diff --git a/testbed/astropy__astropy/.astropy-root b/testbed/astropy__astropy/.astropy-root new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/.gitattributes b/testbed/astropy__astropy/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..054f238026f273797fe3c0b64cf2331692cd0c61 --- /dev/null +++ b/testbed/astropy__astropy/.gitattributes @@ -0,0 +1,3 @@ +*.fits -text +astropy.0.3.windows.cfg eol=crlf +CHANGES.rst merge=union diff --git a/testbed/astropy__astropy/.gitignore b/testbed/astropy__astropy/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d4729a8324b082c0f4b5894ea7d7c0eeec9eb547 --- /dev/null +++ b/testbed/astropy__astropy/.gitignore @@ -0,0 +1,70 @@ +# Compiled files +*.py[cod] +*.a +*.o +*.so +*.pyd +*.dll +__pycache__ + +# Ignore .c files by default to avoid including generated code. If you want to +# add a non-generated .c extension, use `git add -f filename.c`. +*.c + +# Other generated files +MANIFEST +astropy/version.py +astropy/cython_version.py +astropy/wcs/include/wcsconfig.h +astropy/_erfa/core.py + +# Sphinx +_build +_generated +docs/api +docs/generated +docs/visualization/ngc6976.jpeg +docs/visualization/ngc6976-default.jpeg + +# Packages/installer info +*.egg +*.egg-info +dist +build +eggs +.eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +distribute-*.tar.gz +.venv +venv + +# Other +.cache +.tox +.*.swp +.*.swo +*~ +.project +.pydevproject +.settings +.coverage +cover +htmlcov + +# Mac OSX +.DS_Store + +# PyCharm +.idea + +# Pytest +v +.pytest_cache + +# VSCode +.vscode diff --git a/testbed/astropy__astropy/.gitmodules b/testbed/astropy__astropy/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..6a20fa6e5f85364c771035c507c15597913d65c2 --- /dev/null +++ b/testbed/astropy__astropy/.gitmodules @@ -0,0 +1,3 @@ +[submodule "astropy_helpers"] + path = astropy_helpers + url = https://github.com/astropy/astropy-helpers.git diff --git a/testbed/astropy__astropy/.mailmap b/testbed/astropy__astropy/.mailmap new file mode 100644 index 0000000000000000000000000000000000000000..b84867d1b9e435d725354621a38aacad825db53a --- /dev/null +++ b/testbed/astropy__astropy/.mailmap @@ -0,0 +1,178 @@ +Adam Ginsburg +Adam Ginsburg Adam Ginsburg +Adam Ginsburg Adam Ginsburg +Adele Plunkett +Alex Conley Alexander Conley +Alex Conley Alexander Conley +Alex Hagen +Asish Panda +Axel Donath +Bryce Nordgren +Bogdan Nicula +Christopher Bonnett +Christoph Gohlke +Curtis McCully +Daniel Bell Daniel +Daniel Bell stampsrule +Daniel Datsev +Daniel Datsev +David Pérez-Suárez +Demitri Muna +Demitri Muna +Dylan Gregersen +Emma Hogan +Moataz Hisham +Erik M. Bray +Erik M. Bray +Erik M. Bray Erik Bray +Gerrit Schellenberger +Gustavo Bragança +Hans Moritz Günther +Hans Moritz Günther hamogu +James Turner +Jeff Taylor +Kacper Kowalik Kacper Kowalik +Kacper Kowalik Kacper Kowalik (Xarthisius) +Kacper Kowalik Kacper Kowalik (Xarthisius) +Karan Grover +Karl Vyhmeister +Kirill Tchernyshyov +Kelle Cruz +Kevin Gullikson +Leonardo Ferreira [Leonardo Ferreira] <[leonardo.ferreira.furg@gmail.com]> +Lisa Walter +Marten van Kerkwijk +Matt Davis +Nadia Dencheva +Nadia Dencheva +Neil Crighton +Perry Greenfield +Pritish Chakraborty +Ryan Cooke +Shantanu Srivastava +Simon Conseil Simon Conseil +Simon Conseil Simon +Simon Liedtke +Thomas Erben +Thompson Le Blanc +Thompson Le Blanc astrocaribe +Tom Aldcroft +Zach Edwards +Jonathan Foster +David Kirkby +Albert Y. Shih +Aleh Khvalko +Elijah Bernstein-Cooper +Lingyi Hu +Francesco Montesano +Daniel Lenz +Dan P. Cunningham +Joseph Long +Brigitta Sipocz +Rohit Patil QuanTakeuchi +Rohit Patil QuanTakeuchi +Demitri Muna Demitri Muna +Steve Crawford Steven Crawford +Steve Crawford +Anne Archibald Anne Archibald +Stuart Mumford Stuart Mumford +Mihai Cara Mihai Cara +Pey Lian Lim P. L. Lim +Pey Lian Lim P. L. Lim <2090236+pllim@users.noreply.github.com> +Pey Lian Lim Pey Lian Lim <2090236+pllim@users.noreply.github.com> +Jonathan Foster Jonathan Foster +Miguel de Val-Borro Miguel de Val-Borro +Eric Depagne +Pratik Patel +Mavani Bhautik +Aniket Kulkarni +Sara Ogaz +Sourabh Cheedella +Sudheesh Singanamalla +Amit Kumar +Jake VanderPlas Jake VanderPlas +Matthew Craig Matt Craig +Sergio Pascual Sergio Pascual +Laura Watkins Laura L Watkins +Axel Donath Axel Donath +Zé Vinicius Ze Vinicius +Ole Streicher Ole Streicher +Alex Rudy Alexander Rudy +Leo Singer Leo Singer +Anthony Horton +Maneesh Yadav +Esteban Pardo Sánchez +John Parejko John K. Parejko +John Parejko +Pauline Barmby Pauline +Joseph Long +Graham Kanarek +Jurien Huisman +Aarya Patil +Aarya Patil +Ritwick DSouza +Jake VanderPlas +Douglas Burke +Benjamin Alan Weaver +Benjamin Alan Weaver +Asra Nizami +Asra Nizami +Michele Costa +Luke G. Bouma +VSN Reddy Janga +Giorgio Calderone +Tyler Finethy +Sam Verstocken +Mikhail Minin +Matteo Bachetti +Anirudh Katipally +David Shupe +Adrian Price-Whelan +Derek Homeier +Brett Morris +Daniel D'Avella +Daniel D'Avella Dan D'Avella +Stuart Littlefair StuartLittlefair +Juan Luis Cano Rodríguez Juan Luis Cano Rodríguez +Juan Luis Cano Rodríguez Juan Luis Cano Rodríguez +Joe Hunkeler Joseph Hunkeler +Dan Foreman-Mackey Dan F-M +Dan Foreman-Mackey Dan F-M +Johnny Greco Johnny +Zé Vinicius mirca +Michael Seifert --system +Michael Seifert MSeifert04 +Vishnunarayan K I vn-ki +Ritiek Malhotra ritiek +Rohan Rajpal rohanrajpal +Mangala Gowri Krishnamoorthy mangalagb +Hannes Breytenbach astromancer +Hannes Breytenbach apodemus +Christian Clauss cclauss +Eric Koch e-koch +Alexander Bakanov Aleksandr Bakanov +Emily Deibert emilydeibert +Sanjeev Dubey getsanjeev +Humna Awan Humna +Daria Cara unknown +Jani Šumak dasdachs +Alexandre Beelen alexandre beelen +Steve Crawford Steven Crawford +Steve Crawford crawfordsm +Mike Alexandersen Mike Alexandersen (on Vancouver) +Patricio Rojo duckrojo +Ana Posses anaposses +Kyle Oman K.A. Oman +Vital Fernández Delosari +Anany Shrey Jain ananyashreyjain <31594632+ananyashreyjain@users.noreply.github.com> +Joseph Schlitz SG004 +Benjamin Roulston broulston +Himanshu Pathak himanshupathak21061998 +Dan Taranu taranu +Yash Kumar yashkmr99 +Benjamin Winkel bwinkel +Javier Pascual Granado JaviPG +Javier Pascual Granado javier-iaa +Rohit Kapoor algo-circle +Jane Rigby janerigby +Lisa Martin <48742903+lisamartin72@users.noreply.github.com> lisamartin72 <48742903+lisamartin72@users.noreply.github.com> diff --git a/testbed/astropy__astropy/.readthedocs.yml b/testbed/astropy__astropy/.readthedocs.yml new file mode 100644 index 0000000000000000000000000000000000000000..b6e2331bc4d1748e0491d81c7af7e89106857579 --- /dev/null +++ b/testbed/astropy__astropy/.readthedocs.yml @@ -0,0 +1,22 @@ +version: 2 + +build: + image: latest + +# Install regular dependencies. +# Then, install special pinning for RTD. +python: + version: 3.6 + install: + - method: pip + path: . + extra_requirements: + - docs + - all + - requirements: docs/rtd_requirements.txt + +submodules: + include: all + +# Don't build any extra formats +formats: [] diff --git a/testbed/astropy__astropy/.travis.yml b/testbed/astropy__astropy/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..88d64367ca8554b9b39ec460f608eb5a66698442 --- /dev/null +++ b/testbed/astropy__astropy/.travis.yml @@ -0,0 +1,216 @@ +# We set the language to c because python isn't supported on the MacOS X nodes +# on Travis. However, the language ends up being irrelevant anyway, since we +# install Python ourselves using conda. +language: c + +compiler: gcc + +# Cache can be cleared from the travis settings menu, see docs currently at +# https://docs.travis-ci.com/user/caching#Clearing-Caches +cache: + - ccache + +os: + - linux + +stage: Comprehensive tests + +# Setting sudo to false opts in to Travis-CI container-based builds. +sudo: false + +# The apt packages below are needed for sphinx builds, which can no longer +# be installed with sudo apt-get. +addons: + apt: + packages: + - graphviz + - language-pack-de + +env: + global: + # Set defaults to avoid repeating in most cases + - PYTHON_VERSION=3.6 + - NUMPY_VERSION=stable + - PYTEST_VERSION=3.10 + - MAIN_CMD='python setup.py' + - CONDA_DEPENDENCIES='Cython jinja2' + - CONDA_ALL_DEPENDENCIES='Cython jinja2 scipy h5py matplotlib pyyaml pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck' + - DEV_PIP_DEP='asdf>=2.3 Cython jinja2 scipy h5py matplotlib pyyaml scikit-image pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck' + - ASDF_PIP_DEP='asdf>=2.3' + - SETUP_XVFB=True + - EVENT_TYPE='push pull_request' + - SETUP_CMD='test' + - INSTALL_WITH_PIP=False + - EXTRAS_INSTALL="" + + # PEP8 errors/warnings: + # E101 - mix of tabs and spaces + # W191 - use of tabs + # W291 - trailing whitespace + # W292 - no newline at end of file + # W293 - trailing whitespace + # W391 - blank line at end of file + # E111 - 4 spaces per indentation level + # E112 - 4 spaces per indentation level + # E113 - 4 spaces per indentation level + # E502 - the backslash is redundant between brackets + # E722 - do not use bare except + # E901 - SyntaxError or IndentationError + # E902 - IOError + # E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree + # # F821: undefined name # Note: Removed for now because of heavy use of units.si + # F822: undefined name in __all__ + # F823: local variable name referenced before assignment + - FLAKE8_OPT="--select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E502,E722,E901,E902,E999,F822,F823" + +stages: + # Do the style check and a single test job, don't proceed if it fails + - name: Initial tests + # Do the rest of the tests + - name: Comprehensive tests + - name: Cron tests + if: type = cron + +matrix: + + # Don't wait for allowed failures + fast_finish: true + + include: + # Try MacOS X. Use a slightly old numpy version to help test against + # all supported numpy versions. + - os: osx + stage: Cron tests + env: SETUP_CMD='test --remote-data=astropy' + CONDA_DEPENDENCIES="$CONDA_ALL_DEPENDENCIES clang" + PIP_DEPENDENCIES="scikit-image jplephem $ASDF_PIP_DEP" + CCOMPILER=clang + EVENT_TYPE='cron' + + # Try all python versions and Numpy versions. Since we can assume that + # the Numpy developers have taken care of testing Numpy with different + # versions of Python, we can vary Python and Numpy versions at the same + # time. + # Run this test using native pytest + - os: linux + env: PYTHON_VERSION=3.5 NUMPY_VERSION=1.13 + INSTALL_CMD='python setup.py build_ext --inplace' + PIP_DEPENDENCIES='pytest-astropy' + TEST_CMD='pytest --open-files --doctest-rst' + PYTEST_VERSION=3.7 + script: + - $INSTALL_CMD + - $TEST_CMD + + # Now try with all optional dependencies. We also include the --readonly + # flag to make sure no files are being written to the temporary install + # location during testing. We also use this build to make sure that the + # dependencies get correctly installed with pip. + - os: linux + env: SETUP_CMD='test --remote-data=astropy --readonly' + LC_CTYPE=C.ascii LC_ALL=C + PYTEST_VERSION=4.4 + PIP_DEPENDENCIES="" CONDA_DEPENDENCIES="" + INSTALL_WITH_PIP=True + EXTRAS_INSTALL="test,all" + + - os: linux + stage: Initial tests + env: PYTHON_VERSION=3.7 CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES + PIP_DEPENDENCIES="scikit-image $ASDF_PIP_DEP" + SETUP_CMD='test -a "--durations=50"' + compiler: clang + + # Full tests with coverage checks. + - os: linux + env: SETUP_CMD='test --coverage --remote-data=astropy --readonly' + CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES + PIP_DEPENDENCIES="scikit-image codecov objgraph jplephem bintrees sortedcontainers $ASDF_PIP_DEP" + LC_CTYPE=C.ascii LC_ALL=C + CFLAGS='--coverage -fno-inline-functions -O0' + MATPLOTLIB_VERSION=2.1 + EVENT_TYPE='push pull_request cron' + + # Try pre-release version of Numpy without optional dependencies + - os: linux + env: NUMPY_VERSION=prerelease + EVENT_TYPE='push pull_request cron' + + # Do a PEP8/pyflakes test with flake8 + - os: linux + stage: Initial tests + env: MAIN_CMD="flake8 astropy --count $FLAKE8_OPT" SETUP_CMD='' + + # Try developer version of Numpy with optional dependencies and also + # run all remote tests. Since both cases will be potentially + # unstable, we combine them into a single unstable build that we can + # mark as an allowed failure below. + - os: linux + env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data' + CONDA_DEPENDENCIES='' + PIP_DEPENDENCIES=$DEV_PIP_DEP + MATPLOTLIB_VERSION=dev + + # We check numpy-dev also in a job that only runs from cron, so that + # we can spot issues sooner. We do not use remote data here, since + # that gives too many false positives due to URL timeouts. + # We also install all dependencies via pip here so we pick up the latest + # releases. + - os: linux + stage: Cron tests + env: NUMPY_VERSION=dev MATPLOTLIB_VERSION=dev EVENT_TYPE='cron' + CONDA_DEPENDENCIES='' + PIP_DEPENDENCIES=$DEV_PIP_DEP + + # Run documentation link check in a cron job. + # Was originally in CircleCI doc build but links are too flaky, so + # we moved it here instead. + - os: linux + stage: Cron tests + env: SETUP_CMD='build_docs -b linkcheck' + PIP_DEPENDENCIES="" CONDA_DEPENDENCIES="" + INSTALL_WITH_PIP=True + EXTRAS_INSTALL="docs,all" + + allow_failures: + - os: linux + env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data' + CONDA_DEPENDENCIES='' + PIP_DEPENDENCIES=$DEV_PIP_DEP + MATPLOTLIB_VERSION=dev + +before_install: + + # We need to use CCOMPILER otherwise Travis overwrites CC if we define it + # in env: above. + - if [ ! -z $CCOMPILER ]; then + export CC=$CCOMPILER; + fi + + # Check CC variable + - echo $CC + + # Write configuration items to standard location to make sure they are + # ignored (the tests will fail if not) + - mkdir -p $HOME/.astropy/config/ + - printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg + + +install: + - git clone git://github.com/astropy/ci-helpers.git + - source ci-helpers/travis/setup_conda.sh + - if [[ $INSTALL_WITH_PIP == True ]]; then + if [ -z $EXTRAS_INSTALL ]; then + pip install -e .; + else + pip install -e .[$EXTRAS_INSTALL]; + fi + fi + +script: + - $MAIN_CMD $SETUP_CMD + +after_success: + - if [[ $SETUP_CMD == *--coverage* ]]; then + codecov --gcov-glob "*cextern*"; + fi diff --git a/testbed/astropy__astropy/CHANGES.rst b/testbed/astropy__astropy/CHANGES.rst new file mode 100644 index 0000000000000000000000000000000000000000..9cc0c28c2d9681833a5d364cf133b287aa71fd8f --- /dev/null +++ b/testbed/astropy__astropy/CHANGES.rst @@ -0,0 +1,10900 @@ +4.0 (unreleased) +================ + +New Features +------------ + +astropy.config +^^^^^^^^^^^^^^ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Changed ``coordinates.solar_system_ephemeris`` to also accept local files + as input. The ephemeris can now be selected by either keyword (e.g. 'jpl', + 'de430'), URL or file path. [#8767] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.fits +^^^^^^^^^^^^^^^ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +astropy.modeling +^^^^^^^^^^^^^^^^ + +astropy.nddata +^^^^^^^^^^^^^^ + +astropy.samp +^^^^^^^^^^^^ + +astropy.stats +^^^^^^^^^^^^^ + +astropy.table +^^^^^^^^^^^^^ + +astropy.tests +^^^^^^^^^^^^^ + +astropy.time +^^^^^^^^^^^^ + +- ``TimeDelta`` gained a ``to_value`` method, so that it becomes easier to + use it wherever a ``Quantity`` with units of time could be used. [#8762] + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +astropy.uncertainty +^^^^^^^^^^^^^^^^^^^ + +astropy.units +^^^^^^^^^^^^^ + +astropy.utils +^^^^^^^^^^^^^ + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +astropy.wcs +^^^^^^^^^^^ + +API Changes +----------- + +astropy.config +^^^^^^^^^^^^^^ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.fits +^^^^^^^^^^^^^^^ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Changed ``pedantic`` argument to ``verify`` and change it to have three + string-based options (``ignore``, ``warn``, and ``exception``) instead of just + being a boolean. In addition, changed default to ``ignore``, which means + that warnings will not be shown by default when loading VO tables. [#8715] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +astropy.nddata +^^^^^^^^^^^^^^ + +astropy.samp +^^^^^^^^^^^^ + +astropy.stats +^^^^^^^^^^^^^ + +astropy.table +^^^^^^^^^^^^^ + +astropy.tests +^^^^^^^^^^^^^ + +astropy.time +^^^^^^^^^^^^ + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +astropy.uncertainty +^^^^^^^^^^^^^^^^^^^ + +astropy.units +^^^^^^^^^^^^^ + +astropy.utils +^^^^^^^^^^^^^ + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +astropy.wcs +^^^^^^^^^^^ + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.fits +^^^^^^^^^^^^^^^ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +astropy.modeling +^^^^^^^^^^^^^^^^ + +astropy.nddata +^^^^^^^^^^^^^^ + +astropy.samp +^^^^^^^^^^^^ + +astropy.stats +^^^^^^^^^^^^^ + +astropy.table +^^^^^^^^^^^^^ + +astropy.tests +^^^^^^^^^^^^^ + +astropy.time +^^^^^^^^^^^^ + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +astropy.uncertainty +^^^^^^^^^^^^^^^^^^^ + +astropy.units +^^^^^^^^^^^^^ + +astropy.utils +^^^^^^^^^^^^^ + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +astropy.wcs +^^^^^^^^^^^ + +Other Changes and Additions +--------------------------- + +- Matplotlib 2.1 and later is now required. [#8787] + + +3.2.2 (unreleased) +================== + +Bug fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.fits +^^^^^^^^^^^^^^^ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +astropy.modeling +^^^^^^^^^^^^^^^^ + +astropy.nddata +^^^^^^^^^^^^^^ + +astropy.samp +^^^^^^^^^^^^ + +astropy.stats +^^^^^^^^^^^^^ + +astropy.table +^^^^^^^^^^^^^ + +astropy.tests +^^^^^^^^^^^^^ + +astropy.time +^^^^^^^^^^^^ + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +astropy.uncertainty +^^^^^^^^^^^^^^^^^^^ + +astropy.units +^^^^^^^^^^^^^ + +astropy.utils +^^^^^^^^^^^^^ + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +astropy.wcs +^^^^^^^^^^^ + + +Other Changes and Additions +--------------------------- + + +3.2.1 (2019-06-14) +================== + +Bug fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Avoid reporting a warning with ``BinTableHDU.from_columns`` with keywords that + are not provided by the user. [#8838] + +- Fix ``Header.fromfile`` to work on FITS files. [#8713] + +- Fix reading of empty ``BinTableHDU`` when stored in a gzip-compressed file. + [#8848] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a problem where mask was dropped when creating a ``MaskedColumn`` + from a list of ``MaskedArray`` objects. [#8826] + +astropy.wcs +^^^^^^^^^^^ + +- Added ``None`` to be displayed as a ``world_axis_physical_types`` in + the ``WCS`` repr, as ``None`` values are now supported in ``APE14``. [#8811] + + + +3.2 (2019-06-10) +================ + +New Features +------------ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Add CODATA 2018 constants but not make them default because the + redefinition of SI units that will follow has not been implemented + yet. [#8595] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- New ``BarycentricMeanEcliptic``, ``HeliocentricTrueEcliptic`` and + ``GeocentricTrueEcliptic`` frames. + The ecliptic frames are no longer considered experimental. [#8394] + +- The default time scale for epochs like 'J2000' or 'B1975' is now "tt", + which is the correct one for 'J2000' and avoids leap-second warnings + for epochs in the far future or past. [#8600] + +astropy.extern +^^^^^^^^^^^^^^ + +- Bundled ``six`` now emits ``AstropyDeprecationWarning``. It will be removed + in 4.0. [#8323] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- IPAC tables now output data types of ``float`` instead of ``double``, or + ``int`` instead of ``long``, based on the column ``dtype.itemsize``. [#8216] + +- Update handling of MaskedColumn columns when using the 'data_mask' serialization + method. This can make writing ECSV significantly faster if the data do not + actually have any masked values. [#8447] + +- Fixed a bug that caused newlines to be incorrect when writing out ASCII tables + on Windows (they were ``\r\r\n`` instead of ``\r\n``). [#8659] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Implement serialization of ``TimeDelta`` in ASDF. [#8285] + +- Implement serialization of ``EarthLocation`` in ASDF. [#8286] + +- Implement serialization of ``SkyCoord`` in ASDF. [#8284] + +- Support serialization of Astropy tables with mixin columns in ASDF. [#8337] + +- No warnings when reading HDF5 files with only one table and no ``path=`` + argument [#8483] + +- The HDF5 writer will now create a default table instead of raising an + exception when ``path=`` is not specified and when writing to empty/new HDF5 + files. [#8553] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Optimize parsing of cards within the ``Header`` class. [#8428] + +- Optimize the parsing of headers to get the structural keywords that are + needed to find extensions. Thanks to this, getting a random HDU from a file + with many extensions is much faster than before, in particular when the + extension headers contain many keywords. [#8502] + +- Change behavior of FITS undefined value in ``Header`` such that ``None`` + is used in Python to represent FITS undefined when using dict interface. + ``Undefined`` can also be assigned and is translated to ``None``. + Previously setting a header card value to ``None`` resulted in an + empty string field rather than a FITS undefined value. [#8572] + +- Allow ``Header.fromstring`` and ``Card.fromstring`` to accept ``bytes``. + [#8707] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Implement ``Table`` reader and writer for ``ASDF``. [#8261] + +- Implement ``Table`` reader and writer methods to wrap ``pandas`` I/O methods + for CSV, Fixed width format, HTML, and JSON. [#8381] + +- Add ``help()`` and ``list_formats()`` methods to unified I/O ``read`` and + ``write`` methods. For example ``Table.read.help()`` gives help on available + ``Table`` read formats and ``Table.read.help('fits')`` gives detailed + help on the arguments for reading FITS table file. [#8255] + +astropy.table +^^^^^^^^^^^^^ + +- Initializing a table with ``Table(rows=...)``, if the first item is an ``OrderedDict``, + now uses the column order of the first row. [#8587] + +- Added new pprint_all() and pformat_all() methods to Table. These two new + methods print the entire table by default. [#8577] + +- Removed restriction of initializing a Table from a dict with copy=False. [#8541] + +- Improved speed of table row access by a factor of about 2-3. Improved speed + of Table len() by a factor of around 3-10 (depending on the number of columns). + [#8494] + +- Improved the Table - pandas ``DataFrame`` interface (``to_pandas()`` and + ``from_pandas()``). Mixin columns like ``Time`` and ``Quantity`` can now be + converted to pandas by flattening the columns as necessary to plain + columns. ``Time`` and ``TimeDelta`` columns get converted to + corresponding pandas date or time delta types. The ``DataFrame`` + index is now handled in the conversion methods. [#8247] + +- Added ``rename_columns`` method to rename multiple columns in one call. + [#5159, #8070] + +- Improved Table performance by reducing unnecessary calls to copy and deepcopy, + especially as related to the table and column ``meta`` attributes. Changed the + behavior when slicing a table (either in rows or with a list of column names) + so now the sliced output gets a light (key-only) copy of ``meta`` instead of a + deepcopy. Changed the ``Table.meta`` class-level descriptor so that assigning + directly to ``meta``, e.g. ``tbl.meta = new_meta`` no longer does a deepcopy + and instead just directly assigns the ``new_meta`` object reference. Changed + Table initialization so that input ``meta`` is copied only if ``copy=True``. + [#8404] + +- Improved Table slicing performance with internal implementation changes + related to column attribute access and certain input validation. [#8493] + +- Added ``reverse`` argument to the ``sort`` and ``argsort`` methods to allow + sorting in reverse order. [#8528] + +- Improved ``Table.sort()`` performance by removing ``self[keys]`` from code + which is creating deep copies of ``meta`` attribute and adding a new keyword + ``names`` in ``get_index()`` to get index by using a list or tuple containing + names of columns. [#8570] + +- Expose ``represent_mixins_as_columns`` as a public function in the + ``astropy.table`` subpackage. This previously-private function in the + ``table.serialize`` module is used to represent mixin columns in a Table as + one or more plain Column objects. [#7729] + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +- Added a new astropy.timeseries sub-package to represent and manipulate + sampled and binned time series. [#8540] + +- The ``BoxLeastSquares`` and ``LombScargle`` classes have been moved to + ``astropy.timeseries.periodograms`` from ``astropy.stats``. [#8591] + +- Added the ability to provide absolute ``Time`` objects to the + ``BoxLeastSquares`` and ``LombScargle`` periodogram classes. [#8599] + +- Added model inspection methods (``model_parameters()``, ``design_matrix()``, + and ``offset()``) to ``astropy.timeseries.LombScargle`` class [#8397]. + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity`` overrides of ``ndarray`` methods such as ``sum``, ``min``, + ``max``, which are implemented via reductions, have been removed since they + are dealt with in ``Quantity.__array_ufunc__``. This should not affect + subclasses, but they may consider doing similarly. [#8316] Note that this + does not include methods that use more complicated python code such as + ``mean``, ``std`` and ``var``. [#8370] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ +- Added ``CompositeStretch``, which inherits from ``CompositeTransform`` and + also ``BaseStretch`` so that it can be used with ``ImageNormalize``. [#8564] + +- Added a ``log_a`` argument to the ``simple_norm`` method. Similar to the + exposing of the ``asinh_a`` argument for ``AsinhStretch``, the new + ``log_a`` argument is now exposed for ``LogStretch``. [#8436] + +astropy.wcs +^^^^^^^^^^^ + +- WCSLIB was updated to v 6.2. + This adds support for time-related WCS keywords (WCS Paper VII). + FITS headers containing ``Time`` axis are parsed and the axis is included in + the WCS object. [#8592] + +- The ``OBSGEO`` attribute as expanded to 6 members - ``XYZLBH``. [#8592] + +- Added a new class ``SlicedLowLevelWCS`` in ``astropy.wcs.wcsapi`` that can be + used to slice any WCS that conforms to the ``BaseLowLevelWCS`` API. [#8546] + +- Updated implementation of ``WCS.__getitem__`` and ``WCS.slice`` to now return + a ``SlicedLowLevelWCS`` rather than raising an error when reducing the + dimensionality of the WCS. [#8546] + + +API Changes +----------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``QuantityAttribute`` no longer has a default value for ``default``. The + previous value of None was misleading as it always was an error. [#8450] + +- The default J2000 has been changed to use be January 1, 2000 12:00 TT instead + of UTC. This is more in line with convention. [#8594] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- IPAC tables now output data types of ``float`` instead of ``double``, or + ``int`` instead of ``long``, based on the column ``dtype.itemsize``. [#8216] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Unit equivalencies can now be serialized to ASDF. [#8252] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Composition of model classes is deprecated and will be removed in 4.0. + Composition of model instances remain unaffected. [#8234, #8408] + +astropy.stats +^^^^^^^^^^^^^ + +- The ``BoxLeastSquares`` and ``LombScargle`` classes have been moved to the + ``astropy.timeseries.periodograms`` module and will now emit a deprecation + warning when imported from ``astropy.stats``. [#8591] + +astropy.table +^^^^^^^^^^^^^ + +- Converting an empty table to an array using ``as_array`` method now returns + an empty array instead of ``None``. [#8647] + +- Changed the behavior when slicing a table (either in rows or with a list of column + names) so now the sliced output gets a light (key-only) copy of ``meta`` instead of + a deepcopy. Changed the ``Table.meta`` class-level descriptor so that assigning + directly to ``meta``, e.g. ``tbl.meta = new_meta`` no longer does a deepcopy + and instead just directly assigns the ``new_meta`` object reference. Changed + Table initialization so that input ``meta`` is copied only if ``copy=True``. + [#8404] + +- Added a keyword ``names`` in ``Table.as_array()``. If provided this specifies + a list of column names to include for the returned structured array. [#8532] + +astropy.tests +^^^^^^^^^^^^^ + +- Removed ``pytest_plugins`` as they are completely broken for ``pytest>=4``. + [#7786] + +- Removed the ``astropy.tests.plugins.config`` plugin and removed the + ``--astropy-config-dir`` and ``--astropy-cache-dir`` options from + testing. Please use caching functionality that is natively in ``pytest``. + [#7787, #8489] + +astropy.time +^^^^^^^^^^^^ + +- The default time scale for epochs like 'J2000' or 'B1975' is now "tt", + which is the correct one for 'J2000' and avoids leap-second warnings + for epochs in the far future or past. [#8600] + +astropy.units +^^^^^^^^^^^^^ + +- Unit equivalencies can now be introspected. [#8252] + +astropy.wcs +^^^^^^^^^^^ + +- The ``world_to_pixel``, ``world_to_array_index*``, ``pixel_to_world*`` and + ``array_index_to_world*`` methods now all consistently return scalars, arrays, + or objects not wrapped in a one-element tuple/list when only one scalar, + array, or object (as was previously already the case for ``WCS.pixel_to_world`` + and ``WCS.array_index_to_world``). [#8663] + +astropy.utils +^^^^^^^^^^^^^ + +- It is now possible to control the number of cores used by ``ProgressBar.map`` + by passing a positive integer as the ``multiprocess`` keyword argument. Use + ``True`` to use all cores. [#8083] + + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``BarycentricTrueEcliptic``, ``HeliocentricTrueEcliptic`` and + ``GeocentricTrueEcliptic`` now use the correct transformation + (including nutation), whereas the new ``*MeanEcliptic`` classes + use the nutation-free transformation. [#8394] + +- Representations with ``float32`` coordinates can now be transformed, + although the output will always be ``float64``. [#8759] + +- Fixed bug that prevented using differentials with HCRS<->ICRS + transformations. [#8794] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed a bug where an exception was raised when writing a table which includes + mixin columns (e.g. a Quantity column) and the output format was specified + using the ``formats`` keyword. [#8681] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fixed bug in ASDF tag that inadvertently introduced dependency on ``pytest``. + [#8456] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed slowness for certain compound models consisting of large numbers + of multi-input models [#8338, #8349] + +- Fixed bugs in fitting of compound models with units. [#8369] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed bug in reading multi-extension FITS files written by earlier versions + of ``CCDData``. [#8534] + +- Fixed two errors in the way ``CCDData`` handles FITS files with WCS in the + header. Some of the WCS keywords that should have been removed from the + header were not, potentially leading to FITS files with inconsistent + WCS. [#8602] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a bug when initializing from an empty list: ``Table([])`` no longer + results in a crash. [#8647] + +- Fixed a bug when initializing from an existing ``Table``. In this case the + input ``meta`` argument was being ignored. Now the input ``meta``, if + supplied, will be used as the ``meta`` for the new ``Table``. [#8404] + +- Fix the conversion of bytes values to Python ``str`` with ``Table.tolist``. + [#8739] + +astropy.time +^^^^^^^^^^^^ + +- Fixed a number of issues to ensure a consistent output type resulting from + multiplication or division involving a ``TimeDelta`` instance. The output is + now always a ``TimeDelta`` if the result is a time unit (like u.s or u.d), + otherwise it will be a ``Quantity``. [#8356] + +- Multiplication between two ``TimeDelta`` instances is now possible, resulting + in a ``Quantity`` with units of time squared (division already correctly + resulted in a dimensionless ``Quantity``). [#8356] + +- Like for comparisons, addition, and subtraction of ``Time`` instances with + with non-time instances, multiplication and division of ``TimeDelta`` + instances with incompatible other instances no longer immediately raise an + ``UnitsError`` or ``TypeError`` (depending on the other instance), but + rather go through the regular Python mechanism of ``TimeDelta`` returning + ``NotImplemented`` (which will lead to a regular ``TypeError`` unless the + other instance can handle ``TimeDelta``). [#8356] + +- Corrected small rounding errors that could cause the ``jd2`` values in + ``Time`` to fall outside the range of -0.5 to 0.5. [#8763] + +astropy.units +^^^^^^^^^^^^^ + +- Added a ``Quantity.to_string`` method to add flexibility to the string formatting + of quantities. It produces unadorned or LaTeX strings, and accepts two different + sets of delimiters in the latter case: ``inline`` and ``display``. [#8313] + +- Ensure classes that mimic quantities by having a ``unit`` attribute and/or + ``to`` and ``to_value`` methods can be properly used to initialize ``Quantity`` + or set ``Quantity`` instance items. [#8535] + +- Add support for ``<<`` to create logarithmic units. [#8290] + +- Add support for the ``clip`` ufunc, which in numpy 1.17 is used to implement + ``np.clip``. As part of that, remove the ``Quantity.clip`` method under + numpy 1.17. [#8747] + +- Fix parsing of numerical powers in FITS-compatible units. [#8251] + +astropy.wcs +^^^^^^^^^^^ + +- Added a ``PyUnitListProxy_richcmp`` method in ``UnitListProxy`` class to enable + ``WCS.wcs.cunit`` equality testing. It helps to check whether the two instances of + ``WCS.wcs.cunit`` are equal or not by comparing the data members of + ``UnitListProxy`` class [#8480] + +- Fixed ``SlicedLowLevelWCS`` when ``array_shape`` is ``None``. [#8649] + +- Do not attempt to delete repeated distortion keywords multiple times when + loading distortions with ``_read_distortion_kw`` and + ``_read_det2im_kw``. [#8777] + + +Other Changes and Additions +--------------------------- + +- Update bundled expat to 2.2.6. [#8343] + +- Added instructions for uploading releases to Zenodo. [#8395] + +- The bug fixes to the behaviour of ``TimeDelta`` for multiplcation and + division, which ensure that the output is now always a ``TimeDelta`` if the + result is a time unit (like u.s or u.d) and otherwise a ``Quantity``, imply + that sometimes the output type will be different than it was before. [#8356] + +- For types unrecognized by ``TimeDelta``, multiplication and division now + will consistently return a ``TypeError`` if the other instance cannot handle + ``TimeDelta`` (rather than ``UnitsError`` or ``TypeError`` depending on + presumed abilities of the other instance). [#8356] + +- Multiplication between two ``TimeDelta`` instances will no longer result in + an ``OperandTypeError``, but rather result in a ``Quantity`` with units of + time squared (division already correctly resulted in a dimensionless + ``Quantity``). [#8356] + +- Made running the tests insensitive to local user configuration when running + the tests in parallel mode or directly with pytest. [#8727] + +- Added a narrative style guide to the documentation for contributor reference. + [#8588] + +- Ensure we call numpy equality functions in a way that reduces the number + of ``DeprecationWarning``. [#8755] + +Installation +^^^^^^^^^^^^ + +- We now require setuptools 30.3.0 or later to install the core astropy + package. [#8240] + +- We now define groups of dependencies that can be installed with pip, e.g. + ``pip install astropy[all]`` (to install all optional dependencies). [#8198] + + + +3.1.2 (2019-02-23) +================== + +Bug fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Convert the default of ``QuantityAttribute``, thereby catching the error case + case of it being set to None at attribute creation, and giving a more useful + error message in the process. [#8300] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Fix elliptic analytical solution for comoving distance. Only + relevant for non-flat cosmologies without radiation and ``Om0`` > ``Ode0``. + [#8391] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed slowness for certain compound models consisting of large numbers + of multi-input models [#8338, #8349] + +astropy.visualization.wcsaxes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fix a bug that caused an error when passing an array with all values the same + to contour or contourf. [#8321] + +- Fix a bug that caused contour and contourf to return None instead of the + contour set. [#8321] + + +3.1.1 (2018-12-31) +================== + +Bug fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix error when writing out empty table. [#8279] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``fitsdiff --ignore-hdus`` now prints input filenames in the diff report + instead of ````. [#8295] + +astropy.units +^^^^^^^^^^^^^ + +- Ensure correctness of units when raising to a negative power. [#8263] + +- Fix ``with_H0`` equivalency to use the correct direction of + conversion. [#8292] + + + +3.1 (2018-12-06) +================ + +New Features +------------ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- ``convolve`` now accepts any array-like input, not just ``numpy.ndarray`` or + lists. [#7303] + +- ``convolve`` Now raises AstropyUserWarning if nan_treatment='interpolate' and + preserve_nan=False and NaN values are present post convolution. [#8088] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``SkyCoord.from_name`` constructor now has the ability to create + coordinate objects by parsing object catalogue names that have embedded + J-coordinates. [#7830] + +- The new function ``make_transform_graph_docs`` can be used to create a + docstring graph from a custom ``TransformGraph`` object. [#7135] + +- ``KDTree`` for catalog matching is now built with sliding midpoint rule + rather than standard. In code, this means setting ``compact_nodes=False`` + and ``balanced_tree=False`` in ``cKDTree``. The sliding midpoint rule is much + more suitable for catalog matching, and results in 1000x speedup in some + cases. [#7324] + +- Additional information about a site loaded from the Astropy sites registry is + now available in ``EarthLocation.info.meta``. [#7857] + +- Added a ``concatenate_representations`` function to combine coordinate + representation data and any associated differentials. [#7922] + +- ``BaseCoordinateFrame`` will now check for a method named + ``_astropy_repr_in_frame`` when constructing the string forms of attributes. + Allowing any class to control how ``BaseCoordinateFrame`` represents it when + it is an attribute of a frame. [#7745] + +- Some rarely-changed attributes of frame classes are now cached, resulting in + speedups (up to 50% in some cases) when creating new scalar frame or + ``SkyCoord`` objects. [#7949, #5952] + +- Added a ``directional_offset_by`` method to ``SkyCoord`` that computes a new + coordinate given a coordinate, position angle, and angular separation [#5727] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ +- The default cosmology has been changed from ``WMAP9`` to ``Planck15``. [#8123] + +- Distance calculations with ``LambaCDM`` with no radiation (T_CMB0=0) + are now 20x faster by using elliptic integrals for non-flat cases. [#7155] + +- Distance calculations with ``FlatLambaCDM`` with no radiation (T_CMB0=0) + are now 20x faster by using the hypergeometric function solution + for this special case. [#7087] + +- Age calculations with ``FlatLambdaCDM`` with no radiation (Tcmb0=0) + are now 1000x faster by using analytic solutions instead of integrating. + [#7117] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Latex reader now ignores ``\toprule``, ``\midrule``, and ``\bottomrule`` + commands. [#7349] + +- Added the RST (Restructured-text) table format and the fast version of the + RDB reader to the set of formats that are guessed by default. [#5578] + +- The read trace (used primarily for debugging) now includes guess argument + sets that were skipped entirely e.g. for not supporting user-supplied kwargs. + All guesses thus removed from ``filtered_guess_kwargs`` are now listed as + "Disabled" at the beginning of the trace. [#5578] + +- Emit a warning when reading an ECSV file without specifying the ``format`` + and without PyYAML installed. Previously this silently fell through to + parsing as a basic format file and the file metadata was lost. [#7580] + +- Optionally allow writing masked columns to ECSV with the mask explicitly + specified as a separate column instead of marking masked elements with "" + (empty string). This allows handling the case of a masked string column + with "" data rows. [#7481] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Added support for saving all representation classes and many coordinate + frames to the asdf format. [#7079] + +- Added support for saving models with units to the asdf format. [#7237] + +- Added a new ``character_as_bytes`` keyword to the HDF5 Table reading + function to control whether byte string columns in the HDF5 file + are left as bytes or converted to unicode. The default is to read + as bytes (``character_as_bytes=True``). [#7024, #8017] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``HDUList.pop()`` now accepts string and tuple extension name + specifications. [#7236] + +- Add an ``ignore_hdus`` keyword to ``FITSDiff`` to allow ignoring HDUs by + NAME when diffing two FITS files [#7538] + +- Optionally allow writing masked columns to FITS with the mask explicitly + specified as a separate column instead of using the FITS standard of + certain embedded null values (``NaN`` for float, ``TNULL`` for integers). + This can be used to work around limitations in the FITS standard. [#7481] + +- All time coordinates can now be written to and read from FITS binary tables, + including those with vectorized locations. [#7430] + +- The ``fitsheader`` command line tool now supports a ``dfits+fitsort`` mode, + and the dotted notation for keywords (e.g. ``ESO.INS.ID``). [#7240] + +- Fall back to reading arrays using mode='denywrite' if mode='readonly' fails + when using memory-mapping. This solves cases on some platforms when the + available address space was less than the file size (even when using memory + mapping). [#7926] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Add a ``Multiply`` model which preserves unit through evaluate, unlike + ``Scale`` which is dimensionless. [#7210] + +- Add a ``uses_quantity`` property to ``Model`` which allows introspection of if + the ``Model`` can accept ``Quantity`` objects. [#7417] + +- Add a ``separability_matrix`` function which returns the correlation matrix + of inputs and outputs. [#7803] + +- Fixed compatibility of ``JointFitter`` with the latest version of Numpy. [#7984] + +- Add ``prior`` and ``posterior`` constraints to modeling parameters. These are + not used by any current fitters, but are provided to allow user code to + experiment with Bayesian fitters. [#7558] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``NDUncertainty`` objects now have a ``quantity`` attribute for simple + conversion to quantities. [#7704] + +- Add a ``bitmask`` module that provides functions for manipulating bitmasks + and data quality (DQ) arrays. [#7944] + +astropy.stats +^^^^^^^^^^^^^ + +- Add an ``astropy.stats.bls`` module with an implementation of the "box least + squares" periodogram that is commonly used for discovering transiting + exoplanets and eclipsing binaries. [#7391] + +astropy.table +^^^^^^^^^^^^^ + +- Added support for full use of ``Time`` mixin column for join, hstack, and + vstack table operations. [#6888] + +- Added a new table index engine, ``SCEngine``, based on the Sorted Containers + package. [#7574] + +- Add a new keyword argument ``serialize_method`` to ``Table.write`` to + control how ``Time`` and ``MaskedColumn`` columns are written. [#7481] + +- Allow mixin columns to be used in table ``group`` and ``unique`` + functions. This applies to both the key columns and the other data + columns. [#7712] + +- Added support for stacking ``Column``, mixin column (e.g. ``Quantity``, + ``Time``) or column-like objects. [#7674] + +- Added support for inserting a row into a Table that has ``Time`` or + ``TimeDelta`` column(s). [#7897] + +astropy.tests +^^^^^^^^^^^^^ + +- Added an option ``--readonly`` to the test command to change the + permissions on the temporary installation location to read-only. [#7598] + +astropy.time +^^^^^^^^^^^^ + +- Allow array-valued ``Time`` object to be modified in place. [#6028] + +- Added support for missing values (masking) to the ``Time`` class. [#6028] + +- Added supper for a 'local' time scale (for free-running clocks, etc.), + and round-tripping to the corresponding FITS time scale. [#7122] + +- Added `datetime.timedelta` format class for ``TimeDelta``. [#7441] + +- Added ``strftime`` and ``strptime`` methods to ``Time`` class. + These methods are similar to those in the Python standard library + `time` package and provide flexible input and output formatting. [#7323] + +- Added ``datetime64`` format to the ``Time`` class to support working with + ``numpy.datetime64`` dtype arrays. [#7361] + +- Add fractional second support for ``strftime`` and ``strptime`` methods + of ``Time`` class. [#7705] + +- Added an ``insert`` method to allow inserting one or more values into a + ``Time`` or ``TimeDelta`` object. [#7897] + +- Remove timescale from string version of FITS format time string. + The timescale is not part of the FITS standard and should not be included. + This change may cause some compatibility issues for code that relies on + round-tripping a FITS format string with a timescale. Strings generated + from previous versions of this package are still understood but a + DeprecationWarning will be issued. [#7870] + +astropy.uncertainty +^^^^^^^^^^^^^^^^^^^ + +- This sub-package was added as a "preview" (i.e. API unstable), containing + the ``Distribution`` class and associated convenience functions. [#6945] + +astropy.units +^^^^^^^^^^^^^ + +- Add complex numbers support for ``Quantity._repr_latex_``. [#7676] + +- Add ``thermodynamic_temperature`` equivalency to convert between + Jy/sr and "thermodynamic temperature" for cosmology. [#7054] + +- Add millibar unit. [#7863] + +- Add maggy and nanomaggy unit, as well as associated ``zero_point_flux`` + equivalency. [#7891] + +- ``AB`` and ``ST`` are now enabled by default, and have alternate names + ``ABflux`` and ``STflux``. [#7891] + +- Added ``littleh`` unit and associated ``with_H0`` equivalency. [#7970] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Added ``imshow_norm`` function, which combines imshow and creation of a + ``ImageNormalize`` object. [#7785] + +astropy.visualization.wcsaxes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Add support for setting ``set_separator(None)`` in WCSAxes to use default + separators. [#7570] + +- Added two keyword argument options to ``CoordinateHelper.set_format_unit``: + ``decimal`` can be used to specify whether to use decimal formatting for the + labels (by default this is False for degrees and hours and True otherwise), + and ``show_decimal_unit`` can be used to determine whether the units should be + shown for decimal labels. [#7318] + +- Added documentation for ``transform=`` and ``coord_meta=``. [#7698] + +- Allow ``coord_meta=`` to optionally include ``format_unit=``. [#7848] + +- Add support for more rcParams related to the grid, ticks, and labels, and + should work with most built-in Matplotlib styles. [#7961] + +- Improved rendering of outward-facing ticks. [#7961] + +- Add support for ``tick_params`` (which is a standard Matplotlib + function/method) on both the ``WCSAxes`` class and the individual + ``CoordinateHelper`` classes. Note that this is provided for compatibility + with Matplotlib syntax users may be familiar with, but it is not the + preferred way to change settings. Instead, methods such as ``set_ticks`` + should be preferred. [#7969] + +- Moved the argument ``exclude_overlapping`` from ``set_ticks`` to + ``set_ticklabel``. [#7969] + +- Added a ``pad=`` argument to ``set_ticklabel`` to provide a way to control + the padding between ticks and tick labels. [#7969] + +- Added support for setting the tick direction in ``set_ticks`` using the + ``direction=`` keyword argument. [#7969] + +astropy.wcs +^^^^^^^^^^^ + +- Map ITRS frames to terrestrial WCS coordinates. This will make it possible to + use WCSAxes to make figures that combine both celestial and terrestrial + features. An example is plotting the coordinates of an astronomical transient + over an all- sky satellite image to illustrate the position relative to the + Earth at the time of the event. The ITRS frame is identified with WCSs that + use the ``TLON-`` and ``TLAT-`` coordinate types. There are several examples + of WCSs where this syntax is used to describe terrestrial coordinate systems: + Section 7.4.1 of `WCS in FITS "Paper II" `_ + and the `WCSTools documentation `_. + [#6990] + +- Added the abstract base class for the low-level WCS API described in APE 14 + (https://doi.org/10.5281/zenodo.1188875). [#7325] + +- Add ``WCS.footprint_contains()`` function to check if the WCS footprint contains a given sky coordinate. [#7273] + +- Added the abstract base class for the high-level WCS API described in APE 14 + (https://doi.org/10.5281/zenodo.1188875). [#7325] + +- Added the high-level wrapper class for low-level WCS objects as described in + APE 14 (https://doi.org/10.5281/zenodo.1188875). [#7326] + +- Added a new property ``WCS.has_distortion``. [#7326] + +- Deprecated ``_naxis1`` and ``_naxis2`` in favor of ``pixel_shape``. [#7973] + +- Added compatibility to wcslib version 6. [#8093] + + +API Changes +----------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- ``kernel`` can now be a tuple. [#7561] + +- Not technically an API changes, however, the doc string indicated that ``boundary=None`` + was the default when actually it is ``boundary='fill'``. The doc string has been corrected, + however, someone may interpret this as an API change not realising that nothing has actually + changed. [#7293] + +- ``interpolate_replace_nans()`` can no longer accept the keyword argument + ``preserve_nan``. It is explicitly set to ``False``. [#8088] + + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed ``astropy.coordinates.concatenate`` to include velocity data in the + concatenation. [#7922] + +- Changed the name of the single argument to ``Frame.realize_frame()`` from the + (incorrect) ``representation_type`` to ``data``. [#7923] + +- Negative parallaxes passed to ``Distance()`` now raise an error by default + (``allow_negative=False``), or are converted to NaN values with a warning + (``allow_negative=True``). [#7988] + +- Negating a ``SphericalRepresentation`` object now changes the angular + coordinates (by rotating 180º) instead of negating the distance. [#7988] + +- Creation of new frames now generally creates copies of frame attributes, + rather than inconsistently either copying or making references. [#8204] + +- The frame class method ``is_equivalent_frame`` now checks for equality of + components to determine if a frame is the same when it has frame attributes + that are representations, rather than checking if they are the same + object. [#8218] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- If a fast reader is explicitly selected (e.g. ``fast_reader='force'``) and + options which are incompatible with the fast reader are provided + (e.g. ``quotechar='##'``) then now a ``ParameterError`` exception will be + raised. [#5578] + +- The fast readers will now raise ``InconsistentTableError`` instead of + ``CParserError`` if the number of data and header columns do not match. + [#5578] + +- Changed a number of ``ValueError`` exceptions to ``InconsistentTableError`` + in places where the exception is related to parsing a table which is + inconsistent with the specified table format. Note that + ``InconsistentTableError`` inherits from ``ValueError`` so no user code + changes are required. [#7425] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``fits.table_to_hdu()`` function will translate any column ``format`` + attributes to a TDISPn format string, if possible, and store it as a TDISPn + keyword in the ``HDU`` header. [#7226] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Change the order of the return values from ``FittingWithOutlierRemoval``, + such that ``fitted_model`` comes first, for consistency with other fitters. + For the second value, return only a boolean outlier ``mask``, instead of the + previous ``MaskedArray`` (which included a copy of the input data that was + both redundant and inadvertently corrupted at masked points). Return a + consistent type for the second value when ``niter=0``. [#7407] + +- Set the minimum value for the ``bolometric_flux`` parameter of the + ``BlackBody1D`` model to zero. [#7045] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Add two new uncertainty classes, ``astropy.nddata.VarianceUncertainty`` and + ``astropy.nddata.InverseVariance``. [#6971] + +astropy.stats +^^^^^^^^^^^^^ + +- String values can now be used for the ``cenfunc`` and ``stdfunc`` + keywords in the ``SigmaClip`` class and ``sigma_clip`` and + ``sigma_clipped_stats`` functions. [#7478] + +- The ``SigmaClip`` class and ``sigma_clip`` and + ``sigma_clipped_stats`` functions now have a ``masked`` keyword, + which can be used to return either a masked array (default) or an + ndarray with the min/max values. [#7478] + +- The ``iters`` keyword has been renamed (and deprecated) to + ``maxiters`` in the ``SigmaClip`` class and ``sigma_clip`` and + ``sigma_clipped_stats`` functions. [#7478] + +astropy.table +^^^^^^^^^^^^^ + +- ``Table.read()`` on a FITS binary table file will convert any TDISPn header + keywords to a Python formatting string when possible, and store it in the + column ``format`` attribute. [#7226] + +- No values provided to stack will now raise ``ValueError`` rather than + ``TypeError``. [#7674] + +astropy.tests +^^^^^^^^^^^^^ + +- ``from astropy.tests.helper import *`` no longer includes + ``quantity_allclose``. However, + ``from astropy.tests.helper import quantity_allclose`` would still work. + [#7381] + +- ``warnings_to_ignore_by_pyver`` option in + ``enable_deprecations_as_exceptions()`` now takes ``None`` as key. + Any deprecation message that is mapped to ``None`` will be ignored + regardless of the Python version. [#7790] + +astropy.time +^^^^^^^^^^^^ + +- Added the ability to use ``local`` as time scale in ``Time`` and + ``TimeDelta``. [#6487] + +- Comparisons, addition, and subtraction of ``Time`` instances with non-time + instances will now return ``NotImplemented`` rather than raise the + ``Time``-specific ``OperandTypeError``. This will generally lead to a + regular ``TypeError``. As a result, ``OperandTypeError`` now only occurs if + the operation is between ``Time`` instances of incompatible type or scale. + [#7584] + +astropy.units +^^^^^^^^^^^^^ + +- In ``UnitBase.compose()``, if a sequence (list|tuple) is passed in to + ``units``, the default for ``include_prefix_units`` is set to + `True`, so that no units get ignored. [#6957] + +- Negative parallaxes are now converted to NaN values when using the + ``parallax`` equivalency. [#7988] + +astropy.utils +^^^^^^^^^^^^^ + +- ``InheritDocstrings`` now also works on class properties. [#7166] + +- ``diff_values()``, ``report_diff_values()``, and ``where_not_allclose()`` + utility functions are moved from ``astropy.io.fits.diff``. [#7444] + +- ``invalidate_caches()`` has been removed from the + ``astropy.utils.compat`` namespace, use it directly from ``importlib``. [#7872] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- In ``ImageNormalize``, the default for ``clip`` is set to ``True``. [#7800] + +- Changed ``AsymmetricPercentileInterval`` and ``MinMaxInterval`` to + ignore NaN values in arrays. [#7360] + +- Automatically default to using ``grid_type='contours'`` in WCSAxes when using + a custom ``Transform`` object if the transform has no inverse. [#7847] + + +Performance Improvements +------------------------ + +- Reduced import time by more cautious use of the standard library. [#7647] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Major performance overhaul to ``convolve()``. [#7293] + +- ``convolve()``: Boundaries ``fill``, ``extend``, and ``wrap`` now use a single + implementation that pads the image with the correct boundary values before convolving. + The runtimes of these three were significantly skewed. They now have + equivalent runtimes that are also faster than before due to performant contiguous + memory access. However, this does increase the memory footprint as an entire + new image array is required plus that needed for the padded region.[#7293] + +- ``convolve()``: Core computation ported from Cython to C. Several optimization + techniques have been implemented to achieve performance gains, e.g. compiler + hoisting, and vectorization, etc. Compiler optimization level ``-O2`` required for + hoisting and ``-O3`` for vectorization. [#7293] + +- ``convolve()``: ``nan_treatment=‘interpolate’`` was slow to compute irrespective of + whether any NaN values exist within the array. The input array is now + checked for NaN values and interpolation is disabled if non are found. This is a + significant performance boost for arrays without NaN values. [#7293] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Sped up creating SkyCoord objects by a factor of ~2 in some cases. [#7615] + +- Sped up getting xyz vectors from ``CartesianRepresentation`` (which + is used a lot internally). [#7638] + +- Sped up transformations and some representation methods by replacing + python code with (compiled) ``erfa`` ufuncs. [#7639] + +- Sped up adding differential (velocity) data to representations by a factor of + ~20, which improves the speed of frame and SkyCoord initialization. [#7924] + +- Refactored ``SkyCoord`` initializer to improve performance and code clarity. + [#7958] + +- Sped up initialization of ``Longitude`` by ~40%. [#7616] + +astropy.stats +^^^^^^^^^^^^^ + +- The ``SigmaClip`` class and ``sigma_clip`` and + ``sigma_clipped_stats`` functions are now significantly faster. [#7478] + +- A Cython implementation for `astropy.stats.kuiper_two` and a vectorized + implementation for `astropy.stats.kuiper_false_positive_probability` have + been added, speeding up both functions. [#8104] + +astropy.units +^^^^^^^^^^^^^ + +- Sped up creating new composite units, and raising units to some power + [#7549, #7649] + +- Sped up Unit.to when target unit is the same as the original unit. [#7643] + +- Lazy-load ``scipy.special`` to shorten ``astropy.units`` import time. [#7636] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Significantly sped up drawing of contours in WCSAxes. [#7568] + + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fixed bug in ``convolve_fft`` where masked input was copied with + ``numpy.asarray`` instead of ``numpy.asanyarray``. + ``numpy.asarray`` removes the mask subclass causing + ``numpy.ma.ismasked(input)`` to fail, causing ``convolve_fft`` + to ignore all masked input. [#8137] + +- Remove function side-effects of input data from ``convolve_fft``. + It was possible for input data to remain modified if particular exceptions + were raised. [#8152] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``EarthLocation.of_address`` now uses the OpenStreetMap geocoding API by + default to retrieve coordinates, with the Google API (which now requires an + API key) as an option. [#7918] + +- Fixed a bug that caused frame objects with NaN distances to have NaN sky + positions, even if valid sky coordinates were specified. [#7988] + +- Fixed ``represent_as()`` to not round-trip through cartesian if the same + representation class as the instance is passed in. [#7988] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed a problem when ``guess=True`` that ``fast_reader`` options + could be dropped after the first fast reader class was tried. [#5578] + +- Units in CDS-formatted tables are now parsed correctly by the units + module. [#7348] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fixed bug when writing a table with masked columns to HDF5. Previously + the mask was being silently dropped. If the ``serialize_meta`` option is + enabled the data mask will now be written as an additional column and the + masked columns will round-trip correctly. [#7481] + +- Fixed a bug where writing to HDF5 failed for for tables with columns of + unicode strings. Now those columns are first encoded to UTF-8 and + written as byte strings. [#7024, #8017] + +- Fixed a bug with serializing the bounding_box of models initialized + with ``Quantities`` . [#8052] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Added support for ``copy.copy`` and ``copy.deepcopy`` for ``HDUList``. [#7218] + +- Override ``HDUList.copy()`` to return a shallow HDUList instance. [#7218] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fix behaviour of certain models with units, by making certain unit-related + attributes readonly. [#7210] + +- Fixed an issue with validating a ``bounding_box`` whose items are + ``Quantities``. [#8052] + +- Fix ``Moffat1D`` and ``Moffat2D`` derivatives. [#8108] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed rounding behavior in ``overlap_slices`` for even-sized small + arrays. [#7859] + +- Added support for pickling ``NDData`` instances that have an uncertainty. + [#7383] + +astropy.stats +^^^^^^^^^^^^^ + +- Fix errors in ``kuiper_false_positive_probability``. [#7975] + +astropy.tests +^^^^^^^^^^^^^ + +- Fixing bug that prevented to run the doctests on only a single rst documentation + file rather than all of them. [#8055] + +astropy.time +^^^^^^^^^^^^ + +- Fix a bug when setting a ``TimeDelta`` array item with plain float value(s). + This was always interpreted as a JD (day) value regardless of the + ``TimeDelta`` format. [#7990] + +astropy.units +^^^^^^^^^^^^^ + +- To simplify fast creation of ``Quantity`` instances from arrays, one can now + write ``array << unit`` (equivalent to ``Quantity(array, unit, copy=False)``). + If ``array`` is already a ``Quantity``, this will convert the quantity to the + requested units; in-place conversion can be done with ``quantity <<= unit``. + [#7734] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed a bug due to which ``report_diff_values()`` was reporting incorrect + number of differences when comparing two ``numpy.ndarray``. [#7470] + +- The download progress bar is now only displayed in terminals, to avoid + polluting piped output. [#7577] + +- Ignore URL mirror caching when there is no internet. [#8163] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Right ascension coordinates are now shown in hours by default, and the + ``set_format_unit`` method on ``CoordinateHelper`` now works correctly + with angle coordinates. [#7215] + + +Other Changes and Additions +--------------------------- + +- The documentation build now uses the Sphinx configuration from sphinx-astropy + rather than from astropy-helpers. [#7139] + +- Versions of Numpy <1.13 are no longer supported. [#7058] + +- Running tests now suppresses the output of the installation stage by default, + to allow easier viewing of the test results. To re-enable the output as + before, use ``python setup.py test --verbose-install``. [#7512] + +- The ERFA functions are now wrapped in ufuncs instead of custom C code, + leading to some speed improvements, and setting the stage for allowing + overrides with ``__array_ufunc__``. [#7502] + +- Updated the bundled CFITSIO library to 3.450. See + ``cextern/cfitsio/docs/changes.txt`` for additional information. [#8014] + +- The ``representation`` keywords in coordinate frames are now deprecated in + favor of the ``representation_type`` keywords (which are less + ambiguously named). [#8119] + + + +3.0.5 (2018-10-14) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed bug in which consecutive ``StaticMatrixTransform``'s in a frame + transform path would be combined in the incorrect order. [#7707] + +astropy.tests +^^^^^^^^^^^^^ + +- Fixing bug that doctests were not picked up from the narrative + documentation when tests were run for all modules. [#7767] + + + +3.0.4 (2018-08-02) +================== + +API Changes +----------- + +astropy.table +^^^^^^^^^^^^^ + +- The private ``_parent`` attribute in the ``info`` attribute of table + columns was changed from a direct reference to the parent column to a weak + reference. This was in response to a memory leak caused by having a + circular reference cycle. This change means that expressions like + ``col[3:5].info`` will now fail because at the point of the ``info`` + property being evaluated the ``col[3:5]`` weak reference is dead. Instead + force a reference with ``c = col[3:5]`` followed by + ``c.info.indices``. [#6277, #7448] + + +Bug Fixes +--------- + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed an bug when creating the ``WCS`` of a cutout (see ``nddata.Cutout2D``) + when input image's ``WCS`` contains ``SIP`` distortion corrections by + adjusting the ``crpix`` of the ``astropy.wcs.Sip`` (in addition to + adjusting the ``crpix`` of the ``astropy.wcs.WCS`` object). This bug + had the potential to produce large errors in ``WCS`` coordinate + transformations depending on the position of the cutout relative + to the input image's ``crpix``. [#7556, #7550] + +astropy.table +^^^^^^^^^^^^^ + +- Fix memory leak where updating a table column or deleting a table + object was not releasing the memory due to a reference cycle + in the column ``info`` attributes. [#6277, #7448] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed an bug when creating the ``WCS`` slice (see ``WCS.slice()``) + when ``WCS`` contains ``SIP`` distortion corrections by + adjusting the ``WCS.sip.crpix`` in addition to adjusting + ``WCS.wcs.crpix``. This bug had the potential to produce large errors in + ``WCS`` coordinate transformations depending on the position of the slice + relative to ``WCS.wcs.crpix``. [#7556, #7550] + + +Other Changes and Additions +--------------------------- + +- Updated bundled wcslib to v 5.19.1 [#7688] + + +3.0.3 (2018-06-01) +================== + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix stripping correct (header) comment line from ``meta['comments']`` + in the ``CommentedHeader`` reader for all ``header_start`` settings. [#7508] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Raise error when attempting to open gzipped FITS file in 'append' mode. + [#7473] + +- Fix a bug when writing to FITS a table that has a column description + with embedded blank lines. [#7482] + +astropy.tests +^^^^^^^^^^^^^ + +- Enabling running tests for multiple packages when specified comma + separated. [#7463] + + +3.0.2 (2018-04-23) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Computing a 3D separation between two ``SkyCoord`` objects (with the + ``separation_3d`` method) now works with or without velocity data attached to + the objects. [#7387] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fix validate with xmllint=True. [#7255, #7283] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- ``FittingWithOutlierRemoval`` now handles model sets, as long as the + underlying fitter supports masked values. [#7199] + +- Remove assumption that ``model_set_axis == 0`` for 2D models in + ``LinearLSQFitter``. [#7317, #7199] + +- Fix the shape of the outputs when a model set is evaluated with + ``model_set_axis=False`` . [#7317] + +astropy.stats +^^^^^^^^^^^^^ + +- Accept a tuple for the ``axis`` parameter in ``sigma_clip``, like the + underlying ``numpy`` functions and some other functions in ``stats``. [#7199] + +astropy.tests +^^^^^^^^^^^^^ + +- The function ``quantity_allclose`` was moved to the ``units`` package with + the new, shorter name ``allclose``. This eliminates a runtime dependency on + ``pytest`` which was causing issues for some affiliated packages. The old + import will continue to work but may be deprecated in the future. [#7252] + +astropy.units +^^^^^^^^^^^^^ + +- Added a units-aware ``allclose`` function (this was previously available in + the ``tests`` module as ``quantity_allclose``). To complement ``allclose``, + a new ``isclose`` function is also added and backported. [#7252] + + +3.0.1 (2018-03-12) +================== + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a unicode decode error when reading a table with non-ASCII characters. + The fast C reader cannot handle unicode so the code now uses the pure-Python + reader in this case. [#7103] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Updated the bundled CFITSIO library to 3.430. This is to remedy a critical + security vulnerability that was identified by NASA. See + ``cextern/cfitsio/docs/changes.txt`` for additional information. [#7274] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Make sure that a sufficiently recent version of ASDF is installed when + running test suite against ASDF tags and schemas. [#7205] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Fix reading files with serialized metadata when using a Table subclass. [#7213] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fix lookup fields by ID. [#7208] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fix model set evaluation over common input when model_set_axis > 0. [#7222] + +- Fixed the evaluation of compound models with units. This required adding the + ability to have ``input_units_strict`` and ``input_units_allow_dimensionless`` + be dictionaries with input names as keys. [#6952] + +astropy.units +^^^^^^^^^^^^^ + +- ``quantity_helper`` no longer requires ``scipy>=0.18``. [#7219] + + +3.0 (2018-02-12) +================ + +New Features +------------ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- New context manager ``set_enabled_constants`` to temporarily use an older + version. [#7008] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``Distance`` object now accepts ``parallax`` as a keyword in the + initializer, and supports retrieving a parallax (as an ``Angle``) via + the ``.parallax`` attributes. [#6855] + +- The coordinate frame classes (subclasses of ``BaseCoordinateFrame``) now + always have ``.velocity``, ``.proper_motion``, and ``.radial_velocity`` + properties that provide shorthands to the full-space Cartesian velocity as + a ``CartesianDifferential``, the 2D proper motion as a ``Quantity``, and the + radial or line-of-sight velocity as a ``Quantity``. [#6869] + +- ``SkyCoord`` objects now support storing and tranforming differentials - i.e., + both radial velocities and proper motions. [#6944] + +- All frame classes now automatically get sensible representation mappings for + velocity components. For example, ``d_x``, ``d_y``, ``d_z`` are all + automatically mapped to frame component namse ``v_x``, ``v_y``, ``v_z``. + [#6856] + +- ``SkyCoord`` objects now support updating the position of a source given its + space motion and a new time or time difference. [#6872] + +- The frame classes now accept a representation class or differential class, or + string names for either, through the keyword arguments ``representation_type`` + and ``differential_type`` instead of ``representation`` and + ``differential_cls``. [#6873] + +- The frame classes (and ``SkyCoord``) now give more useful error messages when + incorrect attribute names are given. Instead of using the representation + attribute names, they use the frame attribute names. [#7106] + +- ``EarthLocation`` now has a method to compute the gravitational redshift due + due to solar system bodies. [#6861, #6935] + +- ``EarthLocation`` now has a ``get_gcrs`` convenience method to get the + location in GCRS coordinates. [#6861, #6935] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Expanded the FITS ``Column`` interface to accept attributes pertaining to the FITS + World Coordinate System, which includes spatial(celestial) and time coordinates. [#6359] + +- Added ``ver`` attribute to set the ``EXTVER`` header keyword to ``ImageHDU`` + and ``TableHDU``. [#6454] + +- The performance for reading FITS tables has been significantly improved, + in particular for cases where the tables contain one or more string columns + and when done through ``Table.read``. [#6821] + +- The performance for writing tables from ``Table.write`` has now been + significantly improved for tables containing one or more string columns. [#6920] + +- The ``Table.read`` now supports a ``memmap=`` keyword argument to control + whether or not to use memory mapping when reading the table. [#6821] + +- When reading FITS tables with ``fits.open``, a new keyword argument + ``character_as_bytes`` can be passed - when set to `True`, character columns + are returned as Numpy byte arrays (Numpy type S) while when set to `False`, + the same columns are decoded to Unicode strings (Numpy type U) which uses more + memory. [#6821] + +- The ``table_to_hdu`` function and the ``BinTableHDU.from_columns`` and + ``FITS_rec.from_columns`` methods now include a ``character_as_bytes`` + keyword argument - if set to `True`, then when string columns are accessed, + byte columns will be returned, which can provide significantly improved + performance. [#6920] + +- Added support for writing and reading back a table which has "mixin columns" + such as ``SkyCoord`` or ``EarthLocation`` with no loss of information. [#6912] + +- Enable tab-completion for ``FITS_rec`` column names and ``Header`` keywords + with IPython 5 and later. [#7071] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- When writing to HDF5 files, the serialized metadata are now saved in a new + dataset, instead of the HDF5 dataset attributes. This allows for metadata of + any dimensions. [#6304] + +- Added support in HDF5 for writing and reading back a table which has "mixin + columns" such as ``SkyCoord`` or ``EarthLocation`` with no loss of + information. [#7007] + +- Add implementations of astropy-specific ASDF tag types. [#6790] + +- Add ASDF tag and schema for ICRSCoord. [#6904] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Add unit support for tabular models. [#6529] + +- A ``deepcopy()`` method was added to models. [#6515] + +- Added units support to ``AffineTransformation``. [#6853] + +- Added ``is_separable`` function to modeling to test the + separability of a model. [#6746] + +- Added ``Model.separable`` property. It returns a boolean value or + ``None`` if not set. [#6746] + +- Support masked array values in ``LinearLSQFitter`` (instead of silently + ignorning the mask). [#6927] + +astropy.stats +^^^^^^^^^^^^^ + +- Added false alarm probability computation to ``astropy.stats.LombScargle`` + [#6488] + +- Implemented Kuiper functions in ``astropy.stats`` [#3724, #6565] + +astropy.table +^^^^^^^^^^^^^ + +- Added support for reading and writing ``astropy.time.Time`` Table columns + to and from FITS tables, to the extent supported by the FITS standard. [#6176] + +- Improved exception handling and error messages when column ``format`` + attribute is incorrect for the column type. [#6385] + +- Allow to pass ``htmldict`` option to the jsviewer writer. [#6551] + +- Added new table operation ``astropy.table.setdiff`` that returns the set + difference of table rows for two tables. [#6443] + +- Added support for reading time columns in FITS compliant binary tables + as ``astropy.time.Time`` Table columns. [#6442] + +- Allowed to remove table rows through the ``__delitem__`` method. [#5839] + +- Added a new ``showtable`` command-line script to view binary or ASCII table + files. [#6859] + +- Added new table property ``astropy.table.Table.loc_indices`` that returns the + location of rows by indexes. [#6831] + +- Allow updating of table by indices through the property ``astropy.table.Table.loc``. [#6831] + +- Enable tab-completion for column names with IPython 5 and later. [#7071] + +- Allow getting and setting a table Row using multiple column names. [#7107] + +astropy.tests +^^^^^^^^^^^^^ + +- Split pytest plugins into separate modules. Move remotedata, openfiles, + doctestplus plugins to standalone repositories. [#6384, #6606] + +- When testing, astropy (or the package being tested) is now installed to + a temporary directory instead of copying the build. This allows + entry points to work correctly. [#6890] + +- The tests_require setting in setup.py now works properly when running + 'python setup.py test'. [#6892] + +astropy.units +^^^^^^^^^^^^^ + +- Deprecated conversion of quantities to truth values. Currently, the expression + ``bool(0 * u.dimensionless_unscaled)`` evaluates to ``True``. In the future, + attempting to convert a ``Quantity`` to a ``bool`` will raise ``ValueError``. + [#6580, #6590] + +- Modify the ``brightness_temperature`` equivalency to provide a surface + brightness equivalency instead of the awkward assumed-per-beam equivalency + that previously existed [#5173, #6663] + +- Support was added for a number of ``scipy.special`` functions. [#6852] + +astropy.utils +^^^^^^^^^^^^^ + +- The ``astropy.utils.console.ProgressBar.map`` class method now supports the + ``ipython_widget`` option. You can now pass it both ``multiprocess=True`` and + ``ipython_widget=True`` to get both multiprocess speedup and a progress bar + widget in an IPython Notebook. [#6368] + +- The ``astropy.utils.compat.funcsigs`` module has now been deprecated. Use the + Python 'inspect' module directly instead. [#6598] + +- The ``astropy.utils.compat.futures`` module has now been deprecated. Use the + Python 'concurrent.futures' module directly instead. [#6598] + +- ``JsonCustomEncoder`` is expanded to handle ``Quantity`` and ``UnitBase``. + [#5471] + +- Added a ``dcip_xy`` method to IERS that interpolates along the dX_2000A and + dY_2000A columns of the IERS table. Hence, the data for the CIP offsets is + now available for use in coordinate frame conversion. [#5837] + +- The functions ``matmul``, ``broadcast_arrays``, ``broadcast_to`` of the + ``astropy.utils.compat.numpy`` module have been deprecated. Use the + NumPy functions directly. [#6691] + +- The ``astropy.utils.console.ProgressBar.map`` class method now returns + results in sequential order. Previously, if you set ``multiprocess=True``, + then the results could arrive in any arbitrary order, which could be a nasty + shock. Although the function will still be evaluated on the items in + arbitrary order, the return values will arrive in the same order in which the + input items were provided. The method is now a thin wrapper around + ``astropy.utils.console.ProgressBar.map_unordered``, which preserves the old + behavior. [#6439] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Enable Matplotlib's subtraction shorthand syntax for composing and + inverting trasformations for the ``WCSWorld2PixelTransform`` and + ``WCSPixel2WorldTransform`` classes by setting ``has_inverse`` to ``True``. + In order to implement a unit test, also implement the equality comparison + operator for both classes. [#6531] + +- Added automatic hiding of axes labels when no tick labels are drawn on that + axis. This parameter can be configured with + ``WCSAxes.coords[*].set_axislabel_visibility_rule`` so that labels are automatically + hidden when no ticks are drawn or always shown. [#6774] + +astropy.wcs +^^^^^^^^^^^ + +- Added a new function ``celestial_frame_to_wcs`` to convert from + coordinate frames to WCS (the opposite of what ``wcs_to_celestial_frame`` + currently does. [#6481] + +- ``wcslib`` was updated to v 5.18. [#7066] + + +API Changes +----------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- ``Gaussian2DKernel`` now accepts ``x_stddev`` in place of ``stddev`` with + an option for ``y_stddev``, if different. It also accepts ``theta`` like + ``Gaussian2D`` model. [#3605, #6748] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Deprecated ``recommended_units`` for representations. These were used to + ensure that any angle was presented in degrees in sky coordinates and + frames. This is more logically done in the frame itself. [#6858] + +- As noted above, the frame class attributes ``representation`` and + ``differential_cls`` are being replaced by ``representation_type`` and + ``differential_type``. In the next version, using ``representation`` will raise + a deprecation warning. [#6873] + +- Coordinate frame classes now can't be added to the frame transform graph if + they have frame attribute names that conflict with any component names. This + is so ``SkyCoord`` can uniquely identify and distinguish frame attributes from + frame components. [#6871] + +- Slicing and reshaping of ``SkyCoord`` and coordinate frames no longer passes + the new object through ``__init__``, but directly sets atttributes on a new + instance. This speeds up those methods by an order of magnitude, but means + that any customization done in ``__init__`` is by-passed. [#6941] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Allow ECSV files to be auto-identified by ``Table.read`` or + ``Table.write`` based on the ``.ecsv`` file name suffix. In this case it + is not required to provide the ``format`` keyword. [#6552] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Automatically detect and handle compression in FITS files that are opened by + passing a file handle to ``fits.open`` [#6373] + +- Remove the ``nonstandard`` checksum option. [#6571] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- When writing to HDF5 files, the serialized metadata are now saved in a new + dataset instead of the HDF5 dataset attributes. This allows for metadata of + any dimensions. [#6304] + +- Deprecated the ``usecPickle`` kwarg of ``fnunpickle`` and ``fnpickle`` as + it was needed only for Python2 usage. [#6655] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Add handling of ``tree.Group`` elements to ``tree.Resource``. Unified I/O + or conversion to astropy tables is not affected. [#6262] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Removed deprecated ``GaussianAbsorption1D`` model. + Use ``Const1D - Gaussian1D`` instead. [#6542] + +- Removed the registry from modeling. [#6706] + +astropy.table +^^^^^^^^^^^^^ + +- When setting the column ``format`` attribute the value is now immediately + validated. Previously one could set to any value and it was only checked + when actually formatting the column. [#6385] + +- Deprecated the ``python3_only`` kwarg of the + ``convert_bytestring_to_unicode`` and ``convert_unicode_to_bytestring`` + methods it was needed only for Python2 usage. [#6655] + +- When reading in FITS tables with ``Table.read``, string columns are now + represented using Numpy byte (dtype ``S``) arrays rather than Numpy + unicode arrays (dtype ``U``). The ``Column`` class then ensures the + bytes are automatically converted to string as needed. [#6821] + +- When getting a table row using multiple column names, if one of the + names is not a valid column name then a ``KeyError`` exception is + now raised (previously ``ValueError``). When setting a table row, + if the right hand side is not a sequence with the correct length + then a ``ValueError`` is now raised (previously in certain cases + a ``TypeError`` was raised). [#7107] + +astropy.utils +^^^^^^^^^^^^^ + +- ``download_files_in_parallel`` now always uses ``cache=True`` to make the + function work on Windows. [#6671] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- The Astropy matplotlib plot style has been deprecated. It will continue to + work in future but is no longer documented. [#6991] + + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Frame objects now use the default differential even if the representation is + explicitly provided as long as the representation provided is the same type as + the default representation. [#6944] + +- Coordinate frame classes now raise an error when they are added to the frame + transform graph if they have frame attribute names that conflict with any + component names. [#6871] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Added support for reading very large tables in chunks to reduce memory + usage. [#6458] + +- Strip leading/trailing white-space from latex lines to avoid issues when + matching ``\begin{tabular}`` statements. This is done by introducing a new + ``LatexInputter`` class to override the ``BaseInputter``. [#6311] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Properly handle opening of FITS files from ``http.client.HTTPResponse`` (i.e. + it now works correctly when passing the results of ``urllib.request.urlopen`` + to ``fits.open``). [#6378] + +- Fix the ``fitscheck`` script for updating invalid checksums, or removing + checksums. [#6571] + +- Fixed potential problems with the compression module [#6732] + +- Always use the 'D' format for floating point values in ascii tables. [#6938] + +astropy.table +^^^^^^^^^^^^^ + +- Fix getting a table row when using multiple column names (for example + ``t[3]['a', 'b', 'c']``). Also fix a problem when setting an entire row: + if setting one of the right-hand side values failed this could result in + a partial update of the referenced parent table before the exception is + raised. [#7107] + +astropy.time +^^^^^^^^^^^^ + +- Initialization of ``Time`` instances with bytes or arrays with dtype ``S`` + will now automatically attempt to decode as ASCII. This ensures ``Column`` + instances with ASCII strings stored with dtype ``S`` can be used. + [#6823, #6903] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed a bug that caused PLY files to not be generated correctly in Python 3. + [#7174] + +astropy.utils +^^^^^^^^^^^^^ + +- The ``deprecated`` decorator applied to a class will now modify the class + itself, rather than to create a class that just looks and behave like the + original. This is needed so that the Python 3 ``super`` without arguments + works for decorated classes. [#6615] + +- Fixed ``HomogeneousList`` when setting one item or a slice. [#6773] + +- Also check the type when creating a new instance of + ``HomogeneousList``. [#6773] + +- Make ``HomogeneousList`` work with iterators and generators when creating the + instance, extending it, or using when setting a slice. [#6773] + + +Other Changes and Additions +--------------------------- + +- Versions of Python <3.5 are no longer supported. [#6556] + +- Versions of Pytest <3.1 are no longer supported. [#6419] + +- Versions of Numpy <1.10 are no longer supported. [#6593] + +- The bundled CFITSIO was updated to version 3.41 [#6477] + +- ``analytic_functions`` sub-package is removed. + Use ``astropy.modeling.blackbody``. [#6541] + +- ``astropy.vo`` sub-package is removed. Use ``astropy.samp`` for SAMP and + ``astroquery`` for VO cone search. [#6540] + +- The guide to setting up Emacs for code development was simplified, and + updated to recommend ``flycheck`` and ``flake8`` for syntax checks. [#6692] + +- The bundled version of PLY was updated to 3.10. [#7174] + + + +2.0.15 (unreleased) +=================== + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +astropy.io.fits +^^^^^^^^^^^^^^^ + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +astropy.modeling +^^^^^^^^^^^^^^^^ + +astropy.nddata +^^^^^^^^^^^^^^ + +astropy.stats +^^^^^^^^^^^^^ + +astropy.table +^^^^^^^^^^^^^ + +astropy.tests +^^^^^^^^^^^^^ + +astropy.time +^^^^^^^^^^^^ + +astropy.units +^^^^^^^^^^^^^ + +astropy.utils +^^^^^^^^^^^^^ + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +astropy.vo +^^^^^^^^^^ + +astropy.wcs +^^^^^^^^^^^ + + +Other Changes and Additions +--------------------------- + + + +2.0.14 (2019-06-14) +=================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix ``Header.update`` which was dropping the comments when passed + a ``Header`` object. [#8840] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- ``Moffat1D.fwhm`` and ``Moffat2D.fwhm`` will return a positive value when + ``gamma`` is negative. [#8801, #8815] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed a bug that prevented ``EarthLocation`` from being initialized with + numpy >=1.17. [#8849] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed ``quantity_support`` to work around the fact that matplotlib + does not detect subclasses in its ``units`` framework. With this, + ``Angle`` and other subclasses work correctly. [#8818] + +- Fixed ``quantity_support`` to work properly if multiple context managers + are nested. [#8844] + + +2.0.13 (2019-06-08) +=================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ +- Fixed bug in ``ColDefs._init_from_array()`` that caused unsigned datatypes + with the opposite endianess as the host architecture to fail the + TestColumnFunctions.test_coldefs_init_from_array unit test. [#8460] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Explicitly set PyYAML default flow style to None to ensure consistent + astropy YAML output for PyYAML version 5.1 and later. [#8500] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Block floating-point columns from using repr format when converted to Table + [#8358] + +astropy.stats +^^^^^^^^^^^^^ + +- Fixed issue in ``bayesian_blocks`` when called with the ``ncp_prior`` + keyword. [#8339] + +astropy.units +^^^^^^^^^^^^^ + +- Fix ``take`` when one gets only a single element from a ``Quantity``, + ensuring it returns a ``Quantity`` rather than a scalar. [#8617] + + + +2.0.12 (2019-02-23) +=================== + +New Features +------------ + +astropy.utils +^^^^^^^^^^^^^ + +- The ``deprecated_renamed_argument`` decorator now capable deprecating an + argument without renaming it. It also got a new ``alternative`` keyword + argument to suggest alternative functionality instead of the removed + one. [#8324] + + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed bug in ``ColDefs._init_from_array()`` that caused non-scalar unsigned + entries to not have the correct bzero value set. [#8353] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed compatibility of ``JointFitter`` with the latest version of Numpy. + [#7984] + +astropy.table +^^^^^^^^^^^^^ + +- Fix ``.quantity`` property of ``Column`` class for function-units (e.g., + ``dex``). Previously setting this was possible, but getting raised + an error. [#8425] + +- Fixes a bug where initializing a new ``Table`` from the final row of an + existing ``Table`` failed. This happened when that row was generated using + the item index ``[-1]``. [#8422] + +astropy.wcs +^^^^^^^^^^^ + +- Fix bug that caused ``WCS.has_celestial``, ``wcs_to_celestial_frame``, and + other functionality depending on it to fail in the presence of correlated + celestial and other axes. [#8420] + + +Other Changes and Additions +--------------------------- + +- Fixed ``make clean`` for the documentation on Windows to ensure it + properly removes the ``api`` and ``generated`` directories. [#8346] + +- Updating bundled ``pytest-openfiles`` to v0.3.2. [#8434] + +- Making ``ErfaWarning`` and ``ErfaError`` available via + ``astropy.utils.exceptions``. [#8441] + + + +2.0.11 (2018-12-31) +=================== + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix fast reader C tokenizer to handle double quotes in quoted field. + [#8283] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix a bug in ``io.fits`` with writing Fortran-ordered arrays to file + objects. [#8282] + +astropy.units +^^^^^^^^^^^^^ + +- Add support for ``np.matmul`` as a ``ufunc`` (new in numpy 1.16). + [#8264, #8305] + +astropy.utils +^^^^^^^^^^^^^ + +- Fix failures caused by IERS_A_URL being unavailable by introducing + IERS_A_URL_MIRROR. [#8308] + + + +2.0.10 (2018-12-04) +=================== + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fix Moffat2DKernel's FWHM computation, which has an influence on the default + size of the kernel when no size is given. [#8105] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Disable ``of_address`` usage due to Google API now requiring API key. [#7993] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``fits.append`` now correctly handles file objects with valid modes other + than ``ostream``. [#7856] + +astropy.table +^^^^^^^^^^^^^ + +- Fix ``Table.show_in_notebook`` failure when mixin columns are present. [#8069] + +astropy.tests +^^^^^^^^^^^^^ + +- Explicitly disallow incompatible versions of ``pytest`` when using the test + runner. [#8188] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed the spelling of the 'luminous emittance/illuminance' physical + property. [#7942] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug that caused origin to be incorrect if not specified. [#7927] + +- Fixed a bug that caused an error when plotting grids multiple times + with grid_type='contours'. [#7927] + +- Put an upper limit on the number of bins in ``hist`` and ``histogram`` and + factor out calculation of bin edges into public function + ``calculate_bin_edges``. [#7991] + + +Other Changes and Additions +--------------------------- + +- Fixing ``astropy.__citation__`` to provide the full bibtex entry of the 2018 + paper. [#8110] + +- Pytest 4.0 is not supported by the 2.0.x LTS releases. [#8173] + +- Updating bundled ``pytest-remotedata`` to v0.3.1. [#8174] + +- Updating bundled ``pytest-doctestplus`` to v0.2.0. [#8175] + +- Updating bundled ``pytest-openfiles`` to v0.3.0. [#8176] + +- Adding ``warning_type`` keyword argument to the "deprecated" decorators to + allow issuing custom warning types instead of the default + ``AstropyDeprecationWarning``. [#8178] + + +2.0.9 (2018-10-14) +================== + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix reading of big files with the fast reader. [#7885] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``HDUList.__contains__()`` now works with ``HDU`` arguments. That is, + ``hdulist[0] in hdulist`` now works as expected. [#7282] + +- ``HDUList`` s can now be written to streams in Python 3 [#7850] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed the bug in CCData.read when the HDU is not specified and the first one + is empty so the function searches for the first HDU with data which may not + have an image extension. [#7739] + +astropy.stats +^^^^^^^^^^^^^ + +- Fixed bugs in biweight statistics functions where a constant data + array (or if using the axis keyword, constant along an axis) would + return NaN. [#7737] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a bug in ``to_pandas()`` where integer type masked columns were always + getting converted to float. This could cause loss of precision. Now this only + occurs if there are actually masked data values, in which case ``pandas`` + does require the values to be float so that ``NaN`` can be used to mark the + masked values. [#7741, #7747] + +astropy.tests +^^^^^^^^^^^^^ + +- Change the name of the configuration variable controlling the location of the + Astropy cache in the Pytest plugin from ``cache_dir`` to + ``astropy_cache_dir``. The command line flag also changed to + ``--astropy-cache-dir``. This prevents a conflict with the ``cache_dir`` + variable provided by pytest itself. Also made similar change to + ``config_dir`` option as a precaution. [#7721] + +astropy.units +^^^^^^^^^^^^^ + +- ``UnrecognizedUnit`` instances can now be compared to any other object + without raising `TypeError`. [#7606] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fix compatibility with Matplotlib 3.0. [#7839] + +- Fix an issue that caused a crash when using WCSAxes with a custom Transform + object and when using ``grid_type='contours'`` to plot a grid. [#7846] + +astropy.wcs +^^^^^^^^^^^ + +- Instead of raising an error ``astropy.wcs`` now returns the input when + the input has zero size. [#7746] + +- Fix ``malloc(0)`` bug in ``pipeline_all_pixel2world()`` and + ``pipeline_pix2foc()``. They now raise an exception for input with + zero coordinates, i.e. shape = (0, n). [#7806] + +- Fixed an issue with scalar input when WCS.naxis is one. [#7858] + +Other Changes and Additions +--------------------------- + +- Added a new ``astropy.__citation__`` attribute which gives a citation + for Astropy in bibtex format. Made sure that both this and + ``astropy.__bibtex__`` works outside the source environment, too. [#7718] + + + +2.0.8 (2018-08-02) +================== + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Correct data type conversion for non-float masked kernels. [#7542] + +- Fix non-float or masked, zero sum kernels when ``normalize_kernel=False``. + Non-floats would yeild a type error and masked kernels were not being filled. + [#7541] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Ensure that relative humidities can be given as Quantities, rather than take + any quantity and just strip its unit. [#7668] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed ``Cutout2D`` output WCS NAXIS values to reflect the cutout + image size. [#7552] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a bug in ``add_columns`` method where ``rename_duplicate=True`` would + cause an error if there were no duplicates. [#7540] + +astropy.tests +^^^^^^^^^^^^^ + +- Fixed bug in ``python setup.py test --coverage`` on Windows machines. [#7673] + +astropy.time +^^^^^^^^^^^^ + +- Avoid rounding errors when converting ``Quantity`` to ``TimeDelta``. [#7625] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug that caused the position of the tick values in decimal mode + to be incorrectly determined. [#7332] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed a bug that caused ``wcs_to_celestial_frame``, ``skycoord_to_pixel``, and + ``pixel_to_skycoord`` to raise an error if the axes of the celestial WCS were + swapped. [#7691] + + +2.0.7 (2018-06-01) +================== + +Bug Fixes +--------- + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed ``Tabular`` models to not change the shape of data. [#7411] + +astropy.stats +^^^^^^^^^^^^^ + +- In ``freedman_bin_width``, if the data has too small IQR, + raise ``ValueError``. [#7248, #7402] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a performance issue in ``MaskedColumn`` where initialization was + extremely slow for large arrays with the default ``mask=None``. [#7422] + +- Fix printing table row indexed with unsigned integer. [#7469] + +- Fix copy of mask when copying a Table, as this is no more done systematically + by Numpy since version 1.14. Also fixed a problem when MaskedColumn was + initialized with ``mask=np.ma.nomask``. [#7486] + +astropy.time +^^^^^^^^^^^^ + +- Fixed a bug in Time that raised an error when initializing a subclass of Time + with a Time object. [#7453] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed a bug that improperly handled unicode case of URL mirror in Python 2. + [#7493] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug that prevented legends from being added to plots done with + units. [#7510] + + +Other Changes and Additions +--------------------------- + +- Bundled ``pytest-remotedata`` plugin is upgraded to 0.3. [#7493] + + +2.0.6 (2018-04-23) +================== + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- convolve(boundary=None) requires the kernel to be smaller than the image. + This was never actually checked, it now is and an exception is raised. + [#7313] + +astropy.units +^^^^^^^^^^^^^ + +- ``u.quantity_input`` no longer errors if the return annotation for a + function is ``None``. [#7336, #7380] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Explicitly default to origin='lower' in WCSAxes. [#7331] + +- Lists of units are now converted in the Matplotlib unit converter. This means + that for Matplotlib versions later than 2.2, more plotting functions now work + with units (e.g. errorbar). [#7037] + + +Other Changes and Additions +--------------------------- + +- Updated the bundled CFITSIO library to 3.44. This is to remedy another + critical security vulnerability that was identified by NASA. See + ``cextern/cfitsio/docs/changes.txt`` for additional information. [#7370] + + +2.0.5 (2018-03-12) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Add a workaround for a bug in the einsum function in Numpy 1.14.0. [#7187] + +- Fix problems with printing ``Angle`` instances under numpy 1.14.1. [#7234] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed the ``fitsdiff`` script for matching fits file with one in a + directory path. [#7085] + +- Make sure that lazily-loaded ``HDUList`` is automatically loaded when calling + ``hdulist.pop``. [#7186] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Propagate weights to underlying fitter in ``FittingWithOutlierRemoval`` [#7249] + +astropy.tests +^^^^^^^^^^^^^ + +- Support dotted package names as namespace packages when gathering test + coverage. [#7170] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Matplotlib axes have the ``axisbelow`` property to control the z-order of + ticks, tick labels, and grid lines. WCSAxes will now respect this property. + This is useful for drawing scale bars or inset boxes, which should have a + z-order that places them above all ticks and gridlines. [#7098] + + +Other Changes and Additions +--------------------------- + +- Updated the bundled CFITSIO library to 3.430. This is to remedy a critical + security vulnerability that was identified by NASA. See + ``cextern/cfitsio/docs/changes.txt`` for additional information. [#7274, #7275] + + +2.0.4 (2018-02-06) +================== + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fixed IndexError when ``preserve_nan=True`` in ``convolve_fft``. Added + testing with ``preserve_nan=True``. [#7000] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``sites.json`` file is now parsed explicitly with a UTF-8 encoding. This + means that future revisions to the file with unicode observatory names can + be done without breaking the site registry parser. [#7082] + +- Working around a bug in Numpy 1.14.0 that broke some coordinate + transformations. [#7105] + +- Fixed a bug where negative angles could be rounded wrongly when converting + to a string with seconds omitted. [#7148] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- When datafile is missing, fits.tabledump uses input file name to build + output file name. Fixed how it gets input file name from HDUList. [#6976] + +- Fix in-place updates to scaled columns. [#6956] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Fixed bug in identifying inherited registrations from multiple ancestors [#7156] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a bug in ``LevMarLSQFitter`` when fitting 2D models with constraints. [#6705] + +astropy.utils +^^^^^^^^^^^^^ + +- ``download_file`` function will check for cache downloaded from mirror URL + first before attempting actual download if primary URL is unavailable. [#6987] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed test failures for ``astropy.visualization.wcsaxes`` which were due to + local matplotlibrc files being taken into account. [#7132] + + +Other Changes and Additions +--------------------------- + +- Fixed broken links in the documentation. [#6745] + +- Substantial performance improvement (potentially >1000x for some cases) when + converting non-scalar ``coordinates.Angle`` objects to strings. [#7004] + + +2.0.3 (2017-12-13) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Ecliptic frame classes now support attributes ``v_x``, ``v_y``, ``v_z`` when + using with a Cartesian representation. [#6569] + +- Added a nicer error message when accidentally calling ``frame.representation`` + instead of ``frame.data`` in the context of methods that use ``._apply()``. + [#6561] + +- Creating a new ``SkyCoord`` from a list of multiple ``SkyCoord`` objects now + yield the correct type of frame, and works at all for non-equatorial frames. + [#6612] + +- Improved accuracy of velocity calculation in ``EarthLocation.get_gcrs_posvel``. + [#6699] + +- Improved accuracy of radial velocity corrections in + ``SkyCoord.radial_velocity_correction```. [#6861] + +- The precision of ecliptic frames is now much better, after removing the + nutation from the rotation and fixing the computation of the position of the + Sun. [#6508] + +astropy.extern +^^^^^^^^^^^^^^ + +- Version 0.2.1 of ``pytest-astropy`` is included as an external package. + [#6918] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix writing the result of ``fitsdiff`` to file with ``--output-file``. [#6621] + +- Fix a minor bug where ``FITS_rec`` instances can not be indexed with tuples + and other sequences that end up with a scalar. [#6955, #6966] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fix ``ImportError`` when ``hdf5`` is imported first in a fresh Python + interpreter in Python 3. [#6604, #6610] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Suppress errors during WCS creation in CCDData.read(). [#6500] + +- Fixed a problem with ``CCDData.read`` when the extension wasn't given and the + primary HDU contained no ``data`` but another HDU did. In that case the header + were not correctly combined. [#6489] + +astropy.stats +^^^^^^^^^^^^^ + +- Fixed an issue where the biweight statistics functions would + sometimes cause runtime underflow/overflow errors for float32 input + arrays. [#6905] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a problem when printing a table when a column is deleted and + garbage-collected, and the format function caching mechanism happens + to re-use the same cache key. [#6714] + +- Fixed a problem when comparing a unicode masked column (on left side) to + a bytes masked column (on right side). [#6899] + +- Fixed a problem in comparing masked columns in bytes and unicode when the + unicode had masked entries. [#6899] + +astropy.tests +^^^^^^^^^^^^^ + +- Fixed a bug that causes tests for rst files to not be run on certain + platforms. [#6555, #6608] + +- Fixed a bug that caused the doctestplus plugin to not work nicely with the + hypothesis package. [#6605, #6609] + +- Fixed a bug that meant that the data.astropy.org mirror could not be used when + using --remote-data=astropy. [#6724] + +- Support compatibility with new ``pytest-astropy`` plugins. [#6918] + +- When testing, astropy (or the package being tested) is now installed to + a temporary directory instead of copying the build. This allows + entry points to work correctly. [#6890] + +astropy.time +^^^^^^^^^^^^ + +- Initialization of Time instances now is consistent for all formats to + ensure that ``-0.5 <= jd2 < 0.5``. [#6653] + +astropy.units +^^^^^^^^^^^^^ + +- Ensure that ``Quantity`` slices can be set with objects that have a ``unit`` + attribute (such as ``Column``). [#6123] + +astropy.utils +^^^^^^^^^^^^^ + +- ``download_files_in_parallel`` now respects the given ``timeout`` value. + [#6658] + +- Fixed bugs in remote data handling and also in IERS unit test related to path + URL, and URI normalization on Windows. [#6651] + +- Fixed a bug that caused ``get_pkg_data_fileobj`` to not work correctly when + used with non-local data from inside packages. [#6724] + +- Make sure ``get_pkg_data_fileobj`` fails if the URL can not be read, and + correctly falls back on the mirror if necessary. [#6767] + +- Fix the ``finddiff`` option in ``find_current_module`` to properly deal + with submodules. [#6767] + +- Fixed ``pyreadline`` import in ``utils.console.isatty`` for older IPython + versions on Windows. [#6800] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed the vertical orientation of the ``fits2bitmap`` output bitmap + image to match that of the FITS image. [#6844, #6969] + +- Added a workaround for a bug in matplotlib so that the ``fits2bitmap`` + script generates the correct output file type. [#6969] + + +Other Changes and Additions +--------------------------- + +- No longer require LaTeX to build the documentation locally and + use mathjax instead. [#6701] + +- Ensured that all tests use the Astropy data mirror if needed. [#6767] + + +2.0.2 (2017-09-08) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Ensure transformations via ICRS also work for coordinates that use cartesian + representations. [#6440] + +- Fixed a bug that was preventing ``SkyCoord`` objects made from lists of other + coordinate objects from being written out to ECSV files. [#6448] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Support the ``GZIP_2`` FITS image compression algorithm as claimed + in docs. [#6486] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed a bug that wrote out VO table as version 1.2 instead of 1.3. [#6521] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a bug when combining unicode columns via join or vstack. The character + width of the output column was a factor of 4 larger than needed. [#6459] + +astropy.tests +^^^^^^^^^^^^^ + +- Fixed running the test suite using --parallel. [#6415] + +- Added error handling for attempting to run tests in parallel without having + the ``pytest-xdist`` package installed. [#6416] + +- Fixed issue running doctests with pytest>=3.2. [#6423, #6430] + +- Fixed issue caused by antivirus software in response to malformed compressed + files used for testing. [#6522] + +- Updated top-level config file to properly ignore top-level directories. + [#6449] + +astropy.units +^^^^^^^^^^^^^ + +- Quantity._repr_latex_ now respects precision option from numpy + printoptions. [#6412] + +astropy.utils +^^^^^^^^^^^^^ + +- For the ``deprecated_renamed_argument`` decorator, refer to the deprecation‘s + caller instead of ``astropy.utils.decorators``, to makes it easier to find + where the deprecation warnings comes from. [#6422] + + +2.0.1 (2017-07-30) +================== + +Bug Fixes +--------- + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Fixed Earth radius to be the IAU2015 value for the equatorial radius. + The polar value had erroneously been used in 2.0. [#6400] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Added old frame attribute classes back to top-level namespace of + ``astropy.coordinates``. [#6357] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Scaling an image always uses user-supplied values when given. Added + defaults for scaling when bscale/bzero are not present (float images). + Fixed a small bug in when to reset ``_orig_bscale``. [#5955] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a bug in initializing compound models with units. [#6398] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Updating CCDData.read() to be more flexible with inputs, don't try to + delete keywords that are missing from the header. [#6388] + +astropy.tests +^^^^^^^^^^^^^ +- Fixed the test command that is run from ``setuptools`` to allow it to + gracefully handle keyboard interrupts and pass them on to the ``pytest`` + subprocess. This prompts ``pytest`` to teardown and display useful traceback + and test information [#6369] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Ticks and tick labels are now drawn in front of, rather than behind, + gridlines in WCS axes. This improves legibility in situations where + tick labels may be on the interior of the axes frame, such as the right + ascension axis of an all-sky Aitoff or Mollweide projection. [#6361] + +astropy.wcs +^^^^^^^^^^^ + +- Fix the missing wcskey part in _read_sip_kw, this will cause error when reading sip wcs while there is no default CRPIX1 CRPIX2 keywords and only CRPIX1n CRPIX2n in header. [#6372] + + +2.0 (2017-07-07) +================ + +New Features +------------ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Constants are now organized into version modules, with physical CODATA + constants in the ``codata2010`` and ``codata2014`` sub-modules, + and astronomical constants defined by the IAU in the ``iau2012`` and + ``iau2015`` sub-modules. The default constants in ``astropy.constants`` + in Astropy 2.0 have been updated from ``iau2012`` to ``iau2015`` and + from ``codata2010`` to ``codata2014``. The constants for 1.3 can be + accessed in the ``astropyconst13`` sub-module and the constants for 2.0 + (the default in ``astropy.constants``) can also be accessed in the + ``astropyconst20`` sub-module [#6083] + +- The GM mass parameters recommended by IAU 2015 Resolution B 3 have been + added as ``GM_sun``, ``GM_jup``, and ``GM_earth``, for the Sun, + Jupiter and the Earth. [#6083] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Major change in convolution behavior and keyword arguments. Additional + details are in the API section. [#5782] + +- Convolution with un-normalized and un-normalizable kernels is now possible. + [#5782] + +- Add a new argument, ``normalization_rtol``, to ``convolve_fft``, allowing + the user to specify the relative error tolerance in the normalization of + the convolution kernel. [#5649, #5177] + +- Models can now be convoluted using ``convolve`` or ``convolve_fft``, + which generates a regular compound model. [#6015] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Frame attributes set on ``SkyCoord`` are now always validated, and any + ndarray-like operation (like slicing) will also be done on those. [#5751] + +- Caching of all possible frame attributes was implemented. This greatly + speeds up many ``SkyCoord`` operations. [#5703, #5751] + +- A class hierarchy was added to allow the representation layer to store + differentials (i.e., finite derivatives) of coordinates. This is intended + to enable support for velocities in coordinate frames. [#5871] + +- ``replicate_without_data`` and ``replicate`` methods were added to + coordinate frames that allow copying an existing frame object with various + reference or copy behaviors and possibly overriding frame attributes. [#6182] + +- The representation class instances can now contain differential objects. + This is primarily useful for internal operations that will provide support + for transforming velocity components in coordinate frames. [#6169] + +- ``EarthLocation.to_geodetic()`` (and ``EarthLocation.geodetic``) now return + namedtuples instead of regular tuples. [#6237] + +- ``EarthLocation`` now has ``lat`` and ``lon`` properties (equivalent to, but + preferred over, the previous ``latitude`` and ``longitude``). [#6237] + +- Added a ``radial_velocity_correction`` method to ``SkyCoord`` to do compute + barycentric and heliocentric velocity corrections. [#5752] + +- Added a new ``AffineTransform`` class for coordinate frame transformations. + This class supports matrix operations with vector offsets in position or + any differential quantities (so far, only velocity is supported). The + matrix transform classes now subclass from the base affine transform. + [#6218] + +- Frame objects now have experimental support for velocity components. Most + frames default to accepting proper motion components and radial velocity, + and the velocities transform correctly for any transformation that uses + one of the ``AffineTransform``-type transformations. For other + transformations a finite-difference velocity transformation is available, + although it is not as numerically stable as those that use + ``AffineTransform``-type transformations. [#6219, #6226] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Allow to specify encoding in ``ascii.read``, only for Python 3 and with the + pure-Python readers. [#5448] + +- Writing latex tables with only a ``tabular`` environment is now possible by + setting ``latexdict['tabletyle']`` to ``None``. [#6205] + +- Allow ECSV format to support reading and writing mixin columns like + ``Time``, ``SkyCoord``, ``Latitude``, and ``EarthLocation``. [#6181] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Checking available disk space before writing out file. [#5550, #4065] + +- Change behavior to warn about units that are not FITS-compliant when + writing a FITS file but not when reading. [#5675] + +- Added absolute tolerance parameter when comparing FITS files. [#4729] + +- New convenience function ``printdiff`` to print out diff reports. [#5759] + +- Allow to instantiate a ``BinTableHDU`` directly from a ``Table`` object. + [#6139] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- YAML representer now also accepts numpy types. [#6077] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- New functions to unregister readers, writers, and identifiers. [#6217] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added ``SmoothlyBrokenPowerLaw1D`` model. [#5656] + +- Add ``n_submodels`` shared method to single and compound models, which + allows users to get the number of components of a given single (compound) + model. [#5747] + +- Added a ``name`` setter for instances of ``_CompoundModel``. [#5741] + +- Added FWHM properties to Gaussian and Moffat models. [#6027] + +- Added support for evaluating models and setting the results for inputs + outside the bounding_box to a user specified ``fill_value``. This + is controlled by a new optional boolean keyword ``with_bounding_box``. [#6081] + +- Added infrastructure support for units on parameters and during + model evaluation and fitting, added support for units on all + functional, power-law, polynomial, and rotation models where this + is appropriate. A new BlackBody1D model has been added. [#4855, #6183, + #6204, #6235] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Added an image class, ``CCDData``. [#6173] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``biweight_midcovariance`` function. [#5777] + +- Added ``biweight_scale`` and ``biweight_midcorrelation`` + functions. [#5991] + +- ``median_absolute_deviation`` and ``mad_std`` have ``ignore_nan`` option + that will use ``np.ma.median`` with nans masked out or ``np.nanmedian`` + instead of ``np.median`` when computing the median. [#5232] + +- Implemented statistical estimators for Ripley's K Function. [#5712] + +- Added ``SigmaClip`` class. [#6206] + +- Added ``std_ddof`` keyword option to ``sigma_clipped_stats``. + [#6066, #6207] + +astropy.table +^^^^^^^^^^^^^ + +- Issue a warning when assigning a string value to a column and + the string gets truncated. This can occur because numpy string + arrays are fixed-width and silently drop characters which do not + fit within the fixed width. [#5624, #5819] + +- Added functionality to allow ``astropy.units.Quantity`` to be written + as a normal column to FITS files. [#5910] + +- Add support for Quantity columns (within a ``QTable``) in table + ``join()``, ``hstack()`` and ``vstack()`` operations. [#5841] + +- Allow unicode strings to be stored in a Table bytestring column in + Python 3 using UTF-8 encoding. Allow comparison and assignment of + Python 3 ``str`` object in a bytestring column (numpy ``'S'`` dtype). + If comparison with ``str`` instead of ``bytes`` is a problem + (and ``bytes`` is really more logical), please open an issue on GitHub. + [#5700] + +- Added functionality to allow ``astropy.units.Quantity`` to be read + from and written to a VOtable file. [#6132] + +- Added support for reading and writing a table with mixin columns like + ``Time``, ``SkyCoord``, ``Latitude``, and ``EarthLocation`` via the + ASCII ECSV format. [#6181] + +- Bug fix for ``MaskedColumn`` insert method, where ``fill_value`` attribute + was not being passed along to the copy of the ``MaskedColumn`` that was + returned. [#7585] + +astropy.tests +^^^^^^^^^^^^^ + +- ``enable_deprecations_as_exceptions`` function now accepts additional + user-defined module imports and warning messages to ignore. [#6223, #6334] + +astropy.units +^^^^^^^^^^^^^ + +- The ``astropy.units.quantity_input`` decorator will now convert the output to + the unit specified as a return annotation under Python 3. [#5606] + +- Passing a logarithmic unit to the ``Quantity`` constructor now returns the + appropriate logarithmic quantity class if ``subok=True``. For instance, + ``Quantity(1, u.dex(u.m), subok=True)`` yields ````. [#5928] + +- The ``quantity_input`` decorator now accepts a string physical type in + addition to of a unit object to specify the expected input ``Quantity``'s + physical type. For example, ``@u.quantity_input(x='angle')`` is now + functionally the same as ``@u.quantity_input(x=u.degree)``. [#3847] + +- The ``quantity_input`` decorator now also supports unit checking for + optional keyword arguments and accepts iterables of units or physical types + for specifying multiple valid equivalent inputs. For example, + ``@u.quantity_input(x=['angle', 'angular speed'])`` or + ``@u.quantity_input(x=[u.radian, u.radian/u.yr])`` would both allow either + a ``Quantity`` angle or angular speed passed in to the argument ``x``. + [#5653] + +- Added a new equivalence ``molar_mass_amu`` between g/mol to + atomic mass units. [#6040, #6113] + +- ``Quantity`` has gained a new ``to_value`` method which returns the value + of the quantity in a given unit. [#6127] + +- ``Quantity`` now supports the ``@`` operator for matrix multiplication that + was introduced in Python 3.5, for all supported versions of numpy. [#6144] + +- ``Quantity`` supports the new ``__array_ufunc__`` protocol introduced in + numpy 1.13. As a result, operations that involve unit conversion will be + sped up considerably (by up to a factor of two for costly operations such + as trigonometric ones). [#2583] + +astropy.utils +^^^^^^^^^^^^^ + +- Added a new ``dataurl_mirror`` configuration item in ``astropy.utils.data`` + that is used to indicate a mirror for the astropy data server. [#5547] + +- Added a new convenience method ``get_cached_urls`` to ``astropy.utils.data`` + for getting a list of the URLs in your cache. [#6242] + +astropy.wcs +^^^^^^^^^^^ + +- Upgraded the included wcslib to version 5.16. [#6225] + + The minimum required version of wcslib in is 5.14. + + +API Changes +----------- + +astropy.analytic_functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- This entire sub-package is deprecated because blackbody has been moved to + ``astropy.modeling.blackbody``. [#6191] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Major change in convolution behavior and keyword arguments. + ``astropy.convolution.convolve_fft`` replaced ``interpolate_nan`` with + ``nan_treatment``, and ``astropy.convolution.convolve`` received a new + ``nan_treatment`` argument. ``astropy.convolution.convolve`` also no longer + double-interpolates interpolates over NaNs, although that is now available + as a separate ``astropy.convolution.interpolate_replace_nans`` function. See + :ref:`the backwards compatibility note ` for more + on how to get the old behavior (and why you probably don't want to.) [#5782] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``astropy.coordinates.Galactic`` frame previously was had the cartesian + ordering 'w', 'u', 'v' (for 'x', 'y', and 'z', respectively). This was an + error and against the common convention. The 'x', 'y', and 'z' axes now + map to 'u', 'v', and 'w', following the right-handed ('u' points to + the Galactic center) convention. [#6330] + +- Removed deprecated ``angles.rotation_matrix`` and + ``angles.angle_axis``. Use the routines in + ``coordinates.matrix_utilities`` instead. [#6170] + +- ``EarthLocation.latitude`` and ``EarthLocation.longitude`` are now + deprecated in favor of ``EarthLocation.lat`` and ``EarthLocation.lon``. + They former will be removed in a future version. [#6237] + +- The ``FrameAttribute`` class and subclasses have been renamed to just contain + ``Attribute``. For example, ``QuantityFrameAttribute`` is now + ``QuantityAttribute``. [#6300] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Cosmological models do not include any contribution from neutrinos or photons + by default -- that is, the default value of Tcmb0 is 0. This does not affect + built in models (such as WMAP or Planck). [#6112] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Remove deprecated ``NumCode`` and ``ImgCode`` properties on FITS + ``_ImageBaseHDU``. Use module-level constants ``BITPIX2DTYPE`` and + ``DTYPE2BITPIX`` instead. [#4993] + +- ``comments`` meta key (which is ``io.ascii``'s table convention) is output + to ``COMMENT`` instead of ``COMMENTS`` header. Similarly, ``COMMENT`` + headers are read into ``comments`` meta [#6097] + +- Remove compatibility code which forced loading all HDUs on close. The old + behavior can be used with ``lazy_load_hdus=False``. Because of this change, + trying to access the ``.data`` attribute from an HDU which is not loaded + now raises a ``IndexError`` instead of a ``ValueError``. [#6082] + +- Deprecated ``clobber`` keyword; use ``overwrite``. [#6203] + +- Add EXTVER column to the output of ``HDUList.info()``. [#6124] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Removed deprecated ``Redshift`` model; Use ``RedshiftScaleFactor``. [#6053] + +- Removed deprecated ``Pix2Sky_AZP.check_mu`` and ``Pix2Sky_SZP.check_mu`` + methods. [#6170] + +- Deprecated ``GaussianAbsorption1D`` model, as it can be better represented + by subtracting ``Gaussian1D`` from ``Const1D``. [#6200] + +- Added method ``sum_of_implicit_terms`` to ``Model``, needed when performing + a linear fit to a model that has built-in terms with no corresponding + parameters (primarily the ``1*x`` term of ``Shift``). [#6174] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Removed deprecated usage of parameter ``propagate_uncertainties`` as a + positional keyword. [#6170] + +- Removed deprecated ``support_correlated`` attribute. [#6170] + +- Removed deprecated ``propagate_add``, ``propagate_subtract``, + ``propagate_multiply`` and ``propagate_divide`` methods. [#6170] + +astropy.stats +^^^^^^^^^^^^^ + +- Removed the deprecated ``sig`` and ``varfunc`` keywords in the + ``sigma_clip`` function. [#5715] + +- Added ``modify_sample_size`` keyword to ``biweight_midvariance`` + function. [#5991] + +astropy.table +^^^^^^^^^^^^^ + +- In Python 3, when getting an item from a bytestring Column it is now + converted to ``str``. This means comparing a single item to a ``bytes`` + object will always fail, and instead one must compare with a ``str`` + object. [#5700] + +- Removed the deprecated ``data`` property of Row. [#5729] + +- Removed the deprecated functions ``join``, ``hstack``, ``vstack`` and + ``get_groups`` from np_utils. [#5729] + +- Added ``name`` parameter to method ``astropy.table.Table.add_column`` and + ``names`` parameter to method ``astropy.table.Table.add_columns``, to + provide the flexibility to add unnamed columns, mixin objects and also to + specify explicit names. Default names will be used if not + specified. [#5996] + +- Added optional ``axis`` parameter to ``insert`` method for ``Column`` and + ``MaskedColumn`` classes. [#6092] + +astropy.units +^^^^^^^^^^^^^ + +- Moved ``units.cgs.emu`` to ``units.deprecated.emu`` due to ambiguous + definition of "emu". [#4918, #5906] + +- ``jupiterMass``, ``earthMass``, ``jupiterRad``, and ``earthRad`` no longer + have their prefixed units included in the standard units. If needed, they + can still be found in ``units.deprecated``. [#5661] + +- ``solLum``,``solMass``, and ``solRad`` no longer have their prefixed units + included in the standard units. If needed, they can still be found in + ``units.required_by_vounit``, and are enabled by default. [#5661] + +- Removed deprecated ``Unit.get_converter``. [#6170] + +- Internally, astropy replaced use of ``.to(unit).value`` with the new + ``to_value(unit)`` method, since this is somewhat faster. Any subclasses + that overwrote ``.to``, should also overwrite ``.to_value`` (or + possibly just the private ``._to_value`` method. (If you did this, + please let us know what was lacking that made this necessary!). [#6137] + +astropy.utils +^^^^^^^^^^^^^ + +- Removed the deprecated compatibility modules for Python 2.6 (``argparse``, + ``fractions``, ``gzip``, ``odict``, ``subprocess``) [#5975,#6157,#6164] + +- Removed the deprecated ``zest.releaser`` machinery. [#6282] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Removed the deprecated ``scale_image`` function. [#6170] + +astropy.vo +^^^^^^^^^^ + +- Cone Search now issues deprecation warning because it is moved to + Astroquery 0.3.5 and will be removed from Astropy in a future version. + [#5558, #5904] + +- The ``astropy.vo.samp`` package has been moved to ``astropy.samp``, and no + longer supports HTTPS/SSL. [#6201, #6213] + +astropy.wcs +^^^^^^^^^^^ + +- Removed deprecated ``wcs.rotateCD``. [#6170] + + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Major change in convolution behavior and keyword arguments: + ``astropy.convolution.convolve`` was not performing normalized convolution + in earlier versions of astropy. [#5782] + +- Direct convolution previously implemented the wrong definition of + convolution. This error only affects *asymmetric* kernels. [#6267] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``astropy.coordinates.Galactic`` frame had an incorrect ording for the + 'u', 'v', and 'w' cartesian coordinates. [#6330] + +- The ``astropy.coordinates.search_around_sky``, + ``astropy.coordinates.search_around_3d``, and ``SkyCoord`` equivalent methods + now correctly yield an ``astropy.coordinates.Angle`` as the third return type + even if there are no matches (previously it returned a raw Quantity). [#6347] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.extern +^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix an issue where the fast C-reader was dropping table comments for a + table with no data lines. [#8274] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``comments`` meta key (which is ``io.ascii``'s table convention) is output + to ``COMMENT`` instead of ``COMMENTS`` header. Similarly, ``COMMENT`` + headers are read into ``comments`` meta [#6097] + +- Use more sensible fix values for invalid NAXISj header values. [#5935] + +- Close file on error to avoid creating a ``ResourceWarning`` warning + about an unclosed file. [#6168, #6177] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Creating a compound model where one of the submodels is + a compound model whose parameters were changed now uses the + updated parameters and not the parameters of the original model. [#5741] + +- Allow ``Mapping`` and ``Identity`` to be fittable. [#6018] + +- Gaussian models now impose positive ``stddev`` in fitting. [#6019] + +- OrthoPolynomialBase (Chebyshev2D / Legendre2D) models were being evaluated + incorrectly when part of a compound model (using the parameters from the + original model), which in turn caused fitting to fail as a no-op. [#6085] + +- Allow ``Ring2D`` to be defined using ``r_out``. [#6192] + +- Make ``LinearLSQFitter`` produce correct results with fixed model + parameters and allow ``Shift`` and ``Scale`` to be fitted with + ``LinearLSQFitter`` and ``LevMarLSQFitter``. [#6174] + +astropy.stats +^^^^^^^^^^^^^ + +- Allow to choose which median function is used in ``mad_std`` and + ``median_absolute_deviation``. And allow to use these functions with + a multi-dimensional ``axis``. [#5835] + +- Fixed ``biweight_midvariance`` so that by default it returns a + variance that agrees with the standard definition. [#5991] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a problem with vstack for bytes columns in Python 3. [#5628] + +- Fix QTable add/insert row for multidimensional Quantity. [#6092] + +astropy.time +^^^^^^^^^^^^ + +- Fixed the initial condition of ``TimeFITS`` to allow scale, FITS scale + and FITS realization to be checked and equated properly. [#6202] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug that caused the default WCS to return coordinates offset by + one. [#6339] + +astropy.vo +^^^^^^^^^^ + +- Fixed a bug in vo.samp when stopping a hub for which a lockfile was + not created. [#6211] + + +Other Changes and Additions +--------------------------- + +- Numpy 1.7 and 1.8 are no longer supported. [#6006] + +- Python 3.3 is no longer suppored. [#6020] + +- The bundled ERFA was updated to version 1.4.0. [#6239] + +- The bundled version of pytest has now been removed, but the + astropy.tests.helper.pytest import will continue to work properly. + Affiliated packages should nevertheless transition to importing pytest + directly rather than from astropy.tests.helper. This also means that + pytest is now a formal requirement for testing for both Astropy and + for affiliated packages. [#5694] + + +1.3.3 (2017-05-29) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug where ``StaticMatrixTransform`` erroneously copied frame + attributes from the input coordinate to the output frame. In practice, this + didn't actually affect any transforms in Astropy but may change behavior for + users who explicitly used the ``StaticMatrixTransform`` in their own code. + [#6045] + +- Fixed ``get_icrs_coordinates`` to loop through all the urls in case one + raises an exception. [#5864] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix table header not written out properly when ``fits.writeto()`` + convenience function is used. [#6042] + +- Fix writing out read-only arrays. [#6036] + +- Extension headers are written out properly when the ``fits.update()`` + convenience function is used. [#6058] + +- Angstrom, erg, G, and barn are no more reported as deprecated FITS units. + [#5929] + +astropy.table +^^^^^^^^^^^^^ + +- Fix problem with Table pprint/pformat raising an exception for + non-UTF-8 compliant bytestring data. [#6117] + +astropy.units +^^^^^^^^^^^^^ + +- Allow strings 'nan' and 'inf' as Quantity inputs. [#5958] + +- Add support for ``positive`` and ``divmod`` ufuncs (new in numpy 1.13). + [#5998, #6020, #6116] + +astropy.utils +^^^^^^^^^^^^^ + +- On systems that do not have ``pkg_resources`` non-numerical additions to + version numbers like ``dev`` or ``rc1`` are stripped in ``minversion`` to + avoid a ``TypeError`` in ``distutils.version.LooseVersion`` [#5944] + +- Fix ``auto_download`` setting ignored in ``Time.ut1``. [#6033] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fix bug in ManualInterval which caused the limits to be returned incorrectly + if set to zero, and fix defaults for ManualInterval in the presence of NaNs. + [#6088] + +- Get rid of warnings that occurred when slicing a cube due to the tick + locator trying to find ticks for the sliced axis. [#6104] + +- Accept normal Matplotlib keyword arguments in set_xlabel and set_ylabel + functions. [#5686, #5692, #6060] + +- Fix a bug that caused labels to be missing from frames with labels that + could change direction mid-axis, such as EllipticalFrame. Also ensure + that empty tick labels do not cause any warnings. [#6063] + + +1.3.2 (2017-03-30) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Ensure that checking equivalance of ``SkyCoord`` objects works with + non-scalar attributes [#5884, #5887] + +- Ensure that transformation to frames with multi-dimensional attributes + works as expected [#5890, #5897] + +- Make sure all ``BaseRepresentation`` objects can be output as strings. + [#5889, #5897] + +astropy.units +^^^^^^^^^^^^^ + +- Add support for ``heaviside`` ufunc (new in numpy 1.13). [#5920] + +astropy.utils +^^^^^^^^^^^^^ + +- Fix to allow the C-based _fast_iterparse() VOTable XML parser to + relloc() its buffers instead of overflowing them. [#5824, #5869] + + +Other Changes and Additions +--------------------------- + +- File permissions are revised in the released source distribution. [#5912] + + +1.3.1 (2017-03-18) +================== + +New Features +------------ + +astropy.utils +^^^^^^^^^^^^^ + +- The ``deprecated_renamed_argument`` decorator got a new ``pending`` + parameter to suppress the deprecation warnings. [#5761] + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Changed ``SkyCoord`` so that frame attributes which are not valid for the + current ``frame`` (but are valid for other frames) are stored on the + ``SkyCoord`` instance instead of the underlying ``frame`` instance (e.g., + setting ``relative_humidity`` on an ICRS ``SkyCoord`` instance.) [#5750] + +- Ensured that ``position_angle`` and ``separation`` give correct answers for + frames with different equinox (see #5722). [#5762] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix problem with padding bytes written for BinTable columns converted + from unicode [#5280, #5287, #5288, #5296]. + +- Fix out-of-order TUNITn cards when writing tables to FITS. [#5720] + +- Recognize PrimaryHDU when non boolean values are present for the + 'GROUPS' header keyword. [#5808] + +- Fix the insertion of new keywords in compressed image headers + (``CompImageHeader``). [#5866] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a problem with setting ``bounding_box`` on 1D models. [#5718] + +- Fixed a broadcasting problem with weighted fitting of 2D models + with ``LevMarLSQFitter``. [#5788] + +- Fixed a problem with passing kwargs to fitters, specifically ``verblevel``. [#5815] + +- Changed FittingWithOutlierRemoval to reject on the residual to the fit [#5831] + +astropy.stats +^^^^^^^^^^^^^ + +- Fix the psd normalization for Lomb-Scargle periodograms in the presence + of noise. [#5713] + +- Fix bug in the autofrequency range when ``minimum_frequency`` is specified + but ``maximum_frequency`` is not. [#5738] + +- Ensure that a masked array is returned when sigma clipping fully masked + data. [#5711] + +astropy.table +^^^^^^^^^^^^^ + +- Fix problem where key for caching column format function was not + sufficiently unique. [#5803] + +- Handle sorting NaNs and masked values in jsviewer. [#4052, #5572] + +- Ensure mixin columns can be added to a table using a scalar value for the + right-hand side if the type supports broadcasting. E.g., for an existing + ``QTable``, ``t['q'] = 3*u.m`` will now add a column as expected. [#5820] + +- Fixes the bug of setting/getting values from rows/columns of a table using + numpy array scalars. [#5772] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed problem where IrreducibleUnits could fail to unpickle. [#5868] + +astropy.utils +^^^^^^^^^^^^^ + +- Avoid importing ``ipython`` in ``utils.console`` until it is necessary, to + prevent deprecation warnings when importing, e.g., ``Column``. [#5755] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Avoid importing matplotlib.pyplot when importing + astropy.visualization.wcsaxes. [#5680, #5684] + +- Ignore Numpy warnings that happen in coordinate transforms in WCSAxes. + [#5792] + +- Fix compatibility issues between WCSAxes and Matplotlib 2.x. [#5786] + +- Fix a bug that caused WCSAxes frame visual properties to not be copied + over when resetting the WCS. [#5791] + +astropy.extern +^^^^^^^^^^^^^^ + +- Fixed a bug where PLY was overwriting its generated files. [#5728] + +Other Changes and Additions +--------------------------- + +- Fixed a deprecation warning that occurred when running tests with + astropy.test(). [#5689] + +- The deprecation of the ``clobber`` argument (originally deprecated in 1.3.0) + in the ``io.fits`` write functions was changed to a "pending" deprecation + (without displaying warnings) for now. [#5761] + +- Updated bundled astropy-helpers to v1.3.1. [#5880] + + +1.3 (2016-12-22) +================ + +New Features +------------ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- The ``convolve`` and ``convolve_fft`` arguments now support a ``mask`` keyword, + which allows them to also support ``NDData`` objects as inputs. [#5554] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Added an ``of_address`` classmethod to ``EarthLocation`` to enable fast creation of + ``EarthLocation`` objects given an address by querying the Google maps API [#5154]. + +- A new routine, ``get_body_barycentric_posvel`` has been added that allows + one to calculate positions as well as velocities for solar system bodies. + For JPL kernels, this roughly doubles the execution time, so if one requires + only the positions, one should use ``get_body_barycentric``. [#5231] + +- Transformations between coordinate systems can use the more accurate JPL + ephemerides. [#5273, #5436] + +- Arithmetic on representations, such as addition of two representations, + multiplication with a ``Quantity``, or calculating the norm via ``abs``, + has now become possible. Furthermore, there are new methods ``mean``, + ``sum``, ``dot``, and ``cross``. For all these, the representations are + treated as vectors in cartesian space (temporarily converting to + ``CartesianRepresentation`` if necessary). [#5301] + has now become possible. Furthermore, there are news methods ``mean``, + ``sum``, ``dot``, and ``cross`` with obvious meaning. [#5301] + multiplication with a ``Quantity`` has now become possible. Furthermore, + there are new methods ``norm``, ``mean``, ``sum``, ``dot``, and ``cross``. + In all operations, the representations are treated as vectors. They are + temporarily converted to ``CartesianRepresentation`` if necessary. [#5301] + +- ``CartesianRepresentation`` can be initialized with plain arrays by passing + in a ``unit``. Furthermore, for input with a vector array, the coordinates + no longer have to be in the first dimension, but can be at any ``xyz_axis``. + To complement the latter, a new ``get_xyz(xyz_axis)`` method allows one to + get a vector array out along a given axis. [#5439] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Files with "Fortran-style" columns (i.e. double-precision scientific notation + with a character other than "e", like ``1.495978707D+13``) can now be parsed by + the fast reader natively. [#5552] + +- Allow round-tripping masked data tables in most formats by using an + empty string ``''`` as the default representation of masked values + when writing. [#5347] + +- Allow reading HTML tables with unicode column values in Python 2.7. [#5410] + +- Check for self-consistency of ECSV header column names. [#5463] + +- Produce warnings when writing an IPAC table from an astropy table that + contains metadata not supported by the IPAC format. [#4700] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- "Lazy" loading of HDUs now occurs - when an HDU is requested, the file is + only read up to the point where that HDU is found. This can mean a + substantial speedup when accessing files that have many HDUs. [#5065] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Added ``io.misc.yaml`` module to support serializing core astropy objects + using the YAML protocol. [#5486] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Added ``delay_doc_updates`` contextmanager to postpone the formatting of + the documentation for the ``read`` and ``write`` methods of the class to + optionally reduce the import time. [#5275] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added a class to combine astropy fitters and functions to remove outliers + e. g., sigma clip. [#4760] + +- Added a ``Tabular`` model. [#5105] + +- Added ``Hermite1D`` and ``Hermite2D`` polynomial models [#5242] + +- Added the injection of EntryPoints into astropy.modeling.fitting if + they inherit from Fitters class. [#5241] + +- Added bounding box to ``Lorentz1D`` and ``MexicanHat1D`` models. [#5393] + +- Added ``Planar2D`` functional model. [#5456] + +- Updated ``Gaussian2D`` to accept no arguments (will use default x/y_stddev + and theta). [#5537] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Added ``keep`` and ``**kwargs`` parameter to ``support_nddata``. [#5477] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``axis`` keyword to ``biweight_location`` and + ``biweight_midvariance``. [#5127, #5158] + +astropy.table +^^^^^^^^^^^^^ + +- Allow renaming mixin columns. [#5469] + +- Support generalized value formatting for mixin columns in tables. [#5274] + +- Support persistence of table indices when pickling and copying table. [#5468] + +astropy.tests +^^^^^^^^^^^^^ + +- Install both runtime and test dependencies when running the + ./setup.py test command. These dependencies are specified by the + install_requires and tests_require keywords via setuptools. [#5092] + +- Enable easier subclassing of the TestRunner class. [#5505] + +astropy.time +^^^^^^^^^^^^ + +- ``light_travel_time`` can now use more accurate JPL ephemerides. [#5273, #5436] + +astropy.units +^^^^^^^^^^^^^ + +- Added ``pixel_scale`` and ``plate_scale`` equivalencies. [#4987] + +- The ``spectral_density`` equivalency now supports transformations of + luminosity density. [#5151] + +- ``Quantity`` now accepts strings consisting of a number and unit such + as '10 km/s'. [#5245] + +astropy.utils +^^^^^^^^^^^^^ + +- Added a new decorator: ``deprecated_renamed_argument``. This can be used to + rename a function argument, while it still allows for the use of the older + argument name. [#5214] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Added a ``make_lupton_rgb`` function to generate color images from three + greyscale images, following the algorithm of Lupton et al. (2004). [#5535] + +- Added ``data`` and ``interval`` inputs to the ``ImageNormalize`` + class. [#5206] + +- Added a new ``simple_norm`` convenience function. [#5206] + +- Added a default stretch for the ``Normalization`` class. [#5206]. + +- Added a default ``vmin/vmax`` for the ``ManualInterval`` class. + [#5206]. + +- The ``wcsaxes`` subpackage has now been integrated in astropy as + ``astropy.visualization.wcsaxes``. This allows plotting of astronomical + data/coordinate systems in Matplotlib. [#5496] + +astropy.wcs +^^^^^^^^^^^ + +- Improved ``footprint_to_file``: allow to specify the coordinate system, and + use by default the one from ``RADESYS``. Overwrite the file instead of + appending to it. [#5494] + + +API Changes +----------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- ``discretize_model`` now raises an exception if non-integer ranges are used. + Previously it had incorrect behavior but did not raise an exception. [#5538] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``SkyCoord``, ``ICRS``, and other coordinate objects, as well as the + underlying representations such as ``SphericalRepresentation`` and + ``CartesianRepresentation`` can now be reshaped using methods named like the + numpy ones for ``ndarray`` (``reshape``, ``swapaxes``, etc.) + [#4123, #5254, #5482] + +- The ``obsgeoloc`` and ``obsgeovel`` attributes of ``GCRS`` and + ``PrecessedGeocentric`` frames are now stored and returned as + ``CartesianRepresentation`` objects, rather than ``Quantity`` objects. + Similarly, ``EarthLocation.get_gcrs_posvel`` now returns a tuple of + ``CartesianRepresentation`` objects. [#5253] + +- ``search_around_3d`` and ``search_around_sky`` now return units + for the distance matching their input argument when no match is + found, instead of ``dimensionless_unscaled``. [#5528] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- ASCII writers now accept an 'overwrite' argument. + The default behavior is changed so that a warning will be + issued when overwriting an existing file unless ``overwrite=True``. + In a future version this will be changed from a warning to an + exception to prevent accidentally overwriting a file. [#5007] + +- The default representation of masked values when writing tables was + changed from ``'--'`` to the empty string ``''``. Previously any + user-supplied ``fill_values`` parameter would overwrite the class + default, but now the values are prepended to the class default. [#5347] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The old ``Header`` interface, deprecated since Astropy 0.1 (PyFITS 3.1), has + been removed entirely. See :ref:`header-transition-guide` for explanations + on this change and help on the transition. [#5310] + +- The following functions, classes and methods have been removed: + ``CardList``, ``Card.key``, ``Card.cardimage``, ``Card.ascardimage``, + ``create_card``, ``create_card_from_string``, ``upper_key``, + ``Header.ascard``, ``Header.rename_key``, ``Header.get_history``, + ``Header.get_comment``, ``Header.toTxtFile``, ``Header.fromTxtFile``, + ``new_table``, ``tdump``, ``tcreate``, ``BinTableHDU.tdump``, + ``BinTableHDU.tcreate``. + +- Removed ``txtfile`` argument to the ``Header`` constructor. + +- Removed usage of ``Header.update`` with ``Header.update(keyword, value, + comment)`` arguments. + +- Removed ``startColumn`` and ``endColumn`` arguments to the ``FITS_record`` + constructor. + +- The ``clobber`` argument in FITS writers has been renamed to + ``overwrite``. This change affects the following functions and + methods: ``tabledump``, ``writeto``, ``Header.tofile``, + ``Header.totextfile``, ``_BaseDiff.report``, + ``_BaseHDU.overwrite``, ``BinTableHDU.dump`` and + ``HDUList.writeto``. [#5171] + +- Added an optional ``copy`` parameter to ``fits.Header`` which controls if + a copy is made when creating an ``Header`` from another ``Header``. + [#5005, #5326] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- ``.fts`` and ``.fts.gz`` files will be automatically identified as + ``io.fits`` files if no explicit ``format`` is given. [#5211] + +- Added an optional ``readwrite`` parameter for ``get_formats`` to filter + formats for read or write. [#5275] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- ``Gaussian2D`` now raises an error if ``theta`` is set at the same time as + ``cov_matrix`` (previously ``theta`` was silently ignored). [#5537] + +astropy.table +^^^^^^^^^^^^^ + +- Setting an existing table column (e.g. ``t['a'] = [1, 2, 3]``) now defaults + to *replacing* the column with a column corresponding to the new value + (using ``t.replace_column()``) instead of doing an in-place update. Any + existing meta-data in the column (e.g. the unit) is discarded. An + in-place update is still done when the new value is not a valid column, + e.g. ``t['a'] = 0``. To force an in-place update use the pattern + ``t['a'][:] = [1, 2, 3]``. [#5556] + +- Allow ``collections.Mapping``-like ``data`` attribute when initializing a + ``Table`` object (``dict``-like was already possible). [#5213] + +astropy.tests +^^^^^^^^^^^^^ + +- The inputs to the ``TestRunner.run_tests()`` method now must be + keyword arguments (no positional arguments). This applies to the + ``astropy.test()`` function as well. [#5505] + +astropy.utils +^^^^^^^^^^^^^ + +- Renamed ``ignored`` context manager in ``compat.misc`` to ``suppress`` + to be consistent with https://bugs.python.org/issue19266 . [#5003] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Deprecated the ``scale_image`` function. [#5206] + +- The ``mpl_normalize`` module (containing the ``ImageNormalize`` + class) is now automatically imported with the ``visualization`` + subpackage. [#5491] + +astropy.vo +^^^^^^^^^^ + +- The ``clobber`` argument in ``VOSDatabase.to_json()`` has been + renamed to ``overwrite``. [#5171] + +astropy.wcs +^^^^^^^^^^^ + +- ``wcs.rotateCD()`` was deprecated without a replacement. [#5240] + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Transformations between CIRS and AltAz now correctly account for the + location of the observer. [#5591] + +- GCRS frames representing a location on Earth with multiple obstimes are now + allowed. This means that the solar system routines ``get_body``, + ``get_moon`` and ``get_sun`` now work with non-scalar times and a + non-geocentric observer. [#5253] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix issue with units or other astropy core classes stored in table meta. + [#5605] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Copying a ``fits.Header`` using ``copy`` or ``deepcopy`` from the ``copy`` + module will use ``Header.copy`` to ensure that modifying the copy will + not alter the other original Header and vice-versa. [#4990, #5323] + +- ``HDUList.info()`` no longer raises ``AttributeError`` in presence of + ``BZERO``. [#5508] + +- Avoid exceptions with numpy 1.10 and up when using scaled integer data + where ``BZERO`` has float type but integer value. [#4639, #5527] + +- Converting a header card to a string now calls ``self.verify('fix+warn')`` + instead of ``self.verify('fix')`` so headers with invalid keywords will + not raise a ``VerifyError`` on printing. [#887,#5054] + +- ``FITS_Record._convert_ascii`` now converts blank fields to 0 when a + non-blank null column value is set. [#5134, #5394] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- ``read`` now correctly raises an IOError if a file with an unknown + extension can't be found, instead of raising IORegistryError: + "Format could not be identified." [#4779] + +astropy.time +^^^^^^^^^^^^ + +- Ensure ``Time`` instances holding a single ``delta_ut1_utc`` can be copied, + flattened, etc. [#5225] + +astropy.units +^^^^^^^^^^^^^ + +- Operations involving ``Angle`` or ``Distance``, or any other + ``SpecificTypeQuantity`` instance, now also keep return an instance of the + same type if the instance was the second argument (if the resulting unit + is consistent with the specific type). [#5327] + +- Inplace operations on ``Angle`` and ``Distance`` instances now raise an + exception if the final unit is not equivalent to radian and meter, resp. + Similarly, views as ``Angle`` and ``Distance`` can now only be taken + from quantities with appropriate units, and views as ``Quantity`` can only + be taken from logarithmic quanties such as ``Magnitude`` if the physical + unit is dimensionless. [#5070] + +- Conversion from quantities to logarithmic units now correctly causes a + logarithmic quantity such as ``Magnitude`` to be returned. [#5183] + + +astropy.wcs +^^^^^^^^^^^ + +- SIP distortion for an alternate WCS is correctly initialized now by + looking at the "CTYPE" values matching the alternate WCS. [#5443] + +Other Changes and Additions +--------------------------- + +- The bundled ERFA was updated to version 1.3.0. This includes the + leap second planned for 2016 Dec 31. + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Initialization of ``Angle`` has been sped up for ``Quantity`` and ``Angle`` + input. [#4970] + +- The use of ``np.matrix`` instances in the transformations has been + deprecated, since this class does not allow stacks of matrices. As a + result, the semi-public functions ``angles.rotation_matrix`` and + ``angles.angle_axis`` are also deprecated, in favour of the new routines + with the same name in ``coordinates.matrix_utilities``. [#5104] + +- A new ``BaseCoordinateFrame.cache`` dictionary has been created to expose + the internal cache. This is useful when modifying representation data + in-place without using ``realize_frame``. Additionally, documentation for + in-place operations on coordinates were added. [#5575] + +- Coordinates and their representations are printed with a slightly different + format, following how numpy >= 1.12 prints structured arrays. [#5423] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The default cosmological model has been changed to Planck 2015, + and the citation strings have been updated. [#5372] + +astropy.extern +^^^^^^^^^^^^^^ + +- Updated the bundled ``six`` module to version 1.10.0. [#5521] + +- Updated the astropy shipped version of ``PLY`` to version 3.9. [#5526] + +- Updated the astropy shipped version of jQuery to v3.3.1, and dataTables + to v1.10.12. [#5564] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Performance improvements for tables with many columns. [#4985] + +- Removed obsolete code that was previously needed to properly + implement the append mode. [#4793] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Reduced the time spent in the ``get_formats`` function. This also reduces + the time it takes to import astropy subpackages, i.e. + ``astropy.coordinates``. [#5262] + +astropy.units +^^^^^^^^^^^^^ + +- The functions ``add_enabled_units``, ``set_enabled_equivalencies`` and + ``add_enabled_equivalencies`` have been sped up by copying the current + ``_UnitRegistry`` instead of building it from scratch. [#5306] + +- To build the documentation, the ``build_sphinx`` command has been deprecated + in favor of ``build_docs``. [#5179] + +- The ``--remote-data`` option to ``python setup.py test`` can now take + different arguments: ``--remote-data=none`` is the same as not specifying + ``--remote-data`` (skip all tests that require the internet), + ``--remote-data=astropy`` skips all tests that need remote data except those + that require only data from data.astropy.org, and ``--remote-data=any`` is + the same as ``--remote-data`` (run all tests that use remote data). [#5506] + +- The pytest ``recwarn`` fixture has been removed from the tests in favor of + ``utils.catch_warnings``. [#5489] + +- Deprecated escape sequences in strings (Python 3.6) have been removed. [#5489] + + +1.2.2 (2016-12-22) +================== + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a bug where the ``fill_values`` parameter was ignored when writing a + table to HTML format. [#5379] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Handle unicode FITS BinTable column names on Python 2 [#5204, #4805] + +- Fix reading of float values from ASCII tables, that could be read as + float32 instead of float64 (with the E and F formats). These values are now + always read as float64. [#5362] + +- Fixed memoryleak when using the compression module. [#5399, #5464] + +- Able to insert and remove lower case HIERARCH keywords in a consistent + manner [#5313, #5321] + +astropy.stats +^^^^^^^^^^^^^ + +- Fixed broadcasting in ``sigma_clip`` when using negative ``axis``. [#4988] + +astropy.table +^^^^^^^^^^^^^ + +- Assigning a logarithmic unit to a ``QTable`` column that did not have a + unit yet now correctly turns it into the appropriate function quantity + subclass (such as ``Magnitude`` or ``Dex``). [#5345] + +- Fix default value for ``show_row_index`` in ``Table.show_in_browser``. + [#5562] + +astropy.units +^^^^^^^^^^^^^ + +- For inverse trig functions that operate on quantities, catch any warnings + that occur from evaluating the function on the unscaled quantity value + between __array_prepare__ and __array_wrap__. [#5153] + +- Ensure ``!=`` also works for function units such as ``MagUnit`` [#5345] + +astropy.wcs +^^^^^^^^^^^ + +- Fix use of the ``relax`` keyword in ``to_header`` when used to change the + output precision. [#5164] + +- ``wcs.to_header(relax=True)`` adds a "-SIP" suffix to ``CTYPE`` when SIP + distortion is present in the WCS object. [#5239] + +- Improved log messages in ``to_header``. [#5239] + +Other Changes and Additions +--------------------------- + +- The bundled ERFA was updated to version 1.3.0. This includes the + leap second planned for 2016 Dec 31. + +astropy.stats +^^^^^^^^^^^^^ + +- ``poisson_conf_interval`` with ``'kraft-burrows-nousek'`` interval is now + faster and useable with SciPy versions < 0.14. [#5064, #5290] + + + +1.2.1 (2016-06-22) +================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed a bug that caused TFIELDS to not be in the correct position in + compressed image HDU headers under certain circumstances, which created + invalid FITS files. [#5118, #5125] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed an ``ImportError`` that occurred whenever ``astropy.constants`` was + imported before ``astropy.units``. [#5030, #5121] + +- Magnitude zero points used to define ``STmag``, ``ABmag``, ``M_bol`` and + ``m_bol`` are now collected in ``astropy.units.magnitude_zero_points``. + They are not enabled as regular units by default, but can be included + using ``astropy.units.magnitude_zero_points.enable()``. This makes it + possible to round-trip magnitudes as originally intended. [#5030] + +1.2 (2016-06-19) +================ + +General +------- + +- Astropy now requires Numpy 1.7.0 or later. [#4784] + +New Features +------------ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Add ``L_bol0``, the luminosity corresponding to absolute bolometric + magnitude zero. [#4262] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``CartesianRepresentation`` now includes a transform() method that can take + a 3x3 matrix to transform coordinates. [#4860] + +- Solar system and lunar ephemerides accessible via ``get_body``, + ``get_body_barycentric`` and ``get_moon`` functions. [#4890] + +- Added astrometric frames (i.e., a frame centered on a particular + point/object specified in another frame). [#4909, #4941] + +- Added ``SkyCoord.spherical_offsets_to`` method. [#4338] + +- Recent Earth rotation (IERS) data are now auto-downloaded so that AltAz + transformations for future dates now use the most accurate available + rotation values. [#4436] + +- Add support for heliocentric coordinate frames. [#4314] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- ``angular_diameter_distance_z1z2`` now supports the computation of + the angular diameter distance between a scalar and an array like + argument. [#4593] The method now supports models with negative + Omega_k0 (positive curvature universes) [#4661] and allows z2 < z1. + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- File name could be passed as ``Path`` object. [#4606] + +- Check that columns in ``formats`` specifier exist in the output table + when writing. [#4508, #4511] + +- Allow trailing whitespace in the IPAC header lines. [#4758] + +- Updated to filter out the default parser warning of BeautifulSoup. + [#4551] + +- Added support for reading and writing reStructuredText simple tables. + [#4812] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- File name could be passed as ``Path`` object. [#4606] + +- Header allows a dictionary-like cards argument during creation. [#4663] + +- New function ``convenience.table_to_hdu`` to allow creating a FITS + HDU object directly from an astropy ``Table``. [#4778] + +- New optional arguments ``ignore_missing`` and ``remove_all`` are added + to ``astropy.io.fits.header.remove()``. [#5020] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Added custom ``IORegistryError``. [#4833] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- File name could be passed as ``Path`` object. [#4606] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added the fittable=True attribute to the Scale and Shift models with tests. [#4718] + +- Added example plots to docstrings for some build-in models. [#4008] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``UnknownUncertainty`` new subclass of ``NDUncertainty`` that can be used to + save uncertainties that cannot be used for error propagation. [#4272] + +- ``NDArithmeticMixin``: ``add``, ``subtract``, ``multiply`` and ``divide`` + can be used as classmethods but require that two operands are given. These + operands don't need to be NDData instances but they must be convertible to + NDData. This conversion is done internally. Using it on the instance does + not require (but also allows) two operands. [#4272, #4851] + +- ``NDDataRef`` new subclass that implements ``NDData`` together with all + currently available mixins. This class does not implement additional + attributes, methods or a numpy.ndarray-like interface like ``NDDataArray``. + attributes, methods or a numpy.ndarray-like interface like ``NDDataArray``. + [#4797] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``axis`` keyword for ``mad_std`` function. [#4688, #4689] + +- Added Bayesian and Akaike Information Criteria. [#4716] + +- Added Bayesian upper limits for Poisson count rates. [#4622] + +- Added ``circstats``; a module for computing circular statistics. [#3705, #4472] + +- Added ``jackknife`` resampling method. [#3708, #4439] + +- Updated ``bootstrap`` to allow bootstrapping statistics with multiple + outputs. [#3601] + +- Added ``LombScargle`` class to compute Lomb-Scargle periodograms [#4811] + +astropy.table +^^^^^^^^^^^^^ + +- ``Table.show_in_notebook`` and ``Table.show_in_browser(jsviewer=True)`` now + yield tables with an "idx" column, allowing easy identification of the index + of a row even when the table is re-sorted in the browser. [#4404] + +- Added ``AttributeError`` when trying to set mask on non-masked table. [#4637] + +- Allow to use a tuple of keys in ``Table.sort``. [#4671] + +- Added ``itercols``; a way to iterate through columns of a table. [#3805, + #4888] + +- ``Table.show_in_notebook`` and the default notebook display (i.e., + ``Table._repr_html_``) now use consistent table styles which can be set + using the ``astropy.table.default_notebook_table_class`` configuration + item. [#4886] + +- Added interface to create ``Table`` directly from any table-like object + that has an ``__astropy_table__`` method. [#4885] + +astropy.tests +^^^^^^^^^^^^^ + +- Enable test runner to obtain documentation source files from directory + other than "docs". [#4748] + +astropy.time +^^^^^^^^^^^^ + +- Added caching of scale and format transformations for improved performance. + [#4422] + +- Recent Earth rotation (IERS) data are now auto-downloaded so that UT1 + transformations for future times now work out of the box. [#4436] + +- Add support for barycentric/heliocentric time corrections. [#4314] + +astropy.units +^^^^^^^^^^^^^ + +- The option to use tuples to indicate fractional powers of units, + deprecated in 0.3.1, has been removed. [#4449] + +- Added slug to imperial units. [#4670] + +- Added Earth radius (``R_earth``) and Jupiter radius (``R_jup``) to units. + [#4818] + +- Added a ``represents`` property to allow access to the definition of a + named unit (e.g., ``u.kpc.represents`` yields ``1000 pc``). [#4806] + +- Add bolometric absolute and apparent magnitudes, ``M_bol`` and ``m_bol``. + [#4262] + +astropy.utils +^^^^^^^^^^^^^ + +- ``Path`` object could be passed to ``get_readable_fileobj``. [#4606] + +- Implemented a generic and extensible way of merging metadata. [#4459] + +- Added ``format_doc`` decorator which allows to replace and/or format the + current docstring of an object. [#4242] + +- Added a new context manager ``set_locale`` to temporarily set the + current locale. [#4363] + +- Added new IERS_Auto class to auto-download recent IERS (Earth rotation) + data when required by coordinate or time transformations. [#4436] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Add zscale interval based on Numdisplay's implementation. [#4776] + +API changes +----------- + +astropy.config +^^^^^^^^^^^^^^ + +- The deprecated ``ConfigurationItem`` and ``ConfigAlias`` classes and the + ``save_config``, ``get_config_items``, and ``generate_all_config_items`` + functions have now been removed. [#2767, #4446] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Removed compatibility layer for pre-v0.4 API. [#4447] + +- Added ``copy`` keyword-only argument to allow initialization without + copying the (possibly large) input coordinate arrays. [#4883] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Improve documentation of z validity range of cosmology objects [#4882, #4949] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Add a way to control HTML escaping when writing a table as an HTML file. [#4423] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Two optional boolean arguments ``ignore_missing`` and ``remove_all`` are + added to ``Header.remove``. [#5020] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Renamed ``Redshift`` model to ``RedshiftScaleFactor``. [#3672] + +- Inputs (``coords`` and ``out``) to ``render`` function in ``Model`` are + converted to float. [#4697] + +- ``RotateNative2Celestial`` and ``RotateCelestial2Native`` are now + implemented as subclasses of ``EulerAngleRotation``. [#4881, #4940] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``NDDataBase`` does not set the private uncertainty property anymore. This + only affects you if you subclass ``NDDataBase`` directly. [#4270] + +- ``NDDataBase``: the ``uncertainty``-setter is removed. A similar one is + added in ``NDData`` so this also only affects you if you subclassed + ``NDDataBase`` directly. [#4270] + +- ``NDDataBase``: ``uncertainty``-getter returns ``None`` instead of the + private uncertainty and is now abstract. This getter is moved to + ``NDData`` so it only affects direct subclasses of ``NDDataBase``. [#4270] + +- ``NDData`` accepts a Quantity-like data and an explicitly given unit. + Before a ValueError was raised in this case. The final instance will use the + explicitly given unit-attribute but doesn't check if the units are + convertible and the data will not be scaled. [#4270] + +- ``NDData`` : the given mask, explicit or implicit if the data was masked, + will be saved by the setter. It will not be saved directly as the private + attribute. [#4879] + +- ``NDData`` accepts an additional argument ``copy`` which will copy every + parameter before it is saved as attribute of the instance. [#4270] + +- ``NDData``: added an ``uncertainty.getter`` that returns the private + attribute. It is equivalent to the old ``NDDataBase.uncertainty``-getter. + [#4270] + +- ``NDData``: added an ``uncertainty.setter``. It is slightly modified with + respect to the old ``NDDataBase.uncertainty``-setter. The changes include: + +- if the uncertainty has no uncertainty_type an info message is printed + instead of a TypeError and the uncertainty is saved as + ``UnknownUncertainty`` except the uncertainty is None. [#4270] + +- the requirement that the uncertainty_type of the uncertainty needs to be a + string was removed. [#4270] + +- if the uncertainty is a subclass of NDUncertainty the parent_nddata + attribute will be set so the uncertainty knows to which data it belongs. + This is also a Bugfix. [#4152, #4270] + +- ``NDData``: added a ``meta``-getter, which will set and return an empty + OrderedDict if no meta was previously set. [#4509, #4469] + +- ``NDData``: added an ``meta``-setter. It requires that the meta is + dictionary-like (it also accepts Headers or ordered dictionaries and others) + or None. [#4509, #4469, #4921] + +- ``NDArithmeticMixin``: The operand in arithmetic methods (``add``, ...) + doesn't need to be a subclass of ``NDData``. It is sufficient if it can be + converted to one. This conversion is done internally. [#4272] + +- ``NDArithmeticMixin``: The arithmetic methods allow several new arguments to + control how or if different attributes of the class will be processed during + the operation. [#4272] + +- ``NDArithmeticMixin``: Giving the parameter ``propagate_uncertainties`` as + positional keyword is deprecated and will be removed in the future. You now + need to specify it as keyword-parameter. Besides ``True`` and ``False`` also + ``None`` is now a valid value for this parameter. [#4272, #4851] + +- ``NDArithmeticMixin``: The wcs attribute of the operands is not compared and + thus raises no ValueError if they differ, except if a ``compare_wcs`` + parameter is specified. [#4272] + +- ``NDArithmeticMixin``: The arithmetic operation was split from a general + ``_arithmetic`` method to different specialized private methods to allow + subclasses more control on how the attributes are processed without + overriding ``_arithmetic``. The ``_arithmetic`` method is now used to call + these other methods. [#4272] + +- ``NDSlicingMixin``: If the attempt at slicing the mask, wcs or uncertainty + fails with a ``TypeError`` a Warning is issued instead of the TypeError. [#4271] + +- ``NDUncertainty``: ``support_correlated`` attribute is deprecated in favor of + ``supports_correlated`` which is a property. Also affects + ``StdDevUncertainty``. [#4272] + +- ``NDUncertainty``: added the ``__init__`` that was previously implemented in + ``StdDevUncertainty`` and takes an additional ``unit`` parameter. [#4272] + +- ``NDUncertainty``: added a ``unit`` property without setter that returns the + set unit or if not set the unit of the parent. [#4272] + +- ``NDUncertainty``: included a ``parent_nddata`` property similar to the one + previously implemented in StdDevUncertainty. [#4272] + +- ``NDUncertainty``: added an ``array`` property with setter. The setter will + convert the value to a plain numpy array if it is a list or a subclass of a + numpy array. [#4272] + +- ``NDUncertainty``: ``propagate_multiply`` and similar were removed. Before + they were abstract properties and replaced by methods with the same name but + with a leading underscore. The entry point for propagation is a method + called ``propagate``. [#4272] + +- ``NDUncertainty`` and subclasses: implement a representation (``__repr__``). + [#4787] + +- ``StdDevUncertainty``: error propagation allows an explicitly given + correlation factor, which may be a scalar or an array which will be taken + into account during propagation. + This correlation must be determined manually and is not done by the + uncertainty! [#4272] + +- ``StdDevUncertainty``: the ``array`` is converted to a plain numpy array + only if it's a list or a subclass of numpy.ndarray. Previously it was always + cast to a numpy array but also allowed subclasses. [#4272] + +- ``StdDevUncertainty``: setting the ``parent_nddata`` does not compare if the + shape of it's array is identical to the parents data shape. [#4272] + +- ``StdDevUncertainty``: the ``array.setter`` doesn't compare if the array has + the same shape as the parents data. [#4272] + +- ``StdDevUncertainty``: deprecated ``support_correlated`` in favor of + ``supports_correlated``. [#4272, #4828] + +- ``StdDevUncertainty``: deprecated ``propagate_add`` and similar methods in + favor of ``propagate``. [#4272, #4828] + +- Allow ``data`` to be a named argument in ``NDDataArray``. [#4626] + +astropy.table +^^^^^^^^^^^^^ + +- ``operations.unique`` now has a ``keep`` parameter, which allows + one to select whether to keep the first or last row in a set of + duplicate rows, or to remove all rows that are duplicates. [#4632] + +- ``QTable`` now behaves more consistently by making columns act as a + ``Quantity`` even if they are assigned a unit after the table is + created. [#4497, #4884] + +astropy.units +^^^^^^^^^^^^^ + +- Remove deprecated ``register`` argument for Unit classes. [#4448] + +astropy.utils +^^^^^^^^^^^^^ + +- The astropy.utils.compat.argparse module has now been deprecated. Use the + Python 'argparse' module directly instead. [#4462] + +- The astropy.utils.compat.odict module has now been deprecated. Use the + Python 'collections' module directly instead. [#4466] + +- The astropy.utils.compat.gzip module has now been deprecated. Use the + Python 'gzip' module directly instead. [#4464] + +- The deprecated ``ScienceStateAlias`` class has been removed. [#2767, #4446] + +- The astropy.utils.compat.subprocess module has now been deprecated. Use the + Python 'subprocess' module instead. [#4483] + +- The astropy.utils.xml.unescaper module now also unescapes ``'%2F'`` to + ``'/'`` and ``'&&'`` to ``'&'`` in a given URL. [#4699] + +- The astropy.utils.metadata.MetaData descriptor has now two optional + parameters: doc and copy. [#4921] + +- The default IERS (Earth rotation) data now is now auto-downloaded via a + new class IERS_Auto. When extrapolating UT1-UTC or polar motion values + outside the available time range, the values are now clipped at the last + available value instead of being linearly extrapolated. [#4436] + +astropy.wcs +^^^^^^^^^^^ + +- WCS objects can now be initialized with an ImageHDU or + PrimaryHDU object. [#4493, #4505] + +- astropy.wcs now issues an INFO message when the header has SIP coefficients but + "-SIP" is missing from CTYPE. [#4814] + +Bug fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Ameliorate a problem with ``get_sun`` not round-tripping due to + approximations in the light deflection calculation. [#4952] + +- Ensure that ``angle_utilities.position_angle`` accepts floats, as stated + in the docstring. [#3800] + +- Ensured that transformations for ``GCRS`` frames are correct for + non-geocentric observers. [#4986] + +- Fixed a problem with the ``Quantity._repr_latex_`` method causing errors + when showing an ``EarthLocation`` in a Jupyter notebook. [#4542, #5068] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a problem where the fast reader (with use_fast_converter=False) can + fail on non-US locales. [#4363] + +- Fix astropy.io.ascii.read handling of units for IPAC formatted files. + Columns with no unit are treated as unitless not dimensionless. [#4867, + #4947] + +- Fix problems the header parsing in the sextractor reader. [#4603, #4910] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``GroupsHDU.is_image`` property is now set to ``False``. [#4742] + +- Ensure scaling keywords are removed from header when unsigned integer data + is converted to signed type. [#4974, #5053] + +- Made TFORMx keyword check more flexible in test of compressed images to + enable compatibility of the test with cfitsio 3.380. [#4646, #4653] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- The astropy.io.votable.validator.html module is updated to handle division + by zero when generating validation report. [#4699] + +- KeyError when converting Table v1.2 numeric arrays fixed. [#4782] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Refactored ``AiryDisk2D``, ``Sersic1D``, and ``Sersic2D`` models + to be able to combine them as classes as well as instances. [#4720] + +- Modified the "LevMarLSQFitter" class to use the weights in the + calculation of the Jacobian. [#4751] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``NDData`` giving masked_Quantities as data-argument will use the + implicitly passed mask, unit and value. [#4270] + +- ``NDData`` using a subclass implementing ``NDData`` with + ``NDArithmeticMixin`` now allows error propagation. [#4270] + +- Fixed memory leak that happened when uncertainty of ``NDDataArray`` was + set. [#4825, #4862] + +- ``StdDevUncertainty``: During error propagation the unit of the uncertainty + is taken into account. [#4272] + +- ``NDArithmeticMixin``: ``divide`` and ``multiply`` yield correct + uncertainties if only one uncertainty is set. [#4152, #4272] + +astropy.stats +^^^^^^^^^^^^^ + +- Fix ``sigma_clipped_stats`` to use the ``axis`` argument. [#4726, #4808] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed bug where Tables created from existing Table objects were not + inheriting the ``primary_key`` attribute. [#4672, #4930] + +- Provide more detail in the error message when reading a table fails due to a + problem converting column string values. [#4759] + +astropy.units +^^^^^^^^^^^^^ + +- Exponentiation using a ``Quantity`` with a unit equivalent to dimensionless + as base and an ``array``-like exponent yields the correct result. [#4770] + +- Ensured that with ``spectral_density`` equivalency one could also convert + between ``photlam`` and ``STmag``/``ABmag``. [#5017] + +astropy.utils +^^^^^^^^^^^^^ + +- The astropy.utils.compat.fractions module has now been deprecated. Use the + Python 'fractions' module directly instead. [#4463] + +- Added ``format_doc`` decorator which allows to replace and/or format the + current docstring of an object. [#4242] + +- Attributes using the astropy.utils.metadata.MetaData descriptor are now + included in the sphinx documentation. [#4921] + +astropy.vo +^^^^^^^^^^ + +- Relaxed expected accuracy of Cone Search prediction test to reduce spurious + failures. [#4382] + +astropy.wcs +^^^^^^^^^^^ + +- astropy.wcs.to_header removes "-SIP" from CTYPE when SIP coefficients + are not written out, i.e. ``relax`` is either ``False`` or ``None``. + astropy.wcs.to_header appends "-SIP" to CTYPE when SIP coefficients + are written out, i.e. ``relax=True``. [#4814] + +- Made ``wcs.bounds_check`` call ``wcsprm_python2c``, which means it + works even if ``wcs.set`` has not been called yet. [#4957, #4966]. + +- WCS objects can no longer be reverse-indexed, which was technically + permitted but incorrectly implemented previously [#4962] + +Other Changes and Additions +--------------------------- + +- Python 2.6 is no longer supported. [#4486] + +- The bundled version of py.test has been updated to 2.8.3. [#4349] + +- Reduce Astropy's import time (``import astropy``) by almost a factor 2. [#4649] + +- Cython prerequisite for building changed to v0.19 in install.rst [#4705, + #4710, #4719] + +- All astropy.modeling functionality that was deprecated in Astropy 1.0 has + been removed. [#4857] + +- Added instructions for installing Astropy into CASA. [#4840] + +- Added an example gallery to the docs demonstrating short + snippets/examples. [#4734] + + +1.1.2 (2016-03-10) +================== + +New Features +------------ + +astropy.wcs +^^^^^^^^^^^ + +- The ``astropy.wcs`` module now exposes ``WCSHDO_P*`` constants that can be + used to allow more control over output precision when using the ``relax`` + keyword argument. [#4616] + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed handling of CDS data file when no description is given and also + included stripping out of markup for missing value from description. [#4437, #4474] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed possible segfault during error handling in FITS tile + compression. [#4489] + +- Fixed crash on pickling of binary table columns with the 'X', 'P', or + 'Q' format. [#4514] + +- Fixed memory / reference leak that could occur when copying a ``FITS_rec`` + object (the ``.data`` for table HDUs). [#520] + +- Fixed a memory / reference leak in ``FITS_rec`` that occurred in a wide + range of cases, especially after writing FITS tables to a file, but in + other cases as well. [#4539] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fix a bug to allow instantiation of a modeling class having a parameter + with a custom setter that takes two parameters ``(value, model)`` [#4656] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed bug when replacing a table column with a mixin column like + Quantity or Time. [#4601] + +- Disable initial ordering in jsviewer (``show_in_browser``, + ``show_in_notebook``) to respect the order from the Table. [#4628] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed sphinx issues on plotting quantities. [#4527] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed latex representation of function units. [#4563] + +- The ``zest.releaser`` hooks included in Astropy are now injected locally to + Astropy, rather than being global. [#4650] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed ``fits2bitmap`` script to allow ext flag to contain extension + names or numbers. [#4468] + +- Fixed ``fits2bitmap`` default output filename generation for + compressed FITS files. [#4468] + +- Fixed ``quantity_support`` to ensure its conversion returns ndarray + instances (needed for numpy >=1.10). [#4654] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed possible exception in handling of SIP headers that was introduced in + v1.1.1. [#4492] + +- Fixed a bug that caused WCS objects with a high dynamic range of values for + certain parameters to lose precision when converted to a header. This + occurred for example in cases of spectral cubes, where a spectral axis in + Hz might have a CRVAL3 value greater than 1e10 but the spatial coordinates + would have CRVAL1/2 values 8 to 10 orders of magnitude smaller. This bug + was present in Astropy 1.1 and 1.1.1 but not 1.0.x. This has now been fixed + by ensuring that all WCS keywords are output with 14 significant figures by + default. [#4616] + +Other Changes and Additions +--------------------------- + +- Updated bundled astropy-helpers to v1.1.2. [#4678] + +- Updated bundled copy of WCSLIB to 5.14. [#4579] + + +1.1.1 (2016-01-08) +================== + +New Features +------------ + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Allow ``pathlib.Path`` objects (available in Python 3.4 and later) for + specifying the file name in registry read / write functions. [#4405] + +astropy.utils +^^^^^^^^^^^^^ + +- ``console.human_file_size`` now accepts quantities with byte-equivalent + units [#4373] + +Bug Fixes +--------- + +astropy.analytic_functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed the blackbody functions' handling of overflows on some platforms + (Windows with MSVC, older Linux versions) with a buggy ``expm1`` function. + [#4393] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed an bug where updates to string columns in FITS tables were not saved + on Python 3. [#4452] + +Other Changes and Additions +--------------------------- + +- Updated bundled astropy-helpers to v1.1.1. [#4413] + + +1.1 (2015-12-11) +================ + +New Features +------------ + +astropy.config +^^^^^^^^^^^^^^ + +- Added new tools ``set_temp_config`` and ``set_temp_cache`` which can be + used either as function decorators or context managers to temporarily + use alternative directories in which to read/write the Astropy config + files and download caches respectively. This is especially useful for + testing, though ``set_temp_cache`` may also be used as a way to provide + an alternative (application specific) download cache for large data files, + rather than relying on the default cache location in users' home + directories. [#3975] + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Added the Thomson scattering cross-section. [#3839] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Added Moffat2DKernel. [#3965] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Added ``get_constellation`` function and ``SkyCoord.get_constellation`` + convenience method to determine the constellation that a coordinate + is in. [#3758] + +- Added ``PrecessedGeocentric`` frame, which is based on GCRS, but precessed + to a specific requested mean equinox. [#3758] + +- Added ``Supergalactic`` frame to support de Vaucouleurs supergalactic + coordinates. [#3892] + +- ``SphericalRepresentation`` now has a ``._unit_representation`` class attribute to specify + an equivalent UnitSphericalRepresentation. This allows subclasses of + representations to pair up correctly. [#3757] + +- Added functionality to support getting the locations of observatories by + name. See ``astropy.coordinates.EarthLocation.of_site``. [#4042] + +- Added ecliptic coordinates, including ``GeocentricTrueEcliptic``, + ``BarycentricTrueEcliptic``, and ``HeliocentricTrueEcliptic``. [#3749] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Add Planck 2015 cosmology [#3476] + +- Distance calculations now > 20-40x faster for the supplied + cosmologies due to implementing Cython scalar versions of + ``FLRW.inv_efunc``.[#4127] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Automatically use ``guess=False`` when reading if the file ``format`` is + provided and the format parameters are uniquely specified. This update + also removes duplicate format guesses to improve performance. [#3418] + +- Calls to ascii.read() for fixed-width tables may now omit one of the keyword + arguments ``col_starts`` or ``col_ends``. Columns will be assumed to begin and + end immediately adjacent to each other. [#3657] + +- Add a function ``get_read_trace()`` that returns a traceback of the + attempted read formats for the last call to ``astropy.io.ascii.read``. [#3688] + +- Supports LZMA decompression via ``get_readable_fileobj`` [#3667] + +- Allow ``-`` character is Sextractor format column names. [#4168] + +- Improve DAOphot reader to read multi-aperture files [#3535, #4207] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Support reading and writing from bzip2 compressed files. i.e. ``.fits.bz2`` + files. [#3789] + +- Included a new command-line script called ``fitsinfo`` to display + a summary of the HDUs in one or more FITS files. [#3677] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Support saving all meta information, description and units of tables and columns + in HDF5 files [#4103] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- A new method was added to ``astropy.io.votable.VOTable``, + ``get_info_by_id`` to conveniently find an ``INFO`` element by its + ``ID`` attribute. [#3633] + +- Instances in the votable tree now have better ``__repr__`` methods. [#3639] + +astropy.logger.py +^^^^^^^^^^^^^^^^^ + +- Added log levels (e.g., DEBUG, INFO, CRITICAL) to ``astropy.log`` [#3947] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added a new ``Parameter.validator`` interface for setting a validation + method on individual model parameters. See the ``Parameter`` + documentation for more details. [#3910] + +- The projection classes that are named based on the 3-letter FITS + WCS projections (e.g. ``Pix2Sky_TAN``) now have aliases using + longer, more descriptive names (e.g. ``Pix2Sky_Gnomonic``). + [#3583] + +- All of the standard FITS WCS projection types have been + implemented in ``astropy.modeling.projections`` (by wrapping + WCSLIB). [#3906] + +- Added ``Sersic1D`` and ``Sersic2D`` model classes. [#3889] + +- Added the Voigt profile to existing models. [#3901] + +- Added ``bounding_box`` property and ``render_model`` function [#3909] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Added ``block_reduce`` and ``block_replicate`` functions. [#3453] + +- ``extract_array`` now offers different options to deal with array + boundaries [#3727] + +- Added a new ``Cutout2D`` class to create postage stamp image cutouts + with optional WCS propagation. [#3823] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``sigma_lower`` and ``sigma_upper`` keywords to + ``sigma_clip`` to allow for non-symmetric clipping. [#3595] + +- Added ``cenfunc``, ``stdfunc``, and ``axis`` keywords to + ``sigma_clipped_stats``. [#3792] + +- ``sigma_clip`` automatically masks invalid input values (NaNs, Infs) before + performing the clipping [#4051] + +- Added the ``histogram`` routine, which is similar to ``np.histogram`` but + includes several additional options for automatic determination of optimal + histogram bins. Associated helper routines include ``bayesian_blocks``, + ``friedman_bin_width``, ``scott_bin_width``, and ``knuth_bin_width``. + This functionality was ported from the astroML library. [#3756] + +- Added the ``bayesian_blocks`` routine, which implements a dynamic algorithm + for locating change-points in various time series. [#3756] + +- A new function ``poisson_conf_interval()`` was added to allow easy calculation + of several standard formulae for the error bars on the mean of a Poisson variable + estimated from a single sample. + +astropy.table +^^^^^^^^^^^^^ + +- ``add_column()`` and ``add_columns()`` now have ``rename_duplicate`` + option to rename new column(s) rather than raise exception when its name + already exists. [#3592] + +- Added ``Table.to_pandas`` and ``Table.from_pandas`` for converting to/from + pandas dataframes. [#3504] + +- Initializing a ``Table`` with ``Column`` objects no longer requires + that the column ``name`` attribute be defined. [#3781] + +- Added an ``info`` property to ``Table`` objects which provides configurable + summary information about the table and its columns. [#3731] + +- Added an ``info`` property to column classes (``Column`` or mixins). This + serves a dual function of providing configurable summary information about + the column, and acting as a manager of column attributes such as + name, format, or description. [#3731] + +- Updated table and column representation to use the ``dtype_info_name`` + function for the dtype value. Removed the default "masked=False" + from the table representation. [#3868, #3869] + +- Updated row representation to be consistent with the corresponding + table representation for that row. Added HTML representation so a + row displays nicely in IPython notebook. + +- Added a new table indexing engine allowing for the creation of + indices on one or more columns of a table using ``add_index``. These + indices enable new functionality such as searching for rows by value + using ``loc`` and ``iloc``, as well as increased performance for + certain operations. [#3915, #4202] + +- Added capability to include a structured array or recarray in a table + as a mixin column. This allows for an approximation of nested tables. + [#3925] + +- Added ``keep_byteorder`` option to ``Table.as_array()``. See the + "API Changes" section below. [#4080] + +- Added a new method ``Table.replace_column()`` to replace an existing + column with a new data column. [#4090] + +- Added a ``tableclass`` option to ``Table.pformat()`` to allow specifying + a list of CSS classes added to the HTML table. [#4131] + +- New CSS for jsviewer table [#2917, #2982, #4174] + +- Added a new ``Table.show_in_notebook`` method that shows an interactive view + of a Table (similar to ``Table.show_in_browser(jsviewer=True)``) in an + Python/Jupyter notebook. [#4197] + +- Added column alignment formatting for better pprint viewing + experience. [#3644] + +astropy.tests +^^^^^^^^^^^^^ + +- Added new test config options, ``config_dir`` and ``cache_dir`` (these + can be edited in ``setup.cfg`` or as extra command-line options to + py.test) for setting the locations to use for the Astropy config files + and download caches (see also the related ``set_temp_config/cache`` + features added in ``astropy.config``). [#3975] + +astropy.time +^^^^^^^^^^^^ + +- Add support for FITS standard time strings. [#3547] + +- Allow the ``format`` attribute to be updated in place to change the + default representation of a ``Time`` object. [#3673] + +- Add support for shape manipulation (reshape, ravel, etc.). [#3224] + +- Add argmin, argmax, argsort, min, max, ptp, sort methods. [#3681] + +- Add ``Time.to_datetime`` method for converting ``Time`` objects to + timezone-aware datetimes. [#4119, #4124] + +astropy.units +^^^^^^^^^^^^^ + +- Added furlong to imperial units. [#3529] + +- Added mil to imperial units. [#3716] + +- Added stone to imperial units. [#4192] + +- Added Earth Mass (``M_earth``) and Jupiter mass (``M_jup``) to units [#3907] + +- Added support for functional units, in particular the logarithmic ones + ``Magnitude``, ``Decibel``, and ``Dex``. [#1894] + +- Quantities now work with the unit support in matplotlib. See + :ref:`plotting-quantities`. [#3981] + +- Clarified imperial mass measurements and added pound force (lbf), + kilopound (kip), and pound per square inch (psi). [#3409] + +astropy.utils +^^^^^^^^^^^^^ + +- Added new ``OrderedDescriptor`` and ``OrderedDescriptorContainer`` utility + classes that make it easier to implement classes with declarative APIs, + wherein class-level attributes have an inherit "ordering" to them that is + specified by the order in which those attributes are defined in the class + declaration (by defining them using special descriptors that have + ``OrderedDescriptor`` as a base class). See the API documentation for + these classes for more details. Coordinate frames and models now use this + interface. [#3679] + +- The ``get_pkg_data_*`` functions now take an optional ``package`` argument + which allows specifying any package to read package data filenames or + content out of, as opposed to only being able to use data from the package + that the function is called from. [#4079] + +- Added function ``dtype_info_name`` to the ``data_info`` module to provide + the name of a ``dtype`` for human-readable informational purposes. [#3868] + +- Added ``classproperty`` decorator--this is to ``property`` as + ``classmethod`` is to normal instance methods. [#3982] + +- ``iers.open`` now handles network URLs, as well as local paths. [#3850] + +- The ``astropy.utils.wraps`` decorator now takes an optional + ``exclude_args`` argument not shared by the standard library ``wraps`` + decorator (as it is unique to the Astropy version's ability of copying + the wrapped function's argument signature). ``exclude_args`` allows + certain arguments on the wrapped function to be excluded from the signature + of the wrapper function. This is particularly useful when wrapping an + instance method as a function (to exclude the ``self`` argument). [#4017] + +- ``get_readable_fileobj`` can automatically decompress LZMA ('.xz') + files using the ``lzma`` module of Python 3.3+ or, when available, the + ``backports.lzma`` package on earlier versions. [#3667] + +- The ``resolve_name`` utility now accepts any number of additional + positional arguments that are automatically dotted together with the + first ``name`` argument. [#4083] + +- Added ``is_url_in_cache`` for resolving paths to cached files via URLS + and checking if files exist. [#4095] + +- Added a ``step`` argument to the ``ProgressBar.map`` method to give + users control over the update frequency of the progress bar. [#4191] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Added a function / context manager ``quantity_support`` for enabling + seamless plotting of ``Quantity`` instances in matplotlib. [#3981] + +- Added the ``hist`` function, which is similar to ``plt.hist`` but + includes several additional options for automatic determination of optimal + histogram bins. This functionality was ported from the astroML library. + [#3756] + +astropy.wcs +^^^^^^^^^^^ + +- The included version of wcslib has been upgraded to 5.10. [#3992, #4239] + + The minimum required version of wcslib in the 4.x series remains 4.24. + + The minimum required version of wcslib in the 5.x series is + 5.8. Building astropy against a wcslib 5.x prior to 5.8 + will raise an ``ImportError`` when ``astropy.wcs`` is imported. + + The wcslib changes relevant to astropy are: + +- The FITS headers returned by ``astropy.wcs.WCS.to_header`` and + ``astropy.wcs.WCS.to_header_string`` now include values with + more precision. This will result in numerical differences in + your results if you convert ``astropy.wcs.WCS`` objects to FITS + headers and use the results. + +- ``astropy.wcs.WCS`` now recognises the ``TPV``, ``TPD``, + ``TPU``, ``DSS``, ``TNX`` and ``ZPX`` polynomial distortions. + +- Added relaxation flags to allow ``PC0i_0ja``, ``PV0j_0ma``, and + ``PS0j_0ma`` (i.e. with leading zeroes on the index). + +- Tidied up error reporting, particularly relating to translating + status returns from lower-level functions. + +- Changed output formatting of floating point values in + ``to_header``. + +- Enhanced text representation of ``WCS`` objects. [#3604] + +- The ``astropy.tests.helper`` module is now part of the public API (and has a + documentation page). This module was in previous releases of astropy, + but was not considered part of the public API until now. [#3890] + +- There is a new function ``astropy.online_help`` to search the + astropy documentation and display the result in a web + browser. [#3642] + +API changes +----------- + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- ``FLRW._tfunc`` and ``FLRW._xfunc`` are marked as deprecated. Users + should use the new public interfaces ``FLRW.lookback_time_integrand`` + and ``FLRW.abs_distance_integrand`` instead. [#3767] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- The default header line processing was made to be consistent with data line + processing in that it now ignores blank lines that may have whitespace + characters. Any code that explicitly specifies a ``header_start`` value + for parsing a file with blank lines in the header containing whitespace will + need to be updated. [#2654] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``uint`` argument to ``fits.open`` is now True by default; that is, + arrays using the FITS unsigned integer convention will be detected, and + read as unsigned integers by default. A new config option for + ``io.fits``, ``enable_uint``, can be changed to False to revert to the + original behavior of ignoring the ``uint`` convention unless it is + explicitly requested with ``uint=True``. [#3916] + +- The ``ImageHDU.NumCode`` and ``ImageHDU.ImgCode`` attributes (and same + for other classes derived from ``_ImageBaseHDU``) are deprecated. Instead, + the ``astropy.io.fits`` module-level constants ``BITPIX2DTYPE`` and + ``DTYPE2BITPIX`` can be used. [#3916] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Note: Comparisons of model parameters with array-like values now + yields a Numpy boolean array as one would get with normal Numpy + array comparison. Previously this returned a scalar True or False, + with True only if the comparison was true for all elements compared, + which could lead to confusing circumstances. [#3912] + +- Using ``model.inverse = None`` to reset a model's inverse to its + default is deprecated. In the future this syntax will explicitly make + a model not have an inverse (even if it has a default). Instead, use + ``del model.inverse`` to reset a model's inverse to its default (if it + has a default, otherwise this just deletes any custom inverse that has + been assigned to the model and is still equivalent to setting + ``model.inverse = None``). [#4236] + +- Adds a ``model.has_user_inverse`` attribute which indicates whether or not + a user has assigned a custom inverse to ``model.inverse``. This is just + for informational purposes, for example, for software that introspects + model objects. [#4236] + +- Renamed the parameters of ``RotateNative2Celestial`` and + ``RotateCelestial2Native`` from ``phi``, ``theta``, ``psi`` to + ``lon``, ``lat`` and ``lon_pole``. [#3578] + +- Deprecated the ``Pix2Sky_AZP.check_mu`` and ``Sky2Pix_AZP.check_mu`` + methods (these were obscure "accidentally public" methods that were + probably not used by anyone). [#3910] + +- Added a phase parameter to the Sine1D model. [#3807] + +astropy.stats +^^^^^^^^^^^^^ + +- Renamed the ``sigma_clip`` ``sig`` keyword as ``sigma``. [#3595] + +- Changed the ``sigma_clip`` ``varfunc`` keyword to ``stdfunc``. [#3595] + +- Renamed the ``sigma_clipped_stats`` ``mask_val`` keyword to + ``mask_value``. [#3595] + +- Changed the default ``iters`` keyword value to 5 in both the + ``sigma_clip`` and ``sigma_clipped_stats`` functions. [#4067] + +astropy.table +^^^^^^^^^^^^^ + +- ``Table.as_array()`` always returns a structured array with each column in + the system's native byte order. The optional ``keep_byteorder=True`` + option will keep each column's data in its original byteorder. [#4080] + +- ``Table.simple_table()`` now creates tables with int64 and float64 types + instead of int32 and float64. [#4114] + +- An empty table can now be initialized without a ``names`` argument as long + as a valid ``dtype`` argument (with names embedded) is supplied. [#3977] + +astropy.time +^^^^^^^^^^^^ + +- The ``astropy_time`` attribute and time format has been removed from the + public interface. Existing code that instantiates a new time object using + ``format='astropy_time'`` can simply omit the ``format`` + specification. [#3857] + +astropy.units +^^^^^^^^^^^^^ + +- Single-item ``Quantity`` instances with record ``dtype`` will now have + their ``isscalar`` property return ``True``, consistent with behaviour for + numpy arrays, where ``np.void`` records are considered scalar. [#3899] + +- Three changes relating to the FITS unit format [#3993]: + +- The FITS unit format will no longer parse an arbitrary number as a + scale value. It must be a power of 10 of the form ``10^^k``, + ``10^k``, ``10+k``, ``10-k`` and ``10(k)``. [#3993] + +- Scales that are powers of 10 can be written out. Previously, any + non-1.0 scale was rejected. + +- The ``*`` character is accepted as a separator between the scale + and the units. + +- Unit formatter classes now require the ``parse`` and ``to_string`` + methods are now required to be classmethods (and the formatter + classes themselves are assumed to be singletons that are not + instantiated). As unit formatters are mostly an internal implementation + detail this is not likely to affect any users. [#4001] + +- CGS E&M units are now defined separately from SI E&M units, and have + distinct physical types. [#4255, #4355] + +astropy.utils +^^^^^^^^^^^^^ + +- All of the ``get_pkg_data_*`` functions take an optional ``package`` + argument as their second positional argument. So any code that previously + passed other arguments to these functions as positional arguments might + break. Use keyword argument passing instead to mitigate this. [#4079] + +- ``astropy.utils.iers`` now uses a ``QTable`` internally, which means that + the numerical columns are stored as ``Quantity``, with full support for + units. Furthermore, the ``ut1_utc`` method now returns a ``Quantity`` + instead of a float or an array (as did ``pm_xy`` already). [#3223] + +- ``astropy.utils.iers`` now throws an ``IERSRangeError``, a subclass + of ``IndexError``, rather than a raw ``IndexError``. This allows more + fine-grained catching of situations where a ``Time`` is beyond the range + of the loaded IERS tables. [#4302] + +astropy.wcs +^^^^^^^^^^^ + +- When compiled with wcslib 5.9 or later, the FITS headers returned + by ``astropy.wcs.WCS.to_header`` and + ``astropy.wcs.WCS.to_header_string`` now include values with more + precision. This will result in numerical differences in your + results if you convert ``astropy.wcs.WCS`` objects to FITS headers + and use the results. + +- If NAXIS1 or NAXIS2 is not passed with the header object to + WCS.calc_footprint, a ValueError is raised. [#3557] + +Bug fixes +--------- + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- The constants ``Ry`` and ``u`` are now properly used inside the + corresponding units. The latter have changed slightly as a result. [#4229] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Internally, ``coordinates`` now consistently uses the appropriate time + scales for using ERFA functions. [#4302] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a segfault in the fast C parser when one of the column headers + is empty [#3545]. + +- Fix several bugs that prevented the fast readers from being used + when guessing the file format. Also improved the read trace + information to better understand format guessing. [#4115] + +- Fix an underlying problem that resulted in an uncaught TypeError + exception when reading a CDS-format file with guessing enabled. [#4120] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- ``Simplex`` fitter now correctly passes additional keywords arguments to + the scipy solver. [#3966] + +- The keyword ``acc`` (for accuracy) is now correctly accepted by + ``Simplex``. [#3966] + +astropy.units +^^^^^^^^^^^^^ + +- The units ``Ryd`` and ``u`` are no longer hard-coded numbers, but depend + on the appropriate values in the ``constants`` module. As a result, these + units now imply slightly different conversions. [#4229] + +Other Changes and Additions +--------------------------- + +- The ``./setup.py test`` command is now implemented in the ``astropy.tests`` + module again (previously its implementation had been moved into + astropy-helpers). However, that made it difficult to synchronize changes + to the Astropy test runner with changes to the ``./setup.py test`` UI. + astropy-helpers v1.1 and above will detect this implementation of the + ``test`` command, when present, and use it instead of the old version that + was included in astropy-helpers (most users will not notice any difference + as a result of this change). [#4020] + +- The repr for ``Table`` no longer displays ``masked=False`` since tables + are not masked by default anyway. [#3869] + +- The version of ``PLY`` that ships with astropy has been updated to 3.6. + +- WCSAxes is now required for doc builds. [#4074] + +- The migration guide from pre-v0.4 coordinates has been removed to avoid + cluttering the ``astropy.coordinates`` documentation with increasingly + irrelevant material. To see the migration guide, we recommend you simply look + to the archived documentation for previous versions, e.g. + http://docs.astropy.org/en/v1.0/coordinates/index.html#migrating-from-pre-v0-4-coordinates + [#4203] + +- In ``astropy.coordinates``, the transformations between GCRS, CIRS, + and ITRS have been adjusted to more logically reflect the order in + which they actually apply. This should not affect most coordinate + transformations, but may affect code that is especially sensitive to + machine precision effects that change when the order in which + transformations occur is changed. [#4255] + +- Astropy v1.1.0 will be the last release series to officially support + Python 2.6. A deprecation warning will now be issued when using Astropy + in Python 2.6 (this warning can be disabled through the usual Python warning + filtering mechanisms). [#3779] + + +1.0.13 (2017-05-29) +=================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix use of quantize level parameter for ``CompImageHDU``. [#6029] + +- Prevent crash when a header contains non-ASCII (e.g. UTF-8) characters, to + allow fixing the problematic cards. [#6084] + + +1.0.12 (2017-03-05) +=================== + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fixed bug in ``discretize_integrate_2D`` in which x and y coordinates + where swapped. [#5634] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug where ``get_transform`` could sometimes produce confusing errors + because of a typo in the input validation. [#5645] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Guard against extremely unlikely problems in compressed images, which + could lead to memory unmapping errors. [#5775] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed a bug where stdlib ``realloc()`` was used instead of + ``PyMem_Realloc()`` [#5696, #4739, #2100] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed ImportError with NumPy < 1.7 and Python 3.x in + ``_register_patched_dtype_reduce``. [#5848] + + +1.0.11 (2016-12-22) +=================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Initialising a SkyCoord from a list containing a single SkyCoord no longer removes + the distance from the coordinate. [#5270] + +- Fix errors in the implementation of the conversion to and from FK4 frames + without e-terms, which will have affected coordinates not on the unit + sphere (i.e., with distances). [#4293] + +- Fix bug where with cds units enabled it was no longer possible to initialize + an ``Angle``. [#5483] + +- Ensure that ``search_around_sky`` and ``search_around_3d`` return + integer type index arrays for empty (non) matches. [#4877, #5083] + +- Return an empty set of matches for ``search_around_sky`` and + ``search_around_3d`` when one or both of the input coordinate + arrays is empty. [#4875, #5083] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a bug with empty value at end of tab-delimited table on Windows. [#5370] + +- Fix reading of big ASCII tables (more than 2Gb) with the fast reader. + [#5319] + +- Fix segfault with FastCsv and row with too many columns. [#5534] + +- Fix problem reading an AASTex format table that does not have ``\\`` + at the end of the last table row. [#5427] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Removed raising of AssertionError that could occur after closing or + deleting compressed image data. [#4690, #4694, #4948] + +- Fixed bug that caused an ignored exception to be displayed under certain + conditions when terminating a script after using fits.getdata(). [#4977] + +- Fixed usage of inplace operations that were raising an exception with + recent versions of Numpy due to implicit casting. [#5250] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed bug of ``Resource.__repr__()`` having undefined attributes and + variables. [#5382] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- CompoundModel now correctly inherits _n_models, allowing the use of model sets [#5358] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed bug in Ci definition. [#5106] + +- Non-ascii cds unit strings are now correctly represented using ``str`` also + on python2. This solves bugs in parsing coordinates involving strings too. + [#5355] + +- Ensure ``Quantity`` supports ``np.float_power``, which is new in numpy 1.12. + [#5480] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed AttributeError when calling ``utils.misc.signal_number_to_name`` with + Python3 [#5430]. + +astropy.wcs +^^^^^^^^^^^ + +- Update the ``_naxis{x}`` attributes when calling ``WCS.slice``. [#5411] + + +Other Changes and Additions +--------------------------- + +- The bundled ERFA was updated to version 1.3.0. This includes the + leap second planned for 2016 Dec 31. [#5418] + +1.0.10 (2016-06-09) +=================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``SkyCoord`` objects created before a new frame which has frame attributes + is created no longer raise ``AttributeError`` when the new attributes are + accessed [#5021] + +- Fix some errors in the implementation of aberration for ``get_sun``. [#4979] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix problem reading a zero-length ECSV table with a bool type column. [#5010] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix convenience functions (``getdata``, ``getheader``, ``append``, + ``update``) to close files. [#4786] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- The astropy.io.votable.validator.html module is updated to handle division + by zero when generating validation report. [#4699] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a bug where ``pprint()`` sometimes raises ``UnicodeDecodeError`` + in Python 2. [#4946] + +- Fix bug when doing outer join on multi-dimensional columns. [#4060] + +- Fixed bug where Tables created from existing Table objects were not + inheriting the ``primary_key`` attribute. [#4672] + +astropy.tests +^^^^^^^^^^^^^ + +- Fix coverage reporting in Python 3. [#4822] + +astropy.units +^^^^^^^^^^^^^ + +- Duplicates between long and short names are now removed in the ``names`` + and ``aliases`` properties of units. [#5036] + +astropy.utils +^^^^^^^^^^^^^ + +- The astropy.utils.xml.unescaper module now also unescapes ``'%2F'`` to + ``'/'`` and ``'&&'`` to ``'&'`` in a given URL. [#4699] + +- Fix two problems related to the download cache: clear_download_cache() does + not work in Python 2.7 and downloading in Python 2.7 and then Python 3 + can result in an exception. [#4810] + +astropy.vo +^^^^^^^^^^ + +- Cache option now properly caches both downloaded JSON database and XML VO + tables. [#4699] + +- The astropy.vo.validator.conf.conesearch_urls listing is updated to reflect + external changes to some VizieR Cone Search services. [#4699] + +- VOSDatabase decodes byte-string to UTF-8 instead of ASCII to avoid + UnicodeDecodeError for some rare cases. Fixed a Cone Search test that is + failing as a side-effect of #4699. [#4757] + +Other Changes and Additions +--------------------------- + +- Updated ``astropy.tests`` test runner code to work with Coverage v4.0 when + generating test coverage reports. [#4176] + + +1.0.9 (2016-03-10) +================== + +New Features +------------ + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``NDArithmeticMixin`` check for matching WCS now works with + ``astropy.wcs.WCS`` objects [#4499, #4503] + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Correct a bug in which ``psf_pad`` and ``fft_pad`` would be ignored [#4366] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed addition of new line characters after last row of data in + ascii.latex.AASTex. [#4561] + +- Fixed reading of Latex tables where the ``\tabular`` tag is in the first + line. [#4595] + +- Fix use of plain format strings with the fast writer. [#4517] + +- Fix bug writing space-delimited file when table has empty fields. [#4417] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed possible segfault during error handling in FITS tile + compression. [#4489] + +- Fixed crash on pickling of binary table columns with the 'X', 'P', or + 'Q' format. [#4514] + +- Fixed memory / reference leak that could occur when copying a ``FITS_rec`` + object (the ``.data`` for table HDUs). [#520] + +- Fixed a memory / reference leak in ``FITS_rec`` that occurred in a wide + range of cases, especially after writing FITS tables to a file, but in + other cases as well. [#4539] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed display of compound model expressions and components when printing + compound model instances. [#4414, #4482] + +astropy.stats +^^^^^^^^^^^^^ + +- the input for median_absolute_deviation will not be cast to plain numpy + arrays when given subclasses of numpy arrays + (like Quantity, numpy.ma.MaskedArray, etc.) [#4658] + +- Fixed incorrect results when using median_absolute_deviation with masked + arrays. [#4658] + +astropy.utils +^^^^^^^^^^^^^ + +- The ``zest.releaser`` hooks included in Astropy are now injected locally to + Astropy, rather than being global. [#4650] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed ``fits2bitmap`` script to allow ext flag to contain extension + names or numbers. [#4468] + +- Fixed ``fits2bitmap`` default output filename generation for + compressed FITS files. [#4468] + + +1.0.8 (2016-01-08) +================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed an bug where updates to string columns in FITS tables were not saved + on Python 3. [#4452] + +astropy.units +^^^^^^^^^^^^^ + +- In-place peak-to-peak calculations now work on ``Quantity``. [#4442] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed ``find_api_page`` to work correctly on python 3.x [#4378, #4379] + + +1.0.7 (2015-12-04) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Pickling of ``EarthLocation`` instances now also works on Python 2. [#4304] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix fast writer so bytestring column output is not prefixed by 'b' in + Python 3. [#4350] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed a regression that could cause writes of large FITS files to be + truncated. [#4307] + +- Astropy v1.0.6 included a fix (#4228) for an obscure case where the TDIM + of a table column is smaller than the repeat count of its data format. + This updates that fix in such a way that it works with Numpy 1.10 as well. + [#4266] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a bug when pickling a Table with mixin columns (e.g. Time). [#4098] + +astropy.time +^^^^^^^^^^^^ + +- Fix incorrect ``value`` attribute for epoch formats like "unix" + when ``scale`` is different from the class ``epoch_scale``. [#4312] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed an issue where if ipython is installed but ipykernel is not + installed then importing astropy from the ipython console gave an + IPython.kernel deprecation warning. [#4279] + +- Fixed crash that could occur in ``ProgressBar`` when ``astropy`` is + imported in an IPython startup script. [#4274] + +Other Changes and Additions +--------------------------- + +- Updated bundled astropy-helpers to v1.0.6. [#4372] + + +1.0.6 (2015-10-22) +================== + +Bug Fixes +--------- + +astropy.analytic_functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed blackbody analytic functions to properly support arrays of + temperatures. [#4251] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed errors in transformations for objects within a few AU of the + Earth. Included substantive changes to transformation machinery + that may change distances at levels ~machine precision for other + objects. [#4254] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- ``fitsdiff`` and related functions now do a better job reporting differences + between values that are different types but have the same representation + (ex: the string '0' versus the number 0). [#4122] + +- Miscellaneous fixes for supporting Numpy 1.10. [#4228] + +- Fixed an issue where writing a column of unicode strings to a FITS table + resulted in a quadrupling of size of the column (i.e. the format of the + FITS column was 4 characters for every one in the original strings). + [#4228] + +- Added support for an obscure case (but nonetheless allowed by the FITS + standard) where a column has some TDIMn keyword, but a repeat count in + the TFORMn column greater than the number of elements implied by the + TDIMn. For example TFORMn = 100I, but TDIMn = '(5,5)'. In this case + the TDIMn implies 5x5 arrays in the column, but the TFORMn implies + a 100 element 1-D array in the column. In this case the TDIM takes + precedence, and the remaining bytes in the column are ignored. [#4228] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed crash with Python compiler optimization level = 2. [#4231] + +astropy.vo +^^^^^^^^^^ + +- Fixed ``check_conesearch_sites`` with ``parallel=True`` on Python >= 3.3 + and on Windows (it was broken in both those cases for separate reasons). + [#2970] + +Other Changes and Additions +--------------------------- + +- All tests now pass against Numpy v1.10.x. This implies nominal support for + Numpy 1.10.x moving forward (but there may still be unknown issues). For + example, there is already a known performance issue with tables containing + large multi-dimensional columns--for example, tables that contain entire + images in one or more of their columns. This is a known upstream issue in + Numpy. [#4259] + + +1.0.5 (2015-10-05) +================== + +Bug Fixes +--------- + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Rename units -> unit and error -> uncertainty in the ``repr`` and ``str`` + of constants to match attribute names. [#4147] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fix string representation of ``SkyCoord`` objects transformed into + the ``AltAz`` frame [#4055, #4057] + +- Fix the ``search_around_sky`` function to allow ``storekdtree`` to be + ``False`` as was intended. [#4082, #4212] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix bug when extending one header (without comments) with another + (with comments). [#3967] + +- Somewhat improved resource usage for FITS data--previously a new ``mmap`` + was opened for each HDU of a FITS file accessed through an ``HDUList``. + Each ``mmap`` used up a single file descriptor, causing problems with + system resource limits for some users. Now only a single ``mmap`` is + opened, and shared for the data of all HDUs. Note: The problem still + persists with using the "convenience" functions. For example using + ``fits.getdata`` will create one ``mmap`` per HDU read this way (as + opposed to opening the file with ``fits.open`` and accessing the HDUs + through the ``HDUList`` object). [#4097] + +- Fix bug where reading a file without a newline failed with an + unrelated / unhelpful exception. [#4160] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Cleaned up ``repr`` of models that have no parameters. [#4076] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Initializing ``NDDataArray`` from another instance now sets ``flags`` as + expected and no longer fails when ``uncertainty`` is set [#4129]. + Initializing an ``NDData`` subclass from a parent instance + (eg. ``NDDataArray`` from ``NDData``) now sets the attributes other than + ``data`` as it should [#4130, #4137]. + +astropy.table +^^^^^^^^^^^^^ + +- Fix an issue with setting fill value when column dtype is changed. [#4088] + +- Fix bug when unpickling a bare Column where the _parent_table + attribute was not set. This impacted the Column representation. [#4099] + +- Fix issue with the web browser opening with an empty page, and ensure that + the url is correctly formatted for Windows. [#4132] + +- Fix NameError in table stack exception message. [#4213] + +astropy.utils +^^^^^^^^^^^^^ + +- ``resolve_name`` no longer causes ``sys.modules`` to be cluttered with + additional copies of modules under a package imported like + ``resolve_name('numpy')``. [#4084] + +- ``console`` was updated to support IPython 4.x and Jupyter 1.x. + This should suppress a ShimWarning that was appearing at + import of astropy with IPython 4.0 or later. [#4078] + +- Temporary downloaded files created by ``get_readable_fileobj`` when passed + a URL are now deleted immediately after the file is closed. [#4198] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- The color for axes labels was set to white. Since white labels on white + background are hard to read, the label color has been changed to black. + [#4143] + +- ``ImageNormalize`` now automatically determines ``vmin``/``vmax`` + (via the ``autoscale_None`` method) when they have not been set + explicitly. [#4117] + +astropy.vo +^^^^^^^^^^ + +- Cone Search validation no longer crashes when the provider gives an + incomplete test query. It also ensures search radius for a test query + is not too large to avoid timeout. [#4158, #4159] + +Other Changes and Additions +--------------------------- + +- Astropy now supports Python 3.5. [#4027] + +- Updated bundled version of astropy-helpers to 1.0.5. [#4215] + +- Updated tests to support py.test 2.7, and upgraded the bundled copy of + py.test to v2.7.3. [#4027] + + +1.0.4 (2015-08-11) +================== + +New Features +------------ + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Modified Cython functions to release the GIL. This enables convolution + to be parallelized effectively and gives large speedups when used with + multithreaded task schedulers such as Dask. [#3949] + +API Changes +----------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Some transformations for an input coordinate that's a scalar now correctly + return a scalar. This was always the intended behavior, but it may break + code that has been written to work-around this bug, so it may be viewed as + an unplanned API change [#3920, #4039] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- The ``astropy_mpl_style`` no longer sets ``interactive`` to ``True``, but + instead leaves it at the user preference. This makes using the style + compatible with building docs with Sphinx, and other non-interactive + contexts. [#4030] + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fix bug where coordinate representation setting gets reset to default value + when coordinate array is indexed or sliced. [#3824] + +- Fixed confusing warning message shown when using dates outside current IERS + data. [#3844] + +- ``get_sun`` now yields a scalar when the input time is a scalar (this was a + regression in v1.0.3 from v1.0.2) [#3998, #4039] + +- Fixed bug where some scalar coordinates were incorrectly being changed to + length-1 array coordinates after transforming through certain frames. + [#3920, #4039] + +- Fixed bug causing the ``separation`` methods of ``SkyCoord`` and frame + classes to fail due to infinite recursion [#4033, #4039] + +- Made it so that passing in a list of ``SkyCoord`` objects that are in + UnitSphericalRepresentation to the ``SkyCoord`` constructor appropriately + yields a new object in UnitSphericalRepresentation [#3938, #4039] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Fixed wCDM to not ignore the Ob0 parameter on initialization. [#3934] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed crash when updating data in a random groups HDU opened in update + mode. [#3730] + +- Fixed incorrect checksum / datasum being written when re-writing a scaled + HDU (i.e. non-trivial BSCALE and/or BZERO) with + ``do_not_scale_image_data=False``. [#3883] + +- Fixed stray deprecation warning in ``BinTableHDU.copy()``. [#3798] + +- Better handling of the ``BLANK`` keyword when auto-scaling scaled image + data. The ``BLANK`` keyword is now removed from the header after + auto-scaling is applied, and it is restored properly (with floating point + NaNs replaced by the filler value) when updating a file opened with the + ``scale_back=True`` argument. Invalid usage of the ``BLANK`` keyword is + also better warned about during validation. [#3865] + +- Reading memmaped scaled images won't fail when + ``do_not_scale_image_data=True`` (that is, since we're just reading the raw + / physical data there is no reason mmap can't be used). [#3766] + +- Fixed a reference cycle that could sometimes cause FITS table-related + objects (``BinTableHDU``, ``ColDefs``, etc.) to hang around in memory + longer than expected. [#4012] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Improved support for pickling of compound models, including both compound + model instances, and new compound model classes. [#3867] + +- Added missing default values for ``Ellipse2D`` parameters. [#3903] + +astropy.time +^^^^^^^^^^^^ + +- Fixed iteration of scalar ``Time`` objects so that ``iter()`` correctly + raises a ``TypeError`` on them (while still allowing ``Time`` arrays to be + iterated). [#4048] + +astropy.units +^^^^^^^^^^^^^ + +- Added frequency-equivalency check when declaring doppler equivalencies + [#3728] + +- Define ``floor_divide`` (``//``) for ``Quantity`` to be consistent + ``divmod``, such that it only works where the quotient is dimensionless. + This guarantees that ``(q1 // q2) * q2 + (q1 % q2) == q1``. [#3817] + +- Fixed the documentation of supported units to correctly report support for + SI prefixes. Previously the table of supported units incorrectly showed + several derived unit as not supporting prefixes, when in fact they do. + [#3835] + +- Fix a crash when calling ``astropy.units.cds.enable()``. This will now + "set" rather than "add" units to the active set to avoid the namespace + clash with the default units. [#3873] + +- Ensure in-place operations on ``float32`` quantities work. [#4007] + +astropy.utils +^^^^^^^^^^^^^ + +- The ``deprecated`` decorator did not correctly wrap classes that have a + custom metaclass--the metaclass could be dropped from the deprecated + version of the class. [#3997] + +- The ``wraps`` decorator would copy the wrapped function's name to the + wrapper function even when ``'__name__'`` is excluded from the ``assigned`` + argument. [#4016] + +Misc +^^^^ + +- ``fitscheck`` no longer causes scaled image data to be rescaled when + adding checksums to existing files. [#3884] + +- Fixed an issue where running ``import astropy`` from within the source + tree did not automatically build the extension modules if the source is + from a source distribution (as opposed to a git repository). [#3932] + +- Fixed multiple instances of a bug that prevented Astropy from being used + when compiled with the ``python -OO`` flag, due to it causing all + docstrings to be stripped out. [#3923] + +- Removed source code template files that were being installed + accidentally alongside installed Python modules. [#4014] + +- Fixed a bug in the exception logging that caused a crash in the exception + handler itself on Python 3 when exceptions do not include a message. + [#4056] + + +1.0.3 (2015-06-05) +================== + +New Features +------------ + +astropy.table +^^^^^^^^^^^^^ + +- Greatly improved the speed of printing a large table to the screen when + only a few rows are being displayed. [#3796] + +astropy.time +^^^^^^^^^^^^ + +- Add support for the 2015-Jun-30 leap second. [#3794] + +API Changes +----------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Note that HTML formatted tables will not always be found with guess mode + unless it passes certain heuristics that strongly suggest the presence of + HTML in the input. Code that expects to read tables from HTML should + specify ``format='html'`` explicitly. See bug fixes below for more + details. [#3693] + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fix issue with repeated normalizations of ``Kernels``. [#3747] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed ``get_sun`` to yield frames with the ``obstime`` set to what's passed into the function (previously it incorrectly always had J2000). [#3750] + +- Fixed ``get_sun`` to account for aberration of light. [#3750] + +- Fixed error in the GCRS->ICRS transformation that gave incorrect distances. [#3750] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Remove HTML from the list of automatically-guessed formats when reading if + the file does not appear to be HTML. This was necessary to avoid a + commonly-encountered segmentation fault occurring in the libxml parser on + MacOSX. [#3693] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixes to support the upcoming Numpy 1.10. [#3419] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Polynomials are now scaled when used in a compound model. [#3702] + +- Fixed the ``Ellipse2D`` model to be consistent with ``Disk2D`` in + how pixels are included. [#3736] + +- Fixed crash when evaluating a model that accepts no inputs. [#3772] + +astropy.testing +^^^^^^^^^^^^^^^ + +- The Astropy py.test plugins that disable unintentional internet access + in tests were also blocking use of local UNIX sockets in tests, which + prevented testing some multiprocessing code--fixed. [#3713] + +astropy.units +^^^^^^^^^^^^^ + +- Supported full SI prefixes for the barn unit ("picobarn", "femtobarn", + etc.) [#3753] + +- Fix loss of precision when multiplying non-whole-numbered powers + of units together. For example, before this change, ``(u.m ** + 1.5) ** Fraction(4, 5)`` resulted in an inaccurate floating-point + power of ``1.2000000000000002``. After this change, the exact + rational number of ``Fraction(6, 5)`` is maintained. [#3790] + +- Fixed printing of object ndarrays containing multiple Quantity + objects with differing / incompatible units. Note: Unit conversion errors + now cause a ``UnitConversionError`` exception to be raised. However, this + is a subclass of the ``UnitsError`` exception used previously, so existing + code that catches ``UnitsError`` should still work. [#3778] + +Other Changes and Additions +--------------------------- + +- Added a new ``astropy.__bibtex__`` attribute which gives a citation + for Astropy in bibtex format. [#3697] + +- The bundled version of ERFA was updated to v1.2.0 to address leapsecond + updates. [#3802] + + +0.4.6 (2015-05-29) +================== + +Bug Fixes +--------- + +astropy.time +^^^^^^^^^^^^ + +- Fixed ERFA code to handle the 2015-Jun-30 leap second. [#3795] + + +1.0.2 (2015-04-16) +================== + +New Features +------------ + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added support for polynomials with degree 0 or degree greater than 15. + [#3574, 3589] + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +- The pre-astropy-0.4 configuration API has been fixed. It was + inadvertently broken in 1.0.1. [#3627] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed a severe memory leak that occurred when reading tile compressed + images. [#3680] + +- Fixed bug where column data could be unintentionally byte-swapped when + copying data from an existing FITS file to a new FITS table with a + TDIMn keyword for that column. [#3561] + +- The ``ColDefs.change_attrib``, ``ColDefs.change_name``, and + ``ColDefs.change_unit`` methods now work as advertised. It is also + possible (and preferable) to update attributes directly on ``Column`` + objects (for example setting ``column.name``), and the change will be + accurately reflected in any associated table data and its FITS header. + [#3283, #1539, #2618] + +- Fixes an issue with the ``FITS_rec`` interface to FITS table data, where a + ``FITS_rec`` created by copying an existing FITS table but adding new rows + could not be sliced or masked correctly. [#3641] + +- Fixed handling of BINTABLE with TDIMn of size 1. [#3580] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Loading a ``TABLE`` element without any ``DATA`` now correctly + creates a 0-row array. [#3636] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added workaround to support inverses on compound models when one of the + sub-models is itself a compound model with a manually-assigned custom + inverse. [#3542] + +- Fixed instantiation of polynomial models with constraints for parameters + (constraints could still be assigned after instantiation, but not during). + [#3606] + +- Fixed fitting of 2D polynomial models with the ``LeVMarLSQFitter``. [#3606] + +astropy.table +^^^^^^^^^^^^^ + +- Ensure ``QTable`` can be pickled [#3590] + +- Some corner cases when instantiating an ``astropy.table.Table`` + with a Numpy array are handled [#3637]. Notably: + +- a zero-length array is the same as passing ``None`` + +- a scalar raises a ``ValueError`` + +- a one-dimensional array is treated as a single row of a table. + +- Ensure a ``Column`` without units is treated as an ``array``, not as an + dimensionless ``Quantity``. [#3648] + +astropy.units +^^^^^^^^^^^^^ + +- Ensure equivalencies that do more than just scale a ``Quantity`` are + properly handled also in ``ufunc`` evaluations. [#2496, #3586] + +- The LaTeX representation of the Angstrom unit has changed from + ``\overset{\circ}{A}`` to ``\mathring{A}``, which should have + better support across regular LaTeX, MathJax and matplotlib (as of + version 1.5) [#3617] + +astropy.vo +^^^^^^^^^^ + +- Using HTTPS/SSL for communication between SAMP hubs now works + correctly on all supported versions of Python [#3613] + +astropy.wcs +^^^^^^^^^^^ + +- When no ``relax`` argument is passed to ``WCS.to_header()`` and + the result omits non-standard WCS keywords, a warning is + emitted. [#3652] + +Other Changes and Additions +--------------------------- + +astropy.vo +^^^^^^^^^^ + +- The number of retries for connections in ``astropy.vo.samp`` can now be + configured by a ``n_retries`` configuration option. [#3612] + +- Testing + +- Running ``astropy.test()`` from within the IPython prompt has been + provisionally re-enabled. [#3184] + + +1.0.1 (2015-03-06) +================== + +Bug Fixes +--------- + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Ensure constants can be turned into ``Quantity`` safely. [#3537, #3538] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a segfault in the fast C parser when one of the column headers + is empty [#3545]. + +- Fixed support for reading inf and nan values with the fast reader in + Windows. Also fixed in the case of using ``use_fast_converter=True`` + with the fast reader. [#3525] + +- Fixed use of mmap in the fast reader on Windows. [#3525] + +- Fixed issue where commented header would treat comments defining the table + (i.e. column headers) as purely information comments, leading to problems + when trying to round-trip the table. [#3562] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed propagation of parameter constraints ('fixed', 'bounds', 'tied') + between compound models and their components. There is may still be some + difficulty defining 'tied' constraints properly for use with compound + models, however. [#3481] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Restore several properties to the compatibility class ``NDDataArray`` that + were inadvertently omitted [#3466]. + +astropy.time +^^^^^^^^^^^^ + +- Time objects now always evaluate to ``True``, except when empty. [#3530] + +Miscellaneous +------------- + +- The ERFA wrappers are now written directly in the Python/C API + rather than using Cython, for greater performance. [#3521] + +- Improve import time of astropy [#3488]. + +Other Changes and Additions +--------------------------- + +- Updated bundled astropy-helpers version to v1.0.1 to address installation + issues with some packages that depend on Astropy. [#3541] + + +1.0 (2015-02-18) +================ + +General +------- + +- Astropy now requires Numpy 1.6.0 or later. + +New Features +------------ + +astropy.analytic_functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- The ``astropy.analytic_functions`` was added to contain analytic functions + useful for astronomy [#3077]. + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``astropy.coordinates`` now has a full stack of frames allowing + transformations from ICRS or other celestial systems down to Alt/Az + coordinates. [#3217] + +- ``astropy.coordinates`` now has a ``get_sun`` function that gives + the coordinates of the Sun at a specified time. [#3217] + +- ``SkyCoord`` now has ``to_pixel`` and ``from_pixel`` methods that convert + between celestial coordinates as ``SkyCoord`` objects and pixel coordinates + given an ``astropy.wcs.WCS`` object. [#3002] + +- ``SkyCoord`` now has ``search_around_sky`` and ``search_around_3d`` + convenience methods that allow searching for all coordinates within + a certain distance of another ``SkyCoord``. [#2953] + +- ``SkyCoord`` can now accept a frame instance for the ``frame=`` keyword + argument. [#3063] + +- ``SkyCoord`` now has a ``guess_from_table`` method that can be used to + quickly create ``SkyCoord`` objects from an ``astropy.table.Table`` + object. [#2951] + +- ``astropy.coordinates`` now has a ``Galactocentric`` frame, a coordinate + frame centered on a (user specified) center of the Milky Way. [#2761, #3286] + +- ``SkyCoord`` now accepts more formats of the coordinate string when the + representation has ``ra`` and ``dec`` attributes. [#2920] + +- ``SkyCoord`` can now accept lists of ``SkyCoord`` objects, frame objects, + or representation objects and will combine them into a single object. + [#3285] + +- Frames and ``SkyCoord`` instances now have a method ``is_equivalent_frame`` + that can be used to check that two frames are equivalent (ignoring the + data). [#3330] + +- The ``__repr__`` of coordinate objects now shows scalar coordinates in the + same format as vector coordinates. [#3350, 3448] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Added ``lookback_distance``, which is ``c * lookback_time``. [#3145] + +- Add baryonic matter density and dark matter only density parameters + to cosmology objects [#2757]. + +- Add a ``clone`` method to cosmology objects to allow copies + of cosmological objects to be created with the specified variables + modified [#2592]. + +- Increase default numerical precision of ``z_at_value`` following + the accurate by default, fast by explicit request model [#3074]. + +- Cosmology functions that take a single (redshift) input now + broadcast like numpy ufuncs. So, passing an arbitrarily shaped + array of inputs will produce an output of the same shape. [#3178, #3194] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Simplify the way new Reader classes are defined, allowing custom behavior + entirely by overriding inherited class attributes instead of setting + instance attributes in the Reader ``__init__`` method. [#2812] + +- There is now a faster C/Cython engine available for reading and writing + simple ASCII formats like CSV. Both are enabled by default, and fast + reading will fall back on an ordinary reader in case of a parsing + failure. Their behavior can be altered with the parameter ``fast_reader`` + in ``read`` and ``fast_writer`` in ``write``. [#2716] + +- Make Latex/AASTex tables use unit attribute of Column for output. [#3064] + +- Store comment lines encountered during reading in metadata of the + output table via ``meta['comment_lines']``. [#3222] + +- Write comment lines in Table metadata during output for all basic formats, + IPAC, and fast writers. This functionality can be disabled with + ``comment=False``. [#3255] + +- Add reader / writer for the Enhanced CSV format which stores table and + column meta data, in particular data type and unit. [#2319] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``fitsdiff`` script ignores some things by default when comparing fits + files (e.g. empty header lines). This adds a ``--exact`` option where + nothing is ignored. [#2782, #3110] + +- The ``fitsheader`` script now takes a ``--keyword`` option to extract a + specific keyword from the header of a FITS file, and a ``--table`` option + to export headers into any of the data formats supported by + ``astropy.table``. [#2555, #2588] + +- ``Section`` now supports all advanced indexing features ``ndarray`` does + (slices with any steps, integer arrays, boolean arrays, None, Ellipsis). + It also properly returns scalars when this is appropriate. [#3148] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- ``astropy.io.votable.parse`` now takes a ``datatype_mapping`` + keyword argument to map invalid datatype names to valid ones in + order to support non-compliant files. [#2675] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added the capability of creating new "compound" models by combining + existing models using arithmetic operators. See the "What's New in 1.0" + page in the Astropy documentation for more details. [#3231] + +- A new ``custom_model`` decorator/factory function has been added for + converting normal functions to ``Model`` classes that can work within + the Astropy modeling framework. This replaces the old ``custom_model_1d`` + function which is now deprecated. The new function works the same as + the old one but is less limited in the types of models it can be used to + created. [#1763] + +- The ``Model`` and ``Fitter`` classes have ``.registry`` attributes which + provide sets of all loaded ``Model`` and ``Fitter`` classes (this is + useful for building UIs for models and fitting). [#2725] + +- A dict-like ``meta`` member was added to ``Model``. it is to be used to + store any optional information which is relevant to a project and is not + in the standard ``Model`` class. [#2189] + +- Added ``Ellipse2D`` model. [#3124] + +astropy.nddata +^^^^^^^^^^^^^^ + +- New array-related utility functions in ``astropy.nddata.utils`` for adding + and removing arrays from other arrays with different sizes/shapes. [#3201] + +- New metaclass ``NDDataBase`` for enforcing the nddata interface in + subclasses without restricting implementation of the data storage. [#2905] + +- New mixin classes ``NDSlicingMixin`` for slicing, ``NDArithmeticMixin`` + for arithmetic operations, and ``NDIOMixin`` for input/ouput in NDData. [#2905] + +- Added a decorator ``support_nddata`` that can be used to write functions + that can either take separate arguments or NDData objects. [#2855] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``mad_std()`` function. [#3208] + +- Added ``gaussian_fwhm_to_sigma`` and ``gaussian_sigma_to_fwhm`` + constants. [#3208] + +- New function ``sigma_clipped_stats`` which can be used to quickly get + common statistics for an array, using sigma clipping at the same time. + [#3201] + +astropy.table +^^^^^^^^^^^^^ + +- Changed the internal implementation of the ``Table`` class changed so that + it no longer uses numpy structured arrays as the core table data container. + [#2790, #3179] + +- Tables can now be written to an html file that includes interactive + browsing capabilities. To write out to this format, use + ``Table.write('filename.html', format='jsviewer')``. [#2875] + +- A ``quantity`` property and ``to`` method were added to ``Table`` + columns that allow the column values to be easily converted to + ``astropy.units.Quantity`` objects. [#2950] + +- Add ``unique`` convenience method to table. [#3185] + +astropy.tests +^^^^^^^^^^^^^ + +- Added a new Quantity-aware ``assert_quantity_allclose``. [#3273] + +astropy.time +^^^^^^^^^^^^ + +- ``Time`` can now handle arbitrary array dimensions, with operations + following standard numpy broadcasting rules. [#3138] + +astropy.units +^^^^^^^^^^^^^ + +- Support for VOUnit has been updated to be compliant with version + 1.0 of the standard. [#2901] + +- Added an ``insert`` method to insert values into a ``Quantity`` object. + This is similar to the ``numpy.insert`` function. [#3049] + +- When viewed in IPython, ``Quantity`` objects with array values now render + using LaTeX and scientific notation. [#2271] + +- Added ``units.quantity_input`` decorator to validate quantity inputs to a + function for unit compatibility. [#3072] + +- Added ``units.astronomical_unit`` as a long form for ``units.au``. [#3303] + +astropy.utils +^^^^^^^^^^^^^ + +- Added a new decorator ``astropy.utils.wraps`` which acts as a replacement + for the standard library's ``functools.wraps``, the only difference being + that the decorated function also preserves the wrapped function's call + signature. [#2849] + +- ``astropy.utils.compat.numpy`` has been revised such that it can include + patched versions of routines from newer ``numpy`` versions. The first + addition is a version of ``broadcast_arrays`` that can be used with + ``Quantity`` and other ``ndarray`` subclasses (using the ``subok=True`` + flag). [#2327] + +- Added ``astropy.utils.resolve_name`` which returns a member of a module + or class given the fully qualified dotted name of that object as a + string. [#3389] + +- Added ``astropy.utils.minversion`` which can be used to check minimum + version requirements of Python modules (to test for specific features and/ + or bugs and the like). [#3389] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Created ``astropy.visualization`` module and added functionality relating + to image normalization (i.e. stretching and scaling) as well as a new + script ``fits2bitmap`` that can produce a bitmap image from a FITS file. + [#3201] + +- Added dictionary ``astropy.visualization.mpl_style.astropy_mpl_style`` + which can be used to set a uniform plotstyle specifically for tutorials + that is improved compared to matplotlib defaults. [#2719, #2787, #3200] + +astropy.wcs +^^^^^^^^^^^ + +- ``wcslib`` has been upgraded to version 4.25. This brings a + single new feature: + +- ``equinox`` and ``radesys`` will now be given default values + conforming with the WCS specification if ``EQUINOXa`` and + ``RADESYSa``, respectively, are not present in the header. + +- The minimum required version of ``wcslib`` is now 4.24. [#2503] + +- Added a new function ``wcs_to_celestial_frame`` that can be used to find + the astropy.coordinates celestial frame corresponding to a particular WCS. + [#2730] + +- ``astropy.wcs.WCS.compare`` now supports a ``tolerance`` keyword argument + to allow for approximate comparison of floating-point values. [#2503] + +- added ``pixel_scale_matrix``, ``celestial``, ``is_celestial``, and + ``has_celestial`` convenience attributes. Added + ``proj_plane_pixel_scales``, ``proj_plane_pixel_area``, and + ``non_celestial_pixel_scales`` utility functions for retrieving WCS pixel + scale and area information [#2832, #3304] + +- Added two functions ``pixel_to_skycoord`` and + ``skycoord_to_pixel`` that make it easy to convert between + SkyCoord objects and pixel coordinates. [#2885] + +- ``all_world2pix`` now uses a much more sophisticated and complete + algorithm to iteratively compute the inverse WCS transform. [#2816] + +- Add ability to use ``WCS`` object to define projections in Matplotlib, + using the ``WCSAxes`` package. [#3183] + +- Added ``is_proj_plane_distorted`` for testing if pixels are + distorted. [#3329] + +Misc +^^^^ + +- ``astropy._erfa`` was added as a new subpackage wrapping the functionality + of the ERFA library in python. This is primarily of use for other astropy + subpackages, but the API may be made more public in the future. [#2992] + + +API Changes +----------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Subclasses of ``BaseCoordinateFrame`` which define a custom ``repr`` should + be aware of the format expected in ``SkyCoord.__repr__()``, which changed in + this release. [#2704, #2882] + +- The ``CartesianPoints`` class (deprecated in v0.4) has now been removed. + [#2990] + +- The previous ``astropy.coordinates.builtin_frames`` module is now a + subpackage. Everything that was in the + ``astropy.coordinates.builtin_frames`` module is still accessible from the + new package, but the classes are now in separate modules. This should have + no direct impact at the user level. [#3120] + +- Support for passing a frame as a positional argument in the ``SkyCoord`` + class has now been deprecated, except in the case where a frame with data + is passed as the sole positional argument. [#3152] + +- Improved ``__repr__`` of coordinate objects representing a single + coordinate point for the sake of easier copy/pasting. [#3350] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The functional interface to the cosmological routines as well as + ``set_current`` and ``get_current`` (deprecated in v0.4) have now been + removed. [#2990] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Added a new argument to ``htmldict`` in the HTML reader named + ``parser``, which allows the user to specify which parser + BeautifulSoup should use as a backend. [#2815] + +- Add ``FixedWidthTwoLine`` reader to guessing. This will allows to read + tables that a copied from screen output like ``print my_table`` to be read + automatically. Discussed in #3025 and #3099 [#3109] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- A new optional argument ``cache`` has been added to + ``astropy.io.fits.open()``. When opening a FITS file from a URL, + ``cache`` is a boolean value specifying whether or not to save the + file locally in Astropy's download cache (``True`` by default). [#3041] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Model classes should now specify ``inputs`` and ``outputs`` class + attributes instead of the old ``n_inputs`` and ``n_outputs``. These + should be tuples providing human-readable *labels* for all inputs and + outputs of the model. The length of the tuple indicates the numbers + of inputs and outputs. See "What's New in Astropy 1.0" for more + details. [#2835] + +- It is no longer necessary to include ``__init__`` or ``__call__`` + definitions in ``Model`` subclasses if all they do is wrap the + super-method in order to provide a nice call signature to the docs. + The ``inputs`` class attribute is now used to generate a nice call + signature, so these methods should only be overridden by ``Model`` + subclasses in order to provide new functionality. [#2835] + +- Most models included in Astropy now have sensible default values for most + or all of their parameters. Call ``help(ModelClass)`` on any model to + check what those defaults are. Most of them time they should be + overridden, but some of them are useful (for example spatial offsets are + always set at the origin by default). Another rule of thumb is that, where + possible, default parameters are set so that the model is a no-op, or + close to it, by default. [#2932] + +- The ``Model.inverse`` method has been changed to a *property*, so that + now accessing ``model.inverse`` on a model returns a new model that + implements that model's inverse, and *calling* ``model.inverse(...)``` on + some independent variable computes the value of the inverse (similar to what + the old ``Model.invert()`` method was meant to do). [#3024] + +- The ``Model.invert()`` method has been removed entirely (it was never + implemented and there should not be any existing code that relies on it). + [#3024] + +- ``custom_model_1d`` is deprecated in favor of the new ``custom_model`` + (see "New Features" above). [#1763] + +- The ``Model.param_dim`` property (deprecated in v0.4) has now been removed. + [#2990] + +- The ``Beta1D`` and ``Beta2D`` models have been renamed to ``Moffat1D`` and + ``Moffat2D``. [#3029] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``flags``, ``shape``, ``size``, ``dtype`` and ``ndim`` properties removed + from ``astropy.nddata.NDData``. [#2905] + +- Arithmetic operations, uncertainty propagation, slicing and automatic + conversion to a numpy array removed from ``astropy.nddata.NDData``. The + class ``astropy.nddata.NDDataArray`` is functionally equivalent to the + old ``NDData``. [#2905] + +astropy.table +^^^^^^^^^^^^^ + +- The ``Column.units`` property (deprecated in v0.3) has now been removed. + [#2990] + +- The ``Row.data`` and ``Table._data`` attributes have been deprecated + related to the change in Table implementation. They are replaced by + ``Row.as_void()`` and ``Table.as_array()`` methods, respectively. [#2790] + +- The ``Table.create_mask`` method has been removed. This undocumented + method was a development orphan and would cause corruption of the + table if called. [#2790] + +- The return type for integer item access to a Column (e.g. col[12] or + t['a'][12]) is now always a numpy scalar, numpy ``ndarray``, or numpy + ``MaskedArray``. Previously if the column was multidimensional then a + Column object would be returned. [#3095] + +- The representation of Table and Column objects has been changed to + be formatted similar to the print output. [#3239] + +astropy.time +^^^^^^^^^^^^ + +- The ``Time.val`` and ``Time.vals`` properties (deprecated in v0.3) and the + ``Time.lon``, and ``Time.lat`` properties (deprecated in v0.4) have now + been removed. [#2990] + +- Add ``decimalyear`` format that represents time as a decimal year. [#3265] + +astropy.units +^^^^^^^^^^^^^ + +- Support for VOUnit has been updated to be compliant with version + 1.0 of the standard. This means that some VOUnit strings that were + rejected before are now acceptable. [#2901] Notably: + +- SI prefixes are supported on most units + +- Binary prefixes are supported on "bits" and "bytes" + +- Custom units can be defined "inline" by placing them between single + quotes. + +- ``Unit.get_converter`` has been deprecated. It is not strictly + necessary for end users, and it was confusing due to lack of + support for ``Quantity`` objects. [#3456] + +astropy.utils +^^^^^^^^^^^^^ + +- Some members of ``astropy.utils.misc`` were moved into new submodules. + Specifically: + +- ``deprecated``, ``deprecated_attribute``, and ``lazyproperty`` -> + ``astropy.utils.decorators`` + +- ``find_current_module``, ``find_mod_objs`` -> + ``astropy.utils.introspection`` + + All of these functions can be imported directly from ``astropy.utils`` + which should be preferred over referencing individual submodules of + ``astropy.utils``. [#2857] + +- The ProgressBar.iterate class method (deprecated in v0.3) has now been + removed. [#2990] + +- Updated ``astropy/utils/console.py`` ProgressBar() module to + display output to IPython notebook with the addition of an + ``interactive`` kwarg. [#2658, #2789] + +astropy.wcs +^^^^^^^^^^^ + +- The ``WCS.calcFootprint`` method (deprecated in v0.4) has now been removed. + [#2990] + +- An invalid unit in a ``CUNITn`` keyword now displays a warning and + returns a ``UnrecognizedUnit`` instance rather than raising an + exception [#3190] + +Bug Fixes +--------- + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- ``astropy.convolution.discretize_model`` now handles arbitrary callables + correctly [#2274]. + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``Angle.to_string`` now outputs unicode arrays instead of object arrays. + [#2981] + +- ``SkyCoord.to_string`` no longer gives an error when used with an array + coordinate with more than one dimension. [#3340] + +- Fixed support for subclasses of ``UnitSphericalRepresentation`` and + ``SphericalRepresentation`` [#3354, #3366] + +- Fixed latex display of array angles in IPython notebook. [#3480] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- In the ``CommentedHeader`` the ``data_start`` parameter now defaults to + ``0``, which is the first uncommented line. Discussed in #2692. [#3054] + +- Position lines in ``FixedWidthTwoLine`` reader could consist of many characters. + Now, only one character in addition to the delimiter is allowed. This bug was + discovered as part of [#3109] + +- The IPAC table writer now consistently uses the ``fill_values`` keyword to + specify the output null values. Previously the behavior was inconsistent + or incorrect. [#3259] + +- The IPAC table reader now correctly interprets abbreviated column types. + [#3279] + +- Tables that look almost, but not quite like DAOPhot tables could cause + guessing to fail. [#3342] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed the problem in ``fits.open`` of some filenames with colon (``:``) in + the name being recognized as URLs instead of file names. [#3122] + +- Setting ``memmap=True`` in ``fits.open`` and related functions now raises + a ValueError if opening a file in memory-mapped mode is impossible. [#2298] + +- CONTINUE cards no longer end the value of the final card in the series with + an ampersand, per the specification of the CONTINUE card convention. [#3282] + +- Fixed a crash that occurred when reading an ASCII table containing + zero-precision floating point fields. [#3422] + +- When a float field for an ASCII table has zero-precision a decimal point + (with no digits following it) is still written to the field as long as + there is space for it, as recommended by the FITS standard. This makes it + less ambiguous that these columns should be interpreted as floats. [#3422] + +astropy.logger +^^^^^^^^^^^^^^ + +- Fix a bug that occurred when displaying warnings that produced an error + message ``dictionary changed size during iteration``. [#3353] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a bug in ``SLSQPLSQFitter`` where the ``maxiter`` argument was not + passed correctly to the optimizer. [#3339] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a problem where ``table.hstack`` fails to stack multiple references to + the same table, e.g. ``table.hstack([t, t])``. [#2995] + +- Fixed a problem where ``table.vstack`` and ``table.hstack`` failed to stack + a single table, e.g. ``table.vstack([t])``. [#3313] + +- Fix a problem when doing nested iterators on a single table. [#3358] + +- Fix an error when an empty list, tuple, or ndarray is used for item access + within a table. This now returns the table with no rows. [#3442] + +astropy.time +^^^^^^^^^^^^ + +- When creating a Time object from a datetime object the time zone + info is now correctly used. [#3160] + +- For Time objects, it is now checked that numerical input is finite. [#3396] + +astropy.units +^^^^^^^^^^^^^ + +- Added a ``latex_inline`` unit format that returns the units in LaTeX math + notation with negative exponents instead of fractions [#2622]. + +- When using a unit that is deprecated in a given unit format, + non-deprecated alternatives will be suggested. [#2806] For + example:: + + >>> import astropy.units as u + >>> u.Unit('Angstrom', format='fits') + WARNING: UnitsWarning: The unit 'Angstrom' has been deprecated + in the FITS standard. Suggested: nm (with data multiplied by + 0.1). [astropy.units.format.utils] + +astropy.utils +^^^^^^^^^^^^^ + +- ``treat_deprecations_as_exceptions`` has been fixed to recognize Astropy + deprecation warnings. [#3015] + +- Converted representation of progress bar units without suffix + from float to int in console.human_file_size. [#2201, #2202, #2721, #3299] + +astropy.wcs +^^^^^^^^^^^ + +- ``astropy.wcs.WCS.sub`` now accepts unicode strings as input on + Python 2.x [#3356] + +Misc +^^^^ + +- Some modules and tests that would crash upon import when using a non-final + release of Numpy (e.g. 1.9.0rc1). [#3471] + +Other Changes and Additions +--------------------------- + +- The bundled copy of astropy-helpers has been updated to v1.0. [#3515] + +- Updated ``astropy.extern.configobj`` to Version 5. Version 5 uses ``six`` + and the same code covers both Python 2 and Python 3. [#3149] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``repr`` of ``SkyCoord`` and coordinate frame classes now separate + frame attributes and coordinate information. [#2704, #2882] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Overwriting an existing file using the ``clobber=True`` option no longer + displays a warning message. [#1963] + +- ``fits.open`` no longer catches ``OSError`` exceptions on missing or + unreadable files-- instead it raises the standard Python exceptions in such + cases. [#2756, #2785] + +astropy.table +^^^^^^^^^^^^^ + +- Sped up setting of ``Column`` slices by an order of magnitude. [#2994, #3020] + +- Updated the bundled ``six`` module to version 1.7.3 and made 1.7.3 the + minimum acceptable version of ``six``. [#2814] + +- The version of ERFA included with Astropy is now v1.1.1 [#2971] + +- The code base is now fully Python 2 and 3 compatible and no longer requires + 2to3. [#2033] + +- `funcsigs `_ is included in + utils.compat, but defaults to the inspect module components where available + (3.3+) [#3151]. + +- The list of modules displayed in the pytest header can now be customized. + [#3157] + +- `jinja2 `_>=2.7 is now required to build the + source code from the git repository, in order to allow the ERFA wrappers to + be generated. [#3166] + + +0.4.5 (2015-02-16) +================== + +Bug Fixes +--------- + +- Fixed unnecessary attempt to run ``git`` when importing astropy. In + particular, fixed a crash in Python 3 that could result from this when + importing Astropy when the the current working directory is an empty git + repository. [#3475] + +Other Changes and Additions +--------------------------- + +- Updated bundled copy of astropy-helpers to v0.4.6. [#3508] + + +0.4.4 (2015-01-21) +================== + +Bug Fixes +--------- + +astropy.vo.samp +^^^^^^^^^^^^^^^ + +- ``astropy.vo.samp`` is now usable on Python builds that do not + support the SSLv3 protocol (which depends both on the version of + Python and the version of OpenSSL or LibreSSL that it is built + against.) [#3308] + +API Changes +----------- + +astropy.vo.samp +^^^^^^^^^^^^^^^ + +- The default SSL protocol used is now determined from the default + used in the Python ``ssl`` standard library. This default may be + different depending on the exact version of Python you are using. + [#3308] + +astropy.wcs +^^^^^^^^^^^ + +- WCS allows slices of the form slice(None, x, y), which previously resulted + in an unsliced copy being returned (note: this was previously incorrectly + reported as fixed in v0.4.3) [#2909] + + +0.4.3 (2015-01-15) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``Distance`` class has been fixed to no longer rely on the deprecated + cosmology functions. [#2991] + +- Ensure ``float32`` values can be used in coordinate representations. [#2983] + +- Fix frame attribute inheritance in ``SkyCoord.transform_to()`` method so + that the default attribute value (e.g. equinox) for the destination frame + gets used if no corresponding value was explicitly specified. [#3106] + +- ``Angle`` accepts hours:mins or deg:mins initializers (without + seconds). In these cases float minutes are also accepted. [#2843] + +- ``astropy.coordinates.SkyCoord`` objects are now copyable. [#2888] + +- ``astropy.coordinates.SkyCoord`` object attributes are now + immutable. It is still technically possible to change the + internal data for an array-valued coordinate object but this leads + to inconsistencies [#2889] and should not be done. [#2888] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The ``ztol`` keyword argument to z_at_value now works correctly [#2993]. + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fix a bug in Python 3 when guessing file format using a file object as + input. Also improve performance in same situation for Python 2. [#3132] + +- Fix a problem where URL was being downloaded for each guess. [#2001] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``in`` operator now works correctly for checking if an extension + is in an ``HDUList`` (as given via EXTNAME, (EXTNAME, EXTVER) tuples, + etc.) [#3060] + +- Added workaround for bug in MacOS X <= 10.8 that caused np.fromfile to + fail. [#3078] + +- Added support for the ``RICE_ONE`` compression type synonym. [#3115] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a test failure on Debian/PowerPC and Debian/s390x. [#2708] + +- Fixed crash in evaluating models that have more outputs than inputs--this + case may not be handled as desired for all conceivable models of this + format (some may have to implement custom ``prepare_inputs`` and + ``prepare_outputs`` methods). But as long as all outputs can be assumed + to have a shape determined from the broadcast of all inputs with all + parameters then this can be used safely. [#3250] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a bug that caused join to fail for multi-dimensional columns. [#2984] + +- Fix a bug where MaskedColumn attributes which had been changed since + the object was created were not being carried through when slicing. [#3023] + +- Fix a bug that prevented initializing a table from a structured array + with multi-dimensional columns with copy=True. [#3034] + +- Fixed unnecessarily large unicode columns when instantiating a table from + row data on Python 3. [#3052] + +- Improved the warning message when unable to aggregate non-numeric + columns. [#2700] + +astropy.units +^^^^^^^^^^^^^ + +- Operations on quantities with incompatible types now raises a much + more informative ``TypeError``. [#2934] + +- ``Quantity.tolist`` now overrides the ``ndarray`` method to give a + ``NotImplementedError`` (by renaming the previous ``list`` method). [#3050] + +- ``Quantity.round`` now always returns a ``Quantity`` (previously it + returned an ``ndarray`` for ``decimals>0``). [#3062] + +- Ensured ``np.squeeze`` always returns a ``Quantity`` (it only worked if + no dimensions were removed). [#3045] + +- Input to ``Quantity`` with a ``unit`` attribute no longer can get mangled + with ``copy=False``. [#3051] + +- Remove trailing space in ``__format__`` calls for dimensionless quantities. + [#3097] + +- Comparisons between units and non-unit-like objects now works + correctly. [#3108] + +- Units with fractional powers are now correctly multiplied together + by using rational arithmetic. [#3121] + +- Removed a few entries from spectral density equivalencies which did not + make sense. [#3153] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed an issue with the ``deprecated`` decorator on classes that invoke + ``super()`` in their ``__init__`` method. [#3004] + +- Fixed a bug which caused the ``metadata_conflicts`` parameter to be + ignored in the ``astropy.utils.metadata.merge`` function. [#3294] + +astropy.vo +^^^^^^^^^^ + +- Fixed an issue with reconnecting to a SAMP Hub. [#2674] + +astropy.wcs +^^^^^^^^^^^ + +- Invalid or out of range values passed to ``wcs_world2pix`` will + now be correctly identified and returned as ``nan`` + values. [#2965] + +- Fixed an issue which meant that Python thought ``WCS`` objects were + iterable. [#3066] + +Misc +^^^^ + +- Astropy will now work if your Python interpreter does not have the + ``bz2`` module installed. [#3104] + +- Fixed ``ResourceWarning`` for ``astropy/extern/bundled/six.py`` that could + occur sometimes after using Astropy in Python 3.4. [#3156] + +Other Changes and Additions +--------------------------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Improved the agreement of the FK5 <-> Galactic conversion with other + codes, and with the FK5 <-> FK4 <-> Galactic route. [#3107] + + +0.4.2 (2014-09-23) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``Angle`` accepts hours:mins or deg:mins initializers (without + seconds). In these cases float minutes are also accepted. + +- The ``repr`` for coordinate frames now displays the frame attributes + (ex: ra, dec) in a consistent order. It should be noted that as part of + this fix, the ``BaseCoordinateFrame.get_frame_attr_names()`` method now + returns an ``OrderedDict`` instead of just a ``dict``. [#2845] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fixed a crash when reading scaled float data out of a FITS file that was + loaded from a string (using ``HDUList.fromfile``) rather than from a file. + [#2710] + +- Fixed a crash when reading data from an HDU whose header contained in + invalid value for the BLANK keyword (e.g., a string value instead of an + integer as required by the FITS Standard). Invalid BLANK keywords are now + warned about, but are otherwise ignored. [#2711] + +- Fixed a crash when reading the header of a tile-compressed HDU if that + header contained invalid duplicate keywords resulting in a ``KeyError`` + [#2750] + +- Fixed crash when reading gzip-compressed FITS tables through the Astropy + ``Table`` interface. [#2783] + +- Fixed corruption when writing new FITS files through to gzipped files. + [#2794] + +- Fixed crash when writing HDUs made with non-contiguous data arrays to + file-like objects. [#2794] + +- It is now possible to create ``astropy.io.fits.BinTableHDU`` + objects with a table with zero rows. [#2916] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fixed a bug that prevented h5py ``Dataset`` objects from being + automatically recognized by ``Table.read``. [#2831] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Make ``LevMarLSQFitter`` work with ``weights`` keyword. [#2900] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed reference cycle in tables that could prevent ``Table`` objects + from being freed from memory. [#2879] + +- Fixed an issue where ``Table.pprint()`` did not print the header to + ``stdout`` when ``stdout`` is redirected (say, to a file). [#2878] + +- Fixed printing of masked values when a format is specified. [#1026] + +- Ensured that numpy ufuncs that return booleans return plain ``ndarray`` + instances, just like the comparison operators. [#2963] + +astropy.time +^^^^^^^^^^^^ + +- Ensure bigendian input to Time works on a little-endian machine + (and vice versa). [#2942] + +astropy.units +^^^^^^^^^^^^^ + +- Ensure unit is kept when adding 0 to quantities. [#2968] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed color printing on Windows with IPython 2.0. [#2878] + +astropy.vo +^^^^^^^^^^ + +- Improved error message on Cone Search time out. [#2687] + +Other Changes and Additions +--------------------------- + +- Fixed a couple issues with files being inappropriately included and/or + excluded from the source archive distributions of Astropy. [#2843, #2854] + +- As part of fixing the fact that masked elements of table columns could not be + printed when a format was specified, the column format string options were + expanded to allow simple specifiers such as ``'5.2f'``. [#2898] + +- Ensure numpy 1.9 is supported. [#2917] + +- Ensure numpy master is supported, by making ``np.cbrt`` work with quantities. + [#2937] + +0.4.1 (2014-08-08) +================== + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +- Fixed a bug where an unedited configuration file from astropy + 0.3.2 would not be correctly identified as unedited. [#2772] This + resulted in the warning:: + + WARNING: ConfigurationChangedWarning: The configuration options + in astropy 0.4 may have changed, your configuration file was not + updated in order to preserve local changes. A new configuration + template has been saved to + '~/.astropy/config/astropy.0.4.cfg'. [astropy.config.configuration] + +- Fixed the error message that is displayed when an old + configuration item has moved. Before, the destination + section was wrong. [#2772] + +- Added configuration settings for ``io.fits``, ``io.votable`` and + ``table.jsviewer`` that were missing from the configuration file + template. [#2772] + +- The configuration template is no longer rewritten on every import + of astropy, causing race conditions. [#2805] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fixed the multiplication of ``Kernel`` with numpy floats. [#2174] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- ``Distance`` can now take a list of quantities. [#2261] + +- For in-place operations for ``Angle`` instances in which the result unit + is not an angle, an exception is raised before the instance is corrupted. + [#2718] + +- ``CartesianPoints`` are now deprecated in favor of + ``CartesianRepresentation``. [#2727] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- An existing table within an HDF5 file can be overwritten without affecting + other datasets in the same HDF5 file by simultaneously using + ``overwrite=True`` and ``append=True`` arguments to the ``Table.write`` + method. [#2624] + +astropy.logger +^^^^^^^^^^^^^^ + +- Fixed a crash that could occur in rare cases when (such as in bundled + apps) where submodules of the ``email`` package are not importable. [#2671] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``astropy.nddata.NDData()`` no longer raises a ``ValueError`` when passed + a numpy masked array which has no masked entries. [#2784] + +astropy.table +^^^^^^^^^^^^^ + +- When saving a table to a FITS file containing a unit that is not + supported by the FITS standard, a warning rather than an exception + is raised. [#2797] + +astropy.units +^^^^^^^^^^^^^ + +- By default, ``Quantity`` and its subclasses will now convert to float also + numerical types such as ``decimal.Decimal``, which are stored as objects + by numpy. [#1419] + +- The units ``count``, ``pixel``, ``voxel`` and ``dbyte`` now output + to FITS, OGIP and VOUnit formats correctly. [#2798] + +astropy.utils +^^^^^^^^^^^^^ + +- Restored missing information from deprecation warning messages + from the ``deprecated`` decorator. [#2811] + +- Fixed support for ``staticmethod`` deprecation in the ``deprecated`` + decorator. [#2811] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed a memory leak when ``astropy.wcs.WCS`` objects are copied + [#2754] + +- Fixed a crash when passing ``ra_dec_order=True`` to any of the + ``*2world`` methods. [#2791] + +Other Changes and Additions +--------------------------- + +- Bundled copy of astropy-helpers upgraded to v0.4.1. [#2825] + +- General improvements to documentation and docstrings [#2722, #2728, #2742] + +- Made it easier for third-party packagers to have Astropy use their own + version of the ``six`` module (so long as it meets the minimum version + requirement) and remove the copy bundled with Astropy. See the + astropy/extern/README file in the source tree. [#2623] + + +0.4 (2014-07-16) +================ + +New Features +------------ + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- Added ``b_wien`` to represent Wien wavelength displacement law constant. + [#2194] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Changed the input parameter in ``Gaussian1DKernel`` and + ``Gaussian2DKernel`` from ``width`` to ``stddev`` [#2085]. + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The coordinates package has undergone major changes to implement + `APE5 `_ . + These include backwards-incompatible changes, as the underlying framework + has changed substantially. See the APE5 text and the package documentation + for more details. [#2422] + +- A ``position_angle`` method has been added to the new ``SkyCoord``. [#2487] + +- Updated ``Angle.dms`` and ``Angle.hms`` to return ``namedtuple`` -s instead + of regular tuples, and added ``Angle.signed_dms`` attribute that gives the + absolute value of the ``d``, ``m``, and ``s`` along with the sign. [#1988] + +- By default, ``Distance`` objects are now required to be positive. To + allow negative values, set ``allow_negative=True`` in the ``Distance`` + constructor when creating a ``Distance`` instance. + +- ``Longitude`` (resp. ``Latitude``) objects cannot be used any more to + initialize or set ``Latitude`` (resp. ``Longitude``) objects. An explicit + conversion to ``Angle`` is now required. [#2461] + +- The deprecated functions for pre-0.3 coordinate object names like + ``ICRSCoordinates`` have been removed. [#2422] + +- The ``rotation_matrix`` and ``angle_axis`` functions in + ``astropy.coordinates.angles`` were made more numerically consistent and + are now tested explicitly [#2619] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Added ``z_at_value`` function to find the redshift at which a cosmology + function matches a desired value. [#1909] + +- Added ``FLRW.differential_comoving_volume`` method to give the differential + comoving volume at redshift z. [#2103] + +- The functional interface is now deprecated in favor of the more-explicit + use of methods on cosmology objects. [#2343] + +- Updated documentation to reflect the removal of the functional + interface. [#2507] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- The ``astropy.io.ascii`` output formats ``latex`` and ``aastex`` accept a + dictionary called ``latex_dict`` to specify options for LaTeX output. It is + now possible to specify the table alignment within the text via the + ``tablealign`` keyword. [#1838] + +- If ``header_start`` is specified in a call to ``ascii.get_reader`` or any + method that calls ``get_reader`` (e.g. ``ascii.read``) but ``data_start`` + is not specified at the same time, then ``data_start`` is calculated so + that the data starts after the header. Before this, the default was + that the header line was read again as the first data line + [#855 and #1844]. + +- A new ``csv`` format was added as a convenience for handling CSV (comma- + separated values) data. [#1935] + This format also recognises rows with an inconsistent number of elements. + [#1562] + +- An option was added to guess the start of data for CDS format files when + they do not strictly conform to the format standard. [#2241] + +- Added an HTML reader and writer to the ``astropy.io.ascii`` package. + Parsing requires the installation of BeautifulSoup and is therefore + an optional feature. [#2160] + +- Added support for inputting column descriptions and column units + with the ``io.ascii.SExtractor`` reader. [#2372] + +- Allow the use of non-local ReadMe files in the CDS reader. [#2329] + +- Provide a mechanism to select how masked values are printed. [#2424] + +- Added support for reading multi-aperture daophot file. [#2656] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Included a new command-line script called ``fitsheader`` to display the + header(s) of a FITS file from the command line. [#2092] + +- Added new verification options ``fix+ignore``, ``fix+warn``, + ``fix+exception``, ``silentfix+ignore``, ``silentfix+warn``, and + ``silentfix+exception`` which give more control over how to report fixable + errors as opposed to unfixable errors. + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Prototype implementation of fitters that treat optimization algorithms + separately from fit statistics, allowing new fitters to be created by + mixing and matching optimizers and statistic functions. [#1914] + +- Slight overhaul to how inputs to and outputs from models are handled with + respect to array-valued parameters and variables, as well as sets of + multiple models. See the associated PR and the modeling section of the + v0.4 documentation for more details. [#2634] + +- Added a new ``SimplexLSQFitter`` which uses a downhill simplex optimizer + with a least squares statistic. [#1914] + +- Changed ``Gaussian2D`` model such that ``theta`` now increases + counterclockwise. [#2199] + +- Replaced the ``MatrixRotation2D`` model with a new model called simply + ``Rotation2D`` which requires only an angle to specify the rotation. + The new ``Rotation2D`` rotates in a counter-clockwise sense whereas + the old ``MatrixRotation2D`` increased the angle clockwise. + [#2266, #2269] + +- Added a new ``AffineTransformation2D`` model which serves as a + replacement for the capability of ``MatrixRotation2D`` to accept an + arbitrary matrix, while also adding a translation capability. [#2269] + +- Added ``GaussianAbsorption1D`` model. [#2215] + +- New ``Redshift`` model [#2176]. + +astropy.nddata +^^^^^^^^^^^^^^ + +- Allow initialization ``NDData`` or ``StdDevUncertainty`` with a + ``Quantity``. [#2380] + +astropy.stats +^^^^^^^^^^^^^ + +- Added flat prior to binom_conf_interval and binned_binom_proportion + +- Change default in ``sigma_clip`` from ``np.median`` to ``np.ma.median``. + [#2582] + +astropy.sphinx +^^^^^^^^^^^^^^ + +- Note, the following new features are included in astropy-helpers as well: + +- The ``automodapi`` and ``automodsumm`` extensions now include sphinx + configuration options to write out what ``automodapi`` and ``automodsumm`` + generate, mainly for debugging purposes. [#1975, #2022] + +- Reference documentation now shows functions/class docstrings at the + inteded user-facing API location rather than the actual file where + the implementation is found. [#1826] + +- The ``automodsumm`` extension configuration was changed to generate + documentation of class ``__call__`` member functions. [#1817, #2135] + +- ``automodapi`` and ``automodsumm`` now have an ``:allowed-package-names:`` + option that make it possible to document functions and classes that + are in a different namespace. [#2370] + +astropy.table +^^^^^^^^^^^^^ + +- Improved grouped table aggregation by using the numpy ``reduceat()`` method + when possible. This can speed up the operation by a factor of at least 10 + to 100 for large unmasked tables and columns with relatively small + group sizes. [#2625] + +- Allow row-oriented data input using a new ``rows`` keyword argument. + [#850] + +- Allow subclassing of ``Table`` and the component classes ``Row``, ``Column``, + ``MaskedColumn``, ``TableColumns``, and ``TableFormatter``. [#2287] + +- Fix to allow numpy integer types as valid indices into tables in + Python 3.x [#2477] + +- Remove transition code related to the order change in ``Column`` and + ``MaskedColumn`` arguments ``name`` and ``data`` from Astropy 0.2 + to 0.3. [#2511] + +- Change HTML table representation in IPython notebook to show all + table columns instead of restricting to 80 column width. [#2651] + +astropy.time +^^^^^^^^^^^^ + +- Mean and apparent sidereal time can now be calculated using the + ``sidereal_time`` method [#1418]. + +- The time scale now defaults to UTC if no scale is provided. [#2091] + +- ``TimeDelta`` objects can have all scales but UTC, as well as, for + consistency with time-like quantities, undefined scale (where the + scale is taken from the object one adds to or subtracts from). + This allows, e.g., to work consistently in TDB. [#1932] + +- ``Time`` now supports ISO format strings that end in "Z". [#2211, #2203] + +astropy.units +^^^^^^^^^^^^^ + +- Support for the unit format `Office of Guest Investigator Programs (OGIP) + FITS files + `__ + has been added. [#377] + +- The ``spectral`` equivalency can now handle angular wave number. [#1306 and + #1899] + +- Added ``one`` as a shorthand for ``dimensionless_unscaled``. [#1980] + +- Added ``dex`` and ``dB`` units. [#1628] + +- Added ``temperature()`` equivalencies to support conversion between + Kelvin, Celsius, and Fahrenheit. [#2209] + +- Added ``temperature_energy()`` equivalencies to support conversion + between electron-volt and Kelvin. [#2637] + +- The runtime of ``astropy.units.Unit.compose`` is greatly improved + (by a factor of 2 in most cases) [#2544] + +- Added ``electron`` unit. [#2599] + +astropy.utils +^^^^^^^^^^^^^ + +- ``timer.RunTimePredictor`` now uses ``astropy.modeling`` in its + ``do_fit()`` method. [#1896] + +astropy.vo +^^^^^^^^^^ + +- A new sub-package, ``astropy.vo.samp``, is now available (this was + previously the SAMPy package, which has been refactored for use in + Astropy). [#1907] + +- Enhanced functionalities for ``VOSCatalog`` and ``VOSDatabase``. [#1206] + +astropy.wcs +^^^^^^^^^^^ + +- astropy now requires wcslib version 4.23. The version of wcslib + included with astropy has been updated to version 4.23. + +- Bounds checking is now performed on native spherical + coordinates. Any out-of-bounds values will be returned as + ``NaN``, and marked in the ``stat`` array, if using the + low-level ``wcslib`` interface such as + ``astropy.wcs.Wcsprm.p2s``. [#2107] + +- A new method, ``astropy.wcs.WCS.compare()``, compares two wcsprm + structs for equality with varying degrees of strictness. [#2361] + +- New ``astropy.wcs.utils`` module, with a handful of tools for manipulating + WCS objects, including dropping, swapping, and adding axes. + +Misc +^^^^ + +- Includes the new astropy-helpers package which separates some of Astropy's + build, installation, and documentation infrastructure out into an + independent package, making it easier for Affiliated Packages to depend on + these features. astropy-helpers replaces/deprecates some of the submodules + in the ``astropy`` package (see API Changes below). See also + `APE 4 `_ + for more details on the motivation behind and implementation of + astropy-helpers. [#1563] + + +API Changes +----------- + +astropy.config +^^^^^^^^^^^^^^ + +- The configuration system received a major overhaul, as part of APE3. It is + no longer possible to save configuration items from Python, but instead + users must edit the configuration file directly. The locations of + configuration items have moved, and some have been changed to science state + values. The old locations should continue to work until astropy 0.5, but + deprecation warnings will be displayed. See the `Configuration transition + `_ + docs for a detailed description of the changes and how to update existing + code. [#2094] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``astropy.io.fits.new_table`` function is now fully deprecated (though + will not be removed for a long time, considering how widely it is used). + + Instead please use the more explicit ``BinTableHDU.from_columns`` to create + a new binary table HDU, and the similar ``TableHDU.from_columns`` to create + a new ASCII table. These otherwise accept the same arguments as + ``new_table`` which is now just a wrapper for these. + +- The ``.fromstring`` classmethod of each HDU type has been simplified such + that, true to its namesake, it only initializes an HDU from a string + containing its header *and* data. + +- Fixed an issue where header wildcard matching (for example + ``header['DATE*']``) can be used to match *any* characters that might + appear in a keyword. Previously this only matched keywords containing + characters in the set ``[0-9A-Za-z_]``. Now this can also match a hyphen + ``-`` and any other characters, as some conventions like ``HIERARCH`` and + record-valued keyword cards allow a wider range of valid characters than + standard FITS keywords. + +- This will be the *last* release to support the following APIs that have + been marked deprecated since Astropy v0.1/PyFITS v3.1: + +- The ``CardList`` class, which was part of the old header implementation. + +- The ``Card.key`` attribute. Use ``Card.keyword`` instead. + +- The ``Card.cardimage`` and ``Card.ascardimage`` attributes. Use simply + ``Card.image`` or ``str(card)`` instead. + +- The ``create_card`` factory function. Simply use the normal ``Card`` + constructor instead. + +- The ``create_card_from_string`` factory function. Use ``Card.fromstring`` + instead. + +- The ``upper_key`` function. Use ``Card.normalize_keyword`` method + instead (this is not unlikely to be used outside of PyFITS itself, but it + was technically public API). + +- The usage of ``Header.update`` with ``Header.update(keyword, value, + comment)`` arguments. ``Header.update`` should only be used analogously + to ``dict.update``. Use ``Header.set`` instead. + +- The ``Header.ascard`` attribute. Use ``Header.cards`` instead for a list + of all the ``Card`` objects in the header. + +- The ``Header.rename_key`` method. Use ``Header.rename_keyword`` instead. + +- The ``Header.get_history`` method. Use ``header['HISTORY']`` instead + (normal keyword lookup). + +- The ``Header.get_comment`` method. Use ``header['COMMENT']`` instead. + +- The ``Header.toTxtFile`` method. Use ``header.totextfile`` instead. + +- The ``Header.fromTxtFile`` method. Use ``Header.fromtextfile`` instead. + +- The ``tdump`` and ``tcreate`` functions. Use ``tabledump`` and + ``tableload`` respectively. + +- The ``BinTableHDU.tdump`` and ``tcreate`` methods. Use + ``BinTableHDU.dump`` and ``BinTableHDU.load`` respectively. + +- The ``txtfile`` argument to the ``Header`` constructor. Use + ``Header.fromfile`` instead. + +- The ``startColumn`` and ``endColumn`` arguments to the ``FITS_record`` + constructor. These are unlikely to be used by any user code. + + These deprecated interfaces will be removed from the development version of + Astropy following the v0.4 release (they will still be available in any + v0.4.x bugfix releases, however). + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- The method computing the derivative of the model with respect + to parameters was renamed from ``deriv`` to ``fit_deriv``. [#1739] + +- ``ParametricModel`` and the associated ``Parametric1DModel`` and + ``Parametric2DModel`` classes have been renamed ``FittableModel``, + ``Fittable1DModel``, and ``Fittable2DModel`` respectively. The base + ``Model`` class has subsumed the functionality of the old + + ``ParametricModel`` class so that all models support parameter constraints. + The only distinction of ``FittableModel`` is that anything which subclasses + it is assumed "safe" to use with Astropy fitters. [#2276] + +- ``NonLinearLSQFitter`` has been renamed ``LevMarLSQFitter`` to emphasise + that it uses the Levenberg-Marquardt optimization algorithm with a + least squares statistic function. [#1914] + +- The ``SLSQPFitter`` class has been renamed ``SLSQPLSQFitter`` to emphasize + that it uses the Sequential Least Squares Programming optimization + algorithm with a least squares statistic function. [#1914] + +- The ``Fitter.errorfunc`` method has been renamed to the more general + ``Fitter.objective_function``. [#1914] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Issue warning if unit is changed from a non-trivial value by directly + setting ``NDData.unit``. [#2411] + +- The ``mask`` and ``flag`` attributes of ``astropy.nddata.NDData`` can now + be set with any array-like object instead of requiring that they be set + with a ``numpy.ndarray``. [#2419] + +astropy.sphinx +^^^^^^^^^^^^^^ + +- Use of the ``astropy.sphinx`` module is deprecated; all new development of + this module is in ``astropy_helpers.sphinx`` which should be used instead + (therefore documentation builds that made use of any of the utilities in + ``astropy.sphinx`` now have ``astropy_helpers`` as a documentation + dependency). + +astropy.table +^^^^^^^^^^^^^ + +- The default table printing function now shows a table header row for units + if any columns have the unit attribute set. [#1282] + +- Before, an unmasked ``Table`` was automatically converted to a masked + table if generated from a masked Table or a ``MaskedColumn``. + Now, this conversion is only done if explicitly requested or if any + of the input values is actually masked. [#1185] + +- The repr() function of ``astropy.table.Table`` now shows the units + if any columns have the unit attribute set. [#2180] + +- The semantics of the config options ``table.max_lines`` and + ``table.max_width`` has changed slightly. If these values are not + set in the config file, astropy will try to determine the size + automatically from the terminal. [#2683] + +astropy.time +^^^^^^^^^^^^ + +- Correct use of UT in TDB calculation [#1938, #1939]. + +- ``TimeDelta`` objects can have scales other than TAI [#1932]. + +- Location information should now be passed on via an ``EarthLocation`` + instance or anything that initialises it, e.g., a tuple containing + either geocentric or geodetic coordinates. [#1928] + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity`` now converts input to float by default, as this is physically + most sensible for nearly all units [#1776]. + +- ``Quantity`` comparisons with ``==`` or ``!=`` now always return ``True`` + or ``False``, even if units do not match (for which case a ``UnitsError`` + used to be raised). [#2328] + +- Applying ``float`` or ``int`` to a ``Quantity`` now works for all + dimensionless quantities; they are automatically converted to unscaled + dimensionless. [#2249] + +- The exception ``astropy.units.UnitException``, which was + deprecated in astropy 0.2, has been removed. Use + ``astropy.units.UnitError`` instead [#2386] + +- Initializing a ``Quantity`` with a valid number/array with a ``unit`` + attribute now interprets that attribute as the units of the input value. + This makes it possible to initialize a ``Quantity`` from an Astropy + ``Table`` column and have it correctly pick up the units from the column. + [#2486] + +astropy.wcs +^^^^^^^^^^^ + +- ``calcFootprint`` was deprecated. It is replaced by + ``calc_footprint``. An optional boolean keyword ``center`` was + added to ``calc_footprint``. It controls whether the centers or + the corners of the pixels are used in the computation. [#2384] + +- ``astropy.wcs.WCS.sip_pix2foc`` and + ``astropy.wcs.WCS.sip_foc2pix`` formerly did not conform to the + ``SIP`` standard: ``CRPIX`` was added to the ``foc`` result so + that it could be used as input to "core FITS WCS". As of astropy + 0.4, ``CRPIX`` is no longer added to the result, so the ``foc`` + space is correct as defined in the `SIP convention + `__. [#2360] + +- ``astropy.wcs.UnitConverter``, which was deprecated in astropy + 0.2, has been removed. Use the ``astropy.units`` module + instead. [#2386] + +- The following methods on ``astropy.wcs.WCS``, which were + deprecated in astropy 0.1, have been removed [#2386]: + +- ``all_pix2sky`` -> ``all_pix2world`` + +- ``wcs_pix2sky`` -> ``wcs_pix2world`` + +- ``wcs_sky2pix`` -> ``wcs_world2pix`` + +- The ``naxis1`` and ``naxis2`` attributes and the ``get_naxis`` + method of ``astropy.wcs.WCS``, which were deprecated in astropy + 0.2, have been removed. Use the shape of the underlying FITS data + array instead. [#2386] + +Misc +^^^^ + +- The ``astropy.setup_helpers`` and ``astropy.version_helpers`` modules are + deprecated; any non-critical fixes and development to those modules should + be in ``astropy_helpers`` instead. Packages that use these modules in + their ``setup.py`` should depend on ``astropy_helpers`` following the same + pattern as in the Astropy package template. + + +Bug Fixes +--------- + +astropy.constants +^^^^^^^^^^^^^^^^^ + +- ``astropy.constants.Contant`` objects can now be deep + copied. [#2601] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The distance modulus function in ``astropy.cosmology`` can now handle + negative distances, which can occur in certain closed cosmologies. [#2008] + +- Removed accidental imports of some extraneous variables in + ``astropy.cosmology`` [#2025] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- ``astropy.io.ascii.read`` would fail to read lists of strings where some of + the strings consisted of just a newline ("\n"). [#2648] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Use NaN for missing values in FITS when using Table.write for float + columns. Earlier the default fill value was close to 1e20.[#2186] + +- Fixes for checksums on 32-bit platforms. Results may be different + if writing or checking checksums in "nonstandard" mode. [#2484] + +- Additional minor bug fixes ported from PyFITS. [#2575] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- It is now possible to save an ``astropy.table.Table`` object as a + VOTable with any of the supported data formats, ``tabledata``, + ``binary`` and ``binary2``, by using the ``tabledata_format`` + kwarg. [#2138] + +- Fixed a crash writing out variable length arrays. [#2577] + +astropy.nddata +^^^^^^^^^^^^^^ + +- Indexing ``NDData`` in a way that results in a single element returns that + element. [#2170] + +- Change construction of result of arithmetic and unit conversion to allow + subclasses to require the presence of attribute like unit. [#2300] + +- Scale uncertainties to correct units in arithmetic operations and unit + conversion. [#2393] + +- Ensure uncertainty and mask members are copied in arithmetic and + convert_unit_to. [#2394] + +- Mask result of arithmetic if either of the operands is masked. [#2403] + +- Copy all attributes of input object if ``astropy.nddata.NDData`` is + initialized with an ``NDData`` object. [#2406] + +- Copy ``flags`` to new object in ``convert_unit_to``. [#2409] + +- Result of ``NDData`` arithmetic makes a copy of any WCS instead of using + a reference. [#2410] + +- Fix unit handling for multiplication/division and use + ``astropy.units.Quantity`` for units arithmetic. [#2413] + +- A masked ``NDData`` is now converted to a masked array when used in an + operation or ufunc with a numpy array. [#2414] + +- An unmasked ``NDData`` now uses an internal representation of its mask + state that ``numpy.ma`` expects so that an ``NDData`` behaves as an + unmasked array. [#2417] + +astropy.sphinx +^^^^^^^^^^^^^^ + +- Fix crash in smart resolver when the resolution doesn't work. [#2591] + +astropy.table +^^^^^^^^^^^^^ + +- The ``astropy.table.Column`` object can now use both functions and callable + objects as formats. [#2313] + +- Fixed a problem on 64 bit windows that caused errors + "expected 'DTYPE_t' but got 'long long'" [#2490] + +- Fix initialisation of ``TableColumns`` with lists or tuples. [#2647] + +- Fix removal of single column using ``remove_columns``. [#2699] + +- Fix a problem that setting a row element within a masked table did not + update the corresponding table element. [#2734] + +astropy.time +^^^^^^^^^^^^ + +- Correct UT1->UTC->UT1 round-trip being off by 1 second if UT1 is + on a leap second. [#2077] + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity.copy`` now behaves identically to ``ndarray.copy``, and thus + supports the ``order`` argument (for numpy >=1.6). [#2284] + +- Composing base units into identical composite units now works. [#2382] + +- Creating and composing/decomposing units is now substantially faster [#2544] + +- ``Quantity`` objects now are able to be assigned NaN [#2695] + +astropy.wcs +^^^^^^^^^^^ + +- Astropy now requires wcslib version 4.23. The version of wcslib + included with astropy has been updated to version 4.23. + +- Bug fixes in the projection routines: in ``hpxx2s`` [the + cartesian-to-spherical operation of the ``HPX`` projection] + relating to bounds checking, bug introduced at wcslib 4.20; in + ``parx2s`` and molx2s`` [the cartesion-to-spherical operation of + the ``PAR`` and ``MOL`` projections respectively] relating to + setting the stat vector; in ``hpxx2s`` relating to implementation + of the vector API; and in ``xphx2s`` relating to setting an + out-of-bounds value of *phi*. + +- In the ``PCO`` projection, use alternative projection equations + for greater numerical precision near theta == 0. In the ``COP`` + projection, return an exact result for theta at the poles. + Relaxed the tolerance for bounds checking a little in ``SFL`` + projection. + +- Fix a bug allocating insufficient memory in + ``astropy.wcs.WCS.sub`` [#2468] + +- A new method, ``Wcsprm.bounds_check`` (corresponding to wcslib's + ``wcsbchk``) has been added to control what bounds checking is performed by + wcslib. + +- ``WCS.to_header`` will now raise a more meaningful exception when the WCS + information is invalid or inconsistent in some way. [#1854] + +- In ``WCS.to_header``, ``RESTFRQ`` and ``RESTWAV`` are no longer + rewritten if zero. [#2468] + +- In ``WCS.to_header``, floating point values will now always be written + with an exponent or fractional part, i.e. ``.0`` being appended if necessary + to acheive this. [#2468] + +- If the C extension for ``astropy.wcs`` was not built or fails to import for + any reason, ``import astropy.wcs`` will result in an ``ImportError``, + rather than getting obscure errors once the ``astropy.wcs`` is used. + [#2061] + +- When the C extension for ``astropy.wcs`` is built using a version of + ``wscslib`` already present in the system, the package does not try + to install ``wcslib`` headers under ``astropy/wcs/include``. [#2536] + +- Fixes an unresolved external symbol error in the + ``astropy.wcs._wcs`` C extension on Microsoft Windows when built + with a Microsoft compiler. [#2478] + +Misc +^^^^ + +- Running the test suite with ``python setup.py test`` now works if + the path to the source contains spaces. [#2488] + +- The version of ERFA included with Astropy is now v1.1.0 [#2497] + +- Removed deprecated option from travis configuration and force use of + wheels rather than allowing build from source. [#2576] + +- The short option ``-n`` to run tests in parallel was broken + (conflicts with the distutils built-in option of "dry-run"). + Changed to ``-j``. [#2566] + +Other Changes and Additions +--------------------------- + +- python setup.py test --coverage will now give more accurate + results, because the coverage analysis will include early imports of + astropy. There doesn't seem to be a way to get this to work when + doing ``import astropy; astropy.test()``, so the ``coverage`` + keyword to ``astropy.test`` has been removed. Coverage testing now + depends only on `coverage.py + `__, not + ``pytest-cov``. [#2112] + +- The included version of py.test has been upgraded to 2.5.1. [#1970] + +- The included version of six.py has been upgraded to 1.5.2. [#2006] + +- Where appropriate, tests are now run both with and without the + ``unicode_literals`` option to ensure that we support both cases. [#1962] + +- Running the Astropy test suite from within the IPython REPL is disabled for + now due to bad interaction between the test runner and IPython's logging + and I/O handler. For now, run the Astropy tests should be run in the basic + Python interpreter. [#2684] + +- Added support for numerical comparison of floating point values appearing in + the output of doctests using a ``+FLOAT_CMP`` doctest flag. [#2087] + +- A monkey patch is performed to fix a bug in Numpy version 1.7 and + earlier where unicode fill values on masked arrays are not + supported. This may cause unintended side effects if your + application also monkey patches ``numpy.ma`` or relies on the broken + behavior. If unicode support of masked arrays is important to your + application, upgrade to Numpy 1.8 or later for best results. [#2059] + +- The developer documentation has been extensively rearranged and + rewritten. [#1712] + +- The ``human_time`` function in ``astropy.utils`` now returns strings + without zero padding. [#2420] + +- The ``bdist_dmg`` command for ``setup.py`` has now been removed. [#2553] + +- Many broken API links have been fixed in the documentation, and the + ``nitpick`` Sphinx option is now used to avoid broken links in future. + [#1221, #2019, #2109, #2161, #2162, #2192, #2200, #2296, #2448, #2456, + #2460, #2467, #2476, #2508, #2509] + + +0.3.2 (2014-05-13) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- if ``sep`` argument is specified to be a single character in + ``sexagisimal_to_string``, it now includes seperators only between + items [#2183] + +- Ensure comparisons involving ``Distance`` objects do not raise exceptions; + also ensure operations that lead to units other than length return + ``Quantity``. [#2206, #2250] + +- Multiplication and division of ``Angle`` objects is now + supported. [#2273] + +- Fixed ``Angle.to_string`` functionality so that negative angles have the + correct amount of padding when ``pad=True``. [#2337] + +- Mixing strings and quantities in the ``Angle`` constructor now + works. For example: ``Angle(['1d', 1. * u.d])``. [#2398] + +- If ``Longitude`` is given a ``Longitude`` as input, use its ``wrap_angle`` + by default [#2705] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Fixed ``format()`` compatibility with Python 2.6. [#2129] + +- Be more careful about converting to floating point internally [#1815, #1818] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- The CDS reader in ``astropy.io.ascii`` can now handle multiple + description lines in ReadMe files. [#2225] + +- When reading a table with values that generate an overflow error during + type conversion (e.g. overflowing the native C long type), fall through to + using string. Previously this generated an exception [#2234]. + +- Recognize any string with one to four dashes as null value. [#1335] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Allow pickling of ``FITS_rec`` objects. [#1597] + +- Improved behavior when writing large compressed images on OSX by removing + an unnecessary check for platform architecture. [#2345] + +- Fixed an issue where Astropy ``Table`` objects containing boolean columns + were not correctly written out to FITS files. [#1953] + +- Several other bug fixes ported from PyFITS v3.2.3 [#2368] + +- Fixed a crash on Python 2.x when writing a FITS file directly to a + ``StringIO.StringIO`` object. [#2463] + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Allow readers/writers with the same name to be attached to different + classes. [#2312] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- By default, floating point values are now written out using + ``repr`` rather than ``str`` to preserve precision [#2137] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed the ``SIP`` and ``InverseSIP`` models both so that they work in the + first place, and so that they return results consistent with the SIP + functions in ``astropy.wcs``. [#2177] + +astropy.stats +^^^^^^^^^^^^^ + +- Ensure the ``axis`` keyword in ``astropy.stats.funcs`` can now be used for + all axes. [#2173] + +astropy.table +^^^^^^^^^^^^^ + +- Ensure nameless columns can be printed, using 'None' for the header. [#2213] + +astropy.time +^^^^^^^^^^^^ + +- Fixed pickling of ``Time`` objects. [#2123] + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity._repr_latex_()`` returns ``NotImplementedError`` for quantity + arrays instead of an uninformative formatting exception. [#2258] + +- Ensure ``Quantity.flat`` always returns ``Quantity``. [#2251] + +- Angstrom unit renders better in MathJax [#2286] + +astropy.utils +^^^^^^^^^^^^^ + +- Progress bars will now be displayed inside the IPython + qtconsole. [#2230] + +- ``data.download_file()`` now evaluates ``REMOTE_TIMEOUT()`` at runtime + rather than import time. Previously, setting ``REMOTE_TIMEOUT`` after + import had no effect on the function's behavior. [#2302] + +- Progressbar will be limited to 100% so that the bar does not exceed the + terminal width. The numerical display can still exceed 100%, however. + +astropy.vo +^^^^^^^^^^ + +- Fixed ``format()`` compatibility with Python 2.6. [#2129] + +- Cone Search validation no longer raises ``ConeSearchError`` for positive RA. + [#2240, #2242] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed a bug where calling ``astropy.wcs.Wcsprm.sub`` with + ``WCSSUB_CELESTIAL`` may cause memory corruption due to + underallocation of a temporary buffer. [#2350] + +- Fixed a memory allocation bug in ``astropy.wcs.Wcsprm.sub`` and + ``astropy.wcs.Wcsprm.copy``. [#2439] + +Misc +^^^^ + +- Fixes for compatibility with Python 3.4. [#1945] + +- ``import astropy; astropy.test()`` now correctly uses the same test + configuration as ``python setup.py test`` [#1811] + + +0.3.1 (2014-03-04) +================== + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +- Fixed a bug where ``ConfigurationItem.set_temp()`` does not reset to + default value when exception is raised within ``with`` block. [#2117] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug where ``_truncation`` was left undefined for ``CustomKernel``. + [#2016] + +- Fixed a bug with ``_normalization`` when ``CustomKernel`` input array + sums to zero. [#2016] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed a bug where using ``==`` on two array coordinates wouldn't + work. [#1832] + +- Fixed bug which caused ``len()`` not to work for coordinate objects and + added a ``.shape`` property to get appropriately array-like behavior. + [#1761, #2014] + +- Fixed a bug where sexagesimal notation would sometimes include + exponential notation in the last field. [#1908, #1913] + +- ``CompositeStaticMatrixTransform`` no longer attempts to reference the + undefined variable ``self.matrix`` during instantiation. [#1944] + +- Fixed pickling of ``Longitude``, ensuring ``wrap_angle`` is preserved + [#1961] + +- Allow ``sep`` argument in ``Angle.to_string`` to be empty (resulting in no + separators) [#1989] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Allow passing unicode delimiters when reading or writing tables. The + delimiter must be convertible to pure ASCII. [#1949] + +- Fix a problem when reading a table and renaming the columns to names that + already exist. [#1991] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Ported all bug fixes from PyFITS 3.2.1. See the PyFITS changelog at + http://pyfits.readthedocs.io/en/v3.2.1/ [#2056] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fixed issues in the HDF5 Table reader/writer functions that occurred on + Windows. [#2099] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- The ``write_null_values`` kwarg to ``VOTable.to_xml``, when set to `False` + (the default) would produce non-standard VOTable files. Therefore, this + functionality has been replaced by a better understanding that knows which + fields in a VOTable may be left empty (only ``char``, ``float`` and + ``double`` in VOTable 1.1 and 1.2, and all fields in VOTable 1.3). The + kwarg is still accepted but it will be ignored, and a warning is emitted. + [#1809] + +- Printing out a ``astropy.io.votable.tree.Table`` object using `repr` or + `str` now uses the pretty formatting in ``astropy.table``, so it's possible + to easily preview the contents of a ``VOTable``. [#1766] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed bug in computation of model derivatives in ``LinearLSQFitter``. + [#1903] + +- Raise a ``NotImplementedError`` when fitting composite models. [#1915] + +- Fixed bug in the computation of the ``Gaussian2D`` model. [#2038] + +- Fixed bug in the computation of the ``AiryDisk2D`` model. [#2093] + +astropy.sphinx +^^^^^^^^^^^^^^ + +- Added slightly more useful debug info for AstropyAutosummary. [#2024] + +astropy.table +^^^^^^^^^^^^^ + +- The column string representation for n-dimensional cells with only + one element has been fixed. [#1522] + +- Fix a problem that caused ``MaskedColumn.__getitem__`` to not preserve + column metadata. [#1471, #1872] + +- With Numpy prior to version 1.6.2, tables with Unicode columns now + sort correctly. [#1867] + +- ``astropy.table`` can now print out tables with Unicode columns containing + non-ascii characters. [#1864] + +- Columns can now be named with Unicode strings, as long as they contain only + ascii characters. This makes using ``astropy.table`` easier on Python 2 + when ``from __future__ import unicode_literals`` is used. [#1864] + +- Allow pickling of ``Table``, ``Column``, and ``MaskedColumn`` objects. [#792] + +- Fix a problem where it was not possible to rename columns after sorting or + adding a row. [#2039] + +astropy.time +^^^^^^^^^^^^ + +- Fix a problem where scale conversion problem in TimeFromEpoch + was not showing a useful error [#2046] + +- Fix a problem when converting to one of the formats ``unix``, ``cxcsec``, + ``gps`` or ``plot_date`` when the time scale is ``UT1``, ``TDB`` or ``TCB`` + [#1732] + +- Ensure that ``delta_ut1_utc`` gets calculated when accessed directly, + instead of failing and giving a rather obscure error message [#1925] + +- Fix a bug when computing the TDB to TT offset. The transform routine was + using meters instead of kilometers for the Earth vector. [#1929] + +- Increase ``__array_priority__`` so that ``TimeDelta`` can convert itself + to a ``Quantity`` also in reverse operations [#1940] + +- Correct hop list from TCG to TDB to ensure that conversion is + possible [#2074] + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity`` initialisation rewritten for speed [#1775] + +- Fixed minor string formatting issue for dimensionless quantities. [#1772] + +- Fix error for inplace operations on non-contiguous quantities [#1834]. + +- The definition of the unit ``bar`` has been corrected to "1e5 + Pascal" from "100 Pascal" [#1910] + +- For units that are close to known units, but not quite, for + example due to differences in case, the exception will now include + recommendations. [#1870] + +- The generic and FITS unit parsers now accept multiple slashes in + the unit string. There are multiple ways to interpret them, but + the approach taken here is to convert "m/s/kg" to "m s-1 kg-1". + Multiple slashes are accepted, but discouraged, by the FITS + standard, due to the ambiguity of parsing, so a warning is raised + when it is encountered. [#1911] + +- The use of "angstrom" (with a lower case "a") is now accepted in FITS unit + strings, since it is in common usage. However, since it is not officially + part of the FITS standard, a warning will be issued when it is encountered. + [#1911] + +- Pickling unrecognized units will not raise a ``AttributeError``. [#2047] + +- ``astropy.units`` now correctly preserves the precision of + fractional powers. [#2070] + +- If a ``Unit`` or ``Quantity`` is raised to a floating point power + that is very close to a rational number with a denominator less + than or equal to 10, it is converted to a ``Fraction`` object to + preserve its precision through complex unit conversion operations. + [#2070] + +astropy.utils +^^^^^^^^^^^^^ + +- Fixed crash in ``timer.RunTimePredictor.do_fit``. [#1905] + +- Fixed ``astropy.utils.compat.argparse`` for Python 3.1. [#2017] + +astropy.wcs +^^^^^^^^^^^ + +- ``astropy.wcs.WCS``, ``astropy.wcs.WCS.fix`` and + ``astropy.wcs.find_all_wcs`` now have a ``translate_units`` keyword + argument that is passed down to ``astropy.wcs.Wcsprm.fix``. This can be + used to specify any unsafe translations of units from rarely used ones to + more commonly used ones. + + Although ``"S"`` is commonly used to represent seconds, its translation to + ``"s"`` is potentially unsafe since the standard recognizes ``"S"`` + formally as Siemens, however rarely that may be used. The same applies to + ``"H"`` for hours (Henry), and ``"D"`` for days (Debye). + + When these sorts of changes are performed, a warning is emitted. + [#1854] + +- When a unit is "fixed" by ``astropy.wcs.WCS.fix`` or + ``astropy.wcs.Wcsprm.unitfix``, it now correctly reports the ``CUNIT`` + field that was changed. [#1854] + +- ``astropy.wcs.Wcs.printwcs`` will no longer warn that ``cdelt`` is being + ignored when none was present in the FITS file. [#1845] + +- ``astropy.wcs.Wcsprm.set`` is called from within the ``astropy.wcs.WCS`` + constructor, therefore any invalid information in the keywords will be + raised from the constructor, rather than on a subsequent call to a + transformation method. [#1918] + +- Fix a memory corruption bug when using ``astropy.wcs.Wcs.sub`` with + ``astropy.wcs.WCSSUB_CELESTIAL``. [#1960] + +- Fixed the ``AttributeError`` exception that was raised when using + ``astropy.wcs.WCS.footprint_to_file``. [#1912] + +- Fixed a ``NameError`` exception that was raised when using + ``astropy.wcs.validate`` or the ``wcslint`` script. [#2053] + +- Fixed a bug where named WCSes may be erroneously reported as ``' '`` when + using ``astropy.wcs.validate`` or the ``wcslint`` script. [#2053] + +- Fixed a bug where error messages about incorrect header keywords + may not be propagated correctly, resulting in a "NULL error object + in wcslib" message. [#2106] + +Misc +^^^^ + +- There are a number of improvements to make Astropy work better on big + endian platforms, such as MIPS, PPC, s390x and SPARC. [#1849] + +- The test suite will now raise exceptions when a deprecated feature of + Python or Numpy is used. [#1948] + +Other Changes and Additions +--------------------------- + +- A new function, ``astropy.wcs.get_include``, has been added to get the + location of the ``astropy.wcs`` C header files. [#1755] + +- The doctests in the ``.rst`` files in the ``docs`` folder are now + tested along with the other unit tests. This is in addition to the + testing of doctests in docstrings that was already being performed. + See ``docs/development/testguide.rst`` for more information. [#1771] + +- Fix a problem where import fails on Python 3 if setup.py exists + in current directory. [#1877] + + +0.3 (2013-11-20) +================ + +New Features +------------ + +- General + +- A top-level configuration item, ``unicode_output`` has been added to + control whether the Unicode string representation of certain + objects will contain Unicode characters. For example, when + ``use_unicode`` is `False` (default):: + + >>> from astropy import units as u + >>> print(unicode(u.degree)) + deg + + When ``use_unicode`` is `True`:: + + >>> from astropy import units as u + >>> print(unicode(u.degree)) + ° + + See `handling-unicode + `_ + for more information. [#1441] + +- ``astropy.utils.misc.find_api_page`` is now imported into the top-level. + This allows usage like ``astropy.find_api_page(astropy.units.Quantity)``. + [#1779] + +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- New class-based system for generating kernels, replacing ``make_kernel``. + [#1255] The ``astropy.nddata.convolution`` sub-package has now been moved + to ``astropy.convolution``. [#1451] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Two classes ``astropy.coordinates.Longitude`` and + ``astropy.coordinates.Latitude`` have been added. These are derived from + the new ``Angle`` class and used for all longitude-like (RA, azimuth, + galactic L) and latitude-like coordinates (Dec, elevation, galactic B) + respectively. The ``Longitude`` class provides auto-wrapping capability + and ``Latitude`` performs bounds checking. + +- ``astropy.coordinates.Distance`` supports conversion to and from distance + modulii. [#1472] + +- ``astropy.coordinates.SphericalCoordinateBase`` and derived classes now + support arrays of coordinates, enabling large speed-ups for some operations + on multiple coordinates at the same time. These coordinates can also be + indexed using standard slicing or any Numpy-compatible indexing. [#1535, + #1615] + +- Array coordinates can be matched to other array coordinates, finding the + closest matches between the two sets of coordinates (see the + ``astropy.coordinates.matching.match_coordinates_3d`` and + ``astropy.coordinates.matching.match_coordinates_sky`` functions). [#1535] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Added support for including massive Neutrinos in the cosmology classes. The + Planck (2013) cosmology has been updated to use this. [#1364] + +- Calculations now use and return ``Quantity`` objects where appropriate. + [#1237] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Added support for writing IPAC format tables [#1152]. + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Added initial support for table columns containing pseudo-unsigned + integers. This is currently enabled by using the ``uint=True`` option when + opening files; any table columns with the correct BZERO value will be + interpreted and returned as arrays of unsigned integers. [#906] + +- Upgraded vendored copy of CFITSIO to v3.35, though backwards compatibility + back to version v3.28 is maintained. + +- Added support for reading and writing tables using the Q format for columns. + The Q format is identical to the P format (variable-length arrays) except + that it uses 64-bit integers for the data descriptors, allowing more than + 4 GB of variable-length array data in a single table. + +- Some refactoring of the table and ``FITS_rec`` modules in order to better + separate the details of the FITS binary and ASCII table data structures from + the HDU data structures that encapsulate them. Most of these changes should + not be apparent to users (but see API Changes below). + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Updated to support the VOTable 1.3 draft. [#433] + +- Added the ability to look up and group elements by their utype attribute. + [#622] + +- The format of the units of a VOTable file can be specified using the + ``unit_format`` parameter. Note that units are still always written out + using the CDS format, to ensure compatibility with the standard. + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added a new framework for representing and evaluating mathematical models + and for fitting data to models. See "What's New in Astropy 0.3" in the + documentation for further details. [#493] + +astropy.stats +^^^^^^^^^^^^^ + +- Added robust statistics functions + ``astropy.stats.funcs.median_absolute_deviation``, + ``astropy.stats.funcs.biweight_location``, and + ``astropy.stats.funcs.biweight_midvariance``. [#621] + +- Added ``astropy.stats.funcs.signal_to_noise_oir_ccd`` for computing the + signal to noise ratio for source being observed in the optical/IR using a + CCD. [#870] + +- Add ``axis=int`` option to ``stropy.stats.funcs.sigma_clip`` to allow + clipping along a given axis for multidimensional data. [#1083] + +astropy.table +^^^^^^^^^^^^^ + +- New columns can be added to a table via assignment to a non-existing + column by name. [#726] + +- Added ``join`` function to perform a database-like join on two tables. This + includes support for inner, left, right, and outer joins as well as + metadata merging. [#903] + +- Added ``hstack`` and ``vstack`` functions to stack two or more tables. + [#937] + +- Tables now have a ``.copy`` method and include support for ``copy`` and + ``deepcopy``. [#1208] + +- Added support for selecting and manipulating groups within a table with + a database style ``group_by`` method. [#1424] + +- Table ``read`` and ``write`` functions now include rudimentary support + reading and writing of FITS tables via the unified reading/writing + interface. [#591] + +- The ``units`` and ``dtypes`` attributes and keyword arguments in Column, + MaskedColumn, Row, and Table are now deprecated in favor of the + single-tense ``unit`` and ``dtype``. [#1174] + +- Setting a column from a Quantity now correctly sets the unit on the Column + object. [#732] + +- Add ``remove_row`` and ``remove_rows`` to remove table rows. [#1230] + +- Added a new ``Table.show_in_browser`` method that opens a web browser + and displays the table rendered as HTML. [#1342] + +- New tables can now be instantiated using a single row from an existing + table. [#1417] + +astropy.time +^^^^^^^^^^^^ + +- New ``Time`` objects can be instantiated from existing ``Time`` objects + (but with different format, scale, etc.) [#889] + +- Added a ``Time.now`` classmethod that returns the current UTC time, + similarly to Python's ``datetime.now``. [#1061] + +- Update internal time manipulations so that arithmetic with Time and + TimeDelta objects maintains sub-nanosecond precision over a time span + longer than the age of the universe. [#1189] + +- Use ``astropy.utils.iers`` to provide ``delta_ut1_utc``, so that + automatic calculation of UT1 becomes possible. [#1145] + +- Add ``datetime`` format which allows converting to and from standard + library ``datetime.datetime`` objects. [#860] + +- Add ``plot_date`` format which allows converting to and from the date + representation used when plotting dates with matplotlib via the + ``matplotlib.pyplot.plot_date`` function. [#860] + +- Add ``gps`` format (seconds since 1980-01-01 00:00:00 UTC, + including leap seconds) [#1164] + +- Add array indexing to Time objects [#1132] + +- Allow for arithmetic of multi-element and single-element Time and TimeDelta + objects. [#1081] + +- Allow multiplication and division of TimeDelta objects by + constants and arrays, as well as changing sign (negation) and + taking the absolute value of TimeDelta objects. [#1082] + +- Allow comparisons of Time and TimeDelta objects. [#1171] + +- Support interaction of Time and Quantity objects that represent a time + interval. [#1431] + +astropy.units +^^^^^^^^^^^^^ + +- Added parallax equivalency for length-angle. [#985] + +- Added mass-energy equivalency. [#1333] + +- Added a new-style format method which will use format specifiers + (like ``0.03f``) in new-style format strings for the Quantity's value. + Specifiers which can't be applied to the value will fall back to the + entire string representation of the quantity. [#1383] + +- Added support for complex number values in quantities. [#1384] + +- Added new spectroscopic equivalencies for velocity conversions + (relativistic, optical, and radio conventions are supported) [#1200] + +- The ``spectral`` equivalency now also handles wave number. + +- The ``spectral_density`` equivalency now also accepts a Quantity for the + frequency or wavelength. It also handles additional flux units. + +- Added Brightness Temperature (antenna gain) equivalency for conversion + between :math:`T_B` and flux density. [#1327] + +- Added percent unit, and allowed any string containing just a number to be + interpreted as a scaled dimensionless unit. [#1409] + +- New-style format strings can be used to set the unit output format. For + example, ``"{0:latex}".format(u.km)`` will print with the latex formatter. + [#1462] + +- The ``Unit.is_equivalent`` method can now take a tuple. In this case, the + method returns ``True`` if the unit is equivalent to any of the units + listed in the tuple. [#1521] + +- ``def_unit`` can now take a 2-tuple of names of the form (short, long), + where each entry is a list. This allows for handling strange units that + might have multiple short names. [#1543] + +- Added ``dimensionless_angles`` equivalency, which allows conversion of any + power of radian to dimensionless. [#1161] + +- Added the ability to enable set of units, or equivalencies that are used by + default. Also provided context managers for these cases. [#1268] + +- Imperial units are disabled by default. [#1593, #1662] + +- Added an ``astropy.units.add_enabled_units`` context manager, which allows + creating a temporary context with additional units temporarily enabled in + the global units namespace. [#1662] + +- ``Unit`` instances now have ``.si`` and ``.cgs`` properties a la + ``Quantity``. These serve as shortcuts for ``Unit.to_system(cgs)[0]`` + etc. [#1610] + +astropy.vo +^^^^^^^^^^ + +- New package added to support Virtual Observatory Simple Cone Search query + and service validation. [#552] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed attribute error in ``astropy.wcs.Wcsprm`` (lattype->lattyp) [#1463] + +- Included a new command-line script called ``wcslint`` and accompanying API + for validating the WCS in a given FITS file or header. [#580] + +- Upgraded included version of WCSLIB to 4.19. + +astropy.utils +^^^^^^^^^^^^^ + +- Added a new set of utilities in ``astropy.utils.timer`` for analyzing the + runtime of functions and making runtime predections for larger inputs. + [#743] + +- ``ProgressBar`` and ``Spinner`` classes can now be used directly to return + generator expressions. [#771] + +- Added ``astropy.utils.iers`` which allows reading in of IERS A or IERS B + bulletins and interpolation in UT1-UTC. + +- Added a function ``astropy.utils.find_api_page``--given a class or object + from the ``astropy`` package, this will open that class's API documentation + in a web browser. [#663] + +- Data download functions such as ``download_file`` now accept a + ``show_progress`` argument to suppress console output, and a ``timeout`` + argument. [#865, #1258] + +astropy.extern.six +^^^^^^^^^^^^^^^^^^ + +- Added `six `_ for python2/python3 + compatibility + +- Astropy now uses the ERFA library instead of the IAU SOFA library for + fundamental time transformation routines. The ERFA library is derived, with + permission, from the IAU SOFA library but is distributed under a BSD license. + See ``license/ERFA.rst`` for details. [#1293] + +astropy.logger +^^^^^^^^^^^^^^ + +- The Astropy logger now no longer catches exceptions by default, and also + only captures warnings emitted by Astropy itself (prior to this change, + following an import of Astropy, any warning got re-directed through the + Astropy logger). Logging to the Astropy log file has also been disabled by + default. However, users of Astropy 0.2 will likely still see the previous + behavior with Astropy 0.3 for exceptions and logging to file since the + default configuration file installed by 0.2 set the exception logging to be + on by default. To get the new behavior, set the ``log_exceptions`` and + ``log_to_file`` configuration items to ``False`` in the ``astropy.cfg`` + file. [#1331] + +API Changes +----------- + +- General + +- The configuration option ``utils.console.use_unicode`` has been + moved to the top level and renamed to ``unicode_output``. It now + not only affects console widgets, such as progress bars, but also + controls whether calling `unicode` on certain classes will return a + string containing unicode characters. + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``astropy.coordinates.Angle`` class is now a subclass of + ``astropy.units.Quantity``. This means it has all of the methods of a + `numpy.ndarray`. [#1006] + +- The ``astropy.coordinates.Distance`` class is now a subclass of + ``astropy.units.Quantity``. This means it has all of the methods of a + `numpy.ndarray`. [#1472] + +- All angular units are now supported, not just ``radian``, ``degree`` and + ``hour``, but now ``arcsecond`` and ``arcminute`` as well. The object + will retain its native unit, so when printing out a value initially + provided in hours, its ``to_string()`` will, by default, also be + expressed in hours. + +- The ``Angle`` class now supports arrays of angles. + +- To be consistent with ``units.Unit``, ``Angle.format`` has been + deprecated and renamed to ``Angle.to_string``. + +- To be consistent with ``astropy.units``, all plural forms of unit names + have been removed. Therefore, the following properties of + ``astropy.coordinates.Angle`` should be renamed: + +- ``radians`` -> ``radian`` + +- ``degrees`` -> ``degree`` + +- ``hours`` -> ``hour`` + +- Multiplication and division of two ``Angle`` objects used to raise + ``NotImplementedError``. Now they raise ``TypeError``. + +- The ``astropy.coordinates.Angle`` class no longer has a ``bounds`` + attribute so there is no bounds-checking or auto-wrapping at this level. + This allows ``Angle`` objects to be used in arbitrary arithmetic + expressions (e.g. coordinate distance computation). + +- The ``astropy.coordinates.RA`` and ``astropy.coordinates.Dec`` classes have + been removed and replaced with ``astropy.coordinates.Longitude`` and + ``astropy.coordinates.Latitude`` respectively. These are now used for the + components of Galactic and Horizontal (Alt-Az) coordinates as well instead + of plain ``Angle`` objects. + +- ``astropy.coordinates.angles.rotation_matrix`` and + ``astropy.coordinates.angles.angle_axis`` now take a ``unit`` kwarg instead + of ``degrees`` kwarg to specify the units of the angles. + ``rotation_matrix`` will also take the unit from the given ``Angle`` object + if no unit is provided. + +- The ``AngularSeparation`` class has been removed. The output of the + coordinates ``separation()`` method is now an + ``astropy.coordinates.Angle``. [#1007] + +- The coordinate classes have been renamed in a way that remove the + ``Coordinates`` at the end of the class names. E.g., ``ICRSCoordinates`` + from previous versions is now called ``ICRS``. [#1614] + +- ``HorizontalCoordinates`` are now named ``AltAz``, to reflect more common + terminology. + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The Planck (2013) cosmology will likely give slightly different (and more + accurate) results due to the inclusion of Neutrino masses. [#1364] + +- Cosmology class properties now return ``Quantity`` objects instead of + simple floating-point values. [#1237] + +- The names of cosmology instances are now truly optional, and are set to + ``None`` rather than the name of the class if the user does not provide + them. [#1705] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- In the ``read`` method of ``astropy.io.ascii``, empty column values in an + ASCII table are now treated as missing values instead of the previous + treatment as a zero-length string "". This now corresponds to the behavior + of other table readers like ``numpy.genfromtxt``. To restore the previous + behavior set ``fill_values=None`` in the call to ``ascii.read()``. [#919] + +- The ``read`` and ``write`` methods of ``astropy.io.ascii`` now have a + ``format`` argument for specifying the file format. This is the preferred + way to choose the format instead of the ``Reader`` and ``Writer`` + arguments. [#961] + +- The ``include_names`` and ``exclude_names`` arguments were removed from + the ``BaseHeader`` initializer, and now instead handled by the reader and + writer classes directly. [#1350] + +- Allow numeric and otherwise unusual column names when reading a table + where the ``format`` argument is specified, but other format details such + as the delimiter or quote character are being guessed. [#1692] + +- When reading an ASCII table using the ``Table.read()`` method, the default + has changed from ``guess=False`` to ``guess=True`` to allow auto-detection + of file format. This matches the default behavior of ``ascii.read()``. + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The ``astropy.io.fits.new_table`` function is marked "pending deprecation". + This does not mean it will be removed outright or that its functionality + has changed. It will likely be replaced in the future for a function with + similar, if not subtly different functionality. A better, if not slightly + more verbose approach is to use ``pyfits.FITS_rec.from_columns`` to create + a new ``FITS_rec`` table--this has the same interface as + ``pyfits.new_table``. The difference is that it returns a plan + ``FITS_rec`` array, and not an HDU instance. This ``FITS_rec`` object can + then be used as the data argument in the constructors for ``BinTableHDU`` + (for binary tables) or ``TableHDU`` (for ASCII tables). This is analogous + to creating an ``ImageHDU`` by passing in an image array. + ``pyfits.FITS_rec.from_columns`` is just a simpler way of creating a + FITS-compatible recarray from a FITS column specification. + +- The ``updateHeader``, ``updateHeaderData``, and ``updateCompressedData`` + methods of the ``CompDataHDU`` class are pending deprecation and moved to + internal methods. The operation of these methods depended too much on + internal state to be used safely by users; instead they are invoked + automatically in the appropriate places when reading/writing compressed + image HDUs. + +- The ``CompDataHDU.compData`` attribute is pending deprecation in favor of + the clearer and more PEP-8 compatible ``CompDataHDU.compressed_data``. + +- The constructor for ``CompDataHDU`` has been changed to accept new keyword + arguments. The new keyword arguments are essentially the same, but are in + underscore_separated format rather than camelCase format. The old + arguments are still pending deprecation. + +- The internal attributes of HDU classes ``_hdrLoc``, ``_datLoc``, and + ``_datSpan`` have been replaced with ``_header_offset``, ``_data_offset``, + and ``_data_size`` respectively. The old attribute names are still pending + deprecation. This should only be of interest to advanced users who have + created their own HDU subclasses. + +- The following previously deprecated functions and methods have been removed + entirely: ``createCard``, ``createCardFromString``, ``upperKey``, + ``ColDefs.data``, ``setExtensionNameCaseSensitive``, ``_File.getfile``, + ``_TableBaseHDU.get_coldefs``, ``Header.has_key``, ``Header.ascardlist``. + +- Interfaces that were pending deprecation are now fully deprecated. These + include: ``create_card``, ``create_card_from_string``, ``upper_key``, + ``Header.get_history``, and ``Header.get_comment``. + +- The ``.name`` attribute on HDUs is now directly tied to the HDU's header, so + that if ``.header['EXTNAME']`` changes so does ``.name`` and vice-versa. + +astropy.io.registry +^^^^^^^^^^^^^^^^^^^ + +- Identifier functions for reading/writing Table and NDData objects should + now accept ``(origin, *args, **kwargs)`` instead of ``(origin, args, + kwargs)``. [#591] + +- Added a new ``astropy.io.registry.get_formats`` function for listing + registered I/O formats and details about the their readers/writers. [#1669] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Added a new option ``use_names_over_ids`` option to use when converting + from VOTable objects to Astropy Tables. This can prevent a situation where + column names are not preserved when converting from a VOTable. [#609] + +astropy.nddata +^^^^^^^^^^^^^^ + +- The ``astropy.nddata.convolution`` sub-package has now been moved to + ``astropy.convolution``, and the ``make_kernel`` function has been removed. + (the kernel classes should be used instead) [#1451] + +astropy.stats.funcs +^^^^^^^^^^^^^^^^^^^ + +- For ``sigma_clip``, the ``maout`` optional parameter has been removed, and + the function now always returns a masked array. A new boolean parameter + ``copy`` can be used to indicated whether the input data should be copied + (``copy=True``, default) or used by reference (``copy=False``) in the + output masked array. [#1083] + +astropy.table +^^^^^^^^^^^^^ + +- The first argument to the ``Column`` and ``MaskedColumn`` classes is now + the data array--the ``name`` argument has been changed to an optional + keyword argument. [#840] + +- Added support for instantiating a ``Table`` from a list of dict, each one + representing a single row with the keys mapping to column names. [#901] + +- The plural 'units' and 'dtypes' have been switched to 'unit' and 'dtype' + where appropriate. The original attributes are still present in this + version as deprecated attributes, but will be removed in the next version. + [#1174] + +- The ``copy`` methods of ``Column`` and ``MaskedColumn`` were changed so + that the first argument is now ``order='C'``. This is required for + compatibility with Numpy 1.8 which is currently in development. [#1250] + +- Comparing a column (with == or !=) to a scalar, an array, or another column + now always returns a boolean Numpy array (which is a masked array if either + of the arguments in the comparison was masked). This is in contrast to the + previous behavior, which in some cases returned a boolean Numpy array, and + in some cases returned a boolean Column object. [#1446] + +astropy.time +^^^^^^^^^^^^ + +- For consistency with ``Quantity``, the attributes ``val`` and + ``is_scalar`` have been renamed to ``value`` and ``isscalar``, + respectively, and the attribute ``vals`` has been dropped. [#767] + +- The double-float64 internal representation of time is used more + efficiently to enable better accuracy. [#366] + +- Format and scale arguments are now allowed to be case-insensitive. [#1128] + +astropy.units +^^^^^^^^^^^^^ + +- The ``Quantity`` class now inherits from the Numpy array class, and + includes the following API changes [#929]: + +- Using ``float(...)``, ``int(...)``, and ``long(...)`` on a quantity will + now only work if the quantity is dimensionless and unscaled. + +- All Numpy ufuncs should now treat units correctly (or raise an exception + if not supported), rather than extract the value of quantities and + operate on this, emitting a warning about the implicit loss of units. + +- When using relevant Numpy ufuncs on dimensionless quantities (e.g. + ``np.exp(h * nu / (k_B * T))``), or combining dimensionless quantities + with Python scalars or plain Numpy arrays ``1 + v / c``, the + dimensionless Quantity will automatically be converted to an unscaled + dimensionless Quantity. + +- When initializing a quantity from a value with no unit, it is now set to + be dimensionless and unscaled by default. When initializing a Quantity + from another Quantity and with no unit specified in the initializer, the + unit is now taken from the unit of the Quantity being initialized from. + +- Strings are no longer allowed as the values for Quantities. [#1005] + +- Quantities are always comparable with zero regardless of their units. + [#1254] + +- The exception ``astropy.units.UnitsException`` has been renamed to + ``astropy.units.UnitsError`` to be more consistent with the naming + of built-in Python exceptions. [#1406] + +- Multiplication with and division by a string now always returns a Unit + (rather than a Quantity when the string was first) [#1408] + +- Imperial units are disabled by default. + +astropy.wcs +^^^^^^^^^^^ + +- For those including the ``astropy.wcs`` C headers in their project, they + should now include it as: + + #include "astropy_wcs/astropy_wcs_api.h" + + instead of: + + #include "astropy_wcs_api.h" + + [#1631] + +- The ``--enable-legacy`` option for ``setup.py`` has been removed. [#1493] + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- The ``write()`` function was ignoring the ``fill_values`` argument. [#910] + +- Fixed an issue in ``DefaultSplitter.join`` where the delimiter attribute + was ignored when writing the CSV. [#1020] + +- Fixed writing of IPAC tables containing null values. [#1366] + +- When a table with no header row was read without specifying the format and + using the ``names`` argument, then the first row could be dropped. [#1692] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Binary tables containing compressed images may, optionally, contain other + columns unrelated to the tile compression convention. Although this is an + uncommon use case, it is permitted by the standard. + +- Reworked some of the file I/O routines to allow simpler, more consistent + mapping between OS-level file modes ('rb', 'wb', 'ab', etc.) and the more + "PyFITS-specific" modes used by PyFITS like "readonly" and "update". That + is, if reading a FITS file from an open file object, it doesn't matter as + much what "mode" it was opened in so long as it has the right capabilities + (read/write/etc.) Also works around bugs in the Python io module in 2.6+ + with regard to file modes. + +- Fixed a long-standing issue where writing binary tables did not correctly + write the TFORMn keywords for variable-length array columns (they omitted + the max array length parameter of the format). This was thought fixed in + an earlier version, but it was only fixed for compressed image HDUs and + not for binary tables in general. + +astropy.nddata +^^^^^^^^^^^^^^ + +- Fixed crash when trying to multiple or divide ``NDData`` objects with + uncertainties. [#1547] + +astropy.table +^^^^^^^^^^^^^ + +- Using a list of strings to index a table now correctly returns a new table + with the columns named in the list. [#1454] + +- Inequality operators now work properly with ``Column`` objects. [#1685] + +astropy.time +^^^^^^^^^^^^ + +- ``Time`` scale and format attributes are now shown when calling ``dir()`` + on a ``Time`` object. [#1130] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed assignment to string-like WCS attributes on Python 3. [#956] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed a bug that caused the order of multiplication/division of plain + Numpy arrays with Quantities to matter (i.e. if the plain array comes + first the units were not preserved in the output). [#899] + +- Directly instantiated ``CompositeUnits`` were made printable without + crashing. [#1576] + +Misc +^^^^ + +- Fixed various modules that hard-coded ``sys.stdout`` as default arguments + to functions at import time, rather than using the runtime value of + ``sys.stdout``. [#1648] + +- Minor documentation fixes and enhancements [#922, #1034, #1210, #1217, + #1491, #1492, #1498, #1582, #1608, #1621, #1646, #1670, #1756] + +- Fixed a crash that could sometimes occur when running the test suite on + systems with platform names containing non-ASCII characters. [#1698] + +Other Changes and Additions +--------------------------- + +- General + +- Astropy now follows the PSF Code of Conduct. [#1216] + +- Astropy's test suite now tests all doctests in inline docstrings. Support + for running doctests in the reST documentation is planned to follow in + v0.3.1. + +- Astropy's test suite can be run on multiple CPUs in parallel, often + greatly improving runtime, using the ``--parallel`` option. [#1040] + +- A warning is now issued when using Astropy with Numpy < 1.5--much of + Astropy may still work in this case but it shouldn't be expected to + either. [#1479] + +- Added automatic download/build/installation of Numpy during Astropy + installation if not already found. [#1483] + +- Handling of metadata for the ``NDData`` and ``Table`` classes has been + unified by way of a common ``MetaData`` descriptor--it allows instantiating + an object with metadata of any mapping type, and subsequently prevents + replacing the mapping stored in the ``.meta`` attribute (only direct + updates to that object are allowed). [#1686] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Angles containing out of bounds minutes or seconds (e.g. 60) can be + parsed--the value modulo 60 is used with carry to the hours/minutes, and a + warning is issued rather than raising an exception. [#990] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- The new compression code also adds support for the ZQUANTIZ and ZDITHER0 + keywords added in more recent versions of this FITS Tile Compression spec. + This includes support for lossless compression with GZIP. (#198) By default + no dithering is used, but the ``SUBTRACTIVE_DITHER_1`` and + ``SUBTRACTIVE_DITHER_2`` methods can be enabled by passing the correct + constants to the ``quantize_method`` argument to the ``CompImageHDU`` + constructor. A seed can be manually specified, or automatically generated + using either the system clock or checksum-based methods via the + ``dither_seed`` argument. See the documentation for ``CompImageHDU`` for + more details. + +- Images compressed with the Tile Compression standard can now be larger than + 4 GB through support of the Q format. + +- All HDUs now have a ``.ver`` ``.level`` attribute that returns the value of + the EXTVAL and EXTLEVEL keywords from that HDU's header, if the exist. + This was added for consistency with the ``.name`` attribute which returns + the EXTNAME value from the header. + +- Then ``Column`` and ``ColDefs`` classes have new ``.dtype`` attributes + which give the Numpy dtype for the column data in the first case, and the + full Numpy compound dtype for each table row in the latter case. + +- There was an issue where new tables created defaulted the values in all + string columns to '0.0'. Now string columns are filled with empty strings + by default--this seems a less surprising default, but it may cause + differences with tables created with older versions of PyFITS or Astropy. + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- The HDF5 reader can now refer to groups in the path as well as datasets; + if given a group, the first dataset in that group is read. [#1159] + +astropy.nddata +^^^^^^^^^^^^^^ + +- ``NDData`` objects have more helpful, though still rudimentary ``__str__` + and ``__repr__`` displays. [#1313] + +astropy.units +^^^^^^^^^^^^^ + +- Added 'cycle' unit. [#1160] + +- Extended units supported by the CDS formatter/parser. [#1468] + +- Added unicode an LaTeX symbols for liter. [#1618] + +astropy.wcs +^^^^^^^^^^^ + +- Redundant SCAMP distortion parameters are removed with SIP distortions are + also present. [#1278] + +- Added iterative implementation of ``all_world2pix`` that can be reliably + inverted. [#1281] + + +0.2.5 (2013-10-25) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed incorrect string formatting of Angles using ``precision=0``. [#1319] + +- Fixed string formatting of Angles using ``decimal=True`` which ignored the + ``precision`` argument. [#1323] + +- Fixed parsing of format strings using appropriate unicode characters + instead of the ASCII ``-`` for minus signs. [#1429] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed a crash in the IPAC table reader when the ``include/exclude_names`` + option is set. [#1348] + +- Fixed writing AASTex tables to honor the ``tabletype`` option. [#1372] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Improved round-tripping and preservation of manually assigned column + attributes (``TNULLn``, ``TSCALn``, etc.) in table HDU headers. (Note: This + issue was previously reported as fixed in Astropy v0.2.2 by mistake; it is + not fixed until v0.3.) [#996] + +- Fixed a bug that could cause a segfault when trying to decompress an + compressed HDU whose contents are truncated (due to a corrupt file, for + example). This still causes a Python traceback but better that than a + segfault. [#1332] + +- Newly created ``CompImageHDU`` HDUs use the correct value of the + ``DEFAULT_COMPRESSION_TYPE`` module-level constant instead of hard-coding + "RICE_1" in the header. + +- Fixed a corner case where when extra memory is allocated to compress an + image, it could lead to unnecessary in-memory copying of the compressed + image data and a possible memory leak through Numpy. + +- Fixed a bug where assigning from an mmap'd array in one FITS file over + the old (also mmap'd) array in another FITS file failed to update the + destination file. Corresponds to PyFITS issue 25. + +- Some miscellaneous documentation fixes. + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Added a warning for when a VOTable 1.2 file contains no ``RESOURCES`` + elements (at least one should be present). [#1337] + +- Fixed a test failure specific to MIPS architecture caused by an errant + floating point warning. [#1179] + +astropy.nddata.convolution +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Prevented in-place modification of the input arrays to ``convolve()``. + [#1153] + +astropy.table +^^^^^^^^^^^^^ + +- Added HTML escaping for string values in tables when outputting the table + as HTML. [#1347] + +- Added a workaround in a bug in Numpy that could cause a crash when + accessing a table row in a masked table containing ``dtype=object`` + columns. [#1229] + +- Fixed an issue similar to the one in #1229, but specific to unmasked + tables. [#1403] + +astropy.units +^^^^^^^^^^^^^ + +- Improved error handling for unparseable units and fixed parsing CDS units + without mantissas in the exponent. [#1288] + +- Added a physical type for spectral flux density. [#1410] + +- Normalized conversions that should result in a scale of exactly 1.0 to + round off slight floating point imprecisions. [#1407] + +- Added support in the CDS unit parser/formatter for unusual unit prefixes + that are nonetheless required to be supported by that convention. [#1426] + +- Fixed the parsing of ``sqrt()`` in unit format strings which was returning + ``unit ** 2`` instead of ``unit ** 0.5``. [#1458] + +astropy.wcs +^^^^^^^^^^^ + +- When passing a single array to the wcs transformation functions, + (``astropy.wcs.Wcs.all_pix2world``, etc.), its second dimension must now + exactly match the number of dimensions in the transformation. [#1395] + +- Improved error message when incorrect arguments are passed to + ``WCS.wcs_world2pix``. [#1394] + +- Fixed a crash when trying to read WCS from FITS headers on Python 3.3 + in Windows. [#1363] + +- Only headers that are required as part of the WCSLIB C API are installed + by the package, per request of system packagers. [#1666] + +Misc +^^^^ + +- Fixed crash when the ``COLUMNS`` environment variable is set to a + non-integer value. [#1291] + +- Fixed a bug in ``ProgressBar.map`` where ``multiprocess=True`` could cause + it to hang on waiting for the process pool to be destroyed. [#1381] + +- Fixed a crash on Python 3.2 when affiliated packages try to use the + ``astropy.utils.data.get_pkg_data_*`` functions. [#1256] + +- Fixed a minor path normalization issue that could occur on Windows in + ``astropy.utils.data.get_pkg_data_filename``. [#1444] + +- Fixed an annoyance where configuration items intended only for testing + showed up in users' astropy.cfg files. [#1477] + +- Prevented crashes in exception logging in unusual cases where no traceback + is associated with the exception. [#1518] + +- Fixed a crash when running the tests in unusual environments where + ``sys.stdout.encoding`` is ``None``. [#1530] + +- Miscellaneous documentation fixes and improvements [#1308, #1317, #1377, + #1393, #1362, #1516] + +Other Changes and Additions +--------------------------- + +- Astropy installation now requests setuptools >= 0.7 during build/installation + if neither distribute or setuptools >= 0.7 is already installed. In other + words, if ``import setuptools`` fails, ``ez_setup.py`` is used to bootstrap + the latest setuptools (rather than using ``distribute_setup.py`` to bootstrap + the now obsolete distribute package). [#1197] + +- When importing Astropy from a source checkout without having built the + extension modules first an ``ImportError`` is raised rather than a + ``SystemExit`` exception. [#1269] + + +0.2.4 (2013-07-24) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed the angle parser to support parsing the string "1 degree". [#1168] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Fixed a crash in the ``comoving_volume`` method on non-flat cosmologies + when passing it an array of redshifts. + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed a bug that prevented saving changes to the comment symbol when + writing changes to a table. [#1167] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Added a workaround for a bug in 64-bit OSX that could cause truncation when + writing files greater than 2^32 bytes in size. [#839] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed incorrect reading of tables containing multiple ```` + elements. [#1223] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a bug where ``Table.remove_column`` and ``Table.rename_column`` + could cause a masked table to lose its masking. [#1120] + +- Fixed bugs where subclasses of ``Table`` did not preserver their class in + certain operations. [#1142] + +- Fixed a bug where slicing a masked table did not preserve the mask. [#1187] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed a bug where the ``.si`` and ``.cgs`` properties of dimensionless + ``Quantity`` objects raised a ``ZeroDivisionError``. [#1150] + +- Fixed a bug where multiple subsequent calls to the ``.decompose()`` method + on array quantities applied a scale factor each time. [#1163] + +Misc +^^^^ + +- Fixed an installation crash that could occur sometimes on Debian/Ubuntu + and other \*NIX systems where ``pkg_resources`` can be installed without + installing ``setuptools``. [#1150] + +- Updated the ``distribute_setup.py`` bootstrapper to use setuptools >= 0.7 + when installing on systems that don't already have an up to date version + of distribute/setuptools. [#1180] + +- Changed the ``version.py`` template so that Astropy affiliated packages can + (and they should) use their own ``cython_version.py`` and + ``utils._compiler`` modules where appropriate. This issue only pertains to + affiliated package maintainers. [#1198] + +- Fixed a corner case where the default config file generation could crash + if building with matplotlib but *not* Sphinx installed in a virtualenv. + [#1225] + +- Fixed a crash that could occur in the logging module on systems that + don't have a default preferred encoding (in particular this happened + in some versions of PyCharm). [#1244] + +- The Astropy log now supports passing non-string objects (and calling + ``str()`` on them by default) to the logging methods, in line with Python's + standard logging API. [#1267] + +- Minor documentation fixes [#582, #696, #1154, #1194, #1212, #1213, #1246, + #1252] + +Other Changes and Additions +--------------------------- + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Added a new ``Plank13`` object representing the Plank 2013 results. [#895] + +astropy.units +^^^^^^^^^^^^^ + +- Performance improvements in initialization of ``Quantity`` objects with + a large number of elements. [#1231] + + +0.2.3 (2013-05-30) +================== + +Bug Fixes +--------- + +astropy.time +^^^^^^^^^^^^ + +- Fixed inaccurate handling of leap seconds when converting from UTC to UNIX + timestamps. [#1118] + +- Tightened required accuracy in many of the time conversion tests. [#1121] + +Misc +^^^^ + +- Fixed a regression that was introduced in v0.2.2 by the fix to issue #992 + that was preventing installation of Astropy affiliated packages that use + Astropy's setup framework. [#1124] + + +0.2.2 (2013-05-21) +================== + +Bug Fixes +--------- + +astropy.io +^^^^^^^^^^ + +- Fixed issues in both the ``fits`` and ``votable`` sub-packages where array + byte order was not being handled consistently, leading to possible crashes + especially on big-endian systems. [#1003] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- When an error occurs opening a file in fitsdiff the exception message will + now at least mention which file had the error. + +- Fixed a couple cases where creating a new table using TDIMn in some of the + columns could cause a crash. + +- Slightly refactored how tables containing variable-length array columns are + handled to add two improvements: Fixes an issue where accessing the data + after a call to the ``astropy.io.fits.getdata`` convenience function caused + an exception, and allows the VLA data to be read from an existing mmap of + the FITS file. + +- Fixed a bug on Python 3 where attempting to open a non-existent file on + Python 3 caused a seemingly unrelated traceback. + +- Fixed an issue in the tests that caused some tests to fail if Astropy is + installed with read-only permissions. + +- Fixed a bug where instantiating a ``BinTableHDU`` from a numpy array + containing boolean fields converted all the values to ``False``. + +- Fixed an issue where passing an array of integers into the constructor of + ``Column()`` when the column type is floats of the same byte width caused + the column array to become garbled. + +- Fixed inconsistent behavior in creating CONTINUE cards from byte strings + versus unicode strings in Python 2--CONTINUE cards can now be created + properly from unicode strings (so long as they are convertable to ASCII). + +- Fixed a bug in parsing HIERARCH keywords that do not have a space after the + first equals sign (before the value). + +- Prevented extra leading whitespace on HIERARCH keywords from being treated + as part of the keyword. + +- Fixed a bug where HIERARCH keywords containing lower-case letters was + mistakenly marked as invalid during header validation along with an + ancillary issue where the ``Header.index()`` method id not work correctly + with HIERARCH keywords containing lower-case letters. + +- Disallowed assigning NaN and Inf floating point values as header values, + since the FITS standard does not define a way to represent them in. Because + this is undefined, the previous behavior did not make sense and produced + invalid FITS files. [#954] + +- Fixed an obscure issue that can occur on systems that don't have flush to + memory-mapped files implemented (namely GNU Hurd). [#968] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Stopped deprecation warnings from the ``astropy.io.votable`` package that + could occur during setup. [#970] + +- Fixed an issue where INFO elements were being incorrectly dropped when + occurring inside a TABLE element. [#1000] + +- Fixed obscure test failures on MIPS platforms. [#1010] + +astropy.nddata.convolution +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed an issue in ``make_kernel()`` when using an Airy function kernel. + Also removed the superfluous 'brickwall' option. [#939] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a crash that could occur when adding a row to an empty (rowless) + table with masked columns. [#973] + +- Made it possible to assign to one table row from the value of another row, + effectively making it easier to copy rows, for example. [#1019] + +astropy.time +^^^^^^^^^^^^ + +- Added appropriate ``__copy__`` and ``__deepcopy__`` behavior; this + omission caused a seemingly unrelated error in FK5 coordinate separation. + [#891] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed an issue where the ``isiterable()`` utility returned ``True`` for + quantities with scalar values. Added an ``__iter__`` method for the + ``Quantity`` class and fixed ``isiterable()`` to catch false positives. + [#878] + +- Fixed previously undefined behavior when multiplying a unit by a string. + [#949] + +- Added 'time' as a physical type--this was a simple omission. [#959] + +- Fixed issues with pickling unit objects so as to play nicer with the + multiprocessing module. [#974] + +- Made it more difficult to accidentally override existing units with a new + unit of the same name. [#1070] + +- Added several more physical types and units that were previously omitted, + including 'mass density', 'specific volume', 'molar volume', 'momentum', + 'angular momentum', 'angular speed', 'angular acceleration', 'electric + current', 'electric current density', 'electric field strength', 'electric + flux density', 'electric charge density', 'permittivity', 'electromagnetic + field strength', 'radiant intensity', 'data quantity', 'bandwidth'; and + 'knots', 'nautical miles', 'becquerels', and 'curies' respectively. [#1072] + +Misc +^^^^ + +- Fixed a permission error that could occur when running ``astropy.test()`` + on Python 3 when Astropy is installed as root. [#811] + +- Made it easier to filter warnings from the ``convolve()`` function and + from ``Quantity`` objects. [#853] + +- Fixed a crash that could occur in Python 3 when generation of the default + config file fails during setup. [#952] + +- Fixed an unrelated error message that could occur when trying to import + astropy from a source checkout without having build the extension modules + first. This issue was claimed to be fixed in v0.2.1, but the fix itself had + a bug. [#971] + +- Fixed a crash that could occur when running the ``build_sphinx`` setup + command in Python 3. [#977] + +- Added a more helpful error message when trying to run the + ``setup.py build_sphinx`` command when Sphinx is not installed. [#1027] + +- Minor documentation fixes and restructuring. + [#935, #967, #978, #1004, #1028, #1047] + +Other Changes and Additions +--------------------------- + +- Some performance improvements to the ``astropy.units`` package, in particular + improving the time it takes to import the sub-package. [#1015] + + +0.2.1 (2013-04-03) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Fixed encoding errors that could occur when formatting coordinate objects + in code using ``from __future__ import unicode_literals``. [#817] + +- Fixed a bug where the minus sign was dropped when string formatting dms + coordinates with -0 degrees. [#875] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Properly supports the ZQUANTIZ keyword used to support quantization + level--this includes working support for lossless GZIP compression of + images. + +- Fixed support for opening gzipped FITS files in a writeable mode. [#256] + +- Added a more helpful exception message when trying to read invalid values + from a table when the required ``TNULLn`` keyword is missing. [#309] + +- More refactoring of the tile compression handling to work around a + potential memory access violation that was particularly prevalent on + Windows. [#507] + +- Fixed an integer size mismatch in the compression module that could affect + 32-bit systems. [#786] + +- Fixed malformatting of the ``TFORMn`` keywords when writing compressed + image tables (they omitted the max array length parameter from the + variable-length array format). + +- Fixed a crash that could occur when writing a table containing multi- + dimensional array columns from an existing file into a new file. + +- Fixed a bug in fitsdiff that reported two header keywords containing NaN + as having different values. + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- Fixed links to the ``astropy.io.votable`` documentation in the VOTable + validator output. [#806] + +- When reading VOTables containing integers that are out of range for their + column type, display a warning rather than raising an exception. [#825] + +- Changed the default string format for floating point values for better + round-tripping. [#856] + +- Fixed opening VOTables through the ``Table.read()`` interface for tables + that have no names. [#927] + +- Fixed creation of VOTables from an Astropy table that does not have a data + mask. [#928] + +- Minor documentation fixes. [#932] + +astropy.nddata.convolution +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Added better handling of ``inf`` values to the ``convolve_fft`` family of + functions. [#893] + +astropy.table +^^^^^^^^^^^^^ + +- Fixed silent failure to assign values to a row on multiple columns. [#764] + +- Fixed various buggy behavior when viewing a table after sorting by one of + its columns. [#829] + +- Fixed using ``numpy.where()`` with table indexing. [#838] + +- Fixed a bug where opening a remote table with ``Table.read()`` could cause + the entire table to be downloaded twice. [#845] + +- Fixed a bug where ``MaskedColumn`` no longer worked if the column being + masked is renamed. [#916] + +astropy.units +^^^^^^^^^^^^^ + +- Added missing capability for array ``Quantity``\s to be initializable by + a list of ``Quantity``\s. [#835] + +- Fixed the definition of year and lightyear to be in terms of Julian year + per the IAU definition. [#861] + +- "degree" was removed from the list of SI base units. [#863] + +astropy.wcs +^^^^^^^^^^^ + +- Fixed ``TypeError`` when calling ``WCS.to_header_string()``. [#822] + +- Added new method ``WCS.all_world2pix`` for converting from world + coordinates to pixel space, including inversion of the astrometric + distortion correction. [#1066, #1281] + +Misc +^^^^ + +- Fixed a minor issue when installing with ``./setup.py develop`` on a fresh + git clone. This is likely only of interest to developers on Astropy. + [#725] + +- Fixes a crash with ``ImportError: No module named 'astropy.version'`` when + running setup.py from a source checkout for the first time on OSX with + Python 3.3. [#820] + +- Fixed an installation issue where running ``./setup.py install`` or when + installing with pip the ``.astropy`` directory gets created in the home + directory of the user running the command. The user's ``.astropy`` + directory should only be created when they use Astropy, not when they + install it. [#867] + +- Fixed an exception when creating a ``ProgressBar`` with a "total" of 0. + [#752] + +- Added better documentation of behavior that can occur when trying to import + the astropy package from within a source checkout without first building + the extension modules. [#795, #864] + +- Added link to the installation instructions in the README. [#797] + +- Catches segfaults in xmllint which can occur sometimes and is otherwise out + of our control. [#803] + +- Minor changes to the documentation template. [#805] + +- Fixed a minor exception handling bug in ``download_file()``. [#808] + +- Added cleanup of any temporary files if an error occurs in + ``download_file()``. [#857] + +- Filesystem free space is checked for before attempting to download a file + with ``download_file()``. [#858] + +- Fixed package data locating to work across symlinks--required to work with + some OS packaging layouts. [#827] + +- Fixed a bug when building Cython extensions where hidden files containing + ``.pyx`` extensions could cause the build to crash. This can be an issue + with software and filesystems that autogenerate hidden files. [#834] + +- Fixed bug that could cause a "script" called README.rst to be installed + in a bin directory. [#852] + +- Fixed some miscellaneous and mostly rare reference leaks caught by + cpychecker. [#914] + +Other Changes and Additions +--------------------------- + +- Added logo and branding for Windows binary installers. [#741] + +- Upgraded included version libexpat to 2.1.0. [#781] + +- ~25% performance improvement in unit composition/decomposition. [#836] + +- Added previously missing LaTeX formatting for ``L_sun`` and ``R_sun``. [#841] + +- ConfigurationItem\s now have a more useful and informative __repr__ + and improved documentation for how to use them. [#855] + +- Added a friendlier error message when trying to import astropy from a source + checkout without first building the extension modules inplace. [#864] + +- py.test now outputs more system information for help in debugging issues + from users. [#869] + +- Added unit definitions "mas" and "uas" for "milliarcsecond" and + "microarcsecond" respectively. [#892] + + +0.2 (2013-02-19) +================ + +New Features +------------ + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- This new subpackage contains a representation of celestial coordinates, + and provides a wide range of related functionality. While + fully-functional, it is a work in progress and parts of the API may + change in subsequent releases. + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Update to include cosmologies with variable dark energy equations of state. + (This introduces some API incompatibilities with the older Cosmology + objects). + +- Added parameters for relativistic species (photons, neutrinos) to the + astropy.cosmology classes. The current treatment assumes that neutrinos are + massless. [#365] + +- Add a WMAP9 object using the final (9-year) WMAP parameters from + Hinshaw et al. 2013. It has also been made the default cosmology. + [#629, #724] + +- astropy.table I/O infrastructure for custom readers/writers + implemented. [#305] + +- Added support for reading/writing HDF5 files [#461] + +- Added support for masked tables with missing or invalid data [#451] + +- New ``astropy.time`` sub-package. [#332] + +- New ``astropy.units`` sub-package that includes a class for units + (``astropy.units.Unit``) and scalar quantities that have units + (``astropy.units.Quantity``). [#370, #445] + + This has the following effects on other sub-packages: + +- In ``astropy.wcs``, the ``wcs.cunit`` list now takes and returns + ``astropy.units.Unit`` objects. [#379] + +- In ``astropy.nddata``, units are now stored as ``astropy.units.Unit`` + objects. [#382] + +- In ``astropy.table``, units on columns are now stored as + ``astropy.units.Unit`` objects. [#380] + +- In ``astropy.constants``, constants are now stored as + ``astropy.units.Quantity`` objects. [#529] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Improved integration with the ``astropy.table`` Table class so that + table and column metadata (e.g. keywords, units, description, + formatting) are directly available in the output table object. The + CDS, DAOphot, and IPAC format readers now provide this type of + integrated metadata. + +- Changed to using ``astropy.table`` masked tables instead of NumPy + masked arrays for tables with missing values. + +- Added SExtractor table reader to ``astropy.io.ascii`` [#420] + +- Removed the Memory reader class which was used to convert data input + passed to the ``write`` function into an internal table. Instead + ``write`` instantiates an astropy Table object using the data + input to ``write``. + +- Removed the NumpyOutputter as the output of reading a table is now + always a ``Table`` object. + +- Removed the option of supplying a function as a column output + formatter. + +- Added a new ``strip_whitespace`` keyword argument to the ``write`` + function. This controls whether whitespace is stripped from + the left and right sides of table elements before writing. + Default is True. + +- Fixed a bug in reading IPAC tables with null values. + +- Generalized I/O infrastructure so that ``astropy.nddata`` can also have + custom readers/writers [#659] + +astropy.wcs +^^^^^^^^^^^ + +- From updating the underlying wcslib 4.16: + +- When ``astropy.wcs.WCS`` constructs a default coordinate representation + it will give it the special name "DEFAULTS", and will not report "Found + one coordinate representation". + +Other Changes and Additions +--------------------------- + +- A configuration file with all options set to their defaults is now generated + when astropy is installed. This file will be pulled in as the users' + astropy configuration file the first time they ``import astropy``. [#498] + +- Astropy doc themes moved into ``astropy.sphinx`` to allow affiliated packages + to access them. + +- Added expanded documentation for the ``astropy.cosmology`` sub-package. + [#272] + +- Added option to disable building of "legacy" packages (pyfits, vo, etc.). + +- The value of the astronomical unit (au) has been updated to that adopted by + IAU 2012 Resolution B2, and the values of the pc and kpc constants have been + updated to reflect this. [#368] + +- Added links to the documentation pages to directly edit the documentation on + GitHub. [#347] + +- Several updates merged from ``pywcs`` into ``astropy.wcs`` [#384]: + +- Improved the reading of distortion images. + +- Added a new option to choose whether or not to write SIP coefficients. + +- Uses the ``relax`` option by default so that non-standard keywords are + allowed. [#585] + + +- Added HTML representation of tables in IPython notebook [#409] + +- Rewrote CFITSIO-based backend for handling tile compression of FITS files. + It now uses a standard CFITSIO instead of heavily modified pieces of CFITSIO + as before. Astropy ships with its own copy of CFITSIO v3.30, but system + packagers may choose instead to strip this out in favor of a + system-installed version of CFITSIO. This corresponds to PyFITS ticket 169. + [#318] + +- Moved ``astropy.config.data`` to ``astropy.utils.data`` and re-factored the + I/O routines to separate out the generic I/O code that can be used to open + any file or resource from the code used to access Astropy-related data. The + 'core' I/O routine is now ``get_readable_fileobj``, which can be used to + access any local as well as remote data, supports caching, and can decompress + gzip and bzip2 files on-the-fly. [#425] + +- Added a classmethod to + ``astropy.coordinates.coordsystems.SphericalCoordinatesBase`` that performs a + name resolve query using Sesame to retrieve coordinates for the requested + object. This works for any subclass of ``SphericalCoordinatesBase``, but + requires an internet connection. [#556] + +- astropy.nddata.convolution removed requirement of PyFFTW3; uses Numpy's + FFT by default instead with the added ability to specify an FFT + implementation to use. [#660] + + +Bug Fixes +--------- + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Fixed crash when pprinting a row with INDEF values. [#511] + +- Fixed failure when reading DAOphot files with empty keyword values. [#666] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Improved handling of scaled images and pseudo-unsigned integer images in + compressed image HDUs. They now work more transparently like normal image + HDUs with support for the ``do_not_scale_image_data`` and ``uint`` options, + as well as ``scale_back`` and ``save_backup``. The ``.scale()`` method + works better too. Corresponds to PyFITS ticket 88. + +- Permits non-string values for the EXTNAME keyword when reading in a file, + rather than throwing an exception due to the malformatting. Added + verification for the format of the EXTNAME keyword when writing. + Corresponds to PyFITS ticket 96. + +- Added support for EXTNAME and EXTVER in PRIMARY HDUs. That is, if EXTNAME + is specified in the header, it will also be reflected in the ``.name`` + attribute and in ``fits.info()``. These keywords used to be verboten in + PRIMARY HDUs, but the latest version of the FITS standard allows them. + Corresponds to PyFITS ticket 151. + +- HCOMPRESS can again be used to compress data cubes (and higher-dimensional + arrays) so long as the tile size is effectively 2-dimensional. In fact, + compatible tile sizes will automatically be used even if they're not + explicitly specified. Corresponds to PyFITS ticket 171. + +- Fixed a bug that could cause a deadlock in the filesystem on OSX when + reading the data from certain types of FITS files. This only occurred + when used in conjunction with Numpy 1.7. [#369] + +- Added support for the optional ``endcard`` parameter in the + ``Header.fromtextfile()`` and ``Header.totextfile()`` methods. Although + ``endcard=False`` was a reasonable default assumption, there are still text + dumps of FITS headers that include the END card, so this should have been + more flexible. Corresponds to PyFITS ticket 176. + +- Fixed a crash when running fitsdiff on two empty (that is, zero row) tables. + Corresponds to PyFITS ticket 178. + +- Fixed an issue where opening a FITS file containing a random group HDU in + update mode could result in an unnecessary rewriting of the file even if + no changes were made. This corresponds to PyFITS ticket 179. + +- Fixed a crash when generating diff reports from diffs using the + ``ignore_comments`` options. Corresponds to PyFITS ticket 181. + +- Fixed some bugs with WCS distortion paper record-valued keyword cards: + +- Cards that looked kind of like RVKCs but were not intended to be were + over-permissively treated as such--commentary keywords like COMMENT and + HISTORY were particularly affected. Corresponds to PyFITS ticket 183. + +- Looking up a card in a header by its standard FITS keyword only should + always return the raw value of that card. That way cards containing + values that happen to valid RVKCs but were not intended to be will still + be treated like normal cards. Corresponds to PyFITS ticket 184. + +- Looking up a RVKC in a header with only part of the field-specifier (for + example "DP1.AXIS" instead of "DP1.AXIS.1") was implicitly treated as a + wildcard lookup. Corresponds to PyFITS ticket 184. + +- Fixed a crash when diffing two FITS files where at least one contains a + compressed image HDU which was not recognized as an image instead of a + table. Corresponds to PyFITS ticket 187. + +- Fixed a bug where opening a file containing compressed image HDUs in + 'update' mode and then immediately closing it without making any changes + caused the file to be rewritten unnecessarily. + +- Fixed two memory leaks that could occur when writing compressed image data, + or in some cases when opening files containing compressed image HDUs in + 'update' mode. + +- Fixed a bug where ``ImageHDU.scale(option='old')`` wasn't working at + all--it was not restoring the image to its original BSCALE and BZERO + values. + +- Fixed a bug when writing out files containing zero-width table columns, + where the TFIELDS keyword would be updated incorrectly, leaving the table + largely unreadable. + +- Fixed a minor string formatting issue. + +- Fixed bugs in the backwards compatibility layer for the ``CardList.index`` + and ``CardList.count`` methods. Corresponds to PyFITS ticket 190. + +- Improved ``__repr__`` and text file representation of cards with long + values that are split into CONTINUE cards. Corresponds to PyFITS ticket + 193. + +- Fixed a crash when trying to assign a long (> 72 character) value to blank + ('') keywords. This also changed how blank keywords are represented--there + are still exactly 8 spaces before any commentary content can begin; this + *may* affect the exact display of header cards that assumed there could be + fewer spaces in a blank keyword card before the content begins. However, + the current approach is more in line with the requirements of the FITS + standard. Corresponds to PyFITS ticket 194. + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- The ``Table`` class now maintains a single array object which is a + Numpy masked array. For variable-length columns, the object that + is stored there is also a Numpy masked array. + +- Changed the ``pedantic`` configuration option to be ``False`` by default + due to the vast proliferation of non-compliant VO Tables. [#296] + +- Renamed ``astropy.io.vo`` to ``astropy.io.votable``. + +astropy.table +^^^^^^^^^^^^^ + +- Added a workaround for an upstream bug in Numpy 1.6.2 that could cause + a maximum recursion depth RuntimeError when printing table rows. [#341] + +astropy.wcs +^^^^^^^^^^^ + +- Updated to wcslib 4.15 [#418] + +- Fixed a problem with handling FITS headers on locales that do not use + dot as a decimal separator. This required an upstream fix to wcslib which + is included in wcslib 4.14. [#313] + +- Fixed some tests that could fail due to missing/incorrect logging + configuration--ensures that tests don't have any impact on the default log + location or contents. [#291] + +- Various minor documentation fixes [#293 and others] + +- Fixed a bug where running the tests with the ``py.test`` command still tried + to replace the system-installed pytest with the one bundled with Astropy. + [#454] + +- Improved multiprocessing compatibility for file downloads. [#615] + +- Fixed handling of Cython modules when building from a source checkout of a + tagged release version. [#594] + +- Added a workaround for a bug in Sphinx that could occur when using the + ``:tocdepth:`` directive. [#595] + +- Minor VOTable fixes [#596] + +- Fixed how ``setup.py`` uses ``distribute_setup.py`` to prevent possible + ``VersionConflict`` errors when an older version of distribute is already + installed on the user's system. [#616, #640] + +- Changed use of ``log.warn`` in the logging module to ``log.warning`` since + the former is deprecated. [#624] + + +0.1 (2012-06-19) +================ + +- Initial release. diff --git a/testbed/astropy__astropy/CITATION b/testbed/astropy__astropy/CITATION new file mode 100644 index 0000000000000000000000000000000000000000..e9b47516a3459cbf03a0d5a275f68893a20f7c75 --- /dev/null +++ b/testbed/astropy__astropy/CITATION @@ -0,0 +1,112 @@ +If you use Astropy for work/research presented in a publication (whether +directly, or as a dependency to another package), we recommend and encourage +the following acknowledgment: + + This research made use of Astropy, a community-developed core Python package + for Astronomy (Astropy Collaboration, 2018). + +where (Astropy Collaboration, 2018) is a citation to this paper: + + http://adsabs.harvard.edu/abs/2018AJ....156..123T + +An earlier paper is also available describing the status of the package at +the time of v0.2. If you have used Astropy for a long time, you are +encouraged to acknowledge both papers: + + This research made use of Astropy, a community-developed core Python package + for Astronomy (Astropy Collaboration, 2013, 2018). + +where (Astropy Collaboration, 2013) is a citation to this paper: + + http://adsabs.harvard.edu/abs/2013A%26A...558A..33A + +We encourage you to also include citations to the papers in the main text +wherever appropriate. + + +Recommended BibTeX entries for the above citations are: + +@ARTICLE{2018AJ....156..123T, + author = {{The Astropy Collaboration} and {Price-Whelan}, A.~M. and {Sip{\H o}cz}, B.~M. and + {G{\"u}nther}, H.~M. and {Lim}, P.~L. and {Crawford}, S.~M. and + {Conseil}, S. and {Shupe}, D.~L. and {Craig}, M.~W. and {Dencheva}, N. and + {Ginsburg}, A. and {VanderPlas}, J.~T. and {Bradley}, L.~D. and + {P{\'e}rez-Su{\'a}rez}, D. and {de Val-Borro}, M. and {Paper Contributors}, (. and + {Aldcroft}, T.~L. and {Cruz}, K.~L. and {Robitaille}, T.~P. and + {Tollerud}, E.~J. and {Coordination Committee}, (. and {Ardelean}, C. and + {Babej}, T. and {Bach}, Y.~P. and {Bachetti}, M. and {Bakanov}, A.~V. and + {Bamford}, S.~P. and {Barentsen}, G. and {Barmby}, P. and {Baumbach}, A. and + {Berry}, K.~L. and {Biscani}, F. and {Boquien}, M. and {Bostroem}, K.~A. and + {Bouma}, L.~G. and {Brammer}, G.~B. and {Bray}, E.~M. and {Breytenbach}, H. and + {Buddelmeijer}, H. and {Burke}, D.~J. and {Calderone}, G. and + {Cano Rodr{\'{\i}}guez}, J.~L. and {Cara}, M. and {Cardoso}, J.~V.~M. and + {Cheedella}, S. and {Copin}, Y. and {Corrales}, L. and {Crichton}, D. and + {D{\rsquo}Avella}, D. and {Deil}, C. and {Depagne}, {\'E}. and + {Dietrich}, J.~P. and {Donath}, A. and {Droettboom}, M. and + {Earl}, N. and {Erben}, T. and {Fabbro}, S. and {Ferreira}, L.~A. and + {Finethy}, T. and {Fox}, R.~T. and {Garrison}, L.~H. and {Gibbons}, S.~L.~J. and + {Goldstein}, D.~A. and {Gommers}, R. and {Greco}, J.~P. and + {Greenfield}, P. and {Groener}, A.~M. and {Grollier}, F. and + {Hagen}, A. and {Hirst}, P. and {Homeier}, D. and {Horton}, A.~J. and + {Hosseinzadeh}, G. and {Hu}, L. and {Hunkeler}, J.~S. and {Ivezi{\'c}}, {\v Z}. and + {Jain}, A. and {Jenness}, T. and {Kanarek}, G. and {Kendrew}, S. and + {Kern}, N.~S. and {Kerzendorf}, W.~E. and {Khvalko}, A. and + {King}, J. and {Kirkby}, D. and {Kulkarni}, A.~M. and {Kumar}, A. and + {Lee}, A. and {Lenz}, D. and {Littlefair}, S.~P. and {Ma}, Z. and + {Macleod}, D.~M. and {Mastropietro}, M. and {McCully}, C. and + {Montagnac}, S. and {Morris}, B.~M. and {Mueller}, M. and {Mumford}, S.~J. and + {Muna}, D. and {Murphy}, N.~A. and {Nelson}, S. and {Nguyen}, G.~H. and + {Ninan}, J.~P. and {N{\"o}the}, M. and {Ogaz}, S. and {Oh}, S. and + {Parejko}, J.~K. and {Parley}, N. and {Pascual}, S. and {Patil}, R. and + {Patil}, A.~A. and {Plunkett}, A.~L. and {Prochaska}, J.~X. and + {Rastogi}, T. and {Reddy Janga}, V. and {Sabater}, J. and {Sakurikar}, P. and + {Seifert}, M. and {Sherbert}, L.~E. and {Sherwood-Taylor}, H. and + {Shih}, A.~Y. and {Sick}, J. and {Silbiger}, M.~T. and {Singanamalla}, S. and + {Singer}, L.~P. and {Sladen}, P.~H. and {Sooley}, K.~A. and + {Sornarajah}, S. and {Streicher}, O. and {Teuben}, P. and {Thomas}, S.~W. and + {Tremblay}, G.~R. and {Turner}, J.~E.~H. and {Terr{\'o}n}, V. and + {van Kerkwijk}, M.~H. and {de la Vega}, A. and {Watkins}, L.~L. and + {Weaver}, B.~A. and {Whitmore}, J.~B. and {Woillez}, J. and + {Zabalza}, V. and {Contributors}, (.}, + title = "{The Astropy Project: Building an Open-science Project and Status of the v2.0 Core Package}", + journal = {\aj}, +archivePrefix = "arXiv", + eprint = {1801.02634}, + primaryClass = "astro-ph.IM", + keywords = {methods: data analysis, methods: miscellaneous, methods: statistical, reference systems }, + year = 2018, + month = sep, + volume = 156, + eid = {123}, + pages = {123}, + doi = {10.3847/1538-3881/aabc4f}, + adsurl = {http://adsabs.harvard.edu/abs/2018AJ....156..123T}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + +@ARTICLE{2013A&A...558A..33A, + author = {{Astropy Collaboration} and {Robitaille}, T.~P. and {Tollerud}, E.~J. and + {Greenfield}, P. and {Droettboom}, M. and {Bray}, E. and {Aldcroft}, T. and + {Davis}, M. and {Ginsburg}, A. and {Price-Whelan}, A.~M. and + {Kerzendorf}, W.~E. and {Conley}, A. and {Crighton}, N. and + {Barbary}, K. and {Muna}, D. and {Ferguson}, H. and {Grollier}, F. and + {Parikh}, M.~M. and {Nair}, P.~H. and {Unther}, H.~M. and {Deil}, C. and + {Woillez}, J. and {Conseil}, S. and {Kramer}, R. and {Turner}, J.~E.~H. and + {Singer}, L. and {Fox}, R. and {Weaver}, B.~A. and {Zabalza}, V. and + {Edwards}, Z.~I. and {Azalee Bostroem}, K. and {Burke}, D.~J. and + {Casey}, A.~R. and {Crawford}, S.~M. and {Dencheva}, N. and + {Ely}, J. and {Jenness}, T. and {Labrie}, K. and {Lian Lim}, P. and + {Pierfederici}, F. and {Pontzen}, A. and {Ptak}, A. and {Refsdal}, B. and + {Servillat}, M. and {Streicher}, O.}, + title = "{Astropy: A community Python package for astronomy}", + journal = {\aap}, + keywords = {methods: data analysis, methods: miscellaneous, virtual observatory tools}, + year = 2013, + month = oct, + volume = 558, + eid = {A33}, + pages = {A33}, + doi = {10.1051/0004-6361/201322068}, + adsurl = {http://adsabs.harvard.edu/abs/2013A%26A...558A..33A}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} diff --git a/testbed/astropy__astropy/CODE_OF_CONDUCT.md b/testbed/astropy__astropy/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..e44a9261c4ca0b6e022141c4f046d6a65d43c3fe --- /dev/null +++ b/testbed/astropy__astropy/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +All Astropy community members are expected to abide by the [Astropy Project Code of Conduct](http://www.astropy.org/code_of_conduct.html). diff --git a/testbed/astropy__astropy/CONTRIBUTING.md b/testbed/astropy__astropy/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..7e27b3ed08c07130a596a75190842b0478665518 --- /dev/null +++ b/testbed/astropy__astropy/CONTRIBUTING.md @@ -0,0 +1,177 @@ +Contributing to Astropy +======================= + +Reporting Issues +---------------- + +When opening an issue to report a problem, please try to provide a minimal code +example that reproduces the issue along with details of the operating +system and the Python, NumPy, and `astropy` versions you are using. + +Contributing Code +----------------- + +So you are interested in contributing code to the Astropy Project? Excellent! +We love contributions! Astropy is open source, built on open source, +and we'd love to have you hang out in our community. + +**Imposter syndrome disclaimer**: We want your help. No, really. + +There may be a little voice inside your head that is telling you that you're not +ready to be an open source contributor; that your skills aren't nearly good +enough to contribute. What could you possibly offer a project like this one? + +We assure you - the little voice in your head is wrong. If you can write code at +all, you can contribute code to open source. Contributing to open source +projects is a fantastic way to advance one's coding skills. Writing perfect code +isn't the measure of a good developer (that would disqualify all of us!); it's +trying to create something, making mistakes, and learning from those +mistakes. That's how we all improve, and we are happy to help others learn. + +Being an open source contributor doesn't just mean writing code, either. You can +help out by writing documentation, tests, or even giving feedback about the +project (and yes - that includes giving feedback about the contribution +process). Some of these contributions may be the most valuable to the project as +a whole, because you're coming to the project with fresh eyes, so you can see +the errors and assumptions that seasoned contributors have glossed over. + +Note: This disclaimer was originally written by +`Adrienne Lowe `_ for a +`PyCon talk `_, and was adapted by +Astropy based on its use in the README file for the +`MetPy project `_. + +Most contributions to Astropy are done via pull requests from GitHub users' +forks of the [astropy repository](https://github.com/astropy/astropy). If you +are new to this style of development, you will want to read over our +[development workflow](http://docs.astropy.org/en/latest/development/workflow/development_workflow.html). + +You may also/instead be interested in contributing to an +[astropy affiliated package](http://www.astropy.org/affiliated/). +Affiliated packages are astronomy-related software packages that are not a part +of the `astropy` core package, but build on it for more specialized applications +and follow the Astropy guidelines for reuse, interoperability, and interfacing. +Each affiliated package has its own developers/maintainers and its own specific +guidelines for contributions, so be sure to read their docs. + +Once you open a pull request (which should be opened against the ``master`` +branch, not against any of the other branches), please make sure to +include the following: + +- **Code**: the code you are adding, which should follow + our [coding guidelines](http://docs.astropy.org/en/latest/development/codeguide.html) as much as possible. + +- **Tests**: these are usually tests to ensure code that previously + failed now works (regression tests), or tests that cover as much as possible + of the new functionality to make sure it does not break in the future and + also returns consistent results on all platforms (since we run these tests on + many platforms/configurations). For more information about how to write + tests, see our [testing guidelines](http://docs.astropy.org/en/latest/development/testguide.html). + +- **Documentation**: if you are adding new functionality, be sure to include a + description in the main documentation (in ``docs/``). Again, we have some + detailed [documentation guidelines](http://docs.astropy.org/en/latest/development/docguide.html) to help you out. + +- **Performance improvements**: if you are making changes that impact `astropy` + performance, consider adding a performance benchmark in the + [astropy-benchmarks](https://github.com/astropy/astropy-benchmarks) + repository. You can find out more about how to do this + [in the README for that repository](https://github.com/astropy/astropy-benchmarks#contributing-a-benchmark). + +- **Changelog entry**: whether you are fixing a bug or adding new + functionality, you should add an entry to the ``CHANGES.rst`` file that + includes the PR number. If you are opening a pull request you may not know + the PR number yet, but you can add it once the pull request is open. If you + are not sure where to put the changelog entry, wait until a maintainer + has reviewed your PR and assigned it to a milestone. + + You do not need to include a changelog entry for fixes to bugs introduced in + the developer version and therefore are not present in the stable releases. In + general you do not need to include a changelog entry for minor documentation + or test updates. Only user-visible changes (new features/API changes, fixed + issues) need to be mentioned. If in doubt, ask the core maintainer reviewing + your changes. + +Other Tips +---------- + +- To prevent the automated tests from running, you can add ``[ci skip]`` to your + commit message. This is useful if your PR is a work in progress and you are + not yet ready for the tests to run. For example: + + $ git commit -m "WIP widget [ci skip]" + + - If you already made the commit without including this string, you can edit + your existing commit message by running: + + $ git commit --amend + +- To skip only the AppVeyor (Windows) CI builds you can use ``[skip appveyor]``, + and to skip testing on Travis CI use ``[skip travis]``. + +- If your commit makes substantial changes to the documentation but no code + changes, then you can use ``[docs only]``, which will skip all but the + documentation building jobs on Travis. + +- When contributing trivial documentation fixes (i.e. fixes to typos, spelling, + grammar) that don't contain any special markup and are not associated with + code changes, please include the string ``[docs only]`` in your commit + message. + + $ git commit -m "Fixed typo [docs only]" + +Checklist for Contributed Code +------------------------------ + +A pull request for a new feature will be reviewed to see if it meets the +following requirements. For any pull request, an `astropy` maintainer can help +to make sure that the pull request meets the requirements for inclusion in the +package. + +**Scientific Quality** (when applicable) + * Is the submission relevant to astronomy? + * Are references included to the origin source for the algorithm? + * Does the code perform as expected? + * Has the code been tested against previously existing implementations? + +**Code Quality** + * Are the [coding guidelines](http://docs.astropy.org/en/latest/development/codeguide.html) followed? + * Is the code compatible with Python >=3.5? + * Are there dependencies other than the `astropy` core, the Python Standard + Library, and NumPy 1.10.0 or later? + * Is the package importable even if the C-extensions are not built? + * Are additional dependencies handled appropriately? + * Do functions that require additional dependencies raise an `ImportError` + if they are not present? + +**Testing** + * Are the [testing guidelines](http://docs.astropy.org/en/latest/development/testguide.html) followed? + * Are the inputs to the functions sufficiently tested? + * Are there tests for any exceptions raised? + * Are there tests for the expected performance? + * Are the sources for the tests documented? + * Have tests that require an [optional dependency](http://docs.astropy.org/en/latest/development/testguide.html#tests-requiring-optional-dependencies) + been marked as such? + * Does ``python setup.py test`` run without failures? + +**Documentation** + * Are the [documentation guidelines](http://docs.astropy.org/en/latest/development/docguide.html) followed? + * Is there a [docstring](http://docs.astropy.org/en/latest/development/docrules.html) in the function describing: + * What the code does? + * The format of the inputs of the function? + * The format of the outputs of the function? + * References to the original algorithms? + * Any exceptions which are raised? + * An example of running the code? + * Is there any information needed to be added to the docs to describe the + function? + * Does the documentation build without errors or warnings? + +**License** + * Is the `astropy` license included at the top of the file? + * Are there any conflicts with this code and existing codes? + +**Astropy requirements** + * Do all the Travis CI, AppVeyor, and CircleCI tests pass? + * If applicable, has an entry been added into the changelog? + * Can you check out the pull request and repeat the examples and tests? diff --git a/testbed/astropy__astropy/GOVERNANCE.md b/testbed/astropy__astropy/GOVERNANCE.md new file mode 100644 index 0000000000000000000000000000000000000000..a8070e708f655148479276457042909b1e3939e0 --- /dev/null +++ b/testbed/astropy__astropy/GOVERNANCE.md @@ -0,0 +1,3 @@ +# Astropy Project Governance + +Please visit our website to learn more about the [Astropy Team](http://www.astropy.org/team.html). \ No newline at end of file diff --git a/testbed/astropy__astropy/LICENSE.rst b/testbed/astropy__astropy/LICENSE.rst new file mode 100644 index 0000000000000000000000000000000000000000..1110225936f4e04989a86a0dd1c6a484352ec8e0 --- /dev/null +++ b/testbed/astropy__astropy/LICENSE.rst @@ -0,0 +1,26 @@ +Copyright (c) 2011-2017, Astropy Developers + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +* Neither the name of the Astropy Team nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/testbed/astropy__astropy/MANIFEST.in b/testbed/astropy__astropy/MANIFEST.in new file mode 100644 index 0000000000000000000000000000000000000000..62d7f9f8dc5b51e76d325b76101d7adc0d8f4b80 --- /dev/null +++ b/testbed/astropy__astropy/MANIFEST.in @@ -0,0 +1,53 @@ +include .astropy-root +include LICENSE.rst +include README.rst +include CHANGES.rst +include pip-requirements* +include CITATION +include astropy/CITATION + +include ah_bootstrap.py +include setup.cfg +include astropy/tests/coveragerc +recursive-include astropy *.pyx *.c *.h *.map *.templ + +include astropy/astropy.cfg + +# We have to explicitly include the following modules, otherwise only the +# Python 2 versions are included when making a source distribution in Python +# 2, and similarly for Python 3: +include astropy/extern/configobj/*.py +recursive-include astropy/utils/compat *.py + +recursive-include docs * +recursive-include examples * +recursive-include licenses * +recursive-include cextern * +recursive-include scripts * +recursive-include static * + +prune docs/_build +prune build + + +# the next few stanzas are for astropy_helpers. It's derived from the +# astropy_helpers/MANIFEST.in, but requires additional includes for the actual +# package directory and egg-info. + +include astropy_helpers/README.rst +include astropy_helpers/CHANGES.rst +include astropy_helpers/LICENSE.rst +recursive-include astropy_helpers/licenses * + +include astropy_helpers/ah_bootstrap.py + +recursive-include astropy_helpers/astropy_helpers *.py *.pyx *.c *.h *.rst +recursive-include astropy_helpers/astropy_helpers.egg-info * +# include the sphinx stuff with "*" because there are css/html/rst/etc. +recursive-include astropy_helpers/astropy_helpers/sphinx * + +prune astropy_helpers/build +prune astropy_helpers/astropy_helpers/tests + + +global-exclude *.pyc *.o diff --git a/testbed/astropy__astropy/README.rst b/testbed/astropy__astropy/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..5f63143f249788a1b010c161daf1550592386ed0 --- /dev/null +++ b/testbed/astropy__astropy/README.rst @@ -0,0 +1,90 @@ +======= +Astropy +======= + +|Travis Status| |AppVeyor Status| |CircleCI Status| |Coverage Status| |PyPI Status| |Documentation Status| + +The Astropy Project (http://astropy.org/) is a community effort to develop a +single core package for Astronomy in Python and foster interoperability between +Python astronomy packages. This repository contains the core package which is +intended to contain much of the core functionality and some common tools needed +for performing astronomy and astrophysics with Python. + +Releases are `registered on PyPI `_, +and development is occurring at the +`project's GitHub page `_. + +For installation instructions, see the `online documentation `_ +or `docs/install.rst `_ in this source distribution. + +Contributing Code, Documentation, or Feedback +--------------------------------------------- + +The Astropy Project is made both by and for its users, so we welcome and +encourage contributions of many kinds. Our goal is to keep this a positive, +inclusive, successful, and growing community by abiding with the +`Astropy Community Code of Conduct `_. + +More detailed information on contributing to the project or submitting feedback +can be found on the `contributions `_ +page. A `summary of contribution guidelines `_ can also be +used as a quick reference when you are ready to start writing or validating +code for submission. + +Supporting the Project +---------------------- + +|NumFOCUS| |Donate| + +The Astropy Project is sponsored by NumFOCUS, a 501(c)(3) nonprofit in the +United States. You can donate to the project by using the link above, and this +donation will support our mission to promote sustainable, high-level code base +for the astronomy community, open code development, educational materials, and +reproducible scientific research. + +License +------- + +Astropy is licensed under a 3-clause BSD style license - see the +`LICENSE.rst `_ file. + +Notes for Package Managers +-------------------------- + +For system packagers: Please install `astropy` with the command:: + + $ python setup.py --offline install + +This will prevent the astropy_helpers bootstrap script from attempting to +reach out to PyPI. + +.. |Travis Status| image:: https://travis-ci.org/astropy/astropy.svg + :target: https://travis-ci.org/astropy/astropy + :alt: Astropy's Travis CI Status + +.. |CircleCI Status| image:: https://circleci.com/gh/astropy/astropy.svg?style=svg + :target: https://circleci.com/gh/astropy/astropy + :alt: Astropy's CircleCI Status + +.. |AppVeyor Status| image:: https://ci.appveyor.com/api/projects/status/ym7lxajcs5qwm31e/branch/master?svg=true + :target: https://ci.appveyor.com/project/Astropy/astropy/branch/master + :alt: Astropy's Appveyor Status + +.. |Coverage Status| image:: https://codecov.io/gh/astropy/astropy/branch/master/graph/badge.svg + :target: https://codecov.io/gh/astropy/astropy + :alt: Astropy's Coverage Status + +.. |PyPI Status| image:: https://img.shields.io/pypi/v/astropy.svg + :target: https://pypi.python.org/pypi/astropy + :alt: Astropy's PyPI Status + +.. |Documentation Status| image:: https://readthedocs.org/projects/astropy/badge/?version=stable + :target: http://docs.astropy.org/en/stable/?badge=stable + :alt: Documentation Status + +.. |NumFOCUS| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A + :target: http://numfocus.org + :alt: Powered by NumFOCUS + +.. |Donate| image:: https://img.shields.io/badge/Donate-to%20Astropy-brightgreen.svg + :target: https://numfocus.salsalabs.org/donate-to-astropy/index.html diff --git a/testbed/astropy__astropy/ah_bootstrap.py b/testbed/astropy__astropy/ah_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..512a05a1992704302e0d765c7f168d46770e4154 --- /dev/null +++ b/testbed/astropy__astropy/ah_bootstrap.py @@ -0,0 +1,1010 @@ +""" +This bootstrap module contains code for ensuring that the astropy_helpers +package will be importable by the time the setup.py script runs. It also +includes some workarounds to ensure that a recent-enough version of setuptools +is being used for the installation. + +This module should be the first thing imported in the setup.py of distributions +that make use of the utilities in astropy_helpers. If the distribution ships +with its own copy of astropy_helpers, this module will first attempt to import +from the shipped copy. However, it will also check PyPI to see if there are +any bug-fix releases on top of the current version that may be useful to get +past platform-specific bugs that have been fixed. When running setup.py, use +the ``--offline`` command-line option to disable the auto-upgrade checks. + +When this module is imported or otherwise executed it automatically calls a +main function that attempts to read the project's setup.cfg file, which it +checks for a configuration section called ``[ah_bootstrap]`` the presences of +that section, and options therein, determine the next step taken: If it +contains an option called ``auto_use`` with a value of ``True``, it will +automatically call the main function of this module called +`use_astropy_helpers` (see that function's docstring for full details). +Otherwise no further action is taken and by default the system-installed version +of astropy-helpers will be used (however, ``ah_bootstrap.use_astropy_helpers`` +may be called manually from within the setup.py script). + +This behavior can also be controlled using the ``--auto-use`` and +``--no-auto-use`` command-line flags. For clarity, an alias for +``--no-auto-use`` is ``--use-system-astropy-helpers``, and we recommend using +the latter if needed. + +Additional options in the ``[ah_boostrap]`` section of setup.cfg have the same +names as the arguments to `use_astropy_helpers`, and can be used to configure +the bootstrap script when ``auto_use = True``. + +See https://github.com/astropy/astropy-helpers for more details, and for the +latest version of this module. +""" + +import contextlib +import errno +import io +import locale +import os +import re +import subprocess as sp +import sys + +from distutils import log +from distutils.debug import DEBUG + +from configparser import ConfigParser, RawConfigParser + +import pkg_resources + +from setuptools import Distribution +from setuptools.package_index import PackageIndex + +# This is the minimum Python version required for astropy-helpers +__minimum_python_version__ = (3, 5) + +# TODO: Maybe enable checking for a specific version of astropy_helpers? +DIST_NAME = 'astropy-helpers' +PACKAGE_NAME = 'astropy_helpers' +UPPER_VERSION_EXCLUSIVE = None + +# Defaults for other options +DOWNLOAD_IF_NEEDED = True +INDEX_URL = 'https://pypi.python.org/simple' +USE_GIT = True +OFFLINE = False +AUTO_UPGRADE = True + +# A list of all the configuration options and their required types +CFG_OPTIONS = [ + ('auto_use', bool), ('path', str), ('download_if_needed', bool), + ('index_url', str), ('use_git', bool), ('offline', bool), + ('auto_upgrade', bool) +] + +# Start off by parsing the setup.cfg file + +SETUP_CFG = ConfigParser() + +if os.path.exists('setup.cfg'): + + try: + SETUP_CFG.read('setup.cfg') + except Exception as e: + if DEBUG: + raise + + log.error( + "Error reading setup.cfg: {0!r}\n{1} will not be " + "automatically bootstrapped and package installation may fail." + "\n{2}".format(e, PACKAGE_NAME, _err_help_msg)) + +# We used package_name in the package template for a while instead of name +if SETUP_CFG.has_option('metadata', 'name'): + parent_package = SETUP_CFG.get('metadata', 'name') +elif SETUP_CFG.has_option('metadata', 'package_name'): + parent_package = SETUP_CFG.get('metadata', 'package_name') +else: + parent_package = None + +if SETUP_CFG.has_option('options', 'python_requires'): + + python_requires = SETUP_CFG.get('options', 'python_requires') + + # The python_requires key has a syntax that can be parsed by SpecifierSet + # in the packaging package. However, we don't want to have to depend on that + # package, so instead we can use setuptools (which bundles packaging). We + # have to add 'python' to parse it with Requirement. + + from pkg_resources import Requirement + req = Requirement.parse('python' + python_requires) + + # We want the Python version as a string, which we can get from the platform module + import platform + # strip off trailing '+' incase this is a dev install of python + python_version = platform.python_version().strip('+') + # allow pre-releases to count as 'new enough' + if not req.specifier.contains(python_version, True): + if parent_package is None: + message = "ERROR: Python {} is required by this package\n".format(req.specifier) + else: + message = "ERROR: Python {} is required by {}\n".format(req.specifier, parent_package) + sys.stderr.write(message) + sys.exit(1) + +if sys.version_info < __minimum_python_version__: + + if parent_package is None: + message = "ERROR: Python {} or later is required by astropy-helpers\n".format( + __minimum_python_version__) + else: + message = "ERROR: Python {} or later is required by astropy-helpers for {}\n".format( + __minimum_python_version__, parent_package) + + sys.stderr.write(message) + sys.exit(1) + +_str_types = (str, bytes) + + +# What follows are several import statements meant to deal with install-time +# issues with either missing or misbehaving pacakges (including making sure +# setuptools itself is installed): + +# Check that setuptools 30.3 or later is present +from distutils.version import LooseVersion + +try: + import setuptools + assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3') +except (ImportError, AssertionError): + sys.stderr.write("ERROR: setuptools 30.3 or later is required by astropy-helpers\n") + sys.exit(1) + +# typing as a dependency for 1.6.1+ Sphinx causes issues when imported after +# initializing submodule with ah_boostrap.py +# See discussion and references in +# https://github.com/astropy/astropy-helpers/issues/302 + +try: + import typing # noqa +except ImportError: + pass + + +# Note: The following import is required as a workaround to +# https://github.com/astropy/astropy-helpers/issues/89; if we don't import this +# module now, it will get cleaned up after `run_setup` is called, but that will +# later cause the TemporaryDirectory class defined in it to stop working when +# used later on by setuptools +try: + import setuptools.py31compat # noqa +except ImportError: + pass + + +# matplotlib can cause problems if it is imported from within a call of +# run_setup(), because in some circumstances it will try to write to the user's +# home directory, resulting in a SandboxViolation. See +# https://github.com/matplotlib/matplotlib/pull/4165 +# Making sure matplotlib, if it is available, is imported early in the setup +# process can mitigate this (note importing matplotlib.pyplot has the same +# issue) +try: + import matplotlib + matplotlib.use('Agg') + import matplotlib.pyplot +except: + # Ignore if this fails for *any* reason* + pass + + +# End compatibility imports... + + +class _Bootstrapper(object): + """ + Bootstrapper implementation. See ``use_astropy_helpers`` for parameter + documentation. + """ + + def __init__(self, path=None, index_url=None, use_git=None, offline=None, + download_if_needed=None, auto_upgrade=None): + + if path is None: + path = PACKAGE_NAME + + if not (isinstance(path, _str_types) or path is False): + raise TypeError('path must be a string or False') + + if not isinstance(path, str): + fs_encoding = sys.getfilesystemencoding() + path = path.decode(fs_encoding) # path to unicode + + self.path = path + + # Set other option attributes, using defaults where necessary + self.index_url = index_url if index_url is not None else INDEX_URL + self.offline = offline if offline is not None else OFFLINE + + # If offline=True, override download and auto-upgrade + if self.offline: + download_if_needed = False + auto_upgrade = False + + self.download = (download_if_needed + if download_if_needed is not None + else DOWNLOAD_IF_NEEDED) + self.auto_upgrade = (auto_upgrade + if auto_upgrade is not None else AUTO_UPGRADE) + + # If this is a release then the .git directory will not exist so we + # should not use git. + git_dir_exists = os.path.exists(os.path.join(os.path.dirname(__file__), '.git')) + if use_git is None and not git_dir_exists: + use_git = False + + self.use_git = use_git if use_git is not None else USE_GIT + # Declared as False by default--later we check if astropy-helpers can be + # upgraded from PyPI, but only if not using a source distribution (as in + # the case of import from a git submodule) + self.is_submodule = False + + @classmethod + def main(cls, argv=None): + if argv is None: + argv = sys.argv + + config = cls.parse_config() + config.update(cls.parse_command_line(argv)) + + auto_use = config.pop('auto_use', False) + bootstrapper = cls(**config) + + if auto_use: + # Run the bootstrapper, otherwise the setup.py is using the old + # use_astropy_helpers() interface, in which case it will run the + # bootstrapper manually after reconfiguring it. + bootstrapper.run() + + return bootstrapper + + @classmethod + def parse_config(cls): + + if not SETUP_CFG.has_section('ah_bootstrap'): + return {} + + config = {} + + for option, type_ in CFG_OPTIONS: + if not SETUP_CFG.has_option('ah_bootstrap', option): + continue + + if type_ is bool: + value = SETUP_CFG.getboolean('ah_bootstrap', option) + else: + value = SETUP_CFG.get('ah_bootstrap', option) + + config[option] = value + + return config + + @classmethod + def parse_command_line(cls, argv=None): + if argv is None: + argv = sys.argv + + config = {} + + # For now we just pop recognized ah_bootstrap options out of the + # arg list. This is imperfect; in the unlikely case that a setup.py + # custom command or even custom Distribution class defines an argument + # of the same name then we will break that. However there's a catch22 + # here that we can't just do full argument parsing right here, because + # we don't yet know *how* to parse all possible command-line arguments. + if '--no-git' in argv: + config['use_git'] = False + argv.remove('--no-git') + + if '--offline' in argv: + config['offline'] = True + argv.remove('--offline') + + if '--auto-use' in argv: + config['auto_use'] = True + argv.remove('--auto-use') + + if '--no-auto-use' in argv: + config['auto_use'] = False + argv.remove('--no-auto-use') + + if '--use-system-astropy-helpers' in argv: + config['auto_use'] = False + argv.remove('--use-system-astropy-helpers') + + return config + + def run(self): + strategies = ['local_directory', 'local_file', 'index'] + dist = None + + # First, remove any previously imported versions of astropy_helpers; + # this is necessary for nested installs where one package's installer + # is installing another package via setuptools.sandbox.run_setup, as in + # the case of setup_requires + for key in list(sys.modules): + try: + if key == PACKAGE_NAME or key.startswith(PACKAGE_NAME + '.'): + del sys.modules[key] + except AttributeError: + # Sometimes mysterious non-string things can turn up in + # sys.modules + continue + + # Check to see if the path is a submodule + self.is_submodule = self._check_submodule() + + for strategy in strategies: + method = getattr(self, 'get_{0}_dist'.format(strategy)) + dist = method() + if dist is not None: + break + else: + raise _AHBootstrapSystemExit( + "No source found for the {0!r} package; {0} must be " + "available and importable as a prerequisite to building " + "or installing this package.".format(PACKAGE_NAME)) + + # This is a bit hacky, but if astropy_helpers was loaded from a + # directory/submodule its Distribution object gets a "precedence" of + # "DEVELOP_DIST". However, in other cases it gets a precedence of + # "EGG_DIST". However, when activing the distribution it will only be + # placed early on sys.path if it is treated as an EGG_DIST, so always + # do that + dist = dist.clone(precedence=pkg_resources.EGG_DIST) + + # Otherwise we found a version of astropy-helpers, so we're done + # Just active the found distribution on sys.path--if we did a + # download this usually happens automatically but it doesn't hurt to + # do it again + # Note: Adding the dist to the global working set also activates it + # (makes it importable on sys.path) by default. + + try: + pkg_resources.working_set.add(dist, replace=True) + except TypeError: + # Some (much) older versions of setuptools do not have the + # replace=True option here. These versions are old enough that all + # bets may be off anyways, but it's easy enough to work around just + # in case... + if dist.key in pkg_resources.working_set.by_key: + del pkg_resources.working_set.by_key[dist.key] + pkg_resources.working_set.add(dist) + + @property + def config(self): + """ + A `dict` containing the options this `_Bootstrapper` was configured + with. + """ + + return dict((optname, getattr(self, optname)) + for optname, _ in CFG_OPTIONS if hasattr(self, optname)) + + def get_local_directory_dist(self): + """ + Handle importing a vendored package from a subdirectory of the source + distribution. + """ + + if not os.path.isdir(self.path): + return + + log.info('Attempting to import astropy_helpers from {0} {1!r}'.format( + 'submodule' if self.is_submodule else 'directory', + self.path)) + + dist = self._directory_import() + + if dist is None: + log.warn( + 'The requested path {0!r} for importing {1} does not ' + 'exist, or does not contain a copy of the {1} ' + 'package.'.format(self.path, PACKAGE_NAME)) + elif self.auto_upgrade and not self.is_submodule: + # A version of astropy-helpers was found on the available path, but + # check to see if a bugfix release is available on PyPI + upgrade = self._do_upgrade(dist) + if upgrade is not None: + dist = upgrade + + return dist + + def get_local_file_dist(self): + """ + Handle importing from a source archive; this also uses setup_requires + but points easy_install directly to the source archive. + """ + + if not os.path.isfile(self.path): + return + + log.info('Attempting to unpack and import astropy_helpers from ' + '{0!r}'.format(self.path)) + + try: + dist = self._do_download(find_links=[self.path]) + except Exception as e: + if DEBUG: + raise + + log.warn( + 'Failed to import {0} from the specified archive {1!r}: ' + '{2}'.format(PACKAGE_NAME, self.path, str(e))) + dist = None + + if dist is not None and self.auto_upgrade: + # A version of astropy-helpers was found on the available path, but + # check to see if a bugfix release is available on PyPI + upgrade = self._do_upgrade(dist) + if upgrade is not None: + dist = upgrade + + return dist + + def get_index_dist(self): + if not self.download: + log.warn('Downloading {0!r} disabled.'.format(DIST_NAME)) + return None + + log.warn( + "Downloading {0!r}; run setup.py with the --offline option to " + "force offline installation.".format(DIST_NAME)) + + try: + dist = self._do_download() + except Exception as e: + if DEBUG: + raise + log.warn( + 'Failed to download and/or install {0!r} from {1!r}:\n' + '{2}'.format(DIST_NAME, self.index_url, str(e))) + dist = None + + # No need to run auto-upgrade here since we've already presumably + # gotten the most up-to-date version from the package index + return dist + + def _directory_import(self): + """ + Import astropy_helpers from the given path, which will be added to + sys.path. + + Must return True if the import succeeded, and False otherwise. + """ + + # Return True on success, False on failure but download is allowed, and + # otherwise raise SystemExit + path = os.path.abspath(self.path) + + # Use an empty WorkingSet rather than the man + # pkg_resources.working_set, since on older versions of setuptools this + # will invoke a VersionConflict when trying to install an upgrade + ws = pkg_resources.WorkingSet([]) + ws.add_entry(path) + dist = ws.by_key.get(DIST_NAME) + + if dist is None: + # We didn't find an egg-info/dist-info in the given path, but if a + # setup.py exists we can generate it + setup_py = os.path.join(path, 'setup.py') + if os.path.isfile(setup_py): + # We use subprocess instead of run_setup from setuptools to + # avoid segmentation faults - see the following for more details: + # https://github.com/cython/cython/issues/2104 + sp.check_output([sys.executable, 'setup.py', 'egg_info'], cwd=path) + + for dist in pkg_resources.find_distributions(path, True): + # There should be only one... + return dist + + return dist + + def _do_download(self, version='', find_links=None): + if find_links: + allow_hosts = '' + index_url = None + else: + allow_hosts = None + index_url = self.index_url + + # Annoyingly, setuptools will not handle other arguments to + # Distribution (such as options) before handling setup_requires, so it + # is not straightforward to programmatically augment the arguments which + # are passed to easy_install + class _Distribution(Distribution): + def get_option_dict(self, command_name): + opts = Distribution.get_option_dict(self, command_name) + if command_name == 'easy_install': + if find_links is not None: + opts['find_links'] = ('setup script', find_links) + if index_url is not None: + opts['index_url'] = ('setup script', index_url) + if allow_hosts is not None: + opts['allow_hosts'] = ('setup script', allow_hosts) + return opts + + if version: + req = '{0}=={1}'.format(DIST_NAME, version) + else: + if UPPER_VERSION_EXCLUSIVE is None: + req = DIST_NAME + else: + req = '{0}<{1}'.format(DIST_NAME, UPPER_VERSION_EXCLUSIVE) + + attrs = {'setup_requires': [req]} + + # NOTE: we need to parse the config file (e.g. setup.cfg) to make sure + # it honours the options set in the [easy_install] section, and we need + # to explicitly fetch the requirement eggs as setup_requires does not + # get honored in recent versions of setuptools: + # https://github.com/pypa/setuptools/issues/1273 + + try: + + context = _verbose if DEBUG else _silence + with context(): + dist = _Distribution(attrs=attrs) + try: + dist.parse_config_files(ignore_option_errors=True) + dist.fetch_build_eggs(req) + except TypeError: + # On older versions of setuptools, ignore_option_errors + # doesn't exist, and the above two lines are not needed + # so we can just continue + pass + + # If the setup_requires succeeded it will have added the new dist to + # the main working_set + return pkg_resources.working_set.by_key.get(DIST_NAME) + except Exception as e: + if DEBUG: + raise + + msg = 'Error retrieving {0} from {1}:\n{2}' + if find_links: + source = find_links[0] + elif index_url != INDEX_URL: + source = index_url + else: + source = 'PyPI' + + raise Exception(msg.format(DIST_NAME, source, repr(e))) + + def _do_upgrade(self, dist): + # Build up a requirement for a higher bugfix release but a lower minor + # release (so API compatibility is guaranteed) + next_version = _next_version(dist.parsed_version) + + req = pkg_resources.Requirement.parse( + '{0}>{1},<{2}'.format(DIST_NAME, dist.version, next_version)) + + package_index = PackageIndex(index_url=self.index_url) + + upgrade = package_index.obtain(req) + + if upgrade is not None: + return self._do_download(version=upgrade.version) + + def _check_submodule(self): + """ + Check if the given path is a git submodule. + + See the docstrings for ``_check_submodule_using_git`` and + ``_check_submodule_no_git`` for further details. + """ + + if (self.path is None or + (os.path.exists(self.path) and not os.path.isdir(self.path))): + return False + + if self.use_git: + return self._check_submodule_using_git() + else: + return self._check_submodule_no_git() + + def _check_submodule_using_git(self): + """ + Check if the given path is a git submodule. If so, attempt to initialize + and/or update the submodule if needed. + + This function makes calls to the ``git`` command in subprocesses. The + ``_check_submodule_no_git`` option uses pure Python to check if the given + path looks like a git submodule, but it cannot perform updates. + """ + + cmd = ['git', 'submodule', 'status', '--', self.path] + + try: + log.info('Running `{0}`; use the --no-git option to disable git ' + 'commands'.format(' '.join(cmd))) + returncode, stdout, stderr = run_cmd(cmd) + except _CommandNotFound: + # The git command simply wasn't found; this is most likely the + # case on user systems that don't have git and are simply + # trying to install the package from PyPI or a source + # distribution. Silently ignore this case and simply don't try + # to use submodules + return False + + stderr = stderr.strip() + + if returncode != 0 and stderr: + # Unfortunately the return code alone cannot be relied on, as + # earlier versions of git returned 0 even if the requested submodule + # does not exist + + # This is a warning that occurs in perl (from running git submodule) + # which only occurs with a malformatted locale setting which can + # happen sometimes on OSX. See again + # https://github.com/astropy/astropy/issues/2749 + perl_warning = ('perl: warning: Falling back to the standard locale ' + '("C").') + if not stderr.strip().endswith(perl_warning): + # Some other unknown error condition occurred + log.warn('git submodule command failed ' + 'unexpectedly:\n{0}'.format(stderr)) + return False + + # Output of `git submodule status` is as follows: + # + # 1: Status indicator: '-' for submodule is uninitialized, '+' if + # submodule is initialized but is not at the commit currently indicated + # in .gitmodules (and thus needs to be updated), or 'U' if the + # submodule is in an unstable state (i.e. has merge conflicts) + # + # 2. SHA-1 hash of the current commit of the submodule (we don't really + # need this information but it's useful for checking that the output is + # correct) + # + # 3. The output of `git describe` for the submodule's current commit + # hash (this includes for example what branches the commit is on) but + # only if the submodule is initialized. We ignore this information for + # now + _git_submodule_status_re = re.compile( + r'^(?P[+-U ])(?P[0-9a-f]{40}) ' + r'(?P\S+)( .*)?$') + + # The stdout should only contain one line--the status of the + # requested submodule + m = _git_submodule_status_re.match(stdout) + if m: + # Yes, the path *is* a git submodule + self._update_submodule(m.group('submodule'), m.group('status')) + return True + else: + log.warn( + 'Unexpected output from `git submodule status`:\n{0}\n' + 'Will attempt import from {1!r} regardless.'.format( + stdout, self.path)) + return False + + def _check_submodule_no_git(self): + """ + Like ``_check_submodule_using_git``, but simply parses the .gitmodules file + to determine if the supplied path is a git submodule, and does not exec any + subprocesses. + + This can only determine if a path is a submodule--it does not perform + updates, etc. This function may need to be updated if the format of the + .gitmodules file is changed between git versions. + """ + + gitmodules_path = os.path.abspath('.gitmodules') + + if not os.path.isfile(gitmodules_path): + return False + + # This is a minimal reader for gitconfig-style files. It handles a few of + # the quirks that make gitconfig files incompatible with ConfigParser-style + # files, but does not support the full gitconfig syntax (just enough + # needed to read a .gitmodules file). + gitmodules_fileobj = io.StringIO() + + # Must use io.open for cross-Python-compatible behavior wrt unicode + with io.open(gitmodules_path) as f: + for line in f: + # gitconfig files are more flexible with leading whitespace; just + # go ahead and remove it + line = line.lstrip() + + # comments can start with either # or ; + if line and line[0] in (':', ';'): + continue + + gitmodules_fileobj.write(line) + + gitmodules_fileobj.seek(0) + + cfg = RawConfigParser() + + try: + cfg.readfp(gitmodules_fileobj) + except Exception as exc: + log.warn('Malformatted .gitmodules file: {0}\n' + '{1} cannot be assumed to be a git submodule.'.format( + exc, self.path)) + return False + + for section in cfg.sections(): + if not cfg.has_option(section, 'path'): + continue + + submodule_path = cfg.get(section, 'path').rstrip(os.sep) + + if submodule_path == self.path.rstrip(os.sep): + return True + + return False + + def _update_submodule(self, submodule, status): + if status == ' ': + # The submodule is up to date; no action necessary + return + elif status == '-': + if self.offline: + raise _AHBootstrapSystemExit( + "Cannot initialize the {0} submodule in --offline mode; " + "this requires being able to clone the submodule from an " + "online repository.".format(submodule)) + cmd = ['update', '--init'] + action = 'Initializing' + elif status == '+': + cmd = ['update'] + action = 'Updating' + if self.offline: + cmd.append('--no-fetch') + elif status == 'U': + raise _AHBootstrapSystemExit( + 'Error: Submodule {0} contains unresolved merge conflicts. ' + 'Please complete or abandon any changes in the submodule so that ' + 'it is in a usable state, then try again.'.format(submodule)) + else: + log.warn('Unknown status {0!r} for git submodule {1!r}. Will ' + 'attempt to use the submodule as-is, but try to ensure ' + 'that the submodule is in a clean state and contains no ' + 'conflicts or errors.\n{2}'.format(status, submodule, + _err_help_msg)) + return + + err_msg = None + cmd = ['git', 'submodule'] + cmd + ['--', submodule] + log.warn('{0} {1} submodule with: `{2}`'.format( + action, submodule, ' '.join(cmd))) + + try: + log.info('Running `{0}`; use the --no-git option to disable git ' + 'commands'.format(' '.join(cmd))) + returncode, stdout, stderr = run_cmd(cmd) + except OSError as e: + err_msg = str(e) + else: + if returncode != 0: + err_msg = stderr + + if err_msg is not None: + log.warn('An unexpected error occurred updating the git submodule ' + '{0!r}:\n{1}\n{2}'.format(submodule, err_msg, + _err_help_msg)) + +class _CommandNotFound(OSError): + """ + An exception raised when a command run with run_cmd is not found on the + system. + """ + + +def run_cmd(cmd): + """ + Run a command in a subprocess, given as a list of command-line + arguments. + + Returns a ``(returncode, stdout, stderr)`` tuple. + """ + + try: + p = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.PIPE) + # XXX: May block if either stdout or stderr fill their buffers; + # however for the commands this is currently used for that is + # unlikely (they should have very brief output) + stdout, stderr = p.communicate() + except OSError as e: + if DEBUG: + raise + + if e.errno == errno.ENOENT: + msg = 'Command not found: `{0}`'.format(' '.join(cmd)) + raise _CommandNotFound(msg, cmd) + else: + raise _AHBootstrapSystemExit( + 'An unexpected error occurred when running the ' + '`{0}` command:\n{1}'.format(' '.join(cmd), str(e))) + + + # Can fail of the default locale is not configured properly. See + # https://github.com/astropy/astropy/issues/2749. For the purposes under + # consideration 'latin1' is an acceptable fallback. + try: + stdio_encoding = locale.getdefaultlocale()[1] or 'latin1' + except ValueError: + # Due to an OSX oddity locale.getdefaultlocale() can also crash + # depending on the user's locale/language settings. See: + # http://bugs.python.org/issue18378 + stdio_encoding = 'latin1' + + # Unlikely to fail at this point but even then let's be flexible + if not isinstance(stdout, str): + stdout = stdout.decode(stdio_encoding, 'replace') + if not isinstance(stderr, str): + stderr = stderr.decode(stdio_encoding, 'replace') + + return (p.returncode, stdout, stderr) + + +def _next_version(version): + """ + Given a parsed version from pkg_resources.parse_version, returns a new + version string with the next minor version. + + Examples + ======== + >>> _next_version(pkg_resources.parse_version('1.2.3')) + '1.3.0' + """ + + if hasattr(version, 'base_version'): + # New version parsing from setuptools >= 8.0 + if version.base_version: + parts = version.base_version.split('.') + else: + parts = [] + else: + parts = [] + for part in version: + if part.startswith('*'): + break + parts.append(part) + + parts = [int(p) for p in parts] + + if len(parts) < 3: + parts += [0] * (3 - len(parts)) + + major, minor, micro = parts[:3] + + return '{0}.{1}.{2}'.format(major, minor + 1, 0) + + +class _DummyFile(object): + """A noop writeable object.""" + + errors = '' # Required for Python 3.x + encoding = 'utf-8' + + def write(self, s): + pass + + def flush(self): + pass + + +@contextlib.contextmanager +def _verbose(): + yield + +@contextlib.contextmanager +def _silence(): + """A context manager that silences sys.stdout and sys.stderr.""" + + old_stdout = sys.stdout + old_stderr = sys.stderr + sys.stdout = _DummyFile() + sys.stderr = _DummyFile() + exception_occurred = False + try: + yield + except: + exception_occurred = True + # Go ahead and clean up so that exception handling can work normally + sys.stdout = old_stdout + sys.stderr = old_stderr + raise + + if not exception_occurred: + sys.stdout = old_stdout + sys.stderr = old_stderr + + +_err_help_msg = """ +If the problem persists consider installing astropy_helpers manually using pip +(`pip install astropy_helpers`) or by manually downloading the source archive, +extracting it, and installing by running `python setup.py install` from the +root of the extracted source code. +""" + + +class _AHBootstrapSystemExit(SystemExit): + def __init__(self, *args): + if not args: + msg = 'An unknown problem occurred bootstrapping astropy_helpers.' + else: + msg = args[0] + + msg += '\n' + _err_help_msg + + super(_AHBootstrapSystemExit, self).__init__(msg, *args[1:]) + + +BOOTSTRAPPER = _Bootstrapper.main() + + +def use_astropy_helpers(**kwargs): + """ + Ensure that the `astropy_helpers` module is available and is importable. + This supports automatic submodule initialization if astropy_helpers is + included in a project as a git submodule, or will download it from PyPI if + necessary. + + Parameters + ---------- + + path : str or None, optional + A filesystem path relative to the root of the project's source code + that should be added to `sys.path` so that `astropy_helpers` can be + imported from that path. + + If the path is a git submodule it will automatically be initialized + and/or updated. + + The path may also be to a ``.tar.gz`` archive of the astropy_helpers + source distribution. In this case the archive is automatically + unpacked and made temporarily available on `sys.path` as a ``.egg`` + archive. + + If `None` skip straight to downloading. + + download_if_needed : bool, optional + If the provided filesystem path is not found an attempt will be made to + download astropy_helpers from PyPI. It will then be made temporarily + available on `sys.path` as a ``.egg`` archive (using the + ``setup_requires`` feature of setuptools. If the ``--offline`` option + is given at the command line the value of this argument is overridden + to `False`. + + index_url : str, optional + If provided, use a different URL for the Python package index than the + main PyPI server. + + use_git : bool, optional + If `False` no git commands will be used--this effectively disables + support for git submodules. If the ``--no-git`` option is given at the + command line the value of this argument is overridden to `False`. + + auto_upgrade : bool, optional + By default, when installing a package from a non-development source + distribution ah_boostrap will try to automatically check for patch + releases to astropy-helpers on PyPI and use the patched version over + any bundled versions. Setting this to `False` will disable that + functionality. If the ``--offline`` option is given at the command line + the value of this argument is overridden to `False`. + + offline : bool, optional + If `False` disable all actions that require an internet connection, + including downloading packages from the package index and fetching + updates to any git submodule. Defaults to `True`. + """ + + global BOOTSTRAPPER + + config = BOOTSTRAPPER.config + config.update(**kwargs) + + # Create a new bootstrapper with the updated configuration and run it + BOOTSTRAPPER = _Bootstrapper(**config) + BOOTSTRAPPER.run() diff --git a/testbed/astropy__astropy/appveyor.yml b/testbed/astropy__astropy/appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..fdb45d957dd457d0e81a9079f6f33497e76f937b --- /dev/null +++ b/testbed/astropy__astropy/appveyor.yml @@ -0,0 +1,38 @@ +# AppVeyor.com is a Continuous Integration service to build and run tests under +# Windows + +environment: + + global: + PYTHON: "C:\\conda" + MINICONDA_VERSION: "latest" + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd" + PYTHON_ARCH: "64" # needs to be set for CMD_IN_ENV to succeed. If a mix + # of 32 bit and 64 bit builds are needed, move this + # to the matrix section. + CONDA_DEPENDENCIES: "Cython scipy h5py beautifulsoup4 html5lib jinja2 pyyaml matplotlib scikit-image pytz pandas" + PIP_DEPENDENCIES: "objgraph asdf" + + matrix: + - PYTHON_VERSION: "3.7" + NUMPY_VERSION: "stable" + +matrix: + fast_finish: true + +platform: + -x64 + +os: Visual Studio 2017 + +install: + - "git clone git://github.com/astropy/ci-helpers.git" + - "powershell ci-helpers/appveyor/install-miniconda.ps1" + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + - "activate test" + +# Not a .NET project, we build Astropy in the install step instead +build: false + +test_script: + - "%CMD_IN_ENV% python setup.py test --readonly" diff --git a/testbed/astropy__astropy/astropy/CITATION b/testbed/astropy__astropy/astropy/CITATION new file mode 100644 index 0000000000000000000000000000000000000000..e9b47516a3459cbf03a0d5a275f68893a20f7c75 --- /dev/null +++ b/testbed/astropy__astropy/astropy/CITATION @@ -0,0 +1,112 @@ +If you use Astropy for work/research presented in a publication (whether +directly, or as a dependency to another package), we recommend and encourage +the following acknowledgment: + + This research made use of Astropy, a community-developed core Python package + for Astronomy (Astropy Collaboration, 2018). + +where (Astropy Collaboration, 2018) is a citation to this paper: + + http://adsabs.harvard.edu/abs/2018AJ....156..123T + +An earlier paper is also available describing the status of the package at +the time of v0.2. If you have used Astropy for a long time, you are +encouraged to acknowledge both papers: + + This research made use of Astropy, a community-developed core Python package + for Astronomy (Astropy Collaboration, 2013, 2018). + +where (Astropy Collaboration, 2013) is a citation to this paper: + + http://adsabs.harvard.edu/abs/2013A%26A...558A..33A + +We encourage you to also include citations to the papers in the main text +wherever appropriate. + + +Recommended BibTeX entries for the above citations are: + +@ARTICLE{2018AJ....156..123T, + author = {{The Astropy Collaboration} and {Price-Whelan}, A.~M. and {Sip{\H o}cz}, B.~M. and + {G{\"u}nther}, H.~M. and {Lim}, P.~L. and {Crawford}, S.~M. and + {Conseil}, S. and {Shupe}, D.~L. and {Craig}, M.~W. and {Dencheva}, N. and + {Ginsburg}, A. and {VanderPlas}, J.~T. and {Bradley}, L.~D. and + {P{\'e}rez-Su{\'a}rez}, D. and {de Val-Borro}, M. and {Paper Contributors}, (. and + {Aldcroft}, T.~L. and {Cruz}, K.~L. and {Robitaille}, T.~P. and + {Tollerud}, E.~J. and {Coordination Committee}, (. and {Ardelean}, C. and + {Babej}, T. and {Bach}, Y.~P. and {Bachetti}, M. and {Bakanov}, A.~V. and + {Bamford}, S.~P. and {Barentsen}, G. and {Barmby}, P. and {Baumbach}, A. and + {Berry}, K.~L. and {Biscani}, F. and {Boquien}, M. and {Bostroem}, K.~A. and + {Bouma}, L.~G. and {Brammer}, G.~B. and {Bray}, E.~M. and {Breytenbach}, H. and + {Buddelmeijer}, H. and {Burke}, D.~J. and {Calderone}, G. and + {Cano Rodr{\'{\i}}guez}, J.~L. and {Cara}, M. and {Cardoso}, J.~V.~M. and + {Cheedella}, S. and {Copin}, Y. and {Corrales}, L. and {Crichton}, D. and + {D{\rsquo}Avella}, D. and {Deil}, C. and {Depagne}, {\'E}. and + {Dietrich}, J.~P. and {Donath}, A. and {Droettboom}, M. and + {Earl}, N. and {Erben}, T. and {Fabbro}, S. and {Ferreira}, L.~A. and + {Finethy}, T. and {Fox}, R.~T. and {Garrison}, L.~H. and {Gibbons}, S.~L.~J. and + {Goldstein}, D.~A. and {Gommers}, R. and {Greco}, J.~P. and + {Greenfield}, P. and {Groener}, A.~M. and {Grollier}, F. and + {Hagen}, A. and {Hirst}, P. and {Homeier}, D. and {Horton}, A.~J. and + {Hosseinzadeh}, G. and {Hu}, L. and {Hunkeler}, J.~S. and {Ivezi{\'c}}, {\v Z}. and + {Jain}, A. and {Jenness}, T. and {Kanarek}, G. and {Kendrew}, S. and + {Kern}, N.~S. and {Kerzendorf}, W.~E. and {Khvalko}, A. and + {King}, J. and {Kirkby}, D. and {Kulkarni}, A.~M. and {Kumar}, A. and + {Lee}, A. and {Lenz}, D. and {Littlefair}, S.~P. and {Ma}, Z. and + {Macleod}, D.~M. and {Mastropietro}, M. and {McCully}, C. and + {Montagnac}, S. and {Morris}, B.~M. and {Mueller}, M. and {Mumford}, S.~J. and + {Muna}, D. and {Murphy}, N.~A. and {Nelson}, S. and {Nguyen}, G.~H. and + {Ninan}, J.~P. and {N{\"o}the}, M. and {Ogaz}, S. and {Oh}, S. and + {Parejko}, J.~K. and {Parley}, N. and {Pascual}, S. and {Patil}, R. and + {Patil}, A.~A. and {Plunkett}, A.~L. and {Prochaska}, J.~X. and + {Rastogi}, T. and {Reddy Janga}, V. and {Sabater}, J. and {Sakurikar}, P. and + {Seifert}, M. and {Sherbert}, L.~E. and {Sherwood-Taylor}, H. and + {Shih}, A.~Y. and {Sick}, J. and {Silbiger}, M.~T. and {Singanamalla}, S. and + {Singer}, L.~P. and {Sladen}, P.~H. and {Sooley}, K.~A. and + {Sornarajah}, S. and {Streicher}, O. and {Teuben}, P. and {Thomas}, S.~W. and + {Tremblay}, G.~R. and {Turner}, J.~E.~H. and {Terr{\'o}n}, V. and + {van Kerkwijk}, M.~H. and {de la Vega}, A. and {Watkins}, L.~L. and + {Weaver}, B.~A. and {Whitmore}, J.~B. and {Woillez}, J. and + {Zabalza}, V. and {Contributors}, (.}, + title = "{The Astropy Project: Building an Open-science Project and Status of the v2.0 Core Package}", + journal = {\aj}, +archivePrefix = "arXiv", + eprint = {1801.02634}, + primaryClass = "astro-ph.IM", + keywords = {methods: data analysis, methods: miscellaneous, methods: statistical, reference systems }, + year = 2018, + month = sep, + volume = 156, + eid = {123}, + pages = {123}, + doi = {10.3847/1538-3881/aabc4f}, + adsurl = {http://adsabs.harvard.edu/abs/2018AJ....156..123T}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + +@ARTICLE{2013A&A...558A..33A, + author = {{Astropy Collaboration} and {Robitaille}, T.~P. and {Tollerud}, E.~J. and + {Greenfield}, P. and {Droettboom}, M. and {Bray}, E. and {Aldcroft}, T. and + {Davis}, M. and {Ginsburg}, A. and {Price-Whelan}, A.~M. and + {Kerzendorf}, W.~E. and {Conley}, A. and {Crighton}, N. and + {Barbary}, K. and {Muna}, D. and {Ferguson}, H. and {Grollier}, F. and + {Parikh}, M.~M. and {Nair}, P.~H. and {Unther}, H.~M. and {Deil}, C. and + {Woillez}, J. and {Conseil}, S. and {Kramer}, R. and {Turner}, J.~E.~H. and + {Singer}, L. and {Fox}, R. and {Weaver}, B.~A. and {Zabalza}, V. and + {Edwards}, Z.~I. and {Azalee Bostroem}, K. and {Burke}, D.~J. and + {Casey}, A.~R. and {Crawford}, S.~M. and {Dencheva}, N. and + {Ely}, J. and {Jenness}, T. and {Labrie}, K. and {Lian Lim}, P. and + {Pierfederici}, F. and {Pontzen}, A. and {Ptak}, A. and {Refsdal}, B. and + {Servillat}, M. and {Streicher}, O.}, + title = "{Astropy: A community Python package for astronomy}", + journal = {\aap}, + keywords = {methods: data analysis, methods: miscellaneous, virtual observatory tools}, + year = 2013, + month = oct, + volume = 558, + eid = {A33}, + pages = {A33}, + doi = {10.1051/0004-6361/201322068}, + adsurl = {http://adsabs.harvard.edu/abs/2013A%26A...558A..33A}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} diff --git a/testbed/astropy__astropy/astropy/__init__.py b/testbed/astropy__astropy/astropy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ab8d1736ad27070c0d3f61d26ad80248093c14bf --- /dev/null +++ b/testbed/astropy__astropy/astropy/__init__.py @@ -0,0 +1,343 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +Astropy is a package intended to contain core functionality and some +common tools needed for performing astronomy and astrophysics research with +Python. It also provides an index for other astronomy packages and tools for +managing them. +""" + +# Prior to Astropy 3.2, astropy was imported during setup.py commands. If we are +# in setup mode, then astropy-helpers defines an _ASTROPY_SETUP_ variable, which +# we used to use to conditionally import C extensions for example. However, the +# behavior of importing the package during the setup process is not good +# practice and we therefore now explicitly prevent the package from being +# imported in that case to prevent any regressions. We use _ASTROPY_CORE_SETUP_ +# (defined in setup.py) rather than _ASTROPY_SETUP_ since the latter is also +# set up for affiliated packages, and those need to be able to import the +# (installed) core package during e.g. python setup.py test. +try: + _ASTROPY_CORE_SETUP_ +except NameError: + pass +else: + raise RuntimeError("The astropy package cannot be imported during setup") + +import sys +import os +from warnings import warn + +__minimum_python_version__ = '3.5' +__minimum_numpy_version__ = '1.13.0' +# ASDF is an optional dependency, but this is the minimum version that is +# compatible with Astropy when it is installed. +__minimum_asdf_version__ = '2.3.0' + + +class UnsupportedPythonError(Exception): + pass + + +# This is the same check as the one at the top of setup.py +if sys.version_info < tuple((int(val) for val in __minimum_python_version__.split('.'))): + raise UnsupportedPythonError("Astropy does not support Python < {}".format(__minimum_python_version__)) + + +def _is_astropy_source(path=None): + """ + Returns whether the source for this module is directly in an astropy + source distribution or checkout. + """ + + # If this __init__.py file is in ./astropy/ then import is within a source + # dir .astropy-root is a file distributed with the source, but that should + # not installed + if path is None: + path = os.path.join(os.path.dirname(__file__), os.pardir) + elif os.path.isfile(path): + path = os.path.dirname(path) + + source_dir = os.path.abspath(path) + return os.path.exists(os.path.join(source_dir, '.astropy-root')) + + +def _is_astropy_setup(): + """ + Returns whether we are currently being imported in the context of running + Astropy's setup.py. + """ + + main_mod = sys.modules.get('__main__') + if not main_mod: + return False + + return (getattr(main_mod, '__file__', False) and + os.path.basename(main_mod.__file__).rstrip('co') == 'setup.py' and + _is_astropy_source(main_mod.__file__)) + +try: + from .version import version as __version__ +except ImportError: + # TODO: Issue a warning using the logging framework + __version__ = '' +try: + from .version import githash as __githash__ +except ImportError: + # TODO: Issue a warning using the logging framework + __githash__ = '' + + +# The location of the online documentation for astropy +# This location will normally point to the current released version of astropy +if 'dev' in __version__: + online_docs_root = 'http://docs.astropy.org/en/latest/' +else: + online_docs_root = 'http://docs.astropy.org/en/{0}/'.format(__version__) + + +def _check_numpy(): + """ + Check that Numpy is installed and it is of the minimum version we + require. + """ + # Note: We could have used distutils.version for this comparison, + # but it seems like overkill to import distutils at runtime. + requirement_met = False + + try: + import numpy + except ImportError: + pass + else: + from .utils import minversion + requirement_met = minversion(numpy, __minimum_numpy_version__) + + if not requirement_met: + msg = ("Numpy version {0} or later must be installed to use " + "Astropy".format(__minimum_numpy_version__)) + raise ImportError(msg) + + return numpy + + +_check_numpy() + + +from . import config as _config + + +class Conf(_config.ConfigNamespace): + """ + Configuration parameters for `astropy`. + """ + + unicode_output = _config.ConfigItem( + False, + 'When True, use Unicode characters when outputting values, and ' + 'displaying widgets at the console.') + use_color = _config.ConfigItem( + sys.platform != 'win32', + 'When True, use ANSI color escape sequences when writing to the console.', + aliases=['astropy.utils.console.USE_COLOR', 'astropy.logger.USE_COLOR']) + max_lines = _config.ConfigItem( + None, + description='Maximum number of lines in the display of pretty-printed ' + 'objects. If not provided, try to determine automatically from the ' + 'terminal size. Negative numbers mean no limit.', + cfgtype='integer(default=None)', + aliases=['astropy.table.pprint.max_lines']) + max_width = _config.ConfigItem( + None, + description='Maximum number of characters per line in the display of ' + 'pretty-printed objects. If not provided, try to determine ' + 'automatically from the terminal size. Negative numbers mean no ' + 'limit.', + cfgtype='integer(default=None)', + aliases=['astropy.table.pprint.max_width']) + + +conf = Conf() + +# Create the test() function +from .tests.runner import TestRunner +test = TestRunner.make_test_runner_in(__path__[0]) + + +# if we are *not* in setup mode, import the logger and possibly populate the +# configuration file with the defaults +def _initialize_astropy(): + from . import config + + def _rollback_import(message): + log.error(message) + # Now disable exception logging to avoid an annoying error in the + # exception logger before we raise the import error: + _teardown_log() + + # Roll back any astropy sub-modules that have been imported thus + # far + + for key in list(sys.modules): + if key.startswith('astropy.'): + del sys.modules[key] + raise ImportError('astropy') + + try: + from .utils import _compiler + except ImportError: + if _is_astropy_source(): + log.warning('You appear to be trying to import astropy from ' + 'within a source checkout without building the ' + 'extension modules first. Attempting to (re)build ' + 'extension modules:') + + try: + _rebuild_extensions() + except BaseException as exc: + _rollback_import( + 'An error occurred while attempting to rebuild the ' + 'extension modules. Please try manually running ' + '`./setup.py develop` or `./setup.py build_ext ' + '--inplace` to see what the issue was. Extension ' + 'modules must be successfully compiled and importable ' + 'in order to import astropy.') + # Reraise the Exception only in case it wasn't an Exception, + # for example if a "SystemExit" or "KeyboardInterrupt" was + # invoked. + if not isinstance(exc, Exception): + raise + + else: + # Outright broken installation; don't be nice. + raise + + # add these here so we only need to cleanup the namespace at the end + config_dir = os.path.dirname(__file__) + + try: + config.configuration.update_default_config(__package__, config_dir) + except config.configuration.ConfigurationDefaultMissingError as e: + wmsg = (e.args[0] + " Cannot install default profile. If you are " + "importing from source, this is expected.") + warn(config.configuration.ConfigurationDefaultMissingWarning(wmsg)) + + +def _rebuild_extensions(): + global __version__ + global __githash__ + + import subprocess + import time + + from .utils.console import Spinner + + devnull = open(os.devnull, 'w') + old_cwd = os.getcwd() + os.chdir(os.path.join(os.path.dirname(__file__), os.pardir)) + try: + sp = subprocess.Popen([sys.executable, 'setup.py', 'build_ext', + '--inplace'], stdout=devnull, + stderr=devnull) + with Spinner('Rebuilding extension modules') as spinner: + while sp.poll() is None: + next(spinner) + time.sleep(0.05) + finally: + os.chdir(old_cwd) + devnull.close() + + if sp.returncode != 0: + raise OSError('Running setup.py build_ext --inplace failed ' + 'with error code {0}: try rerunning this command ' + 'manually to check what the error was.'.format( + sp.returncode)) + + # Try re-loading module-level globals from the astropy.version module, + # which may not have existed before this function ran + try: + from .version import version as __version__ + except ImportError: + pass + + try: + from .version import githash as __githash__ + except ImportError: + pass + + +# Set the bibtex entry to the article referenced in CITATION. +def _get_bibtex(): + citation_file = os.path.join(os.path.dirname(__file__), 'CITATION') + + with open(citation_file, 'r') as citation: + refs = citation.read().split('@ARTICLE')[1:] + if len(refs) == 0: return '' + bibtexreference = "@ARTICLE{0}".format(refs[0]) + return bibtexreference + + +__citation__ = __bibtex__ = _get_bibtex() + +import logging + +# Use the root logger as a dummy log before initilizing Astropy's logger +log = logging.getLogger() + + +from .logger import _init_log, _teardown_log + +log = _init_log() + +_initialize_astropy() + +from .utils.misc import find_api_page + + +def online_help(query): + """ + Search the online Astropy documentation for the given query. + Opens the results in the default web browser. Requires an active + Internet connection. + + Parameters + ---------- + query : str + The search query. + """ + from urllib.parse import urlencode + import webbrowser + + version = __version__ + if 'dev' in version: + version = 'latest' + else: + version = 'v' + version + + url = 'http://docs.astropy.org/en/{0}/search.html?{1}'.format( + version, urlencode({'q': query})) + + webbrowser.open(url) + + +__dir_inc__ = ['__version__', '__githash__', '__minimum_numpy_version__', + '__bibtex__', 'test', 'log', 'find_api_page', 'online_help', + 'online_docs_root', 'conf'] + + +from types import ModuleType as __module_type__ +# Clean up top-level namespace--delete everything that isn't in __dir_inc__ +# or is a magic attribute, and that isn't a submodule of this package +for varname in dir(): + if not ((varname.startswith('__') and varname.endswith('__')) or + varname in __dir_inc__ or + (varname[0] != '_' and + isinstance(locals()[varname], __module_type__) and + locals()[varname].__name__.startswith(__name__ + '.'))): + # The last clause in the the above disjunction deserves explanation: + # When using relative imports like ``from .. import config``, the + # ``config`` variable is automatically created in the namespace of + # whatever module ``..`` resolves to (in this case astropy). This + # happens a few times just in the module setup above. This allows + # the cleanup to keep any public submodules of the astropy package + del locals()[varname] + +del varname, __module_type__ diff --git a/testbed/astropy__astropy/astropy/_erfa/__init__.py b/testbed/astropy__astropy/astropy/_erfa/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aaaccbd4494809679a28b8c6ed4b60041ca9c413 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/__init__.py @@ -0,0 +1,3 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from .core import * diff --git a/testbed/astropy__astropy/astropy/_erfa/core.py.templ b/testbed/astropy__astropy/astropy/_erfa/core.py.templ new file mode 100644 index 0000000000000000000000000000000000000000..807eed2c77eacee7862a9e636ecccc3c85b8840e --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/core.py.templ @@ -0,0 +1,313 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +# "core.py" is auto-generated by erfa_generator.py from the template +# "core.py.templ". Do *not* edit "core.py" directly, instead edit +# "core.py.templ" and run erfa_generator.py from the source directory to +# update it. + +""" +Python wrappers for the ufunc wrappers of the ERFA library. + +..warning:: + This is currently *not* part of the public Astropy API, and may change in + the future. + +The key idea is that any function can be called with inputs that are arrays, +and the ufuncs will automatically vectorize and call the ERFA functions for +each item using broadcasting rules for numpy. So the return values are always +numpy arrays of some sort. + +For ERFA functions that take/return vectors or matrices, the vector/matrix +dimension(s) are always the *last* dimension(s). For example, if you +want to give ten matrices (i.e., the ERFA input type is double[3][3]), +you would pass in a (10, 3, 3) numpy array. If the output of the ERFA +function is scalar, you'll get back a length-10 1D array. +(Note that the ufuncs take this into account using structured dtypes.) + +Note that the ufunc part of these functions are implemented in a separate +module (compiled as ``ufunc``), derived from the ``ufunc.c`` file. +""" + +import warnings + +import numpy + +# we import these exceptions from astropy locations instead of defining them +# in this file because otherwise there are circular dependencies +from astropy.utils.exceptions import ErfaError, ErfaWarning +from astropy.utils.misc import check_broadcast + +from . import ufunc +from .ufunc import (dt_eraASTROM, dt_eraLDBODY, dt_pv, + dt_sign, dt_type, dt_ymdf, dt_hmsf, dt_dmsf) + +__all__ = ['ErfaError', 'ErfaWarning', + {{ funcs|map(attribute='pyname')|surround("'","'")|join(", ") }}, + {{ constants|map(attribute='name')|surround("'","'")|join(", ") }}, + # TODO: delete the functions below when they can get auto-generated + 'version', 'version_major', 'version_minor', 'version_micro', 'sofa_version', + 'dt_eraASTROM', 'dt_eraLDBODY', 'dt_pv', 'dt_ymdf', 'dt_hmsf', 'dt_dmsf'] + + +# <---------------------------------Error-handling----------------------------> + + +STATUS_CODES = {} # populated below before each function that returns an int + +# This is a hard-coded list of status codes that need to be remapped, +# such as to turn errors into warnings. +STATUS_CODES_REMAP = { + 'cal2jd': {-3: 3} +} + + +def check_errwarn(statcodes, func_name): + if not numpy.any(statcodes): + return + # Remap any errors into warnings in the STATUS_CODES_REMAP dict. + if func_name in STATUS_CODES_REMAP: + for before, after in STATUS_CODES_REMAP[func_name].items(): + statcodes[statcodes == before] = after + STATUS_CODES[func_name][after] = STATUS_CODES[func_name][before] + + if numpy.any(statcodes<0): + # errors present - only report the errors. + if statcodes.shape: + statcodes = statcodes[statcodes<0] + + errcodes = numpy.unique(statcodes) + + errcounts = dict([(e, numpy.sum(statcodes==e)) for e in errcodes]) + + elsemsg = STATUS_CODES[func_name].get('else', None) + if elsemsg is None: + errmsgs = dict([(e, STATUS_CODES[func_name].get(e, 'Return code ' + str(e))) for e in errcodes]) + else: + errmsgs = dict([(e, STATUS_CODES[func_name].get(e, elsemsg)) for e in errcodes]) + + emsg = ', '.join(['{0} of "{1}"'.format(errcounts[e], errmsgs[e]) for e in errcodes]) + raise ErfaError('ERFA function "' + func_name + '" yielded ' + emsg) + + elif numpy.any(statcodes>0): + #only warnings present + if statcodes.shape: + statcodes = statcodes[statcodes>0] + + warncodes = numpy.unique(statcodes) + + warncounts = dict([(w, numpy.sum(statcodes==w)) for w in warncodes]) + + elsemsg = STATUS_CODES[func_name].get('else', None) + if elsemsg is None: + warnmsgs = dict([(w, STATUS_CODES[func_name].get(w, 'Return code ' + str(w))) for w in warncodes]) + else: + warnmsgs = dict([(w, STATUS_CODES[func_name].get(w, elsemsg)) for w in warncodes]) + + wmsg = ', '.join(['{0} of "{1}"'.format(warncounts[w], warnmsgs[w]) for w in warncodes]) + warnings.warn('ERFA function "' + func_name + '" yielded ' + wmsg, ErfaWarning) + + +# <------------------------structured dtype conversion------------------------> + +{%- if NUMPY_LT_1_16 %} +# Note: the following are only necessary for NUMPY_LT_1_16. Once we support +# only numpy >=1.16, they can be removed, and the template code below should be +# adapted. Note that for >=1.16, these are not used, since the template parts +# that use it are never inserted (since `d3_fix_arg` is always empty). +class D3Fix(numpy.ndarray): + """NDarray subclass that can transfer itself into a Quantity. + + For the rationale for this, see arrayify_inputs_and_create_d3_fix. + """ + def __quantity_subclass__(self, unit): + return type(self), True + + def __array_wrap__(self, obj, context): + return obj.view(numpy.ndarray) + + +def arrayify_inputs_and_create_d3_fix(inputs, core_dims, out_core_shape, out_dtype): + """Create an empty array of the right trailing shape. + + Gufuncs currently do not allow one to pass in fixed dimensions, which + means that for functions with signatures like `()->(n)`, one has to pass in + an output argument for the gufunc to determine `n` (to be 3 for instance). + + For those gufuncs, this functions creates the output array upfront, + with properly broadcast dimensions. + + A problem that arises, though, is that if anything overrides the function + using ``__array_ufunc__``, it will fail because the output is of the wrong + class. To work around this for `~astropy.units.Quantity` at least, we + create the output with a special class (``D3Fix``), which has an + ``__array_wrap__`` that will turn it into a regular ndarray for normal + usage, and a ``__quantity_subclass__`` that allows it to be replaced by a + `~astropy.units.Quantity`. + + Obviously, this is a hack, and only works easily for Quantity (which, + however, is the only class likely to use this private implementation). As + an alternative, one could create a regular empty ndarray and then remove + it in the C type resolver, so that a new one with the proper class is + created by the iterator. But that seemed even more fragile. + + Parameters + ---------- + inputs : array-like + Input arguments, used to determine the required broadcast shape. + core_dims: list of int + Number of core dimensions for the inputs; these are removed for + calculating the broadcast shape. + out_core_shape : tuple + Output core shape; the full shape will be the broadcast shape + determined from the inputs plus this core shape. + out_dtype : `~numpy.dtype` + Data type of the array. + + Notes + ----- + Once https://github.com/numpy/numpy/pull/11175 is in, this will no + longer be necessary for all but NUMPY_LT_1_16, since we'll be able to just + define the signature with explicit numerical dimensions. + """ + shapes = [] + arrays = [] + for input, core_dim in zip(inputs, core_dims): + try: + shape = input.shape + except AttributeError: + input = numpy.asanyarray(input) + shape = input.shape + shapes.append(shape[:-core_dim] if core_dim else shape) + arrays.append(input) + + broadcast_shape = check_broadcast(*shapes) + d3_fix = numpy.empty(broadcast_shape + out_core_shape, out_dtype).view(D3Fix) + return arrays, d3_fix +{%- endif %} + + +dt_bytes1 = numpy.dtype('S1') +dt_bytes12 = numpy.dtype('S12') + +# <--------------------------Actual ERFA-wrapping code------------------------> + +{% for constant in constants %} +{{ constant.name }} = {{ constant.value }} +"""{{ constant.doc|join(' ') }}""" +{%- endfor %} + + +{% for func in funcs -%} +def {{ func.pyname }}({{ func.args_by_inout('in|inout')|map(attribute='name')|join(', ') }}): + """ + Wrapper for ERFA function ``{{ func.name }}``. + + Parameters + ---------- + {%- for arg in func.args_by_inout('in|inout') %} + {{ arg.name }} : {{ arg.ctype }} array + {%- endfor %} + + Returns + ------- + {%- for arg in func.args_by_inout('inout|out|ret') %} + {{ arg.name }} : {{ arg.ctype }} array + {%- endfor %} + + Notes + ----- + The ERFA documentation is below. + +{{ func.doc }} + """ + + {#- + # Call the ufunc. Note that we pass inout twice, once as input + # and once as output, so that changes are done in-place + #} + {%- if func.d3_fix_arg %} + {% if func.args_by_inout('in|inout') -%} + ({{ func.args_by_inout('in|inout')|map(attribute='name')|join(', ') }},) + {%- else -%}_{%- endif -%}, {{ func.d3_fix_arg.name + }} = arrayify_inputs_and_create_d3_fix( + [{{ func.args_by_inout('in|inout')|map(attribute='name')|list()|join(', ') + }}], core_dims=[{{ + func.args_by_inout('in|inout')|map(attribute='ndim')|list()|join(', ') + }}], out_core_shape={{ func.d3_fix_arg.shape + }}, out_dtype=numpy.{{ func.d3_fix_arg.ctype }}) + {%- endif %} + {{ func.python_call }} + {#- + # Check whether any warnings or errors occurred. + #} + {%- for arg in func.args_by_inout('stat') %} + check_errwarn({{ arg.name }}, '{{ func.pyname }}') + {%- endfor %} + {#- + # Any string outputs will be in structs; view them as their base type. + #} + {%- for arg in func.args_by_inout('out') -%} + {%- if 'char' in arg.ctype %} + {{ arg.name }} = {{ arg.name }}.view({{ arg.view_dtype }}) + {%- endif %} + {%- endfor %} + {#- + # Return the output arguments (including the inplace ones) + #} + return {{ func.args_by_inout('inout|out|ret')|map(attribute='name')|join(', ') }} + + +{# + # Define the status codes that this function returns. + #} +{%- if func.args_by_inout('stat') -%} +{%- for stat in func.args_by_inout('stat') -%} +{%- if stat.doc_info.statuscodes -%} +STATUS_CODES['{{ func.pyname }}'] = {{ stat.doc_info.statuscodes|string }} +{% endif %} +{% endfor %} +{% endif -%} +{% endfor -%} + + +# TODO: delete the functions below when they can get auto-generated +# (current machinery doesn't support returning strings or non-status-codes) +def version(): + """ + Returns the package version + as defined in configure.ac + in string format + """ + return "1.4.0" + +def version_major(): + """ + Returns the package major version + as defined in configure.ac + as integer + """ + return 1 + +def version_minor(): + """ + Returns the package minor version + as defined in configure.ac + as integer + """ + return 4 + +def version_micro(): + """ + Returns the package micro version + as defined in configure.ac + as integer + """ + return 0 + +def sofa_version(): + """ + Returns the corresponding SOFA version + as defined in configure.ac + in string format + """ + return "20170420" diff --git a/testbed/astropy__astropy/astropy/_erfa/erfa_additions.h b/testbed/astropy__astropy/astropy/_erfa/erfa_additions.h new file mode 100644 index 0000000000000000000000000000000000000000..301580ae6d2f293124a719502c8b9343c647d6b3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/erfa_additions.h @@ -0,0 +1,21 @@ +#ifndef ERFAADDITIONSDEF +#define ERFAADDITIONSDEF + +/* +** - - - - - - - - - - - - - - - - - +** e r f a _ a d d i t i o n s . h +** - - - - - - - - - - - - - - - - - +** +** A few extra routines which are particularly handy for constructing +** pv vectors inside the coordinate transforms. +** +** MHvK proposed these to Catherine Hohenkerk for inclusion in SOFA +** on 2018-05-24, with the response suggesting this was reasonable and +** might thus be done. +*/ + +/* Extra/PVMergeExtract */ +void eraPav2pv(double p[3], double v[3], double pv[2][3]); +void eraPv2pav(double pv[2][3], double p[3], double v[3]); + +#endif diff --git a/testbed/astropy__astropy/astropy/_erfa/erfa_generator.py b/testbed/astropy__astropy/astropy/_erfa/erfa_generator.py new file mode 100644 index 0000000000000000000000000000000000000000..ac822de62e2664efd56ceefe7b1e9ebe3800ad10 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/erfa_generator.py @@ -0,0 +1,740 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +This module's main purpose is to act as a script to create new versions +of ufunc.c when ERFA is updated (or this generator is enhanced). + +`Jinja2 `_ must be installed for this +module/script to function. + +Note that this does *not* currently automate the process of creating structs +or dtypes for those structs. They should be added manually in the template file. +""" +# note that we do *not* use unicode_literals here, because that makes the +# generated code's strings have u'' in them on py 2.x + +import re +import os.path +from collections import OrderedDict +from distutils.version import LooseVersion + +import numpy + +# Note: once we support only numpy >=1.16, all things related to "d3_fix" +# can be removed, here and in the templates (core.py.templ + +# NOTE: we define this variable here instead of importing from astropy to +# ensure that running this script does not require importing astropy. +NUMPY_LT_1_16 = LooseVersion(numpy.__version__) < '1.16' + + +DEFAULT_ERFA_LOC = os.path.join(os.path.split(__file__)[0], + '../../cextern/erfa') +DEFAULT_TEMPLATE_LOC = os.path.split(__file__)[0] + +NDIMS_REX = re.compile(re.escape("numpy.dtype([('fi0', '.*', <(.*)>)])").replace(r'\.\*', '.*').replace(r'\<', '(').replace(r'\>', ')')) + + +class FunctionDoc: + + def __init__(self, doc): + self.doc = doc.replace("**", " ").replace("/*\n", "").replace("*/", "") + self.__input = None + self.__output = None + self.__ret_info = None + + def _get_arg_doc_list(self, doc_lines): + """Parse input/output doc section lines, getting arguments from them. + + Ensure all elements of eraASTROM and eraLDBODY are left out, as those + are not input or output arguments themselves. Also remove the nb + argument in from of eraLDBODY, as we infer nb from the python array. + """ + doc_list = [] + skip = [] + for d in doc_lines: + arg_doc = ArgumentDoc(d) + if arg_doc.name is not None: + if skip: + if skip[0] == arg_doc.name: + skip.pop(0) + continue + else: + raise RuntimeError("We whould be skipping {} " + "but {} encountered." + .format(skip[0], arg_doc.name)) + + if arg_doc.type.startswith('eraLDBODY'): + # Special-case LDBODY: for those, the previous argument + # is always the number of bodies, but we don't need it + # as an input argument for the ufunc since we're going + # to determine this from the array itself. Also skip + # the description of its contents; those are not arguments. + doc_list.pop() + skip = ['bm', 'dl', 'pv'] + elif arg_doc.type.startswith('eraASTROM'): + # Special-case ASTROM: need to skip the description + # of its contents; those are not arguments. + skip = ['pmt', 'eb', 'eh', 'em', 'v', 'bm1', + 'bpn', 'along', 'xpl', 'ypl', 'sphi', + 'cphi', 'diurab', 'eral', 'refa', 'refb'] + + doc_list.append(arg_doc) + + return doc_list + + @property + def input(self): + if self.__input is None: + self.__input = [] + for regex in ("Given([^\n]*):\n(.+?) \n", + "Given and returned([^\n]*):\n(.+?) \n"): + result = re.search(regex, self.doc, re.DOTALL) + if result is not None: + doc_lines = result.group(2).split("\n") + self.__input += self._get_arg_doc_list(doc_lines) + + return self.__input + + @property + def output(self): + if self.__output is None: + self.__output = [] + for regex in ("Given and returned([^\n]*):\n(.+?) \n", + "Returned([^\n]*):\n(.+?) \n"): + result = re.search(regex, self.doc, re.DOTALL) + if result is not None: + doc_lines = result.group(2).split("\n") + self.__output += self._get_arg_doc_list(doc_lines) + + return self.__output + + @property + def ret_info(self): + if self.__ret_info is None: + ret_info = [] + result = re.search("Returned \\(function value\\)([^\n]*):\n(.+?) \n", self.doc, re.DOTALL) + if result is not None: + ret_info.append(ReturnDoc(result.group(2))) + + if len(ret_info) == 0: + self.__ret_info = '' + elif len(ret_info) == 1: + self.__ret_info = ret_info[0] + else: + raise ValueError("Multiple C return sections found in this doc:\n" + self.doc) + + return self.__ret_info + + def __repr__(self): + return self.doc.replace(" \n", "\n") + + +class ArgumentDoc: + + def __init__(self, doc): + match = re.search("^ +([^ ]+)[ ]+([^ ]+)[ ]+(.+)", doc) + if match is not None: + self.name = match.group(1) + self.type = match.group(2) + self.doc = match.group(3) + else: + self.name = None + self.type = None + self.doc = None + + def __repr__(self): + return " {0:15} {1:15} {2}".format(self.name, self.type, self.doc) + + +class Variable: + """Properties shared by Argument and Return.""" + @property + def npy_type(self): + """Predefined type used by numpy ufuncs to indicate a given ctype. + + Eg., NPY_DOUBLE for double. + """ + return "NPY_" + self.ctype.upper() + + @property + def dtype(self): + """Name of dtype corresponding to the ctype. + + Specifically, + double : dt_double + int : dt_int + double[3]: dt_vector + double[2][3] : dt_pv + double[2] : dt_pvdpv + double[3][3] : dt_matrix + int[4] : dt_ymdf | dt_hmsf | dt_dmsf, depding on name + eraASTROM: dt_eraASTROM + eraLDBODY: dt_eraLDBODY + char : dt_sign + char[] : dt_type + + The corresponding dtypes are defined in ufunc.c, where they are + used for the loop definitions. In core.py, they are also used + to view-cast regular arrays to these structured dtypes. + """ + if self.ctype == 'const char': + return 'dt_type' + elif self.ctype == 'char': + return 'dt_sign' + elif self.ctype == 'int' and self.shape == (4,): + return 'dt_' + self.name[1:] + elif self.ctype == 'double' and self.shape == (3,): + return 'dt_double' + elif self.ctype == 'double' and self.shape == (2, 3): + return 'dt_pv' + elif self.ctype == 'double' and self.shape == (2,): + return 'dt_pvdpv' + elif self.ctype == 'double' and self.shape == (3, 3): + return 'dt_double' + elif not self.shape: + return 'dt_' + self.ctype + else: + raise ValueError("ctype {} with shape {} not recognized." + .format(self.ctype, self.shape)) + + @property + def view_dtype(self): + """Name of dtype corresponding to the ctype for viewing back as array. + + E.g., dt_double for double, dt_double33 for double[3][3]. + + The types are defined in core.py, where they are used for view-casts + of structured results as regular arrays. + """ + if self.ctype == 'const char': + return 'dt_bytes12' + elif self.ctype == 'char': + return 'dt_bytes1' + else: + raise ValueError('Only char ctype should need view back!') + + @property + def ndim(self): + return len(self.shape) + + @property + def size(self): + size = 1 + for s in self.shape: + size *= s + return size + + @property + def cshape(self): + return ''.join(['[{0}]'.format(s) for s in self.shape]) + + @property + def signature_shape(self): + if self.ctype == 'eraLDBODY': + return '(n)' + elif self.ctype == 'double' and self.shape == (3,): + return '(d3)' if NUMPY_LT_1_16 else '(3)' + elif self.ctype == 'double' and self.shape == (3, 3): + return '(d3, d3)' if NUMPY_LT_1_16 else '(3, 3)' + else: + return '()' + + +class Argument(Variable): + + def __init__(self, definition, doc): + self.definition = definition + self.doc = doc + self.__inout_state = None + self.ctype, ptr_name_arr = definition.strip().rsplit(" ", 1) + if "*" == ptr_name_arr[0]: + self.is_ptr = True + name_arr = ptr_name_arr[1:] + else: + self.is_ptr = False + name_arr = ptr_name_arr + if "[]" in ptr_name_arr: + self.is_ptr = True + name_arr = name_arr[:-2] + if "[" in name_arr: + self.name, arr = name_arr.split("[", 1) + self.shape = tuple([int(size) for size in arr[:-1].split("][")]) + else: + self.name = name_arr + self.shape = () + + @property + def inout_state(self): + if self.__inout_state is None: + self.__inout_state = '' + for i in self.doc.input: + if self.name in i.name.split(','): + self.__inout_state = 'in' + for o in self.doc.output: + if self.name in o.name.split(','): + if self.__inout_state == 'in': + self.__inout_state = 'inout' + else: + self.__inout_state = 'out' + return self.__inout_state + + @property + def name_for_call(self): + """How the argument should be used in the call to the ERFA function. + + This takes care of ensuring that inputs are passed by value, + as well as adding back the number of bodies for any LDBODY argument. + The latter presumes that in the ufunc inner loops, that number is + called 'nb'. + """ + if self.ctype == 'eraLDBODY': + assert self.name == 'b' + return 'nb, _' + self.name + elif self.is_ptr: + return '_'+self.name + else: + return '*_'+self.name + + def __repr__(self): + return "Argument('{0}', name='{1}', ctype='{2}', inout_state='{3}')".format(self.definition, self.name, self.ctype, self.inout_state) + + +class ReturnDoc: + + def __init__(self, doc): + self.doc = doc + + self.infoline = doc.split('\n')[0].strip() + self.type = self.infoline.split()[0] + self.descr = self.infoline.split()[1] + + if self.descr.startswith('status'): + self.statuscodes = statuscodes = {} + + code = None + for line in doc[doc.index(':')+1:].split('\n'): + ls = line.strip() + if ls != '': + if ' = ' in ls: + code, msg = ls.split(' = ') + if code != 'else': + code = int(code) + statuscodes[code] = msg + elif code is not None: + statuscodes[code] += ls + else: + self.statuscodes = None + + def __repr__(self): + return "Return value, type={0:15}, {1}, {2}".format(self.type, self.descr, self.doc) + + +class Return(Variable): + + def __init__(self, ctype, doc): + self.name = 'c_retval' + self.inout_state = 'stat' if ctype == 'int' else 'ret' + self.ctype = ctype + self.shape = () + self.doc = doc + + def __repr__(self): + return "Return(name='{0}', ctype='{1}', inout_state='{2}')".format(self.name, self.ctype, self.inout_state) + + @property + def doc_info(self): + return self.doc.ret_info + + +class Function: + """ + A class representing a C function. + + Parameters + ---------- + name : str + The name of the function + source_path : str + Either a directory, which means look for the function in a + stand-alone file (like for the standard ERFA distribution), or a + file, which means look for the function in that file (as for the + astropy-packaged single-file erfa.c). + match_line : str, optional + If given, searching of the source file will skip until it finds + a line matching this string, and start from there. + """ + + def __init__(self, name, source_path, match_line=None): + self.name = name + self.pyname = name.split('era')[-1].lower() + self.filename = self.pyname+".c" + if os.path.isdir(source_path): + self.filepath = os.path.join(os.path.normpath(source_path), self.filename) + else: + self.filepath = source_path + + with open(self.filepath) as f: + if match_line: + line = f.readline() + while line != '': + if line.startswith(match_line): + filecontents = '\n' + line + f.read() + break + line = f.readline() + else: + msg = ('Could not find the match_line "{0}" in ' + 'the source file "{1}"') + raise ValueError(msg.format(match_line, self.filepath)) + else: + filecontents = f.read() + + pattern = r"\n([^\n]+{0} ?\([^)]+\)).+?(/\*.+?\*/)".format(name) + p = re.compile(pattern, flags=re.DOTALL | re.MULTILINE) + + search = p.search(filecontents) + self.cfunc = " ".join(search.group(1).split()) + self.doc = FunctionDoc(search.group(2)) + + self.args = [] + for arg in re.search(r"\(([^)]+)\)", self.cfunc).group(1).split(', '): + self.args.append(Argument(arg, self.doc)) + self.ret = re.search("^(.*){0}".format(name), self.cfunc).group(1).strip() + if self.ret != 'void': + self.args.append(Return(self.ret, self.doc)) + + def args_by_inout(self, inout_filter, prop=None, join=None): + """ + Gives all of the arguments and/or returned values, depending on whether + they are inputs, outputs, etc. + + The value for `inout_filter` should be a string containing anything + that arguments' `inout_state` attribute produces. Currently, that can be: + + * "in" : input + * "out" : output + * "inout" : something that's could be input or output (e.g. a struct) + * "ret" : the return value of the C function + * "stat" : the return value of the C function if it is a status code + + It can also be a "|"-separated string giving inout states to OR + together. + """ + result = [] + for arg in self.args: + if arg.inout_state in inout_filter.split('|'): + if prop is None: + result.append(arg) + else: + result.append(getattr(arg, prop)) + if join is not None: + return join.join(result) + else: + return result + + @property + def user_dtype(self): + """The non-standard dtype, if any, needed by this function's ufunc. + + This would be any structured array for any input or output, but + we give preference to LDBODY, since that also decides that the ufunc + should be a generalized ufunc. + """ + user_dtype = None + for arg in self.args_by_inout('in|inout|out'): + if arg.ctype == 'eraLDBODY': + return arg.dtype + elif user_dtype is None and arg.dtype not in ('dt_double', + 'dt_int'): + user_dtype = arg.dtype + + return user_dtype + + @property + def signature(self): + """Possible signature, if this function should be a gufunc.""" + if all(arg.signature_shape == '()' + for arg in self.args_by_inout('in|inout|out')): + return None + + return '->'.join( + [','.join([arg.signature_shape for arg in args]) + for args in (self.args_by_inout('in|inout'), + self.args_by_inout('inout|out|ret|stat'))]) + + def _d3_fix_arg_and_index(self): + if not any('d3' in arg.signature_shape + for arg in self.args_by_inout('in|inout')): + for j, arg in enumerate(self.args_by_inout('out')): + if 'd3' in arg.signature_shape: + return j, arg + + return None, None + + @property + def d3_fix_op_index(self): + """Whether only output arguments have a d3 dimension.""" + index = self._d3_fix_arg_and_index()[0] + if index is not None: + len_in = len(list(self.args_by_inout('in'))) + len_inout = len(list(self.args_by_inout('inout'))) + index += + len_in + 2 * len_inout + return index + + @property + def d3_fix_arg(self): + """Whether only output arguments have a d3 dimension.""" + return self._d3_fix_arg_and_index()[1] + + @property + def python_call(self): + outnames = [arg.name for arg in self.args_by_inout('inout|out|stat|ret')] + argnames = [arg.name for arg in self.args_by_inout('in|inout')] + argnames += [arg.name for arg in self.args_by_inout('inout')] + d3fix_index = self._d3_fix_arg_and_index()[0] + if d3fix_index is not None: + argnames += ['None'] * d3fix_index + [self.d3_fix_arg.name] + return '{out} = {func}({args})'.format(out=', '.join(outnames), + func='ufunc.' + self.pyname, + args=', '.join(argnames)) + + def __repr__(self): + return "Function(name='{0}', pyname='{1}', filename='{2}', filepath='{3}')".format(self.name, self.pyname, self.filename, self.filepath) + + + +class Constant: + + def __init__(self, name, value, doc): + self.name = name.replace("ERFA_", "") + self.value = value.replace("ERFA_", "") + self.doc = doc + + +class ExtraFunction(Function): + """ + An "extra" function - e.g. one not following the SOFA/ERFA standard format. + + Parameters + ---------- + cname : str + The name of the function in C + prototype : str + The prototype for the function (usually derived from the header) + pathfordoc : str + The path to a file that contains the prototype, with the documentation + as a multiline string *before* it. + """ + + def __init__(self, cname, prototype, pathfordoc): + self.name = cname + self.pyname = cname.split('era')[-1].lower() + self.filepath, self.filename = os.path.split(pathfordoc) + + self.prototype = prototype.strip() + if prototype.endswith('{') or prototype.endswith(';'): + self.prototype = prototype[:-1].strip() + + incomment = False + lastcomment = None + with open(pathfordoc, 'r') as f: + for l in f: + if incomment: + if l.lstrip().startswith('*/'): + incomment = False + lastcomment = ''.join(lastcomment) + else: + if l.startswith('**'): + l = l[2:] + lastcomment.append(l) + else: + if l.lstrip().startswith('/*'): + incomment = True + lastcomment = [] + if l.startswith(self.prototype): + self.doc = lastcomment + break + else: + raise ValueError('Did not find prototype {} in file ' + '{}'.format(self.prototype, pathfordoc)) + + self.args = [] + argset = re.search(r"{0}\(([^)]+)?\)".format(self.name), + self.prototype).group(1) + if argset is not None: + for arg in argset.split(', '): + self.args.append(Argument(arg, self.doc)) + self.ret = re.match("^(.*){0}".format(self.name), + self.prototype).group(1).strip() + if self.ret != 'void': + self.args.append(Return(self.ret, self.doc)) + + def __repr__(self): + r = super().__repr__() + if r.startswith('Function'): + r = 'Extra' + r + return r + + +def main(srcdir=DEFAULT_ERFA_LOC, outfn='core.py', ufuncfn='ufunc.c', + templateloc=DEFAULT_TEMPLATE_LOC, extra='erfa_additions.h', + verbose=True): + from jinja2 import Environment, FileSystemLoader + + if verbose: + print_ = lambda *args, **kwargs: print(*args, **kwargs) + else: + print_ = lambda *args, **kwargs: None + + # Prepare the jinja2 templating environment + env = Environment(loader=FileSystemLoader(templateloc)) + + def prefix(a_list, pre): + return [pre+'{0}'.format(an_element) for an_element in a_list] + + def postfix(a_list, post): + return ['{0}'.format(an_element)+post for an_element in a_list] + + def surround(a_list, pre, post): + return [pre+'{0}'.format(an_element)+post for an_element in a_list] + env.filters['prefix'] = prefix + env.filters['postfix'] = postfix + env.filters['surround'] = surround + + erfa_c_in = env.get_template(ufuncfn + '.templ') + erfa_py_in = env.get_template(outfn + '.templ') + + # Extract all the ERFA function names from erfa.h + if os.path.isdir(srcdir): + erfahfn = os.path.join(srcdir, 'erfa.h') + multifilserc = True + else: + erfahfn = os.path.join(os.path.split(srcdir)[0], 'erfa.h') + multifilserc = False + + with open(erfahfn, "r") as f: + erfa_h = f.read() + print_("read erfa header") + if extra: + with open(os.path.join(templateloc or '.', extra), "r") as f: + erfa_h += f.read() + print_("read extra header") + + funcs = OrderedDict() + section_subsection_functions = re.findall( + r'/\* (\w*)/(\w*) \*/\n(.*?)\n\n', erfa_h, + flags=re.DOTALL | re.MULTILINE) + for section, subsection, functions in section_subsection_functions: + print_("{0}.{1}".format(section, subsection)) + # Right now, we compile everything, but one could be more selective. + # In particular, at the time of writing (2018-06-11), what was + # actually require for astropy was not quite everything, but: + # ((section == 'Extra') + # or (section == "Astronomy") + # or (subsection == "AngleOps") + # or (subsection == "SphericalCartesian") + # or (subsection == "MatrixVectorProducts") + # or (subsection == 'VectorOps')) + if True: + + func_names = re.findall(r' (\w+)\(.*?\);', functions, + flags=re.DOTALL) + for name in func_names: + print_("{0}.{1}.{2}...".format(section, subsection, name)) + if multifilserc: + # easy because it just looks in the file itself + cdir = (srcdir if section != 'Extra' else + templateloc or '.') + funcs[name] = Function(name, cdir) + else: + # Have to tell it to look for a declaration matching + # the start of the header declaration, otherwise it + # might find a *call* of the function instead of the + # definition + for line in functions.split(r'\n'): + if name in line: + # [:-1] is to remove trailing semicolon, and + # splitting on '(' is because the header and + # C files don't necessarily have to match + # argument names and line-breaking or + # whitespace + match_line = line[:-1].split('(')[0] + funcs[name] = Function(name, cdir, match_line) + break + else: + raise ValueError("A name for a C file wasn't " + "found in the string that " + "spawned it. This should be " + "impossible!") + + funcs = funcs.values() + + # Extract all the ERFA constants from erfam.h + erfamhfn = os.path.join(srcdir, 'erfam.h') + with open(erfamhfn, 'r') as f: + erfa_m_h = f.read() + constants = [] + for chunk in erfa_m_h.split("\n\n"): + result = re.findall(r"#define (ERFA_\w+?) (.+?)$", chunk, + flags=re.DOTALL | re.MULTILINE) + if result: + doc = re.findall(r"/\* (.+?) \*/\n", chunk, flags=re.DOTALL) + for (name, value) in result: + constants.append(Constant(name, value, doc)) + + # TODO: re-enable this when const char* return values and + # non-status code integer rets are possible + # #Add in any "extra" functions from erfaextra.h + # erfaextrahfn = os.path.join(srcdir, 'erfaextra.h') + # with open(erfaextrahfn, 'r') as f: + # for l in f: + # ls = l.strip() + # match = re.match('.* (era.*)\(', ls) + # if match: + # print_("Extra: {0} ...".format(match.group(1))) + # funcs.append(ExtraFunction(match.group(1), ls, erfaextrahfn)) + + print_("Rendering template") + erfa_c = erfa_c_in.render(funcs=funcs, NUMPY_LT_1_16=NUMPY_LT_1_16) + erfa_py = erfa_py_in.render(funcs=funcs, constants=constants, + NUMPY_LT_1_16=NUMPY_LT_1_16) + + if outfn is not None: + print_("Saving to", outfn, 'and', ufuncfn) + with open(os.path.join(templateloc, outfn), "w") as f: + f.write(erfa_py) + with open(os.path.join(templateloc, ufuncfn), "w") as f: + f.write(erfa_c) + + print_("Done!") + + return erfa_c, erfa_py, funcs + + +if __name__ == '__main__': + from argparse import ArgumentParser + + ap = ArgumentParser() + ap.add_argument('srcdir', default=DEFAULT_ERFA_LOC, nargs='?', + help='Directory where the ERFA c and header files ' + 'can be found or to a single erfa.c file ' + '(which must be in the same directory as ' + 'erfa.h). Defaults to the builtin astropy ' + 'erfa: "{0}"'.format(DEFAULT_ERFA_LOC)) + ap.add_argument('-o', '--output', default='core.py', + help='The output filename for the pure-python output.') + ap.add_argument('-u', '--ufunc', default='ufunc.c', + help='The output filename for the ufunc .c output') + ap.add_argument('-t', '--template-loc', + default=DEFAULT_TEMPLATE_LOC, + help='the location where the "core.py.templ" and ' + '"ufunc.c.templ templates can be found.') + ap.add_argument('-x', '--extra', + default='erfa_additions.h', + help='header file for any extra files in the template ' + 'location that should be included.') + ap.add_argument('-q', '--quiet', action='store_false', dest='verbose', + help='Suppress output normally printed to stdout.') + + args = ap.parse_args() + main(args.srcdir, args.output, args.ufunc, args.template_loc, + args.extra) diff --git a/testbed/astropy__astropy/astropy/_erfa/pav2pv.c b/testbed/astropy__astropy/astropy/_erfa/pav2pv.c new file mode 100644 index 0000000000000000000000000000000000000000..4df4161e148a5bb37f74916099f9652f4fef4885 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/pav2pv.c @@ -0,0 +1,30 @@ +#include "erfa.h" + +void eraPav2pv(double p[3], double v[3], double pv[2][3]) +/* +** - - - - - - - - - - +** e r a P a v 2 p v +** - - - - - - - - - - +** +** Extend a p-vector to a pv-vector by appending a zero velocity. +** +** Given: +** p double[3] p-vector +** v double[3] v-vector +** +** Returned: +** pv double[2][3] pv-vector +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(p, pv[0]); + eraCp(v, pv[1]); + + return; + +} diff --git a/testbed/astropy__astropy/astropy/_erfa/pv2pav.c b/testbed/astropy__astropy/astropy/_erfa/pv2pav.c new file mode 100644 index 0000000000000000000000000000000000000000..c00c21f6c9858fac5b885e4ebe8bbfb32de0afde --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/pv2pav.c @@ -0,0 +1,30 @@ +#include "erfa.h" + +void eraPv2pav(double pv[2][3], double p[3], double v[3]) +/* +** - - - - - - - - - +** e r a P v 2 p a v +** - - - - - - - - - +** +** Extend a p-vector to a pv-vector by appending a zero velocity. +** +** Given: +** pv double[2][3] pv-vector +** +** Returned: +** p double[3] p-vector +** v double[3] v-vector +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(pv[0], p); + eraCp(pv[1], v); + + return; + +} diff --git a/testbed/astropy__astropy/astropy/_erfa/setup_package.py b/testbed/astropy__astropy/astropy/_erfa/setup_package.py new file mode 100644 index 0000000000000000000000000000000000000000..f1fc572b30381a8ffb68816bdee6cbf8080bf411 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/setup_package.py @@ -0,0 +1,108 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import os +import glob + +from distutils import log +from distutils.extension import Extension + +from astropy_helpers import setup_helpers +from astropy_helpers.utils import import_file +from astropy_helpers.version_helpers import get_pkg_version_module + +ERFAPKGDIR = os.path.relpath(os.path.dirname(__file__)) + +ERFA_SRC = os.path.abspath(os.path.join(ERFAPKGDIR, '..', '..', + 'cextern', 'erfa')) + +SRC_FILES = glob.glob(os.path.join(ERFA_SRC, '*')) +SRC_FILES += [os.path.join(ERFAPKGDIR, filename) + for filename in ['pav2pv.c', 'pv2pav.c', 'erfa_additions.h', + 'ufunc.c.templ', 'core.py.templ', + 'erfa_generator.py']] + +GEN_FILES = [os.path.join(ERFAPKGDIR, 'core.py'), + os.path.join(ERFAPKGDIR, 'ufunc.c')] + + +def pre_build_py_hook(cmd_obj): + preprocess_source() + + +def pre_build_ext_hook(cmd_obj): + preprocess_source() + + +def pre_sdist_hook(cmd_obj): + preprocess_source() + + +def preprocess_source(): + # Generating the ERFA wrappers should only be done if needed. This also + # ensures that it is not done for any release tarball since those will + # include core.py and ufunc.c. + if all(os.path.exists(filename) for filename in GEN_FILES): + + # Determine modification times + erfa_mtime = max(os.path.getmtime(filename) for filename in SRC_FILES) + gen_mtime = min(os.path.getmtime(filename) for filename in GEN_FILES) + + version = import_file(os.path.join(ERFAPKGDIR, '..', 'version.py')) + + if gen_mtime > erfa_mtime: + # If generated source is recent enough, don't update + return + elif version.release: + # or, if we're on a release, issue a warning, but go ahead and use + # the wrappers anyway + log.warn('WARNING: The autogenerated wrappers in astropy._erfa ' + 'seem to be older than the source templates used to ' + 'create them. Because this is a release version we will ' + 'use them anyway, but this might be a sign of some sort ' + 'of version mismatch or other tampering. Or it might just ' + 'mean you moved some files around or otherwise ' + 'accidentally changed timestamps.') + return + # otherwise rebuild the autogenerated files + + # If jinja2 isn't present, then print a warning and use existing files + try: + import jinja2 # pylint: disable=W0611 + except ImportError: + log.warn("WARNING: jinja2 could not be imported, so the existing " + "ERFA core.py and ufunc.c files will be used") + return + + gen = import_file(os.path.join(ERFAPKGDIR, 'erfa_generator.py')) + + gen.main(verbose=False) + + +def get_extensions(): + sources = [os.path.join(ERFAPKGDIR, fn) + for fn in ("ufunc.c", "pav2pv.c", "pv2pav.c")] + include_dirs = ['numpy'] + libraries = [] + + if setup_helpers.use_system_library('erfa'): + libraries.append('erfa') + else: + # get all of the .c files in the cextern/erfa directory + erfafns = os.listdir(ERFA_SRC) + sources.extend(['cextern/erfa/' + fn + for fn in erfafns if fn.endswith('.c')]) + + include_dirs.append('cextern/erfa') + + erfa_ext = Extension( + name="astropy._erfa.ufunc", + sources=sources, + include_dirs=include_dirs, + libraries=libraries, + language="c",) + + return [erfa_ext] + + +def get_external_libraries(): + return ['erfa'] diff --git a/testbed/astropy__astropy/astropy/_erfa/tests/__init__.py b/testbed/astropy__astropy/astropy/_erfa/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dce85d06f83264a6e502be0906d86bd976e1677 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/tests/__init__.py @@ -0,0 +1 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst diff --git a/testbed/astropy__astropy/astropy/_erfa/tests/test_erfa.py b/testbed/astropy__astropy/astropy/_erfa/tests/test_erfa.py new file mode 100644 index 0000000000000000000000000000000000000000..9f9beae75a98f0aee33b3e537d69e54a0d8defa1 --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/tests/test_erfa.py @@ -0,0 +1,240 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import numpy as np + +from astropy._erfa import core as erfa +from astropy.tests.helper import catch_warnings + + +def test_erfa_wrapper(): + """ + Runs a set of tests that mostly make sure vectorization is + working as expected + """ + + jd = np.linspace(2456855.5, 2456855.5+1.0/24.0/60.0, 60*2+1) + ra = np.linspace(0.0, np.pi*2.0, 5) + dec = np.linspace(-np.pi/2.0, np.pi/2.0, 4) + + aob, zob, hob, dob, rob, eo = erfa.atco13(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, jd, 0.0, 0.0, 0.0, np.pi/4.0, 0.0, 0.0, 0.0, 1014.0, 0.0, 0.0, 0.5) + assert aob.shape == (121,) + + aob, zob, hob, dob, rob, eo = erfa.atco13(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, jd[0], 0.0, 0.0, 0.0, np.pi/4.0, 0.0, 0.0, 0.0, 1014.0, 0.0, 0.0, 0.5) + assert aob.shape == () + + aob, zob, hob, dob, rob, eo = erfa.atco13(ra[:, None, None], dec[None, :, None], 0.0, 0.0, 0.0, 0.0, jd[None, None, :], 0.0, 0.0, 0.0, np.pi/4.0, 0.0, 0.0, 0.0, 1014.0, 0.0, 0.0, 0.5) + (aob.shape) == (5, 4, 121) + + iy, im, id, ihmsf = erfa.d2dtf("UTC", 3, jd, 0.0) + assert iy.shape == (121,) + assert ihmsf.shape == (121,) + assert ihmsf.dtype == erfa.dt_hmsf + + iy, im, id, ihmsf = erfa.d2dtf("UTC", 3, jd[0], 0.0) + assert iy.shape == () + assert ihmsf.shape == () + assert ihmsf.dtype == erfa.dt_hmsf + + +def test_angle_ops(): + + sign, idmsf = erfa.a2af(6, -np.pi) + assert sign == b'-' + assert idmsf.item() == (180, 0, 0, 0) + + sign, ihmsf = erfa.a2tf(6, np.pi) + assert sign == b'+' + assert ihmsf.item() == (12, 0, 0, 0) + + rad = erfa.af2a('-', 180, 0, 0.0) + np.testing.assert_allclose(rad, -np.pi) + + rad = erfa.tf2a('+', 12, 0, 0.0) + np.testing.assert_allclose(rad, np.pi) + + rad = erfa.anp(3.*np.pi) + np.testing.assert_allclose(rad, np.pi) + + rad = erfa.anpm(3.*np.pi) + np.testing.assert_allclose(rad, -np.pi) + + sign, ihmsf = erfa.d2tf(1, -1.5) + assert sign == b'-' + assert ihmsf.item() == (36, 0, 0, 0) + + days = erfa.tf2d('+', 3, 0, 0.0) + np.testing.assert_allclose(days, 0.125) + + +def test_spherical_cartesian(): + + theta, phi = erfa.c2s([0.0, np.sqrt(2.0), np.sqrt(2.0)]) + np.testing.assert_allclose(theta, np.pi/2.0) + np.testing.assert_allclose(phi, np.pi/4.0) + + theta, phi, r = erfa.p2s([0.0, np.sqrt(2.0), np.sqrt(2.0)]) + np.testing.assert_allclose(theta, np.pi/2.0) + np.testing.assert_allclose(phi, np.pi/4.0) + np.testing.assert_allclose(r, 2.0) + + pv = np.array(([0.0, np.sqrt(2.0), np.sqrt(2.0)], [1.0, 0.0, 0.0]), + dtype=erfa.dt_pv) + theta, phi, r, td, pd, rd = erfa.pv2s(pv) + np.testing.assert_allclose(theta, np.pi/2.0) + np.testing.assert_allclose(phi, np.pi/4.0) + np.testing.assert_allclose(r, 2.0) + np.testing.assert_allclose(td, -np.sqrt(2.0)/2.0) + np.testing.assert_allclose(pd, 0.0) + np.testing.assert_allclose(rd, 0.0) + + c = erfa.s2c(np.pi/2.0, np.pi/4.0) + np.testing.assert_allclose(c, [0.0, np.sqrt(2.0)/2.0, np.sqrt(2.0)/2.0], atol=1e-14) + + c = erfa.s2p(np.pi/2.0, np.pi/4.0, 1.0) + np.testing.assert_allclose(c, [0.0, np.sqrt(2.0)/2.0, np.sqrt(2.0)/2.0], atol=1e-14) + + pv = erfa.s2pv(np.pi/2.0, np.pi/4.0, 2.0, np.sqrt(2.0)/2.0, 0.0, 0.0) + np.testing.assert_allclose(pv['p'], [0.0, np.sqrt(2.0), np.sqrt(2.0)], atol=1e-14) + np.testing.assert_allclose(pv['v'], [-1.0, 0.0, 0.0], atol=1e-14) + + +def test_errwarn_reporting(): + """ + Test that the ERFA error reporting mechanism works as it should + """ + + # no warning + erfa.dat(1990, 1, 1, 0.5) + + # check warning is raised for a scalar + with catch_warnings() as w: + erfa.dat(100, 1, 1, 0.5) + assert len(w) == 1 + assert w[0].category == erfa.ErfaWarning + assert '1 of "dubious year (Note 1)"' in str(w[0].message) + + # and that the count is right for a vector. + with catch_warnings() as w: + erfa.dat([100, 200, 1990], 1, 1, 0.5) + assert len(w) == 1 + assert w[0].category == erfa.ErfaWarning + assert '2 of "dubious year (Note 1)"' in str(w[0].message) + + try: + erfa.dat(1990, [1, 34, 2], [1, 1, 43], 0.5) + except erfa.ErfaError as e: + if '1 of "bad day (Note 3)", 1 of "bad month"' not in e.args[0]: + assert False, 'Raised the correct type of error, but wrong message: ' + e.args[0] + + try: + erfa.dat(200, [1, 34, 2], [1, 1, 43], 0.5) + except erfa.ErfaError as e: + if 'warning' in e.args[0]: + assert False, 'Raised the correct type of error, but there were warnings mixed in: ' + e.args[0] + + +def test_vector_inouts(): + """ + Tests that ERFA functions working with vectors are correctly consumed and spit out + """ + + # values are from test_erfa.c t_ab function + pnat = [-0.76321968546737951, + -0.60869453983060384, + -0.21676408580639883] + v = [2.1044018893653786e-5, + -8.9108923304429319e-5, + -3.8633714797716569e-5] + s = 0.99980921395708788 + bm1 = 0.99999999506209258 + + expected = [-0.7631631094219556269, + -0.6087553082505590832, + -0.2167926269368471279] + + res = erfa.ab(pnat, v, s, bm1) + assert res.shape == (3,) + + np.testing.assert_allclose(res, expected) + + res2 = erfa.ab([pnat]*4, v, s, bm1) + assert res2.shape == (4, 3) + np.testing.assert_allclose(res2, [expected]*4) + + # here we stride an array and also do it Fortran-order to make sure + # it all still works correctly with non-contig arrays + pnata = np.array(pnat) + arrin = np.array([pnata, pnata/2, pnata/3, pnata/4, pnata/5]*4, order='F') + res3 = erfa.ab(arrin[::5], v, s, bm1) + assert res3.shape == (4, 3) + np.testing.assert_allclose(res3, [expected]*4) + + +def test_pv_in(): + jd1 = 2456165.5 + jd2 = 0.401182685 + + pv = np.empty((), dtype=erfa.dt_pv) + pv['p'] = [-6241497.16, + 401346.896, + -1251136.04] + pv['v'] = [-29.264597, + -455.021831, + 0.0266151194] + + astrom = erfa.apcs13(jd1, jd2, pv) + assert astrom.shape == () + + # values from t_erfa_c + np.testing.assert_allclose(astrom['pmt'], 12.65133794027378508) + np.testing.assert_allclose(astrom['em'], 1.010428384373318379) + np.testing.assert_allclose(astrom['eb'], [0.9012691529023298391, + -.4173999812023068781, + -.1809906511146821008]) + np.testing.assert_allclose(astrom['bpn'], np.eye(3)) + + # first make sure it *fails* if we mess with the input orders + pvbad = np.empty_like(pv) + pvbad['p'], pvbad['v'] = pv['v'], pv['p'] + astrombad = erfa.apcs13(jd1, jd2, pvbad) + assert not np.allclose(astrombad['em'], 1.010428384373318379) + + pvarr = np.array([pv]*3) + astrom2 = erfa.apcs13(jd1, jd2, pvarr) + assert astrom2.shape == (3,) + np.testing.assert_allclose(astrom2['em'], 1.010428384373318379) + + # try striding of the input array to make non-contiguous + pvmatarr = np.array([pv]*9)[::3] + astrom3 = erfa.apcs13(jd1, jd2, pvmatarr) + assert astrom3.shape == (3,) + np.testing.assert_allclose(astrom3['em'], 1.010428384373318379) + + +def test_structs(): + """ + Checks producing and consuming of ERFA c structs + """ + + am, eo = erfa.apci13(2456165.5, [0.401182685, 1]) + assert am.shape == (2, ) + assert am.dtype == erfa.dt_eraASTROM + assert eo.shape == (2, ) + + # a few spotchecks from test_erfa.c + np.testing.assert_allclose(am[0]['pmt'], 12.65133794027378508) + np.testing.assert_allclose(am[0]['v'], [0.4289638897157027528e-4, + 0.8115034002544663526e-4, + 0.3517555122593144633e-4]) + + ri, di = erfa.atciqz(2.71, 0.174, am[0]) + np.testing.assert_allclose(ri, 2.709994899247599271) + np.testing.assert_allclose(di, 0.1728740720983623469) + + +def test_float32_input(): + # Regression test for gh-8615 + xyz = np.array([[1, 0, 0], [0.9, 0.1, 0]]) + out64 = erfa.p2s(xyz) + out32 = erfa.p2s(xyz.astype('f4')) + np.testing.assert_allclose(out32, out64, rtol=1.e-5) diff --git a/testbed/astropy__astropy/astropy/_erfa/ufunc.c.templ b/testbed/astropy__astropy/astropy/_erfa/ufunc.c.templ new file mode 100644 index 0000000000000000000000000000000000000000..1868c92c9441a861bb2db5e068bead6320e7329c --- /dev/null +++ b/testbed/astropy__astropy/astropy/_erfa/ufunc.c.templ @@ -0,0 +1,852 @@ +/* -*- mode: c -*- */ + +/* Licensed under a 3-clause BSD style license - see LICENSE.rst */ + +/* + * "ufunc.c" is auto-generated by erfa_generator.py from the template + * "ufunc.c.templ". Do *not* edit "ufunc.c" directly, instead edit + * "ufunc.c.templ" and run ufunc_generator.py from the source directory + * to update it. + */ + +#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION +#include "Python.h" +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "erfa.h" +#include "erfa_additions.h" + +#define MODULE_DOCSTRING \ + "Ufunc wrappers of the ERFA routines.\n\n" \ + "These ufuncs vectorize the ERFA functions assuming structured dtypes\n" \ + "for vector and matrix arguments. Status codes are vectors as well.\n" \ + "Python wrappers are also provided, which convert between\n" \ + "trailing dimensions and structured dtypes where necessary,\n" \ + "and combine status codes." + +static inline void copy_to_double3(char *ptr, npy_intp s, double d[3]) { + char *p = ptr; + int j; + for (j = 0; j < 3; j++, p += s) { + d[j] = *(double *)p; + } +} + +static inline void copy_from_double3(char *ptr, npy_intp s, double d[3]) { + char *p = ptr; + int j; + for (j = 0; j < 3; j++, p += s) { + *(double *)p = d[j]; + } +} + +static inline void copy_to_double33(char *ptr, npy_intp s0, npy_intp s1, + double d[3][3]) { + char *p0 = ptr; + int j0, j1; + for (j0 = 0; j0 < 3; j0++, p0 += s0) { + char *p1 = p0; + for (j1 = 0; j1 < 3; j1++, p1 += s1) { + d[j0][j1] = *(double *)p1; + } + } +} + +static inline void copy_from_double33(char *ptr, npy_intp s0, npy_intp s1, + double d[3][3]) { + char *p = ptr; + char *p0 = ptr; + int j0, j1; + for (j0 = 0; j0 < 3; j0++, p0 += s0) { + char *p1 = p0; + for (j1 = 0; j1 < 3; j1++, p1 += s1) { + *(double *)p = d[j0][j1]; + } + } +} + +/* eraLDBODY is never returned, so we do not need a copy_from */ +static inline void copy_to_eraLDBODY(char *ptr, npy_intp s, npy_intp n, + eraLDBODY b[]) { + char *p = ptr; + npy_intp j; + for (j = 0; j < n; j++, p += s) { + b[j] = *(eraLDBODY *)p; + } +} + +/* + * INNER LOOPS - iteratively call the erfa function for a chunk of data. + * + * For each argument: + * char * is the pointer to the data in memory; + * npy_intp s_ is the number of bytes between successive elements; + * *_ is a correctly cast pointer to the current element; + * ( _, i.e., not a pointer, for status codes and return values) + * + * Notes: + * 1. Some erfa function change elements in-place; in the ufunc, these "inout" + * arguments are treated as separate: data is copied from the input to the + * output, and the output is changed in-place by the erfa function. + * To reproduce the in-place behaviour, the input to the ufunc can be passed + * in as output as well -- as is done in the python wrapper (the copy will + * be omitted for this case). + * 2. Any erfa function involving light deflection requires an struct + * eraLDBODY argument with a dimension that is user-defined. Those function + * are implemented as generalized ufuncs, with a signature in which the + * relevant variable is marked (i.e., '(),...,(n), (), ... -> (),...'). + * In the inner loops, an appropriate copy is done if in the numpy array + * the n elements are not contiguous. + * 3. Similar copies are done for erfa functions that require vectors or + * matrices, if the corresponding axes in the input or output operands are + * not contiguous. + */ + +{%- macro inner_loop_steps_and_copy(arg, arg_name) %} + {%- for i in range(arg.ndim or 1) %} + npy_intp is_{{ arg_name }}{{ i }} = *steps++; + {%- endfor %} + {#- /* copy should be made if buffer not contiguous; + note: one can only have 1 or 2 dimensions */ #} + {%- if arg.ndim == 2 %} + int copy_{{ arg_name + }} = (is_{{ arg_name }}1 != sizeof({{ arg.ctype }}) && + is_{{ arg_name }}0 != {{ arg.shape[1] }} * sizeof({{ arg.ctype }})); + {%- else %} + int copy_{{ arg_name }} = (is_{{ arg_name }}0 != sizeof({{ arg.ctype }})); + {%- endif %} +{%- endmacro %} + +{%- for func in funcs %} + +static void ufunc_loop_{{ func.pyname }}( + char **args, npy_intp *dimensions, npy_intp* steps, void* data) +{ + {#- /* index and length of loop */ #} + npy_intp i_o; + npy_intp n_o = *dimensions++; + {#- /* + * Pointers to each argument, required step size + */ #} + {#- /* normal input arguments */ #} + {%- for arg in func.args_by_inout('in') %} + char *{{ arg.name }} = *args++; + npy_intp s_{{ arg.name }} = *steps++; + {%- endfor -%} + {#- /* for in part of in-place arguments, we need a different name */ #} + {%- for arg in func.args_by_inout('inout') %} + char *{{ arg.name }}_in = *args++; + npy_intp s_{{ arg.name }}_in = *steps++; + {%- endfor -%} + {#- /* out part of input, and output arguments, including status */ #} + {%- for arg in func.args_by_inout('inout|out|stat|ret') %} + char *{{ arg.name }} = *args++; + npy_intp s_{{ arg.name }} = *steps++; + {%- endfor -%} + {#- /* + * Cast pointers and possible contiguous buffers (for gufuncs) + */ #} + {%- for arg in func.args_by_inout('in|inout|out') %} + {%- if arg.signature_shape == '()' or arg.ctype == 'eraLDBODY' %} + {{ arg.ctype }} (*_{{ arg.name }}){{ arg.cshape }}; + {%- else %} + double b_{{ arg.name }}{{ arg.cshape }}; + {{ arg.ctype }} (*_{{ arg.name }}){{ arg.cshape }} = &b_{{ arg.name }}; + {%- endif %} + {%- endfor %} + {#- /* variables to hold status and return values */ #} + {%- for arg in func.args_by_inout('stat|ret') %} + {{ arg.ctype }} _{{ arg.name }}; + {%- endfor %} + {#- /* + * For GENERALIZED UFUNCS - inner loop steps, needs for copying. + */ #} + {%- if func.signature %} + {#- /* loop step sizes and whether copies are needed */ #} + {%- for arg in func.args_by_inout('in') %} + {#- /* only LDBODY has non-fixed dimension; it is always first */ #} + {%- if arg.ctype == 'eraLDBODY' %} + npy_intp nb = dimensions[0]; + {%- endif %} + {%- if arg.signature_shape != '()' -%} + {{ inner_loop_steps_and_copy(arg, arg.name) }} + {%- endif %} + {%- endfor %} + {%- for arg in func.args_by_inout('inout') %} + {%- if arg.signature_shape != '()' -%} + {{ inner_loop_steps_and_copy(arg, arg.name + '_in') }} + {%- endif %} + {%- endfor %} + {%- for arg in func.args_by_inout('inout|out') %} + {%- if arg.signature_shape != '()' -%} + {{ inner_loop_steps_and_copy(arg, arg.name) }} + {%- endif %} + {%- endfor %} + {#- /* if needed, allocate memory for contiguous eraLDBODY copies */ #} + {%- if func.user_dtype == 'dt_eraLDBODY' %} + if (copy_b) { + _b = PyArray_malloc(nb * sizeof(eraLDBODY)); + if (_b == NULL) { + PyErr_NoMemory(); + return; + } + } + else { {#- /* just to keep compiler happy */ #} + _b = NULL; + } + {%- endif %} + {%- endif %} {#- /* end of GUFUNC inner loop definitions */ #} + {#- /* + * Actual inner loop, increasing all pointers by their steps + */ #} + for (i_o = 0; i_o < n_o; + i_o++ {%- for arg in func.args_by_inout('in|inout|out|stat|ret') -%} + , {{ arg.name }} += s_{{ arg.name }} + {%- endfor -%} + {%- for arg in func.args_by_inout('inout') -%} + , {{ arg.name }}_in += s_{{ arg.name }}_in + {%- endfor -%}) { + {%- if func.signature %} + {#- /* + * GENERALIZED UFUNC, prepare for call. + */ #} + {#- /* copy input arguments to buffer if needed */ #} + {%- for arg in func.args_by_inout('in') %} + {%- if arg.signature_shape != '()' %} + if (copy_{{ arg.name }}) { + copy_to_{{ arg.ctype }}{{ arg.shape|join('') }}({{ arg.name }} + {%- for i in range(arg.ndim or 1) -%} + , is_{{ arg.name }}{{ i }} + {%- endfor %}, {{ arg.name_for_call}}); + } + else { + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + } + {%- else %} + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + {%- endif %} + {%- endfor %} {#- end of loop over 'in' #} + {#- /* for inout arguments, set up output first, + and then copy to it if needed */ #} + {%- for arg in func.args_by_inout('inout') %} + {%- if arg.signature_shape != '()' %} + if (!copy_{{ arg.name }}) { + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + } + if (copy_{{ arg.name }}_in || {{ arg.name }} != {{ arg.name }}_in) { + copy_to_{{ arg.ctype }}{{ arg.shape|join('') }}({{ arg.name }}_in + {%- for i in range(arg.ndim or 1) -%} + , is_{{ arg.name }}_in{{ i }} + {%- endfor %}, {{ arg.name_for_call}}); + } + {%- else %} + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + if ({{ arg.name }}_in != {{ arg.name }}) { + memcpy({{ arg.name }}, {{ arg.name }}_in, {{ arg.size }}*sizeof({{ arg.ctype }})); + } + {%- endif %} + {%- endfor %} {#- end of loop over 'inout' #} + {#- /* set up gufunc outputs */ #} + {%- for arg in func.args_by_inout('out') %} + {%- if arg.signature_shape != '()' %} + if (!copy_{{ arg.name }}) { + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + } + {%- else %} + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + {%- endif %} + {%- endfor %} {#- end of loop over 'out' #} + {%- else %} + {#- /* + * NORMAL UFUNC, prepare for call + */ #} + {#- /* set up pointers to input/output arguments */ #} + {%- for arg in func.args_by_inout('in|inout|out') %} + _{{ arg.name }} = (({{ arg.ctype }} (*){{ arg.cshape }}){{ arg.name }}); + {%- endfor %} + {#- /* copy from in to out for arugments changed in-place */ #} + {%- for arg in func.args_by_inout('inout') %} + if ({{ arg.name }}_in != {{ arg.name }}) { + memcpy({{ arg.name }}, {{ arg.name }}_in, {{ arg.size }}*sizeof({{ arg.ctype }})); + } + {%- endfor %} + {%- endif %} {#- end of gufunc/ufunc preparation #} + {#- /* + * call the actual erfa function + */ #} + {{ func.args_by_inout('ret|stat') | + map(attribute='name') | + surround('_', ' = ') | + join + }}{{ func.name + }}({{ func.args_by_inout('in|inout|out') | + map(attribute='name_for_call') | + join(', ') }}); + {#- /* store any return values */ #} + {%- for arg in func.args_by_inout('ret|stat') %} + *(({{ arg.ctype }} *){{ arg.name }}) = _{{ arg.name }}; + {%- endfor %} + {%- if func.signature %} + {#- /* for generalized ufunc, copy output from buffer if needed */ #} + {%- for arg in func.args_by_inout('inout|out') %} + {%- if arg.signature_shape != '()' %} + if (copy_{{ arg.name }}) { + copy_from_{{ arg.ctype }}{{ arg.shape|join('') }}({{ arg.name }} + {%- for i in range(arg.ndim or 1) -%} + , is_{{ arg.name }}{{ i }} + {%- endfor %}, {{ arg.name_for_call}}); + } + {%- endif %} + {%- endfor %} + {%- endif %} + } + {%- if func.user_dtype == 'dt_eraLBODY' %} + if (copy_b) { + PyArray_free(_b); + } + {%- endif %} +} + +{%- endfor %} + +/* + * UFUNC LOOP MATCHING HELPERS + * All but ufunc_loop_matches are copies of code needed but not exported. + */ + +/* + * Adjusted version of ufunc_loop_matches from + * numpy/core/src/umath/ufunc_type_resolution.c. + * Here, we special-case the structured dtype check, only allowing + * casting of the same dtype or string. We also do not distinguish + * between input and output arguments for casting. + */ +static int +ufunc_loop_matches(PyUFuncObject *self, + PyArrayObject **op, + NPY_CASTING casting, + int *types, PyArray_Descr **dtypes) +{ + npy_intp i, nin = self->nin, nop = nin + self->nout; + /* + * Check if all the inputs can be cast to the types used by this function. + */ + for (i = 0; i < nin; ++i) { + PyArray_Descr *op_descr = PyArray_DESCR(op[i]); + /* + * Check for NPY_VOID with an associated struct dtype. + */ + if (types[i] == NPY_VOID && dtypes != NULL) { + int op_descr_type_num = op_descr->type_num; + int dtype_elsize = dtypes[i]->elsize; + /* + * MHvK: we do our own check on casting, since by default + * all items can cast to structured dtypes (see gh-11114), + * which is not OK. So, we only allow VOID->same VOID, + * and STRING -> VOID-of-STRING (which works well; we + * recognize VOID-of-STRING by the dtype element size; + * it would be rather costly to go look at dtype->fields). + */ + if (op_descr_type_num == NPY_VOID) { + /* allow only the same structured to structured */ + if (!PyArray_EquivTypes(op_descr, dtypes[i])) { + return 0; + } + } + else if (dtypes[i]->elsize == 1 || dtypes[i]->elsize == 12) { + /* string structured array; string argument is OK */ + if (!((op_descr_type_num == NPY_STRING && + op_descr->elsize <= dtype_elsize) || + (op_descr_type_num == NPY_UNICODE && + op_descr->elsize >> 2 <= dtype_elsize))) { + return 0; + } + } + else { + return 0; + } + } + else { /* non-void function argument */ + PyArray_Descr *tmp = PyArray_DescrFromType(types[i]); + if (tmp == NULL) { + return -1; + } + if (!PyArray_CanCastTypeTo(op_descr, tmp, casting)) { + Py_DECREF(tmp); + return 0; + } + Py_DECREF(tmp); + } + } + /* + * All inputs were ok; now check casting back to the outputs. + * MHvK: Since no casting from structured to non-structured is + * possible, no changes needed here. + */ + for (i = nin; i < nop; ++i) { + if (op[i] != NULL) { + PyArray_Descr *tmp = PyArray_DescrFromType(types[i]); + if (tmp == NULL) { + return -1; + } + if (!PyArray_CanCastTypeTo(tmp, PyArray_DESCR(op[i]), + casting)) { + Py_DECREF(tmp); + return 0; + } + Py_DECREF(tmp); + } + } + return 1; +} +/* + * Copy from numpy/core/src/umath/ufunc_type_resolution.c, + * since this translation function is not exported. + */ +static const char * +npy_casting_to_string(NPY_CASTING casting) +{ + switch (casting) { + case NPY_NO_CASTING: + return "'no'"; + case NPY_EQUIV_CASTING: + return "'equiv'"; + case NPY_SAFE_CASTING: + return "'safe'"; + case NPY_SAME_KIND_CASTING: + return "'same_kind'"; + case NPY_UNSAFE_CASTING: + return "'unsafe'"; + default: + return ""; + } +} + +/* + * Copy from numpy/core/src/umath/ufunc_type_resolution.c, + * since not exported. + */ +static PyArray_Descr * +ensure_dtype_nbo(PyArray_Descr *type) +{ + if (PyArray_ISNBO(type->byteorder)) { + Py_INCREF(type); + return type; + } + else { + return PyArray_DescrNewByteorder(type, NPY_NATIVE); + } +} + +/* + * Copy from numpy/core/src/umath/ufunc_type_resolution.c, + * since not exported. + */ +static int +set_ufunc_loop_data_types(PyUFuncObject *self, PyArrayObject **op, + PyArray_Descr **out_dtypes, + int *type_nums, PyArray_Descr **dtypes) +{ + int i, nin = self->nin, nop = nin + self->nout; + + /* + * Fill the dtypes array. + * For outputs, + * also search the inputs for a matching type_num to copy + * instead of creating a new one, similarly to preserve metadata. + **/ + for (i = 0; i < nop; ++i) { + if (dtypes != NULL) { + out_dtypes[i] = dtypes[i]; + Py_XINCREF(out_dtypes[i]); + /* + * Copy the dtype from 'op' if the type_num matches, + * to preserve metadata. + */ + } + else if (op[i] != NULL && + PyArray_DESCR(op[i])->type_num == type_nums[i]) { + out_dtypes[i] = ensure_dtype_nbo(PyArray_DESCR(op[i])); + } + /* + * For outputs, copy the dtype from op[0] if the type_num + * matches, similarly to preserve metdata. + */ + else if (i >= nin && op[0] != NULL && + PyArray_DESCR(op[0])->type_num == type_nums[i]) { + out_dtypes[i] = ensure_dtype_nbo(PyArray_DESCR(op[0])); + } + /* Otherwise create a plain descr from the type number */ + else { + out_dtypes[i] = PyArray_DescrFromType(type_nums[i]); + } + + if (out_dtypes[i] == NULL) { + goto fail; + } + } + + return 0; + +fail: + while (--i >= 0) { + Py_DECREF(out_dtypes[i]); + out_dtypes[i] = NULL; + } + return -1; +} + +/* + * UFUNC TYPE RESOLVER + * + * We provide our own type resolver, since the default one, + * PyUFunc_DefaultTypeResolver from + * numpy/core/src/umath/ufunc_type_resolution.c, has problems: + * 1. It only looks for userloops if any of the operands have a user + * type, which does not work if the inputs are normal and no explicit + * output is given (see https://github.com/numpy/numpy/issues/11109). + * 2. It only allows "safe" casting of inputs, which annoyingly prevents + * passing in a python int for int32 input. + * The resolver below solves both, and speeds up the process by + * explicitly assuming that a ufunc has only one function built in, + * either a regular one or a userloop (for structured dtype). + * + * Combines code from linear_search_type_resolver and + * linear_search_userloop_type_resolver from + * numpy/core/src/umath/ufunc_type_resolution.c + */ +static int ErfaUFuncTypeResolver(PyUFuncObject *ufunc, + NPY_CASTING casting, + PyArrayObject **operands, + PyObject *type_tup, + PyArray_Descr **out_dtypes) +{ + int *types; + PyArray_Descr **dtypes; + + if (ufunc->userloops) { + Py_ssize_t unused_pos = 0; + PyObject *userloop; + PyUFunc_Loop1d *funcdata; + + if (ufunc->ntypes > 0 || PyDict_Size(ufunc->userloops) != 1) { + goto fail; + } + /* No iteration needed; only one entry in dict */ + PyDict_Next(ufunc->userloops, &unused_pos, NULL, &userloop); + funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(userloop, NULL); + /* There should be only one function */ + if (funcdata->next != NULL) { + goto fail; + } + types = funcdata->arg_types; + dtypes = funcdata->arg_dtypes; + } + else { + npy_intp j; + int types_array[NPY_MAXARGS]; + + if (ufunc->ntypes != 1) { + goto fail; + } + /* Copy the types into an int array for matching */ + for (j = 0; j < ufunc->nargs; ++j) { + types_array[j] = ufunc->types[j]; + } + types = types_array; + dtypes = NULL; + } + switch (ufunc_loop_matches(ufunc, operands, casting, types, dtypes)) { + case 1: /* Matching types */ + return set_ufunc_loop_data_types(ufunc, operands, out_dtypes, + types, dtypes); + case -1: /* Error */ + return -1; + } + /* No match */ + PyErr_Format(PyExc_TypeError, + "ufunc '%s' not supported for the input types, and the " + "inputs could not be safely coerced to any supported " + "types according to the casting rule '%s'", + ufunc->name, npy_casting_to_string(casting)); + return -1; + +fail: + /* More than one loop or function */ + PyErr_Format(PyExc_RuntimeError, + "Unexpected internal error: ufunc '%s' wraps an ERFA " + "function and should have only a single loop with a " + "single function, yet has more.", + ufunc->name); + return -1; +} + +{%- if NUMPY_LT_1_16 %} +/* + * The following is only necessary for NUMPY_LT_1_16. Once we support + * only numpy >=1.16, it can be removed here and in the template part. + * + * For numpy <1.16, this works around the fact that gufuncs could not + * have fixed dimensions. + * + * Rather than just go for our type resolver, we check here whether + * any non-void input with core dimensions has dimension equal to 3. Here, + * we already know that all core dimensions are equal, so we have to check + * only one. + */ +static int ErfaUFuncD3CheckTypeResolver(PyUFuncObject *ufunc, + NPY_CASTING casting, + PyArrayObject **operands, + PyObject *type_tup, + PyArray_Descr **out_dtypes) +{ + int i; + + for (i = 0; i < ufunc->nin; i++) { + if (ufunc->core_num_dims[i]) { + PyArrayObject *op = operands[i]; + if (PyArray_DESCR(op)->type_num != NPY_VOID) { + /* last dimension is should always be 3 */ + int last_dim = PyArray_DIMS(op)[PyArray_NDIM(op)-1]; + if (last_dim != 3) { + PyErr_Format(PyExc_ValueError, + "%s: Input operand %d has a mismatch in its " + "core dimension %d, with gufunc signature %s " + "(size %zd is different from fixed size 3)", + ufunc->name, i, ufunc->core_num_dims[i] - 1, + ufunc->core_signature, last_dim); + return -1; + } + break; + } + } + } + if (i == ufunc->nin) { + PyErr_SetString(PyExc_RuntimeError, + "no relevant input found; should not happen!"); + } + return ErfaUFuncTypeResolver(ufunc, casting, operands, type_tup, + out_dtypes); +} +{%- endif %} + +/* + * UFUNC MODULE DEFINITIONS AND INITIALIZATION + */ +static PyMethodDef ErfaUFuncMethods[] = { + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "ufunc", + MODULE_DOCSTRING, + -1, + ErfaUFuncMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit_ufunc(void) +{ + /* module and its dict */ + PyObject *m, *d; + /* structured dtypes and their definition */ + PyObject *dtype_def; + PyArray_Descr *dt_double = NULL, *dt_int = NULL; + PyArray_Descr *dt_pv = NULL, *dt_pvdpv = NULL; + PyArray_Descr *dt_ymdf = NULL, *dt_hmsf = NULL, *dt_dmsf = NULL; + PyArray_Descr *dt_sign = NULL, *dt_type = NULL; + PyArray_Descr *dt_eraASTROM = NULL, *dt_eraLDBODY = NULL; + PyArray_Descr *dtypes[NPY_MAXARGS]; + /* ufuncs and their definitions */ + int status; + PyUFuncObject *ufunc; + static void *data[1] = {NULL}; + {#- /* for non-structured functions, define there types and functions + as these do not get copied */ #} + {%- for func in funcs %} + {%- if not func.user_dtype %} + static char types_{{ func.pyname }}[{{ func.args_by_inout('in|inout|out|ret|stat')|count }}] = { {{ func.args_by_inout('in|inout|out|ret|stat')|map(attribute='npy_type')|join(', ') }} }; + static PyUFuncGenericFunction funcs_{{ func.pyname }}[1] = { &ufunc_loop_{{ func.pyname }} }; + {%- endif %} + {%- endfor %} + + m = PyModule_Create(&moduledef); + if (m == NULL) { + return NULL; + } + d = PyModule_GetDict(m); /* borrowed ref. */ + if (d == NULL) { + goto fail; + } + + import_array(); + import_umath(); + /* + * Define the basic and structured types used in erfa so that + * we can use them for definitions of userloops below. + */ + dt_double = PyArray_DescrFromType(NPY_DOUBLE); + dt_int = PyArray_DescrFromType(NPY_INT); + /* double[2][3] = pv */ + dtype_def = Py_BuildValue("[(s, s), (s, s)]", + "p", "(3,)f8", "v", "(3,)f8"); + PyArray_DescrAlignConverter(dtype_def, &dt_pv); + Py_DECREF(dtype_def); + /* double[2] = pvdpv */ + dtype_def = Py_BuildValue("[(s, s), (s, s)]", + "pdp", "f8", "pdv", "f8"); + PyArray_DescrAlignConverter(dtype_def, &dt_pvdpv); + Py_DECREF(dtype_def); + /* int[4] = ymdf, hmsf, dmsf */ + dtype_def = Py_BuildValue("[(s, s), (s, s), (s, s), (s, s)]", + "y", "i4", "m", "i4", "d", "i4", "f", "i4"); + PyArray_DescrAlignConverter(dtype_def, &dt_ymdf); + Py_DECREF(dtype_def); + dtype_def = Py_BuildValue("[(s, s), (s, s), (s, s), (s, s)]", + "h", "i4", "m", "i4", "s", "i4", "f", "i4"); + PyArray_DescrAlignConverter(dtype_def, &dt_hmsf); + Py_DECREF(dtype_def); + dtype_def = Py_BuildValue("[(s, s), (s, s), (s, s), (s, s)]", + "h", "i4", "m", "i4", "s", "i4", "f", "i4"); + PyArray_DescrAlignConverter(dtype_def, &dt_dmsf); + Py_DECREF(dtype_def); + /* char1 (have to use structured, otherwise it cannot be a user type) */ + dtype_def = Py_BuildValue("[(s, s)]", "sign", "S1"); + PyArray_DescrAlignConverter(dtype_def, &dt_sign); + Py_DECREF(dtype_def); + /* char12 */ + dtype_def = Py_BuildValue("[(s, s)]", "type", "S12"); + PyArray_DescrAlignConverter(dtype_def, &dt_type); + Py_DECREF(dtype_def); + /* eraLDBODY */ + dtype_def = Py_BuildValue( + "[(s, s), (s, s), (s, s)]", + "bm", "f8", /* mass of the body (solar masses) */ + "dl", "f8", /* deflection limiter (radians^2/2) */ + "pv", "(2,3)f8" /* barycentric PV of the body (au, au/day) */ + ); + PyArray_DescrAlignConverter(dtype_def, &dt_eraLDBODY); + Py_DECREF(dtype_def); + /* eraASTROM */ + dtype_def = Py_BuildValue( + "[(s, s), (s, s), (s, s), (s, s)," + " (s, s), (s, s), (s, s), (s, s)," + " (s, s), (s, s), (s, s), (s, s)," + " (s, s), (s, s), (s, s), (s, s), (s, s)]", + "pmt", "f8", /* PM time interval (SSB, Julian years) */ + "eb", "(3,)f8", /* SSB to observer (vector, au) */ + "eh", "(3,)f8", /* Sun to observer (unit vector) */ + "em", "f8", /* distance from Sun to observer (au) */ + "v", "(3,)f8", /* barycentric observer velocity (vector, c) */ + "bm1", "f8", /* sqrt(1-|v|^2): reciprocal of Lorenz factor */ + "bpn", "(3,3)f8", /* bias-precession-nutation matrix */ + "along", "f8", /* longitude + s' + dERA(DUT) (radians) */ + "phi", "f8", /* geodetic latitude (radians) */ + "xpl", "f8", /* polar motion xp wrt local meridian (radians) */ + "ypl", "f8", /* polar motion yp wrt local meridian (radians) */ + "sphi", "f8", /* sine of geodetic latitude */ + "cphi", "f8", /* cosine of geodetic latitude */ + "diurab", "f8", /* magnitude of diurnal aberration vector */ + "eral", "f8", /* "local" Earth rotation angle (radians) */ + "refa", "f8", /* refraction constant A (radians) */ + "refb", "f8" /* refraction constant B (radians) */ + ); + PyArray_DescrAlignConverter(dtype_def, &dt_eraASTROM); + Py_DECREF(dtype_def); + if (dt_double == NULL || dt_int == NULL || + dt_pv == NULL || dt_pvdpv == NULL || + dt_ymdf == NULL || dt_hmsf == NULL || dt_dmsf == NULL || + dt_sign == NULL || dt_type == NULL || + dt_eraLDBODY == NULL || dt_eraASTROM == NULL) { + goto fail; + } + /* Make the structured dtypes available in the module */ + PyDict_SetItemString(d, "dt_pv", (PyObject *)dt_pv); + PyDict_SetItemString(d, "dt_pvdpv", (PyObject *)dt_pvdpv); + PyDict_SetItemString(d, "dt_ymdf", (PyObject *)dt_ymdf); + PyDict_SetItemString(d, "dt_hmsf", (PyObject *)dt_hmsf); + PyDict_SetItemString(d, "dt_dmsf", (PyObject *)dt_dmsf); + PyDict_SetItemString(d, "dt_sign", (PyObject *)dt_sign); + PyDict_SetItemString(d, "dt_type", (PyObject *)dt_type); + PyDict_SetItemString(d, "dt_eraLDBODY", (PyObject *)dt_eraLDBODY); + PyDict_SetItemString(d, "dt_eraASTROM", (PyObject *)dt_eraASTROM); + /* + * Define the ufuncs. For those without structured dtypes, + * the ufunc creation uses the static variables defined above; + * for those with structured dtypes, an empty ufunc is created, + * and then a userloop is added. For both, we set the type + * resolver to our own, and then add the ufunc to the module. + * + * Note that for the arguments, any inout arguments, i.e., those + * that are changed in-place in the ERFA function, are repeated, + * since we want the ufuncs not to do in-place changes (unless + * explicitly requested with ufunc(..., in,..., out=in)) + */ + {%- for func in funcs %} + {%- if not func.user_dtype %} + ufunc = (PyUFuncObject *)PyUFunc_FromFuncAndDataAndSignature( + funcs_{{ func.pyname }}, data, types_{{ func.pyname }}, + 1, {{ func.args_by_inout('in|inout')|count }}, {{ func.args_by_inout('inout|out|ret|stat')|count }}, PyUFunc_None, + "{{ func.pyname }}", + "UFunc wrapper for {{ func.name }}", + 0, {% if func.signature -%} "{{ func.signature }}" {%- else -%} NULL {%- endif -%}); + if (ufunc == NULL) { + goto fail; + } + {%- else %} + ufunc = (PyUFuncObject *)PyUFunc_FromFuncAndDataAndSignature( + NULL, NULL, NULL, + 0, {{ func.args_by_inout('in|inout')|count }}, {{ func.args_by_inout('inout|out|ret|stat')|count }}, PyUFunc_None, + "{{ func.pyname }}", + "UFunc wrapper for {{ func.name }}", + 0, {% if func.signature -%} "{{ func.signature }}" {%- else -%} NULL {%- endif -%}); + if (ufunc == NULL) { + goto fail; + } + {%- for arg in func.args_by_inout('in|inout') %} + dtypes[{{ loop.index - 1 }}] = {{ arg.dtype }}; + {%- endfor %} + {%- for arg in func.args_by_inout('inout|out|ret|stat') %} + dtypes[{{ loop.index - 1 + func.args_by_inout('in|inout')|count }}] = {{ arg.dtype }}; + {%- endfor %} + status = PyUFunc_RegisterLoopForDescr( + ufunc, {{ func.user_dtype }}, + ufunc_loop_{{ func.pyname }}, dtypes, NULL); + if(status != 0){ + Py_DECREF(ufunc); + goto fail; + } + {%- endif %} + {%- if func.signature and 'd3' in func.signature and not func.d3_fix_arg %} + ufunc->type_resolver = &ErfaUFuncD3CheckTypeResolver; + {%- else %} + ufunc->type_resolver = &ErfaUFuncTypeResolver; + {%- endif %} + PyDict_SetItemString(d, "{{ func.pyname }}", (PyObject *)ufunc); + Py_DECREF(ufunc); + {%- endfor %} + + goto decref; + +fail: + Py_XDECREF(m); + m = NULL; + +decref: + Py_XDECREF(dt_double); + Py_XDECREF(dt_int); + Py_XDECREF(dt_pv); + Py_XDECREF(dt_pvdpv); + Py_XDECREF(dt_ymdf); + Py_XDECREF(dt_hmsf); + Py_XDECREF(dt_dmsf); + Py_XDECREF(dt_sign); + Py_XDECREF(dt_type); + Py_XDECREF(dt_eraASTROM); + Py_XDECREF(dt_eraLDBODY); + return m; +} diff --git a/testbed/astropy__astropy/astropy/astropy.cfg b/testbed/astropy__astropy/astropy/astropy.cfg new file mode 100644 index 0000000000000000000000000000000000000000..13e4d213e9fcd2fd945ab24b100254a0a893a7d9 --- /dev/null +++ b/testbed/astropy__astropy/astropy/astropy.cfg @@ -0,0 +1,141 @@ +# -*- coding: utf-8 -*- + +### CONSOLE SETTINGS + +## Use Unicode characters when outputting values, and writing widgets to the +## console. +# unicode_output = False + +## When True, use ANSI color escape sequences when writing to the console. +# use_color = True + +## Maximum number of lines for the pretty-printer. If not provided, +## determine automatically from the size of the terminal. -1 means no +## limit. +# max_lines = + +## Maximum number of characters-per-line for the pretty-printer. If +## not provided, determine automatically from the size of the +## terminal, if possible. -1 means no limit. +# max_width = + + +### CORE DATA STRUCTURES AND TRANSFORMATIONS + +[nddata] + +## Whether to issue a warning if NDData arithmetic is performed with +## uncertainties and the uncertainties do not support the propagation of +## correlated uncertainties. +# warn_unsupported_correlated = True + +## Whether to issue a warning when the `~astropy.nddata.NDData` unit +## attribute is changed from a non-``None`` value to another value +## that data values/uncertainties are not scaled with the unit change. +# warn_setting_unit_directly = True + +[table] + +## The template that determines the name of a column if it cannot be +## determined. Uses new-style (format method) string formatting +# auto_colname = col{0} + +[table.jsviewer] + +## The URL to the jQuery library to use. If not provided, uses the +## internal copy installed with astropy. +# jquery_url = + +## The URL to the jQuery datatables library to use. If not provided, +## uses the internal copy installed with astropy. +# datatables_url = + +### ASTRONOMY COMPUTATIONS AND UTILITIES + +[samp] + +## Whether to allow astropy.samp to use the internet, if available +# use_internet = True + +## How many times to retry communications when they fail +# n_retries = 10 + + +### INPUT/OUTPUT + +[io.fits] + +## If True, enable support for record-valued keywords as described by FITS WCS +## Paper IV. Otherwise they are treated as normal keywords. +# enable_record_valued_keyword_cards = True + +## If True, extension names (i.e. the EXTNAME keyword) should be treated as +## case-sensitive. +# extension_name_case_sensitive = False + +## If True, automatically remove trailing whitespace for string values in +## headers. Otherwise the values are returned verbatim, with all whitespace +## intact. +# strip_header_whitespace = True + +## If True, use memory-mapped file access to read/write the data in FITS files. +## This generally provides better performance, especially for large files, but +## may affect performance in I/O-heavy applications. +# use_memmap = True + +[io.votable] + +## When True, treat fixable violations of the VOTable spec as exceptions. +# pedantic = True + + +### NUTS AND BOLTS OF ASTROPY + + +[logger] + +## Threshold for the logging messages. Logging messages that are less severe +## than this level will be ignored. The levels are 'DEBUG', 'INFO', 'WARNING', +## 'ERROR' +# log_level = INFO + +## Whether to log warnings.warn calls +# log_warnings = True + +## Whether to log exceptions before raising them +# log_exceptions = False + +## Whether to always log messages to a log file +# log_to_file = False + +## The file to log messages to. When '', it defaults to a file 'astropy.log' in +## the astropy config directory. +# log_file_path = "" + +## Threshold for logging messages to log_file_path +# log_file_level = INFO + +## Format for log file entries +# log_file_format = "%(asctime)r, %(origin)r, %(levelname)r, %(message)r" + +[utils.data] + +## URL for astropy remote data site. +# dataurl = http://data.astropy.org/ + +## Time to wait for remote data query (in seconds). +# remote_timeout = 3.0 + +## Block size for computing MD5 file hashes. +# hash_block_size = 65536 + +## Number of bytes of remote data to download per step. +# download_block_size = 65536 + +## Number of times to try to get the lock while accessing the data cache before +## giving up. +# download_cache_lock_attempts = 5 + +## If True, temporary download files created when the cache is inacessible will +## be deleted at the end of the python session. +# delete_temporary_downloads_at_exit = True diff --git a/testbed/astropy__astropy/astropy/conftest.py b/testbed/astropy__astropy/astropy/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..ba8df0438fdec38751d1a05bd57b249dfa6232f6 --- /dev/null +++ b/testbed/astropy__astropy/astropy/conftest.py @@ -0,0 +1,75 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +This file contains pytest configuration settings that are astropy-specific +(i.e. those that would not necessarily be shared by affiliated packages +making use of astropy's test runner). +""" +import os +import builtins +import tempfile + +from astropy.tests.plugins.display import PYTEST_HEADER_MODULES +from astropy.tests.helper import enable_deprecations_as_exceptions + +try: + import matplotlib +except ImportError: + HAS_MATPLOTLIB = False +else: + HAS_MATPLOTLIB = True + +enable_deprecations_as_exceptions( + include_astropy_deprecations=False, + # This is a workaround for the OpenSSL deprecation warning that comes from + # the `requests` module. It only appears when both asdf and sphinx are + # installed. This can be removed once pyopenssl 1.7.20+ is released. + modules_to_ignore_on_import=['requests']) + +if HAS_MATPLOTLIB: + matplotlib.use('Agg') + +matplotlibrc_cache = {} + + +def pytest_configure(config): + builtins._pytest_running = True + # do not assign to matplotlibrc_cache in function scope + if HAS_MATPLOTLIB: + matplotlibrc_cache.update(matplotlib.rcParams) + matplotlib.rcdefaults() + + # Make sure we use temporary directories for the config and cache + # so that the tests are insensitive to local configuration. Note that this + # is also set in the test runner, but we need to also set it here for + # things to work properly in parallel mode + + builtins._xdg_config_home_orig = os.environ.get('XDG_CONFIG_HOME') + builtins._xdg_cache_home_orig = os.environ.get('XDG_CACHE_HOME') + + os.environ['XDG_CONFIG_HOME'] = tempfile.mkdtemp('astropy_config') + os.environ['XDG_CACHE_HOME'] = tempfile.mkdtemp('astropy_cache') + + os.mkdir(os.path.join(os.environ['XDG_CONFIG_HOME'], 'astropy')) + os.mkdir(os.path.join(os.environ['XDG_CACHE_HOME'], 'astropy')) + + +def pytest_unconfigure(config): + builtins._pytest_running = False + # do not assign to matplotlibrc_cache in function scope + if HAS_MATPLOTLIB: + matplotlib.rcParams.update(matplotlibrc_cache) + matplotlibrc_cache.clear() + + if builtins._xdg_config_home_orig is None: + os.environ.pop('XDG_CONFIG_HOME') + else: + os.environ['XDG_CONFIG_HOME'] = builtins._xdg_config_home_orig + + if builtins._xdg_cache_home_orig is None: + os.environ.pop('XDG_CACHE_HOME') + else: + os.environ['XDG_CACHE_HOME'] = builtins._xdg_cache_home_orig + + +PYTEST_HEADER_MODULES['Cython'] = 'cython' +PYTEST_HEADER_MODULES['Scikit-image'] = 'skimage' diff --git a/testbed/astropy__astropy/astropy/logger.py b/testbed/astropy__astropy/astropy/logger.py new file mode 100644 index 0000000000000000000000000000000000000000..d6f3d3f7756a57348cd367332158ff082e04654c --- /dev/null +++ b/testbed/astropy__astropy/astropy/logger.py @@ -0,0 +1,568 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +"""This module defines a logging class based on the built-in logging module""" + +import inspect +import os +import sys +import logging +import warnings +from contextlib import contextmanager + +from . import config as _config +from . import conf as _conf +from .utils import find_current_module +from .utils.exceptions import AstropyWarning, AstropyUserWarning + +__all__ = ['Conf', 'conf', 'log', 'AstropyLogger', 'LoggingError'] + +# import the logging levels from logging so that one can do: +# log.setLevel(log.DEBUG), for example +logging_levels = ['NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', + 'FATAL', ] +for level in logging_levels: + globals()[level] = getattr(logging, level) +__all__ += logging_levels + + +# Initialize by calling _init_log() +log = None + + +class LoggingError(Exception): + """ + This exception is for various errors that occur in the astropy logger, + typically when activating or deactivating logger-related features. + """ + + +class _AstLogIPYExc(Exception): + """ + An exception that is used only as a placeholder to indicate to the + IPython exception-catching mechanism that the astropy + exception-capturing is activated. It should not actually be used as + an exception anywhere. + """ + + +class Conf(_config.ConfigNamespace): + """ + Configuration parameters for `astropy.logger`. + """ + log_level = _config.ConfigItem( + 'INFO', + "Threshold for the logging messages. Logging " + "messages that are less severe than this level " + "will be ignored. The levels are ``'DEBUG'``, " + "``'INFO'``, ``'WARNING'``, ``'ERROR'``.") + log_warnings = _config.ConfigItem( + True, + "Whether to log `warnings.warn` calls.") + log_exceptions = _config.ConfigItem( + False, + "Whether to log exceptions before raising " + "them.") + log_to_file = _config.ConfigItem( + False, + "Whether to always log messages to a log " + "file.") + log_file_path = _config.ConfigItem( + '', + "The file to log messages to. When ``''``, " + "it defaults to a file ``'astropy.log'`` in " + "the astropy config directory.") + log_file_level = _config.ConfigItem( + 'INFO', + "Threshold for logging messages to " + "`log_file_path`.") + log_file_format = _config.ConfigItem( + "%(asctime)r, " + "%(origin)r, %(levelname)r, %(message)r", + "Format for log file entries.") + + +conf = Conf() + + +def _init_log(): + """Initializes the Astropy log--in most circumstances this is called + automatically when importing astropy. + """ + + global log + + orig_logger_cls = logging.getLoggerClass() + logging.setLoggerClass(AstropyLogger) + try: + log = logging.getLogger('astropy') + log._set_defaults() + finally: + logging.setLoggerClass(orig_logger_cls) + + return log + + +def _teardown_log(): + """Shut down exception and warning logging (if enabled) and clear all + Astropy loggers from the logging module's cache. + + This involves poking some logging module internals, so much if it is 'at + your own risk' and is allowed to pass silently if any exceptions occur. + """ + + global log + + if log.exception_logging_enabled(): + log.disable_exception_logging() + + if log.warnings_logging_enabled(): + log.disable_warnings_logging() + + del log + + # Now for the fun stuff... + try: + logging._acquireLock() + try: + loggerDict = logging.Logger.manager.loggerDict + for key in loggerDict.keys(): + if key == 'astropy' or key.startswith('astropy.'): + del loggerDict[key] + finally: + logging._releaseLock() + except Exception: + pass + + +Logger = logging.getLoggerClass() + + +class AstropyLogger(Logger): + ''' + This class is used to set up the Astropy logging. + + The main functionality added by this class over the built-in + logging.Logger class is the ability to keep track of the origin of the + messages, the ability to enable logging of warnings.warn calls and + exceptions, and the addition of colorized output and context managers to + easily capture messages to a file or list. + ''' + + def makeRecord(self, name, level, pathname, lineno, msg, args, exc_info, + func=None, extra=None, sinfo=None): + if extra is None: + extra = {} + if 'origin' not in extra: + current_module = find_current_module(1, finddiff=[True, 'logging']) + if current_module is not None: + extra['origin'] = current_module.__name__ + else: + extra['origin'] = 'unknown' + return Logger.makeRecord(self, name, level, pathname, lineno, msg, + args, exc_info, func=func, extra=extra, + sinfo=sinfo) + + _showwarning_orig = None + + def _showwarning(self, *args, **kwargs): + + # Bail out if we are not catching a warning from Astropy + if not isinstance(args[0], AstropyWarning): + return self._showwarning_orig(*args, **kwargs) + + warning = args[0] + # Deliberately not using isinstance here: We want to display + # the class name only when it's not the default class, + # AstropyWarning. The name of subclasses of AstropyWarning should + # be displayed. + if type(warning) not in (AstropyWarning, AstropyUserWarning): + message = '{0}: {1}'.format(warning.__class__.__name__, args[0]) + else: + message = str(args[0]) + + mod_path = args[2] + # Now that we have the module's path, we look through sys.modules to + # find the module object and thus the fully-package-specified module + # name. The module.__file__ is the original source file name. + mod_name = None + mod_path, ext = os.path.splitext(mod_path) + for name, mod in list(sys.modules.items()): + try: + # Believe it or not this can fail in some cases: + # https://github.com/astropy/astropy/issues/2671 + path = os.path.splitext(getattr(mod, '__file__', ''))[0] + except Exception: + continue + if path == mod_path: + mod_name = mod.__name__ + break + + if mod_name is not None: + self.warning(message, extra={'origin': mod_name}) + else: + self.warning(message) + + def warnings_logging_enabled(self): + return self._showwarning_orig is not None + + def enable_warnings_logging(self): + ''' + Enable logging of warnings.warn() calls + + Once called, any subsequent calls to ``warnings.warn()`` are + redirected to this logger and emitted with level ``WARN``. Note that + this replaces the output from ``warnings.warn``. + + This can be disabled with ``disable_warnings_logging``. + ''' + if self.warnings_logging_enabled(): + raise LoggingError("Warnings logging has already been enabled") + self._showwarning_orig = warnings.showwarning + warnings.showwarning = self._showwarning + + def disable_warnings_logging(self): + ''' + Disable logging of warnings.warn() calls + + Once called, any subsequent calls to ``warnings.warn()`` are no longer + redirected to this logger. + + This can be re-enabled with ``enable_warnings_logging``. + ''' + if not self.warnings_logging_enabled(): + raise LoggingError("Warnings logging has not been enabled") + if warnings.showwarning != self._showwarning: + raise LoggingError("Cannot disable warnings logging: " + "warnings.showwarning was not set by this " + "logger, or has been overridden") + warnings.showwarning = self._showwarning_orig + self._showwarning_orig = None + + _excepthook_orig = None + + def _excepthook(self, etype, value, traceback): + + if traceback is None: + mod = None + else: + tb = traceback + while tb.tb_next is not None: + tb = tb.tb_next + mod = inspect.getmodule(tb) + + # include the the error type in the message. + if len(value.args) > 0: + message = '{0}: {1}'.format(etype.__name__, str(value)) + else: + message = str(etype.__name__) + + if mod is not None: + self.error(message, extra={'origin': mod.__name__}) + else: + self.error(message) + self._excepthook_orig(etype, value, traceback) + + def exception_logging_enabled(self): + ''' + Determine if the exception-logging mechanism is enabled. + + Returns + ------- + exclog : bool + True if exception logging is on, False if not. + ''' + try: + ip = get_ipython() + except NameError: + ip = None + + if ip is None: + return self._excepthook_orig is not None + else: + return _AstLogIPYExc in ip.custom_exceptions + + def enable_exception_logging(self): + ''' + Enable logging of exceptions + + Once called, any uncaught exceptions will be emitted with level + ``ERROR`` by this logger, before being raised. + + This can be disabled with ``disable_exception_logging``. + ''' + try: + ip = get_ipython() + except NameError: + ip = None + + if self.exception_logging_enabled(): + raise LoggingError("Exception logging has already been enabled") + + if ip is None: + # standard python interpreter + self._excepthook_orig = sys.excepthook + sys.excepthook = self._excepthook + else: + # IPython has its own way of dealing with excepthook + + # We need to locally define the function here, because IPython + # actually makes this a member function of their own class + def ipy_exc_handler(ipyshell, etype, evalue, tb, tb_offset=None): + # First use our excepthook + self._excepthook(etype, evalue, tb) + + # Now also do IPython's traceback + ipyshell.showtraceback((etype, evalue, tb), tb_offset=tb_offset) + + # now register the function with IPython + # note that we include _AstLogIPYExc so `disable_exception_logging` + # knows that it's disabling the right thing + ip.set_custom_exc((BaseException, _AstLogIPYExc), ipy_exc_handler) + + # and set self._excepthook_orig to a no-op + self._excepthook_orig = lambda etype, evalue, tb: None + + def disable_exception_logging(self): + ''' + Disable logging of exceptions + + Once called, any uncaught exceptions will no longer be emitted by this + logger. + + This can be re-enabled with ``enable_exception_logging``. + ''' + try: + ip = get_ipython() + except NameError: + ip = None + + if not self.exception_logging_enabled(): + raise LoggingError("Exception logging has not been enabled") + + if ip is None: + # standard python interpreter + if sys.excepthook != self._excepthook: + raise LoggingError("Cannot disable exception logging: " + "sys.excepthook was not set by this logger, " + "or has been overridden") + sys.excepthook = self._excepthook_orig + self._excepthook_orig = None + else: + # IPython has its own way of dealing with exceptions + ip.set_custom_exc(tuple(), None) + + def enable_color(self): + ''' + Enable colorized output + ''' + _conf.use_color = True + + def disable_color(self): + ''' + Disable colorized output + ''' + _conf.use_color = False + + @contextmanager + def log_to_file(self, filename, filter_level=None, filter_origin=None): + ''' + Context manager to temporarily log messages to a file. + + Parameters + ---------- + filename : str + The file to log messages to. + filter_level : str + If set, any log messages less important than ``filter_level`` will + not be output to the file. Note that this is in addition to the + top-level filtering for the logger, so if the logger has level + 'INFO', then setting ``filter_level`` to ``INFO`` or ``DEBUG`` + will have no effect, since these messages are already filtered + out. + filter_origin : str + If set, only log messages with an origin starting with + ``filter_origin`` will be output to the file. + + Notes + ----- + + By default, the logger already outputs log messages to a file set in + the Astropy configuration file. Using this context manager does not + stop log messages from being output to that file, nor does it stop log + messages from being printed to standard output. + + Examples + -------- + + The context manager is used as:: + + with logger.log_to_file('myfile.log'): + # your code here + ''' + + fh = logging.FileHandler(filename) + if filter_level is not None: + fh.setLevel(filter_level) + if filter_origin is not None: + fh.addFilter(FilterOrigin(filter_origin)) + f = logging.Formatter(conf.log_file_format) + fh.setFormatter(f) + self.addHandler(fh) + yield + fh.close() + self.removeHandler(fh) + + @contextmanager + def log_to_list(self, filter_level=None, filter_origin=None): + ''' + Context manager to temporarily log messages to a list. + + Parameters + ---------- + filename : str + The file to log messages to. + filter_level : str + If set, any log messages less important than ``filter_level`` will + not be output to the file. Note that this is in addition to the + top-level filtering for the logger, so if the logger has level + 'INFO', then setting ``filter_level`` to ``INFO`` or ``DEBUG`` + will have no effect, since these messages are already filtered + out. + filter_origin : str + If set, only log messages with an origin starting with + ``filter_origin`` will be output to the file. + + Notes + ----- + + Using this context manager does not stop log messages from being + output to standard output. + + Examples + -------- + + The context manager is used as:: + + with logger.log_to_list() as log_list: + # your code here + ''' + lh = ListHandler() + if filter_level is not None: + lh.setLevel(filter_level) + if filter_origin is not None: + lh.addFilter(FilterOrigin(filter_origin)) + self.addHandler(lh) + yield lh.log_list + self.removeHandler(lh) + + def _set_defaults(self): + ''' + Reset logger to its initial state + ''' + + # Reset any previously installed hooks + if self.warnings_logging_enabled(): + self.disable_warnings_logging() + if self.exception_logging_enabled(): + self.disable_exception_logging() + + # Remove all previous handlers + for handler in self.handlers[:]: + self.removeHandler(handler) + + # Set levels + self.setLevel(conf.log_level) + + # Set up the stdout handler + sh = StreamHandler() + self.addHandler(sh) + + # Set up the main log file handler if requested (but this might fail if + # configuration directory or log file is not writeable). + if conf.log_to_file: + log_file_path = conf.log_file_path + + # "None" as a string because it comes from config + try: + _ASTROPY_TEST_ + testing_mode = True + except NameError: + testing_mode = False + + try: + if log_file_path == '' or testing_mode: + log_file_path = os.path.join( + _config.get_config_dir(), "astropy.log") + else: + log_file_path = os.path.expanduser(log_file_path) + + fh = logging.FileHandler(log_file_path) + except OSError as e: + warnings.warn( + 'log file {0!r} could not be opened for writing: ' + '{1}'.format(log_file_path, str(e)), RuntimeWarning) + else: + formatter = logging.Formatter(conf.log_file_format) + fh.setFormatter(formatter) + fh.setLevel(conf.log_file_level) + self.addHandler(fh) + + if conf.log_warnings: + self.enable_warnings_logging() + + if conf.log_exceptions: + self.enable_exception_logging() + + +class StreamHandler(logging.StreamHandler): + """ + A specialized StreamHandler that logs INFO and DEBUG messages to + stdout, and all other messages to stderr. Also provides coloring + of the output, if enabled in the parent logger. + """ + + def emit(self, record): + ''' + The formatter for stderr + ''' + if record.levelno <= logging.INFO: + stream = sys.stdout + else: + stream = sys.stderr + + if record.levelno < logging.DEBUG or not _conf.use_color: + print(record.levelname, end='', file=stream) + else: + # Import utils.console only if necessary and at the latest because + # the import takes a significant time [#4649] + from .utils.console import color_print + if record.levelno < logging.INFO: + color_print(record.levelname, 'magenta', end='', file=stream) + elif record.levelno < logging.WARN: + color_print(record.levelname, 'green', end='', file=stream) + elif record.levelno < logging.ERROR: + color_print(record.levelname, 'brown', end='', file=stream) + else: + color_print(record.levelname, 'red', end='', file=stream) + record.message = "{0} [{1:s}]".format(record.msg, record.origin) + print(": " + record.message, file=stream) + + +class FilterOrigin: + '''A filter for the record origin''' + + def __init__(self, origin): + self.origin = origin + + def filter(self, record): + return record.origin.startswith(self.origin) + + +class ListHandler(logging.Handler): + '''A handler that can be used to capture the records in a list''' + + def __init__(self, filter_level=None, filter_origin=None): + logging.Handler.__init__(self) + self.log_list = [] + + def emit(self, record): + self.log_list.append(record) diff --git a/testbed/astropy__astropy/astropy/setup_package.py b/testbed/astropy__astropy/astropy/setup_package.py new file mode 100644 index 0000000000000000000000000000000000000000..61881ac5bf726e30fccce06904bb9c40689ac1ef --- /dev/null +++ b/testbed/astropy__astropy/astropy/setup_package.py @@ -0,0 +1,18 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import os +import glob + + +def get_package_data(): + + # Find all files in data/ sub-directories since this is a standard location + # for data files. We then need to adjust the paths to be relative to here + # (otherwise glob will be evaluated relative to setup.py) + data_files = glob.glob('**/data/**/*', recursive=True) + data_files = [os.path.relpath(x, os.path.dirname(__file__)) for x in data_files] + + # Glob doesn't recognize hidden files + data_files.append('utils/tests/data/.hidden_file.txt') + + return {'astropy': ['astropy.cfg', 'CITATION'] + data_files} diff --git a/testbed/astropy__astropy/astropy/timeseries/__init__.py b/testbed/astropy__astropy/astropy/timeseries/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..75e99f6bdf9a08de219e37a363fb180a4e2ee49e --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/__init__.py @@ -0,0 +1,12 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +This subpackage contains classes and functions for work with time series. +""" + +from astropy.timeseries.core import * # noqa +from astropy.timeseries.sampled import * # noqa +from astropy.timeseries.binned import * # noqa +from astropy.timeseries import io # noqa +from astropy.timeseries.downsample import * # noqa +from astropy.timeseries.periodograms import * # noqa diff --git a/testbed/astropy__astropy/astropy/timeseries/binned.py b/testbed/astropy__astropy/astropy/timeseries/binned.py new file mode 100644 index 0000000000000000000000000000000000000000..20a35fa68b584660fe0db2fcff9af051d95359bd --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/binned.py @@ -0,0 +1,334 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from copy import deepcopy + +import numpy as np + +from astropy.table import groups, Table, QTable +from astropy.time import Time, TimeDelta +from astropy import units as u +from astropy.units import Quantity +from astropy.utils.misc import InheritDocstrings + +from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns + +__all__ = ['BinnedTimeSeries'] + + +@autocheck_required_columns +class BinnedTimeSeries(BaseTimeSeries, metaclass=InheritDocstrings): + """ + A class to represent binned time series data in tabular form. + + `~astropy.timeseries.BinnedTimeSeries` provides a class for representing + time series as a collection of values of different quantities measured in + time bins (for time series with values sampled at specific times, see the + `~astropy.timeseries.TimeSeries` class). + `~astropy.timeseries.BinnedTimeSeries` is a sub-class of `~astropy.table.QTable` + and thus provides all the standard table maniplation methods available to + tables, but it also provides additional conveniences for dealing with time + series, such as a flexible initializer for setting up the times, and + attributes to access the start/center/end time of bins. + + See also: http://docs.astropy.org/en/stable/timeseries/ + + Parameters + ---------- + data : numpy ndarray, dict, list, Table, or table-like object, optional + Data to initialize time series. This does not need to contain the times, + which can be provided separately, but if it does contain the times they + should be in columns called ``'time_bin_start'`` and ``'time_bin_size'`` + to be automatically recognized. + time_bin_start : `~astropy.time.Time` or iterable + The times of the start of each bin - this can be either given + directly as a `~astropy.time.Time` array or as any iterable that + initializes the `~astropy.time.Time` class. If this is given, then + the remaining time-related arguments should not be used. This can also + be a scalar value if ``time_bin_size`` is provided. + time_bin_end : `~astropy.time.Time` or iterable + The times of the end of each bin - this can be either given directly as + a `~astropy.time.Time` array or as any value or iterable that + initializes the `~astropy.time.Time` class. If this is given, then the + remaining time-related arguments should not be used. This can only be + given if ``time_bin_start`` is an array of values. If ``time_bin_end`` + is a scalar, time bins are assumed to be contiguous, such that the end + of each bin is the start of the next one, and ``time_bin_end`` gives the + end time for the last bin. If ``time_bin_end`` is an array, the time + bins do not need to be contiguous. If this argument is provided, + ``time_bin_size`` should not be provided. + time_bin_size : `~astropy.time.TimeDelta` or `~astropy.units.Quantity` + The size of the time bins, either as a scalar value (in which case all + time bins will be assumed to have the same duration) or as an array of + values (in which case each time bin can have a different duration). + If this argument is provided, ``time_bin_end`` should not be provided. + n_bins : int + The number of time bins for the series. This is only used if both + ``time_bin_start`` and ``time_bin_size`` are provided and are scalar + values. + **kwargs : dict, optional + Additional keyword arguments are passed to `~astropy.table.QTable`. + """ + + _required_columns = ['time_bin_start', 'time_bin_size'] + + def __init__(self, data=None, *, time_bin_start=None, time_bin_end=None, + time_bin_size=None, n_bins=None, **kwargs): + + super().__init__(data=data, **kwargs) + + # For some operations, an empty time series needs to be created, then + # columns added one by one. We should check that when columns are added + # manually, time is added first and is of the right type. + if (data is None and time_bin_start is None and time_bin_end is None and + time_bin_size is None and n_bins is None): + self._required_columns_relax = True + return + + # First if time_bin_start and time_bin_end have been given in the table data, we + # should extract them and treat them as if they had been passed as + # keyword arguments. + + if 'time_bin_start' in self.colnames: + if time_bin_start is None: + time_bin_start = self.columns['time_bin_start'] + else: + raise TypeError("'time_bin_start' has been given both in the table " + "and as a keyword argument") + + if 'time_bin_size' in self.colnames: + if time_bin_size is None: + time_bin_size = self.columns['time_bin_size'] + else: + raise TypeError("'time_bin_size' has been given both in the table " + "and as a keyword argument") + + if time_bin_start is None: + raise TypeError("'time_bin_start' has not been specified") + + if time_bin_end is None and time_bin_size is None: + raise TypeError("Either 'time_bin_size' or 'time_bin_end' should be specified") + + if not isinstance(time_bin_start, Time): + time_bin_start = Time(time_bin_start) + + if time_bin_end is not None and not isinstance(time_bin_end, Time): + time_bin_end = Time(time_bin_end) + + if time_bin_size is not None and not isinstance(time_bin_size, (Quantity, TimeDelta)): + raise TypeError("'time_bin_size' should be a Quantity or a TimeDelta") + + if isinstance(time_bin_size, TimeDelta): + time_bin_size = time_bin_size.sec * u.s + + if time_bin_start.isscalar: + + # We interpret this as meaning that this is the start of the + # first bin and that the bins are contiguous. In this case, + # we require time_bin_size to be specified. + + if time_bin_size is None: + raise TypeError("'time_bin_start' is scalar, so 'time_bin_size' is required") + + if time_bin_size.isscalar: + if data is not None: + if n_bins is not None: + if n_bins != len(self): + raise TypeError("'n_bins' has been given and it is not the " + "same length as the input data.") + else: + n_bins = len(self) + + time_bin_size = np.repeat(time_bin_size, n_bins) + + time_delta = np.cumsum(time_bin_size) + time_bin_end = time_bin_start + time_delta + + # Now shift the array so that the first entry is 0 + time_delta = np.roll(time_delta, 1) + time_delta[0] = 0. * u.s + + # Make time_bin_start into an array + time_bin_start = time_bin_start + time_delta + + else: + + if len(self.colnames) > 0 and len(time_bin_start) != len(self): + raise ValueError("Length of 'time_bin_start' ({0}) should match " + "table length ({1})".format(len(time_bin_start), len(self))) + + if time_bin_end is not None: + if time_bin_end.isscalar: + times = time_bin_start.copy() + times[:-1] = times[1:] + times[-1] = time_bin_end + time_bin_end = times + time_bin_size = (time_bin_end - time_bin_start).sec * u.s + + if time_bin_size.isscalar: + time_bin_size = np.repeat(time_bin_size, len(self)) + + with self._delay_required_column_checks(): + + if 'time_bin_start' in self.colnames: + self.remove_column('time_bin_start') + + if 'time_bin_size' in self.colnames: + self.remove_column('time_bin_size') + + self.add_column(time_bin_start, index=0, name='time_bin_start') + self.add_index('time_bin_start') + self.add_column(time_bin_size, index=1, name='time_bin_size') + + @property + def time_bin_start(self): + """ + The start times of all the time bins. + """ + return self['time_bin_start'] + + @property + def time_bin_center(self): + """ + The center times of all the time bins. + """ + return self['time_bin_start'] + self['time_bin_size'] * 0.5 + + @property + def time_bin_end(self): + """ + The end times of all the time bins. + """ + return self['time_bin_start'] + self['time_bin_size'] + + @property + def time_bin_size(self): + """ + The sizes of all the time bins. + """ + return self['time_bin_size'] + + def __getitem__(self, item): + if self._is_list_or_tuple_of_str(item): + if 'time_bin_start' not in item or 'time_bin_size' not in item: + out = QTable([self[x] for x in item], + meta=deepcopy(self.meta), + copy_indices=self._copy_indices) + out._groups = groups.TableGroups(out, indices=self.groups._indices, + keys=self.groups._keys) + return out + return super().__getitem__(item) + + @classmethod + def read(self, filename, time_bin_start_column=None, time_bin_end_column=None, + time_bin_size_column=None, time_bin_size_unit=None, time_format=None, time_scale=None, + format=None, *args, **kwargs): + """ + Read and parse a file and returns a `astropy.timeseries.BinnedTimeSeries`. + + This method uses the unified I/O infrastructure in Astropy which makes + it easy to define readers/writers for various classes + (http://docs.astropy.org/en/stable/io/unified.html). By default, this + method will try and use readers defined specifically for the + `astropy.timeseries.BinnedTimeSeries` class - however, it is also + possible to use the ``format`` keyword to specify formats defined for + the `astropy.table.Table` class - in this case, you will need to also + provide the column names for column containing the start times for the + bins, as well as other column names (see the Parameters section below + for details):: + + >>> from astropy.timeseries.binned import BinnedTimeSeries + >>> ts = BinnedTimeSeries.read('binned.dat', format='ascii.ecsv', + ... time_bin_start_column='date_start', + ... time_bin_end_column='date_end') # doctest: +SKIP + + Parameters + ---------- + filename : str + File to parse. + format : str + File format specifier. + time_bin_start_column : str + The name of the column with the start time for each bin. + time_bin_end_column : str, optional + The name of the column with the end time for each bin. Either this + option or ``time_bin_size_column`` should be specified. + time_bin_size_column : str, optional + The name of the column with the size for each bin. Either this + option or ``time_bin_end_column`` should be specified. + time_bin_size_unit : `astropy.units.Unit`, optional + If ``time_bin_size_column`` is specified but does not have a unit + set in the table, you can specify the unit manually. + time_format : str, optional + The time format for the start and end columns. + time_scale : str, optional + The time scale for the start and end columns. + *args : tuple, optional + Positional arguments passed through to the data reader. + **kwargs : dict, optional + Keyword arguments passed through to the data reader. + + Returns + ------- + out : `astropy.timeseries.binned.BinnedTimeSeries` + BinnedTimeSeries corresponding to the file. + + """ + + try: + + # First we try the readers defined for the BinnedTimeSeries class + return super().read(filename, format=format, *args, **kwargs) + + except TypeError: + + # Otherwise we fall back to the default Table readers + + if time_bin_start_column is None: + raise ValueError("``time_bin_start_column`` should be provided since the default Table readers are being used.") + if time_bin_end_column is None and time_bin_size_column is None: + raise ValueError("Either `time_bin_end_column` or `time_bin_size_column` should be provided.") + elif time_bin_end_column is not None and time_bin_size_column is not None: + raise ValueError("Cannot specify both `time_bin_end_column` and `time_bin_size_column`.") + + table = Table.read(filename, format=format, *args, **kwargs) + + if time_bin_start_column in table.colnames: + time_bin_start = Time(table.columns[time_bin_start_column], + scale=time_scale, format=time_format) + table.remove_column(time_bin_start_column) + else: + raise ValueError("Bin start time column '{}' not found in the input data.".format(time_bin_start_column)) + + if time_bin_end_column is not None: + + if time_bin_end_column in table.colnames: + time_bin_end = Time(table.columns[time_bin_end_column], + scale=time_scale, format=time_format) + table.remove_column(time_bin_end_column) + else: + raise ValueError("Bin end time column '{}' not found in the input data.".format(time_bin_end_column)) + + time_bin_size = None + + elif time_bin_size_column is not None: + + if time_bin_size_column in table.colnames: + time_bin_size = table.columns[time_bin_size_column] + table.remove_column(time_bin_size_column) + else: + raise ValueError("Bin size column '{}' not found in the input data.".format(time_bin_size_column)) + + if time_bin_size.unit is None: + if time_bin_size_unit is None or not isinstance(time_bin_size_unit, u.UnitBase): + raise ValueError("The bin size unit should be specified as an astropy Unit using ``time_bin_size_unit``.") + time_bin_size = time_bin_size * time_bin_size_unit + else: + time_bin_size = u.Quantity(time_bin_size) + + time_bin_end = None + + return BinnedTimeSeries(data=table, + time_bin_start=time_bin_start, + time_bin_end=time_bin_end, + time_bin_size=time_bin_size, + n_bins=len(table)) diff --git a/testbed/astropy__astropy/astropy/timeseries/core.py b/testbed/astropy__astropy/astropy/timeseries/core.py new file mode 100644 index 0000000000000000000000000000000000000000..730bed601f02ce99d7e55ee3c208c4348b80ebb1 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/core.py @@ -0,0 +1,92 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from types import FunctionType +from contextlib import contextmanager +from functools import wraps + +from astropy.table import QTable + +__all__ = ['BaseTimeSeries', 'autocheck_required_columns'] + +COLUMN_RELATED_METHODS = ['add_column', + 'add_columns', + 'keep_columns', + 'remove_column', + 'remove_columns', + 'rename_column'] + + +def autocheck_required_columns(cls): + """ + This is a decorator that ensures that the table contains specific + methods indicated by the _required_columns attribute. The aim is to + decorate all methods that might affect the columns in the table and check + for consistency after the methods have been run. + """ + + def decorator_method(method): + + @wraps(method) + def wrapper(self, *args, **kwargs): + result = method(self, *args, **kwargs) + self._check_required_columns() + return result + + return wrapper + + for name in COLUMN_RELATED_METHODS: + if (not hasattr(cls, name) or + not isinstance(getattr(cls, name), FunctionType)): + raise ValueError("{0} is not a valid method".format(name)) + setattr(cls, name, decorator_method(getattr(cls, name))) + + return cls + + +class BaseTimeSeries(QTable): + + _required_columns = None + _required_columns_enabled = True + + # If _required_column_relax is True, we don't require the columns to be + # present but we do require them to be the correct ones IF present. Note + # that this is a temporary state - as soon as the required columns + # are all present, we toggle this to False + _required_columns_relax = False + + def _check_required_columns(self): + + if not self._required_columns_enabled: + return + + if self._required_columns is not None: + + if self._required_columns_relax: + required_columns = self._required_columns[:len(self.colnames)] + else: + required_columns = self._required_columns + + plural = 's' if len(required_columns) > 1 else '' + + if not self._required_columns_relax and len(self.colnames) == 0: + + raise ValueError("{0} object is invalid - expected '{1}' " + "as the first column{2} but time series has no columns" + .format(self.__class__.__name__, required_columns[0], plural)) + + elif self.colnames[:len(required_columns)] != required_columns: + + raise ValueError("{0} object is invalid - expected '{1}' " + "as the first column{2} but found '{3}'" + .format(self.__class__.__name__, required_columns[0], plural, self.colnames[0])) + + if (self._required_columns_relax + and self._required_columns == self.colnames[:len(self._required_columns)]): + self._required_columns_relax = False + + @contextmanager + def _delay_required_column_checks(self): + self._required_columns_enabled = False + yield + self._required_columns_enabled = True + self._check_required_columns() diff --git a/testbed/astropy__astropy/astropy/timeseries/downsample.py b/testbed/astropy__astropy/astropy/timeseries/downsample.py new file mode 100644 index 0000000000000000000000000000000000000000..54cb49e5cb9947cfcf892024b41621e8b201c238 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/downsample.py @@ -0,0 +1,137 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import warnings + +import numpy as np +from astropy import units as u +from astropy.utils.exceptions import AstropyUserWarning + +from astropy.timeseries.sampled import TimeSeries +from astropy.timeseries.binned import BinnedTimeSeries + +__all__ = ['aggregate_downsample'] + + +def reduceat(array, indices, function): + """ + Manual reduceat functionality for cases where Numpy functions don't have a reduceat. + It will check if the input function has a reduceat and call that if it does. + """ + if hasattr(function, 'reduceat'): + return np.array(function.reduceat(array, indices)) + else: + result = [] + for i in range(len(indices) - 1): + if indices[i+1] <= indices[i]+1: + result.append(function(array[indices[i]])) + else: + result.append(function(array[indices[i]:indices[i+1]])) + result.append(function(array[indices[-1]:])) + return np.array(result) + + +def aggregate_downsample(time_series, *, time_bin_size=None, time_bin_start=None, + n_bins=None, aggregate_func=None): + """ + Downsample a time series by binning values into bins with a fixed size, + using a single function to combine the values in the bin. + + Parameters + ---------- + time_series : :class:`~astropy.timeseries.TimeSeries` + The time series to downsample. + time_bin_size : `~astropy.units.Quantity` + The time interval for the binned time series. + time_bin_start : `~astropy.time.Time`, optional + The start time for the binned time series. Defaults to the first + time in the sampled time series. + n_bins : int, optional + The number of bins to use. Defaults to the number needed to fit all + the original points. + aggregate_func : callable, optional + The function to use for combining points in the same bin. Defaults + to np.nanmean. + + Returns + ------- + binned_time_series : :class:`~astropy.timeseries.BinnedTimeSeries` + The downsampled time series. + """ + + if not isinstance(time_series, TimeSeries): + raise TypeError("time_series should be a TimeSeries") + + if not isinstance(time_bin_size, u.Quantity): + raise TypeError("time_bin_size should be a astropy.unit quantity") + + bin_size_sec = time_bin_size.to_value(u.s) + + # Use the table sorted by time + sorted = time_series.iloc[:] + + # Determine start time if needed + if time_bin_start is None: + time_bin_start = sorted.time[0] + + # Find the relative time since the start time, in seconds + relative_time_sec = (sorted.time - time_bin_start).sec + + # Determine the number of bins if needed + if n_bins is None: + n_bins = int(np.ceil(relative_time_sec[-1] / bin_size_sec)) + + if aggregate_func is None: + aggregate_func = np.nanmean + + # Determine the bins + relative_bins_sec = np.cumsum(np.hstack([0, np.repeat(bin_size_sec, n_bins)])) + bins = time_bin_start + relative_bins_sec * u.s + + # Find the subset of the table that is inside the bins + keep = ((relative_time_sec >= relative_bins_sec[0]) & + (relative_time_sec < relative_bins_sec[-1])) + subset = sorted[keep] + + # Figure out which bin each row falls in - the -1 is because items + # falling in the first bins will have index 1 but we want that to be 0 + indices = np.searchsorted(relative_bins_sec, relative_time_sec[keep]) - 1 + # Add back the first time. + indices[relative_time_sec[keep] == relative_bins_sec[0]] = 0 + + # Create new binned time series + binned = BinnedTimeSeries(time_bin_start=bins[:-1], time_bin_end=bins[-1]) + + # Determine rows where values are defined + groups = np.hstack([0, np.nonzero(np.diff(indices))[0] + 1]) + + # Find unique indices to determine which rows in the final time series + # will not be empty. + unique_indices = np.unique(indices) + + # Add back columns + + for colname in subset.colnames: + + if colname == 'time': + continue + + values = subset[colname] + + # FIXME: figure out how to avoid the following, if possible + if not isinstance(values, (np.ndarray, u.Quantity)): + warnings.warn("Skipping column {0} since it has a mix-in type", AstropyUserWarning) + continue + + if isinstance(values, u.Quantity): + data = u.Quantity(np.repeat(np.nan, n_bins), unit=values.unit) + data[unique_indices] = u.Quantity(reduceat(values.value, groups, aggregate_func), + values.unit, copy=False) + else: + data = np.ma.zeros(n_bins, dtype=values.dtype) + data.mask = 1 + data[unique_indices] = reduceat(values, groups, aggregate_func) + data.mask[unique_indices] = 0 + + binned[colname] = data + + return binned diff --git a/testbed/astropy__astropy/astropy/timeseries/io/__init__.py b/testbed/astropy__astropy/astropy/timeseries/io/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..206c2de2b27441d0721de3fcf57cf7d5dc8cac2e --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/io/__init__.py @@ -0,0 +1,3 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from .kepler import * diff --git a/testbed/astropy__astropy/astropy/timeseries/io/kepler.py b/testbed/astropy__astropy/astropy/timeseries/io/kepler.py new file mode 100644 index 0000000000000000000000000000000000000000..c1aa2e31417ea8edc6567cd207d356abd79a60c9 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/io/kepler.py @@ -0,0 +1,93 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +import warnings + +import numpy as np + +from astropy.io import registry, fits +from astropy.table import Table +from astropy.time import Time, TimeDelta + +from astropy.timeseries.sampled import TimeSeries + +__all__ = ["kepler_fits_reader"] + + +def kepler_fits_reader(filename): + """ + This serves as the FITS reader for KEPLER or TESS files within + astropy-timeseries. + + This function should generally not be called directly, and instead this + time series reader should be accessed with the + :meth:`~astropy.timeseries.TimeSeries.read` method:: + + >>> from astropy.timeseries import TimeSeries + >>> ts = TimeSeries.read('kplr33122.fits', format='kepler.fits') # doctest: +SKIP + + Parameters + ---------- + filename : `str` or `pathlib.Path` + File to load. + + Returns + ------- + ts : `~astropy.timeseries.TimeSeries` + Data converted into a TimeSeries. + """ + hdulist = fits.open(filename) + # Get the lightcurve HDU + telescope = hdulist[0].header['telescop'].lower() + + if telescope == 'tess': + hdu = hdulist['LIGHTCURVE'] + elif telescope == 'kepler': + hdu = hdulist[1] + else: + raise NotImplementedError("{} is not implemented, only KEPLER or TESS are " + "supported through this reader".format(hdulist[0].header['telescop'])) + + if hdu.header['EXTVER'] > 1: + raise NotImplementedError("Support for {0} v{1} files not yet " + "implemented".format(hdu.header['TELESCOP'], hdu.header['EXTVER'])) + + # Check time scale + if hdu.header['TIMESYS'] != 'TDB': + raise NotImplementedError("Support for {0} time scale not yet " + "implemented in {1} reader".format(hdu.header['TIMESYS'], hdu.header['TELESCOP'])) + + tab = Table.read(hdu, format='fits') + + # Some KEPLER files have a T column instead of TIME. + if "T" in tab.colnames: + tab.rename_column("T", "TIME") + + for colname in tab.colnames: + # Fix units + if tab[colname].unit == 'e-/s': + tab[colname].unit = 'electron/s' + if tab[colname].unit == 'pixels': + tab[colname].unit = 'pixel' + + # Rename columns to lowercase + tab.rename_column(colname, colname.lower()) + + # Filter out NaN rows + nans = np.isnan(tab['time'].data) + if np.any(nans): + warnings.warn('Ignoring {0} rows with NaN times'.format(np.sum(nans))) + tab = tab[~nans] + + # Time column is dependent on source and we correct it here + reference_date = Time(hdu.header['BJDREFI'], hdu.header['BJDREFF'], + scale=hdu.header['TIMESYS'].lower(), format='jd') + time = reference_date + TimeDelta(tab['time'].data) + time.format = 'isot' + + # Remove original time column + tab.remove_column('time') + + return TimeSeries(time=time, data=tab) + + +registry.register_reader('kepler.fits', TimeSeries, kepler_fits_reader) +registry.register_reader('tess.fits', TimeSeries, kepler_fits_reader) diff --git a/testbed/astropy__astropy/astropy/timeseries/io/tests/__init__.py b/testbed/astropy__astropy/astropy/timeseries/io/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dce85d06f83264a6e502be0906d86bd976e1677 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/io/tests/__init__.py @@ -0,0 +1 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst diff --git a/testbed/astropy__astropy/astropy/timeseries/io/tests/test_kepler.py b/testbed/astropy__astropy/astropy/timeseries/io/tests/test_kepler.py new file mode 100644 index 0000000000000000000000000000000000000000..71aaafaef8b902d2e968ab46054161632cc10869 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/io/tests/test_kepler.py @@ -0,0 +1,88 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from unittest import mock + +import pytest + +from astropy.io.fits import HDUList, Header, PrimaryHDU, BinTableHDU +from astropy.utils.data import get_pkg_data_filename + +from astropy.timeseries.io.kepler import kepler_fits_reader + + +def fake_header(extver, version, timesys, telescop): + return Header({"SIMPLE": "T", + "BITPIX": 8, + "NAXIS": 0, + "EXTVER": extver, + "VERSION": version, + 'TIMESYS': "{}".format(timesys), + "TELESCOP": "{}".format(telescop)}) + + +def fake_hdulist(extver=1, version=2, timesys="TDB", telescop="KEPLER"): + new_header = fake_header(extver, version, timesys, telescop) + return [HDUList(hdus=[PrimaryHDU(header=new_header), + BinTableHDU(header=new_header, name="LIGHTCURVE")])] + + +@mock.patch("astropy.io.fits.open", side_effect=fake_hdulist(telescop="MadeUp")) +def test_raise_telescop_wrong(mock_file): + with pytest.raises(NotImplementedError) as exc: + kepler_fits_reader(None) + assert exc.value.args[0] == ("MadeUp is not implemented, only KEPLER or TESS are " + "supported through this reader") + + +@mock.patch("astropy.io.fits.open", side_effect=fake_hdulist(extver=2)) +def test_raise_extversion_kepler(mock_file): + with pytest.raises(NotImplementedError) as exc: + kepler_fits_reader(None) + assert exc.value.args[0] == ("Support for KEPLER v2 files not yet " + "implemented") + + +@mock.patch("astropy.io.fits.open", side_effect=fake_hdulist(extver=2, telescop="TESS")) +def test_raise_extversion_tess(mock_file): + with pytest.raises(NotImplementedError) as exc: + kepler_fits_reader(None) + assert exc.value.args[0] == ("Support for TESS v2 files not yet " + "implemented") + + +@mock.patch("astropy.io.fits.open", side_effect=fake_hdulist(timesys="TCB")) +def test_raise_timesys_kepler(mock_file): + with pytest.raises(NotImplementedError) as exc: + kepler_fits_reader(None) + assert exc.value.args[0] == ("Support for TCB time scale not yet " + "implemented in KEPLER reader") + + +@mock.patch("astropy.io.fits.open", side_effect=fake_hdulist(timesys="TCB", telescop="TESS")) +def test_raise_timesys_tess(mock_file): + with pytest.raises(NotImplementedError) as exc: + kepler_fits_reader(None) + assert exc.value.args[0] == ("Support for TCB time scale not yet " + "implemented in TESS reader") + + +@pytest.mark.remote_data(source='astropy') +def test_kepler_astropy(): + filename = get_pkg_data_filename('timeseries/kplr010666592-2009131110544_slc.fits') + timeseries = kepler_fits_reader(filename) + assert timeseries["time"].format == 'isot' + assert timeseries["time"].scale == 'tdb' + assert timeseries["sap_flux"].unit.to_string() == 'electron / s' + assert len(timeseries) == 14280 + assert len(timeseries.columns) == 20 + + +@pytest.mark.remote_data(source='astropy') +def test_tess_astropy(): + filename = get_pkg_data_filename('timeseries/hlsp_tess-data-alerts_tess_phot_00025155310-s01_tess_v1_lc.fits') + timeseries = kepler_fits_reader(filename) + assert timeseries["time"].format == 'isot' + assert timeseries["time"].scale == 'tdb' + assert timeseries["sap_flux"].unit.to_string() == 'electron / s' + assert len(timeseries) == 19261 + assert len(timeseries.columns) == 20 diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..439f6cd3051d82701fc3c9669645b452ed48a923 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/__init__.py @@ -0,0 +1,3 @@ +from astropy.timeseries.periodograms.base import * # noqa +from astropy.timeseries.periodograms.lombscargle import * # noqa +from astropy.timeseries.periodograms.bls import * # noqa diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/base.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/base.py new file mode 100644 index 0000000000000000000000000000000000000000..300ced2e9d174dc2a604eb9e8cc827af64f5cc41 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/base.py @@ -0,0 +1,56 @@ +import abc +import numpy as np +from astropy.timeseries import TimeSeries, BinnedTimeSeries + +__all__ = ['BasePeriodogram'] + + +class BasePeriodogram: + + @abc.abstractmethod + def __init__(self, t, y, dy=None): + pass + + @classmethod + def from_timeseries(cls, timeseries, signal_column_name=None, uncertainty=None, **kwargs): + """ + Initialize a periodogram from a time series object. + + If a binned time series is passed, the time at the center of the bins is + used. Also note that this method automatically gets rid of NaN/undefined + values when initalizing the periodogram. + + Parameters + ---------- + signal_column_name : str + The name of the column containing the signal values to use. + uncertainty : str or float or `~astropy.units.Quantity`, optional + The name of the column containing the errors on the signal, or the + value to use for the error, if a scalar. + **kwargs + Additional keyword arguments are passed to the initializer for this + periodogram class. + """ + + if signal_column_name is None: + raise ValueError('signal_column_name should be set to a valid column name') + + y = timeseries[signal_column_name] + keep = ~np.isnan(y) + + if isinstance(uncertainty, str): + dy = timeseries[uncertainty] + keep &= ~np.isnan(dy) + dy = dy[keep] + else: + dy = uncertainty + + if isinstance(timeseries, TimeSeries): + time = timeseries.time + elif isinstance(timeseries, BinnedTimeSeries): + time = timeseries.time_bin_center + else: + raise TypeError('Input time series should be an instance of ' + 'TimeSeries or BinnedTimeSeries') + + return cls(time[keep], y[keep], dy=dy, **kwargs) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d4504656b89c02da4c31cde22de0d7d23e31f68 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/__init__.py @@ -0,0 +1,14 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +Box Least Squares +================= + +AstroPy-compatible reference implementation of the transit periorogram used +to discover transiting exoplanets. + +""" + +__all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"] + +from .core import BoxLeastSquares, BoxLeastSquaresResults diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/_impl.pyx b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/_impl.pyx new file mode 100644 index 0000000000000000000000000000000000000000..e104b401538f3a54a678f012928ab03b3653f549 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/_impl.pyx @@ -0,0 +1,96 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +#cython: language_level=3 + +import numpy as np +cimport numpy as np + +cimport cython + +from libc.math cimport sqrt +from libc.stdlib cimport malloc, free + +DTYPE = np.float64 +ctypedef np.float64_t DTYPE_t + +IDTYPE = np.int64 +ctypedef np.int64_t IDTYPE_t + +cdef extern int run_bls ( + int N, # Length of the time array + double* t, # The list of timestamps + double* y, # The y measured at ``t`` + double* ivar, # The inverse variance of the y array + + int n_periods, # + double* periods, # The period to test in units of ``t`` + + int n_durations, # Length of the durations array + double* durations, # The durations to test in units of ``bin_duration`` + int oversample, # The number of ``bin_duration`` bins in the maximum duration + + int obj_flag, # A flag indicating the periodogram type + # 0 - depth signal-to-noise + # 1 - log likelihood + + # Outputs + double* best_objective, # The value of the periodogram at maximum + double* best_depth, # The estimated depth at maximum + double* best_depth_std, # The uncertainty on ``best_depth`` + double* best_duration, # The best fitting duration in units of ``t`` + double* best_phase, # The phase of the mid-transit time in units of + # ``t`` + double* best_depth_snr, # The signal-to-noise ratio of the depth estimate + double* best_log_like # The log likelihood at maximum +) nogil + + +@cython.cdivision(True) +@cython.boundscheck(False) +@cython.wraparound(False) +def bls_impl( + np.ndarray[DTYPE_t, mode='c'] t_array, + np.ndarray[DTYPE_t, mode='c'] y_array, + np.ndarray[DTYPE_t, mode='c'] ivar_array, + np.ndarray[DTYPE_t, mode='c'] period_array, + np.ndarray[DTYPE_t, mode='c'] duration_array, + int oversample, + int obj_flag +): + + cdef np.ndarray[DTYPE_t, mode='c'] out_objective = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_depth = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_depth_err = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_duration = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_phase = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_depth_snr = np.empty_like(period_array, dtype=DTYPE) + cdef np.ndarray[DTYPE_t, mode='c'] out_log_like = np.empty_like(period_array, dtype=DTYPE) + cdef int flag, N = len(t_array), n_periods = len(period_array), n_durations = len(duration_array) + + with nogil: + flag = run_bls( + N, + t_array.data, + y_array.data, + ivar_array.data, + n_periods, + period_array.data, + n_durations, + duration_array.data, + oversample, + obj_flag, + out_objective.data, + out_depth.data, + out_depth_err.data, + out_duration.data, + out_phase.data, + out_depth_snr.data, + out_log_like.data + ) + + if flag < 0: + raise MemoryError() + if flag > 0: + raise ValueError("Invalid inputs for period and/or duration") + + return (out_objective, out_depth, out_depth_err, out_duration, out_phase, + out_depth_snr, out_log_like) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/bls.c b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/bls.c new file mode 100644 index 0000000000000000000000000000000000000000..810218f8f763d49ce3b0c6b7a775dd1cd5b1fc09 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/bls.c @@ -0,0 +1,224 @@ +/* Licensed under a 3-clause BSD style license - see LICENSE.rst */ + +#include +#include +#include + +#if defined(_OPENMP) +#include +#endif + +#ifndef INFINITY +#define INFINITY (1.0 / 0.0) +#endif + +void compute_objective( + double y_in, + double y_out, + double ivar_in, + double ivar_out, + int obj_flag, + double* objective, + double* log_likelihood, + double* depth, + double* depth_err, + double* depth_snr +) { + if (obj_flag) { + double arg = y_out - y_in; + *log_likelihood = 0.5*ivar_in*arg*arg; + *objective = *log_likelihood; + } else { + *depth = y_out - y_in; + *depth_err = sqrt(1.0 / ivar_in + 1.0 / ivar_out); + *depth_snr = *depth / *depth_err; + *objective = *depth_snr; + } +} + +inline double wrap_into (double x, double period) +{ + return x - period * floor(x / period); +} + +int run_bls ( + // Inputs + int N, // Length of the time array + double* t, // The list of timestamps + double* y, // The y measured at ``t`` + double* ivar, // The inverse variance of the y array + + int n_periods, + double* periods, // The period to test in units of ``t`` + + int n_durations, // Length of the durations array + double* durations, // The durations to test in units of ``bin_duration`` + int oversample, // The number of ``bin_duration`` bins in the maximum duration + + int obj_flag, // A flag indicating the periodogram type + // 0 - depth signal-to-noise + // 1 - log likelihood + + // Outputs + double* best_objective, // The value of the periodogram at maximum + double* best_depth, // The estimated depth at maximum + double* best_depth_err, // The uncertainty on ``best_depth`` + double* best_duration, // The best fitting duration in units of ``t`` + double* best_phase, // The phase of the mid-transit time in units of + // ``t`` + double* best_depth_snr, // The signal-to-noise ratio of the depth estimate + double* best_log_like // The log likelihood at maximum +) { + // Start by finding the period and duration ranges + double max_period = periods[0], min_period = periods[0]; + int k; + for (k = 1; k < n_periods; ++k) { + if (periods[k] < min_period) min_period = periods[k]; + if (periods[k] > max_period) max_period = periods[k]; + } + if (min_period < DBL_EPSILON) return 1; + double min_duration = durations[0], max_duration = durations[0]; + for (k = 1; k < n_durations; ++k) { + if (durations[k] < min_duration) min_duration = durations[k]; + if (durations[k] > max_duration) max_duration = durations[k]; + } + if ((max_duration > min_period) || (min_duration < DBL_EPSILON)) return 2; + + // Compute the durations in terms of bin_duration + double bin_duration = min_duration / ((double)oversample); + int max_n_bins = (int)(ceil(max_period / bin_duration)) + oversample; + + int nthreads, blocksize = max_n_bins+1; +#pragma omp parallel +{ +#if defined(_OPENMP) + nthreads = omp_get_num_threads(); +#else + nthreads = 1; +#endif +} + + // Allocate the work arrays + double* mean_y_0 = (double*)malloc(nthreads*blocksize*sizeof(double)); + if (mean_y_0 == NULL) { + return -2; + } + double* mean_ivar_0 = (double*)malloc(nthreads*blocksize*sizeof(double)); + if (mean_ivar_0 == NULL) { + free(mean_y_0); + return -3; + } + + // Pre-accumulate some factors. + double min_t = INFINITY; + double sum_y = 0.0, sum_ivar = 0.0; + int i; + #pragma omp parallel for reduction(+:sum_y), reduction(+:sum_ivar) + for (i = 0; i < N; ++i) { + min_t = fmin(min_t, t[i]); + sum_y += y[i] * ivar[i]; + sum_ivar += ivar[i]; + } + + // Loop over periods and do the search + int p; + #pragma omp parallel for + for (p = 0; p < n_periods; ++p) { +#if defined(_OPENMP) + int ithread = omp_get_thread_num(); +#else + int ithread = 0; +#endif + int block = blocksize * ithread; + double period = periods[p]; + int n_bins = (int)(ceil(period / bin_duration)) + oversample; + + double* mean_y = mean_y_0 + block; + double* mean_ivar = mean_ivar_0 + block; + + // This first pass bins the data into a fine-grain grid in phase from zero + // to period and computes the weighted sum and inverse variance for each + // bin. + int n, ind; + for (n = 0; n < n_bins+1; ++n) { + mean_y[n] = 0.0; + mean_ivar[n] = 0.0; + } + for (n = 0; n < N; ++n) { + int ind = (int)(wrap_into(t[n] - min_t, period) / bin_duration) + 1; + mean_y[ind] += y[n] * ivar[n]; + mean_ivar[ind] += ivar[n]; + } + + // To simplify calculations below, we wrap the binned values around and pad + // the end of the array with the first ``oversample`` samples. + for (n = 1, ind = n_bins - oversample; n <= oversample; ++n, ++ind) { + mean_y[ind] = mean_y[n]; + mean_ivar[ind] = mean_ivar[n]; + } + + // To compute the estimates of the in-transit flux, we need the sum of + // mean_y and mean_ivar over a given set of transit points. To get this + // fast, we can compute the cumulative sum and then use differences between + // points separated by ``duration`` bins. Here we convert the mean arrays + // to cumulative sums. + for (n = 1; n <= n_bins; ++n) { + mean_y[n] += mean_y[n-1]; + mean_ivar[n] += mean_ivar[n-1]; + } + + // Then we loop over phases (in steps of n_bin) and durations and find the + // best fit value. By looping over durations here, we get to reuse a lot of + // the computations that we did above. + double objective, log_like, depth, depth_err, depth_snr; + best_objective[p] = -INFINITY; + int k; + for (k = 0; k < n_durations; ++k) { + int dur = (int)(round(durations[k] / bin_duration)); + int n_max = n_bins-dur; + for (n = 0; n <= n_max; ++n) { + // Estimate the in-transit and out-of-transit flux + double y_in = mean_y[n+dur] - mean_y[n]; + double ivar_in = mean_ivar[n+dur] - mean_ivar[n]; + double y_out = sum_y - y_in; + double ivar_out = sum_ivar - ivar_in; + + // Skip this model if there are no points in transit + if ((ivar_in < DBL_EPSILON) || (ivar_out < DBL_EPSILON)) { + continue; + } + + // Normalize to compute the actual value of the flux + y_in /= ivar_in; + y_out /= ivar_out; + + // Either compute the log likelihood or the signal-to-noise + // ratio + compute_objective(y_in, y_out, ivar_in, ivar_out, obj_flag, + &objective, &log_like, &depth, &depth_err, &depth_snr); + + // If this is the best result seen so far, keep it + if (y_out >= y_in && objective > best_objective[p]) { + best_objective[p] = objective; + + // Compute the other parameters + compute_objective(y_in, y_out, ivar_in, ivar_out, (obj_flag == 0), + &objective, &log_like, &depth, &depth_err, &depth_snr); + + best_depth[p] = depth; + best_depth_err[p] = depth_err; + best_depth_snr[p] = depth_snr; + best_log_like[p] = log_like; + best_duration[p] = dur * bin_duration; + best_phase[p] = fmod(n*bin_duration + 0.5*best_duration[p] + min_t, period); + } + } + } + } + + // Clean up + free(mean_y_0); + free(mean_ivar_0); + + return 0; +} diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/core.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/core.py new file mode 100644 index 0000000000000000000000000000000000000000..54e3d67b07452bdd1575ef5a917e9c7946bfa450 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/core.py @@ -0,0 +1,817 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +__all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"] + +import numpy as np + +from astropy import units +from astropy.time import Time, TimeDelta +from astropy.timeseries.periodograms.lombscargle.core import has_units, strip_units +from astropy import units as u +from . import methods +from astropy.timeseries.periodograms.base import BasePeriodogram + + +def validate_unit_consistency(reference_object, input_object): + if has_units(reference_object): + input_object = units.Quantity(input_object, unit=reference_object.unit) + else: + if has_units(input_object): + input_object = units.Quantity(input_object, unit=units.one) + input_object = input_object.value + return input_object + + +class BoxLeastSquares(BasePeriodogram): + """Compute the box least squares periodogram + + This method is a commonly used tool for discovering transiting exoplanets + or eclipsing binaries in photometric time series datasets. This + implementation is based on the "box least squares (BLS)" method described + in [1]_ and [2]_. + + Parameters + ---------- + t : array-like, `~astropy.units.Quantity`, `~astropy.time.Time`, or `~astropy.time.TimeDelta` + Sequence of observation times. + y : array-like or `~astropy.units.Quantity` + Sequence of observations associated with times ``t``. + dy : float, array-like or `~astropy.units.Quantity`, optional + Error or sequence of observational errors associated with times ``t``. + + Examples + -------- + Generate noisy data with a transit: + + >>> rand = np.random.RandomState(42) + >>> t = rand.uniform(0, 10, 500) + >>> y = np.ones_like(t) + >>> y[np.abs((t + 1.0)%2.0-1)<0.08] = 1.0 - 0.1 + >>> y += 0.01 * rand.randn(len(t)) + + Compute the transit periodogram on a heuristically determined period grid + and find the period with maximum power: + + >>> model = BoxLeastSquares(t, y) + >>> results = model.autopower(0.16) + >>> results.period[np.argmax(results.power)] # doctest: +FLOAT_CMP + 1.9923406038842544 + + Compute the periodogram on a user-specified period grid: + + >>> periods = np.linspace(1.9, 2.1, 5) + >>> results = model.power(periods, 0.16) + >>> results.power # doctest: +FLOAT_CMP + array([0.01421067, 0.02842475, 0.10867671, 0.05117755, 0.01783253]) + + If the inputs are AstroPy Quantities with units, the units will be + validated and the outputs will also be Quantities with appropriate units: + + >>> from astropy import units as u + >>> t = t * u.day + >>> y = y * u.dimensionless_unscaled + >>> model = BoxLeastSquares(t, y) + >>> results = model.autopower(0.16 * u.day) + >>> results.period.unit + Unit("d") + >>> results.power.unit + Unit(dimensionless) + + References + ---------- + .. [1] Kovacs, Zucker, & Mazeh (2002), A&A, 391, 369 + (arXiv:astro-ph/0206099) + .. [2] Hartman & Bakos (2016), Astronomy & Computing, 17, 1 + (arXiv:1605.06811) + + """ + + def __init__(self, t, y, dy=None): + + # If t is a TimeDelta, convert it to a quantity. The units we convert + # to don't really matter since the user gets a Quantity back at the end + # so can convert to any units they like. + if isinstance(t, TimeDelta): + t = t.to('day') + + # We want to expose self.t as being the times the user passed in, but + # if the times are absolute, we need to convert them to relative times + # internally, so we use self._trel and self._tstart for this. + + self.t = t + + if isinstance(self.t, Time): + self._tstart = self.t[0] + trel = (self.t - self._tstart).to(u.day) + else: + self._tstart = None + trel = self.t + + self._trel, self.y, self.dy = self._validate_inputs(trel, y, dy) + + def autoperiod(self, duration, + minimum_period=None, maximum_period=None, + minimum_n_transit=3, frequency_factor=1.0): + """Determine a suitable grid of periods + + This method uses a set of heuristics to select a conservative period + grid that is uniform in frequency. This grid might be too fine for + some user's needs depending on the precision requirements or the + sampling of the data. The grid can be made coarser by increasing + ``frequency_factor``. + + Parameters + ---------- + duration : float, array-like or `~astropy.units.Quantity` + The set of durations that will be considered. + minimum_period, maximum_period : float or `~astropy.units.Quantity`, optional + The minimum/maximum periods to search. If not provided, these will + be computed as described in the notes below. + minimum_n_transits : int, optional + If ``maximum_period`` is not provided, this is used to compute the + maximum period to search by asserting that any systems with at + least ``minimum_n_transits`` will be within the range of searched + periods. Note that this is not the same as requiring that + ``minimum_n_transits`` be required for detection. The default + value is ``3``. + frequency_factor : float, optional + A factor to control the frequency spacing as described in the + notes below. The default value is ``1.0``. + + Returns + ------- + period : array-like or `~astropy.units.Quantity` + The set of periods computed using these heuristics with the same + units as ``t``. + + Notes + ----- + The default minimum period is chosen to be twice the maximum duration + because there won't be much sensitivity to periods shorter than that. + + The default maximum period is computed as + + .. code-block:: python + + maximum_period = (max(t) - min(t)) / minimum_n_transits + + ensuring that any systems with at least ``minimum_n_transits`` are + within the range of searched periods. + + The frequency spacing is given by + + .. code-block:: python + + df = frequency_factor * min(duration) / (max(t) - min(t))**2 + + so the grid can be made finer by decreasing ``frequency_factor`` or + coarser by increasing ``frequency_factor``. + + """ + + duration = self._validate_duration(duration) + baseline = strip_units((self._trel.max() - self._trel.min())) + min_duration = strip_units(np.min(duration)) + + # Estimate the required frequency spacing + # Because of the sparsity of a transit, this must be much finer than + # the frequency resolution for a sinusoidal fit. For a sinusoidal fit, + # df would be 1/baseline (see LombScargle), but here this should be + # scaled proportionally to the duration in units of baseline. + df = frequency_factor * min_duration / baseline**2 + + # If a minimum period is not provided, choose one that is twice the + # maximum duration because we won't be sensitive to any periods + # shorter than that. + if minimum_period is None: + minimum_period = 2.0 * strip_units(np.max(duration)) + else: + minimum_period = validate_unit_consistency(self._trel, minimum_period) + minimum_period = strip_units(minimum_period) + + # If no maximum period is provided, choose one by requiring that + # all signals with at least minimum_n_transit should be detectable. + if maximum_period is None: + if minimum_n_transit <= 1: + raise ValueError("minimum_n_transit must be greater than 1") + maximum_period = baseline / (minimum_n_transit-1) + else: + maximum_period = validate_unit_consistency(self._trel, maximum_period) + maximum_period = strip_units(maximum_period) + + if maximum_period < minimum_period: + minimum_period, maximum_period = maximum_period, minimum_period + if minimum_period <= 0.0: + raise ValueError("minimum_period must be positive") + + # Convert bounds to frequency + minimum_frequency = 1.0/strip_units(maximum_period) + maximum_frequency = 1.0/strip_units(minimum_period) + + # Compute the number of frequencies and the frequency grid + nf = 1 + int(np.round((maximum_frequency - minimum_frequency)/df)) + return 1.0/(maximum_frequency-df*np.arange(nf)) * self._t_unit() + + def autopower(self, duration, objective=None, method=None, oversample=10, + minimum_n_transit=3, minimum_period=None, + maximum_period=None, frequency_factor=1.0): + """Compute the periodogram at set of heuristically determined periods + + This method calls :func:`BoxLeastSquares.autoperiod` to determine + the period grid and then :func:`BoxLeastSquares.power` to compute + the periodogram. See those methods for documentation of the arguments. + + """ + period = self.autoperiod(duration, + minimum_n_transit=minimum_n_transit, + minimum_period=minimum_period, + maximum_period=maximum_period, + frequency_factor=frequency_factor) + return self.power(period, duration, objective=objective, method=method, + oversample=oversample) + + def power(self, period, duration, objective=None, method=None, + oversample=10): + """Compute the periodogram for a set of periods + + Parameters + ---------- + period : array-like or `~astropy.units.Quantity` + The periods where the power should be computed + duration : float, array-like or `~astropy.units.Quantity` + The set of durations to test + objective : {'likelihood', 'snr'}, optional + The scalar that should be optimized to find the best fit phase, + duration, and depth. This can be either ``'likelihood'`` (default) + to optimize the log-likelihood of the model, or ``'snr'`` to + optimize the signal-to-noise with which the transit depth is + measured. + method : {'fast', 'slow'}, optional + The computational method used to compute the periodogram. This is + mainly included for the purposes of testing and most users will + want to use the optimized ``'fast'`` method (default) that is + implemented in Cython. ``'slow'`` is a brute-force method that is + used to test the results of the ``'fast'`` method. + oversample : int, optional + The number of bins per duration that should be used. This sets the + time resolution of the phase fit with larger values of + ``oversample`` yielding a finer grid and higher computational cost. + + Returns + ------- + results : BoxLeastSquaresResults + The periodogram results as a :class:`BoxLeastSquaresResults` + object. + + Raises + ------ + ValueError + If ``oversample`` is not an integer greater than 0 or if + ``objective`` or ``method`` are not valid. + + """ + period, duration = self._validate_period_and_duration(period, duration) + + # Check for absurdities in the ``oversample`` choice + try: + oversample = int(oversample) + except TypeError: + raise ValueError("oversample must be an int, got {0}" + .format(oversample)) + if oversample < 1: + raise ValueError("oversample must be greater than or equal to 1") + + # Select the periodogram objective + if objective is None: + objective = "likelihood" + allowed_objectives = ["snr", "likelihood"] + if objective not in allowed_objectives: + raise ValueError(("Unrecognized method '{0}'\n" + "allowed methods are: {1}") + .format(objective, allowed_objectives)) + use_likelihood = (objective == "likelihood") + + # Select the computational method + if method is None: + method = "fast" + allowed_methods = ["fast", "slow"] + if method not in allowed_methods: + raise ValueError(("Unrecognized method '{0}'\n" + "allowed methods are: {1}") + .format(method, allowed_methods)) + + # Format and check the input arrays + t = np.ascontiguousarray(strip_units(self._trel), dtype=np.float64) + y = np.ascontiguousarray(strip_units(self.y), dtype=np.float64) + if self.dy is None: + ivar = np.ones_like(y) + else: + ivar = 1.0 / np.ascontiguousarray(strip_units(self.dy), + dtype=np.float64)**2 + + # Make sure that the period and duration arrays are C-order + period_fmt = np.ascontiguousarray(strip_units(period), + dtype=np.float64) + duration = np.ascontiguousarray(strip_units(duration), + dtype=np.float64) + + # Select the correct implementation for the chosen method + if method == "fast": + bls = methods.bls_fast + else: + bls = methods.bls_slow + + # Run the implementation + results = bls( + t, y - np.median(y), ivar, period_fmt, duration, + oversample, use_likelihood) + + return self._format_results(objective, period, results) + + def _as_relative_time(self, name, times): + """ + Convert the provided times (if absolute) to relative times using the + current _tstart value. If the times provided are relative, they are + returned without conversion (though we still do some checks). + """ + + if isinstance(times, TimeDelta): + times = times.to('day') + + if self._tstart is None: + if isinstance(times, Time): + raise TypeError('{0} was provided as an absolute time but ' + 'the BoxLeastSquares class was initialized ' + 'with relative times.'.format(name)) + else: + if isinstance(times, Time): + times = (times - self._tstart).to(u.day) + else: + raise TypeError('{0} was provided as a relative time but ' + 'the BoxLeastSquares class was initialized ' + 'with absolute times.'.format(name)) + + times = validate_unit_consistency(self._trel, times) + + return times + + def _as_absolute_time_if_needed(self, name, times): + """ + Convert the provided times to absolute times using the current _tstart + value, if needed. + """ + if self._tstart is not None: + # Some time formats/scales can't represent dates/times too far + # off from the present, so we need to mask values offset by + # more than 100,000 yr (the periodogram algorithm can return + # transit times of e.g 1e300 for some periods). + reset = np.abs(times.to_value(u.year)) > 100000 + times[reset] = 0 + times = self._tstart + times + times[reset] = np.nan + return times + + def model(self, t_model, period, duration, transit_time): + """Compute the transit model at the given period, duration, and phase + + Parameters + ---------- + t_model : array-like or `~astropy.units.Quantity` or `~astropy.time.Time` + Times at which to compute the model. + period : float or `~astropy.units.Quantity` + The period of the transits. + duration : float or `~astropy.units.Quantity` + The duration of the transit. + transit_time : float or `~astropy.units.Quantity` or `~astropy.time.Time` + The mid-transit time of a reference transit. + + Returns + ------- + y_model : array-like or `~astropy.units.Quantity` + The model evaluated at the times ``t_model`` with units of ``y``. + + """ + + period, duration = self._validate_period_and_duration(period, duration) + + transit_time = self._as_relative_time('transit_time', transit_time) + t_model = strip_units(self._as_relative_time('t_model', t_model)) + + period = float(strip_units(period)) + duration = float(strip_units(duration)) + transit_time = float(strip_units(transit_time)) + + t = np.ascontiguousarray(strip_units(self._trel), dtype=np.float64) + y = np.ascontiguousarray(strip_units(self.y), dtype=np.float64) + if self.dy is None: + ivar = np.ones_like(y) + else: + ivar = 1.0 / np.ascontiguousarray(strip_units(self.dy), + dtype=np.float64)**2 + + # Compute the depth + hp = 0.5*period + m_in = np.abs((t-transit_time+hp) % period - hp) < 0.5*duration + m_out = ~m_in + y_in = np.sum(y[m_in] * ivar[m_in]) / np.sum(ivar[m_in]) + y_out = np.sum(y[m_out] * ivar[m_out]) / np.sum(ivar[m_out]) + + # Evaluate the model + y_model = y_out + np.zeros_like(t_model) + m_model = np.abs((t_model-transit_time+hp) % period-hp) < 0.5*duration + y_model[m_model] = y_in + + return y_model * self._y_unit() + + def compute_stats(self, period, duration, transit_time): + """Compute descriptive statistics for a given transit model + + These statistics are commonly used for vetting of transit candidates. + + Parameters + ---------- + period : float or `~astropy.units.Quantity` + The period of the transits. + duration : float or `~astropy.units.Quantity` + The duration of the transit. + transit_time : float or `~astropy.units.Quantity` or `~astropy.time.Time` + The mid-transit time of a reference transit. + + Returns + ------- + stats : dict + A dictionary containing several descriptive statistics: + + - ``depth``: The depth and uncertainty (as a tuple with two + values) on the depth for the fiducial model. + - ``depth_odd``: The depth and uncertainty on the depth for a + model where the period is twice the fiducial period. + - ``depth_even``: The depth and uncertainty on the depth for a + model where the period is twice the fiducial period and the + phase is offset by one orbital period. + - ``depth_half``: The depth and uncertainty for a model with a + period of half the fiducial period. + - ``depth_phased``: The depth and uncertainty for a model with the + fiducial period and the phase offset by half a period. + - ``harmonic_amplitude``: The amplitude of the best fit sinusoidal + model. + - ``harmonic_delta_log_likelihood``: The difference in log + likelihood between a sinusoidal model and the transit model. + If ``harmonic_delta_log_likelihood`` is greater than zero, the + sinusoidal model is preferred. + - ``transit_times``: The mid-transit time for each transit in the + baseline. + - ``per_transit_count``: An array with a count of the number of + data points in each unique transit included in the baseline. + - ``per_transit_log_likelihood``: An array with the value of the + log likelihood for each unique transit included in the + baseline. + + """ + + period, duration = self._validate_period_and_duration(period, duration) + transit_time = self._as_relative_time('transit_time', transit_time) + + period = float(strip_units(period)) + duration = float(strip_units(duration)) + transit_time = float(strip_units(transit_time)) + + t = np.ascontiguousarray(strip_units(self._trel), dtype=np.float64) + y = np.ascontiguousarray(strip_units(self.y), dtype=np.float64) + if self.dy is None: + ivar = np.ones_like(y) + else: + ivar = 1.0 / np.ascontiguousarray(strip_units(self.dy), + dtype=np.float64)**2 + + # This a helper function that will compute the depth for several + # different hypothesized transit models with different parameters + def _compute_depth(m, y_out=None, var_out=None): + if np.any(m) and (var_out is None or np.isfinite(var_out)): + var_m = 1.0 / np.sum(ivar[m]) + y_m = np.sum(y[m] * ivar[m]) * var_m + if y_out is None: + return y_m, var_m + return y_out - y_m, np.sqrt(var_m + var_out) + return 0.0, np.inf + + # Compute the depth of the fiducial model and the two models at twice + # the period + hp = 0.5*period + m_in = np.abs((t-transit_time+hp) % period - hp) < 0.5*duration + m_out = ~m_in + m_odd = np.abs((t-transit_time) % (2*period) - period) \ + < 0.5*duration + m_even = np.abs((t-transit_time+period) % (2*period) - period) \ + < 0.5*duration + + y_out, var_out = _compute_depth(m_out) + depth = _compute_depth(m_in, y_out, var_out) + depth_odd = _compute_depth(m_odd, y_out, var_out) + depth_even = _compute_depth(m_even, y_out, var_out) + y_in = y_out - depth[0] + + # Compute the depth of the model at a phase of 0.5*period + m_phase = np.abs((t-transit_time) % period - hp) < 0.5*duration + depth_phase = _compute_depth(m_phase, + *_compute_depth((~m_phase) & m_out)) + + # Compute the depth of a model with a period of 0.5*period + m_half = np.abs((t-transit_time+0.25*period) % (0.5*period) + - 0.25*period) < 0.5*duration + depth_half = _compute_depth(m_half, *_compute_depth(~m_half)) + + # Compute the number of points in each transit + transit_id = np.round((t[m_in]-transit_time) / period).astype(int) + transit_times = period * np.arange(transit_id.min(), + transit_id.max()+1) + transit_time + unique_ids, unique_counts = np.unique(transit_id, + return_counts=True) + unique_ids -= np.min(transit_id) + transit_id -= np.min(transit_id) + counts = np.zeros(np.max(transit_id) + 1, dtype=int) + counts[unique_ids] = unique_counts + + # Compute the per-transit log likelihood + ll = -0.5 * ivar[m_in] * ((y[m_in] - y_in)**2 - (y[m_in] - y_out)**2) + lls = np.zeros(len(counts)) + for i in unique_ids: + lls[i] = np.sum(ll[transit_id == i]) + full_ll = -0.5*np.sum(ivar[m_in] * (y[m_in] - y_in)**2) + full_ll -= 0.5*np.sum(ivar[m_out] * (y[m_out] - y_out)**2) + + # Compute the log likelihood of a sine model + A = np.vstack(( + np.sin(2*np.pi*t/period), np.cos(2*np.pi*t/period), + np.ones_like(t) + )).T + w = np.linalg.solve(np.dot(A.T, A * ivar[:, None]), + np.dot(A.T, y * ivar)) + mod = np.dot(A, w) + sin_ll = -0.5*np.sum((y-mod)**2*ivar) + + # Format the results + y_unit = self._y_unit() + ll_unit = 1 + if self.dy is None: + ll_unit = y_unit * y_unit + return dict( + transit_times=self._as_absolute_time_if_needed('transit_times', transit_times * self._t_unit()), + per_transit_count=counts, + per_transit_log_likelihood=lls * ll_unit, + depth=(depth[0] * y_unit, depth[1] * y_unit), + depth_phased=(depth_phase[0] * y_unit, depth_phase[1] * y_unit), + depth_half=(depth_half[0] * y_unit, depth_half[1] * y_unit), + depth_odd=(depth_odd[0] * y_unit, depth_odd[1] * y_unit), + depth_even=(depth_even[0] * y_unit, depth_even[1] * y_unit), + harmonic_amplitude=np.sqrt(np.sum(w[:2]**2)) * y_unit, + harmonic_delta_log_likelihood=(sin_ll - full_ll) * ll_unit, + ) + + def transit_mask(self, t, period, duration, transit_time): + """Compute which data points are in transit for a given parameter set + + Parameters + ---------- + t_model : array-like or `~astropy.units.Quantity` + Times where the mask should be evaluated. + period : float or `~astropy.units.Quantity` + The period of the transits. + duration : float or `~astropy.units.Quantity` + The duration of the transit. + transit_time : float or `~astropy.units.Quantity` or `~astropy.time.Time` + The mid-transit time of a reference transit. + + Returns + ------- + transit_mask : array-like + A boolean array where ``True`` indicates and in transit point and + ``False`` indicates and out-of-transit point. + + """ + + period, duration = self._validate_period_and_duration(period, duration) + transit_time = self._as_relative_time('transit_time', transit_time) + t = strip_units(self._as_relative_time('t', t)) + + period = float(strip_units(period)) + duration = float(strip_units(duration)) + transit_time = float(strip_units(transit_time)) + + hp = 0.5*period + return np.abs((t-transit_time+hp) % period - hp) < 0.5*duration + + def _validate_inputs(self, t, y, dy): + """Private method used to check the consistency of the inputs + + Parameters + ---------- + t : array-like, `~astropy.units.Quantity`, `~astropy.time.Time`, or `~astropy.time.TimeDelta` + Sequence of observation times. + y : array-like or `~astropy.units.Quantity` + Sequence of observations associated with times t. + dy : float, array-like or `~astropy.units.Quantity` + Error or sequence of observational errors associated with times t. + + Returns + ------- + t, y, dy : array-like or `~astropy.units.Quantity` or `~astropy.time.Time` + The inputs with consistent shapes and units. + Raises + ------ + ValueError + If the dimensions are incompatible or if the units of dy cannot be + converted to the units of y. + + """ + + # Validate shapes of inputs + if dy is None: + t, y = np.broadcast_arrays(t, y, subok=True) + else: + t, y, dy = np.broadcast_arrays(t, y, dy, subok=True) + if t.ndim != 1: + raise ValueError("Inputs (t, y, dy) must be 1-dimensional") + + # validate units of inputs if any is a Quantity + if dy is not None: + dy = validate_unit_consistency(y, dy) + + return t, y, dy + + def _validate_duration(self, duration): + """Private method used to check a set of test durations + + Parameters + ---------- + duration : float, array-like or `~astropy.units.Quantity` + The set of durations that will be considered. + + Returns + ------- + duration : array-like or `~astropy.units.Quantity` + The input reformatted with the correct shape and units. + + Raises + ------ + ValueError + If the units of duration cannot be converted to the units of t. + + """ + duration = np.atleast_1d(np.abs(duration)) + if duration.ndim != 1 or duration.size == 0: + raise ValueError("duration must be 1-dimensional") + return validate_unit_consistency(self._trel, duration) + + def _validate_period_and_duration(self, period, duration): + """Private method used to check a set of periods and durations + + Parameters + ---------- + period : float, array-like or `~astropy.units.Quantity` + The set of test periods. + duration : float, array-like or `~astropy.units.Quantity` + The set of durations that will be considered. + + Returns + ------- + period, duration : array-like or `~astropy.units.Quantity` + The inputs reformatted with the correct shapes and units. + + Raises + ------ + ValueError + If the units of period or duration cannot be converted to the + units of t. + + """ + duration = self._validate_duration(duration) + period = np.atleast_1d(np.abs(period)) + if period.ndim != 1 or period.size == 0: + raise ValueError("period must be 1-dimensional") + period = validate_unit_consistency(self._trel, period) + + if not np.min(period) > np.max(duration): + raise ValueError("The maximum transit duration must be shorter " + "than the minimum period") + + return period, duration + + def _format_results(self, objective, period, results): + """A private method used to wrap and add units to the periodogram + + Parameters + ---------- + objective : string + The name of the objective used in the optimization. + period : array-like or `~astropy.units.Quantity` + The set of trial periods. + results : tuple + The output of one of the periodogram implementations. + + """ + (power, depth, depth_err, duration, transit_time, depth_snr, + log_likelihood) = results + + if has_units(self._trel): + transit_time = units.Quantity(transit_time, unit=self._trel.unit) + transit_time = self._as_absolute_time_if_needed('transit_time', transit_time) + duration = units.Quantity(duration, unit=self._trel.unit) + + if has_units(self.y): + depth = units.Quantity(depth, unit=self.y.unit) + depth_err = units.Quantity(depth_err, unit=self.y.unit) + + depth_snr = units.Quantity(depth_snr, unit=units.one) + + if self.dy is None: + if objective == "likelihood": + power = units.Quantity(power, unit=self.y.unit**2) + else: + power = units.Quantity(power, unit=units.one) + log_likelihood = units.Quantity(log_likelihood, + unit=self.y.unit**2) + else: + power = units.Quantity(power, unit=units.one) + log_likelihood = units.Quantity(log_likelihood, unit=units.one) + + return BoxLeastSquaresResults( + objective, period, power, depth, depth_err, duration, transit_time, + depth_snr, log_likelihood) + + def _t_unit(self): + if has_units(self._trel): + return self._trel.unit + else: + return 1 + + def _y_unit(self): + if has_units(self.y): + return self.y.unit + else: + return 1 + + +class BoxLeastSquaresResults(dict): + """The results of a BoxLeastSquares search + + Attributes + ---------- + objective : string + The scalar used to optimize to find the best fit phase, duration, and + depth. See :func:`BoxLeastSquares.power` for more information. + period : array-like or `~astropy.units.Quantity` + The set of test periods. + power : array-like or `~astropy.units.Quantity` + The periodogram evaluated at the periods in ``period``. If + ``objective`` is: + + * ``'likelihood'``: the values of ``power`` are the + log likelihood maximized over phase, depth, and duration, or + * ``'snr'``: the values of ``power`` are the signal-to-noise with + which the depth is measured maximized over phase, depth, and + duration. + + depth : array-like or `~astropy.units.Quantity` + The estimated depth of the maximum power model at each period. + depth_err : array-like or `~astropy.units.Quantity` + The 1-sigma uncertainty on ``depth``. + duration : array-like or `~astropy.units.Quantity` + The maximum power duration at each period. + transit_time : array-like or `~astropy.units.Quantity` or `~astropy.time.Time` + The maximum power phase of the transit in units of time. This + indicates the mid-transit time and it will always be in the range + (0, period). + depth_snr : array-like or `~astropy.units.Quantity` + The signal-to-noise with which the depth is measured at maximum power. + log_likelihood : array-like or `~astropy.units.Quantity` + The log likelihood of the maximum power model. + + """ + def __init__(self, *args): + super().__init__(zip( + ("objective", "period", "power", "depth", "depth_err", + "duration", "transit_time", "depth_snr", "log_likelihood"), + args + )) + + def __getattr__(self, name): + try: + return self[name] + except KeyError: + raise AttributeError(name) + + __setattr__ = dict.__setitem__ + __delattr__ = dict.__delitem__ + + def __repr__(self): + if self.keys(): + m = max(map(len, list(self.keys()))) + 1 + return '\n'.join([k.rjust(m) + ': ' + repr(v) + for k, v in sorted(self.items())]) + else: + return self.__class__.__name__ + "()" + + def __dir__(self): + return list(self.keys()) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/methods.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/methods.py new file mode 100644 index 0000000000000000000000000000000000000000..3f811ccca17e4dff6dfe114a9e6679dbd0a970b2 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/methods.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +__all__ = ["bls_fast", "bls_slow"] + +import numpy as np +from functools import partial + +from ._impl import bls_impl + + +def bls_slow(t, y, ivar, period, duration, oversample, use_likelihood): + """Compute the periodogram using a brute force reference method + + t : array-like + Sequence of observation times. + y : array-like + Sequence of observations associated with times t. + ivar : array-like + The inverse variance of ``y``. + period : array-like + The trial periods where the periodogram should be computed. + duration : array-like + The durations that should be tested. + oversample : + The resolution of the phase grid in units of durations. + use_likeliood : bool + If true, maximize the log likelihood over phase, duration, and depth. + + Returns + ------- + power : array-like + The periodogram evaluated at the periods in ``period``. + depth : array-like + The estimated depth of the maximum power model at each period. + depth_err : array-like + The 1-sigma uncertainty on ``depth``. + duration : array-like + The maximum power duration at each period. + transit_time : array-like + The maximum power phase of the transit in units of time. This + indicates the mid-transit time and it will always be in the range + (0, period). + depth_snr : array-like + The signal-to-noise with which the depth is measured at maximum power. + log_likelihood : array-like + The log likelihood of the maximum power model. + + """ + f = partial(_bls_slow_one, t, y, ivar, duration, + oversample, use_likelihood) + return _apply(f, period) + + +def bls_fast(t, y, ivar, period, duration, oversample, use_likelihood): + """Compute the periodogram using an optimized Cython implementation + + t : array-like + Sequence of observation times. + y : array-like + Sequence of observations associated with times t. + ivar : array-like + The inverse variance of ``y``. + period : array-like + The trial periods where the periodogram should be computed. + duration : array-like + The durations that should be tested. + oversample : + The resolution of the phase grid in units of durations. + use_likeliood : bool + If true, maximize the log likelihood over phase, duration, and depth. + + Returns + ------- + power : array-like + The periodogram evaluated at the periods in ``period``. + depth : array-like + The estimated depth of the maximum power model at each period. + depth_err : array-like + The 1-sigma uncertainty on ``depth``. + duration : array-like + The maximum power duration at each period. + transit_time : array-like + The maximum power phase of the transit in units of time. This + indicates the mid-transit time and it will always be in the range + (0, period). + depth_snr : array-like + The signal-to-noise with which the depth is measured at maximum power. + log_likelihood : array-like + The log likelihood of the maximum power model. + + """ + return bls_impl( + t, y, ivar, period, duration, oversample, use_likelihood + ) + + +def _bls_slow_one(t, y, ivar, duration, oversample, use_likelihood, period): + """A private function to compute the brute force periodogram result""" + best = (-np.inf, None) + hp = 0.5*period + min_t = np.min(t) + for dur in duration: + + # Compute the phase grid (this is set by the duration and oversample). + d_phase = dur / oversample + phase = np.arange(0, period+d_phase, d_phase) + + for t0 in phase: + # Figure out which data points are in and out of transit. + m_in = np.abs((t-min_t-t0+hp) % period - hp) < 0.5*dur + m_out = ~m_in + + # Compute the estimates of the in and out-of-transit flux. + ivar_in = np.sum(ivar[m_in]) + ivar_out = np.sum(ivar[m_out]) + y_in = np.sum(y[m_in] * ivar[m_in]) / ivar_in + y_out = np.sum(y[m_out] * ivar[m_out]) / ivar_out + + # Use this to compute the best fit depth and uncertainty. + depth = y_out - y_in + depth_err = np.sqrt(1.0 / ivar_in + 1.0 / ivar_out) + snr = depth / depth_err + + # Compute the log likelihood of this model. + loglike = -0.5*np.sum((y_in - y[m_in])**2 * ivar[m_in]) + loglike += 0.5*np.sum((y_out - y[m_in])**2 * ivar[m_in]) + + # Choose which objective should be used for the optimization. + if use_likelihood: + objective = loglike + else: + objective = snr + + # If this model is better than any before, keep it. + if depth > 0 and objective > best[0]: + best = ( + objective, + (objective, depth, depth_err, dur, (t0+min_t) % period, + snr, loglike) + ) + + return best[1] + + +def _apply(f, period): + return tuple(map(np.array, zip(*map(f, period)))) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/setup_package.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/setup_package.py new file mode 100644 index 0000000000000000000000000000000000000000..8a4315cce34b73fd372dae7ab6abd1766442cef3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/setup_package.py @@ -0,0 +1,21 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import os +from os.path import join + +from distutils.core import Extension + + +BLS_ROOT = os.path.relpath(os.path.dirname(__file__)) + + +def get_extensions(): + ext = Extension( + "astropy.timeseries.periodograms.bls._impl", + sources=[ + join(BLS_ROOT, "bls.c"), + join(BLS_ROOT, "_impl.pyx"), + ], + include_dirs=["numpy"], + ) + return [ext] diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dce85d06f83264a6e502be0906d86bd976e1677 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/__init__.py @@ -0,0 +1 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/test_bls.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/test_bls.py new file mode 100644 index 0000000000000000000000000000000000000000..59efd6097ba1fac3437d0faf23d7a656e8beab3c --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/bls/tests/test_bls.py @@ -0,0 +1,489 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import pytest +import numpy as np +from numpy.testing import assert_allclose, assert_equal + +from astropy import units as u +from astropy.time import Time, TimeDelta +from astropy.tests.helper import assert_quantity_allclose +from astropy.timeseries.periodograms.bls import BoxLeastSquares +from astropy.timeseries.periodograms.lombscargle.core import has_units + + +def assert_allclose_blsresults(blsresult, other, **kwargs): + """Assert that another BoxLeastSquaresResults object is consistent + + This method loops over all attributes and compares the values using + :func:`~astropy.tests.helper.assert_quantity_allclose` function. + + Parameters + ---------- + other : BoxLeastSquaresResults + The other results object to compare. + + """ + for k, v in blsresult.items(): + if k not in other: + raise AssertionError("missing key '{0}'".format(k)) + if k == "objective": + assert v == other[k], ( + "Mismatched objectives. Expected '{0}', got '{1}'" + .format(v, other[k]) + ) + continue + assert_quantity_allclose(v, other[k], **kwargs) + + +@pytest.fixture +def data(): + rand = np.random.RandomState(123) + t = rand.uniform(0, 10, 500) + y = np.ones_like(t) + dy = rand.uniform(0.005, 0.01, len(t)) + period = 2.0 + transit_time = 0.5 + duration = 0.16 + depth = 0.2 + m = np.abs((t-transit_time+0.5*period) % period-0.5*period) < 0.5*duration + y[m] = 1.0 - depth + y += dy * rand.randn(len(t)) + return t, y, dy, dict(period=period, transit_time=transit_time, + duration=duration, depth=depth) + + +def test_32bit_bug(): + rand = np.random.RandomState(42) + t = rand.uniform(0, 10, 500) + y = np.ones_like(t) + y[np.abs((t + 1.0) % 2.0-1) < 0.08] = 1.0 - 0.1 + y += 0.01 * rand.randn(len(t)) + + model = BoxLeastSquares(t, y) + results = model.autopower(0.16) + assert np.allclose(results.period[np.argmax(results.power)], + 1.9923406038842544) + periods = np.linspace(1.9, 2.1, 5) + results = model.power(periods, 0.16) + assert np.allclose( + results.power, + np.array([0.01421067, 0.02842475, 0.10867671, 0.05117755, 0.01783253]) + ) + + +@pytest.mark.parametrize("objective", ["likelihood", "snr"]) +def test_correct_model(data, objective): + t, y, dy, params = data + model = BoxLeastSquares(t, y, dy) + periods = np.exp(np.linspace(np.log(params["period"]) - 0.1, + np.log(params["period"]) + 0.1, 1000)) + results = model.power(periods, params["duration"], objective=objective) + ind = np.argmax(results.power) + for k, v in params.items(): + assert_allclose(results[k][ind], v, atol=0.01) + chi = (results.depth[ind]-params["depth"]) / results.depth_err[ind] + assert np.abs(chi) < 1 + + +@pytest.mark.parametrize("objective", ["likelihood", "snr"]) +@pytest.mark.parametrize("offset", [False, True]) +def test_fast_method(data, objective, offset): + t, y, dy, params = data + if offset: + t = t - params["transit_time"] + params["period"] + model = BoxLeastSquares(t, y, dy) + periods = np.exp(np.linspace(np.log(params["period"]) - 1, + np.log(params["period"]) + 1, 10)) + durations = params["duration"] + results = model.power(periods, durations, objective=objective) + + assert_allclose_blsresults(results, model.power(periods, durations, + method="slow", + objective=objective)) + + +def test_input_units(data): + t, y, dy, params = data + + t_unit = u.day + y_unit = u.mag + + with pytest.raises(u.UnitConversionError): + BoxLeastSquares(t * t_unit, y * y_unit, dy * u.one) + with pytest.raises(u.UnitConversionError): + BoxLeastSquares(t * t_unit, y * u.one, dy * y_unit) + with pytest.raises(u.UnitConversionError): + BoxLeastSquares(t * t_unit, y, dy * y_unit) + model = BoxLeastSquares(t*t_unit, y * u.one, dy) + assert model.dy.unit == model.y.unit + model = BoxLeastSquares(t*t_unit, y * y_unit, dy) + assert model.dy.unit == model.y.unit + model = BoxLeastSquares(t*t_unit, y*y_unit) + assert model.dy is None + + +def test_period_units(data): + t, y, dy, params = data + t_unit = u.day + y_unit = u.mag + model = BoxLeastSquares(t * t_unit, y * y_unit, dy) + + p = model.autoperiod(params["duration"]) + assert p.unit == t_unit + p = model.autoperiod(params["duration"] * 24 * u.hour) + assert p.unit == t_unit + with pytest.raises(u.UnitConversionError): + model.autoperiod(params["duration"] * u.mag) + + p = model.autoperiod(params["duration"], minimum_period=0.5) + assert p.unit == t_unit + with pytest.raises(u.UnitConversionError): + p = model.autoperiod(params["duration"], minimum_period=0.5*u.mag) + + p = model.autoperiod(params["duration"], maximum_period=0.5) + assert p.unit == t_unit + with pytest.raises(u.UnitConversionError): + p = model.autoperiod(params["duration"], maximum_period=0.5*u.mag) + + p = model.autoperiod(params["duration"], minimum_period=0.5, + maximum_period=1.5) + p2 = model.autoperiod(params["duration"], maximum_period=0.5, + minimum_period=1.5) + assert_quantity_allclose(p, p2) + + +@pytest.mark.parametrize("method", ["fast", "slow"]) +@pytest.mark.parametrize("with_err", [True, False]) +@pytest.mark.parametrize("t_unit", [None, u.day]) +@pytest.mark.parametrize("y_unit", [None, u.mag]) +@pytest.mark.parametrize("objective", ["likelihood", "snr"]) +def test_results_units(data, method, with_err, t_unit, y_unit, objective): + t, y, dy, params = data + + periods = np.linspace(params["period"]-1.0, params["period"]+1.0, 3) + + if t_unit is not None: + t = t * t_unit + if y_unit is not None: + y = y * y_unit + dy = dy * y_unit + if not with_err: + dy = None + + model = BoxLeastSquares(t, y, dy) + results = model.power(periods, params["duration"], method=method, + objective=objective) + + if t_unit is None: + assert not has_units(results.period) + assert not has_units(results.duration) + assert not has_units(results.transit_time) + else: + assert results.period.unit == t_unit + assert results.duration.unit == t_unit + assert results.transit_time.unit == t_unit + + if y_unit is None: + assert not has_units(results.power) + assert not has_units(results.depth) + assert not has_units(results.depth_err) + assert not has_units(results.depth_snr) + assert not has_units(results.log_likelihood) + else: + assert results.depth.unit == y_unit + assert results.depth_err.unit == y_unit + assert results.depth_snr.unit == u.one + + if dy is None: + assert results.log_likelihood.unit == y_unit * y_unit + if objective == "snr": + assert results.power.unit == u.one + else: + assert results.power.unit == y_unit * y_unit + else: + assert results.log_likelihood.unit == u.one + assert results.power.unit == u.one + + +def test_autopower(data): + t, y, dy, params = data + duration = params["duration"] + np.linspace(-0.1, 0.1, 3) + + model = BoxLeastSquares(t, y, dy) + period = model.autoperiod(duration) + results1 = model.power(period, duration) + results2 = model.autopower(duration) + + assert_allclose_blsresults(results1, results2) + + +@pytest.mark.parametrize("with_units", [True, False]) +def test_model(data, with_units): + t, y, dy, params = data + + # Compute the model using linear regression + A = np.zeros((len(t), 2)) + p = params["period"] + dt = np.abs((t-params["transit_time"]+0.5*p) % p-0.5*p) + m_in = dt < 0.5*params["duration"] + A[~m_in, 0] = 1.0 + A[m_in, 1] = 1.0 + w = np.linalg.solve(np.dot(A.T, A / dy[:, None]**2), + np.dot(A.T, y / dy**2)) + model_true = np.dot(A, w) + + if with_units: + t = t * u.day + y = y * u.mag + dy = dy * u.mag + model_true = model_true * u.mag + + # Compute the model using the periodogram + pgram = BoxLeastSquares(t, y, dy) + model = pgram.model(t, p, params["duration"], params["transit_time"]) + + # Make sure that the transit mask is consistent with the model + transit_mask = pgram.transit_mask(t, p, params["duration"], + params["transit_time"]) + transit_mask0 = (model - model.max()) < 0.0 + assert_allclose(transit_mask, transit_mask0) + + assert_quantity_allclose(model, model_true) + + +@pytest.mark.parametrize("shape", [(1,), (2,), (3,), (2, 3)]) +def test_shapes(data, shape): + t, y, dy, params = data + duration = params["duration"] + model = BoxLeastSquares(t, y, dy) + + period = np.empty(shape) + period.flat = np.linspace(params["period"]-1, params["period"]+1, + period.size) + if len(period.shape) > 1: + with pytest.raises(ValueError): + results = model.power(period, duration) + else: + results = model.power(period, duration) + for k, v in results.items(): + if k == "objective": + continue + assert v.shape == shape + + +@pytest.mark.parametrize("with_units", [True, False]) +@pytest.mark.parametrize("with_err", [True, False]) +def test_compute_stats(data, with_units, with_err): + t, y, dy, params = data + + y_unit = 1 + if with_units: + y_unit = u.mag + t = t * u.day + y = y * u.mag + dy = dy * u.mag + params["period"] = params["period"] * u.day + params["duration"] = params["duration"] * u.day + params["transit_time"] = params["transit_time"] * u.day + params["depth"] = params["depth"] * u.mag + if not with_err: + dy = None + + model = BoxLeastSquares(t, y, dy) + results = model.power(params["period"], params["duration"], + oversample=1000) + stats = model.compute_stats(params["period"], params["duration"], + params["transit_time"]) + + # Test the calculated transit times + tt = params["period"] * np.arange(int(t.max() / params["period"]) + 1) + tt += params["transit_time"] + assert_quantity_allclose(tt, stats["transit_times"]) + + # Test that the other parameters are consistent with the periodogram + assert_allclose(stats["per_transit_count"], np.array([9, 7, 7, 7, 8])) + assert_quantity_allclose(np.sum(stats["per_transit_log_likelihood"]), + results["log_likelihood"]) + assert_quantity_allclose(stats["depth"][0], results["depth"]) + + # Check the half period result + results_half = model.power(0.5*params["period"], params["duration"], + oversample=1000) + assert_quantity_allclose(stats["depth_half"][0], results_half["depth"]) + + # Skip the uncertainty tests when the input errors are None + if not with_err: + assert_quantity_allclose(stats["harmonic_amplitude"], + 0.029945029964964204 * y_unit) + assert_quantity_allclose(stats["harmonic_delta_log_likelihood"], + -0.5875918155223113 * y_unit * y_unit) + return + + assert_quantity_allclose(stats["harmonic_amplitude"], + 0.033027988742275853 * y_unit) + assert_quantity_allclose(stats["harmonic_delta_log_likelihood"], + -12407.505922833765) + + assert_quantity_allclose(stats["depth"][1], results["depth_err"]) + assert_quantity_allclose(stats["depth_half"][1], results_half["depth_err"]) + for f, k in zip((1.0, 1.0, 1.0, 0.0), + ("depth", "depth_even", "depth_odd", "depth_phased")): + assert np.abs((stats[k][0]-f*params["depth"]) / stats[k][1]) < 1.0 + + +def test_negative_times(data): + t, y, dy, params = data + mu = np.mean(t) + duration = params["duration"] + np.linspace(-0.1, 0.1, 3) + + model1 = BoxLeastSquares(t, y, dy) + results1 = model1.autopower(duration) + + # Compute the periodogram with offset (negative) times + model2 = BoxLeastSquares(t - mu, y, dy) + results2 = model2.autopower(duration) + + # Shift the transit times back into the unshifted coordinates + results2.transit_time = (results2.transit_time + mu) % results2.period + + assert_allclose_blsresults(results1, results2) + + +@pytest.mark.parametrize('timedelta', [False, True]) +def test_absolute_times(data, timedelta): + + # Make sure that we handle absolute times correctly. We also check that + # TimeDelta works properly when timedelta is True. + + # The example data uses relative times + t, y, dy, params = data + + # FIXME: There seems to be a numerical stability issue in that if we run + # the algorithm with the same values but offset in time, the transit_time + # is not offset by a fixed amount. To avoid this issue in this test, we + # make sure the first time is also the smallest so that internally the + # values of the relative time should be the same. + t[0] = 0. + + # Add units + t = t * u.day + y = y * u.mag + dy = dy * u.mag + + # We now construct a set of absolute times but keeping the rest the same. + start = Time('2019-05-04T12:34:56') + trel = TimeDelta(t) if timedelta else t + t = trel + start + + # and we set up two instances of BoxLeastSquares, one with absolute and one + # with relative times. + bls1 = BoxLeastSquares(t, y, dy) + bls2 = BoxLeastSquares(trel, y, dy) + + results1 = bls1.autopower(0.16 * u.day) + results2 = bls2.autopower(0.16 * u.day) + + # All the results should match except transit time which should be + # absolute instead of relative in the first case. + + for key in results1: + if key == 'transit_time': + assert_quantity_allclose((results1[key] - start).to(u.day), results2[key]) + elif key == 'objective': + assert results1[key] == results2[key] + else: + assert_allclose(results1[key], results2[key]) + + # Check that model evaluation works fine + + model1 = bls1.model(t, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + model2 = bls2.model(trel, 0.2 * u.day, 0.05 * u.day, TimeDelta(1 * u.day)) + assert_quantity_allclose(model1, model2) + + # Check model validation + + with pytest.raises(TypeError) as exc: + bls1.model(t, 0.2 * u.day, 0.05 * u.day, 1 * u.day) + assert exc.value.args[0] == ('transit_time was provided as a relative time ' + 'but the BoxLeastSquares class was initialized ' + 'with absolute times.') + + with pytest.raises(TypeError) as exc: + bls1.model(trel, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + assert exc.value.args[0] == ('t_model was provided as a relative time ' + 'but the BoxLeastSquares class was initialized ' + 'with absolute times.') + + with pytest.raises(TypeError) as exc: + bls2.model(trel, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + assert exc.value.args[0] == ('transit_time was provided as an absolute time ' + 'but the BoxLeastSquares class was initialized ' + 'with relative times.') + + with pytest.raises(TypeError) as exc: + bls2.model(t, 0.2 * u.day, 0.05 * u.day, 1 * u.day) + assert exc.value.args[0] == ('t_model was provided as an absolute time ' + 'but the BoxLeastSquares class was initialized ' + 'with relative times.') + + # Check compute_stats + + stats1 = bls1.compute_stats(0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + stats2 = bls2.compute_stats(0.2 * u.day, 0.05 * u.day, 1 * u.day) + + for key in stats1: + if key == 'transit_times': + assert_quantity_allclose((stats1[key] - start).to(u.day), stats2[key], atol=1e-10 * u.day) + elif key.startswith('depth'): + for value1, value2 in zip(stats1[key], stats2[key]): + assert_quantity_allclose(value1, value2) + else: + assert_allclose(stats1[key], stats2[key]) + + # Check compute_stats validation + + with pytest.raises(TypeError) as exc: + bls1.compute_stats(0.2 * u.day, 0.05 * u.day, 1 * u.day) + assert exc.value.args[0] == ('transit_time was provided as a relative time ' + 'but the BoxLeastSquares class was initialized ' + 'with absolute times.') + + with pytest.raises(TypeError) as exc: + bls2.compute_stats(0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + assert exc.value.args[0] == ('transit_time was provided as an absolute time ' + 'but the BoxLeastSquares class was initialized ' + 'with relative times.') + + # Check transit_mask + + mask1 = bls1.transit_mask(t, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + mask2 = bls2.transit_mask(trel, 0.2 * u.day, 0.05 * u.day, 1 * u.day) + + assert_equal(mask1, mask2) + + # Check transit_mask validation + + with pytest.raises(TypeError) as exc: + bls1.transit_mask(t, 0.2 * u.day, 0.05 * u.day, 1 * u.day) + assert exc.value.args[0] == ('transit_time was provided as a relative time ' + 'but the BoxLeastSquares class was initialized ' + 'with absolute times.') + + with pytest.raises(TypeError) as exc: + bls1.transit_mask(trel, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + assert exc.value.args[0] == ('t was provided as a relative time ' + 'but the BoxLeastSquares class was initialized ' + 'with absolute times.') + + with pytest.raises(TypeError) as exc: + bls2.transit_mask(trel, 0.2 * u.day, 0.05 * u.day, Time('2019-06-04T12:34:56')) + assert exc.value.args[0] == ('transit_time was provided as an absolute time ' + 'but the BoxLeastSquares class was initialized ' + 'with relative times.') + + with pytest.raises(TypeError) as exc: + bls2.transit_mask(t, 0.2 * u.day, 0.05 * u.day, 1 * u.day) + assert exc.value.args[0] == ('t was provided as an absolute time ' + 'but the BoxLeastSquares class was initialized ' + 'with relative times.') diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..226f069b282d910da1662c72ec400db4e9ab1120 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/__init__.py @@ -0,0 +1,8 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +lombscargle +=========== +AstroPy-compatible implementation of the Lomb-Scargle periodogram. +""" +from .core import LombScargle diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/_statistics.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/_statistics.py new file mode 100644 index 0000000000000000000000000000000000000000..7c56693f1deee260ac73016c8809bc8a7760f3df --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/_statistics.py @@ -0,0 +1,489 @@ +""" +Utilities for computing periodogram statistics. + +This is an internal module; users should access this functionality via the +``false_alarm_probability`` and ``false_alarm_level`` methods of the +``astropy.timeseries.LombScargle`` API. +""" + +from functools import wraps + +import numpy as np + + +def _weighted_sum(val, dy): + if dy is not None: + return (val / dy ** 2).sum() + else: + return val.sum() + + +def _weighted_mean(val, dy): + if dy is None: + return val.mean() + else: + return _weighted_sum(val, dy) / _weighted_sum(np.ones_like(val), dy) + + +def _weighted_var(val, dy): + return _weighted_mean(val ** 2, dy) - _weighted_mean(val, dy) ** 2 + + +def _gamma(N): + from scipy.special import gammaln + # Note: this is closely approximated by (1 - 0.75 / N) for large N + return np.sqrt(2 / N) * np.exp(gammaln(N / 2) - gammaln((N - 1) / 2)) + + +def _log_gamma(N): + from scipy.special import gammaln + return 0.5 * np.log(2 / N) + gammaln(N / 2) - gammaln((N - 1) / 2) + + +def vectorize_first_argument(func): + @wraps(func) + def new_func(x, *args, **kwargs): + x = np.asarray(x) + return np.array([func(xi, *args, **kwargs) + for xi in x.flat]).reshape(x.shape) + return new_func + + +def pdf_single(z, N, normalization, dH=1, dK=3): + """Probability density function for Lomb-Scargle periodogram + + Compute the expected probability density function of the periodogram + for the null hypothesis - i.e. data consisting of Gaussian noise. + + Parameters + ---------- + z : array-like + The periodogram value. + N : int + The number of data points from which the periodogram was computed. + normalization : {'standard', 'model', 'log', 'psd'} + The periodogram normalization. + dH, dK : integers, optional + The number of parameters in the null hypothesis and the model. + + Returns + ------- + pdf : np.ndarray + The expected probability density function. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + All expressions used here are adapted from Table 1 of Baluev 2008 [1]_. + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + z = np.asarray(z) + if dK - dH != 2: + raise NotImplementedError("Degrees of freedom != 2") + Nk = N - dK + + if normalization == 'psd': + return np.exp(-z) + elif normalization == 'standard': + return 0.5 * Nk * (1 - z) ** (0.5 * Nk - 1) + elif normalization == 'model': + return 0.5 * Nk * (1 + z) ** (-0.5 * Nk - 1) + elif normalization == 'log': + return 0.5 * Nk * np.exp(-0.5 * Nk * z) + else: + raise ValueError("normalization='{0}' is not recognized" + "".format(normalization)) + + +def fap_single(z, N, normalization, dH=1, dK=3): + """Single-frequency false alarm probability for the Lomb-Scargle periodogram + + This is equal to 1 - cdf, where cdf is the cumulative distribution. + The single-frequency false alarm probability should not be confused with + the false alarm probability for the largest peak. + + Parameters + ---------- + z : array-like + The periodogram value. + N : int + The number of data points from which the periodogram was computed. + normalization : {'standard', 'model', 'log', 'psd'} + The periodogram normalization. + dH, dK : integers, optional + The number of parameters in the null hypothesis and the model. + + Returns + ------- + false_alarm_probability : np.ndarray + The single-frequency false alarm probability. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + All expressions used here are adapted from Table 1 of Baluev 2008 [1]_. + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + z = np.asarray(z) + if dK - dH != 2: + raise NotImplementedError("Degrees of freedom != 2") + Nk = N - dK + + if normalization == 'psd': + return np.exp(-z) + elif normalization == 'standard': + return (1 - z) ** (0.5 * Nk) + elif normalization == 'model': + return (1 + z) ** (-0.5 * Nk) + elif normalization == 'log': + return np.exp(-0.5 * Nk * z) + else: + raise ValueError("normalization='{0}' is not recognized" + "".format(normalization)) + + +def inv_fap_single(fap, N, normalization, dH=1, dK=3): + """Single-frequency inverse false alarm probability + + This function computes the periodogram value associated with the specified + single-frequency false alarm probability. This should not be confused with + the false alarm level of the largest peak. + + Parameters + ---------- + fap : array-like + The false alarm probability. + N : int + The number of data points from which the periodogram was computed. + normalization : {'standard', 'model', 'log', 'psd'} + The periodogram normalization. + dH, dK : integers, optional + The number of parameters in the null hypothesis and the model. + + Returns + ------- + z : np.ndarray + The periodogram power corresponding to the single-peak false alarm + probability. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + All expressions used here are adapted from Table 1 of Baluev 2008 [1]_. + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + fap = np.asarray(fap) + if dK - dH != 2: + raise NotImplementedError("Degrees of freedom != 2") + Nk = N - dK + + if normalization == 'psd': + return -np.log(fap) + elif normalization == 'standard': + return 1 - fap ** (2 / Nk) + elif normalization == 'model': + return -1 + fap ** (-2 / Nk) + elif normalization == 'log': + return -2 / Nk * np.log(fap) + else: + raise ValueError("normalization='{0}' is not recognized" + "".format(normalization)) + + +def cdf_single(z, N, normalization, dH=1, dK=3): + """Cumulative distribution for the Lomb-Scargle periodogram + + Compute the expected cumulative distribution of the periodogram + for the null hypothesis - i.e. data consisting of Gaussian noise. + + Parameters + ---------- + z : array-like + The periodogram value. + N : int + The number of data points from which the periodogram was computed. + normalization : {'standard', 'model', 'log', 'psd'} + The periodogram normalization. + dH, dK : integers, optional + The number of parameters in the null hypothesis and the model. + + Returns + ------- + cdf : np.ndarray + The expected cumulative distribution function. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + All expressions used here are adapted from Table 1 of Baluev 2008 [1]_. + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + return 1 - fap_single(z, N, normalization=normalization, dH=dH, dK=dK) + + +def tau_davies(Z, fmax, t, y, dy, normalization='standard', dH=1, dK=3): + """tau factor for estimating Davies bound (Baluev 2008, Table 1)""" + N = len(t) + NH = N - dH # DOF for null hypothesis + NK = N - dK # DOF for periodic hypothesis + Dt = _weighted_var(t, dy) + Teff = np.sqrt(4 * np.pi * Dt) # Effective baseline + W = fmax * Teff + Z = np.asarray(Z) + if normalization == 'psd': + # 'psd' normalization is same as Baluev's z + return W * np.exp(-Z) * np.sqrt(Z) + elif normalization == 'standard': + # 'standard' normalization is Z = 2/NH * z_1 + return (_gamma(NH) * W * (1 - Z) ** (0.5 * (NK - 1)) + * np.sqrt(0.5 * NH * Z)) + elif normalization == 'model': + # 'model' normalization is Z = 2/NK * z_2 + return (_gamma(NK) * W * (1 + Z) ** (-0.5 * NK) + * np.sqrt(0.5 * NK * Z)) + elif normalization == 'log': + # 'log' normalization is Z = 2/NK * z_3 + return (_gamma(NK) * W * np.exp(-0.5 * Z * (NK - 0.5)) + * np.sqrt(NK * np.sinh(0.5 * Z))) + else: + raise NotImplementedError("normalization={0}".format(normalization)) + + +def fap_naive(Z, fmax, t, y, dy, normalization='standard'): + """False Alarm Probability based on estimated number of indep frequencies""" + N = len(t) + T = max(t) - min(t) + N_eff = fmax * T + fap_s = fap_single(Z, N, normalization=normalization) + # result is 1 - (1 - fap_s) ** N_eff + # this is much more precise for small Z / large N + return -np.expm1(N_eff * np.log1p(-fap_s)) + + +def inv_fap_naive(fap, fmax, t, y, dy, normalization='standard'): + """Inverse FAP based on estimated number of indep frequencies""" + fap = np.asarray(fap) + N = len(t) + T = max(t) - min(t) + N_eff = fmax * T + #fap_s = 1 - (1 - fap) ** (1 / N_eff) + fap_s = -np.expm1(np.log(1 - fap) / N_eff) + return inv_fap_single(fap_s, N, normalization) + + +def fap_davies(Z, fmax, t, y, dy, normalization='standard'): + """Davies upper-bound to the false alarm probability + + (Eqn 5 of Baluev 2008) + """ + N = len(t) + fap_s = fap_single(Z, N, normalization=normalization) + tau = tau_davies(Z, fmax, t, y, dy, normalization=normalization) + return fap_s + tau + + +@vectorize_first_argument +def inv_fap_davies(p, fmax, t, y, dy, normalization='standard'): + """Inverse of the davies upper-bound""" + from scipy import optimize + args = (fmax, t, y, dy, normalization) + z0 = inv_fap_naive(p, *args) + func = lambda z, *args: fap_davies(z, *args) - p + res = optimize.root(func, z0, args=args, method='lm') + if not res.success: + raise ValueError('inv_fap_baluev did not converge for p={0}'.format(p)) + return res.x + + +def fap_baluev(Z, fmax, t, y, dy, normalization='standard'): + """Alias-free approximation to false alarm probability + + (Eqn 6 of Baluev 2008) + """ + fap_s = fap_single(Z, len(t), normalization) + tau = tau_davies(Z, fmax, t, y, dy, normalization=normalization) + # result is 1 - (1 - fap_s) * np.exp(-tau) + # this is much more precise for small numbers + return -np.expm1(-tau) + fap_s * np.exp(-tau) + + +@vectorize_first_argument +def inv_fap_baluev(p, fmax, t, y, dy, normalization='standard'): + """Inverse of the Baluev alias-free approximation""" + from scipy import optimize + args = (fmax, t, y, dy, normalization) + z0 = inv_fap_naive(p, *args) + func = lambda z, *args: fap_baluev(z, *args) - p + res = optimize.root(func, z0, args=args, method='lm') + if not res.success: + raise ValueError('inv_fap_baluev did not converge for p={0}'.format(p)) + return res.x + + +def _bootstrap_max(t, y, dy, fmax, normalization, random_seed): + """Generate a sequence of bootstrap estimates of the max""" + from .core import LombScargle + rng = np.random.RandomState(random_seed) + while True: + s = rng.randint(0, len(y), len(y)) # sample with replacement + ls_boot = LombScargle(t, y[s], dy if dy is None else dy[s], + normalization=normalization) + freq, power = ls_boot.autopower(maximum_frequency=fmax) + yield power.max() + + +def fap_bootstrap(Z, fmax, t, y, dy, normalization='standard', + n_bootstraps=1000, random_seed=None): + """Bootstrap estimate of the false alarm probability""" + pmax = np.fromiter(_bootstrap_max(t, y, dy, fmax, + normalization, random_seed), + float, n_bootstraps) + pmax.sort() + return 1 - np.searchsorted(pmax, Z) / len(pmax) + + +def inv_fap_bootstrap(fap, fmax, t, y, dy, normalization='standard', + n_bootstraps=1000, random_seed=None): + """Bootstrap estimate of the inverse false alarm probability""" + fap = np.asarray(fap) + pmax = np.fromiter(_bootstrap_max(t, y, dy, fmax, + normalization, random_seed), + float, n_bootstraps) + pmax.sort() + return pmax[np.clip(np.floor((1 - fap) * len(pmax)).astype(int), + 0, len(pmax) - 1)] + + +METHODS = {'single': fap_single, + 'naive': fap_naive, + 'davies': fap_davies, + 'baluev': fap_baluev, + 'bootstrap': fap_bootstrap} + + +def false_alarm_probability(Z, fmax, t, y, dy, normalization='standard', + method='baluev', method_kwds=None): + """Compute the approximate false alarm probability for periodogram peaks Z + + This gives an estimate of the false alarm probability for the largest value + in a periodogram, based on the null hypothesis of non-varying data with + Gaussian noise. The true probability cannot be computed analytically, so + each method available here is an approximation to the true value. + + Parameters + ---------- + Z : array-like + The periodogram value. + fmax : float + The maximum frequency of the periodogram. + t, y, dy : array-like + The data times, values, and errors. + normalization : {'standard', 'model', 'log', 'psd'}, optional + The periodogram normalization. + method : {'baluev', 'davies', 'naive', 'bootstrap'}, optional + The approximation method to use. + method_kwds : dict, optional + Additional method-specific keywords. + + Returns + ------- + false_alarm_probability : np.ndarray + The false alarm probability. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + + See Also + -------- + false_alarm_level : compute the periodogram level for a particular fap + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + if method == 'single': + return fap_single(Z, len(t), normalization) + elif method not in METHODS: + raise ValueError("Unrecognized method: {0}".format(method)) + method = METHODS[method] + method_kwds = method_kwds or {} + + return method(Z, fmax, t, y, dy, normalization, **method_kwds) + + +INV_METHODS = {'single': inv_fap_single, + 'naive': inv_fap_naive, + 'davies': inv_fap_davies, + 'baluev': inv_fap_baluev, + 'bootstrap': inv_fap_bootstrap} + + +def false_alarm_level(p, fmax, t, y, dy, normalization, + method='baluev', method_kwds=None): + """Compute the approximate periodogram level given a false alarm probability + + This gives an estimate of the periodogram level corresponding to a specified + false alarm probability for the largest peak, assuming a null hypothesis + of non-varying data with Gaussian noise. The true level cannot be computed + analytically, so each method available here is an approximation to the true + value. + + Parameters + ---------- + p : array-like + The false alarm probability (0 < p < 1). + fmax : float + The maximum frequency of the periodogram. + t, y, dy : arrays + The data times, values, and errors. + normalization : {'standard', 'model', 'log', 'psd'}, optional + The periodogram normalization. + method : {'baluev', 'davies', 'naive', 'bootstrap'}, optional + The approximation method to use. + method_kwds : dict, optional + Additional method-specific keywords. + + Returns + ------- + z : np.ndarray + The periodogram level. + + Notes + ----- + For normalization='psd', the distribution can only be computed for + periodograms constructed with errors specified. + + See Also + -------- + false_alarm_probability : compute the fap for a given periodogram level + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + if method == 'single': + return inv_fap_single(p, len(t), normalization) + elif method not in INV_METHODS: + raise ValueError("Unrecognized method: {0}".format(method)) + method = INV_METHODS[method] + method_kwds = method_kwds or {} + + return method(p, fmax, t, y, dy, normalization, **method_kwds) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/core.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/core.py new file mode 100644 index 0000000000000000000000000000000000000000..a9e26e602b8bc5cab8d52439e9231d9614d951ca --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/core.py @@ -0,0 +1,699 @@ +"""Main Lomb-Scargle Implementation""" + +import numpy as np + +from .implementations import lombscargle, available_methods +from .implementations.mle import periodic_fit, design_matrix +from . import _statistics +from astropy import units +from astropy.time import Time, TimeDelta +from astropy import units as u +from astropy.timeseries.periodograms.base import BasePeriodogram + + +def has_units(obj): + return hasattr(obj, 'unit') + + +def get_unit(obj): + return getattr(obj, 'unit', 1) + + +def strip_units(*arrs): + strip = lambda a: None if a is None else np.asarray(a) + if len(arrs) == 1: + return strip(arrs[0]) + else: + return map(strip, arrs) + + +class LombScargle(BasePeriodogram): + """Compute the Lomb-Scargle Periodogram. + + This implementations here are based on code presented in [1]_ and [2]_; + if you use this functionality in an academic application, citation of + those works would be appreciated. + + Parameters + ---------- + t : array_like or Quantity + sequence of observation times + y : array_like or Quantity + sequence of observations associated with times t + dy : float, array_like or Quantity (optional) + error or sequence of observational errors associated with times t + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if fit_mean = False + nterms : int (optional, default=1) + number of terms to use in the Fourier fit + normalization : {'standard', 'model', 'log', 'psd'}, optional + Normalization to use for the periodogram. + + Examples + -------- + Generate noisy periodic data: + + >>> rand = np.random.RandomState(42) + >>> t = 100 * rand.rand(100) + >>> y = np.sin(2 * np.pi * t) + rand.randn(100) + + Compute the Lomb-Scargle periodogram on an automatically-determined + frequency grid & find the frequency of max power: + + >>> frequency, power = LombScargle(t, y).autopower() + >>> frequency[np.argmax(power)] # doctest: +FLOAT_CMP + 1.0016662310392956 + + Compute the Lomb-Scargle periodogram at a user-specified frequency grid: + + >>> freq = np.arange(0.8, 1.3, 0.1) + >>> LombScargle(t, y).power(freq) # doctest: +FLOAT_CMP + array([0.0204304 , 0.01393845, 0.35552682, 0.01358029, 0.03083737]) + + If the inputs are astropy Quantities with units, the units will be + validated and the outputs will also be Quantities with appropriate units: + + >>> from astropy import units as u + >>> t = t * u.s + >>> y = y * u.mag + >>> frequency, power = LombScargle(t, y).autopower() + >>> frequency.unit + Unit("1 / s") + >>> power.unit + Unit(dimensionless) + + Note here that the Lomb-Scargle power is always a unitless quantity, + because it is related to the :math:`\\chi^2` of the best-fit periodic + model at each frequency. + + References + ---------- + .. [1] Vanderplas, J., Connolly, A. Ivezic, Z. & Gray, A. *Introduction to + astroML: Machine learning for astrophysics*. Proceedings of the + Conference on Intelligent Data Understanding (2012) + .. [2] VanderPlas, J. & Ivezic, Z. *Periodograms for Multiband Astronomical + Time Series*. ApJ 812.1:18 (2015) + """ + available_methods = available_methods() + + def __init__(self, t, y, dy=None, fit_mean=True, center_data=True, + nterms=1, normalization='standard'): + + # If t is a TimeDelta, convert it to a quantity. The units we convert + # to don't really matter since the user gets a Quantity back at the end + # so can convert to any units they like. + if isinstance(t, TimeDelta): + t = t.to('day') + + # We want to expose self.t as being the times the user passed in, but + # if the times are absolute, we need to convert them to relative times + # internally, so we use self._trel and self._tstart for this. + + self.t = t + + if isinstance(self.t, Time): + self._tstart = self.t[0] + trel = (self.t - self._tstart).to(u.day) + else: + self._tstart = None + trel = self.t + + self._trel, self.y, self.dy = self._validate_inputs(trel, y, dy) + + self.fit_mean = fit_mean + self.center_data = center_data + self.nterms = nterms + self.normalization = normalization + + def _validate_inputs(self, t, y, dy): + # Validate shapes of inputs + if dy is None: + t, y = np.broadcast_arrays(t, y, subok=True) + else: + t, y, dy = np.broadcast_arrays(t, y, dy, subok=True) + if t.ndim != 1: + raise ValueError("Inputs (t, y, dy) must be 1-dimensional") + + # validate units of inputs if any is a Quantity + if any(has_units(arr) for arr in (t, y, dy)): + t, y = map(units.Quantity, (t, y)) + if dy is not None: + dy = units.Quantity(dy) + try: + dy = units.Quantity(dy, unit=y.unit) + except units.UnitConversionError: + raise ValueError("Units of dy not equivalent " + "to units of y") + return t, y, dy + + def _validate_frequency(self, frequency): + frequency = np.asanyarray(frequency) + + if has_units(self._trel): + frequency = units.Quantity(frequency) + try: + frequency = units.Quantity(frequency, unit=1./self._trel.unit) + except units.UnitConversionError: + raise ValueError("Units of frequency not equivalent to " + "units of 1/t") + else: + if has_units(frequency): + raise ValueError("frequency have units while 1/t doesn't.") + return frequency + + def _validate_t(self, t): + t = np.asanyarray(t) + + if has_units(self._trel): + t = units.Quantity(t) + try: + t = units.Quantity(t, unit=self._trel.unit) + except units.UnitConversionError: + raise ValueError("Units of t not equivalent to " + "units of input self.t") + return t + + def _power_unit(self, norm): + if has_units(self.y): + if self.dy is None and norm == 'psd': + return self.y.unit ** 2 + else: + return units.dimensionless_unscaled + else: + return 1 + + def autofrequency(self, samples_per_peak=5, nyquist_factor=5, + minimum_frequency=None, maximum_frequency=None, + return_freq_limits=False): + """Determine a suitable frequency grid for data. + + Note that this assumes the peak width is driven by the observational + baseline, which is generally a good assumption when the baseline is + much larger than the oscillation period. + If you are searching for periods longer than the baseline of your + observations, this may not perform well. + + Even with a large baseline, be aware that the maximum frequency + returned is based on the concept of "average Nyquist frequency", which + may not be useful for irregularly-sampled data. The maximum frequency + can be adjusted via the nyquist_factor argument, or through the + maximum_frequency argument. + + Parameters + ---------- + samples_per_peak : float (optional, default=5) + The approximate number of desired samples across the typical peak + nyquist_factor : float (optional, default=5) + The multiple of the average nyquist frequency used to choose the + maximum frequency if maximum_frequency is not provided. + minimum_frequency : float (optional) + If specified, then use this minimum frequency rather than one + chosen based on the size of the baseline. + maximum_frequency : float (optional) + If specified, then use this maximum frequency rather than one + chosen based on the average nyquist frequency. + return_freq_limits : bool (optional) + if True, return only the frequency limits rather than the full + frequency grid. + + Returns + ------- + frequency : ndarray or Quantity + The heuristically-determined optimal frequency bin + """ + baseline = self._trel.max() - self._trel.min() + n_samples = self._trel.size + + df = 1.0 / baseline / samples_per_peak + + if minimum_frequency is None: + minimum_frequency = 0.5 * df + + if maximum_frequency is None: + avg_nyquist = 0.5 * n_samples / baseline + maximum_frequency = nyquist_factor * avg_nyquist + + Nf = 1 + int(np.round((maximum_frequency - minimum_frequency) / df)) + + if return_freq_limits: + return minimum_frequency, minimum_frequency + df * (Nf - 1) + else: + return minimum_frequency + df * np.arange(Nf) + + def autopower(self, method='auto', method_kwds=None, + normalization=None, samples_per_peak=5, + nyquist_factor=5, minimum_frequency=None, + maximum_frequency=None): + """Compute Lomb-Scargle power at automatically-determined frequencies. + + Parameters + ---------- + method : string (optional) + specify the lomb scargle implementation to use. Options are: + + - 'auto': choose the best method based on the input + - 'fast': use the O[N log N] fast method. Note that this requires + evenly-spaced frequencies: by default this will be checked unless + ``assume_regular_frequency`` is set to True. + - 'slow': use the O[N^2] pure-python implementation + - 'cython': use the O[N^2] cython implementation. This is slightly + faster than method='slow', but much more memory efficient. + - 'chi2': use the O[N^2] chi2/linear-fitting implementation + - 'fastchi2': use the O[N log N] chi2 implementation. Note that this + requires evenly-spaced frequencies: by default this will be checked + unless ``assume_regular_frequency`` is set to True. + - 'scipy': use ``scipy.signal.lombscargle``, which is an O[N^2] + implementation written in C. Note that this does not support + heteroskedastic errors. + + method_kwds : dict (optional) + additional keywords to pass to the lomb-scargle method + normalization : {'standard', 'model', 'log', 'psd'}, optional + If specified, override the normalization specified at instantiation. + samples_per_peak : float (optional, default=5) + The approximate number of desired samples across the typical peak + nyquist_factor : float (optional, default=5) + The multiple of the average nyquist frequency used to choose the + maximum frequency if maximum_frequency is not provided. + minimum_frequency : float (optional) + If specified, then use this minimum frequency rather than one + chosen based on the size of the baseline. + maximum_frequency : float (optional) + If specified, then use this maximum frequency rather than one + chosen based on the average nyquist frequency. + + Returns + ------- + frequency, power : ndarrays + The frequency and Lomb-Scargle power + """ + frequency = self.autofrequency(samples_per_peak=samples_per_peak, + nyquist_factor=nyquist_factor, + minimum_frequency=minimum_frequency, + maximum_frequency=maximum_frequency) + power = self.power(frequency, + normalization=normalization, + method=method, method_kwds=method_kwds, + assume_regular_frequency=True) + return frequency, power + + def power(self, frequency, normalization=None, method='auto', + assume_regular_frequency=False, method_kwds=None): + """Compute the Lomb-Scargle power at the given frequencies. + + Parameters + ---------- + frequency : array_like or Quantity + frequencies (not angular frequencies) at which to evaluate the + periodogram. Note that in order to use method='fast', frequencies + must be regularly-spaced. + method : string (optional) + specify the lomb scargle implementation to use. Options are: + + - 'auto': choose the best method based on the input + - 'fast': use the O[N log N] fast method. Note that this requires + evenly-spaced frequencies: by default this will be checked unless + ``assume_regular_frequency`` is set to True. + - 'slow': use the O[N^2] pure-python implementation + - 'cython': use the O[N^2] cython implementation. This is slightly + faster than method='slow', but much more memory efficient. + - 'chi2': use the O[N^2] chi2/linear-fitting implementation + - 'fastchi2': use the O[N log N] chi2 implementation. Note that this + requires evenly-spaced frequencies: by default this will be checked + unless ``assume_regular_frequency`` is set to True. + - 'scipy': use ``scipy.signal.lombscargle``, which is an O[N^2] + implementation written in C. Note that this does not support + heteroskedastic errors. + + assume_regular_frequency : bool (optional) + if True, assume that the input frequency is of the form + freq = f0 + df * np.arange(N). Only referenced if method is 'auto' + or 'fast'. + normalization : {'standard', 'model', 'log', 'psd'}, optional + If specified, override the normalization specified at instantiation. + fit_mean : bool (optional, default=True) + If True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in + the case of incomplete phase coverage. + center_data : bool (optional, default=True) + If True, pre-center the data by subtracting the weighted mean of + the input data. This is especially important if fit_mean = False. + method_kwds : dict (optional) + additional keywords to pass to the lomb-scargle method + + Returns + ------- + power : ndarray + The Lomb-Scargle power at the specified frequency + """ + if normalization is None: + normalization = self.normalization + frequency = self._validate_frequency(frequency) + power = lombscargle(*strip_units(self._trel, self.y, self.dy), + frequency=strip_units(frequency), + center_data=self.center_data, + fit_mean=self.fit_mean, + nterms=self.nterms, + normalization=normalization, + method=method, method_kwds=method_kwds, + assume_regular_frequency=assume_regular_frequency) + return power * self._power_unit(normalization) + + def _as_relative_time(self, name, times): + """ + Convert the provided times (if absolute) to relative times using the + current _tstart value. If the times provided are relative, they are + returned without conversion (though we still do some checks). + """ + + if isinstance(times, TimeDelta): + times = times.to('day') + + if self._tstart is None: + if isinstance(times, Time): + raise TypeError('{0} was provided as an absolute time but ' + 'the LombScargle class was initialized ' + 'with relative times.'.format(name)) + else: + if isinstance(times, Time): + times = (times - self._tstart).to(u.day) + else: + raise TypeError('{0} was provided as a relative time but ' + 'the LombScargle class was initialized ' + 'with absolute times.'.format(name)) + + return times + + def model(self, t, frequency): + """Compute the Lomb-Scargle model at the given frequency. + + The model at a particular frequency is a linear model: + model = offset + dot(design_matrix, model_parameters) + + Parameters + ---------- + t : array_like or Quantity, length n_samples + times at which to compute the model + frequency : float + the frequency for the model + + Returns + ------- + y : np.ndarray, length n_samples + The model fit corresponding to the input times + + See Also + -------- + design_matrix + offset + model_parameters + """ + frequency = self._validate_frequency(frequency) + t = self._validate_t(self._as_relative_time('t', t)) + y_fit = periodic_fit(*strip_units(self._trel, self.y, self.dy), + frequency=strip_units(frequency), + t_fit=strip_units(t), + center_data=self.center_data, + fit_mean=self.fit_mean, + nterms=self.nterms) + return y_fit * get_unit(self.y) + + def offset(self): + """Return the offset of the model + + The offset of the model is the (weighted) mean of the y values. + Note that if self.center_data is False, the offset is 0 by definition. + + Returns + ------- + offset : scalar + + See Also + -------- + design_matrix + model + model_parameters + """ + y, dy = strip_units(self.y, self.dy) + if dy is None: + dy = 1 + dy = np.broadcast_to(dy, y.shape) + if self.center_data: + w = dy ** -2.0 + y_mean = np.dot(y, w) / w.sum() + else: + y_mean = 0 + return y_mean * get_unit(self.y) + + def model_parameters(self, frequency, units=True): + r"""Compute the best-fit model parameters at the given frequency. + + The model described by these parameters is: + + .. math:: + + y(t; f, \vec{\theta}) = \theta_0 + \sum_{n=1}^{\tt nterms} [\theta_{2n-1}\sin(2\pi n f t) + \theta_{2n}\cos(2\pi n f t)] + + where :math:`\vec{\theta}` is the array of parameters returned by this function. + + Parameters + ---------- + frequency : float + the frequency for the model + units : bool + If True (default), return design matrix with data units. + + Returns + ------- + theta : np.ndarray (n_parameters,) + The best-fit model parameters at the given frequency. + + See Also + -------- + design_matrix + model + offset + """ + frequency = self._validate_frequency(frequency) + t, y, dy = strip_units(self._trel, self.y, self.dy) + + if self.center_data: + y = y - strip_units(self.offset()) + + dy = np.ones_like(y) if dy is None else np.asarray(dy) + X = self.design_matrix(frequency) + parameters = np.linalg.solve(np.dot(X.T, X), + np.dot(X.T, y / dy)) + if units: + parameters = get_unit(self.y) * parameters + return parameters + + def design_matrix(self, frequency, t=None): + """Compute the design matrix for a given frequency + + Parameters + ---------- + frequency : float + the frequency for the model + t : array_like or `~astropy.units.Quantity` or `~astropy.time.Time`, length n_samples + times at which to compute the model (optional). If not specified, + then the times and uncertainties of the input data are used + + Returns + ------- + X : np.ndarray (len(t), n_parameters) + The design matrix for the model at the given frequency. + + See Also + -------- + model + model_parameters + offset + """ + if t is None: + t, dy = strip_units(self._trel, self.dy) + else: + t, dy = strip_units(self._validate_t(self._as_relative_time('t', t)), None) + return design_matrix(t, frequency, dy, + nterms=self.nterms, + bias=self.fit_mean) + + def distribution(self, power, cumulative=False): + """Expected periodogram distribution under the null hypothesis. + + This computes the expected probability distribution or cumulative + probability distribution of periodogram power, under the null + hypothesis of a non-varying signal with Gaussian noise. Note that + this is not the same as the expected distribution of peak values; + for that see the ``false_alarm_probability()`` method. + + Parameters + ---------- + power : array_like + The periodogram power at which to compute the distribution. + cumulative : bool (optional) + If True, then return the cumulative distribution. + + See Also + -------- + false_alarm_probability + false_alarm_level + + Returns + ------- + dist : np.ndarray + The probability density or cumulative probability associated with + the provided powers. + """ + dH = 1 if self.fit_mean or self.center_data else 0 + dK = dH + 2 * self.nterms + dist = _statistics.cdf_single if cumulative else _statistics.pdf_single + return dist(power, len(self._trel), self.normalization, dH=dH, dK=dK) + + def false_alarm_probability(self, power, method='baluev', + samples_per_peak=5, nyquist_factor=5, + minimum_frequency=None, maximum_frequency=None, + method_kwds=None): + """False alarm probability of periodogram maxima under the null hypothesis. + + This gives an estimate of the false alarm probability given the height + of the largest peak in the periodogram, based on the null hypothesis + of non-varying data with Gaussian noise. + + Parameters + ---------- + power : array-like + The periodogram value. + method : {'baluev', 'davies', 'naive', 'bootstrap'}, optional + The approximation method to use. + maximum_frequency : float + The maximum frequency of the periodogram. + method_kwds : dict (optional) + Additional method-specific keywords. + + Returns + ------- + false_alarm_probability : np.ndarray + The false alarm probability + + Notes + ----- + The true probability distribution for the largest peak cannot be + determined analytically, so each method here provides an approximation + to the value. The available methods are: + + - "baluev" (default): the upper-limit to the alias-free probability, + using the approach of Baluev (2008) [1]_. + - "davies" : the Davies upper bound from Baluev (2008) [1]_. + - "naive" : the approximate probability based on an estimated + effective number of independent frequencies. + - "bootstrap" : the approximate probability based on bootstrap + resamplings of the input data. + + Note also that for normalization='psd', the distribution can only be + computed for periodograms constructed with errors specified. + + See Also + -------- + distribution + false_alarm_level + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + if self.nterms != 1: + raise NotImplementedError("false alarm probability is not " + "implemented for multiterm periodograms.") + if not (self.fit_mean or self.center_data): + raise NotImplementedError("false alarm probability is implemented " + "only for periodograms of centered data.") + + fmin, fmax = self.autofrequency(samples_per_peak=samples_per_peak, + nyquist_factor=nyquist_factor, + minimum_frequency=minimum_frequency, + maximum_frequency=maximum_frequency, + return_freq_limits=True) + return _statistics.false_alarm_probability(power, + fmax=fmax, + t=self._trel, y=self.y, dy=self.dy, + normalization=self.normalization, + method=method, + method_kwds=method_kwds) + + def false_alarm_level(self, false_alarm_probability, method='baluev', + samples_per_peak=5, nyquist_factor=5, + minimum_frequency=None, maximum_frequency=None, + method_kwds=None): + """Level of maximum at a given false alarm probability. + + This gives an estimate of the periodogram level corresponding to a + specified false alarm probability for the largest peak, assuming a + null hypothesis of non-varying data with Gaussian noise. + + Parameters + ---------- + false_alarm_probability : array-like + The false alarm probability (0 < fap < 1). + maximum_frequency : float + The maximum frequency of the periodogram. + method : {'baluev', 'davies', 'naive', 'bootstrap'}, optional + The approximation method to use; default='baluev'. + method_kwds : dict, optional + Additional method-specific keywords. + + Returns + ------- + power : np.ndarray + The periodogram peak height corresponding to the specified + false alarm probability. + + Notes + ----- + The true probability distribution for the largest peak cannot be + determined analytically, so each method here provides an approximation + to the value. The available methods are: + + - "baluev" (default): the upper-limit to the alias-free probability, + using the approach of Baluev (2008) [1]_. + - "davies" : the Davies upper bound from Baluev (2008) [1]_. + - "naive" : the approximate probability based on an estimated + effective number of independent frequencies. + - "bootstrap" : the approximate probability based on bootstrap + resamplings of the input data. + + Note also that for normalization='psd', the distribution can only be + computed for periodograms constructed with errors specified. + + See Also + -------- + distribution + false_alarm_probability + + References + ---------- + .. [1] Baluev, R.V. MNRAS 385, 1279 (2008) + """ + if self.nterms != 1: + raise NotImplementedError("false alarm probability is not " + "implemented for multiterm periodograms.") + if not (self.fit_mean or self.center_data): + raise NotImplementedError("false alarm probability is implemented " + "only for periodograms of centered data.") + + fmin, fmax = self.autofrequency(samples_per_peak=samples_per_peak, + nyquist_factor=nyquist_factor, + minimum_frequency=minimum_frequency, + maximum_frequency=maximum_frequency, + return_freq_limits=True) + return _statistics.false_alarm_level(false_alarm_probability, + fmax=fmax, + t=self._trel, y=self.y, dy=self.dy, + normalization=self.normalization, + method=method, + method_kwds=method_kwds) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52108bbd7da0b173ce686cce0d1f5dc4c7529ed9 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/__init__.py @@ -0,0 +1,8 @@ +"""Various implementations of the Lomb-Scargle Periodogram""" + +from .main import lombscargle, available_methods +from .chi2_impl import lombscargle_chi2 +from .scipy_impl import lombscargle_scipy +from .slow_impl import lombscargle_slow +from .fast_impl import lombscargle_fast +from .fastchi2_impl import lombscargle_fastchi2 diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/chi2_impl.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/chi2_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..192cab94715897231f91df2b7c0c8ea2e274b4be --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/chi2_impl.py @@ -0,0 +1,87 @@ + +import numpy as np + +from .mle import design_matrix + + +def lombscargle_chi2(t, y, dy, frequency, normalization='standard', + fit_mean=True, center_data=True, nterms=1): + """Lomb-Scargle Periodogram + + This implements a chi-squared-based periodogram, which is relatively slow + but useful for validating the faster algorithms in the package. + + Parameters + ---------- + t, y, dy : array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + frequency : array_like + frequencies (not angular frequencies) at which to calculate periodogram + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if ``fit_mean = False`` + nterms : int (optional, default=1) + Number of Fourier terms in the fit + + Returns + ------- + power : array_like + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + References + ---------- + .. [1] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + .. [2] W. Press et al, Numerical Recipes in C (2002) + .. [3] Scargle, J.D. 1982, ApJ 263:835-853 + """ + if dy is None: + dy = 1 + + t, y, dy = np.broadcast_arrays(t, y, dy) + frequency = np.asarray(frequency) + + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + if frequency.ndim != 1: + raise ValueError("frequency should be one-dimensional") + + w = dy ** -2.0 + w /= w.sum() + + # if fit_mean is true, centering the data now simplifies the math below. + if center_data or fit_mean: + yw = (y - np.dot(w, y)) / dy + else: + yw = y / dy + chi2_ref = np.dot(yw, yw) + + # compute the unnormalized model chi2 at each frequency + def compute_power(f): + X = design_matrix(t, f, dy=dy, bias=fit_mean, nterms=nterms) + XTX = np.dot(X.T, X) + XTy = np.dot(X.T, yw) + return np.dot(XTy.T, np.linalg.solve(XTX, XTy)) + + p = np.array([compute_power(f) for f in frequency]) + + if normalization == 'psd': + p *= 0.5 + elif normalization == 'model': + p /= (chi2_ref - p) + elif normalization == 'log': + p = -np.log(1 - p / chi2_ref) + elif normalization == 'standard': + p /= chi2_ref + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + return p diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/cython_impl.pyx b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/cython_impl.pyx new file mode 100644 index 0000000000000000000000000000000000000000..ee7ab9984c491bc8c049bd1335955513e2b4af3b --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/cython_impl.pyx @@ -0,0 +1,250 @@ +#cython: language_level=3 + +import numpy as np +cimport numpy as np + +cimport cython + +cdef extern from "math.h": + double sin(double) + double cos(double) + double atan2(double, double) + +DTYPE = np.float64 +ctypedef np.float64_t DTYPE_t + +ITYPE = np.intp +ctypedef np.intp_t ITYPE_t + + +def lombscargle_cython(t, y, dy, frequency, normalization='standard', + fit_mean=True, center_data=True): + """Lomb-Scargle Periodogram + + This is a pure-python implementation of the original Lomb-Scargle formalism + (e.g. [1]_, [2]_), with the addition of the floating mean (e.g. [3]_) + + Parameters + ---------- + t, y, dy : array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + frequency : array_like + frequencies (not angular frequencies) at which to calculate periodogram + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if ``fit_mean = False`` + + Returns + ------- + power : array_like + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + References + ---------- + .. [1] W. Press et al, Numerical Recipes in C (2002) + .. [2] Scargle, J.D. 1982, ApJ 263:835-853 + .. [3] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + """ + if dy is None: + dy = 1 + + t, y, dy = np.broadcast_arrays(t, y, dy) + t = np.asarray(t, dtype=DTYPE, order='C') + y = np.asarray(y, dtype=DTYPE, order='C') + dy = np.asarray(dy, dtype=DTYPE, order='C') + frequency = np.asarray(frequency, dtype=DTYPE, order='C') + + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + if frequency.ndim != 1: + raise ValueError("frequency should be one-dimensional") + + PLS = np.zeros(frequency.shape, dtype=DTYPE, order='C') + + # pre-center the data: not technically required if fit_mean=True, + # but it simplifies the math. + if fit_mean or center_data: + # compute MLE for mean in the presence of noise. + w = dy ** -2 + y = y - np.dot(w, y) / np.sum(w) + + if fit_mean: + _generalized_lomb_scargle(t, y, dy, 2 * np.pi * frequency, PLS) + else: + _standard_lomb_scargle(t, y, dy, 2 * np.pi * frequency, PLS) + + if normalization == 'standard': + pass + elif normalization == 'model': + return PLS / (1 - PLS) + elif normalization == 'log': + return -np.log(1 - PLS) + elif normalization == 'psd': + w = dy ** -2 + PLS *= 0.5 * np.dot(w, y * y) + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + return PLS.ravel() + + +@cython.cdivision(True) +@cython.boundscheck(False) +@cython.wraparound(False) +cdef _standard_lomb_scargle(DTYPE_t[::1] t, DTYPE_t[::1] y, DTYPE_t[::1] dy, + DTYPE_t[::1] omega, DTYPE_t[::1] PLS): + cdef ITYPE_t N_freq = omega.shape[0] + cdef ITYPE_t N_obs = t.shape[0] + + cdef DTYPE_t w, omega_t, sin_omega_t, cos_omega_t + cdef DTYPE_t S2, C2, tau, Y, wsum, YY, YCtau, YStau, CCtau, SStau + + for i in range(N_freq): + # first pass: determine tau + S2 = 0 + C2 = 0 + for j in range(N_obs): + w = 1. / dy[j] + w *= w + + omega_t = omega[i] * t[j] + sin_omega_t = sin(omega_t) + cos_omega_t = cos(omega_t) + + S2 += 2 * w * sin_omega_t * cos_omega_t + C2 += w * (1 - 2 * sin_omega_t * sin_omega_t) + + tau = 0.5 * atan2(S2, C2) / omega[i] + + wsum = 0 + Y = 0 + YY = 0 + YCtau = 0 + YStau = 0 + CCtau = 0 + SStau = 0 + + # second pass: compute the power + for j in range(N_obs): + w = 1. / dy[j] + w *= w + wsum += w + + omega_t = omega[i] * (t[j] - tau) + sin_omega_t = sin(omega_t) + cos_omega_t = cos(omega_t) + + Y += w * y[j] + YY += w * y[j] * y[j] + YCtau += w * y[j] * cos_omega_t + YStau += w * y[j] * sin_omega_t + CCtau += w * cos_omega_t * cos_omega_t + SStau += w * sin_omega_t * sin_omega_t + + Y /= wsum + YY /= wsum + YCtau /= wsum + YStau /= wsum + CCtau /= wsum + SStau /= wsum + + PLS[i] = (YCtau * YCtau / CCtau + YStau * YStau / SStau) / YY + + +@cython.cdivision(True) +@cython.boundscheck(False) +@cython.wraparound(False) +cdef _generalized_lomb_scargle(DTYPE_t[::1] t, DTYPE_t[::1] y, DTYPE_t[::1] dy, + DTYPE_t[::1] omega, DTYPE_t[::1] PLS): + cdef ITYPE_t N_freq = omega.shape[0] + cdef ITYPE_t N_obs = t.shape[0] + + cdef DTYPE_t w, omega_t, sin_omega_t, cos_omega_t + cdef DTYPE_t S, C, S2, C2, tau, Y, wsum, YY + cdef DTYPE_t Stau, Ctau, YCtau, YStau, CCtau, SStau + + for i in range(N_freq): + # first pass: determine tau + wsum = 0 + S = 0 + C = 0 + S2 = 0 + C2 = 0 + for j in range(N_obs): + w = 1. / dy[j] + w *= w + wsum += w + + omega_t = omega[i] * t[j] + sin_omega_t = sin(omega_t) + cos_omega_t = cos(omega_t) + + S += w * sin_omega_t + C += w * cos_omega_t + + S2 += 2 * w * sin_omega_t * cos_omega_t + C2 += w - 2 * w * sin_omega_t * sin_omega_t + + S2 /= wsum + C2 /= wsum + S /= wsum + C /= wsum + + S2 -= (2 * S * C) + C2 -= (C * C - S * S) + + tau = 0.5 * atan2(S2, C2) / omega[i] + + Y = 0 + YY = 0 + Stau = 0 + Ctau = 0 + YCtau = 0 + YStau = 0 + CCtau = 0 + SStau = 0 + + # second pass: compute the power + for j in range(N_obs): + w = 1. / dy[j] + w *= w + + omega_t = omega[i] * (t[j] - tau) + sin_omega_t = sin(omega_t) + cos_omega_t = cos(omega_t) + + Y += w * y[j] + YY += w * y[j] * y[j] + Ctau += w * cos_omega_t + Stau += w * sin_omega_t + YCtau += w * y[j] * cos_omega_t + YStau += w * y[j] * sin_omega_t + CCtau += w * cos_omega_t * cos_omega_t + SStau += w * sin_omega_t * sin_omega_t + + Y /= wsum + YY /= wsum + Ctau /= wsum + Stau /= wsum + YCtau /= wsum + YStau /= wsum + CCtau /= wsum + SStau /= wsum + + YCtau -= Y * Ctau + YStau -= Y * Stau + CCtau -= Ctau * Ctau + SStau -= Stau * Stau + + YY -= Y * Y + + PLS[i] = (YCtau * YCtau / CCtau + YStau * YStau / SStau) / YY diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fast_impl.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fast_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..f7a0d976ae56037fedd6245a64a4b4a372769faf --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fast_impl.py @@ -0,0 +1,136 @@ + +import numpy as np +from .utils import trig_sum + + +def lombscargle_fast(t, y, dy, f0, df, Nf, + center_data=True, fit_mean=True, + normalization='standard', + use_fft=True, trig_sum_kwds=None): + """Fast Lomb-Scargle Periodogram + + This implements the Press & Rybicki method [1]_ for fast O[N log(N)] + Lomb-Scargle periodograms. + + Parameters + ---------- + t, y, dy : array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + f0, df, Nf : (float, float, int) + parameters describing the frequency grid, f = f0 + df * arange(Nf). + center_data : bool (default=True) + Specify whether to subtract the mean of the data before the fit + fit_mean : bool (default=True) + If True, then compute the floating-mean periodogram; i.e. let the mean + vary with the fit. + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + use_fft : bool (default=True) + If True, then use the Press & Rybicki O[NlogN] algorithm to compute + the result. Otherwise, use a slower O[N^2] algorithm + trig_sum_kwds : dict or None (optional) + extra keyword arguments to pass to the ``trig_sum`` utility. + Options are ``oversampling`` and ``Mfft``. See documentation + of ``trig_sum`` for details. + + Returns + ------- + power : ndarray + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + Notes + ----- + Note that the ``use_fft=True`` algorithm is an approximation to the true + Lomb-Scargle periodogram, and as the number of points grows this + approximation improves. On the other hand, for very small datasets + (<~50 points or so) this approximation may not be useful. + + References + ---------- + .. [1] Press W.H. and Rybicki, G.B, "Fast algorithm for spectral analysis + of unevenly sampled data". ApJ 1:338, p277, 1989 + .. [2] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + .. [3] W. Press et al, Numerical Recipes in C (2002) + """ + if dy is None: + dy = 1 + + # Validate and setup input data + t, y, dy = np.broadcast_arrays(t, y, dy) + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + + # Validate and setup frequency grid + if f0 < 0: + raise ValueError("Frequencies must be positive") + if df <= 0: + raise ValueError("Frequency steps must be positive") + if Nf <= 0: + raise ValueError("Number of frequencies must be positive") + + w = dy ** -2.0 + w /= w.sum() + + # Center the data. Even if we're fitting the offset, + # this step makes the expressions below more succinct + if center_data or fit_mean: + y = y - np.dot(w, y) + + # set up arguments to trig_sum + kwargs = dict.copy(trig_sum_kwds or {}) + kwargs.update(f0=f0, df=df, use_fft=use_fft, N=Nf) + + # ---------------------------------------------------------------------- + # 1. compute functions of the time-shift tau at each frequency + Sh, Ch = trig_sum(t, w * y, **kwargs) + S2, C2 = trig_sum(t, w, freq_factor=2, **kwargs) + + if fit_mean: + S, C = trig_sum(t, w, **kwargs) + tan_2omega_tau = (S2 - 2 * S * C) / (C2 - (C * C - S * S)) + else: + tan_2omega_tau = S2 / C2 + + # This is what we're computing below; the straightforward way is slower + # and less stable, so we use trig identities instead + # + # omega_tau = 0.5 * np.arctan(tan_2omega_tau) + # S2w, C2w = np.sin(2 * omega_tau), np.cos(2 * omega_tau) + # Sw, Cw = np.sin(omega_tau), np.cos(omega_tau) + + S2w = tan_2omega_tau / np.sqrt(1 + tan_2omega_tau * tan_2omega_tau) + C2w = 1 / np.sqrt(1 + tan_2omega_tau * tan_2omega_tau) + Cw = np.sqrt(0.5) * np.sqrt(1 + C2w) + Sw = np.sqrt(0.5) * np.sign(S2w) * np.sqrt(1 - C2w) + + # ---------------------------------------------------------------------- + # 2. Compute the periodogram, following Zechmeister & Kurster + # and using tricks from Press & Rybicki. + YY = np.dot(w, y ** 2) + YC = Ch * Cw + Sh * Sw + YS = Sh * Cw - Ch * Sw + CC = 0.5 * (1 + C2 * C2w + S2 * S2w) + SS = 0.5 * (1 - C2 * C2w - S2 * S2w) + + if fit_mean: + CC -= (C * Cw + S * Sw) ** 2 + SS -= (S * Cw - C * Sw) ** 2 + + power = (YC * YC / CC + YS * YS / SS) + + if normalization == 'standard': + power /= YY + elif normalization == 'model': + power /= YY - power + elif normalization == 'log': + power = -np.log(1 - power / YY) + elif normalization == 'psd': + power *= 0.5 * (dy ** -2.0).sum() + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + + return power diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fastchi2_impl.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fastchi2_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..e00fae7a7fde2ce47dda3f378ef58636c75adcdd --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/fastchi2_impl.py @@ -0,0 +1,135 @@ + +import numpy as np + +from .utils import trig_sum + + +def lombscargle_fastchi2(t, y, dy, f0, df, Nf, normalization='standard', + fit_mean=True, center_data=True, nterms=1, + use_fft=True, trig_sum_kwds=None): + """Lomb-Scargle Periodogram + + This implements a fast chi-squared periodogram using the algorithm + outlined in [4]_. The result is identical to the standard Lomb-Scargle + periodogram. The advantage of this algorithm is the + ability to compute multiterm periodograms relatively quickly. + + Parameters + ---------- + t, y, dy : array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + f0, df, Nf : (float, float, int) + parameters describing the frequency grid, f = f0 + df * arange(Nf). + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if ``fit_mean = False`` + nterms : int (optional, default=1) + Number of Fourier terms in the fit + + Returns + ------- + power : array_like + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + References + ---------- + .. [1] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + .. [2] W. Press et al, Numerical Recipes in C (2002) + .. [3] Scargle, J.D. ApJ 263:835-853 (1982) + .. [4] Palmer, J. ApJ 695:496-502 (2009) + """ + if nterms == 0 and not fit_mean: + raise ValueError("Cannot have nterms = 0 without fitting bias") + + if dy is None: + dy = 1 + + # Validate and setup input data + t, y, dy = np.broadcast_arrays(t, y, dy) + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + + # Validate and setup frequency grid + if f0 < 0: + raise ValueError("Frequencies must be positive") + if df <= 0: + raise ValueError("Frequency steps must be positive") + if Nf <= 0: + raise ValueError("Number of frequencies must be positive") + + w = dy ** -2.0 + ws = np.sum(w) + + # if fit_mean is true, centering the data now simplifies the math below. + if center_data or fit_mean: + y = y - np.dot(w, y) / ws + + yw = y / dy + chi2_ref = np.dot(yw, yw) + + kwargs = dict.copy(trig_sum_kwds or {}) + kwargs.update(f0=f0, df=df, use_fft=use_fft, N=Nf) + + # Here we build-up the matrices XTX and XTy using pre-computed + # sums. The relevant identities are + # 2 sin(mx) sin(nx) = cos(m-n)x - cos(m+n)x + # 2 cos(mx) cos(nx) = cos(m-n)x + cos(m+n)x + # 2 sin(mx) cos(nx) = sin(m-n)x + sin(m+n)x + + yws = np.sum(y * w) + + SCw = [(np.zeros(Nf), ws * np.ones(Nf))] + SCw.extend([trig_sum(t, w, freq_factor=i, **kwargs) + for i in range(1, 2 * nterms + 1)]) + Sw, Cw = zip(*SCw) + + SCyw = [(np.zeros(Nf), yws * np.ones(Nf))] + SCyw.extend([trig_sum(t, w * y, freq_factor=i, **kwargs) + for i in range(1, nterms + 1)]) + Syw, Cyw = zip(*SCyw) + + # Now create an indexing scheme so we can quickly + # build-up matrices at each frequency + order = [('C', 0)] if fit_mean else [] + order.extend(sum([[('S', i), ('C', i)] + for i in range(1, nterms + 1)], [])) + + funcs = dict(S=lambda m, i: Syw[m][i], + C=lambda m, i: Cyw[m][i], + SS=lambda m, n, i: 0.5 * (Cw[abs(m - n)][i] - Cw[m + n][i]), + CC=lambda m, n, i: 0.5 * (Cw[abs(m - n)][i] + Cw[m + n][i]), + SC=lambda m, n, i: 0.5 * (np.sign(m - n) * Sw[abs(m - n)][i] + + Sw[m + n][i]), + CS=lambda m, n, i: 0.5 * (np.sign(n - m) * Sw[abs(n - m)][i] + + Sw[n + m][i])) + + def compute_power(i): + XTX = np.array([[funcs[A[0] + B[0]](A[1], B[1], i) + for A in order] + for B in order]) + XTy = np.array([funcs[A[0]](A[1], i) for A in order]) + return np.dot(XTy.T, np.linalg.solve(XTX, XTy)) + + p = np.array([compute_power(i) for i in range(Nf)]) + + if normalization == 'psd': + p *= 0.5 + elif normalization == 'standard': + p /= chi2_ref + elif normalization == 'log': + p = -np.log(1 - p / chi2_ref) + elif normalization == 'model': + p /= chi2_ref - p + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + return p diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/main.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/main.py new file mode 100644 index 0000000000000000000000000000000000000000..1e898a3ca1b57d7d355822cc41e02b8318e4263f --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/main.py @@ -0,0 +1,217 @@ +""" +Main Lomb-Scargle Implementation + +The ``lombscargle`` function here is essentially a sophisticated switch +statement for the various implementations available in this submodule +""" + +__all__ = ['lombscargle', 'available_methods'] + +import numpy as np + +from .slow_impl import lombscargle_slow +from .fast_impl import lombscargle_fast +from .scipy_impl import lombscargle_scipy +from .chi2_impl import lombscargle_chi2 +from .fastchi2_impl import lombscargle_fastchi2 +from .cython_impl import lombscargle_cython + + +METHODS = {'slow': lombscargle_slow, + 'fast': lombscargle_fast, + 'chi2': lombscargle_chi2, + 'scipy': lombscargle_scipy, + 'fastchi2': lombscargle_fastchi2, + 'cython': lombscargle_cython} + + +def available_methods(): + methods = ['auto', 'slow', 'chi2', 'cython', 'fast', 'fastchi2'] + + # Scipy required for scipy algorithm (obviously) + try: + import scipy + except ImportError: + pass + else: + methods.append('scipy') + return methods + + +def _is_regular(frequency): + frequency = np.asarray(frequency) + + if frequency.ndim != 1: + return False + elif len(frequency) == 1: + return True + else: + diff = np.diff(frequency) + return np.allclose(diff[0], diff) + + +def _get_frequency_grid(frequency, assume_regular_frequency=False): + """Utility to get grid parameters from a frequency array + + Parameters + ---------- + frequency : array_like or Quantity + input frequency grid + assume_regular_frequency : bool (default = False) + if True, then do not check whether frequency is a regular grid + + Returns + ------- + f0, df, N : scalars + Parameters such that all(frequency == f0 + df * np.arange(N)) + """ + frequency = np.asarray(frequency) + if frequency.ndim != 1: + raise ValueError("frequency grid must be 1 dimensional") + elif len(frequency) == 1: + return frequency[0], frequency[0], 1 + elif not (assume_regular_frequency or _is_regular(frequency)): + raise ValueError("frequency must be a regular grid") + + return frequency[0], frequency[1] - frequency[0], len(frequency) + + +def validate_method(method, dy, fit_mean, nterms, + frequency, assume_regular_frequency): + """ + Validate the method argument, and if method='auto' + choose the appropriate method + """ + methods = available_methods() + prefer_fast = (len(frequency) > 200 + and (assume_regular_frequency or _is_regular(frequency))) + prefer_scipy = 'scipy' in methods and dy is None and not fit_mean + + # automatically choose the appropriate method + if method == 'auto': + + if nterms != 1: + if prefer_fast: + method = 'fastchi2' + else: + method = 'chi2' + elif prefer_fast: + method = 'fast' + elif prefer_scipy: + method = 'scipy' + else: + method = 'cython' + + if method not in METHODS: + raise ValueError("invalid method: {0}".format(method)) + + return method + + +def lombscargle(t, y, dy=None, + frequency=None, + method='auto', + assume_regular_frequency=False, + normalization='standard', + fit_mean=True, center_data=True, + method_kwds=None, nterms=1): + """ + Compute the Lomb-scargle Periodogram with a given method. + + Parameters + ---------- + t : array_like + sequence of observation times + y : array_like + sequence of observations associated with times t + dy : float or array_like (optional) + error or sequence of observational errors associated with times t + frequency : array_like + frequencies (not angular frequencies) at which to evaluate the + periodogram. If not specified, optimal frequencies will be chosen using + a heuristic which will attempt to provide sufficient frequency range + and sampling so that peaks will not be missed. Note that in order to + use method='fast', frequencies must be regularly spaced. + method : string (optional) + specify the lomb scargle implementation to use. Options are: + + - 'auto': choose the best method based on the input + - 'fast': use the O[N log N] fast method. Note that this requires + evenly-spaced frequencies: by default this will be checked unless + ``assume_regular_frequency`` is set to True. + - `slow`: use the O[N^2] pure-python implementation + - `chi2`: use the O[N^2] chi2/linear-fitting implementation + - `fastchi2`: use the O[N log N] chi2 implementation. Note that this + requires evenly-spaced frequencies: by default this will be checked + unless `assume_regular_frequency` is set to True. + - `scipy`: use ``scipy.signal.lombscargle``, which is an O[N^2] + implementation written in C. Note that this does not support + heteroskedastic errors. + + assume_regular_frequency : bool (optional) + if True, assume that the input frequency is of the form + freq = f0 + df * np.arange(N). Only referenced if method is 'auto' + or 'fast'. + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard' or 'psd'. + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if `fit_mean = False` + method_kwds : dict (optional) + additional keywords to pass to the lomb-scargle method + nterms : int (default=1) + number of Fourier terms to use in the periodogram. + Not supported with every method. + + Returns + ------- + PLS : array_like + Lomb-Scargle power associated with each frequency omega + """ + # frequencies should be one-dimensional arrays + output_shape = frequency.shape + frequency = frequency.ravel() + + # we'll need to adjust args and kwds for each method + args = (t, y, dy) + kwds = dict(frequency=frequency, + center_data=center_data, + fit_mean=fit_mean, + normalization=normalization, + nterms=nterms, + **(method_kwds or {})) + + method = validate_method(method, dy=dy, fit_mean=fit_mean, nterms=nterms, + frequency=frequency, + assume_regular_frequency=assume_regular_frequency) + + # scipy doesn't support dy or fit_mean=True + if method == 'scipy': + if kwds.pop('fit_mean'): + raise ValueError("scipy method does not support fit_mean=True") + if dy is not None: + dy = np.ravel(np.asarray(dy)) + if not np.allclose(dy[0], dy): + raise ValueError("scipy method only supports " + "uniform uncertainties dy") + args = (t, y) + + # fast methods require frequency expressed as a grid + if method.startswith('fast'): + f0, df, Nf = _get_frequency_grid(kwds.pop('frequency'), + assume_regular_frequency) + kwds.update(f0=f0, df=df, Nf=Nf) + + # only chi2 methods support nterms + if not method.endswith('chi2'): + if kwds.pop('nterms') != 1: + raise ValueError("nterms != 1 only supported with 'chi2' " + "or 'fastchi2' methods") + + PLS = METHODS[method](*args, **kwds) + return PLS.reshape(output_shape) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/mle.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/mle.py new file mode 100644 index 0000000000000000000000000000000000000000..2442f99e1f5102743fcd21b5b5b42a0266557a51 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/mle.py @@ -0,0 +1,108 @@ + +import numpy as np + + +def design_matrix(t, frequency, dy=None, bias=True, nterms=1): + """Compute the Lomb-Scargle design matrix at the given frequency + + This is the matrix X such that the periodic model at the given frequency + can be expressed :math:`\\hat{y} = X \\theta`. + + Parameters + ---------- + t : array_like, shape=(n_times,) + times at which to compute the design matrix + frequency : float + frequency for the design matrix + dy : float or array_like (optional) + data uncertainties: should be broadcastable with `t` + bias : bool (default=True) + If true, include a bias column in the matrix + nterms : int (default=1) + Number of Fourier terms to include in the model + + Returns + ------- + X : ndarray, shape=(n_times, n_parameters) + The design matrix, where n_parameters = bool(bias) + 2 * nterms + """ + t = np.asarray(t) + frequency = np.asarray(frequency) + + if t.ndim != 1: + raise ValueError("t should be one dimensional") + if frequency.ndim != 0: + raise ValueError("frequency must be a scalar") + + if nterms == 0 and not bias: + raise ValueError("cannot have nterms=0 and no bias") + + if bias: + cols = [np.ones_like(t)] + else: + cols = [] + + for i in range(1, nterms + 1): + cols.append(np.sin(2 * np.pi * i * frequency * t)) + cols.append(np.cos(2 * np.pi * i * frequency * t)) + XT = np.vstack(cols) + + if dy is not None: + XT /= dy + + return np.transpose(XT) + + +def periodic_fit(t, y, dy, frequency, t_fit, + center_data=True, fit_mean=True, nterms=1): + """Compute the Lomb-Scargle model fit at a given frequency + + Parameters + ---------- + t, y, dy : float or array_like + The times, observations, and uncertainties to fit + frequency : float + The frequency at which to compute the model + t_fit : float or array_like + The times at which the fit should be computed + center_data : bool (default=True) + If True, center the input data before applying the fit + fit_mean : bool (default=True) + If True, include the bias as part of the model + nterms : int (default=1) + The number of Fourier terms to include in the fit + + Returns + ------- + y_fit : ndarray + The model fit evaluated at each value of t_fit + """ + t, y, frequency = map(np.asarray, (t, y, frequency)) + if dy is None: + dy = np.ones_like(y) + else: + dy = np.asarray(dy) + + t_fit = np.asarray(t_fit) + + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + if t_fit.ndim != 1: + raise ValueError("t_fit should be one dimensional") + if frequency.ndim != 0: + raise ValueError("frequency should be a scalar") + + if center_data: + w = dy ** -2.0 + y_mean = np.dot(y, w) / w.sum() + y = (y - y_mean) + else: + y_mean = 0 + + X = design_matrix(t, frequency, dy=dy, bias=fit_mean, nterms=nterms) + theta_MLE = np.linalg.solve(np.dot(X.T, X), + np.dot(X.T, y / dy)) + + X_fit = design_matrix(t_fit, frequency, bias=fit_mean, nterms=nterms) + + return y_mean + np.dot(X_fit, theta_MLE) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/scipy_impl.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/scipy_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..cfed9dfba21c12017d013bade0dc753bbf5ce249 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/scipy_impl.py @@ -0,0 +1,73 @@ + +import numpy as np + + +def lombscargle_scipy(t, y, frequency, normalization='standard', + center_data=True): + """Lomb-Scargle Periodogram + + This is a wrapper of ``scipy.signal.lombscargle`` for computation of the + Lomb-Scargle periodogram. This is a relatively fast version of the naive + O[N^2] algorithm, but cannot handle heteroskedastic errors. + + Parameters + ---------- + t, y: array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + frequency : array_like + frequencies (not angular frequencies) at which to calculate periodogram + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. + + Returns + ------- + power : array_like + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + References + ---------- + .. [1] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + .. [2] W. Press et al, Numerical Recipes in C (2002) + .. [3] Scargle, J.D. 1982, ApJ 263:835-853 + """ + try: + from scipy import signal + except ImportError: + raise ImportError("scipy must be installed to use lombscargle_scipy") + + t, y = np.broadcast_arrays(t, y) + + # Scipy requires floating-point input + t = np.asarray(t, dtype=float) + y = np.asarray(y, dtype=float) + frequency = np.asarray(frequency, dtype=float) + + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + if frequency.ndim != 1: + raise ValueError("frequency should be one-dimensional") + + if center_data: + y = y - y.mean() + + # Note: scipy input accepts angular frequencies + p = signal.lombscargle(t, y, 2 * np.pi * frequency) + + if normalization == 'psd': + pass + elif normalization == 'standard': + p *= 2 / (t.size * np.mean(y ** 2)) + elif normalization == 'log': + p = -np.log(1 - 2 * p / (t.size * np.mean(y ** 2))) + elif normalization == 'model': + p /= 0.5 * t.size * np.mean(y ** 2) - p + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + return p diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/slow_impl.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/slow_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..1d9ec3e4f4ca7c44b68b79d5293cc4a23157904e --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/slow_impl.py @@ -0,0 +1,120 @@ + +import numpy as np + + +def lombscargle_slow(t, y, dy, frequency, normalization='standard', + fit_mean=True, center_data=True): + """Lomb-Scargle Periodogram + + This is a pure-python implementation of the original Lomb-Scargle formalism + (e.g. [1]_, [2]_), with the addition of the floating mean (e.g. [3]_) + + Parameters + ---------- + t, y, dy : array_like (NOT astropy.Quantities) + times, values, and errors of the data points. These should be + broadcastable to the same shape. + frequency : array_like + frequencies (not angular frequencies) at which to calculate periodogram + normalization : string (optional, default='standard') + Normalization to use for the periodogram. + Options are 'standard', 'model', 'log', or 'psd'. + fit_mean : bool (optional, default=True) + if True, include a constant offset as part of the model at each + frequency. This can lead to more accurate results, especially in the + case of incomplete phase coverage. + center_data : bool (optional, default=True) + if True, pre-center the data by subtracting the weighted mean + of the input data. This is especially important if ``fit_mean = False`` + + Returns + ------- + power : array_like + Lomb-Scargle power associated with each frequency. + Units of the result depend on the normalization. + + References + ---------- + .. [1] W. Press et al, Numerical Recipes in C (2002) + .. [2] Scargle, J.D. 1982, ApJ 263:835-853 + .. [3] M. Zechmeister and M. Kurster, A&A 496, 577-584 (2009) + """ + if dy is None: + dy = 1 + + t, y, dy = np.broadcast_arrays(t, y, dy) + frequency = np.asarray(frequency) + + if t.ndim != 1: + raise ValueError("t, y, dy should be one dimensional") + if frequency.ndim != 1: + raise ValueError("frequency should be one-dimensional") + + w = dy ** -2.0 + w /= w.sum() + + # if fit_mean is true, centering the data now simplifies the math below. + if fit_mean or center_data: + y = y - np.dot(w, y) + + omega = 2 * np.pi * frequency + omega = omega.ravel()[np.newaxis, :] + + # make following arrays into column vectors + t, y, dy, w = map(lambda x: x[:, np.newaxis], (t, y, dy, w)) + + sin_omega_t = np.sin(omega * t) + cos_omega_t = np.cos(omega * t) + + # compute time-shift tau + # S2 = np.dot(w.T, np.sin(2 * omega * t) + S2 = 2 * np.dot(w.T, sin_omega_t * cos_omega_t) + # C2 = np.dot(w.T, np.cos(2 * omega * t) + C2 = 2 * np.dot(w.T, 0.5 - sin_omega_t ** 2) + + if fit_mean: + S = np.dot(w.T, sin_omega_t) + C = np.dot(w.T, cos_omega_t) + + S2 -= (2 * S * C) + C2 -= (C * C - S * S) + + # compute components needed for the fit + omega_t_tau = omega * t - 0.5 * np.arctan2(S2, C2) + + sin_omega_t_tau = np.sin(omega_t_tau) + cos_omega_t_tau = np.cos(omega_t_tau) + + Y = np.dot(w.T, y) + + wy = w * y + + YCtau = np.dot(wy.T, cos_omega_t_tau) + YStau = np.dot(wy.T, sin_omega_t_tau) + CCtau = np.dot(w.T, cos_omega_t_tau * cos_omega_t_tau) + SStau = np.dot(w.T, sin_omega_t_tau * sin_omega_t_tau) + + if fit_mean: + Ctau = np.dot(w.T, cos_omega_t_tau) + Stau = np.dot(w.T, sin_omega_t_tau) + + YCtau -= Y * Ctau + YStau -= Y * Stau + CCtau -= Ctau * Ctau + SStau -= Stau * Stau + + p = (YCtau * YCtau / CCtau + YStau * YStau / SStau) + YY = np.dot(w.T, y * y) + + if normalization == 'standard': + p /= YY + elif normalization == 'model': + p /= YY - p + elif normalization == 'log': + p = -np.log(1 - p / YY) + elif normalization == 'psd': + p *= 0.5 * (dy ** -2.0).sum() + else: + raise ValueError("normalization='{0}' " + "not recognized".format(normalization)) + return p.ravel() diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_mle.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_mle.py new file mode 100644 index 0000000000000000000000000000000000000000..0bc17746544347d95e2dfcacc024d5f802223b0a --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_mle.py @@ -0,0 +1,54 @@ +import pytest +import numpy as np +from numpy.testing import assert_allclose + +from astropy.timeseries.periodograms.lombscargle.implementations.mle import design_matrix, periodic_fit + + +@pytest.fixture +def t(): + rand = np.random.RandomState(42) + return 10 * rand.rand(10) + + +@pytest.mark.parametrize('freq', [1.0, 2]) +@pytest.mark.parametrize('dy', [None, 2.0]) +@pytest.mark.parametrize('bias', [True, False]) +def test_design_matrix(t, freq, dy, bias): + X = design_matrix(t, freq, dy, bias=bias) + assert X.shape == (t.shape[0], 2 + bool(bias)) + if bias: + assert_allclose(X[:, 0], 1. / (dy or 1.0)) + assert_allclose(X[:, -2], np.sin(2 * np.pi * freq * t) / (dy or 1.0)) + assert_allclose(X[:, -1], np.cos(2 * np.pi * freq * t) / (dy or 1.0)) + + +@pytest.mark.parametrize('nterms', range(4)) +def test_multiterm_design_matrix(t, nterms): + dy = 2.0 + freq = 1.5 + X = design_matrix(t, freq, dy=dy, bias=True, nterms=nterms) + assert X.shape == (t.shape[0], 1 + 2 * nterms) + assert_allclose(X[:, 0], 1. / dy) + for i in range(1, nterms + 1): + assert_allclose(X[:, 2 * i - 1], np.sin(2 * np.pi * i * freq * t) / dy) + assert_allclose(X[:, 2 * i], np.cos(2 * np.pi * i * freq * t) / dy) + + +@pytest.mark.parametrize('nterms', range(1, 4)) +@pytest.mark.parametrize('freq', [1, 2]) +@pytest.mark.parametrize('fit_mean', [True, False]) +def test_exact_mle_fit(nterms, freq, fit_mean): + rand = np.random.RandomState(42) + t = 10 * rand.rand(30) + theta = -1 + rand.rand(2 * nterms + 1) + y = np.zeros(t.shape) + if fit_mean: + y = theta[0] * np.ones(t.shape) + for i in range(1, nterms + 1): + y += theta[2 * i - 1] * np.sin(2 * np.pi * i * freq * t) + y += theta[2 * i] * np.cos(2 * np.pi * i * freq * t) + + y_fit = periodic_fit(t, y, dy=1, frequency=freq, t_fit=t, nterms=nterms, + center_data=False, fit_mean=fit_mean) + assert_allclose(y, y_fit) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_utils.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a0bb22fd6950e860070e9bbb8178f5ff5be32784 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_utils.py @@ -0,0 +1,74 @@ + +import pytest +import numpy as np +from numpy.testing import assert_allclose, assert_equal + +from astropy.timeseries.periodograms.lombscargle.implementations.utils import extirpolate, bitceil, trig_sum + + +@pytest.mark.parametrize('N', 2 ** np.arange(1, 12)) +@pytest.mark.parametrize('offset', [-1, 0, 1]) +def test_bitceil(N, offset): + assert_equal(bitceil(N + offset), + int(2 ** np.ceil(np.log2(N + offset)))) + + +@pytest.fixture +def extirpolate_data(): + rng = np.random.RandomState(0) + x = 100 * rng.rand(50) + y = np.sin(x) + f = lambda x: np.sin(x / 10) + return x, y, f + + +@pytest.mark.parametrize('N', [100, None]) +@pytest.mark.parametrize('M', [5]) +def test_extirpolate(N, M, extirpolate_data): + x, y, f = extirpolate_data + y_hat = extirpolate(x, y, N, M) + x_hat = np.arange(len(y_hat)) + assert_allclose(np.dot(f(x), y), np.dot(f(x_hat), y_hat)) + + +@pytest.fixture +def extirpolate_int_data(): + rng = np.random.RandomState(0) + x = 100 * rng.rand(50) + x[:25] = x[:25].astype(int) + y = np.sin(x) + f = lambda x: np.sin(x / 10) + return x, y, f + + +@pytest.mark.parametrize('N', [100, None]) +@pytest.mark.parametrize('M', [5]) +def test_extirpolate_with_integers(N, M, extirpolate_int_data): + x, y, f = extirpolate_int_data + y_hat = extirpolate(x, y, N, M) + x_hat = np.arange(len(y_hat)) + assert_allclose(np.dot(f(x), y), np.dot(f(x_hat), y_hat)) + + +@pytest.fixture +def trig_sum_data(): + rng = np.random.RandomState(0) + t = 10 * rng.rand(50) + h = np.sin(t) + return t, h + + +@pytest.mark.parametrize('f0', [0, 1]) +@pytest.mark.parametrize('adjust_t', [True, False]) +@pytest.mark.parametrize('freq_factor', [1, 2]) +@pytest.mark.parametrize('df', [0.1]) +def test_trig_sum(f0, adjust_t, freq_factor, df, trig_sum_data): + t, h = trig_sum_data + + tfit = t - t.min() if adjust_t else t + S1, C1 = trig_sum(tfit, h, df, N=1000, use_fft=True, + f0=f0, freq_factor=freq_factor, oversampling=10) + S2, C2 = trig_sum(tfit, h, df, N=1000, use_fft=False, + f0=f0, freq_factor=freq_factor, oversampling=10) + assert_allclose(S1, S2, atol=1E-2) + assert_allclose(C1, C2, atol=1E-2) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/utils.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..fdcaeeb8f0d46823608d72719f498fda1843ee15 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/implementations/utils.py @@ -0,0 +1,155 @@ +from math import factorial +import numpy as np + + +def bitceil(N): + """ + Find the bit (i.e. power of 2) immediately greater than or equal to N + Note: this works for numbers up to 2 ** 64. + Roughly equivalent to int(2 ** np.ceil(np.log2(N))) + """ + return 1 << int(N - 1).bit_length() + + +def extirpolate(x, y, N=None, M=4): + """ + Extirpolate the values (x, y) onto an integer grid range(N), + using lagrange polynomial weights on the M nearest points. + Parameters + ---------- + x : array_like + array of abscissas + y : array_like + array of ordinates + N : int + number of integer bins to use. For best performance, N should be larger + than the maximum of x + M : int + number of adjoining points on which to extirpolate. + + Returns + ------- + yN : ndarray + N extirpolated values associated with range(N) + + Example + ------- + >>> rng = np.random.RandomState(0) + >>> x = 100 * rng.rand(20) + >>> y = np.sin(x) + >>> y_hat = extirpolate(x, y) + >>> x_hat = np.arange(len(y_hat)) + >>> f = lambda x: np.sin(x / 10) + >>> np.allclose(np.sum(y * f(x)), np.sum(y_hat * f(x_hat))) + True + + Notes + ----- + This code is based on the C implementation of spread() presented in + Numerical Recipes in C, Second Edition (Press et al. 1989; p.583). + """ + x, y = map(np.ravel, np.broadcast_arrays(x, y)) + + if N is None: + N = int(np.max(x) + 0.5 * M + 1) + + # Now use legendre polynomial weights to populate the results array; + # This is an efficient recursive implementation (See Press et al. 1989) + result = np.zeros(N, dtype=y.dtype) + + # first take care of the easy cases where x is an integer + integers = (x % 1 == 0) + np.add.at(result, x[integers].astype(int), y[integers]) + x, y = x[~integers], y[~integers] + + # For each remaining x, find the index describing the extirpolation range. + # i.e. ilo[i] < x[i] < ilo[i] + M with x[i] in the center, + # adjusted so that the limits are within the range 0...N + ilo = np.clip((x - M // 2).astype(int), 0, N - M) + numerator = y * np.prod(x - ilo - np.arange(M)[:, np.newaxis], 0) + denominator = factorial(M - 1) + + for j in range(M): + if j > 0: + denominator *= j / (j - M) + ind = ilo + (M - 1 - j) + np.add.at(result, ind, numerator / (denominator * (x - ind))) + return result + + +def trig_sum(t, h, df, N, f0=0, freq_factor=1, + oversampling=5, use_fft=True, Mfft=4): + """Compute (approximate) trigonometric sums for a number of frequencies + This routine computes weighted sine and cosine sums: + S_j = sum_i { h_i * sin(2 pi * f_j * t_i) } + C_j = sum_i { h_i * cos(2 pi * f_j * t_i) } + Where f_j = freq_factor * (f0 + j * df) for the values j in 1 ... N. + The sums can be computed either by a brute force O[N^2] method, or + by an FFT-based O[Nlog(N)] method. + + Parameters + ---------- + t : array_like + array of input times + h : array_like + array weights for the sum + df : float + frequency spacing + N : int + number of frequency bins to return + f0 : float (optional, default=0) + The low frequency to use + freq_factor : float (optional, default=1) + Factor which multiplies the frequency + use_fft : bool + if True, use the approximate FFT algorithm to compute the result. + This uses the FFT with Press & Rybicki's Lagrangian extirpolation. + oversampling : int (default = 5) + oversampling freq_factor for the approximation; roughly the number of + time samples across the highest-frequency sinusoid. This parameter + contains the trade-off between accuracy and speed. Not referenced + if use_fft is False. + Mfft : int + The number of adjacent points to use in the FFT approximation. + Not referenced if use_fft is False. + + Returns + ------- + S, C : ndarrays + summation arrays for frequencies f = df * np.arange(1, N + 1) + """ + df *= freq_factor + f0 *= freq_factor + + if df <= 0: + raise ValueError("df must be positive") + t, h = map(np.ravel, np.broadcast_arrays(t, h)) + + if use_fft: + Mfft = int(Mfft) + if Mfft <= 0: + raise ValueError("Mfft must be positive") + + # required size of fft is the power of 2 above the oversampling rate + Nfft = bitceil(N * oversampling) + t0 = t.min() + + if f0 > 0: + h = h * np.exp(2j * np.pi * f0 * (t - t0)) + + tnorm = ((t - t0) * Nfft * df) % Nfft + grid = extirpolate(tnorm, h, Nfft, Mfft) + + fftgrid = np.fft.ifft(grid)[:N] + if t0 != 0: + f = f0 + df * np.arange(N) + fftgrid *= np.exp(2j * np.pi * t0 * f) + + C = Nfft * fftgrid.real + S = Nfft * fftgrid.imag + else: + f = f0 + df * np.arange(N) + C = np.dot(h, np.cos(2 * np.pi * f * t[:, np.newaxis])) + S = np.dot(h, np.sin(2 * np.pi * f * t[:, np.newaxis])) + + return S, C diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/__init__.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_lombscargle.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_lombscargle.py new file mode 100644 index 0000000000000000000000000000000000000000..5c818ef78c84a760ac6a6860421e4560ec0a749e --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_lombscargle.py @@ -0,0 +1,508 @@ +import pytest +import numpy as np +from numpy.testing import assert_allclose + +from astropy.time import Time, TimeDelta +from astropy import units as u +from astropy.tests.helper import assert_quantity_allclose +from astropy.timeseries.periodograms.lombscargle import LombScargle + + +ALL_METHODS = LombScargle.available_methods +ALL_METHODS_NO_AUTO = [method for method in ALL_METHODS if method != 'auto'] +FAST_METHODS = [method for method in ALL_METHODS if 'fast' in method] +NTERMS_METHODS = [method for method in ALL_METHODS if 'chi2' in method] +NORMALIZATIONS = ['standard', 'psd', 'log', 'model'] + + +@pytest.fixture +def data(N=100, period=1, theta=[10, 2, 3], dy=1, rseed=0): + """Generate some data for testing""" + rng = np.random.RandomState(rseed) + t = 20 * period * rng.rand(N) + omega = 2 * np.pi / period + y = theta[0] + theta[1] * np.sin(omega * t) + theta[2] * np.cos(omega * t) + dy = dy * (0.5 + rng.rand(N)) + y += dy * rng.randn(N) + + return t, y, dy + + +@pytest.mark.parametrize('minimum_frequency', [None, 1.0]) +@pytest.mark.parametrize('maximum_frequency', [None, 5.0]) +@pytest.mark.parametrize('nyquist_factor', [1, 10]) +@pytest.mark.parametrize('samples_per_peak', [1, 5]) +def test_autofrequency(data, minimum_frequency, maximum_frequency, + nyquist_factor, samples_per_peak): + t, y, dy = data + baseline = t.max() - t.min() + + freq = LombScargle(t, y, dy).autofrequency(samples_per_peak, + nyquist_factor, + minimum_frequency, + maximum_frequency) + df = freq[1] - freq[0] + + # Check sample spacing + assert_allclose(df, 1. / baseline / samples_per_peak) + + # Check minimum frequency + if minimum_frequency is None: + assert_allclose(freq[0], 0.5 * df) + else: + assert_allclose(freq[0], minimum_frequency) + + if maximum_frequency is None: + avg_nyquist = 0.5 * len(t) / baseline + assert_allclose(freq[-1], avg_nyquist * nyquist_factor, atol=0.5*df) + else: + assert_allclose(freq[-1], maximum_frequency, atol=0.5*df) + + +@pytest.mark.parametrize('method', ALL_METHODS_NO_AUTO) +@pytest.mark.parametrize('center_data', [True, False]) +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('errors', ['none', 'partial', 'full']) +@pytest.mark.parametrize('with_units', [True, False]) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +def test_all_methods(data, method, center_data, fit_mean, + errors, with_units, normalization): + if method == 'scipy' and (fit_mean or errors != 'none'): + return + + t, y, dy = data + frequency = 0.8 + 0.01 * np.arange(40) + if with_units: + t = t * u.day + y = y * u.mag + dy = dy * u.mag + frequency = frequency / t.unit + + if errors == 'none': + dy = None + elif errors == 'partial': + dy = dy[0] + elif errors == 'full': + pass + else: + raise ValueError("Unrecognized error type: '{0}'".format(errors)) + + kwds = {} + + ls = LombScargle(t, y, dy, center_data=center_data, fit_mean=fit_mean, + normalization=normalization) + P_expected = ls.power(frequency) + + # don't use the fft approximation here; we'll test this elsewhere + if method in FAST_METHODS: + kwds['method_kwds'] = dict(use_fft=False) + P_method = ls.power(frequency, method=method, **kwds) + + if with_units: + if normalization == 'psd' and errors == 'none': + assert P_method.unit == y.unit ** 2 + else: + assert P_method.unit == u.dimensionless_unscaled + else: + assert not hasattr(P_method, 'unit') + + assert_quantity_allclose(P_expected, P_method) + + +@pytest.mark.parametrize('method', ALL_METHODS_NO_AUTO) +@pytest.mark.parametrize('center_data', [True, False]) +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('with_errors', [True, False]) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +def test_integer_inputs(data, method, center_data, fit_mean, with_errors, + normalization): + if method == 'scipy' and (fit_mean or with_errors): + return + + t, y, dy = data + + t = np.floor(100 * t) + t_int = t.astype(int) + + y = np.floor(100 * y) + y_int = y.astype(int) + + dy = np.floor(100 * dy) + dy_int = dy.astype('int32') + + frequency = 1E-2 * (0.8 + 0.01 * np.arange(40)) + + if not with_errors: + dy = None + dy_int = None + + kwds = dict(center_data=center_data, + fit_mean=fit_mean, + normalization=normalization) + P_float = LombScargle(t, y, dy, **kwds).power(frequency,method=method) + P_int = LombScargle(t_int, y_int, dy_int, + **kwds).power(frequency, method=method) + assert_allclose(P_float, P_int) + + +@pytest.mark.parametrize('method', NTERMS_METHODS) +@pytest.mark.parametrize('center_data', [True, False]) +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('errors', ['none', 'partial', 'full']) +@pytest.mark.parametrize('nterms', [0, 2, 4]) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +def test_nterms_methods(method, center_data, fit_mean, errors, + nterms, normalization, data): + t, y, dy = data + frequency = 0.8 + 0.01 * np.arange(40) + + if errors == 'none': + dy = None + elif errors == 'partial': + dy = dy[0] + elif errors == 'full': + pass + else: + raise ValueError("Unrecognized error type: '{0}'".format(errors)) + + ls = LombScargle(t, y, dy, center_data=center_data, + fit_mean=fit_mean, nterms=nterms, + normalization=normalization) + + if nterms == 0 and not fit_mean: + with pytest.raises(ValueError) as err: + ls.power(frequency, method=method) + assert 'nterms' in str(err.value) and 'bias' in str(err.value) + else: + P_expected = ls.power(frequency) + + # don't use fast fft approximations here + kwds = {} + if 'fast' in method: + kwds['method_kwds'] = dict(use_fft=False) + P_method = ls.power(frequency, method=method, **kwds) + + assert_allclose(P_expected, P_method, rtol=1E-7, atol=1E-25) + + +@pytest.mark.parametrize('method', FAST_METHODS) +@pytest.mark.parametrize('center_data', [True, False]) +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('errors', ['none', 'partial', 'full']) +@pytest.mark.parametrize('nterms', [0, 1, 2]) +def test_fast_approximations(method, center_data, fit_mean, + errors, nterms, data): + t, y, dy = data + frequency = 0.8 + 0.01 * np.arange(40) + + if errors == 'none': + dy = None + elif errors == 'partial': + dy = dy[0] + elif errors == 'full': + pass + else: + raise ValueError("Unrecognized error type: '{0}'".format(errors)) + + ls = LombScargle(t, y, dy, center_data=center_data, + fit_mean=fit_mean, nterms=nterms, + normalization='standard') + + # use only standard normalization because we compare via absolute tolerance + kwds = dict(method=method) + + if method == 'fast' and nterms != 1: + with pytest.raises(ValueError) as err: + ls.power(frequency, **kwds) + assert 'nterms' in str(err.value) + + elif nterms == 0 and not fit_mean: + with pytest.raises(ValueError) as err: + ls.power(frequency, **kwds) + assert 'nterms' in str(err.value) and 'bias' in str(err.value) + + else: + P_fast = ls.power(frequency, **kwds) + kwds['method_kwds'] = dict(use_fft=False) + P_slow = ls.power(frequency, **kwds) + + assert_allclose(P_fast, P_slow, atol=0.008) + + +@pytest.mark.parametrize('method', LombScargle.available_methods) +@pytest.mark.parametrize('shape', [(), (1,), (2,), (3,), (2, 3)]) +def test_output_shapes(method, shape, data): + t, y, dy = data + freq = np.asarray(np.zeros(shape)) + freq.flat = np.arange(1, freq.size + 1) + PLS = LombScargle(t, y, fit_mean=False).power(freq, method=method) + assert PLS.shape == shape + + +@pytest.mark.parametrize('method', LombScargle.available_methods) +def test_errors_on_unit_mismatch(method, data): + t, y, dy = data + + t = t * u.second + y = y * u.mag + frequency = np.linspace(0.5, 1.5, 10) + + # this should fail because frequency and 1/t units do not match + with pytest.raises(ValueError) as err: + LombScargle(t, y, fit_mean=False).power(frequency, method=method) + assert str(err.value).startswith('Units of frequency not equivalent') + + # this should fail because dy and y units do not match + with pytest.raises(ValueError) as err: + LombScargle(t, y, dy, fit_mean=False).power(frequency / t.unit) + assert str(err.value).startswith('Units of dy not equivalent') + + +# we don't test all normalizations here because they are tested above +# only test method='auto' because unit handling does not depend on method +@pytest.mark.parametrize('with_error', [True, False]) +def test_unit_conversions(data, with_error): + t, y, dy = data + + t_day = t * u.day + t_hour = u.Quantity(t_day, 'hour') + + y_meter = y * u.meter + y_millimeter = u.Quantity(y_meter, 'millimeter') + + # sanity check on inputs + assert_quantity_allclose(t_day, t_hour) + assert_quantity_allclose(y_meter, y_millimeter) + + if with_error: + dy = dy * u.meter + else: + dy = None + + freq_day, P1 = LombScargle(t_day, y_meter, dy).autopower() + freq_hour, P2 = LombScargle(t_hour, y_millimeter, dy).autopower() + + # Check units of frequency + assert freq_day.unit == 1. / u.day + assert freq_hour.unit == 1. / u.hour + + # Check that results match + assert_quantity_allclose(freq_day, freq_hour) + assert_quantity_allclose(P1, P2) + + # Check that switching frequency units doesn't change things + P3 = LombScargle(t_day, y_meter, dy).power(freq_hour) + P4 = LombScargle(t_hour, y_meter, dy).power(freq_day) + assert_quantity_allclose(P3, P4) + + +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('with_units', [True, False]) +@pytest.mark.parametrize('freq', [1.0, 2.0]) +def test_model(fit_mean, with_units, freq): + rand = np.random.RandomState(0) + t = 10 * rand.rand(40) + params = 10 * rand.rand(3) + + y = np.zeros_like(t) + if fit_mean: + y += params[0] + y += params[1] * np.sin(2 * np.pi * freq * (t - params[2])) + + if with_units: + t = t * u.day + y = y * u.mag + freq = freq / u.day + + ls = LombScargle(t, y, center_data=False, fit_mean=fit_mean) + y_fit = ls.model(t, freq) + assert_quantity_allclose(y_fit, y) + + +@pytest.mark.parametrize('t_unit', [u.second, u.day]) +@pytest.mark.parametrize('frequency_unit', [u.Hz, 1. / u.second]) +@pytest.mark.parametrize('y_unit', [u.mag, u.jansky]) +def test_model_units_match(data, t_unit, frequency_unit, y_unit): + t, y, dy = data + t_fit = t[:5] + frequency = 1.0 + + t = t * t_unit + t_fit = t_fit * t_unit + y = y * y_unit + dy = dy * y_unit + frequency = frequency * frequency_unit + + ls = LombScargle(t, y, dy) + y_fit = ls.model(t_fit, frequency) + assert y_fit.unit == y_unit + + +def test_model_units_mismatch(data): + t, y, dy = data + frequency = 1.0 + t_fit = t[:5] + + t = t * u.second + t_fit = t_fit * u.second + y = y * u.mag + frequency = 1.0 / t.unit + + # this should fail because frequency and 1/t units do not match + with pytest.raises(ValueError) as err: + LombScargle(t, y).model(t_fit, frequency=1.0) + assert str(err.value).startswith('Units of frequency not equivalent') + + # this should fail because t and t_fit units do not match + with pytest.raises(ValueError) as err: + LombScargle(t, y).model([1, 2], frequency) + assert str(err.value).startswith('Units of t not equivalent') + + # this should fail because dy and y units do not match + with pytest.raises(ValueError) as err: + LombScargle(t, y, dy).model(t_fit, frequency) + assert str(err.value).startswith('Units of dy not equivalent') + + +def test_autopower(data): + t, y, dy = data + ls = LombScargle(t, y, dy) + kwargs = dict(samples_per_peak=6, nyquist_factor=2, + minimum_frequency=2, maximum_frequency=None) + freq1 = ls.autofrequency(**kwargs) + power1 = ls.power(freq1) + freq2, power2 = ls.autopower(**kwargs) + + assert_allclose(freq1, freq2) + assert_allclose(power1, power2) + + +@pytest.mark.parametrize('with_units', [True, False]) +@pytest.mark.parametrize('errors', ['none', 'partial', 'full']) +@pytest.mark.parametrize('center_data', [True, False]) +@pytest.mark.parametrize('fit_mean', [True, False]) +@pytest.mark.parametrize('nterms', [0, 1, 2]) +def test_model_parameters(data, nterms, fit_mean, center_data, + errors, with_units): + if nterms == 0 and not fit_mean: + return + + t, y, dy = data + frequency = 1.5 + if with_units: + t = t * u.day + y = y * u.mag + dy = dy * u.mag + frequency = frequency / t.unit + + if errors == 'none': + dy = None + elif errors == 'partial': + dy = dy[0] + elif errors == 'full': + pass + else: + raise ValueError("Unrecognized error type: '{0}'".format(errors)) + + ls = LombScargle(t, y, dy, + nterms=nterms, + fit_mean=fit_mean, + center_data=center_data) + tfit = np.linspace(0, 20, 10) + if with_units: + tfit = tfit * u.day + + model = ls.model(tfit, frequency) + params = ls.model_parameters(frequency) + design = ls.design_matrix(frequency, t=tfit) + offset = ls.offset() + + assert len(params) == int(fit_mean) + 2 * nterms + + assert_quantity_allclose(offset + design.dot(params), model) + + +@pytest.mark.parametrize('timedelta', [False, True]) +def test_absolute_times(data, timedelta): + + # Make sure that we handle absolute times correctly. We also check that + # TimeDelta works properly when timedelta is True. + + # The example data uses relative times + t, y, dy = data + + # FIXME: There seems to be a numerical stability issue in that if we run + # the algorithm with the same values but offset in time, the transit_time + # is not offset by a fixed amount. To avoid this issue in this test, we + # make sure the first time is also the smallest so that internally the + # values of the relative time should be the same. + t[0] = 0. + + # Add units + t = t * u.day + y = y * u.mag + dy = dy * u.mag + + # We now construct a set of absolute times but keeping the rest the same + start = Time('2019-05-04T12:34:56') + trel = TimeDelta(t) if timedelta else t + t = trel + start + + # and we set up two instances of LombScargle, one with absolute and one + # with relative times. + ls1 = LombScargle(t, y, dy) + ls2 = LombScargle(trel, y, dy) + + kwargs = dict(samples_per_peak=6, nyquist_factor=2, + minimum_frequency=2 / u.day, maximum_frequency=None) + + freq1 = ls1.autofrequency(**kwargs) + freq2 = ls2.autofrequency(**kwargs) + assert_quantity_allclose(freq1, freq2) + + power1 = ls1.power(freq1) + power2 = ls2.power(freq2) + assert_quantity_allclose(power1, power2) + + freq1, power1 = ls1.autopower(**kwargs) + freq2, power2 = ls2.autopower(**kwargs) + assert_quantity_allclose(freq1, freq2) + assert_quantity_allclose(power1, power2) + + model1 = ls1.model(t, 2 / u.day) + model2 = ls2.model(trel, 2 / u.day) + assert_quantity_allclose(model1, model2) + + # Check model validation + + with pytest.raises(TypeError) as exc: + ls1.model(trel, 2 / u.day) + assert exc.value.args[0] == ('t was provided as a relative time but the ' + 'LombScargle class was initialized with ' + 'absolute times.') + + with pytest.raises(TypeError) as exc: + ls2.model(t, 2 / u.day) + assert exc.value.args[0] == ('t was provided as an absolute time but the ' + 'LombScargle class was initialized with ' + 'relative times.') + + # Check design matrix + + design1 = ls1.design_matrix(2 / u.day, t=t) + design2 = ls2.design_matrix(2 / u.day, t=trel) + assert_quantity_allclose(design1, design2) + + # Check design matrix validation + + with pytest.raises(TypeError) as exc: + ls1.design_matrix(2 / u.day, t=trel) + assert exc.value.args[0] == ('t was provided as a relative time but the ' + 'LombScargle class was initialized with ' + 'absolute times.') + + with pytest.raises(TypeError) as exc: + ls2.design_matrix(2 / u.day, t=t) + assert exc.value.args[0] == ('t was provided as an absolute time but the ' + 'LombScargle class was initialized with ' + 'relative times.') diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_statistics.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_statistics.py new file mode 100644 index 0000000000000000000000000000000000000000..4eede4f3ab1f187035e3f9c77e4203794d4269ff --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_statistics.py @@ -0,0 +1,185 @@ +import numpy as np +import pytest +from numpy.testing import assert_allclose + +try: + import scipy +except ImportError: + HAS_SCIPY = False +else: + HAS_SCIPY = True + +from astropy.timeseries.periodograms.lombscargle import LombScargle +from astropy.timeseries.periodograms.lombscargle._statistics import (cdf_single, pdf_single, fap_single, inv_fap_single, + METHODS) +from astropy.timeseries.periodograms.lombscargle.utils import convert_normalization, compute_chi2_ref + +METHOD_KWDS = dict(bootstrap={'n_bootstraps': 20, 'random_seed': 42}) +NORMALIZATIONS = ['standard', 'psd', 'log', 'model'] + + +def make_data(N=100, period=1, theta=[10, 2, 3], dy=1, rseed=0): + """Generate some data for testing""" + rng = np.random.RandomState(rseed) + t = 5 * period * rng.rand(N) + omega = 2 * np.pi / period + y = theta[0] + theta[1] * np.sin(omega * t) + theta[2] * np.cos(omega * t) + dy = dy * (0.5 + rng.rand(N)) + y += dy * rng.randn(N) + + return t, y, dy + + +@pytest.fixture +def null_data(N=1000, dy=1, rseed=0): + """Generate null hypothesis data""" + rng = np.random.RandomState(rseed) + t = 100 * rng.rand(N) + dy = 0.5 * dy * (1 + rng.rand(N)) + y = dy * rng.randn(N) + return t, y, dy + + +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +@pytest.mark.parametrize('with_errors', [True, False]) +def test_distribution(null_data, normalization, with_errors, fmax=40): + t, y, dy = null_data + if not with_errors: + dy = None + + N = len(t) + ls = LombScargle(t, y, dy, normalization=normalization) + freq, power = ls.autopower(maximum_frequency=fmax) + z = np.linspace(0, power.max(), 1000) + + # Test that pdf and cdf are consistent + dz = z[1] - z[0] + z_mid = z[:-1] + 0.5 * dz + pdf = ls.distribution(z_mid) + cdf = ls.distribution(z, cumulative=True) + assert_allclose(pdf, np.diff(cdf) / dz, rtol=1E-5, atol=1E-8) + + # psd normalization without specified errors produces bad results + if not (normalization == 'psd' and not with_errors): + # Test that observed power is distributed according to the theoretical pdf + hist, bins = np.histogram(power, 30, normed=True) + midpoints = 0.5 * (bins[1:] + bins[:-1]) + pdf = ls.distribution(midpoints) + assert_allclose(hist, pdf, rtol=0.05, atol=0.05 * pdf[0]) + + +@pytest.mark.parametrize('N', [10, 100, 1000]) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +def test_inverse_single(N, normalization): + fap = np.linspace(0, 1, 100) + + z = inv_fap_single(fap, N, normalization) + fap_out = fap_single(z, N, normalization) + assert_allclose(fap, fap_out) + + +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +@pytest.mark.parametrize('use_errs', [True, False]) +def test_inverse_bootstrap(null_data, normalization, use_errs, fmax=5): + t, y, dy = null_data + if not use_errs: + dy = None + + fap = np.linspace(0, 1, 10) + method = 'bootstrap' + method_kwds = METHOD_KWDS['bootstrap'] + + ls = LombScargle(t, y, dy, normalization=normalization) + + z = ls.false_alarm_level(fap, maximum_frequency=fmax, + method=method, method_kwds=method_kwds) + fap_out = ls.false_alarm_probability(z, maximum_frequency=fmax, + method=method, + method_kwds=method_kwds) + + # atol = 1 / n_bootstraps + assert_allclose(fap, fap_out, atol=0.05) + + +@pytest.mark.parametrize('method', sorted(set(METHODS) - {'bootstrap'})) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +@pytest.mark.parametrize('use_errs', [True, False]) +@pytest.mark.parametrize('N', [10, 100, 1000]) +def test_inverses(method, normalization, use_errs, N, T=5, fmax=5): + if not HAS_SCIPY and method in ['baluev', 'davies']: + pytest.skip("SciPy required") + + t, y, dy = make_data(N, rseed=543) + if not use_errs: + dy = None + method_kwds = METHOD_KWDS.get(method, None) + + fap = np.logspace(-10, 0, 10) + + ls = LombScargle(t, y, dy, normalization=normalization) + z = ls.false_alarm_level(fap, maximum_frequency=fmax, + method=method, + method_kwds=method_kwds) + fap_out = ls.false_alarm_probability(z, maximum_frequency=fmax, + method=method, + method_kwds=method_kwds) + assert_allclose(fap, fap_out) + + +@pytest.mark.parametrize('method', sorted(METHODS)) +@pytest.mark.parametrize('normalization', NORMALIZATIONS) +def test_false_alarm_smoketest(method, normalization): + if not HAS_SCIPY and method in ['baluev', 'davies']: + pytest.skip("SciPy required") + + kwds = METHOD_KWDS.get(method, None) + t, y, dy = make_data() + fmax = 5 + + ls = LombScargle(t, y, dy, normalization=normalization) + freq, power = ls.autopower(maximum_frequency=fmax) + Z = np.linspace(power.min(), power.max(), 30) + + fap = ls.false_alarm_probability(Z, maximum_frequency=fmax, + method=method, method_kwds=kwds) + + assert len(fap) == len(Z) + if method != 'davies': + assert np.all(fap <= 1) + assert np.all(fap[:-1] >= fap[1:]) # monotonically decreasing + + +@pytest.mark.parametrize('method', sorted(METHODS)) +@pytest.mark.parametrize('use_errs', [True, False]) +@pytest.mark.parametrize('normalization', sorted(set(NORMALIZATIONS) - {'psd'})) +def test_false_alarm_equivalence(method, normalization, use_errs): + # Note: the PSD normalization is not equivalent to the others, in that it + # depends on the absolute errors rather than relative errors. Because the + # scaling contributes to the distribution, it cannot be converted directly + # from any of the three normalized versions. + if not HAS_SCIPY and method in ['baluev', 'davies']: + pytest.skip("SciPy required") + + kwds = METHOD_KWDS.get(method, None) + t, y, dy = make_data() + if not use_errs: + dy = None + fmax = 5 + + ls = LombScargle(t, y, dy, normalization=normalization) + freq, power = ls.autopower(maximum_frequency=fmax) + Z = np.linspace(power.min(), power.max(), 30) + fap = ls.false_alarm_probability(Z, maximum_frequency=fmax, + method=method, method_kwds=kwds) + + # Compute the equivalent Z values in the standard normalization + # and check that the FAP is consistent + Z_std = convert_normalization(Z, len(t), + from_normalization=normalization, + to_normalization='standard', + chi2_ref=compute_chi2_ref(y, dy)) + ls = LombScargle(t, y, dy, normalization='standard') + fap_std = ls.false_alarm_probability(Z_std, maximum_frequency=fmax, + method=method, method_kwds=kwds) + + assert_allclose(fap, fap_std, rtol=0.1) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_utils.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..b015344ee842bd8e3fd665d11d777916809a658c --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/tests/test_utils.py @@ -0,0 +1,38 @@ +import numpy as np +import pytest +from numpy.testing import assert_allclose + +from astropy.timeseries.periodograms.lombscargle.utils import convert_normalization, compute_chi2_ref +from astropy.timeseries.periodograms.lombscargle.core import LombScargle + + +NORMALIZATIONS = ['standard', 'model', 'log', 'psd'] + + +@pytest.fixture +def data(N=100, period=1, theta=[10, 2, 3], dy=1, rseed=0): + """Generate some data for testing""" + rng = np.random.RandomState(rseed) + t = 5 * period * rng.rand(N) + omega = 2 * np.pi / period + y = theta[0] + theta[1] * np.sin(omega * t) + theta[2] * np.cos(omega * t) + dy = dy * (0.5 + rng.rand(N)) + y += dy * rng.randn(N) + + return t, y, dy + + +@pytest.mark.parametrize('norm_in', NORMALIZATIONS) +@pytest.mark.parametrize('norm_out', NORMALIZATIONS) +def test_convert_normalization(norm_in, norm_out, data): + t, y, dy = data + + _, power_in = LombScargle(t, y, dy).autopower(maximum_frequency=5, + normalization=norm_in) + _, power_out = LombScargle(t, y, dy).autopower(maximum_frequency=5, + normalization=norm_out) + power_in_converted = convert_normalization(power_in, N=len(t), + from_normalization=norm_in, + to_normalization=norm_out, + chi2_ref = compute_chi2_ref(y, dy)) + assert_allclose(power_in_converted, power_out) diff --git a/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/utils.py b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..7c9762632e4cfbd37495ae78f35b1936ecff95ea --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/periodograms/lombscargle/utils.py @@ -0,0 +1,103 @@ +import numpy as np + + +NORMALIZATIONS = ['standard', 'psd', 'model', 'log'] + + +def compute_chi2_ref(y, dy=None, center_data=True, fit_mean=True): + """Compute the reference chi-square for a particular dataset. + + Note: this is not valid center_data=False and fit_mean=False. + + Parameters + ---------- + y : array_like + data values + dy : float, array, or None (optional) + data uncertainties + center_data : boolean + specify whether data should be pre-centered + fit_mean : boolean + specify whether model should fit the mean of the data + + Returns + ------- + chi2_ref : float + The reference chi-square for the periodogram of this data + """ + if dy is None: + dy = 1 + y, dy = np.broadcast_arrays(y, dy) + w = dy ** -2.0 + if center_data or fit_mean: + mu = np.dot(w, y) / w.sum() + else: + mu = 0 + yw = (y - mu) / dy + return np.dot(yw, yw) + + +def convert_normalization(Z, N, from_normalization, to_normalization, + chi2_ref=None): + """Convert power from one normalization to another. + + This currently only works for standard & floating-mean models. + + Parameters + ---------- + Z : array_like + the periodogram output + N : integer + the number of data points + from_normalization, to_normalization : strings + the normalization to convert from and to. Options are + ['standard', 'model', 'log', 'psd'] + chi2_ref : float + The reference chi-square, required for converting to or from the + psd normalization. + + Returns + ------- + Z_out : ndarray + The periodogram in the new normalization + """ + Z = np.asarray(Z) + from_to = (from_normalization, to_normalization) + + for norm in from_to: + if norm not in NORMALIZATIONS: + raise ValueError("{0} is not a valid normalization" + "".format(from_normalization)) + + if from_normalization == to_normalization: + return Z + + if "psd" in from_to and chi2_ref is None: + raise ValueError("must supply reference chi^2 when converting " + "to or from psd normalization") + + if from_to == ('log', 'standard'): + return 1 - np.exp(-Z) + elif from_to == ('standard', 'log'): + return -np.log(1 - Z) + elif from_to == ('log', 'model'): + return np.exp(Z) - 1 + elif from_to == ('model', 'log'): + return np.log(Z + 1) + elif from_to == ('model', 'standard'): + return Z / (1 + Z) + elif from_to == ('standard', 'model'): + return Z / (1 - Z) + elif from_normalization == "psd": + return convert_normalization(2 / chi2_ref * Z, N, + from_normalization='standard', + to_normalization=to_normalization) + elif to_normalization == "psd": + Z_standard = convert_normalization(Z, N, + from_normalization=from_normalization, + to_normalization='standard') + return 0.5 * chi2_ref * Z_standard + else: + raise NotImplementedError("conversion from '{0}' to '{1}'" + "".format(from_normalization, + to_normalization)) diff --git a/testbed/astropy__astropy/astropy/timeseries/sampled.py b/testbed/astropy__astropy/astropy/timeseries/sampled.py new file mode 100644 index 0000000000000000000000000000000000000000..5e6394f0a205c32f7e37ba808c9cfdddfd48065d --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/sampled.py @@ -0,0 +1,303 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from copy import deepcopy + +import numpy as np + +from astropy.table import groups, QTable, Table +from astropy.time import Time, TimeDelta +from astropy import units as u +from astropy.units import Quantity + +from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns + +__all__ = ['TimeSeries'] + + +@autocheck_required_columns +class TimeSeries(BaseTimeSeries): + """ + A class to represent time series data in tabular form. + + `~astropy.timeseries.TimeSeries` provides a class for representing time + series as a collection of values of different quantities measured at specific + points in time (for time series with finite time bins, see the + `~astropy.timeseries.BinnedTimeSeries` class). + `~astropy.timeseries.TimeSeries` is a sub-class of `~astropy.table.QTable` + and thus provides all the standard table maniplation methods available to + tables, but it also provides additional conveniences for dealing with time + series, such as a flexible initializer for setting up the times, a method + for folding time series, and a ``time`` attribute for easy access to the + time values. + + See also: http://docs.astropy.org/en/stable/timeseries/ + + Parameters + ---------- + data : numpy ndarray, dict, list, `~astropy.table.Table`, or table-like object, optional + Data to initialize time series. This does not need to contain the times, + which can be provided separately, but if it does contain the times they + should be in a column called ``'time'`` to be automatically recognized. + time : `~astropy.time.Time` or iterable + The times at which the values are sampled - this can be either given + directly as a `~astropy.time.Time` array or as any iterable that + initializes the `~astropy.time.Time` class. If this is given, then + the remaining time-related arguments should not be used. + time_start : `~astropy.time.Time` or str + The time of the first sample in the time series. This is an alternative + to providing ``time`` and requires that ``time_delta`` is also provided. + time_delta : `~astropy.time.TimeDelta` or `~astropy.units.Quantity` + The step size in time for the series. This can either be a scalar if + the time series is evenly sampled, or an array of values if it is not. + n_samples : int + The number of time samples for the series. This is only used if both + ``time_start`` and ``time_delta`` are provided and are scalar values. + **kwargs : dict, optional + Additional keyword arguments are passed to `~astropy.table.QTable`. + """ + + _required_columns = ['time'] + + def __init__(self, data=None, *, time=None, time_start=None, + time_delta=None, n_samples=None, **kwargs): + + super().__init__(data=data, **kwargs) + + # For some operations, an empty time series needs to be created, then + # columns added one by one. We should check that when columns are added + # manually, time is added first and is of the right type. + if data is None and time is None and time_start is None and time_delta is None: + self._required_columns_relax = True + return + + # First if time has been given in the table data, we should extract it + # and treat it as if it had been passed as a keyword argument. + + if data is not None: + if n_samples is not None: + if n_samples != len(self): + raise TypeError("'n_samples' has been given both and it is not the " + "same length as the input data.") + else: + n_samples = len(self) + + if 'time' in self.colnames: + if time is None: + time = self.columns['time'] + else: + raise TypeError("'time' has been given both in the table and as a keyword argument") + + if time is None and time_start is None: + raise TypeError("Either 'time' or 'time_start' should be specified") + elif time is not None and time_start is not None: + raise TypeError("Cannot specify both 'time' and 'time_start'") + + if time is not None and not isinstance(time, Time): + time = Time(time) + + if time_start is not None and not isinstance(time_start, Time): + time_start = Time(time_start) + + if time_delta is not None and not isinstance(time_delta, (Quantity, TimeDelta)): + raise TypeError("'time_delta' should be a Quantity or a TimeDelta") + + if isinstance(time_delta, TimeDelta): + time_delta = time_delta.sec * u.s + + if time_start is not None: + + # We interpret this as meaning that time is that of the first + # sample and that the interval is given by time_delta. + + if time_delta is None: + raise TypeError("'time' is scalar, so 'time_delta' is required") + + if time_delta.isscalar: + time_delta = np.repeat(time_delta, n_samples) + + time_delta = np.cumsum(time_delta) + time_delta = np.roll(time_delta, 1) + time_delta[0] = 0. * u.s + + time = time_start + time_delta + + elif len(self.colnames) > 0 and len(time) != len(self): + raise ValueError("Length of 'time' ({0}) should match " + "data length ({1})".format(len(time), n_samples)) + + elif time_delta is not None: + raise TypeError("'time_delta' should not be specified since " + "'time' is an array") + + with self._delay_required_column_checks(): + if 'time' in self.colnames: + self.remove_column('time') + self.add_column(time, index=0, name='time') + + @property + def time(self): + """ + The time values. + """ + return self['time'] + + def fold(self, period=None, midpoint_epoch=None): + """ + Return a new `~astropy.timeseries.TimeSeries` folded with a period and + midpoint epoch. + + Parameters + ---------- + period : `~astropy.units.Quantity` + The period to use for folding + midpoint_epoch : `~astropy.time.Time` + The time to use as the midpoint epoch, at which the relative + time offset will be 0. Defaults to the first time in the time + series. + """ + + folded = self.copy() + + if midpoint_epoch is None: + midpoint_epoch = self.time[0] + else: + midpoint_epoch = Time(midpoint_epoch) + + period_sec = period.to_value(u.s) + relative_time_sec = ((self.time - midpoint_epoch).sec + period_sec / 2) % period_sec - period_sec / 2 + + folded_time = TimeDelta(relative_time_sec * u.s) + + with folded._delay_required_column_checks(): + folded.remove_column('time') + folded.add_column(folded_time, name='time', index=0) + + return folded + + def __getitem__(self, item): + if self._is_list_or_tuple_of_str(item): + if 'time' not in item: + out = QTable([self[x] for x in item], + meta=deepcopy(self.meta), + copy_indices=self._copy_indices) + out._groups = groups.TableGroups(out, indices=self.groups._indices, + keys=self.groups._keys) + return out + return super().__getitem__(item) + + def add_columns(self, *args, **kwargs): + """ + See :meth:`~astropy.table.Table.add_columns`. + """ + # Note that the docstring is inherited from QTable + result = super().add_columns(*args, **kwargs) + if len(self.indices) == 0 and 'time' in self.colnames: + self.add_index('time') + return result + + @classmethod + def from_pandas(self, df, time_scale='utc'): + """ + Convert a :class:`~pandas.DataFrame` to a + :class:`astropy.timeseries.TimeSeries`. + + Parameters + ---------- + df : :class:`pandas.DataFrame` + A pandas :class:`pandas.DataFrame` instance. + time_scale : str + The time scale to pass into `astropy.time.Time`. + Defaults to ``UTC``. + + """ + from pandas import DataFrame, DatetimeIndex + + if not isinstance(df, DataFrame): + raise TypeError("Input should be a pandas DataFrame") + + if not isinstance(df.index, DatetimeIndex): + raise TypeError("DataFrame does not have a DatetimeIndex") + + time = Time(df.index, scale=time_scale) + table = Table.from_pandas(df) + + return TimeSeries(time=time, data=table) + + def to_pandas(self): + """ + Convert this :class:`~astropy.timeseries.TimeSeries` to a + :class:`~pandas.DataFrame` with a :class:`~pandas.DatetimeIndex` index. + + Returns + ------- + dataframe : :class:`pandas.DataFrame` + A pandas :class:`pandas.DataFrame` instance + """ + return Table(self).to_pandas(index='time') + + @classmethod + def read(self, filename, time_column=None, time_format=None, time_scale=None, format=None, *args, **kwargs): + """ + Read and parse a file and returns a `astropy.timeseries.TimeSeries`. + + This method uses the unified I/O infrastructure in Astropy which makes + it easy to define readers/writers for various classes + (http://docs.astropy.org/en/stable/io/unified.html). By default, this + method will try and use readers defined specifically for the + `astropy.timeseries.TimeSeries` class - however, it is also + possible to use the ``format`` keyword to specify formats defined for + the `astropy.table.Table` class - in this case, you will need to also + provide the column names for column containing the start times for the + bins, as well as other column names (see the Parameters section below + for details):: + + >>> from astropy.timeseries import TimeSeries + >>> ts = TimeSeries.read('sampled.dat', format='ascii.ecsv', + ... time_column='date') # doctest: +SKIP + + Parameters + ---------- + filename : str + File to parse. + format : str + File format specifier. + time_column : str, optional + The name of the time column. + time_format : str, optional + The time format for the time column. + time_scale : str, optional + The time scale for the time column. + *args : tuple, optional + Positional arguments passed through to the data reader. + **kwargs : dict, optional + Keyword arguments passed through to the data reader. + + Returns + ------- + out : `astropy.timeseries.sampled.TimeSeries` + TimeSeries corresponding to file contents. + + Notes + ----- + """ + try: + + # First we try the readers defined for the BinnedTimeSeries class + return super().read(filename, format=format, *args, **kwargs) + + except TypeError: + + # Otherwise we fall back to the default Table readers + + if time_column is None: + raise ValueError("``time_column`` should be provided since the default Table readers are being used.") + + table = Table.read(filename, format=format, *args, **kwargs) + + if time_column in table.colnames: + time = Time(table.columns[time_column], scale=time_scale, format=time_format) + table.remove_column(time_column) + else: + raise ValueError("Time column '{}' not found in the input data.".format(time_column)) + + return TimeSeries(time=time, data=table) diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/__init__.py b/testbed/astropy__astropy/astropy/timeseries/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dce85d06f83264a6e502be0906d86bd976e1677 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/__init__.py @@ -0,0 +1 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/data/binned.csv b/testbed/astropy__astropy/astropy/timeseries/tests/data/binned.csv new file mode 100644 index 0000000000000000000000000000000000000000..430a0b0d7f7ba6ce964e45033794eb5d256c6fe7 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/data/binned.csv @@ -0,0 +1,11 @@ +time_start,bin_size,time_end,A,B,C,D,E,F +2016-03-22T12:30:31.000,3,2016-03-22T12:30:34.000,164.93,114.73,26.27,19.21,28.87,63.44 +2016-03-22T12:30:34.000,3,2016-03-22T12:30:37.000,164.89,114.75,26.22,19.07,27.76,59.98 +2016-03-22T12:30:37.000,3,2016-03-22T12:30:40.000,164.63,115.04,25.78,19.01,27.04,59.61 +2016-03-22T12:30:40.000,3,2016-03-22T12:30:43.000,163.92,114.85,27.41,19.61,27.84,59.41 +2016-03-22T12:30:43.000,3,2016-03-22T12:30:46.000,163.45,114.84,26.86,19.53,28.02,60.09 +2016-03-22T12:30:46.000,3,2016-03-22T12:30:49.000,163.46,115.4,27.09,19.72,28.25,59.62 +2016-03-22T12:30:49.000,3,2016-03-22T12:30:52.000,163.22,115.56,27.13,19.63,28.24,58.65 +2016-03-22T12:30:52.000,3,2016-03-22T12:30:55.000,164.02,115.54,26.74,19.55,28.43,59.2 +2016-03-22T12:30:55.000,3,2016-03-22T12:30:58.000,163.59,115.72,27.82,20.21,29.17,56.18 +2016-03-22T12:30:58.000,3,2016-03-22T12:31:01.000,163.32,115.11,28.22,20.42,29.38,56.64 diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/data/sampled.csv b/testbed/astropy__astropy/astropy/timeseries/tests/data/sampled.csv new file mode 100644 index 0000000000000000000000000000000000000000..78cd218f900e079fc2bf957513e11eb202558c73 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/data/sampled.csv @@ -0,0 +1,12 @@ +Date,A,B,C,D,E,F,G +2008-03-18,24.68,164.93,114.73,26.27,19.21,28.87,63.44 +2008-03-19,24.18,164.89,114.75,26.22,19.07,27.76,59.98 +2008-03-20,23.99,164.63,115.04,25.78,19.01,27.04,59.61 +2008-03-25,24.14,163.92,114.85,27.41,19.61,27.84,59.41 +2008-03-26,24.44,163.45,114.84,26.86,19.53,28.02,60.09 +2008-03-27,24.38,163.46,115.4,27.09,19.72,28.25,59.62 +2008-03-28,24.32,163.22,115.56,27.13,19.63,28.24,58.65 +2008-03-31,24.19,164.02,115.54,26.74,19.55,28.43,59.2 +2008-04-01,23.81,163.59,115.72,27.82,20.21,29.17,56.18 +2008-04-02,24.03,163.32,115.11,28.22,20.42,29.38,56.64 +2008-04-03,24.34,163.34,115.17,28.14,20.36,29.51,57.49 diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/test_binned.py b/testbed/astropy__astropy/astropy/timeseries/tests/test_binned.py new file mode 100644 index 0000000000000000000000000000000000000000..74633127d96760db86f73042f8b89ae3c71e9213 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/test_binned.py @@ -0,0 +1,304 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import pytest +from numpy.testing import assert_equal, assert_allclose + +from astropy import units as u +from astropy.time import Time, TimeDelta +from astropy.utils.data import get_pkg_data_filename + +from astropy.timeseries.periodograms import BoxLeastSquares, LombScargle +from astropy.timeseries.binned import BinnedTimeSeries +from astropy.tests.helper import assert_quantity_allclose + + +CSV_FILE = get_pkg_data_filename('data/binned.csv') + + +def test_empty_initialization(): + ts = BinnedTimeSeries() + ts['time_bin_start'] = Time([1, 2, 3], format='mjd') + + +def test_empty_initialization_invalid(): + + # Make sure things crash when the first column added is not a time column + + ts = BinnedTimeSeries() + with pytest.raises(ValueError) as exc: + ts['flux'] = [1, 2, 3] + assert exc.value.args[0] == ("BinnedTimeSeries object is invalid - expected " + "'time_bin_start' as the first column but found 'flux'") + + +def test_initialization_time_bin_invalid(): + + # Make sure things crash when time_bin_* is passed incorrectly. + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data=[[1, 4, 3]]) + assert exc.value.args[0] == ("'time_bin_start' has not been specified") + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(time_bin_start='2016-03-22T12:30:31', data=[[1, 4, 3]]) + assert exc.value.args[0] == ("Either 'time_bin_size' or 'time_bin_end' should be specified") + + +def test_initialization_time_bin_both(): + + # Make sure things crash when time_bin_* is passed twice. + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time_bin_start": ["2016-03-22T12:30:31"]}, + time_bin_start="2016-03-22T12:30:31") + assert exc.value.args[0] == ("'time_bin_start' has been given both in the table " + "and as a keyword argument") + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time_bin_size": ["2016-03-22T12:30:31"]}, + time_bin_size=[1]*u.s) + assert exc.value.args[0] == ("'time_bin_size' has been given both in the table " + "and as a keyword argument") + + +def test_initialization_time_bin_size(): + + # Make sure things crash when time_bin_size has no units + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start="2016-03-22T12:30:31", + time_bin_size=1) + assert exc.value.args[0] == ("'time_bin_size' should be a Quantity or a TimeDelta") + + # TimeDelta for time_bin_size + ts = BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start="2016-03-22T12:30:31", + time_bin_size=TimeDelta(1)) + assert isinstance(ts.time_bin_size, u.quantity.Quantity) + + +def test_initialization_time_bin_start_scalar(): + + # Make sure things crash when time_bin_start is a scalar with no time_bin_size + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start=Time(1, format='mjd'), + time_bin_end=Time(1, format='mjd')) + assert exc.value.args[0] == ("'time_bin_start' is scalar, so 'time_bin_size' is required") + + +def test_initialization_n_bins(): + + # Make sure things crash with incorrect n_bins + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start=Time(1, format='mjd'), + time_bin_size=1*u.s, + time_bin_end=Time(1, format='mjd'), + n_bins=10) + assert exc.value.args[0] == ("'n_bins' has been given and it is not the " + "same length as the input data.") + + +def test_initialization_non_scalar_time(): + + # Make sure things crash with incorrect size of time_bin_start + + with pytest.raises(ValueError) as exc: + BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start=["2016-03-22T12:30:31", "2016-03-22T12:30:32"], + time_bin_size=1*u.s, + time_bin_end=Time(1, format='mjd')) + assert exc.value.args[0] == ("Length of 'time_bin_start' (2) should match table length (1)") + + with pytest.raises(TypeError) as exc: + BinnedTimeSeries(data={"time": ["2016-03-22T12:30:31"]}, + time_bin_start=["2016-03-22T12:30:31"], + time_bin_size=None, + time_bin_end=None) + assert exc.value.args[0] == ("Either 'time_bin_size' or 'time_bin_end' should be specified") + + +def test_even_contiguous(): + + # Initialize a ``BinnedTimeSeries`` with even contiguous bins by specifying + # the bin width: + + ts = BinnedTimeSeries(time_bin_start='2016-03-22T12:30:31', + time_bin_size=3 * u.s, data=[[1, 4, 3]]) + + assert_equal(ts.time_bin_start.isot, ['2016-03-22T12:30:31.000', + '2016-03-22T12:30:34.000', + '2016-03-22T12:30:37.000']) + + assert_equal(ts.time_bin_center.isot, ['2016-03-22T12:30:32.500', + '2016-03-22T12:30:35.500', + '2016-03-22T12:30:38.500']) + + assert_equal(ts.time_bin_end.isot, ['2016-03-22T12:30:34.000', + '2016-03-22T12:30:37.000', + '2016-03-22T12:30:40.000']) + + +def test_uneven_contiguous(): + + # Initialize a ``BinnedTimeSeries`` with uneven contiguous bins by giving an + # end time: + + ts = BinnedTimeSeries(time_bin_start=['2016-03-22T12:30:31', + '2016-03-22T12:30:32', + '2016-03-22T12:30:40'], + time_bin_end='2016-03-22T12:30:55', + data=[[1, 4, 3]]) + + assert_equal(ts.time_bin_start.isot, ['2016-03-22T12:30:31.000', + '2016-03-22T12:30:32.000', + '2016-03-22T12:30:40.000']) + + assert_equal(ts.time_bin_center.isot, ['2016-03-22T12:30:31.500', + '2016-03-22T12:30:36.000', + '2016-03-22T12:30:47.500']) + + assert_equal(ts.time_bin_end.isot, ['2016-03-22T12:30:32.000', + '2016-03-22T12:30:40.000', + '2016-03-22T12:30:55.000']) + + +def test_uneven_non_contiguous(): + + # Initialize a ``BinnedTimeSeries`` with uneven non-contiguous bins with + # lists of start times, bin sizes and data: + + ts = BinnedTimeSeries(time_bin_start=['2016-03-22T12:30:31', + '2016-03-22T12:30:38', + '2016-03-22T12:34:40'], + time_bin_size=[5, 100, 2]*u.s, + data=[[1, 4, 3]]) + + assert_equal(ts.time_bin_start.isot, ['2016-03-22T12:30:31.000', + '2016-03-22T12:30:38.000', + '2016-03-22T12:34:40.000']) + + assert_equal(ts.time_bin_center.isot, ['2016-03-22T12:30:33.500', + '2016-03-22T12:31:28.000', + '2016-03-22T12:34:41.000']) + + assert_equal(ts.time_bin_end.isot, ['2016-03-22T12:30:36.000', + '2016-03-22T12:32:18.000', + '2016-03-22T12:34:42.000']) + + +def test_uneven_non_contiguous_full(): + + # Initialize a ``BinnedTimeSeries`` with uneven non-contiguous bins by + # specifying the start and end times for the bins: + + ts = BinnedTimeSeries(time_bin_start=['2016-03-22T12:30:31', + '2016-03-22T12:30:33', + '2016-03-22T12:30:40'], + time_bin_end=['2016-03-22T12:30:32', + '2016-03-22T12:30:35', + '2016-03-22T12:30:41'], + data=[[1, 4, 3]]) + + assert_equal(ts.time_bin_start.isot, ['2016-03-22T12:30:31.000', + '2016-03-22T12:30:33.000', + '2016-03-22T12:30:40.000']) + + assert_equal(ts.time_bin_center.isot, ['2016-03-22T12:30:31.500', + '2016-03-22T12:30:34.000', + '2016-03-22T12:30:40.500']) + + assert_equal(ts.time_bin_end.isot, ['2016-03-22T12:30:32.000', + '2016-03-22T12:30:35.000', + '2016-03-22T12:30:41.000']) + + +def test_read_empty(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, format='csv') + assert exc.value.args[0] == '``time_bin_start_column`` should be provided since the default Table readers are being used.' + + +def test_read_no_size_end(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', format='csv') + assert exc.value.args[0] == 'Either `time_bin_end_column` or `time_bin_size_column` should be provided.' + + +def test_read_both_extra_bins(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', time_bin_end_column='END', time_bin_size_column='bin_size', format='csv') + assert exc.value.args[0] == "Cannot specify both `time_bin_end_column` and `time_bin_size_column`." + + +def test_read_size_no_unit(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', time_bin_size_column='bin_size', format='csv') + assert exc.value.args[0] == "The bin size unit should be specified as an astropy Unit using ``time_bin_size_unit``." + + +def test_read_start_time_missing(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='abc', time_bin_size_column='bin_size', time_bin_size_unit=u.second, format='csv') + assert exc.value.args[0] == "Bin start time column 'abc' not found in the input data." + + +def test_read_end_time_missing(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', time_bin_end_column="missing", format='csv') + assert exc.value.args[0] == "Bin end time column 'missing' not found in the input data." + + +def test_read_size_missing(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', time_bin_size_column="missing", time_bin_size_unit=u.second, format='csv') + assert exc.value.args[0] == "Bin size column 'missing' not found in the input data." + + +def test_read_time_unit_missing(): + with pytest.raises(ValueError) as exc: + BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', time_bin_size_column="bin_size", format='csv') + assert exc.value.args[0] == "The bin size unit should be specified as an astropy Unit using ``time_bin_size_unit``." + + +def test_read(): + + timeseries = BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', + time_bin_end_column='time_end', format='csv') + assert timeseries.colnames == ['time_bin_start', 'time_bin_size', 'bin_size', 'A', 'B', 'C', 'D', 'E', 'F'] + assert len(timeseries) == 10 + assert timeseries['B'].sum() == 1151.54 + + timeseries = BinnedTimeSeries.read(CSV_FILE, time_bin_start_column='time_start', + time_bin_size_column='bin_size', + time_bin_size_unit=u.second, format='csv') + assert timeseries.colnames == ['time_bin_start', 'time_bin_size', 'time_end', 'A', 'B', 'C', 'D', 'E', 'F'] + assert len(timeseries) == 10 + assert timeseries['B'].sum() == 1151.54 + + +@pytest.mark.parametrize('cls', [BoxLeastSquares, LombScargle]) +def test_periodogram(cls): + + # Note that we don't need to check the actual results from the periodogram + # classes here since these are tested extensively in + # astropy.timeseries.periodograms. + + ts = BinnedTimeSeries(time_bin_start='2016-03-22T12:30:31', + time_bin_size=3 * u.s, data=[[1, 4, 3], [3, 4, 3]], names=['a', 'b']) + + p1 = cls.from_timeseries(ts, 'a') + assert isinstance(p1, cls) + assert_allclose(p1.t.jd, ts.time_bin_center.jd) + assert_equal(p1.y, ts['a']) + assert p1.dy is None + + p2 = cls.from_timeseries(ts, 'a', uncertainty='b') + assert_quantity_allclose(p2.dy, ts['b']) + + p3 = cls.from_timeseries(ts, 'a', uncertainty=0.1) + assert_allclose(p3.dy, 0.1) diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/test_common.py b/testbed/astropy__astropy/astropy/timeseries/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..bea08656d21d1f4e31a0a3ce39981a049cbe9e72 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/test_common.py @@ -0,0 +1,83 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import pytest + +from numpy.testing import assert_equal + +from astropy import units as u +from astropy.table import Table, QTable, vstack +from astropy.time import Time + +from astropy.timeseries.sampled import TimeSeries +from astropy.timeseries.binned import BinnedTimeSeries + + +INPUT_TIME = Time(['2016-03-22T12:30:31', '2015-01-21T12:30:32', '2016-03-22T12:30:40']) +PLAIN_TABLE = Table([[1., 2., 11.], [3, 4, 1], ['x', 'y', 'z']], names=['a', 'b', 'c']) + + +class CommonTimeSeriesTests: + + def test_stacking(self): + ts = vstack([self.series, self.series]) + assert isinstance(ts, self.series.__class__) + + def test_row_slicing(self): + ts = self.series[:2] + assert isinstance(ts, self.series.__class__) + + def test_row_indexing(self): + self.series[0][self.time_attr] == Time('2015-01-21T12:30:32') + self.series[self.time_attr][0] == Time('2015-01-21T12:30:32') + + def test_column_indexing(self): + assert_equal(self.series['a'], [1, 2, 11]) + + def test_column_slicing_notime(self): + tab = self.series['a', 'b'] + assert not isinstance(tab, self.series.__class__) + assert isinstance(tab, QTable) + + def test_add_column(self): + self.series['d'] = [1, 2, 3] + + def test_add_row(self): + self.series.add_row(self._row) + + def test_required_after_stacking(self): + # When stacking, we have to temporarily relax the checking of the + # columns in the time series, but we need to make sure that the + # checking works again afterwards + ts = vstack([self.series, self.series]) + with pytest.raises(ValueError) as exc: + ts.remove_columns(ts.colnames) + assert 'TimeSeries object is invalid' in exc.value.args[0] + + +class TestTimeSeries(CommonTimeSeriesTests): + + _row = {'time': '2016-03-22T12:30:40', 'a': 1., 'b': 2, 'c': 'a'} + + def setup_method(self, method): + self.series = TimeSeries(time=INPUT_TIME, data=PLAIN_TABLE) + self.time_attr = 'time' + + def test_column_slicing(self): + ts = self.series['time', 'a'] + assert isinstance(ts, TimeSeries) + + +class TestBinnedTimeSeries(CommonTimeSeriesTests): + + _row = {'time_bin_start': '2016-03-22T12:30:40', + 'time_bin_size': 2 * u.s, 'a': 1., 'b': 2, 'c': 'a'} + + def setup_method(self, method): + self.series = BinnedTimeSeries(time_bin_start=INPUT_TIME, + time_bin_size=3 * u.s, + data=PLAIN_TABLE) + self.time_attr = 'time_bin_start' + + def test_column_slicing(self): + ts = self.series['time_bin_start', 'time_bin_size', 'a'] + assert isinstance(ts, BinnedTimeSeries) diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/test_downsample.py b/testbed/astropy__astropy/astropy/timeseries/tests/test_downsample.py new file mode 100644 index 0000000000000000000000000000000000000000..067561b774e2862db9838ba449a3d38f30deeb65 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/test_downsample.py @@ -0,0 +1,69 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import pytest +import numpy as np +from numpy.testing import assert_equal + +from astropy import units as u +from astropy.time import Time + +from astropy.timeseries.sampled import TimeSeries +from astropy.timeseries.downsample import aggregate_downsample, reduceat + +INPUT_TIME = Time(['2016-03-22T12:30:31', '2016-03-22T12:30:32', + '2016-03-22T12:30:33', '2016-03-22T12:30:34']) +ts = TimeSeries(time=INPUT_TIME, data=[[1, 2, 3, 4]], names=['a']) +ts_units = TimeSeries(time=INPUT_TIME, data=[[1, 2, 3, 4] * u.count], names=['a']) + + +def test_reduceat(): + add_output = np.add.reduceat(np.arange(8),[0, 4, 1, 5, 2, 6, 3, 7]) + # Similar to np.add for an array input. + sum_output = reduceat(np.arange(8), [0, 4, 1, 5, 2, 6, 3, 7], np.sum) + assert_equal(sum_output, add_output) + + mean_output = reduceat(np.arange(8), np.arange(8)[::2], np.mean) + assert_equal(mean_output, np.array([0.5, 2.5, 4.5, 6.5])) + nanmean_output = reduceat(np.arange(8), [0, 4, 1, 5, 2, 6, 3, 7], np.mean) + assert_equal(nanmean_output, np.array([1.5, 4, 2.5, 5, 3.5, 6, 4.5, 7.])) + assert_equal(reduceat(np.arange(8), np.arange(8)[::2], np.mean), + reduceat(np.arange(8), np.arange(8)[::2], np.nanmean)) + + +def test_timeseries_invalid(): + with pytest.raises(TypeError) as exc: + aggregate_downsample(None) + assert exc.value.args[0] == ("time_series should be a TimeSeries") + + with pytest.raises(TypeError) as exc: + aggregate_downsample(TimeSeries()) + assert exc.value.args[0] == ("time_bin_size should be a astropy.unit quantity") + + +def test_downsample(): + down_1 = aggregate_downsample(ts, time_bin_size=1*u.second) + u.isclose(down_1.time_bin_size, [1, 1, 1, 1]*u.second) + assert_equal(down_1.time_bin_start.isot, Time(['2016-03-22T12:30:31.000', '2016-03-22T12:30:32.000', + '2016-03-22T12:30:33.000', '2016-03-22T12:30:34.000'])) + assert_equal(down_1["a"].data, np.array([1, 2, 3, 4])) + + down_2 = aggregate_downsample(ts, time_bin_size=2*u.second) + u.isclose(down_2.time_bin_size, [2, 2]*u.second) + assert_equal(down_2.time_bin_start.isot, Time(['2016-03-22T12:30:31.000', '2016-03-22T12:30:33.000'])) + assert_equal(down_2["a"].data, np.array([1, 3])) + + down_3 = aggregate_downsample(ts, time_bin_size=3*u.second) + u.isclose(down_3.time_bin_size, [3, 3]*u.second) + assert_equal(down_3.time_bin_start.isot, Time(['2016-03-22T12:30:31.000', '2016-03-22T12:30:34.000'])) + assert_equal(down_3["a"].data, np.array([2, 4])) + + down_4 = aggregate_downsample(ts, time_bin_size=4*u.second) + u.isclose(down_4.time_bin_size, [4]*u.second) + assert_equal(down_4.time_bin_start.isot, Time(['2016-03-22T12:30:31.000'])) + assert_equal(down_4["a"].data, np.array([2])) + + down_units = aggregate_downsample(ts_units, time_bin_size=4*u.second) + u.isclose(down_units.time_bin_size, [4]*u.second) + assert_equal(down_units.time_bin_start.isot, Time(['2016-03-22T12:30:31.000'])) + assert down_units["a"].unit.name == 'ct' + assert_equal(down_units["a"].data, np.array([2.5])) diff --git a/testbed/astropy__astropy/astropy/timeseries/tests/test_sampled.py b/testbed/astropy__astropy/astropy/timeseries/tests/test_sampled.py new file mode 100644 index 0000000000000000000000000000000000000000..041b202dae3f8f806bc098c87f932b82e8fbf4e6 --- /dev/null +++ b/testbed/astropy__astropy/astropy/timeseries/tests/test_sampled.py @@ -0,0 +1,305 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from datetime import datetime + +import pytest + +from numpy.testing import assert_equal, assert_allclose + +from astropy.table import Table, Column +from astropy.time import Time, TimeDelta +from astropy import units as u +from astropy.utils.data import get_pkg_data_filename +from astropy.tests.helper import assert_quantity_allclose + +from astropy.timeseries.periodograms import BoxLeastSquares, LombScargle +from astropy.timeseries.sampled import TimeSeries + +INPUT_TIME = Time(['2016-03-22T12:30:31', + '2015-01-21T12:30:32', + '2016-03-22T12:30:40']) +PLAIN_TABLE = Table([[1, 2, 11], [3, 4, 1], [1, 1, 1]], names=['a', 'b', 'c']) + +CSV_FILE = get_pkg_data_filename('data/sampled.csv') + + +def test_empty_initialization(): + ts = TimeSeries() + ts['time'] = Time([1, 2, 3], format='mjd') + + +def test_empty_initialization_invalid(): + # Make sure things crash when the first column added is not a time column + ts = TimeSeries() + with pytest.raises(ValueError) as exc: + ts['flux'] = [1, 2, 3] + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'flux'") + + +def test_initialize_only_time(): + ts = TimeSeries(time=INPUT_TIME) + assert ts['time'] is ts.time + # NOTE: the object in the table is a copy + assert_equal(ts.time.isot, INPUT_TIME.isot) + + +def test_initialization_with_data(): + ts = TimeSeries(time=INPUT_TIME, data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert_equal(ts.time.isot, INPUT_TIME.isot) + assert_equal(ts['a'], [10, 2, 3]) + assert_equal(ts['b'], [4, 5, 6]) + + +def test_initialize_only_data(): + with pytest.raises(TypeError) as exc: + TimeSeries(data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert exc.value.args[0] == "Either 'time' or 'time_start' should be specified" + + +def test_initialization_with_table(): + ts = TimeSeries(time=INPUT_TIME, data=PLAIN_TABLE) + assert ts.colnames == ['time', 'a', 'b', 'c'] + + +def test_initialization_with_time_delta(): + ts = TimeSeries(time_start=datetime(2018, 7, 1, 10, 10, 10), + time_delta=TimeDelta(3, format='sec'), + data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert_equal(ts.time.isot, ['2018-07-01T10:10:10.000', + '2018-07-01T10:10:13.000', + '2018-07-01T10:10:16.000']) + + +def test_initialization_missing_time_delta(): + with pytest.raises(TypeError) as exc: + TimeSeries(time_start=datetime(2018, 7, 1, 10, 10, 10), + data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert exc.value.args[0] == "'time' is scalar, so 'time_delta' is required" + + +def test_initialization_invalid_time_and_time_start(): + with pytest.raises(TypeError) as exc: + TimeSeries(time=INPUT_TIME, time_start=datetime(2018, 7, 1, 10, 10, 10), + data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert exc.value.args[0] == "Cannot specify both 'time' and 'time_start'" + + +def test_initialization_invalid_time_delta(): + with pytest.raises(TypeError) as exc: + TimeSeries(time_start=datetime(2018, 7, 1, 10, 10, 10), + time_delta=[1, 4, 3], + data=[[10, 2, 3], [4, 5, 6]], names=['a', 'b']) + assert exc.value.args[0] == "'time_delta' should be a Quantity or a TimeDelta" + + +def test_initialization_with_time_in_data(): + + data = PLAIN_TABLE.copy() + data['time'] = INPUT_TIME + + ts1 = TimeSeries(data=data) + + assert set(ts1.colnames) == set(['time', 'a', 'b', 'c']) + assert all(ts1.time == INPUT_TIME) + + ts2 = TimeSeries(data=[[10, 2, 3], INPUT_TIME], names=['a', 'time']) + assert set(ts2.colnames) == set(['time', 'a']) + assert all(ts2.time == INPUT_TIME) + + with pytest.raises(TypeError) as exc: + # Don't allow ambiguous cases of passing multiple 'time' columns + TimeSeries(data=data, time=INPUT_TIME) + assert exc.value.args[0] == "'time' has been given both in the table and as a keyword argument" + + with pytest.raises(TypeError) as exc: + # 'time' is a protected name, don't allow ambiguous cases + TimeSeries(time=INPUT_TIME, data=[[10, 2, 3], INPUT_TIME], names=['a', 'time']) + assert exc.value.args[0] == "'time' has been given both in the table and as a keyword argument" + + +def test_initialization_n_samples(): + + # Make sure things crash with incorrect n_samples + + with pytest.raises(TypeError) as exc: + TimeSeries(time=INPUT_TIME, data=PLAIN_TABLE, n_samples=1000) + assert exc.value.args[0] == ("'n_samples' has been given both and it is not the " + "same length as the input data.") + + +def test_initialization_length_mismatch(): + with pytest.raises(ValueError) as exc: + TimeSeries(time=INPUT_TIME, data=[[10, 2], [4, 5]], names=['a', 'b']) + assert exc.value.args[0] == "Length of 'time' (3) should match data length (2)" + + +def test_initialization_invalid_both_time_and_time_delta(): + with pytest.raises(TypeError) as exc: + TimeSeries(time=INPUT_TIME, time_delta=TimeDelta(3, format='sec')) + assert exc.value.args[0] == ("'time_delta' should not be specified since " + "'time' is an array") + + +def test_fold(): + + times = Time([1, 2, 3, 8, 9, 12], format='unix') + + ts = TimeSeries(time=times) + ts['flux'] = [1, 4, 4, 3, 2, 3] + + # Try without midpoint epoch, as it should default to the first time + tsf = ts.fold(period=3 * u.s) + assert isinstance(tsf.time, TimeDelta) + assert_allclose(tsf.time.sec, [0, 1, -1, 1, -1, -1], rtol=1e-6) + + # Try with midpoint epoch + tsf = ts.fold(period=4 * u.s, midpoint_epoch=Time(2.5, format='unix')) + assert isinstance(tsf.time, TimeDelta) + assert_allclose(tsf.time.sec, [-1.5, -0.5, 0.5, 1.5, -1.5, 1.5], rtol=1e-6) + + +def test_pandas(): + pandas = pytest.importorskip("pandas") + + df1 = pandas.DataFrame() + df1['a'] = [1, 2, 3] + df1.set_index(pandas.DatetimeIndex(INPUT_TIME.datetime64), inplace=True) + + ts = TimeSeries.from_pandas(df1) + assert_equal(ts.time.isot, INPUT_TIME.isot) + assert ts.colnames == ['time', 'a'] + assert len(ts.indices) == 1 + assert (ts.indices['time'].columns[0] == INPUT_TIME).all() + + ts_tcb = TimeSeries.from_pandas(df1, time_scale='tcb') + assert ts_tcb.time.scale == 'tcb' + + df2 = ts.to_pandas() + assert (df2.index.values == pandas.Index(INPUT_TIME.datetime64).values).all() + assert df2.columns == pandas.Index(['a']) + assert (df1['a'] == df2['a']).all() + + with pytest.raises(TypeError) as exc: + TimeSeries.from_pandas(None) + assert exc.value.args[0] == 'Input should be a pandas DataFrame' + + df4 = pandas.DataFrame() + df4['a'] = [1, 2, 3] + + with pytest.raises(TypeError) as exc: + TimeSeries.from_pandas(df4) + assert exc.value.args[0] == 'DataFrame does not have a DatetimeIndex' + + +def test_read_time_missing(): + with pytest.raises(ValueError) as exc: + TimeSeries.read(CSV_FILE, format='csv') + assert exc.value.args[0] == '``time_column`` should be provided since the default Table readers are being used.' + + +def test_read_time_wrong(): + with pytest.raises(ValueError) as exc: + TimeSeries.read(CSV_FILE, time_column='abc', format='csv') + assert exc.value.args[0] == "Time column 'abc' not found in the input data." + + +def test_read(): + timeseries = TimeSeries.read(CSV_FILE, time_column='Date', format='csv') + assert timeseries.colnames == ['time', 'A', 'B', 'C', 'D', 'E', 'F', 'G'] + assert len(timeseries) == 11 + assert timeseries['time'].format == 'iso' + assert timeseries['A'].sum() == 266.5 + + +@pytest.mark.remote_data(source='astropy') +def test_kepler_astropy(): + filename = get_pkg_data_filename('timeseries/kplr010666592-2009131110544_slc.fits') + timeseries = TimeSeries.read(filename, format='kepler.fits') + assert timeseries["time"].format == 'isot' + assert timeseries["time"].scale == 'tdb' + assert timeseries["sap_flux"].unit.to_string() == 'electron / s' + assert len(timeseries) == 14280 + assert len(timeseries.columns) == 20 + + +@pytest.mark.remote_data(source='astropy') +def test_tess_astropy(): + filename = get_pkg_data_filename('timeseries/hlsp_tess-data-alerts_tess_phot_00025155310-s01_tess_v1_lc.fits') + timeseries = TimeSeries.read(filename, format='tess.fits') + assert timeseries["time"].format == 'isot' + assert timeseries["time"].scale == 'tdb' + assert timeseries["sap_flux"].unit.to_string() == 'electron / s' + assert len(timeseries) == 19261 + assert len(timeseries.columns) == 20 + + +def test_required_columns(): + + # Test the machinery that makes sure that the required columns are present + + ts = TimeSeries(time=INPUT_TIME, + data=[[10, 2, 3], [4, 5, 6]], + names=['a', 'b']) + + # In the examples below, the operation (e.g. remove_column) is actually + # carried out before the checks are made, so we need to use copy() so that + # we don't change the main version of the time series. + + # Make sure copy works fine + ts.copy() + + with pytest.raises(ValueError) as exc: + ts.copy().add_column(Column([3, 4, 5], name='c'), index=0) + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'c'") + + with pytest.raises(ValueError) as exc: + ts.copy().add_columns([Column([3, 4, 5], name='d'), + Column([3, 4, 5], name='e')], indexes=[0, 1]) + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'd'") + + with pytest.raises(ValueError) as exc: + ts.copy().keep_columns(['a', 'b']) + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'a'") + + with pytest.raises(ValueError) as exc: + ts.copy().remove_column('time') + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'a'") + + with pytest.raises(ValueError) as exc: + ts.copy().remove_columns(['time', 'a']) + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'b'") + + with pytest.raises(ValueError) as exc: + ts.copy().rename_column('time', 'banana') + assert exc.value.args[0] == ("TimeSeries object is invalid - expected " + "'time' as the first column but found 'banana'") + + +@pytest.mark.parametrize('cls', [BoxLeastSquares, LombScargle]) +def test_periodogram(cls): + + # Note that we don't need to check the actual results from the periodogram + # classes here since these are tested extensively in + # astropy.timeseries.periodograms. + + ts = TimeSeries(time=INPUT_TIME, + data=[[10, 2, 3], [4, 5, 6]], + names=['a', 'b']) + + p1 = cls.from_timeseries(ts, 'a') + assert isinstance(p1, cls) + assert_allclose(p1.t.jd, ts.time.jd) + assert_equal(p1.y, ts['a']) + assert p1.dy is None + + p2 = cls.from_timeseries(ts, 'a', uncertainty='b') + assert_quantity_allclose(p2.dy, ts['b']) + + p3 = cls.from_timeseries(ts, 'a', uncertainty=0.1) + assert_allclose(p3.dy, 0.1) diff --git a/testbed/astropy__astropy/astropy/uncertainty/__init__.py b/testbed/astropy__astropy/astropy/uncertainty/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0b61459ce5657e1bbfef94aa161d8c7acf2df721 --- /dev/null +++ b/testbed/astropy__astropy/astropy/uncertainty/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +This sub-package contains classes and functions for creating distributions that +work similar to `~astropy.units.Quantity` or array objects, but can propogate +uncertainties. +""" + + +from .core import * +from .distributions import * diff --git a/testbed/astropy__astropy/astropy/uncertainty/core.py b/testbed/astropy__astropy/astropy/uncertainty/core.py new file mode 100644 index 0000000000000000000000000000000000000000..98ad22b13c030c63c6dad2f9670fb6c500c8ac46 --- /dev/null +++ b/testbed/astropy__astropy/astropy/uncertainty/core.py @@ -0,0 +1,270 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +Distribution class and associated machinery. +""" + +import numpy as np + +from astropy import units as u +from astropy import stats + +__all__ = ['Distribution'] + + +# we set this by hand because the symbolic expression (below) requires scipy +# SMAD_SCALE_FACTOR = 1 / scipy.stats.norm.ppf(0.75) +SMAD_SCALE_FACTOR = 1.48260221850560203193936104071326553821563720703125 + + +class Distribution: + """ + A scalar value or array values with associated uncertainty distribution. + + This object will take its exact type from whatever the ``samples`` argument + is. In general this is expected to be an `~astropy.units.Quantity` or + `numpy.ndarray`, although anything compatible with `numpy.asanyarray` is + possible. + + See also: http://docs.astropy.org/en/stable/uncertainty/ + + Parameters + ---------- + samples : array-like + The distribution, with sampling along the *leading* axis. If 1D, the + sole dimension is used as the sampling axis (i.e., it is a scalar + distribution). + """ + _generated_subclasses = {} + + def __new__(cls, samples): + if isinstance(samples, Distribution): + samples = samples.distribution + else: + samples = np.asanyarray(samples, order='C') + if samples.shape == (): + raise TypeError('Attempted to initialize a Distribution with a scalar') + + new_dtype = np.dtype({'names': ['samples'], + 'formats': [(samples.dtype, (samples.shape[-1],))]}) + samples_cls = type(samples) + if not issubclass(samples_cls, Distribution): + # Make sure first letter is uppercase, but note that we can't use + # str.capitalize since that converts the rest of the name to lowercase. + new_name = samples_cls.__name__[0].upper() + samples_cls.__name__[1:] + cls.__name__ + if new_name in cls._generated_subclasses: + new_cls = cls._generated_subclasses[new_name] + else: + new_cls = type(new_name, (cls, samples_cls), + {'_samples_cls': samples_cls}) + cls._generated_subclasses[new_name] = new_cls + self = samples.view(dtype=new_dtype, type=new_cls) + # Get rid of trailing dimension of 1. + self.shape = samples.shape[:-1] + return self + + @property + def distribution(self): + return self['samples'] + + def __getitem__(self, item): + result = super().__getitem__(item) + if item == 'samples': + return super(Distribution, result).view(self._samples_cls) + else: + return Distribution.__new__(self.__class__, result['samples']) + + def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): + converted = [] + outputs = kwargs.pop('out', None) + if outputs: + kwargs['out'] = tuple((output.distribution if + isinstance(output, Distribution) + else output) for output in outputs) + if method in {'reduce', 'accumulate', 'reduceat'}: + axis = kwargs.get('axis', None) + if axis is None: + assert isinstance(inputs[0], Distribution) + kwargs['axis'] = tuple(range(inputs[0].ndim)) + + for input_ in inputs: + if isinstance(input_, Distribution): + converted.append(input_.distribution) + else: + shape = getattr(input_, 'shape', ()) + if shape: + converted.append(input_[..., np.newaxis]) + else: + converted.append(input_) + + results = getattr(ufunc, method)(*converted, **kwargs) + + if not isinstance(results, tuple): + results = (results,) + if outputs is None: + outputs = (None,) * len(results) + + finals = [] + for result, output in zip(results, outputs): + if output is not None: + finals.append(output) + else: + if getattr(result, 'shape', False): + finals.append(Distribution(result)) + else: + finals.append(result) + + return finals if len(finals) > 1 else finals[0] + + # Override view so that we stay a Distribution version of the new type. + def view(self, dtype=None, type=None): + if type is None: + if issubclass(dtype, np.ndarray): + type = dtype + dtype = None + else: + raise ValueError('Cannot set just dtype for a Distribution.') + + result = self.distribution.view(dtype, type) + return Distribution(result) + + def __repr__(self): + reprarr = repr(self.distribution) + if reprarr.endswith('>'): + firstspace = reprarr.find(' ') + reprarr = reprarr[firstspace+1:-1] # :-1] removes the ending '>' + return '<{} {} with n_samples={}>'.format(self.__class__.__name__, + reprarr, self.n_samples) + else: # numpy array-like + firstparen = reprarr.find('(') + reprarr = reprarr[firstparen:] + return '{}{} with n_samples={}'.format(self.__class__.__name__, + reprarr, self.n_samples) + return reprarr + + def __str__(self): + distrstr = str(self.distribution) + toadd = ' with n_samples={}'.format(self.n_samples) + return distrstr + toadd + + def _repr_latex_(self): + if hasattr(self.distribution, '_repr_latex_'): + superlatex = self.distribution._repr_latex_() + toadd = r', \; n_{{\rm samp}}={}'.format(self.n_samples) + return superlatex[:-1] + toadd + superlatex[-1] + else: + return None + + @property + def n_samples(self): + """ + The number of samples of this distribution. A single `int`. + """ + return self.dtype['samples'].shape[0] + + @property + def pdf_mean(self): + """ + The mean of this distribution. + """ + return self.distribution.mean(axis=-1) + + @property + def pdf_std(self): + """ + The standard deviation of this distribution. + """ + return self.distribution.std(axis=-1) + + @property + def pdf_var(self): + """ + The variance of this distribution. + """ + return self.distribution.var(axis=-1) + + @property + def pdf_median(self): + """ + The median of this distribution. + """ + return np.median(self.distribution, axis=-1) + + @property + def pdf_mad(self): + """ + The median absolute deviation of this distribution. + """ + return np.abs(self - self.pdf_median).pdf_median + + @property + def pdf_smad(self): + """ + The median absolute deviation of this distribution rescaled to match the + standard deviation for a normal distribution. + """ + return self.pdf_mad * SMAD_SCALE_FACTOR + + def pdf_percentiles(self, percentile, **kwargs): + """ + Compute percentiles of this Distribution. + + Parameters + ---------- + percentile : float or array of floats or `~astropy.units.Quantity` + The desired precentiles of the distribution (i.e., on [0,100]). + `~astropy.units.Quantity` will be converted to percent, meaning + that a ``dimensionless_unscaled`` `~astropy.units.Quantity` will + be interpreted as a quantile. + + Additional keywords are passed into `numpy.percentile`. + + Returns + ------- + percentiles : `~astropy.units.Quantity` + The ``fracs`` percentiles of this distribution. + """ + percentile = u.Quantity(percentile, u.percent).value + percs = np.percentile(self.distribution, percentile, axis=-1, **kwargs) + # numpy.percentile strips units for unclear reasons, so we have to make + # a new object with units + if hasattr(self.distribution, '_new_view'): + return self.distribution._new_view(percs) + else: + return percs + + def pdf_histogram(self, **kwargs): + """ + Compute histogram over the samples in the distribution. + + Parameters + ---------- + All keyword arguments are passed into `astropy.stats.histogram`. Note + That some of these options may not be valid for some multidimensional + distributions. + + Returns + ------- + hist : array + The values of the histogram. Trailing dimension is the histogram + dimension. + bin_edges : array of dtype float + Return the bin edges ``(length(hist)+1)``. Trailing dimension is the + bin histogram dimension. + """ + distr = self.distribution + raveled_distr = distr.reshape(distr.size//distr.shape[-1], distr.shape[-1]) + + nhists = [] + bin_edges = [] + for d in raveled_distr: + nhist, bin_edge = stats.histogram(d, **kwargs) + nhists.append(nhist) + bin_edges.append(bin_edge) + + nhists = np.array(nhists) + nh_shape = self.shape + (nhists.size//self.size,) + bin_edges = np.array(bin_edges) + be_shape = self.shape + (bin_edges.size//self.size,) + return nhists.reshape(nh_shape), bin_edges.reshape(be_shape) diff --git a/testbed/astropy__astropy/astropy/uncertainty/distributions.py b/testbed/astropy__astropy/astropy/uncertainty/distributions.py new file mode 100644 index 0000000000000000000000000000000000000000..ae5031cd5751f4e471d413c1cb8a83ae735ca791 --- /dev/null +++ b/testbed/astropy__astropy/astropy/uncertainty/distributions.py @@ -0,0 +1,178 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +""" +Built-in distribution-creation functions. +""" +from warnings import warn + +import numpy as np + +from astropy import units as u +from .core import Distribution + +__all__ = ['normal', 'poisson', 'uniform'] + + +def normal(center, *, std=None, var=None, ivar=None, n_samples, + cls=Distribution, **kwargs): + """ + Create a Gaussian/normal distribution. + + Parameters + ---------- + center : `~astropy.units.Quantity` + The center of this distribution + std : `~astropy.units.Quantity` or `None` + The standard deviation/σ of this distribution. Shape must match and unit + must be compatible with ``center``, or be `None` (if ``var`` or ``ivar`` + are set). + var : `~astropy.units.Quantity` or `None` + The variance of this distribution. Shape must match and unit must be + compatible with ``center``, or be `None` (if ``std`` or ``ivar`` are set). + ivar : `~astropy.units.Quantity` or `None` + The inverse variance of this distribution. Shape must match and unit + must be compatible with ``center``, or be `None` (if ``std`` or ``var`` + are set). + n_samples : int + The number of Monte Carlo samples to use with this distribution + cls : class + The class to use to create this distribution. Typically a + `Distribution` subclass. + + Remaining keywords are passed into the constructor of the ``cls`` + + Returns + ------- + distr : ``cls``, usually `Distribution` + The sampled Gaussian distribution. + """ + center = np.asanyarray(center) + if var is not None: + if std is None: + std = np.asanyarray(var)**0.5 + else: + raise ValueError('normal cannot take both std and var') + if ivar is not None: + if std is None: + std = np.asanyarray(ivar)**-0.5 + else: + raise ValueError('normal cannot take both ivar and ' + 'and std or var') + if std is None: + raise ValueError('normal requires one of std, var, or ivar') + else: + std = np.asanyarray(std) + + randshape = np.broadcast(std, center).shape + (n_samples,) + samples = center[..., np.newaxis] + np.random.randn(*randshape) * std[..., np.newaxis] + return cls(samples, **kwargs) + + +COUNT_UNITS = (u.count, u.electron, u.dimensionless_unscaled, u.chan, u.bin, u.vox, u.bit, u.byte) + +def poisson(center, n_samples, cls=Distribution, **kwargs): + """ + Create a Poisson distribution. + + Parameters + ---------- + center : `~astropy.units.Quantity` + The center value of this distribution (i.e., λ). + n_samples : int + The number of Monte Carlo samples to use with this distribution + cls : class + The class to use to create this distribution. Typically a + `Distribution` subclass. + + Remaining keywords are passed into the constructor of the ``cls`` + + Returns + ------- + distr : ``cls``, usually `Distribution` + The sampled poisson distribution. + """ + # we convert to arrays because np.random.poisson has trouble with quantities + has_unit = False + if hasattr(center, 'unit'): + has_unit = True + poissonarr = np.asanyarray(center.value) + else: + poissonarr = np.asanyarray(center) + randshape = poissonarr.shape + (n_samples,) + + samples = np.random.poisson(poissonarr[..., np.newaxis], randshape) + if has_unit: + if center.unit == u.adu: + warn('ADUs were provided to poisson. ADUs are not strictly count' + 'units because they need the gain to be applied. It is ' + 'recommended you apply the gain to convert to e.g. electrons.') + elif center.unit not in COUNT_UNITS: + warn('Unit {} was provided to poisson, which is not one of {}, ' + 'and therefore suspect as a "counting" unit. Ensure you mean ' + 'to use Poisson statistics.'.format(center.unit, COUNT_UNITS)) + + # re-attach the unit + samples = samples * center.unit + + return cls(samples, **kwargs) + + +def uniform(*, lower=None, upper=None, center=None, width=None, n_samples, + cls=Distribution, **kwargs): + """ + Create a Uniform distriution from the lower and upper bounds. + + Note that this function requires keywords to be explicit, and requires + either ``lower``/``upper`` or ``center``/``width``. + + Parameters + ---------- + lower : array-like + The lower edge of this distribution. If a `~astropy.units.Quantity`, the + distribution will have the same units as ``lower``. + upper : `~astropy.units.Quantity` + The upper edge of this distribution. Must match shape and if a + `~astropy.units.Quantity` must have compatible units with ``lower``. + center : array-like + The center value of the distribution. Cannot be provided at the same + time as ``lower``/``upper``. + width : array-like + The width of the distribution. Must have the same shape and compatible + units with ``center`` (if any). + n_samples : int + The number of Monte Carlo samples to use with this distribution + cls : class + The class to use to create this distribution. Typically a + `Distribution` subclass. + + Remaining keywords are passed into the constructor of the ``cls`` + + Returns + ------- + distr : ``cls``, usually `Distribution` + The sampled uniform distribution. + """ + if center is None and width is None: + lower = np.asanyarray(lower) + upper = np.asanyarray(upper) + if lower.shape != upper.shape: + raise ValueError('lower and upper must have consistent shapes') + elif upper is None and lower is None: + center = np.asanyarray(center) + width = np.asanyarray(width) + lower = center - width/2 + upper = center + width/2 + else: + raise ValueError('either upper/lower or center/width must be given ' + 'to uniform - other combinations are not valid') + + newshape = lower.shape + (n_samples,) + if lower.shape == tuple() and upper.shape == tuple(): + width = upper - lower # scalar + else: + width = (upper - lower)[:, np.newaxis] + lower = lower[:, np.newaxis] + samples = lower + width * np.random.uniform(size=newshape) + + return cls(samples, **kwargs) diff --git a/testbed/astropy__astropy/astropy/uncertainty/tests/__init__.py b/testbed/astropy__astropy/astropy/uncertainty/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/uncertainty/tests/test_distribution.py b/testbed/astropy__astropy/astropy/uncertainty/tests/test_distribution.py new file mode 100644 index 0000000000000000000000000000000000000000..8673178a19b80c730e0249c7952c609d2d120f3c --- /dev/null +++ b/testbed/astropy__astropy/astropy/uncertainty/tests/test_distribution.py @@ -0,0 +1,318 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +from __future__ import absolute_import, division, print_function + +import numpy as np + +from astropy import units as u +from astropy.uncertainty.core import Distribution +from astropy.uncertainty import distributions as ds +from astropy.utils import NumpyRNGContext +from astropy.tests.helper import assert_quantity_allclose, pytest + +try: + from scipy.stats import norm # pylint: disable=W0611 + SMAD_FACTOR = 1 / norm.ppf(0.75) +except ImportError: + HAS_SCIPY = False +else: + HAS_SCIPY = True + + +def test_numpy_init(): + # Test that we can initialize directly from a Numpy array + rates = np.array([1, 5, 30, 400])[:, np.newaxis] + parr = np.random.poisson(rates, (4, 1000)) + Distribution(parr) + + +def test_numpy_init_T(): + rates = np.array([1, 5, 30, 400]) + parr = np.random.poisson(rates, (1000, 4)) + Distribution(parr.T) + + +def test_quantity_init(): + # Test that we can initialize directly from a Quantity + pq = np.random.poisson(np.array([1, 5, 30, 400])[:, np.newaxis], + (4, 1000)) * u.ct + Distribution(pq) + + +def test_quantity_init_T(): + # Test that we can initialize directly from a Quantity + pq = np.random.poisson(np.array([1, 5, 30, 400]), (1000, 4)) * u.ct + Distribution(pq.T) + + +def test_init_scalar(): + parr = np.random.poisson(np.array([1, 5, 30, 400])[:, np.newaxis], + (4, 1000)) + with pytest.raises(TypeError) as exc: + Distribution(parr.ravel()[0]) + assert exc.value.args[0] == "Attempted to initialize a Distribution with a scalar" + + +class TestDistributionStatistics(): + def setup_class(self): + with NumpyRNGContext(12345): + self.data = np.random.normal(np.array([1, 2, 3, 4])[:, np.newaxis], + np.array([3, 2, 4, 5])[:, np.newaxis], + (4, 10000)) + + self.distr = Distribution(self.data * u.kpc) + + def test_shape(self): + # Distribution shape + assert self.distr.shape == (4, ) + assert self.distr.distribution.shape == (4, 10000) + + def test_size(self): + # Total number of values + assert self.distr.size == 4 + assert self.distr.distribution.size == 40000 + + def test_n_samples(self): + # Number of samples + assert self.distr.n_samples == 10000 + + def test_n_distr(self): + assert self.distr.shape == (4,) + + def test_pdf_mean(self): + # Mean of each PDF + expected = np.mean(self.data, axis=-1) * self.distr.unit + assert_quantity_allclose(self.distr.pdf_mean, expected) + assert_quantity_allclose(self.distr.pdf_mean, [1, 2, 3, 4] * self.distr.unit, rtol=0.05) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(self.distr.pdf_mean, Distribution) + assert isinstance(self.distr.pdf_mean, u.Quantity) + + def test_pdf_std(self): + # Standard deviation of each PDF + expected = np.std(self.data, axis=-1) * self.distr.unit + assert_quantity_allclose(self.distr.pdf_std, expected) + assert_quantity_allclose(self.distr.pdf_std, [3, 2, 4, 5] * self.distr.unit, rtol=0.05) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(self.distr.pdf_std, Distribution) + assert isinstance(self.distr.pdf_std, u.Quantity) + + def test_pdf_var(self): + # Variance of each PDF + expected = np.var(self.data, axis=-1) * self.distr.unit**2 + assert_quantity_allclose(self.distr.pdf_var, expected) + assert_quantity_allclose(self.distr.pdf_var, [9, 4, 16, 25] * self.distr.unit**2, rtol=0.1) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(self.distr.pdf_var, Distribution) + assert isinstance(self.distr.pdf_var, u.Quantity) + + def test_pdf_median(self): + # Median of each PDF + expected = np.median(self.data, axis=-1) * self.distr.unit + assert_quantity_allclose(self.distr.pdf_median, expected) + assert_quantity_allclose(self.distr.pdf_median, [1, 2, 3, 4] * self.distr.unit, rtol=0.1) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(self.distr.pdf_median, Distribution) + assert isinstance(self.distr.pdf_median, u.Quantity) + + @pytest.mark.skipif(not HAS_SCIPY, reason='no scipy') + def test_pdf_mad_smad(self): + # Median absolute deviation of each PDF + median = np.median(self.data, axis=-1, keepdims=True) + expected = np.median(np.abs(self.data - median), axis=-1) * self.distr.unit + assert_quantity_allclose(self.distr.pdf_mad, expected) + assert_quantity_allclose(self.distr.pdf_smad, self.distr.pdf_mad * SMAD_FACTOR, rtol=1e-5) + assert_quantity_allclose(self.distr.pdf_smad, [3, 2, 4, 5] * self.distr.unit, rtol=0.05) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(self.distr.pdf_mad, Distribution) + assert isinstance(self.distr.pdf_mad, u.Quantity) + assert not isinstance(self.distr.pdf_smad, Distribution) + assert isinstance(self.distr.pdf_smad, u.Quantity) + + def test_percentile(self): + expected = np.percentile(self.data, [10, 50, 90], axis=-1) * self.distr.unit + percs = self.distr.pdf_percentiles([10, 50, 90]) + assert_quantity_allclose(percs, expected) + assert percs.shape == (3, 4) + + # make sure the right type comes out - should be a Quantity because it's + # now a summary statistic + assert not isinstance(percs, Distribution) + assert isinstance(percs, u.Quantity) + + def test_add_quantity(self): + distrplus = self.distr + [2000, 0, 0, 500] * u.pc + expected = (np.median(self.data, axis=-1) + np.array([2, 0, 0, 0.5])) * self.distr.unit + assert_quantity_allclose(distrplus.pdf_median, expected) + expected = np.var(self.data, axis=-1) * self.distr.unit**2 + assert_quantity_allclose(distrplus.pdf_var, expected) + + def test_add_distribution(self): + another_data = (np.random.randn(4, 10000) + * np.array([1000, .01, 80, 10])[:, np.newaxis] + + np.array([2000, 0, 0, 500])[:, np.newaxis]) + # another_data is in pc, but main distr is in kpc + another_distr = Distribution(another_data * u.pc) + combined_distr = self.distr + another_distr + + expected = np.median(self.data + another_data/1000, + axis=-1) * self.distr.unit + assert_quantity_allclose(combined_distr.pdf_median, expected) + + expected = np.var(self.data + another_data/1000, axis=-1) * self.distr.unit**2 + assert_quantity_allclose(combined_distr.pdf_var, expected) + + +def test_helper_normal_samples(): + centerq = [1, 5, 30, 400] * u.kpc + + with NumpyRNGContext(12345): + n_dist = ds.normal(centerq, std=[0.2, 1.5, 4, 1]*u.kpc, n_samples=100) + assert n_dist.distribution.shape == (4, 100) + assert n_dist.shape == (4, ) + assert n_dist.unit == u.kpc + assert np.all(n_dist.pdf_std > 100*u.pc) + + n_dist2 = ds.normal(centerq, std=[0.2, 1.5, 4, 1]*u.pc, n_samples=20000) + assert n_dist2.distribution.shape == (4, 20000) + assert n_dist2.shape == (4, ) + assert n_dist2.unit == u.kpc + assert np.all(n_dist2.pdf_std < 100*u.pc) + + +def test_helper_poisson_samples(): + centerqcounts = [1, 5, 30, 400] * u.count + + with NumpyRNGContext(12345): + p_dist = ds.poisson(centerqcounts, n_samples=100) + assert p_dist.shape == (4,) + assert p_dist.distribution.shape == (4, 100) + assert p_dist.unit == u.count + p_min = np.min(p_dist) + assert isinstance(p_min, Distribution) + assert p_min.shape == () + assert np.all(p_min >= 0) + assert np.all(np.abs(p_dist.pdf_mean - centerqcounts) < centerqcounts) + + +def test_helper_uniform_samples(): + udist = ds.uniform(lower=[1, 2]*u.kpc, upper=[3, 4]*u.kpc, n_samples=1000) + assert udist.shape == (2, ) + assert udist.distribution.shape == (2, 1000) + assert np.all(np.min(udist.distribution, axis=-1) > [1, 2]*u.kpc) + assert np.all(np.max(udist.distribution, axis=-1) < [3, 4]*u.kpc) + + # try the alternative creator + udist = ds.uniform(center=[1, 3, 2] * u.pc, width=[5, 4, 3] * u.pc, n_samples=1000) + assert udist.shape == (3, ) + assert udist.distribution.shape == (3, 1000) + assert np.all(np.min(udist.distribution, axis=-1) > [-1.5, 1, 0.5]*u.pc) + assert np.all(np.max(udist.distribution, axis=-1) < [3.5, 5, 3.5]*u.pc) + + +def test_helper_normal_exact(): + pytest.skip('distribution stretch goal not yet implemented') + centerq = [1, 5, 30, 400] * u.kpc + ds.normal(centerq, std=[0.2, 1.5, 4, 1]*u.kpc) + ds.normal(centerq, var=[0.04, 2.25, 16, 1]*u.kpc**2) + ds.normal(centerq, ivar=[25, 0.44444444, 0.625, 1]*u.kpc**-2) + + +def test_helper_poisson_exact(): + pytest.skip('distribution stretch goal not yet implemented') + centerq = [1, 5, 30, 400] * u.one + ds.poisson(centerq, n_samples=1000) + + with pytest.raises(u.UnitsError) as exc: + centerq = [1, 5, 30, 400] * u.kpc + ds.poisson(centerq, n_samples=1000) + assert exc.value.args[0] == ("Poisson distribution can only be computed " + "for dimensionless quantities") + + +def test_reprs(): + darr = np.arange(30).reshape(3, 10) + distr = Distribution(darr * u.kpc) + + assert 'n_samples=10' in repr(distr) + assert 'n_samples=10' in str(distr) + + assert r'n_{\rm samp}=10' in distr._repr_latex_() + + +@pytest.mark.parametrize("func, kws", [ + (ds.normal, {'center': 0, 'std': 2}), + (ds.uniform, {'lower': 0, 'upper': 2}), + (ds.poisson, {'center': 2}), + (ds.normal, {'center': 0*u.count, 'std': 2*u.count}), + (ds.uniform, {'lower': 0*u.count, 'upper': 2*u.count}), + (ds.poisson, {'center': 2*u.count}) +]) +def test_wrong_kw_fails(func, kws): + with pytest.raises(Exception): + kw_temp = kws.copy() + kw_temp['n_sample'] = 100 # note the missing "s" + assert func(**kw_temp).n_samples == 100 + kw_temp = kws.copy() + kw_temp['n_samples'] = 100 + assert func(**kw_temp).n_samples == 100 + + +def test_index_assignment_quantity(): + arr = np.random.randn(2, 1000) + distr = Distribution(arr*u.kpc) + d1q, d2q = distr + assert isinstance(d1q, Distribution) + assert isinstance(d2q, Distribution) + + ndistr = ds.normal(center=[1, 2]*u.kpc, std=[3, 4]*u.kpc, n_samples=1000) + n1, n2 = ndistr + assert isinstance(n1, ds.Distribution) + assert isinstance(n2, ds.Distribution) + + +def test_index_assignment_array(): + arr = np.random.randn(2, 1000) + distr = Distribution(arr) + d1a, d2a = distr + assert isinstance(d1a, Distribution) + assert isinstance(d2a, Distribution) + + ndistr = ds.normal(center=[1, 2], std=[3, 4], n_samples=1000) + n1, n2 = ndistr + assert isinstance(n1, ds.Distribution) + assert isinstance(n2, ds.Distribution) + + +def test_histogram(): + arr = np.random.randn(2, 3, 1000) + distr = Distribution(arr) + + hist, bins = distr.pdf_histogram(bins=10) + assert hist.shape == (2, 3, 10) + assert bins.shape == (2, 3, 11) + + +def test_array_repr_latex(): + # as of this writing ndarray does not have a _repr_latex_, and this test + # ensure distributions account for that. However, if in the future ndarray + # gets a _repr_latex_, we can skip this. + + + arr = np.random.randn(4, 1000) + + if hasattr(arr, '_repr_latex_'): + pytest.skip('in this version of numpy, ndarray has a _repr_latex_') + + distr = Distribution(arr) + assert distr._repr_latex_() is None diff --git a/testbed/astropy__astropy/astropy/wcs/__init__.py b/testbed/astropy__astropy/astropy/wcs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3bb8c45f3a0da35b87c06ad5b7bd32fa8688ffbe --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/__init__.py @@ -0,0 +1,35 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +.. _wcslib: http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/index.html +.. _distortion paper: http://www.atnf.csiro.au/people/mcalabre/WCS/dcs_20040422.pdf +.. _SIP: http://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/shupeADASS.pdf +.. _FITS WCS standard: https://fits.gsfc.nasa.gov/fits_wcs.html + +`astropy.wcs` contains utilities for managing World Coordinate System +(WCS) transformations in FITS files. These transformations map the +pixel locations in an image to their real-world units, such as their +position on the sky sphere. + +It performs three separate classes of WCS transformations: + +- Core WCS, as defined in the `FITS WCS standard`_, based on Mark + Calabretta's `wcslib`_. See `~astropy.wcs.Wcsprm`. +- Simple Imaging Polynomial (`SIP`_) convention. See + `~astropy.wcs.Sip`. +- table lookup distortions as defined in WCS `distortion paper`_. See + `~astropy.wcs.DistortionLookupTable`. + +Each of these transformations can be used independently or together in +a standard pipeline. +""" + +from .wcs import * +from . import utils + + +def get_include(): + """ + Get the path to astropy.wcs's C header files. + """ + import os + return os.path.join(os.path.dirname(__file__), "include") diff --git a/testbed/astropy__astropy/astropy/wcs/docstrings.py b/testbed/astropy__astropy/astropy/wcs/docstrings.py new file mode 100644 index 0000000000000000000000000000000000000000..0a9e0f4aa6f7c19c29b5684c99d73ea44afe769c --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/docstrings.py @@ -0,0 +1,2553 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +# It gets to be really tedious to type long docstrings in ANSI C +# syntax (since multi-line string literals are not valid). +# Therefore, the docstrings are written here in doc/docstrings.py, +# which are then converted by setup.py into docstrings.h, which is +# included by pywcs.c + +__all__ = ['TWO_OR_MORE_ARGS', 'RETURNS', 'ORIGIN', 'RA_DEC_ORDER'] + + +def _fix(content, indent=0): + lines = content.split('\n') + indent = '\n' + ' ' * indent + return indent.join(lines) + + +def TWO_OR_MORE_ARGS(naxis, indent=0): + return _fix( +"""args : flexible + There are two accepted forms for the positional arguments: + + - 2 arguments: An *N* x *{0}* array of coordinates, and an + *origin*. + + - more than 2 arguments: An array for each axis, followed by + an *origin*. These arrays must be broadcastable to one + another. + + Here, *origin* is the coordinate in the upper left corner of the + image. In FITS and Fortran standards, this is 1. In Numpy and C + standards this is 0. +""".format(naxis), indent) + + +def RETURNS(out_type, indent=0): + return _fix("""result : array + Returns the {0}. If the input was a single array and + origin, a single array is returned, otherwise a tuple of arrays is + returned.""".format(out_type), indent) + + +def ORIGIN(indent=0): + return _fix( +""" +origin : int + Specifies the origin of pixel values. The Fortran and FITS + standards use an origin of 1. Numpy and C use array indexing with + origin at 0. +""", indent) + + +def RA_DEC_ORDER(indent=0): + return _fix( +""" +ra_dec_order : bool, optional + When `True` will ensure that world coordinates are always given + and returned in as (*ra*, *dec*) pairs, regardless of the order of + the axes specified by the in the ``CTYPE`` keywords. Default is + `False`. +""", indent) + + +a = """ +``double array[a_order+1][a_order+1]`` Focal plane transformation +matrix. + +The `SIP`_ ``A_i_j`` matrix used for pixel to focal plane +transformation. + +Its values may be changed in place, but it may not be resized, without +creating a new `~astropy.wcs.Sip` object. +""" + +a_order = """ +``int`` (read-only) Order of the polynomial (``A_ORDER``). +""" + +all_pix2world = """ +all_pix2world(pixcrd, origin) -> ``double array[ncoord][nelem]`` + +Transforms pixel coordinates to world coordinates. + +Does the following: + + - Detector to image plane correction (if present) + + - SIP distortion correction (if present) + + - FITS WCS distortion correction (if present) + + - wcslib "core" WCS transformation + +The first three (the distortion corrections) are done in parallel. + +Parameters +---------- +pixcrd : double array[ncoord][nelem] + Array of pixel coordinates. + +{0} + +Returns +------- +world : double array[ncoord][nelem] + Returns an array of world coordinates. + +Raises +------ +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +ValueError + Invalid coordinate transformation parameters. + +ValueError + x- and y-coordinate arrays are not the same size. + +InvalidTransformError + Invalid coordinate transformation. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. +""".format(ORIGIN()) + +alt = """ +``str`` Character code for alternate coordinate descriptions. + +For example, the ``"a"`` in keyword names such as ``CTYPEia``. This +is a space character for the primary coordinate description, or one of +the 26 upper-case letters, A-Z. +""" + +ap = """ +``double array[ap_order+1][ap_order+1]`` Focal plane to pixel +transformation matrix. + +The `SIP`_ ``AP_i_j`` matrix used for focal plane to pixel +transformation. Its values may be changed in place, but it may not be +resized, without creating a new `~astropy.wcs.Sip` object. +""" + +ap_order = """ +``int`` (read-only) Order of the polynomial (``AP_ORDER``). +""" + +axis_types = """ +``int array[naxis]`` An array of four-digit type codes for each axis. + +- First digit (i.e. 1000s): + + - 0: Non-specific coordinate type. + + - 1: Stokes coordinate. + + - 2: Celestial coordinate (including ``CUBEFACE``). + + - 3: Spectral coordinate. + +- Second digit (i.e. 100s): + + - 0: Linear axis. + + - 1: Quantized axis (``STOKES``, ``CUBEFACE``). + + - 2: Non-linear celestial axis. + + - 3: Non-linear spectral axis. + + - 4: Logarithmic axis. + + - 5: Tabular axis. + +- Third digit (i.e. 10s): + + - 0: Group number, e.g. lookup table number + +- The fourth digit is used as a qualifier depending on the axis type. + + - For celestial axes: + + - 0: Longitude coordinate. + + - 1: Latitude coordinate. + + - 2: ``CUBEFACE`` number. + + - For lookup tables: the axis number in a multidimensional table. + +``CTYPEia`` in ``"4-3"`` form with unrecognized algorithm code will +have its type set to -1 and generate an error. +""" + +b = """ +``double array[b_order+1][b_order+1]`` Pixel to focal plane +transformation matrix. + +The `SIP`_ ``B_i_j`` matrix used for pixel to focal plane +transformation. Its values may be changed in place, but it may not be +resized, without creating a new `~astropy.wcs.Sip` object. +""" + +b_order = """ +``int`` (read-only) Order of the polynomial (``B_ORDER``). +""" + +bounds_check = """ +bounds_check(pix2world, world2pix) + +Enable/disable bounds checking. + +Parameters +---------- +pix2world : bool, optional + When `True`, enable bounds checking for the pixel-to-world (p2x) + transformations. Default is `True`. + +world2pix : bool, optional + When `True`, enable bounds checking for the world-to-pixel (s2x) + transformations. Default is `True`. + +Notes +----- +Note that by default (without calling `bounds_check`) strict bounds +checking is enabled. +""" + +bp = """ +``double array[bp_order+1][bp_order+1]`` Focal plane to pixel +transformation matrix. + +The `SIP`_ ``BP_i_j`` matrix used for focal plane to pixel +transformation. Its values may be changed in place, but it may not be +resized, without creating a new `~astropy.wcs.Sip` object. +""" + +bp_order = """ +``int`` (read-only) Order of the polynomial (``BP_ORDER``). +""" + +cd = """ +``double array[naxis][naxis]`` The ``CDi_ja`` linear transformation +matrix. + +For historical compatibility, three alternate specifications of the +linear transformations are available in wcslib. The canonical +``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated +``CROTAia`` keywords. Although the latter may not formally co-exist +with ``PCi_ja``, the approach here is simply to ignore them if given +in conjunction with ``PCi_ja``. + +`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and +`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of +these alternatives are present in the header. + +These alternate specifications of the linear transformation matrix are +translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and +are nowhere visible to the lower-level routines. In particular, +`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity +if ``CDi_ja`` is present (and no ``PCi_ja``). If no ``CROTAia`` is +associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts +to a unity ``PCi_ja`` matrix. +""" + +cdelt = """ +``double array[naxis]`` Coordinate increments (``CDELTia``) for each +coord axis. + +If a ``CDi_ja`` linear transformation matrix is present, a warning is +raised and `~astropy.wcs.Wcsprm.cdelt` is ignored. The ``CDi_ja`` +matrix may be deleted by:: + + del wcs.wcs.cd + +An undefined value is represented by NaN. +""" + +cdfix = """ +cdfix() + +Fix erroneously omitted ``CDi_ja`` keywords. + +Sets the diagonal element of the ``CDi_ja`` matrix to unity if all +``CDi_ja`` keywords associated with a given axis were omitted. +According to Paper I, if any ``CDi_ja`` keywords at all are given in a +FITS header then those not given default to zero. This results in a +singular matrix with an intersecting row and column of zeros. + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +cel_offset = """ +``boolean`` Is there an offset? + +If `True`, an offset will be applied to ``(x, y)`` to force ``(x, y) = +(0, 0)`` at the fiducial point, (phi_0, theta_0). Default is `False`. +""" + +celfix = """ +Translates AIPS-convention celestial projection types, ``-NCP`` and +``-GLS``. + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +cname = """ +``list of strings`` A list of the coordinate axis names, from +``CNAMEia``. +""" + +colax = """ +``int array[naxis]`` An array recording the column numbers for each +axis in a pixel list. +""" + +colnum = """ +``int`` Column of FITS binary table associated with this WCS. + +Where the coordinate representation is associated with an image-array +column in a FITS binary table, this property may be used to record the +relevant column number. + +It should be set to zero for an image header or pixel list. +""" + +compare = """ +compare(other, cmp=0, tolerance=0.0) + +Compare two Wcsprm objects for equality. + +Parameters +---------- + +other : Wcsprm + The other Wcsprm object to compare to. + +cmp : int, optional + A bit field controlling the strictness of the comparison. When 0, + (the default), all fields must be identical. + + The following constants may be or'ed together to loosen the + comparison. + + - ``WCSCOMPARE_ANCILLARY``: Ignores ancillary keywords that don't + change the WCS transformation, such as ``DATE-OBS`` or + ``EQUINOX``. + + - ``WCSCOMPARE_TILING``: Ignore integral differences in + ``CRPIXja``. This is the 'tiling' condition, where two WCSes + cover different regions of the same map projection and align on + the same map grid. + + - ``WCSCOMPARE_CRPIX``: Ignore any differences at all in + ``CRPIXja``. The two WCSes cover different regions of the same + map projection but may not align on the same grid map. + Overrides ``WCSCOMPARE_TILING``. + +tolerance : float, optional + The amount of tolerance required. For example, for a value of + 1e-6, all floating-point values in the objects must be equal to + the first 6 decimal places. The default value of 0.0 implies + exact equality. + +Returns +------- +equal : bool +""" + +convert = """ +convert(array) + +Perform the unit conversion on the elements of the given *array*, +returning an array of the same shape. +""" + +coord = """ +``double array[K_M]...[K_2][K_1][M]`` The tabular coordinate array. + +Has the dimensions:: + + (K_M, ... K_2, K_1, M) + +(see `~astropy.wcs.Tabprm.K`) i.e. with the `M` dimension +varying fastest so that the `M` elements of a coordinate vector are +stored contiguously in memory. +""" + +copy = """ +Creates a deep copy of the WCS object. +""" + +cpdis1 = """ +`~astropy.wcs.DistortionLookupTable` + +The pre-linear transformation distortion lookup table, ``CPDIS1``. +""" + +cpdis2 = """ +`~astropy.wcs.DistortionLookupTable` + +The pre-linear transformation distortion lookup table, ``CPDIS2``. +""" + +crder = """ +``double array[naxis]`` The random error in each coordinate axis, +``CRDERia``. + +An undefined value is represented by NaN. +""" + +crota = """ +``double array[naxis]`` ``CROTAia`` keyvalues for each coordinate +axis. + +For historical compatibility, three alternate specifications of the +linear transformations are available in wcslib. The canonical +``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated +``CROTAia`` keywords. Although the latter may not formally co-exist +with ``PCi_ja``, the approach here is simply to ignore them if given +in conjunction with ``PCi_ja``. + +`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and +`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of +these alternatives are present in the header. + +These alternate specifications of the linear transformation matrix are +translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and +are nowhere visible to the lower-level routines. In particular, +`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity +if ``CDi_ja`` is present (and no ``PCi_ja``). If no ``CROTAia`` is +associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts +to a unity ``PCi_ja`` matrix. +""" + +crpix = """ +``double array[naxis]`` Coordinate reference pixels (``CRPIXja``) for +each pixel axis. +""" + +crval = """ +``double array[naxis]`` Coordinate reference values (``CRVALia``) for +each coordinate axis. +""" + +crval_tabprm = """ +``double array[M]`` Index values for the reference pixel for each of +the tabular coord axes. +""" + +csyer = """ +``double array[naxis]`` The systematic error in the coordinate value +axes, ``CSYERia``. + +An undefined value is represented by NaN. +""" + +ctype = """ +``list of strings[naxis]`` List of ``CTYPEia`` keyvalues. + +The `~astropy.wcs.Wcsprm.ctype` keyword values must be in upper case +and there must be zero or one pair of matched celestial axis types, +and zero or one spectral axis. +""" + +cubeface = """ +``int`` Index into the ``pixcrd`` (pixel coordinate) array for the +``CUBEFACE`` axis. + +This is used for quadcube projections where the cube faces are stored +on a separate axis. + +The quadcube projections (``TSC``, ``CSC``, ``QSC``) may be +represented in FITS in either of two ways: + + - The six faces may be laid out in one plane and numbered as + follows:: + + + 0 + + 4 3 2 1 4 3 2 + + 5 + + Faces 2, 3 and 4 may appear on one side or the other (or both). + The world-to-pixel routines map faces 2, 3 and 4 to the left but + the pixel-to-world routines accept them on either side. + + - The ``COBE`` convention in which the six faces are stored in a + three-dimensional structure using a ``CUBEFACE`` axis indexed + from 0 to 5 as above. + +These routines support both methods; `~astropy.wcs.Wcsprm.set` +determines which is being used by the presence or absence of a +``CUBEFACE`` axis in `~astropy.wcs.Wcsprm.ctype`. +`~astropy.wcs.Wcsprm.p2s` and `~astropy.wcs.Wcsprm.s2p` translate the +``CUBEFACE`` axis representation to the single plane representation +understood by the lower-level projection routines. +""" + +cunit = """ +``list of astropy.UnitBase[naxis]`` List of ``CUNITia`` keyvalues as +`astropy.units.UnitBase` instances. + +These define the units of measurement of the ``CRVALia``, ``CDELTia`` +and ``CDi_ja`` keywords. + +As ``CUNITia`` is an optional header keyword, +`~astropy.wcs.Wcsprm.cunit` may be left blank but otherwise is +expected to contain a standard units specification as defined by WCS +Paper I. `~astropy.wcs.Wcsprm.unitfix` is available to translate +commonly used non-standard units specifications but this must be done +as a separate step before invoking `~astropy.wcs.Wcsprm.set`. + +For celestial axes, if `~astropy.wcs.Wcsprm.cunit` is not blank, +`~astropy.wcs.Wcsprm.set` uses ``wcsunits`` to parse it and scale +`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and +`~astropy.wcs.Wcsprm.cd` to decimal degrees. It then resets +`~astropy.wcs.Wcsprm.cunit` to ``"deg"``. + +For spectral axes, if `~astropy.wcs.Wcsprm.cunit` is not blank, +`~astropy.wcs.Wcsprm.set` uses ``wcsunits`` to parse it and scale +`~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, and +`~astropy.wcs.Wcsprm.cd` to SI units. It then resets +`~astropy.wcs.Wcsprm.cunit` accordingly. + +`~astropy.wcs.Wcsprm.set` ignores `~astropy.wcs.Wcsprm.cunit` for +other coordinate types; `~astropy.wcs.Wcsprm.cunit` may be used to +label coordinate values. +""" + +cylfix = """ +cylfix() + +Fixes WCS keyvalues for malformed cylindrical projections. + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +data = """ +``float array`` The array data for the +`~astropy.wcs.DistortionLookupTable`. +""" + +data_wtbarr = """ +``double array`` + +The array data for the BINTABLE. +""" + +dateavg = """ +``string`` Representative mid-point of the date of observation. + +In ISO format, ``yyyy-mm-ddThh:mm:ss``. + +See also +-------- +astropy.wcs.Wcsprm.dateobs +""" + +dateobs = """ +``string`` Start of the date of observation. + +In ISO format, ``yyyy-mm-ddThh:mm:ss``. + +See also +-------- +astropy.wcs.Wcsprm.dateavg +""" + +datfix = """ +datfix() + +Translates the old ``DATE-OBS`` date format to year-2000 standard form +``(yyyy-mm-ddThh:mm:ss)`` and derives ``MJD-OBS`` from it if not +already set. + +Alternatively, if `~astropy.wcs.Wcsprm.mjdobs` is set and +`~astropy.wcs.Wcsprm.dateobs` isn't, then `~astropy.wcs.Wcsprm.datfix` +derives `~astropy.wcs.Wcsprm.dateobs` from it. If both are set but +disagree by more than half a day then `ValueError` is raised. + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +delta = """ +``double array[M]`` (read-only) Interpolated indices into the coord +array. + +Array of interpolated indices into the coordinate array such that +Upsilon_m, as defined in Paper III, is equal to +(`~astropy.wcs.Tabprm.p0` [m] + 1) + delta[m]. +""" + +det2im = """ +Convert detector coordinates to image plane coordinates. +""" + +det2im1 = """ +A `~astropy.wcs.DistortionLookupTable` object for detector to image plane +correction in the *x*-axis. +""" + +det2im2 = """ +A `~astropy.wcs.DistortionLookupTable` object for detector to image plane +correction in the *y*-axis. +""" + +dims = """ +``int array[ndim]`` (read-only) + +The dimensions of the tabular array +`~astropy.wcs.Wtbarr.data`. +""" + +DistortionLookupTable = """ +DistortionLookupTable(*table*, *crpix*, *crval*, *cdelt*) + +Represents a single lookup table for a `distortion paper`_ +transformation. + +Parameters +---------- +table : 2-dimensional array + The distortion lookup table. + +crpix : 2-tuple + The distortion array reference pixel + +crval : 2-tuple + The image array pixel coordinate + +cdelt : 2-tuple + The grid step size +""" + +equinox = """ +``double`` The equinox associated with dynamical equatorial or +ecliptic coordinate systems. + +``EQUINOXa`` (or ``EPOCH`` in older headers). Not applicable to ICRS +equatorial or ecliptic coordinates. + +An undefined value is represented by NaN. +""" + +extlev = """ +``int`` (read-only) + +``EXTLEV`` identifying the binary table extension. +""" + +extnam = """ +``str`` (read-only) + +``EXTNAME`` identifying the binary table extension. +""" + +extrema = """ +``double array[K_M]...[K_2][2][M]`` (read-only) + +An array recording the minimum and maximum value of each element of +the coordinate vector in each row of the coordinate array, with the +dimensions:: + + (K_M, ... K_2, 2, M) + +(see `~astropy.wcs.Tabprm.K`). The minimum is recorded +in the first element of the compressed K_1 dimension, then the +maximum. This array is used by the inverse table lookup function to +speed up table searches. +""" + +extver = """ +``int`` (read-only) + +``EXTVER`` identifying the binary table extension. +""" + +find_all_wcs = """ +find_all_wcs(relax=0, keysel=0) + +Find all WCS transformations in the header. + +Parameters +---------- + +header : str + The raw FITS header data. + +relax : bool or int + Degree of permissiveness: + + - `False`: Recognize only FITS keywords defined by the published + WCS standard. + + - `True`: Admit all recognized informal extensions of the WCS + standard. + + - `int`: a bit field selecting specific extensions to accept. See + :ref:`relaxread` for details. + +keysel : sequence of flags + Used to restrict the keyword types considered: + + - ``WCSHDR_IMGHEAD``: Image header keywords. + + - ``WCSHDR_BIMGARR``: Binary table image array. + + - ``WCSHDR_PIXLIST``: Pixel list keywords. + + If zero, there is no restriction. If -1, `wcspih` is called, + rather than `wcstbh`. + +Returns +------- +wcs_list : list of `~astropy.wcs.Wcsprm` objects +""" + +fix = """ +fix(translate_units='', naxis=0) + +Applies all of the corrections handled separately by +`~astropy.wcs.Wcsprm.datfix`, `~astropy.wcs.Wcsprm.unitfix`, +`~astropy.wcs.Wcsprm.celfix`, `~astropy.wcs.Wcsprm.spcfix`, +`~astropy.wcs.Wcsprm.cylfix` and `~astropy.wcs.Wcsprm.cdfix`. + +Parameters +---------- + +translate_units : str, optional + Specify which potentially unsafe translations of non-standard unit + strings to perform. By default, performs all. + + Although ``"S"`` is commonly used to represent seconds, its + translation to ``"s"`` is potentially unsafe since the standard + recognizes ``"S"`` formally as Siemens, however rarely that may be + used. The same applies to ``"H"`` for hours (Henry), and ``"D"`` + for days (Debye). + + This string controls what to do in such cases, and is + case-insensitive. + + - If the string contains ``"s"``, translate ``"S"`` to ``"s"``. + + - If the string contains ``"h"``, translate ``"H"`` to ``"h"``. + + - If the string contains ``"d"``, translate ``"D"`` to ``"d"``. + + Thus ``''`` doesn't do any unsafe translations, whereas ``'shd'`` + does all of them. + +naxis : int array[naxis], optional + Image axis lengths. If this array is set to zero or ``None``, + then `~astropy.wcs.Wcsprm.cylfix` will not be invoked. + +Returns +------- +status : dict + + Returns a dictionary containing the following keys, each referring + to a status string for each of the sub-fix functions that were + called: + + - `~astropy.wcs.Wcsprm.cdfix` + + - `~astropy.wcs.Wcsprm.datfix` + + - `~astropy.wcs.Wcsprm.unitfix` + + - `~astropy.wcs.Wcsprm.celfix` + + - `~astropy.wcs.Wcsprm.spcfix` + + - `~astropy.wcs.Wcsprm.cylfix` +""" + +get_offset = """ +get_offset(x, y) -> (x, y) + +Returns the offset as defined in the distortion lookup table. + +Returns +------- +coordinate : coordinate pair + The offset from the distortion table for pixel point (*x*, *y*). +""" + +get_cdelt = """ +get_cdelt() -> double array[naxis] + +Coordinate increments (``CDELTia``) for each coord axis. + +Returns the ``CDELT`` offsets in read-only form. Unlike the +`~astropy.wcs.Wcsprm.cdelt` property, this works even when the header +specifies the linear transformation matrix in one of the alternative +``CDi_ja`` or ``CROTAia`` forms. This is useful when you want access +to the linear transformation matrix, but don't care how it was +specified in the header. +""" + +get_pc = """ +get_pc() -> double array[naxis][naxis] + +Returns the ``PC`` matrix in read-only form. Unlike the +`~astropy.wcs.Wcsprm.pc` property, this works even when the header +specifies the linear transformation matrix in one of the alternative +``CDi_ja`` or ``CROTAia`` forms. This is useful when you want access +to the linear transformation matrix, but don't care how it was +specified in the header. +""" + +get_ps = """ +get_ps() -> list of tuples + +Returns ``PSi_ma`` keywords for each *i* and *m*. + +Returns +------- +ps : list of tuples + + Returned as a list of tuples of the form (*i*, *m*, *value*): + + - *i*: int. Axis number, as in ``PSi_ma``, (i.e. 1-relative) + + - *m*: int. Parameter number, as in ``PSi_ma``, (i.e. 0-relative) + + - *value*: string. Parameter value. + +See also +-------- +astropy.wcs.Wcsprm.set_ps : Set ``PSi_ma`` values +""" + +get_pv = """ +get_pv() -> list of tuples + +Returns ``PVi_ma`` keywords for each *i* and *m*. + +Returns +------- + + Returned as a list of tuples of the form (*i*, *m*, *value*): + + - *i*: int. Axis number, as in ``PVi_ma``, (i.e. 1-relative) + + - *m*: int. Parameter number, as in ``PVi_ma``, (i.e. 0-relative) + + - *value*: string. Parameter value. + +See also +-------- +astropy.wcs.Wcsprm.set_pv : Set ``PVi_ma`` values + +Notes +----- + +Note that, if they were not given, `~astropy.wcs.Wcsprm.set` resets +the entries for ``PVi_1a``, ``PVi_2a``, ``PVi_3a``, and ``PVi_4a`` for +longitude axis *i* to match (``phi_0``, ``theta_0``), the native +longitude and latitude of the reference point given by ``LONPOLEa`` +and ``LATPOLEa``. +""" + +has_cd = """ +has_cd() -> bool + +Returns `True` if ``CDi_ja`` is present. + +``CDi_ja`` is an alternate specification of the linear transformation +matrix, maintained for historical compatibility. + +Matrix elements in the IRAF convention are equivalent to the product +``CDi_ja = CDELTia * PCi_ja``, but the defaults differ from that of +the ``PCi_ja`` matrix. If one or more ``CDi_ja`` keywords are present +then all unspecified ``CDi_ja`` default to zero. If no ``CDi_ja`` (or +``CROTAia``) keywords are present, then the header is assumed to be in +``PCi_ja`` form whether or not any ``PCi_ja`` keywords are present +since this results in an interpretation of ``CDELTia`` consistent with +the original FITS specification. + +While ``CDi_ja`` may not formally co-exist with ``PCi_ja``, it may +co-exist with ``CDELTia`` and ``CROTAia`` which are to be ignored. + +See also +-------- +astropy.wcs.Wcsprm.cd : Get the raw ``CDi_ja`` values. +""" + +has_cdi_ja = """ +has_cdi_ja() -> bool + +Alias for `~astropy.wcs.Wcsprm.has_cd`. Maintained for backward +compatibility. +""" + +has_crota = """ +has_crota() -> bool + +Returns `True` if ``CROTAia`` is present. + +``CROTAia`` is an alternate specification of the linear transformation +matrix, maintained for historical compatibility. + +In the AIPS convention, ``CROTAia`` may only be associated with the +latitude axis of a celestial axis pair. It specifies a rotation in +the image plane that is applied *after* the ``CDELTia``; any other +``CROTAia`` keywords are ignored. + +``CROTAia`` may not formally co-exist with ``PCi_ja``. ``CROTAia`` and +``CDELTia`` may formally co-exist with ``CDi_ja`` but if so are to be +ignored. + +See also +-------- +astropy.wcs.Wcsprm.crota : Get the raw ``CROTAia`` values +""" + +has_crotaia = """ +has_crotaia() -> bool + +Alias for `~astropy.wcs.Wcsprm.has_crota`. Maintained for backward +compatibility. +""" + +has_pc = """ +has_pc() -> bool + +Returns `True` if ``PCi_ja`` is present. ``PCi_ja`` is the +recommended way to specify the linear transformation matrix. + +See also +-------- +astropy.wcs.Wcsprm.pc : Get the raw ``PCi_ja`` values +""" + +has_pci_ja = """ +has_pci_ja() -> bool + +Alias for `~astropy.wcs.Wcsprm.has_pc`. Maintained for backward +compatibility. +""" + +i = """ +``int`` (read-only) + +Image axis number. +""" + +imgpix_matrix = """ +``double array[2][2]`` (read-only) Inverse of the ``CDELT`` or ``PC`` +matrix. + +Inverse containing the product of the ``CDELTia`` diagonal matrix and +the ``PCi_ja`` matrix. +""" + +is_unity = """ +is_unity() -> bool + +Returns `True` if the linear transformation matrix +(`~astropy.wcs.Wcsprm.cd`) is unity. +""" + +K = """ +``int array[M]`` (read-only) The lengths of the axes of the coordinate +array. + +An array of length `M` whose elements record the lengths of the axes of +the coordinate array and of each indexing vector. +""" + +kind = """ +``str`` (read-only) + +Character identifying the wcstab array type: + + - ``'c'``: coordinate array, + - ``'i'``: index vector. +""" + +lat = """ +``int`` (read-only) The index into the world coord array containing +latitude values. +""" + +latpole = """ +``double`` The native latitude of the celestial pole, ``LATPOLEa`` (deg). +""" + +lattyp = """ +``string`` (read-only) Celestial axis type for latitude. + +For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--", +"DEC-", "GLON", "GLAT", etc. in the first four characters of +``CTYPEia`` but with trailing dashes removed. +""" + +lng = """ +``int`` (read-only) The index into the world coord array containing +longitude values. +""" + +lngtyp = """ +``string`` (read-only) Celestial axis type for longitude. + +For example, "RA", "DEC", "GLON", "GLAT", etc. extracted from "RA--", +"DEC-", "GLON", "GLAT", etc. in the first four characters of +``CTYPEia`` but with trailing dashes removed. +""" + +lonpole = """ +``double`` The native longitude of the celestial pole. + +``LONPOLEa`` (deg). +""" + +M = """ +``int`` (read-only) Number of tabular coordinate axes. +""" + +m = """ +``int`` (read-only) + +Array axis number for index vectors. +""" + +map = """ +``int array[M]`` Association between axes. + +A vector of length `~astropy.wcs.Tabprm.M` that defines +the association between axis *m* in the *M*-dimensional coordinate +array (1 <= *m* <= *M*) and the indices of the intermediate world +coordinate and world coordinate arrays. + +When the intermediate and world coordinate arrays contain the full +complement of coordinate elements in image-order, as will usually be +the case, then ``map[m-1] == i-1`` for axis *i* in the *N*-dimensional +image (1 <= *i* <= *N*). In terms of the FITS keywords:: + + map[PVi_3a - 1] == i - 1. + +However, a different association may result if the intermediate +coordinates, for example, only contains a (relevant) subset of +intermediate world coordinate elements. For example, if *M* == 1 for +an image with *N* > 1, it is possible to fill the intermediate +coordinates with the relevant coordinate element with ``nelem`` set to +1. In this case ``map[0] = 0`` regardless of the value of *i*. +""" + +mix = """ +mix(mixpix, mixcel, vspan, vstep, viter, world, pixcrd, origin) + +Given either the celestial longitude or latitude plus an element of +the pixel coordinate, solves for the remaining elements by iterating +on the unknown celestial coordinate element using +`~astropy.wcs.Wcsprm.s2p`. + +Parameters +---------- +mixpix : int + Which element on the pixel coordinate is given. + +mixcel : int + Which element of the celestial coordinate is given. If *mixcel* = + ``1``, celestial longitude is given in ``world[self.lng]``, + latitude returned in ``world[self.lat]``. If *mixcel* = ``2``, + celestial latitude is given in ``world[self.lat]``, longitude + returned in ``world[self.lng]``. + +vspan : pair of floats + Solution interval for the celestial coordinate, in degrees. The + ordering of the two limits is irrelevant. Longitude ranges may be + specified with any convenient normalization, for example + ``(-120,+120)`` is the same as ``(240,480)``, except that the + solution will be returned with the same normalization, i.e. lie + within the interval specified. + +vstep : float + Step size for solution search, in degrees. If ``0``, a sensible, + although perhaps non-optimal default will be used. + +viter : int + If a solution is not found then the step size will be halved and + the search recommenced. *viter* controls how many times the step + size is halved. The allowed range is 5 - 10. + +world : double array[naxis] + World coordinate elements. ``world[self.lng]`` and + ``world[self.lat]`` are the celestial longitude and latitude, in + degrees. Which is given and which returned depends on the value + of *mixcel*. All other elements are given. The results will be + written to this array in-place. + +pixcrd : double array[naxis]. + Pixel coordinates. The element indicated by *mixpix* is given and + the remaining elements will be written in-place. + +{0} + +Returns +------- +result : dict + + Returns a dictionary with the following keys: + + - *phi* (double array[naxis]) + + - *theta* (double array[naxis]) + + - Longitude and latitude in the native coordinate system of + the projection, in degrees. + + - *imgcrd* (double array[naxis]) + + - Image coordinate elements. ``imgcrd[self.lng]`` and + ``imgcrd[self.lat]`` are the projected *x*- and + *y*-coordinates, in decimal degrees. + + - *world* (double array[naxis]) + + - Another reference to the *world* argument passed in. + +Raises +------ +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +InvalidTransformError + Invalid coordinate transformation parameters. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. + +InvalidCoordinateError + Invalid world coordinate. + +NoSolutionError + No solution found in the specified interval. + +See also +-------- +astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng + Get the axes numbers for latitude and longitude + +Notes +----- + +Initially, the specified solution interval is checked to see if it's a +\"crossing\" interval. If it isn't, a search is made for a crossing +solution by iterating on the unknown celestial coordinate starting at +the upper limit of the solution interval and decrementing by the +specified step size. A crossing is indicated if the trial value of +the pixel coordinate steps through the value specified. If a crossing +interval is found then the solution is determined by a modified form +of \"regula falsi\" division of the crossing interval. If no crossing +interval was found within the specified solution interval then a +search is made for a \"non-crossing\" solution as may arise from a +point of tangency. The process is complicated by having to make +allowance for the discontinuities that occur in all map projections. + +Once one solution has been determined others may be found by +subsequent invocations of `~astropy.wcs.Wcsprm.mix` with suitably +restricted solution intervals. + +Note the circumstance that arises when the solution point lies at a +native pole of a projection in which the pole is represented as a +finite curve, for example the zenithals and conics. In such cases two +or more valid solutions may exist but `~astropy.wcs.Wcsprm.mix` only +ever returns one. + +Because of its generality, `~astropy.wcs.Wcsprm.mix` is very +compute-intensive. For compute-limited applications, more efficient +special-case solvers could be written for simple projections, for +example non-oblique cylindrical projections. +""".format(ORIGIN()) + +mjdavg = """ +``double`` Modified Julian Date corresponding to ``DATE-AVG``. + +``(MJD = JD - 2400000.5)``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.mjdobs +""" + +mjdobs = """ +``double`` Modified Julian Date corresponding to ``DATE-OBS``. + +``(MJD = JD - 2400000.5)``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.mjdavg +""" + +name = """ +``string`` The name given to the coordinate representation +``WCSNAMEa``. +""" + +naxis = """ +``int`` (read-only) The number of axes (pixel and coordinate). + +Given by the ``NAXIS`` or ``WCSAXESa`` keyvalues. + +The number of coordinate axes is determined at parsing time, and can +not be subsequently changed. + +It is determined from the highest of the following: + + 1. ``NAXIS`` + + 2. ``WCSAXESa`` + + 3. The highest axis number in any parameterized WCS keyword. The + keyvalue, as well as the keyword, must be syntactically valid + otherwise it will not be considered. + +If none of these keyword types is present, i.e. if the header only +contains auxiliary WCS keywords for a particular coordinate +representation, then no coordinate description is constructed for it. + +This value may differ for different coordinate representations of the +same image. +""" + +nc = """ +``int`` (read-only) Total number of coord vectors in the coord array. + +Total number of coordinate vectors in the coordinate array being the +product K_1 * K_2 * ... * K_M. +""" + +ndim = """ +``int`` (read-only) + +Expected dimensionality of the wcstab array. +""" + +obsgeo = """ +``double array[3]`` Location of the observer in a standard terrestrial +reference frame. + +``OBSGEO-X``, ``OBSGEO-Y``, ``OBSGEO-Z`` (in meters). + +An undefined value is represented by NaN. +""" + +p0 = """ +``int array[M]`` Interpolated indices into the coordinate array. + +Vector of length `~astropy.wcs.Tabprm.M` of interpolated +indices into the coordinate array such that Upsilon_m, as defined in +Paper III, is equal to ``(p0[m] + 1) + delta[m]``. +""" + +p2s = """ +p2s(pixcrd, origin) + +Converts pixel to world coordinates. + +Parameters +---------- + +pixcrd : double array[ncoord][nelem] + Array of pixel coordinates. + +{0} + +Returns +------- +result : dict + Returns a dictionary with the following keys: + + - *imgcrd*: double array[ncoord][nelem] + + - Array of intermediate world coordinates. For celestial axes, + ``imgcrd[][self.lng]`` and ``imgcrd[][self.lat]`` are the + projected *x*-, and *y*-coordinates, in pseudo degrees. For + spectral axes, ``imgcrd[][self.spec]`` is the intermediate + spectral coordinate, in SI units. + + - *phi*: double array[ncoord] + + - *theta*: double array[ncoord] + + - Longitude and latitude in the native coordinate system of the + projection, in degrees. + + - *world*: double array[ncoord][nelem] + + - Array of world coordinates. For celestial axes, + ``world[][self.lng]`` and ``world[][self.lat]`` are the + celestial longitude and latitude, in degrees. For spectral + axes, ``world[][self.spec]`` is the intermediate spectral + coordinate, in SI units. + + - *stat*: int array[ncoord] + + - Status return value for each coordinate. ``0`` for success, + ``1+`` for invalid pixel coordinate. + +Raises +------ + +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +ValueError + *x*- and *y*-coordinate arrays are not the same size. + +InvalidTransformError + Invalid coordinate transformation parameters. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. + +See also +-------- +astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng + Definition of the latitude and longitude axes +""".format(ORIGIN()) + +p4_pix2foc = """ +p4_pix2foc(*pixcrd, origin*) -> double array[ncoord][nelem] + +Convert pixel coordinates to focal plane coordinates using `distortion +paper`_ lookup-table correction. + +Parameters +---------- +pixcrd : double array[ncoord][nelem]. + Array of pixel coordinates. + +{0} + +Returns +------- +foccrd : double array[ncoord][nelem] + Returns an array of focal plane coordinates. + +Raises +------ +MemoryError + Memory allocation failed. + +ValueError + Invalid coordinate transformation parameters. +""".format(ORIGIN()) + +pc = """ +``double array[naxis][naxis]`` The ``PCi_ja`` (pixel coordinate) +transformation matrix. + +The order is:: + + [[PC1_1, PC1_2], + [PC2_1, PC2_2]] + +For historical compatibility, three alternate specifications of the +linear transformations are available in wcslib. The canonical +``PCi_ja`` with ``CDELTia``, ``CDi_ja``, and the deprecated +``CROTAia`` keywords. Although the latter may not formally co-exist +with ``PCi_ja``, the approach here is simply to ignore them if given +in conjunction with ``PCi_ja``. + +`~astropy.wcs.Wcsprm.has_pc`, `~astropy.wcs.Wcsprm.has_cd` and +`~astropy.wcs.Wcsprm.has_crota` can be used to determine which of +these alternatives are present in the header. + +These alternate specifications of the linear transformation matrix are +translated immediately to ``PCi_ja`` by `~astropy.wcs.Wcsprm.set` and +are nowhere visible to the lower-level routines. In particular, +`~astropy.wcs.Wcsprm.set` resets `~astropy.wcs.Wcsprm.cdelt` to unity +if ``CDi_ja`` is present (and no ``PCi_ja``). If no ``CROTAia`` is +associated with the latitude axis, `~astropy.wcs.Wcsprm.set` reverts +to a unity ``PCi_ja`` matrix. +""" + +phi0 = """ +``double`` The native latitude of the fiducial point. + +The point whose celestial coordinates are given in ``ref[1:2]``. If +undefined (NaN) the initialization routine, `~astropy.wcs.Wcsprm.set`, +will set this to a projection-specific default. + +See also +-------- +astropy.wcs.Wcsprm.theta0 +""" + +pix2foc = """ +pix2foc(*pixcrd, origin*) -> double array[ncoord][nelem] + +Perform both `SIP`_ polynomial and `distortion paper`_ lookup-table +correction in parallel. + +Parameters +---------- +pixcrd : double array[ncoord][nelem] + Array of pixel coordinates. + +{0} + +Returns +------- +foccrd : double array[ncoord][nelem] + Returns an array of focal plane coordinates. + +Raises +------ +MemoryError + Memory allocation failed. + +ValueError + Invalid coordinate transformation parameters. +""".format(ORIGIN()) + +piximg_matrix = """ +``double array[2][2]`` (read-only) Matrix containing the product of +the ``CDELTia`` diagonal matrix and the ``PCi_ja`` matrix. +""" + +print_contents = """ +print_contents() + +Print the contents of the `~astropy.wcs.Wcsprm` object to stdout. +Probably only useful for debugging purposes, and may be removed in the +future. + +To get a string of the contents, use `repr`. +""" + +print_contents_tabprm = """ +print_contents() + +Print the contents of the `~astropy.wcs.Tabprm` object to +stdout. Probably only useful for debugging purposes, and may be +removed in the future. + +To get a string of the contents, use `repr`. +""" + +radesys = """ +``string`` The equatorial or ecliptic coordinate system type, +``RADESYSa``. +""" + +restfrq = """ +``double`` Rest frequency (Hz) from ``RESTFRQa``. + +An undefined value is represented by NaN. +""" + +restwav = """ +``double`` Rest wavelength (m) from ``RESTWAVa``. + +An undefined value is represented by NaN. +""" + +row = """ +``int`` (read-only) + +Table row number. +""" + +s2p = """ +s2p(world, origin) + +Transforms world coordinates to pixel coordinates. + +Parameters +---------- +world : double array[ncoord][nelem] + Array of world coordinates, in decimal degrees. + +{0} + +Returns +------- +result : dict + Returns a dictionary with the following keys: + + - *phi*: double array[ncoord] + + - *theta*: double array[ncoord] + + - Longitude and latitude in the native coordinate system of + the projection, in degrees. + + - *imgcrd*: double array[ncoord][nelem] + + - Array of intermediate world coordinates. For celestial axes, + ``imgcrd[][self.lng]`` and ``imgcrd[][self.lat]`` are the + projected *x*-, and *y*-coordinates, in pseudo \"degrees\". + For quadcube projections with a ``CUBEFACE`` axis, the face + number is also returned in ``imgcrd[][self.cubeface]``. For + spectral axes, ``imgcrd[][self.spec]`` is the intermediate + spectral coordinate, in SI units. + + - *pixcrd*: double array[ncoord][nelem] + + - Array of pixel coordinates. Pixel coordinates are + zero-based. + + - *stat*: int array[ncoord] + + - Status return value for each coordinate. ``0`` for success, + ``1+`` for invalid pixel coordinate. + +Raises +------ +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +InvalidTransformError + Invalid coordinate transformation parameters. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. + +See also +-------- +astropy.wcs.Wcsprm.lat, astropy.wcs.Wcsprm.lng + Definition of the latitude and longitude axes +""".format(ORIGIN()) + +sense = """ +``int array[M]`` +1 if monotonically increasing, -1 if decreasing. + +A vector of length `~astropy.wcs.Tabprm.M` whose elements +indicate whether the corresponding indexing vector is monotonically +increasing (+1), or decreasing (-1). +""" + +set = """ +set() + +Sets up a WCS object for use according to information supplied within +it. + +Note that this routine need not be called directly; it will be invoked +by `~astropy.wcs.Wcsprm.p2s` and `~astropy.wcs.Wcsprm.s2p` if +necessary. + +Some attributes that are based on other attributes (such as +`~astropy.wcs.Wcsprm.lattyp` on `~astropy.wcs.Wcsprm.ctype`) may not +be correct until after `~astropy.wcs.Wcsprm.set` is called. + +`~astropy.wcs.Wcsprm.set` strips off trailing blanks in all string +members. + +`~astropy.wcs.Wcsprm.set` recognizes the ``NCP`` projection and +converts it to the equivalent ``SIN`` projection and it also +recognizes ``GLS`` as a synonym for ``SFL``. It does alias +translation for the AIPS spectral types (``FREQ-LSR``, ``FELO-HEL``, +etc.) but without changing the input header keywords. + +Raises +------ +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +InvalidTransformError + Invalid coordinate transformation parameters. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. +""" + +set_tabprm = """ +set() + +Allocates memory for work arrays. + +Also sets up the class according to information supplied within it. + +Note that this routine need not be called directly; it will be invoked +by functions that need it. + +Raises +------ +MemoryError + Memory allocation failed. + +InvalidTabularParameters + Invalid tabular parameters. +""" + +set_ps = """ +set_ps(ps) + +Sets ``PSi_ma`` keywords for each *i* and *m*. + +Parameters +---------- +ps : sequence of tuples + + The input must be a sequence of tuples of the form (*i*, *m*, + *value*): + + - *i*: int. Axis number, as in ``PSi_ma``, (i.e. 1-relative) + + - *m*: int. Parameter number, as in ``PSi_ma``, (i.e. 0-relative) + + - *value*: string. Parameter value. + +See also +-------- +astropy.wcs.Wcsprm.get_ps +""" + +set_pv = """ +set_pv(pv) + +Sets ``PVi_ma`` keywords for each *i* and *m*. + +Parameters +---------- +pv : list of tuples + + The input must be a sequence of tuples of the form (*i*, *m*, + *value*): + + - *i*: int. Axis number, as in ``PVi_ma``, (i.e. 1-relative) + + - *m*: int. Parameter number, as in ``PVi_ma``, (i.e. 0-relative) + + - *value*: float. Parameter value. + +See also +-------- +astropy.wcs.Wcsprm.get_pv +""" + +sip = """ +Get/set the `~astropy.wcs.Sip` object for performing `SIP`_ distortion +correction. +""" + +Sip = """ +Sip(*a, b, ap, bp, crpix*) + +The `~astropy.wcs.Sip` class performs polynomial distortion correction +using the `SIP`_ convention in both directions. + +Parameters +---------- +a : double array[m+1][m+1] + The ``A_i_j`` polynomial for pixel to focal plane transformation. + Its size must be (*m* + 1, *m* + 1) where *m* = ``A_ORDER``. + +b : double array[m+1][m+1] + The ``B_i_j`` polynomial for pixel to focal plane transformation. + Its size must be (*m* + 1, *m* + 1) where *m* = ``B_ORDER``. + +ap : double array[m+1][m+1] + The ``AP_i_j`` polynomial for pixel to focal plane transformation. + Its size must be (*m* + 1, *m* + 1) where *m* = ``AP_ORDER``. + +bp : double array[m+1][m+1] + The ``BP_i_j`` polynomial for pixel to focal plane transformation. + Its size must be (*m* + 1, *m* + 1) where *m* = ``BP_ORDER``. + +crpix : double array[2] + The reference pixel. + +Notes +----- +Shupe, D. L., M. Moshir, J. Li, D. Makovoz and R. Narron. 2005. +"The SIP Convention for Representing Distortion in FITS Image +Headers." ADASS XIV. +""" + +sip_foc2pix = """ +sip_foc2pix(*foccrd, origin*) -> double array[ncoord][nelem] + +Convert focal plane coordinates to pixel coordinates using the `SIP`_ +polynomial distortion convention. + +Parameters +---------- +foccrd : double array[ncoord][nelem] + Array of focal plane coordinates. + +{0} + +Returns +------- +pixcrd : double array[ncoord][nelem] + Returns an array of pixel coordinates. + +Raises +------ +MemoryError + Memory allocation failed. + +ValueError + Invalid coordinate transformation parameters. +""".format(ORIGIN()) + +sip_pix2foc = """ +sip_pix2foc(*pixcrd, origin*) -> double array[ncoord][nelem] + +Convert pixel coordinates to focal plane coordinates using the `SIP`_ +polynomial distortion convention. + +Parameters +---------- +pixcrd : double array[ncoord][nelem] + Array of pixel coordinates. + +{0} + +Returns +------- +foccrd : double array[ncoord][nelem] + Returns an array of focal plane coordinates. + +Raises +------ +MemoryError + Memory allocation failed. + +ValueError + Invalid coordinate transformation parameters. +""".format(ORIGIN()) + +spcfix = """ +spcfix() -> int + +Translates AIPS-convention spectral coordinate types. {``FREQ``, +``VELO``, ``FELO``}-{``OBS``, ``HEL``, ``LSR``} (e.g. ``FREQ-LSR``, +``VELO-OBS``, ``FELO-HEL``) + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +spec = """ +``int`` (read-only) The index containing the spectral axis values. +""" + +specsys = """ +``string`` Spectral reference frame (standard of rest), ``SPECSYSa``. + +See also +-------- +astropy.wcs.Wcsprm.ssysobs, astropy.wcs.Wcsprm.velosys +""" + +sptr = """ +sptr(ctype, i=-1) + +Translates the spectral axis in a WCS object. + +For example, a ``FREQ`` axis may be translated into ``ZOPT-F2W`` and +vice versa. + +Parameters +---------- +ctype : str + Required spectral ``CTYPEia``, maximum of 8 characters. The first + four characters are required to be given and are never modified. + The remaining four, the algorithm code, are completely determined + by, and must be consistent with, the first four characters. + Wildcarding may be used, i.e. if the final three characters are + specified as ``\"???\"``, or if just the eighth character is + specified as ``\"?\"``, the correct algorithm code will be + substituted and returned. + +i : int + Index of the spectral axis (0-relative). If ``i < 0`` (or not + provided), it will be set to the first spectral axis identified + from the ``CTYPE`` keyvalues in the FITS header. + +Raises +------ +MemoryError + Memory allocation failed. + +SingularMatrixError + Linear transformation matrix is singular. + +InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + +ValueError + Invalid parameter value. + +InvalidTransformError + Invalid coordinate transformation parameters. + +InvalidTransformError + Ill-conditioned coordinate transformation parameters. + +InvalidSubimageSpecificationError + Invalid subimage specification (no spectral axis). +""" + +ssysobs = """ +``string`` Spectral reference frame. + +The spectral reference frame in which there is no differential +variation in the spectral coordinate across the field-of-view, +``SSYSOBSa``. + +See also +-------- +astropy.wcs.Wcsprm.specsys, astropy.wcs.Wcsprm.velosys +""" + +ssyssrc = """ +``string`` Spectral reference frame for redshift. + +The spectral reference frame (standard of rest) in which the redshift +was measured, ``SSYSSRCa``. +""" + +sub = """ +sub(axes) + +Extracts the coordinate description for a subimage from a +`~astropy.wcs.WCS` object. + +The world coordinate system of the subimage must be separable in the +sense that the world coordinates at any point in the subimage must +depend only on the pixel coordinates of the axes extracted. In +practice, this means that the ``PCi_ja`` matrix of the original image +must not contain non-zero off-diagonal terms that associate any of the +subimage axes with any of the non-subimage axes. + +`sub` can also add axes to a wcsprm object. The new axes will be +created using the defaults set by the Wcsprm constructor which produce +a simple, unnamed, linear axis with world coordinates equal to the +pixel coordinate. These default values can be changed before +invoking `set`. + +Parameters +---------- +axes : int or a sequence. + + - If an int, include the first *N* axes in their original order. + + - If a sequence, may contain a combination of image axis numbers + (1-relative) or special axis identifiers (see below). Order is + significant; ``axes[0]`` is the axis number of the input image + that corresponds to the first axis in the subimage, etc. Use an + axis number of 0 to create a new axis using the defaults. + + - If ``0``, ``[]`` or ``None``, do a deep copy. + + Coordinate axes types may be specified using either strings or + special integer constants. The available types are: + + - ``'longitude'`` / ``WCSSUB_LONGITUDE``: Celestial longitude + + - ``'latitude'`` / ``WCSSUB_LATITUDE``: Celestial latitude + + - ``'cubeface'`` / ``WCSSUB_CUBEFACE``: Quadcube ``CUBEFACE`` axis + + - ``'spectral'`` / ``WCSSUB_SPECTRAL``: Spectral axis + + - ``'stokes'`` / ``WCSSUB_STOKES``: Stokes axis + + - ``'celestial'`` / ``WCSSUB_CELESTIAL``: An alias for the + combination of ``'longitude'``, ``'latitude'`` and ``'cubeface'``. + +Returns +------- +new_wcs : `~astropy.wcs.WCS` object + +Raises +------ +MemoryError + Memory allocation failed. + +InvalidSubimageSpecificationError + Invalid subimage specification (no spectral axis). + +NonseparableSubimageCoordinateSystem + Non-separable subimage coordinate system. + +Notes +----- +Combinations of subimage axes of particular types may be extracted in +the same order as they occur in the input image by combining the +integer constants with the 'binary or' (``|``) operator. For +example:: + + wcs.sub([WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_SPECTRAL]) + +would extract the longitude, latitude, and spectral axes in the same +order as the input image. If one of each were present, the resulting +object would have three dimensions. + +For convenience, ``WCSSUB_CELESTIAL`` is defined as the combination +``WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_CUBEFACE``. + +The codes may also be negated to extract all but the types specified, +for example:: + + wcs.sub([ + WCSSUB_LONGITUDE, + WCSSUB_LATITUDE, + WCSSUB_CUBEFACE, + -(WCSSUB_SPECTRAL | WCSSUB_STOKES)]) + +The last of these specifies all axis types other than spectral or +Stokes. Extraction is done in the order specified by ``axes``, i.e. a +longitude axis (if present) would be extracted first (via ``axes[0]``) +and not subsequently (via ``axes[3]``). Likewise for the latitude and +cubeface axes in this example. + +The number of dimensions in the returned object may be less than or +greater than the length of ``axes``. However, it will never exceed the +number of axes in the input image. +""" + +tab = """ +``list of Tabprm`` Tabular coordinate objects. + +A list of tabular coordinate objects associated with this WCS. +""" + +Tabprm = """ +A class to store the information related to tabular coordinates, +i.e., coordinates that are defined via a lookup table. + +This class can not be constructed directly from Python, but instead is +returned from `~astropy.wcs.Wcsprm.tab`. +""" + +theta0 = """ +``double`` The native longitude of the fiducial point. + +The point whose celestial coordinates are given in ``ref[1:2]``. If +undefined (NaN) the initialization routine, `~astropy.wcs.Wcsprm.set`, +will set this to a projection-specific default. + +See also +-------- +astropy.wcs.Wcsprm.phi0 +""" + +to_header = """ +to_header(relax=False) + +`to_header` translates a WCS object into a FITS header. + +The details of the header depends on context: + + - If the `~astropy.wcs.Wcsprm.colnum` member is non-zero then a + binary table image array header will be produced. + + - Otherwise, if the `~astropy.wcs.Wcsprm.colax` member is set + non-zero then a pixel list header will be produced. + + - Otherwise, a primary image or image extension header will be + produced. + +The output header will almost certainly differ from the input in a +number of respects: + + 1. The output header only contains WCS-related keywords. In + particular, it does not contain syntactically-required keywords + such as ``SIMPLE``, ``NAXIS``, ``BITPIX``, or ``END``. + + 2. Deprecated (e.g. ``CROTAn``) or non-standard usage will be + translated to standard (this is partially dependent on whether + ``fix`` was applied). + + 3. Quantities will be converted to the units used internally, + basically SI with the addition of degrees. + + 4. Floating-point quantities may be given to a different decimal + precision. + + 5. Elements of the ``PCi_j`` matrix will be written if and only if + they differ from the unit matrix. Thus, if the matrix is unity + then no elements will be written. + + 6. Additional keywords such as ``WCSAXES``, ``CUNITia``, + ``LONPOLEa`` and ``LATPOLEa`` may appear. + + 7. The original keycomments will be lost, although + `~astropy.wcs.Wcsprm.to_header` tries hard to write meaningful + comments. + + 8. Keyword order may be changed. + +Keywords can be translated between the image array, binary table, and +pixel lists forms by manipulating the `~astropy.wcs.Wcsprm.colnum` or +`~astropy.wcs.Wcsprm.colax` members of the `~astropy.wcs.WCS` +object. + +Parameters +---------- + +relax : bool or int + Degree of permissiveness: + + - `False`: Recognize only FITS keywords defined by the published + WCS standard. + + - `True`: Admit all recognized informal extensions of the WCS + standard. + + - `int`: a bit field selecting specific extensions to write. + See :ref:`relaxwrite` for details. + +Returns +------- +header : str + Raw FITS header as a string. +""" + +ttype = """ +``str`` (read-only) + +``TTYPEn`` identifying the column of the binary table that contains +the wcstab array. +""" + +unitfix = """ +unitfix(translate_units='') + +Translates non-standard ``CUNITia`` keyvalues. + +For example, ``DEG`` -> ``deg``, also stripping off unnecessary +whitespace. + +Parameters +---------- +translate_units : str, optional + Do potentially unsafe translations of non-standard unit strings. + + Although ``\"S\"`` is commonly used to represent seconds, its + recognizes ``\"S\"`` formally as Siemens, however rarely that may + be translation to ``\"s\"`` is potentially unsafe since the + standard used. The same applies to ``\"H\"`` for hours (Henry), + and ``\"D\"`` for days (Debye). + + This string controls what to do in such cases, and is + case-insensitive. + + - If the string contains ``\"s\"``, translate ``\"S\"`` to ``\"s\"``. + + - If the string contains ``\"h\"``, translate ``\"H\"`` to ``\"h\"``. + + - If the string contains ``\"d\"``, translate ``\"D\"`` to ``\"d\"``. + + Thus ``''`` doesn't do any unsafe translations, whereas ``'shd'`` + does all of them. + +Returns +------- +success : int + Returns ``0`` for success; ``-1`` if no change required. +""" + +velangl = """ +``double`` Velocity angle. + +The angle in degrees that should be used to decompose an observed +velocity into radial and transverse components. + +An undefined value is represented by NaN. +""" + +velosys = """ +``double`` Relative radial velocity. + +The relative radial velocity (m/s) between the observer and the +selected standard of rest in the direction of the celestial reference +coordinate, ``VELOSYSa``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.specsys, astropy.wcs.Wcsprm.ssysobs +""" + +velref = """ +``int`` AIPS velocity code. + +From ``VELREF`` keyword. +""" + +wcs = """ +A `~astropy.wcs.Wcsprm` object to perform the basic `wcslib`_ WCS +transformation. +""" + +Wcs = """ +Wcs(*sip, cpdis, wcsprm, det2im*) + +Wcs objects amalgamate basic WCS (as provided by `wcslib`_), with +`SIP`_ and `distortion paper`_ operations. + +To perform all distortion corrections and WCS transformation, use +``all_pix2world``. + +Parameters +---------- +sip : `~astropy.wcs.Sip` object or `None` + +cpdis : A pair of `~astropy.wcs.DistortionLookupTable` objects, or + ``(None, None)``. + +wcsprm : `~astropy.wcs.Wcsprm` object + +det2im : A pair of `~astropy.wcs.DistortionLookupTable` objects, or + ``(None, None)``. +""" + +Wcsprm = """ +Wcsprm(header=None, key=' ', relax=False, naxis=2, keysel=0, colsel=None) + +`~astropy.wcs.Wcsprm` performs the core WCS transformations. + +.. note:: + The members of this object correspond roughly to the key/value + pairs in the FITS header. However, they are adjusted and + normalized in a number of ways that make performing the WCS + transformation easier. Therefore, they can not be relied upon to + get the original values in the header. For that, use + `astropy.io.fits.Header` directly. + +The FITS header parsing enforces correct FITS "keyword = value" syntax +with regard to the equals sign occurring in columns 9 and 10. +However, it does recognize free-format character (NOST 100-2.0, +Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values +(Sect. 5.2.4) for all keywords. + +Parameters +---------- +header : An `astropy.io.fits.Header`, string, or `None`. + If ``None``, the object will be initialized to default values. + +key : str, optional + The key referring to a particular WCS transform in the header. + This may be either ``' '`` or ``'A'``-``'Z'`` and corresponds to + the ``\"a\"`` part of ``\"CTYPEia\"``. (*key* may only be + provided if *header* is also provided.) + +relax : bool or int, optional + + Degree of permissiveness: + + - `False`: Recognize only FITS keywords defined by the published + WCS standard. + + - `True`: Admit all recognized informal extensions of the WCS + standard. + + - `int`: a bit field selecting specific extensions to accept. See + :ref:`relaxread` for details. + +naxis : int, optional + The number of world coordinates axes for the object. (*naxis* may + only be provided if *header* is `None`.) + +keysel : sequence of flag bits, optional + Vector of flag bits that may be used to restrict the keyword types + considered: + + - ``WCSHDR_IMGHEAD``: Image header keywords. + + - ``WCSHDR_BIMGARR``: Binary table image array. + + - ``WCSHDR_PIXLIST``: Pixel list keywords. + + If zero, there is no restriction. If -1, the underlying wcslib + function ``wcspih()`` is called, rather than ``wcstbh()``. + +colsel : sequence of int + A sequence of table column numbers used to restrict the keywords + considered. `None` indicates no restriction. + +Raises +------ +MemoryError + Memory allocation failed. + +ValueError + Invalid key. + +KeyError + Key not found in FITS header. +""" + +Wtbarr = """ +Classes to construct coordinate lookup tables from a binary table +extension (BINTABLE). + +This class can not be constructed directly from Python, but instead is +returned from `~astropy.wcs.Wcsprm.wtb`. +""" + +zsource = """ +``double`` The redshift, ``ZSOURCEa``, of the source. + +An undefined value is represented by NaN. +""" + +WcsError = """ +Base class of all invalid WCS errors. +""" + +SingularMatrix = """ +SingularMatrixError() + +The linear transformation matrix is singular. +""" + +InconsistentAxisTypes = """ +InconsistentAxisTypesError() + +The WCS header inconsistent or unrecognized coordinate axis type(s). +""" + +InvalidTransform = """ +InvalidTransformError() + +The WCS transformation is invalid, or the transformation parameters +are invalid. +""" + +InvalidCoordinate = """ +InvalidCoordinateError() + +One or more of the world coordinates is invalid. +""" + +NoSolution = """ +NoSolutionError() + +No solution can be found in the given interval. +""" + +InvalidSubimageSpecification = """ +InvalidSubimageSpecificationError() + +The subimage specification is invalid. +""" + +NonseparableSubimageCoordinateSystem = """ +NonseparableSubimageCoordinateSystemError() + +Non-separable subimage coordinate system. +""" + +NoWcsKeywordsFound = """ +NoWcsKeywordsFoundError() + +No WCS keywords were found in the given header. +""" + +InvalidTabularParameters = """ +InvalidTabularParametersError() + +The given tabular parameters are invalid. +""" + +mjdbeg = """ +``double`` Modified Julian Date corresponding to ``DATE-BEG``. + +``(MJD = JD - 2400000.5)``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.mjdbeg +""" + +mjdend = """ +``double`` Modified Julian Date corresponding to ``DATE-END``. + +``(MJD = JD - 2400000.5)``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.mjdend +""" + +mjdref = """ +``double`` Modified Julian Date corresponding to ``DATE-REF``. + +``(MJD = JD - 2400000.5)``. + +An undefined value is represented by NaN. + +See also +-------- +astropy.wcs.Wcsprm.dateref +""" + +bepoch = """ +``double`` Equivalent to ``DATE-OBS``. + +Expressed as a Besselian epoch. + +See also +-------- +astropy.wcs.Wcsprm.dateobs +""" + +jepoch = """ +``double`` Equivalent to ``DATE-OBS``. + +Expressed as a Julian epoch. + +See also +-------- +astropy.wcs.Wcsprm.dateobs +""" + +datebeg = """ +``string`` Date at the start of the observation. + +In ISO format, ``yyyy-mm-ddThh:mm:ss``. + +See also +-------- +astropy.wcs.Wcsprm.datebeg +""" + +dateend = """ +``string`` Date at the end of the observation. + +In ISO format, ``yyyy-mm-ddThh:mm:ss``. + +See also +-------- +astropy.wcs.Wcsprm.dateend +""" + +dateref = """ +``string`` Date of a reference epoch relative to which +other time measurements refer. + +See also +-------- +astropy.wcs.Wcsprm.dateref +""" + +timesys = """ +``string`` Time scale (UTC, TAI, etc.) in which all other time-related +auxiliary header values are recorded. Also defines the time scale for +an image axis with CTYPEia set to 'TIME'. + +See also +-------- +astropy.wcs.Wcsprm.timesys +""" + +trefpos = """ +``string`` Location in space where the recorded time is valid. + +See also +-------- +astropy.wcs.Wcsprm.trefpos +""" + +trefdir = """ +``string`` Reference direction used in calculating a pathlength delay. + +See also +-------- +astropy.wcs.Wcsprm.trefdir +""" + +timeunit = """ +``string`` Time units in which the following header values are expressed: +``TSTART``, ``TSTOP``, ``TIMEOFFS``, ``TIMSYER``, ``TIMRDER``, ``TIMEDEL``. + +It also provides the default value for ``CUNITia`` for time axes. + +See also +-------- +astropy.wcs.Wcsprm.trefdir +""" + +plephem = """ +``string`` The Solar System ephemeris used for calculating a pathlength delay. + +See also +-------- +astropy.wcs.Wcsprm.plephem +""" + +tstart = """ +``double`` equivalent to DATE-BEG expressed as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS. + +See also +-------- +astropy.wcs.Wcsprm.tstop +""" + +tstop = """ +``double`` equivalent to DATE-END expressed as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS. + +See also +-------- +astropy.wcs.Wcsprm.tstart +""" + +telapse = """ +``double`` equivalent to the elapsed time between DATE-BEG and DATE-END, in units of TIMEUNIT. + +See also +-------- +astropy.wcs.Wcsprm.tstart +""" + +timeoffs = """ +``double`` Time offset, which may be used, for example, to provide a uniform clock correction + for times referenced to DATEREF. + +See also +-------- +astropy.wcs.Wcsprm.timeoffs +""" + +timsyer = """ +``double`` the absolute error of the time values, in units of TIMEUNIT. + +See also +-------- +astropy.wcs.Wcsprm.timrder +""" + +timrder = """ +``double`` the accuracy of time stamps relative to each other, in units of TIMEUNIT. + +See also +-------- +astropy.wcs.Wcsprm.timsyer +""" + +timedel = """ +``double`` the resolution of the time stamps. + +See also +-------- +astropy.wcs.Wcsprm.timedel +""" + +timepixr = """ +``double`` relative position of the time stamps in binned time intervals, a value between 0.0 and 1.0. + +See also +-------- +astropy.wcs.Wcsprm.timepixr +""" + +obsorbit = """ +``string`` URI, URL, or name of an orbit ephemeris file giving spacecraft coordinates relating to TREFPOS. + +See also +-------- +astropy.wcs.Wcsprm.trefpos + +""" +xposure = """ +``double`` effective exposure time in units of TIMEUNIT. + +See also +-------- +astropy.wcs.Wcsprm.timeunit +""" + +czphs = """ +``double array[naxis]`` The time at the zero point of a phase axis, ``CSPHSia``. + +An undefined value is represented by NaN. +""" + +cperi = """ +``double array[naxis]`` period of a phase axis, CPERIia. + +An undefined value is represented by NaN. +""" diff --git a/testbed/astropy__astropy/astropy/wcs/include/.gitignore b/testbed/astropy__astropy/astropy/wcs/include/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..fe085aa7d7a66ea94be851184954f7ea2e6c50c6 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/.gitignore @@ -0,0 +1,2 @@ +docstrings.h +wcsconfig.h diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/astropy_wcs.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/astropy_wcs.h new file mode 100644 index 0000000000000000000000000000000000000000..533c1f70e0fba0f03b9378691e05f765cd786d2d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/astropy_wcs.h @@ -0,0 +1,22 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __ASTROPY_WCS_H__ +#define __ASTROPY_WCS_H__ + +/* util.h must be imported first */ +#include "pyutil.h" +#include "pipeline.h" + +typedef struct { + PyObject_HEAD + pipeline_t x; + /*@shared@*/ PyObject* py_det2im[2]; + /*@null@*/ /*@shared@*/ PyObject* py_sip; + /*@shared@*/ PyObject* py_distortion_lookup[2]; + /*@null@*/ /*@shared@*/ PyObject* py_wcsprm; +} Wcs; + +#endif /* __ASTROPY_WCS_H__ */ diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion.h new file mode 100644 index 0000000000000000000000000000000000000000..edd4979232e1a1a226175f3e4e771b223686ea08 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion.h @@ -0,0 +1,108 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __DISTORTION_H__ +#define __DISTORTION_H__ + +#include "util.h" + +/* TODO: This is all two-dimensional. Should be made + multi-dimensional in the future. */ +#define NAXES 2 + +#define MAXAXES 6 + +/** +A structure to contain the information for a single distortion lookup table + */ +typedef struct { + unsigned int naxis[NAXES]; /* size of distortion image */ + double crpix[NAXES]; + double crval[NAXES]; + double cdelt[NAXES]; + /* The data is not "owned" by this structure. It is the user's + responsibility to free it. */ + /*@shared@*/ /*@null@*/ float *data; +} distortion_lookup_t; + +/** +Initialize a lookup table to reasonable default values. + */ +int +distortion_lookup_t_init(distortion_lookup_t* lookup); + +/** +Cleanup after a lookup table. Currently does nothing, but may do +something in the future, so please call it when you are done with +the lookup table. It does not free the data pointed to be the +lookup table -- it is the user's responsibility to free that array. + */ +void +distortion_lookup_t_free(distortion_lookup_t* lookup); + +/** +Lookup the distortion offset for a particular pixel coordinate in +the lookup table. + +@param lookup A lookup table object + +@param A coordinate pair + +@return The offset as determined by binlinear interpolation in the +lookup table +*/ +double +get_distortion_offset( + const distortion_lookup_t * const lookup, + const double * const img /* [NAXES] */); + +/** +Perform just the distortion table part of the FITS WCS distortion paper. + +@param naxes + +@param lookups A pair of lookup table objects + +@param nelem + +@param pix [in]: An array of pixel coordinates + +@param foc [out]: An array of focal plane coordinates + +@return A wcslib error code +*/ +int +p4_pix2foc( + const unsigned int naxes, + const distortion_lookup_t** lookups, /* [NAXES] */ + const unsigned int nelem, + const double* pix, /* [NAXES][nelem] */ + double *foc /* [NAXES][nelem] */); + +/** +Perform just the distortion table part of the FITS WCS distortion paper, by +adding distortion to the values already in place in foc. + +@param naxes + +@param lookups A pair of lookup table objects + +@param nelem + +@param pix [in]: An array of pixel coordinates + +@param foc [in/out]: An array of focal plane coordinates + +@return A wcslib error code +*/ +int +p4_pix2deltas( + const unsigned int naxes, + const distortion_lookup_t** lookups, /* [NAXES] */ + const unsigned int nelem, + const double* pix, /* [NAXES][nelem] */ + double *foc /* [NAXES][nelem] */); + +#endif /* __DISTORTION_H__ */ diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion_wrap.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion_wrap.h new file mode 100644 index 0000000000000000000000000000000000000000..2fce3b52bcbf7f24aaf7b637b61de9ec575a7b07 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/distortion_wrap.h @@ -0,0 +1,24 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __DISTORTION_WRAP_H__ +#define __DISTORTION_WRAP_H__ + +#include "pyutil.h" +#include "distortion.h" + +extern PyTypeObject PyDistLookupType; + +typedef struct { + PyObject_HEAD + distortion_lookup_t x; + /*@null@*/ /*@shared@*/ PyArrayObject* py_data; +} PyDistLookup; + +int +_setup_distortion_type( + PyObject* m); + +#endif diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/sip_wrap.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/sip_wrap.h new file mode 100644 index 0000000000000000000000000000000000000000..4eee5349b0ab55193f7871b5111e89d91b9e0601 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/sip_wrap.h @@ -0,0 +1,23 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __SIP_WRAP_H__ +#define __SIP_WRAP_H__ + +#include "pyutil.h" +#include "sip.h" + +extern PyTypeObject PySipType; + +typedef struct { + PyObject_HEAD + sip_t x; +} PySip; + +int +_setup_sip_type( + PyObject* m); + +#endif diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/str_list_proxy.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/str_list_proxy.h new file mode 100644 index 0000000000000000000000000000000000000000..b6462656a7644c7bdf9732371b4c4c044be3d2a7 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/str_list_proxy.h @@ -0,0 +1,38 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __STR_LIST_PROXY_H__ +#define __STR_LIST_PROXY_H__ + +#include "pyutil.h" + +/*************************************************************************** + * List-of-strings proxy object + * + * A Python object that looks like a list of strings, but is back by a C + * char * list[]; + ***************************************************************************/ + +typedef int (*str_verify_fn)(const char *); + +/*@null@*/ PyObject * +PyStrListProxy_New( + PyObject* owner, + Py_ssize_t size, + Py_ssize_t maxsize, + char (*array)[72] + ); + +/*@null@*/ PyObject* +str_list_proxy_repr( + char (*array)[72], + Py_ssize_t size, + Py_ssize_t maxsize); + +int +_setup_str_list_proxy_type( + PyObject* m); + +#endif /* __STR_LIST_PROXY_H__ */ diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/unit_list_proxy.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/unit_list_proxy.h new file mode 100644 index 0000000000000000000000000000000000000000..875346f0dce2bf3add746a310379840a9f966a91 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/unit_list_proxy.h @@ -0,0 +1,47 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __UNIT_LIST_PROXY_H__ +#define __UNIT_LIST_PROXY_H__ + +#include "pyutil.h" + +/*************************************************************************** + * List-of-units proxy object + * + * A Python object that looks like a list of units, but is back by a C + * char * list[]; + ***************************************************************************/ + +/*@null@*/ PyObject * +PyUnitListProxy_New( + PyObject* owner, + Py_ssize_t size, + char (*array)[72] + ); + +int +_setup_unit_list_proxy_type( + PyObject* m); + +static INLINE PyObject* +get_unit_list( + /*@unused@*/ const char* propname, + char (*array)[72], + Py_ssize_t len, + PyObject* owner) { + + return PyUnitListProxy_New(owner, len, array); +} + +int +set_unit_list( + PyObject *owner, + const char* propname, + PyObject* value, + Py_ssize_t len, + char (*dest)[72]); + +#endif /* __UNIT_LIST_PROXY_H__ */ diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_tabprm_wrap.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_tabprm_wrap.h new file mode 100644 index 0000000000000000000000000000000000000000..4a9fd36531ada1a0ab4b382fd40e6293899a6b72 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_tabprm_wrap.h @@ -0,0 +1,25 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __WCSLIB_TABPRM_WRAP_H__ +#define __WCSLIB_TABPRM_WRAP_H__ + +#include "pyutil.h" +#include "wcs.h" + +extern PyTypeObject PyTabprmType; + +typedef struct { + PyObject_HEAD + struct tabprm* x; + PyObject* owner; +} PyTabprm; + +PyTabprm* +PyTabprm_cnew(PyObject* wcsprm, struct tabprm* x); + +int _setup_tabprm_type(PyObject* m); + +#endif diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wrap.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wrap.h new file mode 100644 index 0000000000000000000000000000000000000000..4746bc041b03c2bc252a531795672471ba25d457 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wrap.h @@ -0,0 +1,26 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __WCSLIB_WRAP_H__ +#define __WCSLIB_WRAP_H__ + +#include "pyutil.h" + +extern PyTypeObject PyWcsprmType; + +typedef struct { + PyObject_HEAD + struct wcsprm x; +} PyWcsprm; + +int _setup_wcsprm_type(PyObject* m); + +PyObject* +PyWcsprm_find_all_wcs( + PyObject* self, + PyObject* args, + PyObject* kwds); + +#endif diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wtbarr_wrap.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wtbarr_wrap.h new file mode 100644 index 0000000000000000000000000000000000000000..0eac2d204ba5e696e5edf18d5784f5831edf7983 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs/wcslib_wtbarr_wrap.h @@ -0,0 +1,25 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#ifndef __WCSLIB_WTBARR_WRAP_H__ +#define __WCSLIB_WTBARR_WRAP_H__ + +#include "pyutil.h" +#include "wcs.h" + +extern PyTypeObject PyWtbarrType; + +typedef struct { + PyObject_HEAD + struct wtbarr* x; + PyObject* owner; +} PyWtbarr; + +PyWtbarr* +PyWtbarr_cnew(PyObject* wcsprm, struct wtbarr* x); + +int _setup_wtbarr_type(PyObject* m); + +#endif diff --git a/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs_api.h b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs_api.h new file mode 100644 index 0000000000000000000000000000000000000000..670831f7ef84d648e98a49426c98a35d80656e25 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/include/astropy_wcs_api.h @@ -0,0 +1 @@ +#error "Since version 0.3, astropy.wcs public API should be imported as \"astropy_wcs/astropy_wcs_api.h" diff --git a/testbed/astropy__astropy/astropy/wcs/include/wcslib/.empty b/testbed/astropy__astropy/astropy/wcs/include/wcslib/.empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/wcs/setup_package.py b/testbed/astropy__astropy/astropy/wcs/setup_package.py new file mode 100644 index 0000000000000000000000000000000000000000..d363ed51eefcf4051d107e19fbfcbbf790627f87 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/setup_package.py @@ -0,0 +1,345 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +CONTACT = "Michael Droettboom" +EMAIL = "mdroe@stsci.edu" + +import io +from os.path import join +import os.path +import shutil +import sys + +from distutils.core import Extension +from distutils.dep_util import newer_group + + +from astropy_helpers.utils import import_file +from astropy_helpers import setup_helpers +from astropy_helpers.distutils_helpers import get_distutils_build_option + +WCSROOT = os.path.relpath(os.path.dirname(__file__)) +WCSVERSION = "6.2.0" + + +def b(s): + return s.encode('ascii') + + +def string_escape(s): + s = s.decode('ascii').encode('ascii', 'backslashreplace') + s = s.replace(b'\n', b'\\n') + s = s.replace(b'\0', b'\\0') + return s.decode('ascii') + + +def determine_64_bit_int(): + """ + The only configuration parameter needed at compile-time is how to + specify a 64-bit signed integer. Python's ctypes module can get us + that information. + If we can't be absolutely certain, we default to "long long int", + which is correct on most platforms (x86, x86_64). If we find + platforms where this heuristic doesn't work, we may need to + hardcode for them. + """ + try: + try: + import ctypes + except ImportError: + raise ValueError() + + if ctypes.sizeof(ctypes.c_longlong) == 8: + return "long long int" + elif ctypes.sizeof(ctypes.c_long) == 8: + return "long int" + elif ctypes.sizeof(ctypes.c_int) == 8: + return "int" + else: + raise ValueError() + + except ValueError: + return "long long int" + + +def write_wcsconfig_h(paths): + """ + Writes out the wcsconfig.h header with local configuration. + """ + h_file = io.StringIO() + h_file.write(""" + /* The bundled version has WCSLIB_VERSION */ + #define HAVE_WCSLIB_VERSION 1 + + /* WCSLIB library version number. */ + #define WCSLIB_VERSION {0} + + /* 64-bit integer data type. */ + #define WCSLIB_INT64 {1} + + /* Windows needs some other defines to prevent inclusion of wcsset() + which conflicts with wcslib's wcsset(). These need to be set + on code that *uses* astropy.wcs, in addition to astropy.wcs itself. + */ + #if defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) || defined (__MINGW64__) + + #ifndef YY_NO_UNISTD_H + #define YY_NO_UNISTD_H + #endif + + #ifndef _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS + #endif + + #ifndef _NO_OLDNAMES + #define _NO_OLDNAMES + #endif + + #ifndef NO_OLDNAMES + #define NO_OLDNAMES + #endif + + #ifndef __STDC__ + #define __STDC__ 1 + #endif + + #endif + """.format(WCSVERSION, determine_64_bit_int())) + content = h_file.getvalue().encode('ascii') + for path in paths: + setup_helpers.write_if_different(path, content) + + +###################################################################### +# GENERATE DOCSTRINGS IN C + + +def generate_c_docstrings(): + docstrings = import_file(os.path.join(WCSROOT, 'docstrings.py')) + docstrings = docstrings.__dict__ + keys = [ + key for key, val in docstrings.items() + if not key.startswith('__') and isinstance(val, str)] + keys.sort() + docs = {} + for key in keys: + docs[key] = docstrings[key].encode('utf8').lstrip() + b'\0' + + h_file = io.StringIO() + h_file.write("""/* +DO NOT EDIT! + +This file is autogenerated by astropy/wcs/setup_package.py. To edit +its contents, edit astropy/wcs/docstrings.py +*/ + +#ifndef __DOCSTRINGS_H__ +#define __DOCSTRINGS_H__ + +""") + for key in keys: + val = docs[key] + h_file.write('extern char doc_{0}[{1}];\n'.format(key, len(val))) + h_file.write("\n#endif\n\n") + + setup_helpers.write_if_different( + join(WCSROOT, 'include', 'astropy_wcs', 'docstrings.h'), + h_file.getvalue().encode('utf-8')) + + c_file = io.StringIO() + c_file.write("""/* +DO NOT EDIT! + +This file is autogenerated by astropy/wcs/setup_package.py. To edit +its contents, edit astropy/wcs/docstrings.py + +The weirdness here with strncpy is because some C compilers, notably +MSVC, do not support string literals greater than 256 characters. +*/ + +#include +#include "astropy_wcs/docstrings.h" + +""") + for key in keys: + val = docs[key] + c_file.write('char doc_{0}[{1}] = {{\n'.format(key, len(val))) + for i in range(0, len(val), 12): + section = val[i:i+12] + c_file.write(' ') + c_file.write(''.join('0x{0:02x}, '.format(x) for x in section)) + c_file.write('\n') + + c_file.write(" };\n\n") + + setup_helpers.write_if_different( + join(WCSROOT, 'src', 'docstrings.c'), + c_file.getvalue().encode('utf-8')) + + +def get_wcslib_cfg(cfg, wcslib_files, include_paths): + + debug = import_file(os.path.join(WCSROOT, '..', 'version.py')).debug + + cfg['include_dirs'].append('numpy') + cfg['define_macros'].extend([ + ('ECHO', None), + ('WCSTRIG_MACRO', None), + ('ASTROPY_WCS_BUILD', None), + ('_GNU_SOURCE', None)]) + + if (not setup_helpers.use_system_library('wcslib') or + sys.platform == 'win32'): + write_wcsconfig_h(include_paths) + + wcslib_path = join("cextern", "wcslib") # Path to wcslib + wcslib_cpath = join(wcslib_path, "C") # Path to wcslib source files + cfg['sources'].extend(join(wcslib_cpath, x) for x in wcslib_files) + cfg['include_dirs'].append(wcslib_cpath) + else: + wcsconfig_h_path = join(WCSROOT, 'include', 'wcsconfig.h') + if os.path.exists(wcsconfig_h_path): + os.unlink(wcsconfig_h_path) + cfg.update(setup_helpers.pkg_config(['wcslib'], ['wcs'])) + + if debug: + cfg['define_macros'].append(('DEBUG', None)) + cfg['undef_macros'].append('NDEBUG') + if (not sys.platform.startswith('sun') and + not sys.platform == 'win32'): + cfg['extra_compile_args'].extend(["-fno-inline", "-O0", "-g"]) + else: + # Define ECHO as nothing to prevent spurious newlines from + # printing within the libwcs parser + cfg['define_macros'].append(('NDEBUG', None)) + cfg['undef_macros'].append('DEBUG') + + if sys.platform == 'win32': + # These are written into wcsconfig.h, but that file is not + # used by all parts of wcslib. + cfg['define_macros'].extend([ + ('YY_NO_UNISTD_H', None), + ('_CRT_SECURE_NO_WARNINGS', None), + ('_NO_OLDNAMES', None), # for mingw32 + ('NO_OLDNAMES', None), # for mingw64 + ('__STDC__', None) # for MSVC + ]) + + if sys.platform.startswith('linux'): + cfg['define_macros'].append(('HAVE_SINCOS', None)) + + # Squelch a few compilation warnings in WCSLIB + if setup_helpers.get_compiler_option() in ('unix', 'mingw32'): + if not get_distutils_build_option('debug'): + cfg['extra_compile_args'].extend([ + '-Wno-strict-prototypes', + '-Wno-unused-function', + '-Wno-unused-value', + '-Wno-uninitialized']) + + +def get_extensions(): + generate_c_docstrings() + + ###################################################################### + # DISTUTILS SETUP + cfg = setup_helpers.DistutilsExtensionArgs() + + wcslib_files = [ # List of wcslib files to compile + 'flexed/wcsbth.c', + 'flexed/wcspih.c', + 'flexed/wcsulex.c', + 'flexed/wcsutrn.c', + 'cel.c', + 'dis.c', + 'lin.c', + 'log.c', + 'prj.c', + 'spc.c', + 'sph.c', + 'spx.c', + 'tab.c', + 'wcs.c', + 'wcserr.c', + 'wcsfix.c', + 'wcshdr.c', + 'wcsprintf.c', + 'wcsunits.c', + 'wcsutil.c' + ] + + wcslib_config_paths = [ + join(WCSROOT, 'include', 'astropy_wcs', 'wcsconfig.h'), + join(WCSROOT, 'include', 'wcsconfig.h') + ] + + get_wcslib_cfg(cfg, wcslib_files, wcslib_config_paths) + + cfg['include_dirs'].append(join(WCSROOT, "include")) + + astropy_wcs_files = [ # List of astropy.wcs files to compile + 'distortion.c', + 'distortion_wrap.c', + 'docstrings.c', + 'pipeline.c', + 'pyutil.c', + 'astropy_wcs.c', + 'astropy_wcs_api.c', + 'sip.c', + 'sip_wrap.c', + 'str_list_proxy.c', + 'unit_list_proxy.c', + 'util.c', + 'wcslib_wrap.c', + 'wcslib_tabprm_wrap.c'] + cfg['sources'].extend(join(WCSROOT, 'src', x) for x in astropy_wcs_files) + + cfg['sources'] = [str(x) for x in cfg['sources']] + cfg = dict((str(key), val) for key, val in cfg.items()) + + return [Extension(str('astropy.wcs._wcs'), **cfg)] + + +def get_package_data(): + # Installs the testing data files + api_files = [ + 'astropy_wcs.h', + 'astropy_wcs_api.h', + 'distortion.h', + 'isnan.h', + 'pipeline.h', + 'pyutil.h', + 'sip.h', + 'util.h', + 'wcsconfig.h', + ] + api_files = [join('include', 'astropy_wcs', x) for x in api_files] + api_files.append(join('include', 'astropy_wcs_api.h')) + + wcslib_headers = [ + 'cel.h', + 'lin.h', + 'prj.h', + 'spc.h', + 'spx.h', + 'tab.h', + 'wcs.h', + 'wcserr.h', + 'wcsmath.h', + 'wcsprintf.h', + ] + if not setup_helpers.use_system_library('wcslib'): + for header in wcslib_headers: + source = join('cextern', 'wcslib', 'C', header) + dest = join('astropy', 'wcs', 'include', 'wcslib', header) + if newer_group([source], dest, 'newer'): + shutil.copy(source, dest) + api_files.append(join('include', 'wcslib', header)) + + return { + str('astropy.wcs.tests'): ['extension/*.c'], + str('astropy.wcs'): api_files, + } + + +def get_external_libraries(): + return ['wcslib'] diff --git a/testbed/astropy__astropy/astropy/wcs/src/.gitignore b/testbed/astropy__astropy/astropy/wcs/src/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f310bffc31b12684a0ecc20a05629388f4512ff4 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/.gitignore @@ -0,0 +1,5 @@ +# Don't ignore *.c files in this directory tree. We don't have any +# Cython files here. + +!*.c +docstrings.c diff --git a/testbed/astropy__astropy/astropy/wcs/src/astropy_wcs.c b/testbed/astropy__astropy/astropy/wcs/src/astropy_wcs.c new file mode 100644 index 0000000000000000000000000000000000000000..080598f7db81ab583c5f9f272073755579c70973 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/astropy_wcs.c @@ -0,0 +1,887 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#include "astropy_wcs/astropy_wcs.h" +#include "astropy_wcs/wcslib_wrap.h" +#include "astropy_wcs/wcslib_tabprm_wrap.h" +#include "astropy_wcs/wcslib_units_wrap.h" +#include "astropy_wcs/wcslib_wtbarr_wrap.h" +#include "astropy_wcs/distortion_wrap.h" +#include "astropy_wcs/sip_wrap.h" +#include "astropy_wcs/docstrings.h" +#include "astropy_wcs/astropy_wcs_api.h" +#include "astropy_wcs/unit_list_proxy.h" + +#include /* from Python */ + +#include +#include + +/*************************************************************************** + * Wcs type + ***************************************************************************/ + +static PyTypeObject WcsType; + +static int _setup_wcs_type(PyObject* m); + + +/*************************************************************************** + * PyWcs methods + */ + +static int +Wcs_traverse( + Wcs* self, + visitproc visit, + void* arg) { + + Py_VISIT(self->py_det2im[0]); + Py_VISIT(self->py_det2im[1]); + Py_VISIT(self->py_sip); + Py_VISIT(self->py_distortion_lookup[0]); + Py_VISIT(self->py_distortion_lookup[1]); + Py_VISIT(self->py_wcsprm); + + return 0; +} + +static int +Wcs_clear( + Wcs* self) { + + PyObject* tmp; + + tmp = self->py_det2im[0]; + self->py_det2im[0] = NULL; + Py_XDECREF(tmp); + + tmp = self->py_det2im[1]; + self->py_det2im[1] = NULL; + Py_XDECREF(tmp); + + tmp = self->py_sip; + self->py_sip = NULL; + Py_XDECREF(tmp); + + tmp = self->py_distortion_lookup[0]; + self->py_distortion_lookup[0] = NULL; + Py_XDECREF(tmp); + + tmp = self->py_distortion_lookup[1]; + self->py_distortion_lookup[1] = NULL; + Py_XDECREF(tmp); + + tmp = self->py_wcsprm; + self->py_wcsprm = NULL; + Py_XDECREF(tmp); + + return 0; +} + +static void +Wcs_dealloc( + Wcs* self) { + + Wcs_clear(self); + pipeline_free(&self->x); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +/*@null@*/ static PyObject * +Wcs_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + Wcs* self; + self = (Wcs*)type->tp_alloc(type, 0); + if (self != NULL) { + pipeline_clear(&self->x); + self->py_det2im[0] = NULL; + self->py_det2im[1] = NULL; + self->py_sip = NULL; + self->py_distortion_lookup[0] = NULL; + self->py_distortion_lookup[1] = NULL; + self->py_wcsprm = NULL; + } + return (PyObject*)self; +} + +static int +Wcs_init( + Wcs* self, + PyObject* args, + /*@unused@*/ PyObject* kwds) { + + size_t i; + PyObject* py_sip; + PyObject* py_wcsprm; + PyObject* py_distortion_lookup[2]; + PyObject* py_det2im[2]; + + if (!PyArg_ParseTuple + (args, "O(OO)O(OO):Wcs.__init__", + &py_sip, + &py_distortion_lookup[0], + &py_distortion_lookup[1], + &py_wcsprm, + &py_det2im[0], + &py_det2im[1])) { + return -1; + } + + /* Check and set Distortion lookup tables */ + for (i = 0; i < 2; ++i) { + if (py_det2im[i] != NULL && py_det2im[i] != Py_None) { + if (!PyObject_TypeCheck(py_det2im[i], &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "Arg 4 must be a pair of DistortionLookupTable or None objects"); + return -1; + } + + Py_XDECREF(self->py_det2im[i]); + self->py_det2im[i] = py_det2im[i]; + self->x.det2im[i] = &(((PyDistLookup*)py_det2im[i])->x); + } + } + + /* Check and set SIP */ + if (py_sip != NULL && py_sip != Py_None) { + if (!PyObject_TypeCheck(py_sip, &PySipType)) { + PyErr_SetString(PyExc_TypeError, + "Arg 1 must be Sip object"); + return -1; + } + + Py_XDECREF(self->py_sip); + self->py_sip = py_sip; + self->x.sip = &(((PySip*)py_sip)->x); + } + + /* Check and set Distortion lookup tables */ + for (i = 0; i < 2; ++i) { + if (py_distortion_lookup[i] != NULL && py_distortion_lookup[i] != Py_None) { + if (!PyObject_TypeCheck(py_distortion_lookup[i], &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "Arg 2 must be a pair of DistortionLookupTable or None objects"); + return -1; + } + + Py_XDECREF(self->py_distortion_lookup[i]); + self->py_distortion_lookup[i] = py_distortion_lookup[i]; + self->x.cpdis[i] = &(((PyDistLookup*)py_distortion_lookup[i])->x); + } + } + + /* Set and lookup Wcsprm object */ + if (py_wcsprm != NULL && py_wcsprm != Py_None) { + if (!PyObject_TypeCheck(py_wcsprm, &PyWcsprmType)) { + PyErr_SetString(PyExc_TypeError, + "Arg 3 must be Wcsprm object"); + return -1; + } + + Py_XDECREF(self->py_wcsprm); + self->py_wcsprm = py_wcsprm; + self->x.wcs = &(((PyWcsprm*)py_wcsprm)->x); + } + + Py_XINCREF(self->py_sip); + Py_XINCREF(self->py_distortion_lookup[0]); + Py_XINCREF(self->py_distortion_lookup[1]); + Py_XINCREF(self->py_wcsprm); + Py_XINCREF(self->py_det2im[0]); + Py_XINCREF(self->py_det2im[1]); + + return 0; +} + +/*@null@*/ static PyObject* +Wcs_all_pix2world( + Wcs* self, + PyObject* args, + PyObject* kwds) { + + int naxis = 2; + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* pixcrd = NULL; + PyArrayObject* world = NULL; + int status = -1; + const char* keywords[] = { + "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "Oi:all_pix2world", (char **)keywords, + &pixcrd_obj, &origin)) { + return NULL; + } + + naxis = self->x.wcs->naxis; + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny(pixcrd_obj, NPY_DOUBLE, 2, 2); + if (pixcrd == NULL) { + return NULL; + } + + if (PyArray_DIM(pixcrd, 1) < naxis) { + PyErr_Format( + PyExc_RuntimeError, + "Input array must be 2-dimensional, where the second dimension >= %d", + naxis); + goto exit; + } + + world = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (world == NULL) { + goto exit; + } + + /* Make the call */ + Py_BEGIN_ALLOW_THREADS + preoffset_array(pixcrd, origin); + wcsprm_python2c(self->x.wcs); + status = pipeline_all_pixel2world(&self->x, + (unsigned int)PyArray_DIM(pixcrd, 0), + (unsigned int)PyArray_DIM(pixcrd, 1), + (double*)PyArray_DATA(pixcrd), + (double*)PyArray_DATA(world)); + wcsprm_c2python(self->x.wcs); + unoffset_array(pixcrd, origin); + Py_END_ALLOW_THREADS + /* unoffset_array(world, origin); */ + + exit: + Py_XDECREF(pixcrd); + + if (status == 0 || status == 8) { + return (PyObject*)world; + } else { + Py_XDECREF(world); + if (status == -1) { + PyErr_SetString( + PyExc_ValueError, + "Wrong number of dimensions in input array. Expected 2."); + return NULL; + } else { + if (status == -1) { + /* exception already set */ + return NULL; + } else { + wcserr_to_python_exc(self->x.err); + return NULL; + } + } + } +} + +/*@null@*/ static PyObject* +Wcs_p4_pix2foc( + Wcs* self, + PyObject* args, + PyObject* kwds) { + + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* pixcrd = NULL; + PyArrayObject* foccrd = NULL; + int status = -1; + const char* keywords[] = { + "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi:p4_pix2foc", (char **)keywords, + &pixcrd_obj, &origin)) { + return NULL; + } + + if (self->x.cpdis[0] == NULL && self->x.cpdis[1] == NULL) { + Py_INCREF(pixcrd_obj); + return pixcrd_obj; + } + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny(pixcrd_obj, NPY_DOUBLE, 2, 2); + if (pixcrd == NULL) { + return NULL; + } + + if (PyArray_DIM(pixcrd, 1) != NAXES) { + PyErr_SetString(PyExc_ValueError, "Pixel array must be an Nx2 array"); + goto exit; + } + + foccrd = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (foccrd == NULL) { + status = 2; + goto exit; + } + + Py_BEGIN_ALLOW_THREADS + preoffset_array(pixcrd, origin); + status = p4_pix2foc(2, (void *)self->x.cpdis, + (unsigned int)PyArray_DIM(pixcrd, 0), + (double*)PyArray_DATA(pixcrd), + (double*)PyArray_DATA(foccrd)); + unoffset_array(pixcrd, origin); + unoffset_array(foccrd, origin); + Py_END_ALLOW_THREADS + + exit: + + Py_XDECREF(pixcrd); + + if (status == 0) { + return (PyObject*)foccrd; + } else { + Py_XDECREF(foccrd); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + PyErr_SetString(PyExc_MemoryError, "NULL pointer passed"); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +Wcs_det2im( + Wcs* self, + PyObject* args, + PyObject* kwds) { + + PyObject* detcrd_obj = NULL; + int origin = 1; + PyArrayObject* detcrd = NULL; + PyArrayObject* imcrd = NULL; + int status = -1; + const char* keywords[] = { + "detcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi:det2im", (char **)keywords, + &detcrd_obj, &origin)) { + return NULL; + } + + if (self->x.det2im[0] == NULL && self->x.det2im[1] == NULL) { + Py_INCREF(detcrd_obj); + return detcrd_obj; + } + + detcrd = (PyArrayObject*)PyArray_ContiguousFromAny(detcrd_obj, NPY_DOUBLE, 2, 2); + if (detcrd == NULL) { + return NULL; + } + + if (PyArray_DIM(detcrd, 1) != NAXES) { + PyErr_SetString(PyExc_ValueError, "Pixel array must be an Nx2 array"); + goto exit; + } + + imcrd = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(detcrd), NPY_DOUBLE); + if (imcrd == NULL) { + status = 2; + goto exit; + } + + Py_BEGIN_ALLOW_THREADS + preoffset_array(detcrd, origin); + status = p4_pix2foc(2, (void *)self->x.det2im, + (unsigned int)PyArray_DIM(detcrd, 0), + (double*)PyArray_DATA(detcrd), + (double*)PyArray_DATA(imcrd)); + unoffset_array(detcrd, origin); + unoffset_array(imcrd, origin); + Py_END_ALLOW_THREADS + + exit: + + Py_XDECREF(detcrd); + + if (status == 0) { + return (PyObject*)imcrd; + } else { + Py_XDECREF(imcrd); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + PyErr_SetString(PyExc_MemoryError, "NULL pointer passed"); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +Wcs_pix2foc( + Wcs* self, + PyObject* args, + PyObject* kwds) { + + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* pixcrd = NULL; + PyArrayObject* foccrd = NULL; + int status = -1; + const char* keywords[] = { + "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi:pix2foc", (char **)keywords, + &pixcrd_obj, &origin)) { + return NULL; + } + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny(pixcrd_obj, NPY_DOUBLE, 2, 2); + if (pixcrd == NULL) { + return NULL; + } + + if (PyArray_DIM(pixcrd, 1) != NAXES) { + PyErr_SetString(PyExc_ValueError, "Pixel array must be an Nx2 array"); + goto _exit; + } + + foccrd = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (foccrd == NULL) { + goto _exit; + } + + Py_BEGIN_ALLOW_THREADS + preoffset_array(pixcrd, origin); + status = pipeline_pix2foc(&self->x, + (unsigned int)PyArray_DIM(pixcrd, 0), + (unsigned int)PyArray_DIM(pixcrd, 1), + (double*)PyArray_DATA(pixcrd), + (double*)PyArray_DATA(foccrd)); + unoffset_array(pixcrd, origin); + unoffset_array(foccrd, origin); + Py_END_ALLOW_THREADS + + _exit: + + Py_XDECREF(pixcrd); + + if (status == 0) { + return (PyObject*)foccrd; + } else { + Py_XDECREF(foccrd); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + wcserr_to_python_exc(self->x.err); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +Wcs_get_wcs( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_wcsprm) { + Py_INCREF(self->py_wcsprm); + return self->py_wcsprm; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_wcs( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_wcsprm); + self->py_wcsprm = NULL; + self->x.wcs = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PyWcsprmType)) { + PyErr_SetString(PyExc_TypeError, + "wcs must be Wcsprm object"); + return -1; + } + + Py_INCREF(value); + self->py_wcsprm = value; + self->x.wcs = &(((PyWcsprm*)value)->x); + } + + return 0; +} + +static PyObject* +Wcs_get_cpdis1( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_distortion_lookup[0]) { + Py_INCREF(self->py_distortion_lookup[0]); + return self->py_distortion_lookup[0]; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_cpdis1( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_distortion_lookup[0]); + self->py_distortion_lookup[0] = NULL; + self->x.cpdis[0] = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "cpdis1 must be DistortionLookupTable object"); + return -1; + } + + Py_INCREF(value); + self->py_distortion_lookup[0] = value; + self->x.cpdis[0] = &(((PyDistLookup*)value)->x); + } + + return 0; +} + +/*@shared@*/ static PyObject* +Wcs_get_cpdis2( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_distortion_lookup[1]) { + Py_INCREF(self->py_distortion_lookup[1]); + return self->py_distortion_lookup[1]; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_cpdis2( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_distortion_lookup[1]); + self->py_distortion_lookup[1] = NULL; + self->x.cpdis[1] = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "cpdis2 must be DistortionLookupTable object"); + return -1; + } + + Py_INCREF(value); + self->py_distortion_lookup[1] = value; + self->x.cpdis[1] = &(((PyDistLookup*)value)->x); + } + + return 0; +} + +static PyObject* +Wcs_get_det2im1( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_det2im[0]) { + Py_INCREF(self->py_det2im[0]); + return self->py_det2im[0]; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_det2im1( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_det2im[0]); + self->py_det2im[0] = NULL; + self->x.det2im[0] = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "det2im1 must be DistortionLookupTable object"); + return -1; + } + + Py_INCREF(value); + self->py_det2im[0] = value; + self->x.det2im[0] = &(((PyDistLookup*)value)->x); + } + + return 0; +} + +/*@shared@*/ static PyObject* +Wcs_get_det2im2( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_det2im[1]) { + Py_INCREF(self->py_det2im[1]); + return self->py_det2im[1]; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_det2im2( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_det2im[1]); + self->py_det2im[1] = NULL; + self->x.det2im[1] = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PyDistLookupType)) { + PyErr_SetString(PyExc_TypeError, + "det2im2 must be DistortionLookupTable object"); + return -1; + } + + Py_INCREF(value); + self->py_det2im[1] = value; + self->x.det2im[1] = &(((PyDistLookup*)value)->x); + } + + return 0; +} + +/*@shared@*/ static PyObject* +Wcs_get_sip( + Wcs* self, + /*@unused@*/ void* closure) { + + if (self->py_sip) { + Py_INCREF(self->py_sip); + return self->py_sip; + } + + Py_INCREF(Py_None); + return Py_None; +} + +static int +Wcs_set_sip( + Wcs* self, + /*@shared@*/ PyObject* value, + /*@unused@*/ void* closure) { + + Py_XDECREF(self->py_sip); + self->py_sip = NULL; + self->x.sip = NULL; + + if (value != NULL && value != Py_None) { + if (!PyObject_TypeCheck(value, &PySipType)) { + PyErr_SetString(PyExc_TypeError, + "sip must be Sip object"); + return -1; + } + + Py_INCREF(value); + self->py_sip = value; + self->x.sip = &(((PySip*)value)->x); + } + + return 0; +} + +static PyObject* +_sanity_check( + PyObject* self, + PyObject* args, + PyObject* kwds) { + + if (sizeof(WCSLIB_INT64) != 8) { + Py_INCREF(Py_False); + return Py_False; + } + + Py_INCREF(Py_True); + return Py_True; +} + +/*************************************************************************** + * Wcs definition structures + */ + +static PyGetSetDef Wcs_getset[] = { + {"det2im1", (getter)Wcs_get_det2im1, (setter)Wcs_set_det2im1, (char *)doc_det2im1}, + {"det2im2", (getter)Wcs_get_det2im2, (setter)Wcs_set_det2im2, (char *)doc_det2im2}, + {"cpdis1", (getter)Wcs_get_cpdis1, (setter)Wcs_set_cpdis1, (char *)doc_cpdis1}, + {"cpdis2", (getter)Wcs_get_cpdis2, (setter)Wcs_set_cpdis2, (char *)doc_cpdis2}, + {"sip", (getter)Wcs_get_sip, (setter)Wcs_set_sip, (char *)doc_sip}, + {"wcs", (getter)Wcs_get_wcs, (setter)Wcs_set_wcs, (char *)doc_wcs}, + {NULL} +}; + +static PyMethodDef Wcs_methods[] = { + {"_all_pix2world", (PyCFunction)Wcs_all_pix2world, METH_VARARGS|METH_KEYWORDS, doc_all_pix2world}, + {"_det2im", (PyCFunction)Wcs_det2im, METH_VARARGS|METH_KEYWORDS, doc_det2im}, + {"_p4_pix2foc", (PyCFunction)Wcs_p4_pix2foc, METH_VARARGS|METH_KEYWORDS, doc_p4_pix2foc}, + {"_pix2foc", (PyCFunction)Wcs_pix2foc, METH_VARARGS|METH_KEYWORDS, doc_pix2foc}, + {NULL} +}; + +static PyMethodDef module_methods[] = { + {"_sanity_check", (PyCFunction)_sanity_check, METH_NOARGS, ""}, + {"find_all_wcs", (PyCFunction)PyWcsprm_find_all_wcs, METH_VARARGS|METH_KEYWORDS, doc_find_all_wcs}, + {NULL} /* Sentinel */ +}; + +static PyTypeObject WcsType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.WCSBase", /*tp_name*/ + sizeof(Wcs), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)Wcs_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + doc_Wcs, /* tp_doc */ + (traverseproc)Wcs_traverse, /* tp_traverse */ + (inquiry)Wcs_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + Wcs_methods, /* tp_methods */ + 0, /* tp_members */ + Wcs_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)Wcs_init, /* tp_init */ + 0, /* tp_alloc */ + Wcs_new, /* tp_new */ +}; + + +/*************************************************************************** + * Module-level + ***************************************************************************/ + +int _setup_wcs_type( + PyObject* m) { + + if (PyType_Ready(&WcsType) < 0) + return -1; + + Py_INCREF(&WcsType); + return PyModule_AddObject(m, "_Wcs", (PyObject *)&WcsType); +} + +struct module_state { +/* The Sun compiler can't handle empty structs */ +#if defined(__SUNPRO_C) || defined(_MSC_VER) + int _dummy; +#endif +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_wcs", + NULL, + sizeof(struct module_state), + module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC +PyInit__wcs(void) + +{ + PyObject* m; + + wcs_errexc[0] = NULL; /* Success */ + wcs_errexc[1] = &PyExc_MemoryError; /* Null wcsprm pointer passed */ + wcs_errexc[2] = &PyExc_MemoryError; /* Memory allocation failed */ + wcs_errexc[3] = &WcsExc_SingularMatrix; /* Linear transformation matrix is singular */ + wcs_errexc[4] = &WcsExc_InconsistentAxisTypes; /* Inconsistent or unrecognized coordinate axis types */ + wcs_errexc[5] = &PyExc_ValueError; /* Invalid parameter value */ + wcs_errexc[6] = &WcsExc_InvalidTransform; /* Invalid coordinate transformation parameters */ + wcs_errexc[7] = &WcsExc_InvalidTransform; /* Ill-conditioned coordinate transformation parameters */ + wcs_errexc[8] = &WcsExc_InvalidCoordinate; /* One or more of the pixel coordinates were invalid, */ + /* as indicated by the stat vector */ + wcs_errexc[9] = &WcsExc_InvalidCoordinate; /* One or more of the world coordinates were invalid, */ + /* as indicated by the stat vector */ + wcs_errexc[10] = &WcsExc_InvalidCoordinate; /* Invalid world coordinate */ + wcs_errexc[11] = &WcsExc_NoSolution; /* no solution found in the specified interval */ + wcs_errexc[12] = &WcsExc_InvalidSubimageSpecification; /* Invalid subimage specification (no spectral axis) */ + wcs_errexc[13] = &WcsExc_NonseparableSubimageCoordinateSystem; /* Non-separable subimage coordinate system */ + + m = PyModule_Create(&moduledef); + + if (m == NULL) + return NULL; + + import_array(); + + if (_setup_api(m) || + _setup_str_list_proxy_type(m) || + _setup_unit_list_proxy_type(m)|| + _setup_wcsprm_type(m) || + _setup_tabprm_type(m) || + /* _setup_wtbarr_type(m) || */ + _setup_distortion_type(m) || + _setup_sip_type(m) || + _setup_wcs_type(m) || + _define_exceptions(m)) { + Py_DECREF(m); + return NULL; + } + +#ifdef HAVE_WCSLIB_VERSION + if (PyModule_AddStringConstant(m, "__version__", wcslib_version(NULL))) { + return NULL; + } +#else + if (PyModule_AddStringConstant(m, "__version__", "4.x")) { + return NULL; + } +#endif + + return m; +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/distortion.c b/testbed/astropy__astropy/astropy/wcs/src/distortion.c new file mode 100644 index 0000000000000000000000000000000000000000..a69178e9ba6c7062fc76b8bec16162d2b648a42f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/distortion.c @@ -0,0 +1,226 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#include "astropy_wcs/distortion.h" + +#include +#include +#include +#include + +/* TODO: n-dimensional support */ + +int +distortion_lookup_t_init( + distortion_lookup_t* lookup) { + + unsigned int i; + + for (i = 0; i < NAXES; ++i) { + lookup->naxis[i] = 0; + lookup->crpix[i] = 0.0; + lookup->crval[i] = 0.0; + lookup->cdelt[i] = 1.0; + } + + lookup->data = NULL; + + return 0; +} + +void +distortion_lookup_t_free( + /*@unused@*/ distortion_lookup_t* lookup) { + + /*@empty@*/ +} + +/** + * Get a value at a specific integral location in the lookup table. + * (This is nothing more special than an array lookup with range + * checking.) + */ +static INLINE float +get_dist_clamp( + const float* const data, + const unsigned int* const naxis, + const int x, + const int y) { + + return data[ + ((naxis[0] * CLAMP(y, 0, (long)naxis[1] - 1)) + + CLAMP(x, 0, (long)naxis[0] - 1))]; +} + +static INLINE float +get_dist( + const float* const data, + const unsigned int* const naxis, + const int x, + const int y) { + + return data[(naxis[0] * y) + x]; +} + +/** + * Converts a pixel coordinate to a fractional coordinate in the + * lookup table on a single axis + */ +static INLINE double +image_coord_to_distortion_coord( + const distortion_lookup_t * const lookup, + const unsigned int axis, + const double img) { + + double result; + + assert(lookup != NULL); + assert(axis < NAXES); + + /* The "- 1./stepsize" is here because the input coordinates are 1-based, + but this is a C-array underneath */ + result = ( + ((img - lookup->crval[axis]) / lookup->cdelt[axis]) + + lookup->crpix[axis]) - 1.0/lookup->cdelt[axis]; + + return CLAMP(result, 0.0, (double)(lookup->naxis[axis] - 1)); +} + +/** + * Converts a pixel coordinate to a fractional coordinate in the + * lookup table. + */ +static INLINE void +image_coords_to_distortion_coords( + const distortion_lookup_t * const lookup, + const double * const img /* [NAXES] */, + /* Output parameters */ + /*@out@*/ double *dist /* [NAXES] */) { + + unsigned int i; + + assert(lookup != NULL); + assert(img != NULL); + assert(dist != NULL); + + for (i = 0; i < NAXES; ++i) { + dist[i] = image_coord_to_distortion_coord(lookup, i, img[i]); + } +} + +INLINE double +get_distortion_offset( + const distortion_lookup_t * const lookup, + const double * const img /*[NAXES]*/) { + + double dist[NAXES]; + double dist_floor[NAXES]; + int dist_ifloor[NAXES]; + double dist_weight[NAXES]; + double dist_iweight[NAXES]; + double result; + const unsigned int* naxis = lookup->naxis; + const float* data = lookup->data; + unsigned int i; + + assert(lookup != NULL); + assert(img != NULL); + + image_coords_to_distortion_coords(lookup, img, dist); + + for (i = 0; i < NAXES; ++i) { + dist_floor[i] = floor(dist[i]); + dist_ifloor[i] = (int)dist_floor[i]; + dist_weight[i] = dist[i] - dist_floor[i]; + dist_iweight[i] = 1.0 - dist_weight[i]; + } + + /* If we may need to clamp the lookups, use this slower approach */ + if (dist_ifloor[0] < 0 || + dist_ifloor[1] < 0 || + dist_ifloor[0] >= (long)lookup->naxis[0] - 1 || + dist_ifloor[1] >= (long)lookup->naxis[1] - 1) { + result = + (double)get_dist_clamp(data, naxis, dist_ifloor[0], dist_ifloor[1]) * dist_iweight[0] * dist_iweight[1] + + (double)get_dist_clamp(data, naxis, dist_ifloor[0], dist_ifloor[1] + 1) * dist_iweight[0] * dist_weight[1] + + (double)get_dist_clamp(data, naxis, dist_ifloor[0] + 1, dist_ifloor[1]) * dist_weight[0] * dist_iweight[1] + + (double)get_dist_clamp(data, naxis, dist_ifloor[0] + 1, dist_ifloor[1] + 1) * dist_weight[0] * dist_weight[1]; + /* Else, we don't need to clamp 4 times for each pixel */ + } else { + result = + (double)get_dist(data, naxis, dist_ifloor[0], dist_ifloor[1]) * dist_iweight[0] * dist_iweight[1] + + (double)get_dist(data, naxis, dist_ifloor[0], dist_ifloor[1] + 1) * dist_iweight[0] * dist_weight[1] + + (double)get_dist(data, naxis, dist_ifloor[0] + 1, dist_ifloor[1]) * dist_weight[0] * dist_iweight[1] + + (double)get_dist(data, naxis, dist_ifloor[0] + 1, dist_ifloor[1] + 1) * dist_weight[0] * dist_weight[1]; + } + + return result; +} + +int +p4_pix2deltas( + const unsigned int naxes, + const distortion_lookup_t **lookup, /* [NAXES] */ + const unsigned int nelem, + const double* pix, /* [NAXES][nelem] */ + double *foc /* [NAXES][nelem] */) { + + int i; + double* foc0; + const double* pix0; + const double* pixend; + +#ifndef NDEBUG + unsigned int k; +#endif + + assert(naxes == NAXES); + assert(lookup != NULL); + assert(pix != NULL); + assert(foc != NULL); + +#ifndef NDEBUG + for (k = 0; k < naxes; ++k) { + if (lookup[k] != NULL) { + assert(lookup[k]->data != NULL); + } + } +#endif + + if (pix == NULL || foc == NULL) { + return 1; + } + + pixend = pix + nelem * NAXES; + /* This can't be parallelized, because pix may be equal to foc */ + /* For the same reason, i needs to be in the inner loop */ + for (pix0 = pix, foc0 = foc; pix0 < pixend; pix0 += NAXES, foc0 += NAXES) { + for (i = 0; i < NAXES; ++i) { + if (lookup[i]) { + foc0[i] += get_distortion_offset(lookup[i], pix0); + } + } + } + + return 0; +} + +int +p4_pix2foc( + const unsigned int naxes, + const distortion_lookup_t **lookup, /* [NAXES] */ + const unsigned int nelem, + const double* pix, /* [NAXES][nelem] */ + double *foc /* [NAXES][nelem] */) { + + assert(pix); + assert(foc); + + if (pix != foc) { + memcpy(foc, pix, sizeof(double) * naxes * nelem); + } + + return p4_pix2deltas(naxes, lookup, nelem, pix, foc); +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/distortion_wrap.c b/testbed/astropy__astropy/astropy/wcs/src/distortion_wrap.c new file mode 100644 index 0000000000000000000000000000000000000000..100f6a7061f05a82cb41dc25a81965ab19e2e14a --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/distortion_wrap.c @@ -0,0 +1,354 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/distortion_wrap.h" +#include "astropy_wcs/docstrings.h" + +#include /* From Python */ + +static int +PyDistLookup_traverse( + PyDistLookup* self, + visitproc visit, + void* arg) { + + Py_VISIT(self->py_data); + + return 0; +} + +static int +PyDistLookup_clear( + PyDistLookup* self) { + + PyObject* tmp; + + tmp = (PyObject*)self->py_data; + self->py_data = NULL; + Py_XDECREF(tmp); + + return 0; +} + +static void +PyDistLookup_dealloc( + PyDistLookup* self) { + + distortion_lookup_t_free(&self->x); + Py_XDECREF(self->py_data); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +/*@null@*/ static PyObject * +PyDistLookup_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyDistLookup* self; + + self = (PyDistLookup*)type->tp_alloc(type, 0); + if (self != NULL) { + if (distortion_lookup_t_init(&self->x)) { + return NULL; + } + self->py_data = NULL; + } + return (PyObject*)self; +} + +static int +PyDistLookup_init( + PyDistLookup* self, + PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyObject* py_array_obj = NULL; + PyArrayObject* array_obj = NULL; + + if (!PyArg_ParseTuple(args, "O(dd)(dd)(dd):DistortionLookupTable.__init__", + &py_array_obj, + &(self->x.crpix[0]), &(self->x.crpix[1]), + &(self->x.crval[0]), &(self->x.crval[1]), + &(self->x.cdelt[0]), &(self->x.cdelt[1]))) { + return -1; + } + + array_obj = (PyArrayObject*)PyArray_ContiguousFromAny(py_array_obj, NPY_FLOAT32, 2, 2); + if (array_obj == NULL) { + return -1; + } + + self->py_data = array_obj; + self->x.naxis[0] = (unsigned int)PyArray_DIM(array_obj, 1); + self->x.naxis[1] = (unsigned int)PyArray_DIM(array_obj, 0); + self->x.data = (float *)PyArray_DATA(array_obj); + + return 0; +} + +static PyObject* +PyDistLookup_get_cdelt( + PyDistLookup* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 2; + + return get_double_array("cdelt", self->x.cdelt, 1, &naxis, (PyObject*)self); +} + +static int +PyDistLookup_set_cdelt( + PyDistLookup* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 2; + + return set_double_array("cdelt", value, 1, &naxis, self->x.cdelt); +} + +static PyObject* +PyDistLookup_get_crpix( + PyDistLookup* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 2; + + return get_double_array("crpix", self->x.crpix, 1, &naxis, (PyObject*)self); +} + +static int +PyDistLookup_set_crpix( + PyDistLookup* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 2; + + return set_double_array("crpix", value, 1, &naxis, self->x.crpix); +} + +static PyObject* +PyDistLookup_get_crval( + PyDistLookup* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 2; + + return get_double_array("crval", self->x.crval, 1, &naxis, (PyObject*)self); +} + +static int +PyDistLookup_set_crval( + PyDistLookup* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 2; + + return set_double_array("crval", value, 1, &naxis, self->x.crval); +} + +/*@shared@*/ static PyObject* +PyDistLookup_get_data( + PyDistLookup* self, + /*@unused@*/ void* closure) { + + if (self->py_data == NULL) { + Py_INCREF(Py_None); + return Py_None; + } else { + Py_INCREF(self->py_data); + return (PyObject*)self->py_data; + } +} + +static int +PyDistLookup_set_data( + PyDistLookup* self, + PyObject* value, + /*@unused@*/ void* closure) { + + PyArrayObject* value_array = NULL; + + if (value == NULL) { + Py_XDECREF(self->py_data); + self->py_data = NULL; + self->x.data = NULL; + return 0; + } + + value_array = (PyArrayObject*)PyArray_ContiguousFromAny(value, NPY_FLOAT32, 2, 2); + + if (value_array == NULL) { + return -1; + } + + Py_XDECREF(self->py_data); + + self->py_data = value_array; + self->x.naxis[0] = (unsigned int)PyArray_DIM(value_array, 1); + self->x.naxis[1] = (unsigned int)PyArray_DIM(value_array, 0); + self->x.data = (float *)PyArray_DATA(value_array); + + return 0; +} + +/*@null@*/ static PyObject* +PyDistLookup_get_offset( + PyDistLookup* self, + PyObject* args, + /*@unused@*/ PyObject* kwds) { + + double coord[NAXES]; + double result; + + if (self->x.data == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "No data has been set for the lookup table"); + return NULL; + } + + if (!PyArg_ParseTuple(args, "dd:get_offset", &coord[0], &coord[1])) { + return NULL; + } + + result = get_distortion_offset(&self->x, coord); + return PyFloat_FromDouble(result); +} + +static PyObject* +PyDistLookup___copy__( + PyDistLookup* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyDistLookup* copy = NULL; + int i = 0; + + copy = (PyDistLookup*)PyDistLookup_new(&PyDistLookupType, NULL, NULL); + if (copy == NULL) { + return NULL; + } + + for (i = 0; i < 2; ++i) { + copy->x.naxis[i] = self->x.naxis[i]; + copy->x.crpix[i] = self->x.crpix[i]; + copy->x.crval[i] = self->x.crval[i]; + copy->x.cdelt[i] = self->x.cdelt[i]; + } + + if (self->py_data) { + PyDistLookup_set_data(copy, (PyObject*)self->py_data, NULL); + } + + return (PyObject*)copy; +} + +static PyObject* +PyDistLookup___deepcopy__( + PyDistLookup* self, + PyObject* memo, + /*@unused@*/ PyObject* kwds) { + + PyDistLookup* copy; + PyObject* obj_copy; + int i = 0; + + copy = (PyDistLookup*)PyDistLookup_new(&PyDistLookupType, NULL, NULL); + if (copy == NULL) { + return NULL; + } + + for (i = 0; i < 2; ++i) { + copy->x.naxis[i] = self->x.naxis[i]; + copy->x.crpix[i] = self->x.crpix[i]; + copy->x.crval[i] = self->x.crval[i]; + copy->x.cdelt[i] = self->x.cdelt[i]; + } + + if (self->py_data) { + obj_copy = get_deepcopy((PyObject*)self->py_data, memo); + if (obj_copy == NULL) { + Py_DECREF(copy); + return NULL; + } + PyDistLookup_set_data(copy, (PyObject*)obj_copy, NULL); + Py_DECREF(obj_copy); + } + + return (PyObject*)copy; +} + + +static PyGetSetDef PyDistLookup_getset[] = { + {"cdelt", (getter)PyDistLookup_get_cdelt, (setter)PyDistLookup_set_cdelt, (char *)doc_cdelt}, + {"crpix", (getter)PyDistLookup_get_crpix, (setter)PyDistLookup_set_crpix, (char *)doc_crpix}, + {"crval", (getter)PyDistLookup_get_crval, (setter)PyDistLookup_set_crval, (char *)doc_crval}, + {"data", (getter)PyDistLookup_get_data, (setter)PyDistLookup_set_data, (char *)doc_data}, + {NULL} +}; + +static PyMethodDef PyDistLookup_methods[] = { + {"__copy__", (PyCFunction)PyDistLookup___copy__, METH_NOARGS, NULL}, + {"__deepcopy__", (PyCFunction)PyDistLookup___deepcopy__, METH_O, NULL}, + {"get_offset", (PyCFunction)PyDistLookup_get_offset, METH_VARARGS, doc_get_offset}, + {NULL} +}; + +PyTypeObject PyDistLookupType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.DistortionLookupTable", /*tp_name*/ + sizeof(PyDistLookup), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PyDistLookup_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + doc_DistortionLookupTable, /* tp_doc */ + (traverseproc)PyDistLookup_traverse, /* tp_traverse */ + (inquiry)PyDistLookup_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + PyDistLookup_methods, /* tp_methods */ + 0, /* tp_members */ + PyDistLookup_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)PyDistLookup_init, /* tp_init */ + 0, /* tp_alloc */ + PyDistLookup_new, /* tp_new */ +}; + +int _setup_distortion_type( + PyObject* m) { + + if (PyType_Ready(&PyDistLookupType) < 0) { + return -1; + } + + Py_INCREF(&PyDistLookupType); + return PyModule_AddObject(m, "DistortionLookupTable", (PyObject *)&PyDistLookupType); +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/pipeline.c b/testbed/astropy__astropy/astropy/wcs/src/pipeline.c new file mode 100644 index 0000000000000000000000000000000000000000..fd6501c457c263875c37407584e13e6ce47ae2a3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/pipeline.c @@ -0,0 +1,271 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#include "astropy_wcs/pipeline.h" +#include "astropy_wcs/util.h" +#include "wcserr.h" +#include +#include +#include + +#define PIP_ERRMSG(status) WCSERR_SET(status) + +void +pipeline_clear( + pipeline_t* pipeline) { + + pipeline->det2im[0] = NULL; + pipeline->det2im[1] = NULL; + pipeline->sip = NULL; + pipeline->cpdis[0] = NULL; + pipeline->cpdis[1] = NULL; + pipeline->wcs = NULL; + pipeline->err = NULL; +} + +void +pipeline_init( + pipeline_t* pipeline, + /*@shared@*/ distortion_lookup_t** det2im /* [2] */, + /*@shared@*/ sip_t* sip, + /*@shared@*/ distortion_lookup_t** cpdis /* [2] */, + /*@shared@*/ struct wcsprm* wcs) { + + pipeline->det2im[0] = det2im[0]; + pipeline->det2im[1] = det2im[1]; + pipeline->sip = sip; + pipeline->cpdis[0] = cpdis[0]; + pipeline->cpdis[1] = cpdis[1]; + pipeline->wcs = wcs; + pipeline->err = NULL; +} + +void +pipeline_free( + pipeline_t* pipeline) { + + free(pipeline->err); + pipeline->err = NULL; +} + +int +pipeline_all_pixel2world( + pipeline_t* pipeline, + const unsigned int ncoord, + const unsigned int nelem, + const double* const pixcrd /* [ncoord][nelem] */, + double* world /* [ncoord][nelem] */) { + + static const char* function = "pipeline_all_pixel2world"; + + const double* wcs_input = NULL; + double* wcs_output = NULL; + int has_det2im; + int has_sip; + int has_p4; + int has_wcs; + int status = 1; + struct wcserr **err; + + /* Temporary buffer for performing WCS calculations */ + unsigned char* buffer = NULL; + unsigned char* mem = NULL; + /*@null@*/ double* tmp; + /*@null@*/ double* imgcrd; + /*@null@*/ double* phi; + /*@null@*/ double* theta; + /*@null@*/ int* stat; + + if (pipeline == NULL || pixcrd == NULL || world == NULL) { + return WCSERR_NULL_POINTER; + } + + err = &(pipeline->err); + + has_det2im = pipeline->det2im[0] != NULL || pipeline->det2im[1] != NULL; + has_sip = pipeline->sip != NULL; + has_p4 = pipeline->cpdis[0] != NULL || pipeline->cpdis[1] != NULL; + has_wcs = pipeline->wcs != NULL; + + if (has_det2im || has_sip || has_p4) { + if (nelem != 2) { + status = wcserr_set( + PIP_ERRMSG(WCSERR_BAD_COORD_TRANS), + "Data must be 2-dimensional when Paper IV lookup table or SIP transform is present."); + goto exit; + } + } + + if (has_wcs) { + if (ncoord < 1) { + status = wcserr_set( + PIP_ERRMSG(WCSERR_BAD_PIX), + "The number of coordinates must be > 0"); + goto exit; + } + + buffer = mem = malloc( + ncoord * nelem * sizeof(double) + /* imgcrd */ + ncoord * sizeof(double) + /* phi */ + ncoord * sizeof(double) + /* theta */ + ncoord * nelem * sizeof(double) + /* tmp */ + ncoord * nelem * sizeof(int) /* stat */ + ); + + if (buffer == NULL) { + status = wcserr_set( + PIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + + imgcrd = (double *)mem; + mem += ncoord * nelem * sizeof(double); + + phi = (double *)mem; + mem += ncoord * sizeof(double); + + theta = (double *)mem; + mem += ncoord * sizeof(double); + + tmp = (double *)mem; + mem += ncoord * nelem * sizeof(double); + + stat = (int *)mem; + /* mem += ncoord * nelem * sizeof(int); */ + + if (has_det2im || has_sip || has_p4) { + status = pipeline_pix2foc(pipeline, ncoord, nelem, pixcrd, tmp); + if (status != 0) { + goto exit; + } + + wcs_input = tmp; + wcs_output = world; + } else { + wcs_input = pixcrd; + wcs_output = world; + } + + if ((status = wcsp2s(pipeline->wcs, (int)ncoord, (int)nelem, wcs_input, imgcrd, + phi, theta, wcs_output, stat))) { + if (pipeline->err == NULL) { + pipeline->err = calloc(1, sizeof(struct wcserr)); + } + wcserr_copy(pipeline->wcs->err, pipeline->err); + } + + if (status == 8) { + set_invalid_to_nan((int)ncoord, (int)nelem, wcs_output, stat); + } + } else { + if (has_det2im || has_sip || has_p4) { + status = pipeline_pix2foc(pipeline, ncoord, nelem, pixcrd, world); + } + } + + exit: + free(buffer); + + return status; +} + +int pipeline_pix2foc( + pipeline_t* pipeline, + const unsigned int ncoord, + const unsigned int nelem, + const double* const pixcrd /* [ncoord][nelem] */, + double* foc /* [ncoord][nelem] */) { + + static const char* function = "pipeline_pix2foc"; + + int has_det2im; + int has_sip; + int has_p4; + const double * input = NULL; + double * tmp = NULL; + int status = 1; + struct wcserr **err; + + assert(nelem == 2); + assert(pixcrd != foc); + + if (pipeline == NULL || pixcrd == NULL || foc == NULL) { + return WCSERR_NULL_POINTER; + } + + err = &(pipeline->err); + + if (ncoord < 1) { + status = wcserr_set( + PIP_ERRMSG(WCSERR_BAD_PIX), + "The number of coordinates must be > 0"); + goto exit; + } + + has_det2im = pipeline->det2im[0] != NULL || pipeline->det2im[1] != NULL; + has_sip = pipeline->sip != NULL; + has_p4 = pipeline->cpdis[0] != NULL || pipeline->cpdis[1] != NULL; + + if (has_det2im) { + if (has_sip || has_p4) { + tmp = malloc(ncoord * nelem * sizeof(double)); + if (tmp == NULL) { + status = wcserr_set( + PIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + + memcpy(tmp, pixcrd, sizeof(double) * ncoord * nelem); + + status = p4_pix2deltas(2, (void*)pipeline->det2im, ncoord, pixcrd, tmp); + if (status) { + wcserr_set(PIP_ERRMSG(WCSERR_NULL_POINTER), "NULL pointer passed"); + goto exit; + } + + input = tmp; + memcpy(foc, input, sizeof(double) * ncoord * nelem); + } else { + memcpy(foc, pixcrd, sizeof(double) * ncoord * nelem); + + status = p4_pix2deltas(2, (void*)pipeline->det2im, ncoord, pixcrd, foc); + if (status) { + wcserr_set(PIP_ERRMSG(WCSERR_NULL_POINTER), "NULL pointer passed"); + goto exit; + } + } + } else { + /* Copy pixcrd to foc as a starting point. The "deltas" functions + below will undistort from there */ + memcpy(foc, pixcrd, sizeof(double) * ncoord * nelem); + input = pixcrd; + } + + if (has_sip) { + status = sip_pix2deltas(pipeline->sip, 2, ncoord, input, foc); + if (status) { + if (pipeline->err == NULL) { + pipeline->err = calloc(1, sizeof(struct wcserr)); + } + wcserr_copy(pipeline->sip->err, pipeline->err); + goto exit; + } + } + + if (has_p4) { + status = p4_pix2deltas(2, (void*)pipeline->cpdis, ncoord, input, foc); + if (status) { + wcserr_set(PIP_ERRMSG(WCSERR_NULL_POINTER), "NULL pointer passed"); + goto exit; + } + } + + status = 0; + + exit: + free(tmp); + + return status; +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/pyutil.c b/testbed/astropy__astropy/astropy/wcs/src/pyutil.c new file mode 100644 index 0000000000000000000000000000000000000000..8b866417ee7ef5e40f7c0b3f0ac8f00d3bb7a618 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/pyutil.c @@ -0,0 +1,947 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +/* util.h must be imported first */ +#include "astropy_wcs/pyutil.h" + +#include "astropy_wcs/docstrings.h" + +#include "wcsfix.h" +#include "wcshdr.h" +#include "wcsprintf.h" +#include "wcsunits.h" + +/*@null@*/ static INLINE PyObject* +_PyArrayProxy_New( + /*@shared@*/ PyObject* self, + int nd, + const npy_intp* dims, + int typenum, + const void* data, + const int flags) { + + PyArray_Descr* type_descr = NULL; + PyObject* result = NULL; + + type_descr = (PyArray_Descr*)PyArray_DescrFromType(typenum); + if (type_descr == NULL) { + return NULL; + } + + result = (PyObject*)PyArray_NewFromDescr( + &PyArray_Type, + type_descr, + nd, (npy_intp*)dims, + NULL, + (void*)data, + NPY_ARRAY_C_CONTIGUOUS | flags, + NULL); + + if (result == NULL) { + return NULL; + } + Py_INCREF(self); + PyArray_SetBaseObject((PyArrayObject *)result, self); + return result; +} + +/*@null@*/ PyObject* +PyArrayProxy_New( + /*@shared@*/ PyObject* self, + int nd, + const npy_intp* dims, + int typenum, + const void* data) { + + return _PyArrayProxy_New(self, nd, dims, typenum, data, NPY_ARRAY_WRITEABLE); +} + +/*@null@*/ PyObject* +PyArrayReadOnlyProxy_New( + /*@shared@*/ PyObject* self, + int nd, + const npy_intp* dims, + int typenum, + const void* data) { + + return _PyArrayProxy_New(self, nd, dims, typenum, data, 0); +} + +void +preoffset_array( + PyArrayObject* array, + int value) { + + npy_intp size; + double *data; + + if (value == 1) { + return; + } + + size = PyArray_Size((PyObject*)array); + data = (double*)PyArray_DATA(array); + offset_c_array(data, size, (double)(1 - value)); +} + +void +unoffset_array( + PyArrayObject* array, + int value) { + + npy_intp size; + double *data; + + if (value == 1) { + return; + } + + size = PyArray_Size((PyObject*)array); + data = (double*)PyArray_DATA(array); + offset_c_array(data, size, (double)-(1 - value)); +} + +void +copy_array_to_c_double( + PyArrayObject* array, + double* dest) { + + npy_intp size = 1; + double* data = NULL; + + size = PyArray_Size((PyObject*)array); + data = (double*)PyArray_DATA(array); + + memcpy(dest, data, size * sizeof(double)); +} + +void +copy_array_to_c_int( + PyArrayObject* array, + int* dest) { + + npy_intp size = 1; + int* data = NULL; + + size = PyArray_Size((PyObject*)array); + data = (int*)PyArray_DATA(array); + + memcpy(dest, data, size * sizeof(int)); +} + +int +is_null( + /*@null@*/ void *p) { + + if (p == NULL) { + PyErr_SetString(PyExc_AssertionError, "Underlying object is NULL."); + return 1; + } + return 0; +} + +/* wcslib represents undefined values using its own special constant, + UNDEFINED. To be consistent with the Pythonic way of doing things, + it's nicer to represent undefined values using NaN. Unfortunately, + in order to get nice mutable arrays in Python, Python must be able + to edit the wcsprm values directly. The solution is to store NaNs + in the struct "canonically", but convert those NaNs to/from + UNDEFINED around every call into a wcslib function. It's not as + computationally expensive as it sounds, as all these arrays are + quite small. +*/ + +static INLINE void +wcsprm_fix_values( + struct wcsprm* x, + value_fixer_t value_fixer) { + + unsigned int naxis = (unsigned int)x->naxis; + + value_fixer(x->cd, naxis * naxis); + value_fixer(x->cdelt, naxis); + value_fixer(x->crder, naxis); + value_fixer(x->crota, naxis); + value_fixer(x->crpix, naxis); + value_fixer(x->crval, naxis); + value_fixer(x->csyer, naxis); + value_fixer(&x->equinox, 1); + value_fixer(&x->latpole, 1); + value_fixer(&x->lonpole, 1); + value_fixer(&x->mjdavg, 1); + value_fixer(&x->mjdobs, 1); + value_fixer(x->obsgeo, 6); + value_fixer(&x->cel.phi0, 1); + value_fixer(&x->restfrq, 1); + value_fixer(&x->restwav, 1); + value_fixer(&x->cel.theta0, 1); + value_fixer(&x->velangl, 1); + value_fixer(&x->velosys, 1); + value_fixer(&x->zsource, 1); + value_fixer(x->czphs, naxis); + value_fixer(x->cperi, naxis); + value_fixer(x->mjdref, 2); + value_fixer(&x->mjdbeg, 1); + value_fixer(&x->mjdend, 1); + value_fixer(&x->jepoch, 1); + value_fixer(&x->bepoch, 1); + value_fixer(&x->tstart, 1); + value_fixer(&x->tstop, 1); + value_fixer(&x->xposure, 1); + value_fixer(&x->timsyer, 1); + value_fixer(&x->timrder, 1); + value_fixer(&x->timedel, 1); + value_fixer(&x->timepixr, 1); + value_fixer(&x->timeoffs, 1); + value_fixer(&x->telapse, 1); +} + +void +wcsprm_c2python( + /*@null@*/ struct wcsprm* x) { + + if (x != NULL) { + wcsprm_fix_values(x, &undefined2nan); + } +} + +void +wcsprm_python2c( + /*@null@*/ struct wcsprm* x) { + + if (x != NULL) { + wcsprm_fix_values(x, &nan2undefined); + } +} + +/*************************************************************************** + * Exceptions * + ***************************************************************************/ + +PyObject* WcsExc_Wcs; +PyObject* WcsExc_SingularMatrix; +PyObject* WcsExc_InconsistentAxisTypes; +PyObject* WcsExc_InvalidTransform; +PyObject* WcsExc_InvalidCoordinate; +PyObject* WcsExc_NoSolution; +PyObject* WcsExc_InvalidSubimageSpecification; +PyObject* WcsExc_NonseparableSubimageCoordinateSystem; +PyObject* WcsExc_NoWcsKeywordsFound; +PyObject* WcsExc_InvalidTabularParameters; + +/* This is an array mapping the wcs status codes to Python exception + * types. The exception string is stored as part of wcslib itself in + * wcs_errmsg. + */ +PyObject** wcs_errexc[14]; + +static PyObject* +_new_exception_with_doc(char *name, char *doc, PyObject *base) +{ + return PyErr_NewExceptionWithDoc(name, doc, base, NULL); +} + +#define DEFINE_EXCEPTION(exc) \ + WcsExc_##exc = _new_exception_with_doc( \ + "astropy.wcs._wcs." #exc "Error", \ + doc_##exc, \ + WcsExc_Wcs); \ + if (WcsExc_##exc == NULL) \ + return 1; \ + PyModule_AddObject(m, #exc "Error", WcsExc_##exc); \ + +int +_define_exceptions( + PyObject* m) { + + WcsExc_Wcs = _new_exception_with_doc( + "astropy.wcs._wcs.WcsError", + doc_WcsError, + PyExc_ValueError); + if (WcsExc_Wcs == NULL) { + return 1; + } + PyModule_AddObject(m, "WcsError", WcsExc_Wcs); + + DEFINE_EXCEPTION(SingularMatrix); + DEFINE_EXCEPTION(InconsistentAxisTypes); + DEFINE_EXCEPTION(InvalidTransform); + DEFINE_EXCEPTION(InvalidCoordinate); + DEFINE_EXCEPTION(NoSolution); + DEFINE_EXCEPTION(InvalidSubimageSpecification); + DEFINE_EXCEPTION(NonseparableSubimageCoordinateSystem); + DEFINE_EXCEPTION(NoWcsKeywordsFound); + DEFINE_EXCEPTION(InvalidTabularParameters); + return 0; +} + +const char* +wcslib_get_error_message(int status) { + return wcs_errmsg[status]; +} + +void +wcserr_to_python_exc(const struct wcserr *err) { + PyObject *exc; + if (err == NULL) { + PyErr_SetString(PyExc_RuntimeError, "NULL error object in wcslib"); + } else { + if (err->status > 0 && err->status <= WCS_ERRMSG_MAX) { + exc = *wcs_errexc[err->status]; + } else { + exc = PyExc_RuntimeError; + } + /* This is technically not thread-safe -- make sure we have the GIL */ + wcsprintf_set(NULL); + wcserr_prt(err, ""); + PyErr_SetString(exc, wcsprintf_buf()); + } +} + +void +wcs_to_python_exc(const struct wcsprm *wcs) { + PyObject* exc; + const struct wcserr *err = wcs->err; + if (err == NULL) { + PyErr_SetString(PyExc_RuntimeError, "NULL error object in wcslib"); + } else { + if (err->status > 0 && err->status < WCS_ERRMSG_MAX) { + exc = *wcs_errexc[err->status]; + } else { + exc = PyExc_RuntimeError; + } + /* This is technically not thread-safe -- make sure we have the GIL */ + wcsprintf_set(NULL); + wcsperr(wcs, ""); + PyErr_SetString(exc, wcsprintf_buf()); + } +} + +void +wcserr_fix_to_python_exc(const struct wcserr *err) { + PyObject *exc; + if (err == NULL) { + PyErr_SetString(PyExc_RuntimeError, "NULL error object in wcslib"); + } else { + if (err->status > 0 && err->status <= FIXERR_NO_REF_PIX_VAL) { + exc = PyExc_ValueError; + } else { + exc = PyExc_RuntimeError; + } + /* This is technically not thread-safe -- make sure we have the GIL */ + wcsprintf_set(NULL); + wcserr_prt(err, ""); + PyErr_SetString(exc, wcsprintf_buf()); + } +} + +void +wcshdr_err_to_python_exc(int status) { + if (status > 0 && status != WCSHDRERR_PARSER) { + PyErr_SetString(PyExc_MemoryError, "Memory allocation error"); + } else { + PyErr_SetString(PyExc_ValueError, "Internal error in wcslib header parser"); + } +} + + +/*************************************************************************** + Property helpers + ***************************************************************************/ + +#define SHAPE_STR_LEN 2048 + +/* Helper function to display the desired shape of an array as a + string, eg. 2x2 */ +static void +shape_to_string( + int ndims, + const npy_intp* dims, + char* str /* [SHAPE_STR_LEN] */) { + + int i; + char value[32]; /* More than large enough to hold string rep of a + 64-bit integer (way overkill) */ + + if (ndims > 3) { + strncpy(str, "ERROR", 6); + return; + } + + str[0] = 0; + for (i = 0; i < ndims; ++i) { + snprintf(value, 32, "%d", (int)dims[i]); + strncat(str, value, 32); + if (i != ndims - 1) { + strncat(str, "x", 2); + } + } +} + +/* get_string is inlined */ + +int +set_string( + const char* propname, + PyObject* value, + char* dest, + Py_ssize_t maxlen) { + + char* buffer; + Py_ssize_t len; + PyObject* ascii_obj = NULL; + int result = -1; + + if (check_delete(propname, value)) { + return -1; + } + + if (PyUnicode_Check(value)) { + ascii_obj = PyUnicode_AsASCIIString(value); + if (ascii_obj == NULL) { + goto end; + } + if (PyBytes_AsStringAndSize(ascii_obj, &buffer, &len) == -1) { + goto end; + } + } else if (PyBytes_Check(value)) { + if (PyBytes_AsStringAndSize(value, &buffer, &len) == -1) { + goto end; + } + } else { + PyErr_SetString(PyExc_TypeError, "value must be bytes or unicode"); + goto end; + } + + if (len > maxlen) { + PyErr_Format( + PyExc_ValueError, + "'%s' must be less than %u characters", + propname, + (unsigned int)maxlen); + goto end; + } + + strncpy(dest, buffer, (size_t)maxlen); + + result = 0; + + end: + Py_XDECREF(ascii_obj); + + return result; +} + +/* get_bool is inlined */ + +int +set_bool( + const char* propname, + PyObject* value, + int* dest) { + + if (check_delete(propname, value)) { + return -1; + } + + *dest = PyObject_IsTrue(value); + + return 0; +} + +/* get_int is inlined */ + +int +set_int( + const char* propname, + PyObject* value, + int* dest) { + long value_int; + + if (check_delete(propname, value)) { + return -1; + } + + value_int = PyLong_AsLong(value); + if (value_int == -1 && PyErr_Occurred()) { + return -1; + } + + if ((unsigned long)value_int > 0x7fffffff) { + PyErr_SetString(PyExc_OverflowError, "integer value too large"); + return -1; + } + + *dest = (int)value_int; + + return 0; +} + +/* get_double is inlined */ + +int +set_double( + const char* propname, + PyObject* value, + double* dest) { + + if (check_delete(propname, value)) { + return -1; + } + + *dest = PyFloat_AsDouble(value); + + if (PyErr_Occurred()) { + return -1; + } else { + return 0; + } +} + +/* get_double_array is inlined */ + +int +set_double_array( + const char* propname, + PyObject* value, + int ndims, + const npy_intp* dims, + double* dest) { + + PyArrayObject* value_array = NULL; + npy_int i = 0; + char shape_str[SHAPE_STR_LEN]; + + if (check_delete(propname, value)) { + return -1; + } + + value_array = (PyArrayObject*)PyArray_ContiguousFromAny(value, NPY_DOUBLE, + ndims, ndims); + if (value_array == NULL) { + return -1; + } + + if (dims != NULL) { + for (i = 0; i < ndims; ++i) { + if (PyArray_DIM(value_array, i) != dims[i]) { + shape_to_string(ndims, dims, shape_str); + PyErr_Format( + PyExc_ValueError, + "'%s' array is the wrong shape, must be %s", + propname, shape_str); + Py_DECREF(value_array); + return -1; + } + } + } + + copy_array_to_c_double(value_array, dest); + + Py_DECREF(value_array); + + return 0; +} + +int +set_int_array( + const char* propname, + PyObject* value, + int ndims, + const npy_intp* dims, + int* dest) { + PyArrayObject* value_array = NULL; + npy_int i = 0; + char shape_str[SHAPE_STR_LEN]; + + if (check_delete(propname, value)) { + return -1; + } + + value_array = (PyArrayObject*)PyArray_ContiguousFromAny(value, NPY_INT, + ndims, ndims); + if (value_array == NULL) { + return -1; + } + + if (dims != NULL) { + for (i = 0; i < ndims; ++i) { + if (PyArray_DIM(value_array, i) != dims[i]) { + shape_to_string(ndims, dims, shape_str); + PyErr_Format( + PyExc_ValueError, + "'%s' array is the wrong shape, must be %s", + propname, shape_str); + Py_DECREF(value_array); + return -1; + } + } + } + + copy_array_to_c_int(value_array, dest); + + Py_DECREF(value_array); + + return 0; +} + +/* get_str_list is inlined */ + +int +set_str_list( + const char* propname, + PyObject* value, + Py_ssize_t len, + Py_ssize_t maxlen, + char (*dest)[72]) { + + PyObject* str = NULL; + Py_ssize_t input_len; + Py_ssize_t i = 0; + + if (check_delete(propname, value)) { + return -1; + } + + if (maxlen == 0) { + maxlen = 68; + } + + if (!PySequence_Check(value)) { + PyErr_Format( + PyExc_TypeError, + "'%s' must be a sequence of strings", + propname); + return -1; + } + + if (PySequence_Size(value) != len) { + PyErr_Format( + PyExc_ValueError, + "len(%s) must be %u", + propname, + (unsigned int)len); + return -1; + } + + /* We go through the list twice, once to verify that the list is + in the correct format, and then again to do the data copy. This + way, we won't partially copy the contents and then throw an + exception. */ + for (i = 0; i < len; ++i) { + str = PySequence_GetItem(value, i); + if (str == NULL) { + return -1; + } + + if (!(PyBytes_CheckExact(str) || PyUnicode_CheckExact(str))) { + PyErr_Format( + PyExc_TypeError, + "'%s' must be a sequence of bytes or strings", + propname); + Py_DECREF(str); + return -1; + } + + input_len = PySequence_Size(str); + if (input_len > maxlen) { + PyErr_Format( + PyExc_ValueError, + "Each entry in '%s' must be less than %u characters", + propname, (unsigned int)maxlen); + Py_DECREF(str); + return -1; + } else if (input_len == -1) { + Py_DECREF(str); + return -1; + } + + Py_DECREF(str); + } + + for (i = 0; i < len; ++i) { + str = PySequence_GetItem(value, i); + if (str == NULL) { + /* Theoretically, something has gone really wrong here, since + we've already verified the list. */ + PyErr_Clear(); + PyErr_Format( + PyExc_RuntimeError, + "Input values have changed underneath us. Something is seriously wrong."); + return -1; + } + + if (set_string(propname, str, dest[i], maxlen)) { + PyErr_Clear(); + PyErr_Format( + PyExc_RuntimeError, + "Input values have changed underneath us. Something is seriously wrong."); + Py_DECREF(str); + return -1; + } + + Py_DECREF(str); + } + + return 0; +} + + +/*@null@*/ PyObject* +get_pscards( + /*@unused@*/ const char* propname, + struct pscard* ps, + int nps) { + + PyObject* result = NULL; + PyObject* subresult = NULL; + Py_ssize_t i = 0; + + if (nps < 0) { + nps = 0; + } + + result = PyList_New((Py_ssize_t)nps); + if (result == NULL) { + return NULL; + } + + if (nps && ps == NULL) { + PyErr_SetString(PyExc_MemoryError, "NULL pointer"); + return NULL; + } + + for (i = 0; i < (Py_ssize_t)nps; ++i) { + subresult = Py_BuildValue("iis", ps[i].i, ps[i].m, ps[i].value); + if (subresult == NULL) { + Py_DECREF(result); + return NULL; + } + + if (PyList_SetItem(result, i, subresult)) { + Py_DECREF(subresult); + Py_DECREF(result); + return NULL; + } + } + + return result; +} + +int +set_pscards( + /*@unused@*/ const char* propname, + PyObject* value, + struct pscard** ps, + int *nps, + int *npsmax) { + + PyObject* subvalue = NULL; + Py_ssize_t i = 0; + Py_ssize_t size = 0; + int ival = 0; + int mval = 0; + const char* strvalue = 0; + void* newmem = NULL; + + if (!PySequence_Check(value)) + return -1; + size = PySequence_Size(value); + if (size > 0x7fffffff) { + /* Must be a 32-bit size */ + return -1; + } + + if (size > (Py_ssize_t)*npsmax) { + newmem = malloc(sizeof(struct pscard) * size); + if (newmem == NULL) { + PyErr_SetString(PyExc_MemoryError, "Could not allocate memory."); + return -1; + } + free(*ps); + *ps = newmem; + *npsmax = (int)size; + } + + /* Verify the entire list for correct types first, so we don't have + to undo anything copied into the canonical array. */ + for (i = 0; i < size; ++i) { + subvalue = PySequence_GetItem(value, i); + if (subvalue == NULL) { + return -1; + } + if (!PyArg_ParseTuple(subvalue, "iis", &ival, &mval, &strvalue)) { + Py_DECREF(subvalue); + return -1; + } + Py_DECREF(subvalue); + } + + for (i = 0; i < size; ++i) { + subvalue = PySequence_GetItem(value, i); + if (subvalue == NULL) { + return -1; + } + if (!PyArg_ParseTuple(subvalue, "iis", &ival, &mval, &strvalue)) { + Py_DECREF(subvalue); + return -1; + } + Py_DECREF(subvalue); + + (*ps)[i].i = ival; + (*ps)[i].m = mval; + strncpy((*ps)[i].value, strvalue, 72); + (*ps)[i].value[71] = '\0'; + (*nps) = (int)(i + 1); + } + + return 0; +} + +/*@null@*/ PyObject* +get_pvcards( + /*@unused@*/ const char* propname, + struct pvcard* pv, + int npv) { + + PyObject* result = NULL; + PyObject* subresult = NULL; + Py_ssize_t i = 0; + + if (npv < 0) { + npv = 0; + } + + result = PyList_New((Py_ssize_t)npv); + if (result == NULL) { + return NULL; + } + + if (npv && pv == NULL) { + PyErr_SetString(PyExc_MemoryError, "NULL pointer"); + return NULL; + } + + for (i = 0; i < (Py_ssize_t)npv; ++i) { + subresult = Py_BuildValue("iid", pv[i].i, pv[i].m, pv[i].value); + if (subresult == NULL) { + Py_DECREF(result); + return NULL; + } + + if (PyList_SetItem(result, i, subresult)) { + Py_DECREF(subresult); + Py_DECREF(result); + return NULL; + } + } + + return result; +} + +int +set_pvcards( + /*@propname@*/ const char* propname, + PyObject* value, + struct pvcard** pv, + int *npv, + int *npvmax) { + + PyObject* fastseq = NULL; + struct pvcard* newmem = NULL; + Py_ssize_t size; + int ret = -1; + int i; + + fastseq = PySequence_Fast(value, "Expected sequence type"); + if (!fastseq) + goto done; + + size = PySequence_Fast_GET_SIZE(value); + newmem = malloc(sizeof(struct pvcard) * size); + + /* Raise exception if size is nonzero but newmem + * could not be allocated. */ + if (size && !newmem) { + PyErr_SetString(PyExc_MemoryError, "Could not allocate memory."); + return -1; + } + + for (i = 0; i < size; ++i) + { + if (!PyArg_ParseTuple(PySequence_Fast_GET_ITEM(value, i), "iid", + &newmem[i].i, &newmem[i].m, &newmem[i].value)) + { + goto done; + } + } + + if (size <= (Py_ssize_t)*npvmax) { + memcpy(*pv, newmem, sizeof(struct pvcard) * size); + } else { /* (size > (Py_ssize_t)*npvmax) */ + free(*pv); + *npv = (int)size; + *pv = newmem; + newmem = NULL; + } + *npv = (int)size; + + ret = 0; +done: + Py_XDECREF(fastseq); + free(newmem); + return ret; +} + +PyObject* +get_deepcopy( + PyObject* obj, + PyObject* memo) { + + if (PyObject_HasAttrString(obj, "__deepcopy__")) { + return PyObject_CallMethod(obj, "__deepcopy__", "O", memo); + } else { + return PyObject_CallMethod(obj, "__copy__", ""); + } +} + +/*************************************************************************** + * Miscellaneous helper functions * + ***************************************************************************/ + +int +parse_unsafe_unit_conversion_spec( + const char* arg, int* ctrl) { + + const char* p = NULL; + + *ctrl = 0; + + for (p = arg; *p != '\0'; ++p) { + switch (*p) { + case 's': + case 'S': + *ctrl |= 1; + break; + case 'h': + case 'H': + *ctrl |= 2; + break; + case 'd': + case 'D': + *ctrl |= 4; + break; + default: + PyErr_SetString( + PyExc_ValueError, + "translate_units may only contain the characters 's', 'h' or 'd'"); + return 1; + } + } + + return 0; +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/sip.c b/testbed/astropy__astropy/astropy/wcs/src/sip.c new file mode 100644 index 0000000000000000000000000000000000000000..a3505a6e05bbb2f5270d783bc800cb586c67193d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/sip.c @@ -0,0 +1,332 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#include "astropy_wcs/sip.h" + +#include +#include +#include + +#include + +#define SIP_ERRMSG(status) WCSERR_SET(status) + +void +sip_clear( + sip_t* sip) { + + assert(sip != NULL); + + sip->a_order = 0; + sip->a = NULL; + sip->b_order = 0; + sip->b = NULL; + sip->ap_order = 0; + sip->ap = NULL; + sip->bp_order = 0; + sip->bp = NULL; + sip->crpix[0] = 0.0; + sip->crpix[1] = 0.0; + sip->scratch = NULL; + sip->err = NULL; +} + +int +sip_init( + sip_t* sip, + const unsigned int a_order, const double* a, + const unsigned int b_order, const double* b, + const unsigned int ap_order, const double* ap, + const unsigned int bp_order, const double* bp, + const double* crpix /* [2] */) { + + unsigned int a_size = 0; + unsigned int b_size = 0; + unsigned int ap_size = 0; + unsigned int bp_size = 0; + unsigned int scratch_size = 0; + int status = 0; + struct wcserr** err = NULL; + static const char *function = "sip_init"; + + assert(sip != NULL); + sip_clear(sip); + err = &(sip->err); + + /* We we have one of A/B or AP/BP, we must have both. */ + if ((a == NULL) ^ (b == NULL)) { + return wcserr_set( + SIP_ERRMSG(WCSERR_BAD_COORD_TRANS), + "Both A and B SIP transform must be defined"); + } + + if ((ap == NULL) ^ (bp == NULL)) { + return wcserr_set( + SIP_ERRMSG(WCSERR_BAD_COORD_TRANS), + "Both AP and BP SIP transform must be defined"); + } + + + if (a != NULL) { + sip->a_order = a_order; + a_size = (a_order + 1) * (a_order + 1) * sizeof(double); + sip->a = malloc(a_size); + if (sip->a == NULL) { + sip_free(sip); + status = wcserr_set( + SIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + memcpy(sip->a, a, a_size); + if (a_order > scratch_size) { + scratch_size = a_order; + } + + sip->b_order = b_order; + b_size = (b_order + 1) * (b_order + 1) * sizeof(double); + sip->b = malloc(b_size); + if (sip->b == NULL) { + sip_free(sip); + status = wcserr_set( + SIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + memcpy(sip->b, b, b_size); + if (b_order > scratch_size) { + scratch_size = b_order; + } + } + + if (ap != NULL) { + sip->ap_order = ap_order; + ap_size = (ap_order + 1) * (ap_order + 1) * sizeof(double); + sip->ap = malloc(ap_size); + if (sip->ap == NULL) { + sip_free(sip); + status = wcserr_set( + SIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + memcpy(sip->ap, ap, ap_size); + if (ap_order > scratch_size) { + scratch_size = ap_order; + } + + sip->bp_order = bp_order; + bp_size = (bp_order + 1) * (bp_order + 1) * sizeof(double); + sip->bp = malloc(bp_size); + if (sip->bp == NULL) { + sip_free(sip); + status = wcserr_set( + SIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + memcpy(sip->bp, bp, bp_size); + if (bp_order > scratch_size) { + scratch_size = bp_order; + } + } + + scratch_size = (scratch_size + 1) * sizeof(double); + sip->scratch = malloc(scratch_size); + if (sip->scratch == NULL) { + sip_free(sip); + status = wcserr_set( + SIP_ERRMSG(WCSERR_MEMORY), "Memory allocation failed"); + goto exit; + } + + sip->crpix[0] = crpix[0]; + sip->crpix[1] = crpix[1]; + + exit: + + return status; +} + +void +sip_free(sip_t* sip) { + free(sip->a); + sip->a = NULL; + free(sip->b); + sip->b = NULL; + free(sip->ap); + sip->ap = NULL; + free(sip->bp); + sip->bp = NULL; + free(sip->scratch); + sip->scratch = NULL; + free(sip->err); + sip->err = NULL; +} + +static INLINE double +lu( + const unsigned int order, + const double* const matrix, + const int x, + const int y) { + + int index; + assert(x >= 0 && x <= (int)order); + assert(y >= 0 && y <= (int)order); + + index = x * ((int)order + 1) + y; + assert(index >= 0 && index < ((int)order + 1) * ((int)order + 1)); + + return matrix[index]; +} + +static int +sip_compute( + /*@unused@*/ const unsigned int naxes, + const unsigned int nelem, + const unsigned int m, + /*@null@*/ const double* a, + const unsigned int n, + /*@null@*/ const double* b, + const double* crpix /* [2] */, + /*@null@*/ double* tmp, + /*@null@*/ const double* input /* [NAXES][nelem] */, + /*@null@*/ double* output /* [NAXES][nelem] */) { + + unsigned int i; + int j, k; + double x, y; + double sum; + const double* input_ptr; + double* output_ptr; + + assert(a != NULL); + assert(b != NULL); + assert(crpix != NULL); + assert(tmp != NULL); + assert(input != NULL); + assert(output != NULL); + + /* Avoid segfaults */ + if (input == NULL || output == NULL || tmp == NULL || crpix == NULL) { + return 1; + } + + /* If we have one, we must have both... */ + if ((a == NULL) ^ (b == NULL)) { + return 6; + } + + /* If no distortion, just return values */ + if (a == NULL /* && b == NULL ... implied */) { + return 0; + } + + input_ptr = input; + output_ptr = output; + for (i = 0; i < nelem; ++i) { + x = *input_ptr++ - crpix[0]; + y = *input_ptr++ - crpix[1]; + + for (j = 0; j <= (int)m; ++j) { + tmp[j] = lu(m, a, (int)m-j, j); + for (k = j-1; k >= 0; --k) { + tmp[j] = (y * tmp[j]) + lu(m, a, (int)m-j, k); + } + } + + sum = tmp[0]; + for (j = (int)m; j > 0; --j) { + sum = x * sum + tmp[(int)m - j + 1]; + } + *output_ptr++ += sum; + + for (j = 0; j <= (int)n; ++j) { + tmp[j] = lu(n, b, (int)n-j, j); + for (k = j-1; k >= 0; --k) { + tmp[j] = (y * tmp[j]) + lu(n, b, (int)n-j, k); + } + } + + sum = tmp[0]; + for (j = (int)n; j > 0; --j) { + sum = x * sum + tmp[n - j + 1]; + } + *output_ptr++ += sum; + } + + return 0; +} + +int +sip_pix2deltas( + const sip_t* sip, + const unsigned int naxes, + const unsigned int nelem, + const double* pix /* [NAXES][nelem] */, + double* deltas /* [NAXES][nelem] */) { + + if (sip == NULL) { + return 1; + } + + return sip_compute(naxes, nelem, + sip->a_order, sip->a, + sip->b_order, sip->b, + sip->crpix, + (double *)sip->scratch, + pix, deltas); +} + +int +sip_foc2deltas( + const sip_t* sip, + const unsigned int naxes, + const unsigned int nelem, + const double* foc /* [NAXES][nelem] */, + double* deltas /* [NAXES][nelem] */) { + + if (sip == NULL) { + return 1; + } + + return sip_compute(naxes, nelem, + sip->ap_order, sip->ap, + sip->bp_order, sip->bp, + sip->crpix, + (double *)sip->scratch, + foc, deltas); +} + +int +sip_pix2foc( + const sip_t* sip, + const unsigned int naxes, + const unsigned int nelem, + const double* pix /* [NAXES][nelem] */, + double* foc /* [NAXES][nelem] */) { + assert(pix); + assert(foc); + + if (pix != foc) { + memcpy(foc, pix, sizeof(double) * naxes * nelem); + } + + return sip_pix2deltas(sip, naxes, nelem, pix, foc); +} + +int +sip_foc2pix( + const sip_t* sip, + const unsigned int naxes, + const unsigned int nelem, + const double* foc /* [NAXES][nelem] */, + double* pix /* [NAXES][nelem] */) { + assert(pix); + assert(foc); + + if (pix != foc) { + memcpy(pix, foc, sizeof(double) * naxes * nelem); + } + + return sip_foc2deltas(sip, naxes, nelem, foc, pix); +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/sip_wrap.c b/testbed/astropy__astropy/astropy/wcs/src/sip_wrap.c new file mode 100644 index 0000000000000000000000000000000000000000..8b07701fb8578c0cdf91ee112799525af2f4c863 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/sip_wrap.c @@ -0,0 +1,526 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/sip_wrap.h" +#include "astropy_wcs/docstrings.h" +#include "wcs.h" + +static void +PySip_dealloc( + PySip* self) { + + sip_free(&self->x); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +/*@null@*/ static PyObject * +PySip_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PySip* self; + + self = (PySip*)type->tp_alloc(type, 0); + if (self != NULL) { + sip_clear(&self->x); + } + return (PyObject*)self; +} + +static int +convert_matrix( + /*@null@*/ PyObject* pyobj, + PyArrayObject** array, + double** data, + unsigned int* order) { + + if (pyobj == Py_None) { + *array = NULL; + *data = NULL; + *order = 0; + return 0; + } + + *array = (PyArrayObject*)PyArray_ContiguousFromAny( + pyobj, NPY_DOUBLE, 2, 2); + if (*array == NULL) { + return -1; + } + + if (PyArray_DIM(*array, 0) != PyArray_DIM(*array, 1)) { + PyErr_SetString(PyExc_ValueError, + "Matrix must be square."); + return -1; + } + + *data = (double*)PyArray_DATA(*array); + *order = (unsigned int)PyArray_DIM(*array, 0) - 1; + + return 0; +} + +static int +PySip_init( + PySip* self, + PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyObject* py_a = NULL; + PyObject* py_b = NULL; + PyObject* py_ap = NULL; + PyObject* py_bp = NULL; + PyObject* py_crpix = NULL; + PyArrayObject* a = NULL; + PyArrayObject* b = NULL; + PyArrayObject* ap = NULL; + PyArrayObject* bp = NULL; + PyArrayObject* crpix = NULL; + double* a_data = NULL; + double* b_data = NULL; + double* ap_data = NULL; + double* bp_data = NULL; + unsigned int a_order = 0; + unsigned int b_order = 0; + unsigned int ap_order = 0; + unsigned int bp_order = 0; + int status = -1; + + if (!PyArg_ParseTuple(args, "OOOOO:Sip.__init__", + &py_a, &py_b, &py_ap, &py_bp, &py_crpix)) { + return -1; + } + + if (convert_matrix(py_a, &a, &a_data, &a_order) || + convert_matrix(py_b, &b, &b_data, &b_order) || + convert_matrix(py_ap, &ap, &ap_data, &ap_order) || + convert_matrix(py_bp, &bp, &bp_data, &bp_order)) { + goto exit; + } + + crpix = (PyArrayObject*)PyArray_ContiguousFromAny(py_crpix, NPY_DOUBLE, + 1, 1); + if (crpix == NULL) { + goto exit; + } + + if (PyArray_DIM(crpix, 0) != 2) { + PyErr_SetString(PyExc_ValueError, "CRPIX wrong length"); + goto exit; + } + + status = sip_init(&self->x, + a_order, a_data, + b_order, b_data, + ap_order, ap_data, + bp_order, bp_data, + PyArray_DATA(crpix)); + + exit: + Py_XDECREF(a); + Py_XDECREF(b); + Py_XDECREF(ap); + Py_XDECREF(bp); + Py_XDECREF(crpix); + + if (status == 0) { + return 0; + } else if (status == -1) { + /* Exception already set */ + return -1; + } else { + wcserr_to_python_exc(self->x.err); + return -1; + } +} + +/*@null@*/ static PyObject* +PySip_pix2foc( + PySip* self, + PyObject* args, + PyObject* kwds) { + + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* pixcrd = NULL; + PyArrayObject* foccrd = NULL; + double* foccrd_data = NULL; + unsigned int nelem = 0; + unsigned int i, j; + int status = -1; + const char* keywords[] = { + "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi:pix2foc", (char **)keywords, + &pixcrd_obj, &origin)) { + return NULL; + } + + if (self->x.a == NULL || self->x.b == NULL) { + PyErr_SetString( + PyExc_ValueError, + "SIP object does not have coefficients for pix2foc transformation (A and B)"); + return NULL; + } + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny(pixcrd_obj, NPY_DOUBLE, 2, 2); + if (pixcrd == NULL) { + goto exit; + } + + if (PyArray_DIM(pixcrd, 1) != 2) { + PyErr_SetString(PyExc_ValueError, "Pixel array must be an Nx2 array"); + goto exit; + } + + foccrd = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(pixcrd), + NPY_DOUBLE); + if (foccrd == NULL) { + goto exit; + } + + Py_BEGIN_ALLOW_THREADS + preoffset_array(pixcrd, origin); + status = sip_pix2foc(&self->x, + (unsigned int)PyArray_DIM(pixcrd, 1), + (unsigned int)PyArray_DIM(pixcrd, 0), + (const double*)PyArray_DATA(pixcrd), + (double*)PyArray_DATA(foccrd)); + unoffset_array(pixcrd, origin); + + /* Adjust for crpix */ + foccrd_data = (double *)PyArray_DATA(foccrd); + nelem = (unsigned int)PyArray_DIM(foccrd, 0); + for (i = 0; i < nelem; ++i) { + for (j = 0; j < 2; ++j) { + foccrd_data[i*2 + j] -= self->x.crpix[j]; + } + } + unoffset_array(foccrd, origin); + Py_END_ALLOW_THREADS + + exit: + + Py_XDECREF(pixcrd); + + if (status == 0) { + return (PyObject*)foccrd; + } else { + Py_XDECREF(foccrd); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + wcserr_to_python_exc(self->x.err); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +PySip_foc2pix( + PySip* self, + PyObject* args, + PyObject* kwds) { + + PyObject* foccrd_obj = NULL; + int origin = 1; + PyArrayObject* foccrd = NULL; + PyArrayObject* pixcrd = NULL; + int status = -1; + double* foccrd_data = NULL; + unsigned int nelem = 0; + unsigned int i, j; + const char* keywords[] = { + "foccrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi:foc2pix", (char **)keywords, + &foccrd_obj, &origin)) { + return NULL; + } + + if (self->x.ap == NULL || self->x.bp == NULL) { + PyErr_SetString( + PyExc_ValueError, + "SIP object does not have coefficients for foc2pix transformation (AP and BP)"); + return NULL; + } + + foccrd = (PyArrayObject*)PyArray_ContiguousFromAny(foccrd_obj, NPY_DOUBLE, 2, 2); + if (foccrd == NULL) { + goto exit; + } + + if (PyArray_DIM(foccrd, 1) != 2) { + PyErr_SetString(PyExc_ValueError, "Pixel array must be an Nx2 array"); + goto exit; + } + + pixcrd = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(foccrd), + NPY_DOUBLE); + if (pixcrd == NULL) { + status = 2; + goto exit; + } + + Py_BEGIN_ALLOW_THREADS + preoffset_array(foccrd, origin); + /* Adjust for crpix */ + foccrd_data = (double *)PyArray_DATA(foccrd); + nelem = (unsigned int)PyArray_DIM(foccrd, 0); + for (i = 0; i < nelem; ++i) { + for (j = 0; j < 2; ++j) { + foccrd_data[i*2 + j] += self->x.crpix[j]; + } + } + + status = sip_foc2pix(&self->x, + (unsigned int)PyArray_DIM(pixcrd, 1), + (unsigned int)PyArray_DIM(pixcrd, 0), + (double*)PyArray_DATA(foccrd), + (double*)PyArray_DATA(pixcrd)); + + /* Adjust for crpix */ + for (i = 0; i < nelem; ++i) { + for (j = 0; j < 2; ++j) { + foccrd_data[i*2 + j] -= self->x.crpix[j]; + } + } + unoffset_array(foccrd, origin); + unoffset_array(pixcrd, origin); + Py_END_ALLOW_THREADS + + exit: + Py_XDECREF(foccrd); + + if (status == 0) { + return (PyObject*)pixcrd; + } else { + Py_XDECREF(pixcrd); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + wcserr_to_python_exc(self->x.err); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +PySip_get_a( + PySip* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (self->x.a == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + dims[0] = (npy_intp)self->x.a_order + 1; + dims[1] = (npy_intp)self->x.a_order + 1; + + return get_double_array("a", self->x.a, 2, dims, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PySip_get_b( + PySip* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (self->x.b == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + dims[0] = (npy_intp)self->x.b_order + 1; + dims[1] = (npy_intp)self->x.b_order + 1; + + return get_double_array("b", self->x.b, 2, dims, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PySip_get_ap( + PySip* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (self->x.ap == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + dims[0] = (npy_intp)self->x.ap_order + 1; + dims[1] = (npy_intp)self->x.ap_order + 1; + + return get_double_array("ap", self->x.ap, 2, dims, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PySip_get_bp( + PySip* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (self->x.bp == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + + dims[0] = (npy_intp)self->x.bp_order + 1; + dims[1] = (npy_intp)self->x.bp_order + 1; + + return get_double_array("bp", self->x.bp, 2, dims, (PyObject*)self); +} + +static PyObject* +PySip_get_a_order( + PySip* self, + /*@unused@*/ void* closure) { + + return get_int("a_order", (long int)self->x.a_order); +} + +static PyObject* +PySip_get_b_order( + PySip* self, + /*@unused@*/ void* closure) { + + return get_int("b_order", (long int)self->x.b_order); +} + +static PyObject* +PySip_get_ap_order( + PySip* self, + /*@unused@*/ void* closure) { + + return get_int("ap_order", (long int)self->x.ap_order); +} + +static PyObject* +PySip_get_bp_order( + PySip* self, + /*@unused@*/ void* closure) { + + return get_int("bp_order", (long int)self->x.bp_order); +} + +static PyObject* +PySip_get_crpix( + PySip* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 2; + + return get_double_array("crpix", self->x.crpix, 1, &naxis, (PyObject*)self); +} + +static PyObject* +PySip___copy__( + PySip* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PySip* copy = NULL; + + copy = (PySip*)PySip_new(&PySipType, NULL, NULL); + if (copy == NULL) { + return NULL; + } + + if (sip_init(©->x, + self->x.a_order, self->x.a, + self->x.b_order, self->x.b, + self->x.ap_order, self->x.ap, + self->x.bp_order, self->x.bp, + self->x.crpix)) { + Py_DECREF(copy); + return NULL; + } + + return (PyObject*)copy; +} + + +static PyGetSetDef PySip_getset[] = { + {"a", (getter)PySip_get_a, NULL, (char *)doc_a}, + {"a_order", (getter)PySip_get_a_order, NULL, (char *)doc_a_order}, + {"b", (getter)PySip_get_b, NULL, (char *)doc_b}, + {"b_order", (getter)PySip_get_b_order, NULL, (char *)doc_b_order}, + {"ap", (getter)PySip_get_ap, NULL, (char *)doc_ap}, + {"ap_order", (getter)PySip_get_ap_order, NULL, (char *)doc_ap_order}, + {"bp", (getter)PySip_get_bp, NULL, (char *)doc_bp}, + {"bp_order", (getter)PySip_get_bp_order, NULL, (char *)doc_bp_order}, + {"crpix", (getter)PySip_get_crpix, NULL, (char *)doc_crpix}, + {NULL} +}; + +static PyMethodDef PySip_methods[] = { + {"__copy__", (PyCFunction)PySip___copy__, METH_NOARGS, NULL}, + {"__deepcopy__", (PyCFunction)PySip___copy__, METH_O, NULL}, + {"pix2foc", (PyCFunction)PySip_pix2foc, METH_VARARGS|METH_KEYWORDS, doc_sip_pix2foc}, + {"foc2pix", (PyCFunction)PySip_foc2pix, METH_VARARGS|METH_KEYWORDS, doc_sip_foc2pix}, + {NULL} +}; + +PyTypeObject PySipType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.Sip", /*tp_name*/ + sizeof(PySip), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PySip_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + doc_Sip, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + PySip_methods, /* tp_methods */ + 0, /* tp_members */ + PySip_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)PySip_init, /* tp_init */ + 0, /* tp_alloc */ + PySip_new, /* tp_new */ +}; + +int +_setup_sip_type( + PyObject* m) { + + if (PyType_Ready(&PySipType) < 0) + return -1; + + Py_INCREF(&PySipType); + return PyModule_AddObject(m, "Sip", (PyObject *)&PySipType); +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/str_list_proxy.c b/testbed/astropy__astropy/astropy/wcs/src/str_list_proxy.c new file mode 100644 index 0000000000000000000000000000000000000000..6b77630d19a1290990941475b538916b90403764 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/str_list_proxy.c @@ -0,0 +1,274 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/pyutil.h" + +/*************************************************************************** + * List-of-strings proxy object + ***************************************************************************/ + +static PyTypeObject PyStrListProxyType; + +typedef struct { + PyObject_HEAD + /*@null@*/ /*@shared@*/ PyObject* pyobject; + Py_ssize_t size; + Py_ssize_t maxsize; + char (*array)[72]; +} PyStrListProxy; + +static void +PyStrListProxy_dealloc( + PyStrListProxy* self) { + + Py_XDECREF(self->pyobject); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +/*@null@*/ static PyObject * +PyStrListProxy_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyStrListProxy* self = NULL; + + self = (PyStrListProxy*)type->tp_alloc(type, 0); + if (self != NULL) { + self->pyobject = NULL; + } + return (PyObject*)self; +} + +static int +PyStrListProxy_traverse( + PyStrListProxy* self, + visitproc visit, + void *arg) { + + int vret; + + if (self->pyobject) { + vret = visit(self->pyobject, arg); + if (vret != 0) { + return vret; + } + } + + return 0; +} + +static int +PyStrListProxy_clear( + PyStrListProxy *self) { + + PyObject *tmp; + + tmp = self->pyobject; + self->pyobject = NULL; + Py_XDECREF(tmp); + + return 0; +} + +/*@null@*/ PyObject * +PyStrListProxy_New( + /*@shared@*/ PyObject* owner, + Py_ssize_t size, + Py_ssize_t maxsize, + char (*array)[72]) { + + PyStrListProxy* self = NULL; + + if (maxsize == 0) { + maxsize = 68; + } + + self = (PyStrListProxy*)PyStrListProxyType.tp_alloc(&PyStrListProxyType, 0); + if (self == NULL) { + return NULL; + } + + Py_XINCREF(owner); + self->pyobject = owner; + self->size = size; + self->maxsize = maxsize; + self->array = array; + return (PyObject*)self; +} + +static Py_ssize_t +PyStrListProxy_len( + PyStrListProxy* self) { + + return self->size; +} + +/*@null@*/ static PyObject* +PyStrListProxy_getitem( + PyStrListProxy* self, + Py_ssize_t index) { + + if (index >= self->size) { + PyErr_SetString(PyExc_IndexError, "index out of range"); + return NULL; + } + + return get_string("string", self->array[index]); +} + +static int +PyStrListProxy_setitem( + PyStrListProxy* self, + Py_ssize_t index, + PyObject* arg) { + + if (index >= self->size) { + PyErr_SetString(PyExc_IndexError, "index out of range"); + return -1; + } + + return set_string("string", arg, self->array[index], self->maxsize); +} + +/*@null@*/ PyObject* +str_list_proxy_repr( + char (*array)[72], + Py_ssize_t size, + Py_ssize_t maxsize) { + + char* buffer = NULL; + char* wp = NULL; + char* rp = NULL; + Py_ssize_t i = 0; + Py_ssize_t j = 0; + PyObject* result = NULL; + /* These are in descending order, so we can exit the loop quickly. They + are in pairs: (char_to_escape, char_escaped) */ + const char* escapes = "\\\\''\rr\ff\vv\nn\tt\bb\aa"; + const char* e = NULL; + char next_char = '\0'; + + /* Overallocating to allow for escaped characters */ + buffer = malloc((size_t)size*maxsize*2 + 2); + if (buffer == NULL) { + PyErr_SetString(PyExc_MemoryError, "Could not allocate memory."); + return NULL; + } + + wp = buffer; + *wp++ = '['; + + for (i = 0; i < size; ++i) { + *wp++ = '\''; + rp = array[i]; + for (j = 0; j < maxsize && *rp != '\0'; ++j) { + /* Check if this character should be escaped */ + e = escapes; + next_char = *rp++; + do { + if (next_char > *e) { + break; + } else if (next_char == *e) { + *wp++ = '\\'; + next_char = *(++e); + break; + } else { + e += 2; + } + } while (*e != '\0'); + + *wp++ = next_char; + } + *wp++ = '\''; + + /* Add a comma for all but the last one */ + if (i != size - 1) { + *wp++ = ','; + *wp++ = ' '; + } + } + + *wp++ = ']'; + *wp++ = '\0'; + + result = PyUnicode_FromString(buffer); + free(buffer); + return result; +} + +/*@null@*/ static PyObject* +PyStrListProxy_repr( + PyStrListProxy* self) { + + return str_list_proxy_repr(self->array, self->size, self->maxsize); +} + +static PySequenceMethods PyStrListProxy_sequence_methods = { + (lenfunc)PyStrListProxy_len, + NULL, + NULL, + (ssizeargfunc)PyStrListProxy_getitem, + NULL, + (ssizeobjargproc)PyStrListProxy_setitem, + NULL, + NULL, + NULL, + NULL +}; + +static PyTypeObject PyStrListProxyType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.StrListProxy", /*tp_name*/ + sizeof(PyStrListProxy), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PyStrListProxy_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)PyStrListProxy_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + &PyStrListProxy_sequence_methods, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + (reprfunc)PyStrListProxy_repr, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /* tp_doc */ + (traverseproc)PyStrListProxy_traverse, /* tp_traverse */ + (inquiry)PyStrListProxy_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + PyStrListProxy_new, /* tp_new */ +}; + +int +_setup_str_list_proxy_type( + /*@unused@*/ PyObject* m) { + + if (PyType_Ready(&PyStrListProxyType) < 0) { + return 1; + } + + return 0; +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/unit_list_proxy.c b/testbed/astropy__astropy/astropy/wcs/src/unit_list_proxy.c new file mode 100644 index 0000000000000000000000000000000000000000..1d38241be18a73da26ba7151bbb926a33ad7b140 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/unit_list_proxy.c @@ -0,0 +1,396 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/pyutil.h" +#include "astropy_wcs/str_list_proxy.h" + +/*************************************************************************** + * List-of-units proxy object + ***************************************************************************/ + +#define MAXSIZE 68 +#define ARRAYSIZE 72 + +static PyTypeObject PyUnitListProxyType; + +typedef struct { + PyObject_HEAD + /*@null@*/ /*@shared@*/ PyObject* pyobject; + Py_ssize_t size; + char (*array)[ARRAYSIZE]; + PyObject* unit_class; +} PyUnitListProxy; + +static void +PyUnitListProxy_dealloc( + PyUnitListProxy* self) { + + Py_XDECREF(self->pyobject); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +/*@null@*/ static PyObject * +PyUnitListProxy_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyUnitListProxy* self = NULL; + + self = (PyUnitListProxy*)type->tp_alloc(type, 0); + if (self != NULL) { + self->pyobject = NULL; + self->unit_class = NULL; + } + return (PyObject*)self; +} + +static int +PyUnitListProxy_traverse( + PyUnitListProxy* self, + visitproc visit, + void *arg) { + + int vret; + + if (self->pyobject) { + vret = visit(self->pyobject, arg); + if (vret != 0) { + return vret; + } + } + + if (self->unit_class) { + vret = visit(self->unit_class, arg); + if (vret != 0) { + return vret; + } + } + + return 0; +} + +static int +PyUnitListProxy_clear( + PyUnitListProxy *self) { + + PyObject *tmp; + + tmp = self->pyobject; + self->pyobject = NULL; + Py_XDECREF(tmp); + + tmp = self->unit_class; + self->unit_class = NULL; + Py_XDECREF(tmp); + + return 0; +} + +/*@null@*/ PyObject * +PyUnitListProxy_New( + /*@shared@*/ PyObject* owner, + Py_ssize_t size, + char (*array)[ARRAYSIZE]) { + + PyUnitListProxy* self = NULL; + PyObject *units_module; + PyObject *units_dict; + PyObject *unit_class; + + units_module = PyImport_ImportModule("astropy.units"); + if (units_module == NULL) { + return NULL; + } + + units_dict = PyModule_GetDict(units_module); + if (units_dict == NULL) { + return NULL; + } + + unit_class = PyDict_GetItemString(units_dict, "Unit"); + if (unit_class == NULL) { + PyErr_SetString(PyExc_RuntimeError, "Could not import Unit class"); + return NULL; + } + + Py_INCREF(unit_class); + + self = (PyUnitListProxy*)PyUnitListProxyType.tp_alloc( + &PyUnitListProxyType, 0); + if (self == NULL) { + return NULL; + } + + Py_XINCREF(owner); + self->pyobject = owner; + self->size = size; + self->array = array; + self->unit_class = unit_class; + return (PyObject*)self; +} + +static Py_ssize_t +PyUnitListProxy_len( + PyUnitListProxy* self) { + + return self->size; +} + +static PyObject* +_get_unit( + PyObject *unit_class, + PyObject *unit) { + + PyObject *args; + PyObject *kw; + PyObject *result; + + kw = Py_BuildValue("{s:s,s:s}", "format", "fits", "parse_strict", "warn"); + if (kw == NULL) { + return NULL; + } + + args = PyTuple_New(1); + PyTuple_SetItem(args, 0, unit); + Py_INCREF(unit); + + result = PyObject_Call(unit_class, args, kw); + + Py_DECREF(args); + Py_DECREF(kw); + return result; +} + +/*@null@*/ static PyObject* +PyUnitListProxy_getitem( + PyUnitListProxy* self, + Py_ssize_t index) { + + PyObject *value; + PyObject *result; + + if (index >= self->size) { + PyErr_SetString(PyExc_IndexError, "index out of range"); + return NULL; + } + + value = PyUnicode_FromString(self->array[index]); + + result = _get_unit(self->unit_class, value); + + Py_DECREF(value); + return result; +} + +static PyObject* +PyUnitListProxy_richcmp( + PyObject *a, + PyObject *b, + int op){ + PyUnitListProxy *lhs, *rhs; + assert(a != NULL && b != NULL); + if (!PyObject_TypeCheck(a, &PyUnitListProxyType) || + !PyObject_TypeCheck(b, &PyUnitListProxyType)) { + Py_RETURN_NOTIMPLEMENTED; + } + if (op != Py_EQ && op != Py_NE) { + Py_RETURN_NOTIMPLEMENTED; + } + lhs = (PyUnitListProxy *)a; + rhs = (PyUnitListProxy *)b; + int equal = PyObject_RichCompareBool(lhs->unit_class, rhs->unit_class, Py_EQ); + if (equal == -1) { + return NULL; // Exception will be set because the rich-compare failed + } + equal = equal == 1 && !strncmp(lhs->array, rhs->array, ARRAYSIZE) && lhs->size == rhs->size; + if ((op == Py_EQ && equal == 1) || + (op == Py_NE && equal == 0)) { + Py_RETURN_TRUE; + } + else { + Py_RETURN_FALSE; + } +} + +static int +PyUnitListProxy_setitem( + PyUnitListProxy* self, + Py_ssize_t index, + PyObject* arg) { + + PyObject* value; + PyObject* unicode_value; + PyObject* bytes_value; + + if (index >= self->size) { + PyErr_SetString(PyExc_IndexError, "index out of range"); + return -1; + } + + value = _get_unit(self->unit_class, arg); + if (value == NULL) { + return -1; + } + + unicode_value = PyObject_CallMethod(value, "to_string", "s", "fits"); + if (unicode_value == NULL) { + Py_DECREF(value); + return -1; + } + Py_DECREF(value); + + if (PyUnicode_Check(unicode_value)) { + bytes_value = PyUnicode_AsASCIIString(unicode_value); + if (bytes_value == NULL) { + Py_DECREF(unicode_value); + return -1; + } + Py_DECREF(unicode_value); + } else { + bytes_value = unicode_value; + } + + strncpy(self->array[index], PyBytes_AsString(bytes_value), MAXSIZE); + Py_DECREF(bytes_value); + + return 0; +} + +/*@null@*/ static PyObject* +PyUnitListProxy_repr( + PyUnitListProxy* self) { + + return str_list_proxy_repr(self->array, self->size, MAXSIZE); +} + +static PySequenceMethods PyUnitListProxy_sequence_methods = { + (lenfunc)PyUnitListProxy_len, + NULL, + NULL, + (ssizeargfunc)PyUnitListProxy_getitem, + NULL, + (ssizeobjargproc)PyUnitListProxy_setitem, + NULL, + NULL, + NULL, + NULL +}; + +static PyTypeObject PyUnitListProxyType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.UnitListProxy", /*tp_name*/ + sizeof(PyUnitListProxy), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PyUnitListProxy_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)PyUnitListProxy_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + &PyUnitListProxy_sequence_methods, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + (reprfunc)PyUnitListProxy_repr, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /* tp_doc */ + (traverseproc)PyUnitListProxy_traverse, /* tp_traverse */ + (inquiry)PyUnitListProxy_clear, /* tp_clear */ + (richcmpfunc)PyUnitListProxy_richcmp, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + PyUnitListProxy_new, /* tp_new */ +}; + + +int +set_unit_list( + PyObject* owner, + const char* propname, + PyObject* value, + Py_ssize_t len, + char (*dest)[ARRAYSIZE]) { + + PyObject* unit = NULL; + PyObject* proxy = NULL; + Py_ssize_t i = 0; + + if (check_delete(propname, value)) { + return -1; + } + + if (!PySequence_Check(value)) { + PyErr_Format( + PyExc_TypeError, + "'%s' must be a sequence of strings", + propname); + return -1; + } + + if (PySequence_Size(value) != len) { + PyErr_Format( + PyExc_ValueError, + "len(%s) must be %u", + propname, + (unsigned int)len); + return -1; + } + + proxy = PyUnitListProxy_New(owner, len, dest); + if (proxy == NULL) { + return -1; + } + + for (i = 0; i < len; ++i) { + unit = PySequence_GetItem(value, i); + if (unit == NULL) { + Py_DECREF(proxy); + return -1; + } + + if (PySequence_SetItem(proxy, i, unit) == -1) { + Py_DECREF(proxy); + Py_DECREF(unit); + return -1; + } + + Py_DECREF(unit); + } + + Py_DECREF(proxy); + + return 0; +} + + +int +_setup_unit_list_proxy_type( + /*@unused@*/ PyObject* m) { + + if (PyType_Ready(&PyUnitListProxyType) < 0) { + return 1; + } + + return 0; +} + diff --git a/testbed/astropy__astropy/astropy/wcs/src/util.c b/testbed/astropy__astropy/astropy/wcs/src/util.c new file mode 100644 index 0000000000000000000000000000000000000000..ccae802d5a2c270e9aac64cc934fd0990455bdea --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/util.c @@ -0,0 +1,40 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/util.h" +#include +#include + +void set_invalid_to_nan( + const int ncoord, + const int nelem, + double* const data, + const int* const stat) +{ + int i = 0; + double* d = data; + const int* s = stat; + const int* s_end = stat + ncoord; + double n; + + #ifndef NAN + #define INF (DBL_MAX+DBL_MAX) + #define NAN (INF-INF) + #endif + + n = NAN; + + for ( ; s != s_end; ++s) { + if (*s) { + for (i = 0; i < nelem; ++i) { + *d++ = n; + } + } else { + d += nelem; + } + } +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/wcslib_tabprm_wrap.c b/testbed/astropy__astropy/astropy/wcs/src/wcslib_tabprm_wrap.c new file mode 100644 index 0000000000000000000000000000000000000000..7394f9c21d25671c9d96b0c718fbf277d4058cfb --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/wcslib_tabprm_wrap.c @@ -0,0 +1,476 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/wcslib_tabprm_wrap.h" + +#include +#include +#include + +/* + It gets to be really tedious to type long docstrings in ANSI C syntax + (since multi-line strings literals are not valid). Therefore, the + docstrings are written in doc/docstrings.py, which are then converted + by setup.py into docstrings.h, which we include here. +*/ +#include "astropy_wcs/docstrings.h" + +/*************************************************************************** + * Helper functions * + ***************************************************************************/ + +static INLINE void +note_change(PyTabprm* self) { + self->x->flag = 0; +} + +static int +make_fancy_dims(PyTabprm* self, int* ndims, npy_intp* dims) { + int i, M; + + M = self->x->M; + if (M + 1 > NPY_MAXDIMS) { + PyErr_SetString(PyExc_ValueError, "Too many dimensions"); + return -1; + } + + *ndims = M + 1; + + for (i = 0; i < M; ++i) { + dims[i] = self->x->K[M-1-i]; + } + + dims[M] = M; + + return 0; +} + +PyObject** tab_errexc[6]; + +static void +wcslib_tab_to_python_exc(int status) { + if (status > 0 && status < 6) { + PyErr_SetString(*tab_errexc[status], tab_errmsg[status]); + } else { + PyErr_SetString( + PyExc_RuntimeError, + "Unknown error occurred. Something is seriously wrong."); + } +} + +/*************************************************************************** + * PyTabprm methods + */ + +static int +PyTabprm_traverse( + PyTabprm* self, visitproc visit, void *arg) { + int vret; + + vret = visit(self->owner, arg); + if (vret != 0) { + return vret; + } + + return 0; +} + +static int +PyTabprm_clear( + PyTabprm* self) { + PyObject* tmp; + + tmp = self->owner; + self->owner = NULL; + Py_XDECREF(tmp); + + return 0; +} + +static void +PyTabprm_dealloc( + PyTabprm* self) { + + PyTabprm_clear(self); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +PyTabprm* +PyTabprm_cnew(PyObject* wcsprm, struct tabprm* x) { + PyTabprm* self; + self = (PyTabprm*)(&PyTabprmType)->tp_alloc(&PyTabprmType, 0); + self->x = x; + Py_INCREF(wcsprm); + self->owner = wcsprm; + return self; +} + +static int +PyTabprm_cset( + PyTabprm* self) { + + int status = 0; + + status = tabset(self->x); + + if (status == 0) { + return 0; + } else { + wcslib_tab_to_python_exc(status); + return -1; + } +} + +/*@null@*/ static PyObject* +PyTabprm_set( + PyTabprm* self) { + + if (PyTabprm_cset(self)) { + return NULL; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/*@null@*/ static PyObject* +PyTabprm_print_contents( + PyTabprm* self) { + + if (PyTabprm_cset(self)) { + return NULL; + } + + /* This is not thread-safe, but since we're holding onto the GIL, + we can assume we won't have thread conflicts */ + wcsprintf_set(NULL); + + tabprt(self->x); + + printf("%s", wcsprintf_buf()); + + Py_INCREF(Py_None); + return Py_None; +} + +/*@null@*/ static PyObject* +PyTabprm___str__( + PyTabprm* self) { + + if (PyTabprm_cset(self)) { + return NULL; + } + + /* This is not thread-safe, but since we're holding onto the GIL, + we can assume we won't have thread conflicts */ + wcsprintf_set(NULL); + + tabprt(self->x); + + return PyUnicode_FromString(wcsprintf_buf()); +} + +/*************************************************************************** + * Member getters/setters (properties) + */ + +/*@null@*/ static PyObject* +PyTabprm_get_coord( + PyTabprm* self, + /*@unused@*/ void* closure) { + + int ndims; + npy_intp dims[NPY_MAXDIMS]; + + if (is_null(self->x->coord)) { + return NULL; + } + + if (make_fancy_dims(self, &ndims, dims)) { + return NULL; + } + + return get_double_array("coord", self->x->coord, ndims, dims, (PyObject*)self); +} + +/*@null@*/ static int +PyTabprm_set_coord( + PyTabprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + int ndims; + npy_intp dims[NPY_MAXDIMS]; + + if (is_null(self->x->coord)) { + return -1; + } + + if (make_fancy_dims(self, &ndims, dims)) { + return -1; + } + + return set_double_array("coord", value, ndims, dims, self->x->coord); +} + +/*@null@*/ static PyObject* +PyTabprm_get_crval( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->crval)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_double_array("crval", self->x->crval, 1, &M, (PyObject*)self); +} + +static int +PyTabprm_set_crval( + PyTabprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp M = 0; + + if (is_null(self->x->crval)) { + return -1; + } + + M = (Py_ssize_t)self->x->M; + + note_change(self); + + return set_double_array("crval", value, 1, &M, self->x->crval); +} + +/*@null@*/ static PyObject* +PyTabprm_get_delta( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->delta)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_double_array("delta", self->x->delta, 1, &M, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyTabprm_get_extrema( + PyTabprm* self, + /*@unused@*/ void* closure) { + + int ndims; + npy_intp dims[NPY_MAXDIMS]; + + if (is_null(self->x->coord)) { + return NULL; + } + + if (make_fancy_dims(self, &ndims, dims)) { + return NULL; + } + + dims[ndims-2] = 2; + + return get_double_array("extrema", self->x->extrema, ndims, dims, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyTabprm_get_K( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->K)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_int_array("K", self->x->K, 1, &M, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyTabprm_get_M( + PyTabprm* self, + /*@unused@*/ void* closure) { + + return get_int("M", self->x->M); +} + +/*@null@*/ static PyObject* +PyTabprm_get_map( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->map)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_int_array("map", self->x->map, 1, &M, (PyObject*)self); +} + +static int +PyTabprm_set_map( + PyTabprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp M = 0; + + if (is_null(self->x->map)) { + return -1; + } + + M = (Py_ssize_t)self->x->M; + + note_change(self); + + return set_int_array("map", value, 1, &M, self->x->map); +} + +/*@null@*/ static PyObject* +PyTabprm_get_nc( + PyTabprm* self, + /*@unused@*/ void* closure) { + + return get_int("nc", self->x->nc); +} + +/*@null@*/ static PyObject* +PyTabprm_get_p0( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->p0)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_int_array("p0", self->x->p0, 1, &M, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyTabprm_get_sense( + PyTabprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t M = 0; + + if (is_null(self->x->sense)) { + return NULL; + } + + M = (Py_ssize_t)self->x->M; + + return get_int_array("sense", self->x->sense, 1, &M, (PyObject*)self); +} + +/*************************************************************************** + * PyTabprm definition structures + */ + +static PyGetSetDef PyTabprm_getset[] = { + {"coord", (getter)PyTabprm_get_coord, (setter)PyTabprm_set_coord, (char *)doc_coord}, + {"crval", (getter)PyTabprm_get_crval, (setter)PyTabprm_set_crval, (char *)doc_crval_tabprm}, + {"delta", (getter)PyTabprm_get_delta, NULL, (char *)doc_delta}, + {"extrema", (getter)PyTabprm_get_extrema, NULL, (char *)doc_extrema}, + {"K", (getter)PyTabprm_get_K, NULL, (char *)doc_K}, + {"M", (getter)PyTabprm_get_M, NULL, (char *)doc_M}, + {"map", (getter)PyTabprm_get_map, (setter)PyTabprm_set_map, (char *)doc_map}, + {"nc", (getter)PyTabprm_get_nc, NULL, (char *)doc_nc}, + {"p0", (getter)PyTabprm_get_p0, NULL, (char *)doc_p0}, + {"sense", (getter)PyTabprm_get_sense, NULL, (char *)doc_sense}, + {NULL} +}; + +static PyMethodDef PyTabprm_methods[] = { + {"print_contents", (PyCFunction)PyTabprm_print_contents, METH_NOARGS, doc_print_contents_tabprm}, + {"set", (PyCFunction)PyTabprm_set, METH_NOARGS, doc_set_tabprm}, + {NULL} +}; + +PyTypeObject PyTabprmType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.Tabprm", /*tp_name*/ + sizeof(PyTabprm), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PyTabprm_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)PyTabprm___str__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + (reprfunc)PyTabprm___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + doc_Tabprm, /* tp_doc */ + (traverseproc)PyTabprm_traverse, /* tp_traverse */ + (inquiry)PyTabprm_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + PyTabprm_methods, /* tp_methods */ + 0, /* tp_members */ + PyTabprm_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ +}; + +int +_setup_tabprm_type( + PyObject* m) { + + if (PyType_Ready(&PyTabprmType) < 0) { + return -1; + } + + Py_INCREF(&PyTabprmType); + + PyModule_AddObject(m, "Tabprm", (PyObject *)&PyTabprmType); + + tab_errexc[0] = NULL; /* Success */ + tab_errexc[1] = &PyExc_MemoryError; /* Null wcsprm pointer passed */ + tab_errexc[2] = &PyExc_MemoryError; /* Memory allocation failed */ + tab_errexc[3] = &WcsExc_InvalidTabularParameters; /* Invalid tabular parameters */ + tab_errexc[4] = &WcsExc_InvalidCoordinate; /* One or more of the x coordinates were invalid */ + tab_errexc[5] = &WcsExc_InvalidCoordinate; /* One or more of the world coordinates were invalid */ + + return 0; +} diff --git a/testbed/astropy__astropy/astropy/wcs/src/wcslib_wrap.c b/testbed/astropy__astropy/astropy/wcs/src/wcslib_wrap.c new file mode 100644 index 0000000000000000000000000000000000000000..dc7da77838ca7a171a41ce145e85b3fc00409a95 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/src/wcslib_wrap.c @@ -0,0 +1,4069 @@ +/* + Author: Michael Droettboom + mdroe@stsci.edu +*/ + +#define NO_IMPORT_ARRAY + +#include "astropy_wcs/wcslib_wrap.h" +#include "astropy_wcs/wcslib_tabprm_wrap.h" +#include "astropy_wcs/wcslib_wtbarr_wrap.h" +#include "astropy_wcs/wcslib_units_wrap.h" +#include "astropy_wcs/unit_list_proxy.h" +#include /* from Python */ + +#include +#include +#include +#include +#include +#include +#include + +#include "astropy_wcs/isnan.h" +#include "astropy_wcs/distortion.h" + +/* + It gets to be really tedious to type long docstrings in ANSI C syntax + (since multi-line strings literals are not valid). Therefore, the + docstrings are written in doc/docstrings.py, which are then converted + by setup.py into docstrings.h, which we include here. +*/ +#include "astropy_wcs/docstrings.h" + +/*************************************************************************** + * Helper functions * + ***************************************************************************/ + +enum e_altlin { + has_pc = 1, + has_cd = 2, + has_crota = 4 +}; + +static int +is_valid_alt_key( + const char* key) { + + if (key[1] != '\0' || + !(key[0] == ' ' || + (key[0] >= 'A' && key[0] <= 'Z'))) { + PyErr_SetString(PyExc_ValueError, "key must be ' ' or 'A'-'Z'"); + return 0; + } + + return 1; +} + +static int +convert_rejections_to_warnings() { + char buf[1024]; + const char *src; + char *dst; + int last_was_space; + PyObject *wcs_module = NULL; + PyObject *FITSFixedWarning = NULL; + int status = -1; + char delimiter; + +#ifdef HAVE_WCSLIB_VERSION + delimiter = ','; +#else + delimiter = ':'; +#endif + + if (wcsprintf_buf()[0] == 0) { + return 0; + } + + wcs_module = PyImport_ImportModule("astropy.wcs"); + if (wcs_module == NULL) { + goto exit; + } + + FITSFixedWarning = PyObject_GetAttrString( + wcs_module, "FITSFixedWarning"); + if (FITSFixedWarning == NULL) { + goto exit; + } + + src = wcsprintf_buf(); + while (*src != 0) { + dst = buf; + + /* Read the first line, removing any repeated spaces */ + last_was_space = 0; + for (; *src != 0; ++src) { + if (*src == ' ') { + if (!last_was_space) { + *(dst++) = *src; + last_was_space = 1; + } + } else if (*src == '\n') { + ++src; + break; + } else { + *(dst++) = *src; + last_was_space = 0; + } + } + + *(dst++) = '\n'; + + /* For the second line, remove everything up to and including the + first colon */ + for (; *src != 0; ++src) { + if (*src == delimiter) { + ++src; + break; + } + } + + /* Read to the end of the second line, removing any repeated + spaces */ + last_was_space = 1; + for (; *src != 0; ++src) { + if (*src == ' ') { + if (!last_was_space) { + *(dst++) = *src; + last_was_space = 1; + } + } else if (*src == '\n') { + ++src; + break; + } else { + *(dst++) = *src; + last_was_space = 0; + } + } + + /* NULL terminate the string */ + *dst = 0; + + /* Raise the warning. Depending on the user's configuration, this + may raise an exception, and PyErr_WarnEx returns -1. */ + if (PyErr_WarnEx(FITSFixedWarning, buf, 1)) { + goto exit; + } + } + + status = 0; + + exit: + + Py_XDECREF(wcs_module); + Py_XDECREF(FITSFixedWarning); + + return status; +} + +/*************************************************************************** + * PyWcsprm methods + */ + +static int +PyWcsprm_cset(PyWcsprm* self, const int convert); + +static INLINE void +note_change(PyWcsprm* self) { + self->x.flag = 0; +} + +static void +PyWcsprm_dealloc( + PyWcsprm* self) { + + wcsfree(&self->x); + Py_TYPE(self)->tp_free((PyObject*)self); +} + +static PyWcsprm* +PyWcsprm_cnew(void) { + PyWcsprm* self; + self = (PyWcsprm*)(&PyWcsprmType)->tp_alloc(&PyWcsprmType, 0); + return self; +} + +static PyObject * +PyWcsprm_new( + PyTypeObject* type, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + PyWcsprm* self; + self = (PyWcsprm*)type->tp_alloc(type, 0); + return (PyObject*)self; +} + +static int +PyWcsprm_init( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int status; + PyObject* header_obj = NULL; + char * header = NULL; + Py_ssize_t header_length = 0; + Py_ssize_t nkeyrec = 0; + const char * key = " "; + PyObject* relax_obj = NULL; + int relax = 0; + int naxis = -1; + int keysel = -1; + PyObject* colsel = Py_None; + PyArrayObject* colsel_array = NULL; + int* colsel_data = NULL; + int* colsel_ints = NULL; + int warnings = 1; + int nreject = 0; + int nwcs = 0; + struct wcsprm* wcs = NULL; + int i = 0; + const char* keywords[] = {"header", "key", "relax", "naxis", "keysel", + "colsel", "warnings", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|OsOiiOi:WCSBase.__init__", + (char **)keywords, &header_obj, &key, &relax_obj, &naxis, &keysel, + &colsel, &warnings)) { + return -1; + } + + if (header_obj == NULL || header_obj == Py_None) { + if (keysel > 0) { + PyErr_SetString( + PyExc_ValueError, + "If no header is provided, keysel may not be provided either."); + return -1; + } + + if (colsel != Py_None) { + PyErr_SetString( + PyExc_ValueError, + "If no header is provided, colsel may not be provided either."); + return -1; + } + + /* Default number of axes is 2 */ + if (naxis < 0) { + naxis = 2; + } + + if (naxis < 1 || naxis > 15) { + PyErr_SetString( + PyExc_ValueError, + "naxis must be in range 1-15"); + return -1; + } + + note_change(self); + self->x.flag = -1; + status = wcsini(1, naxis, &self->x); + + if (status != 0) { + PyErr_SetString( + PyExc_MemoryError, + self->x.err->msg); + return -1; + } + + self->x.alt[0] = key[0]; + + if (PyWcsprm_cset(self, 0)) { + return -1; + } + wcsprm_c2python(&self->x); + + return 0; + } else { /* header != NULL */ + if (PyBytes_AsStringAndSize(header_obj, &header, &header_length)) { + return -1; + } + + if (relax_obj == Py_True) { + relax = WCSHDR_all; + } else if (relax_obj == NULL || relax_obj == Py_False) { + relax = WCSHDR_none; + } else { + relax = (int)PyLong_AsLong(relax_obj); + if (relax == -1) { + PyErr_SetString( + PyExc_ValueError, + "relax must be True, False or an integer."); + return -1; + } + } + + if (!is_valid_alt_key(key)) { + return -1; + } + + if (naxis >= 0) { + PyErr_SetString( + PyExc_ValueError, + "naxis may not be provided if a header is provided."); + return -1; + } + + nkeyrec = header_length / 80; + if (nkeyrec > 0x7fffffff) { + PyErr_SetString( + PyExc_MemoryError, + "header is too long"); + return -1; + } + + if (colsel != Py_None) { + colsel_array = (PyArrayObject*) PyArray_ContiguousFromAny( + colsel, 1, 1, NPY_INT); + if (colsel_array == NULL) { + return -1; + } + + colsel_ints = malloc(sizeof(int) * (PyArray_DIM(colsel_array, 0) + 1)); + if (colsel_ints == NULL) { + Py_DECREF(colsel_array); + PyErr_SetString( + PyExc_MemoryError, + "Memory allocation error."); + return -1; + } + + colsel_ints[0] = (int)PyArray_DIM(colsel_array, 0); + colsel_data = (int *)PyArray_DATA(colsel_array); + for (i = 0; i < colsel_ints[0]; ++i) { + colsel_ints[i+1] = colsel_data[i]; + } + + Py_DECREF(colsel_array); + } + + wcsprintf_set(NULL); + + /* Call the header parser twice, the first time to get warnings + out about "rejected" keywords (which we can then send to Python + as warnings), and the second time to get a corrected wcsprm + object. */ + + if (keysel < 0) { + status = wcspih( + header, + (int)nkeyrec, + WCSHDR_reject, + 2, + &nreject, + &nwcs, + &wcs); + } else { + status = wcsbth( + header, + (int)nkeyrec, + WCSHDR_reject, + 2, + keysel, + colsel_ints, + &nreject, + &nwcs, + &wcs); + } + + if (status != 0) { + free(colsel_ints); + wcshdr_err_to_python_exc(status); + return -1; + } + + wcsvfree(&nwcs, &wcs); + + if (warnings && convert_rejections_to_warnings()) { + free(colsel_ints); + return -1; + } + + if (keysel < 0) { + status = wcspih( + header, + (int)nkeyrec, + relax, + 0, + &nreject, + &nwcs, + &wcs); + } else { + status = wcsbth( + header, + (int)nkeyrec, + relax, + 0, + keysel, + colsel_ints, + &nreject, + &nwcs, + &wcs); + } + + free(colsel_ints); + + if (status != 0) { + wcshdr_err_to_python_exc(status); + return -1; + } + + if (nwcs == 0) { + wcsvfree(&nwcs, &wcs); + PyErr_SetString( + WcsExc_NoWcsKeywordsFound, + "No WCS keywords found in the given header"); + return -1; + } + + /* Find the desired WCS */ + for (i = 0; i < nwcs; ++i) { + if (wcs[i].alt[0] == key[0]) { + break; + } + } + + if (i >= nwcs) { + wcsvfree(&nwcs, &wcs); + PyErr_Format( + PyExc_KeyError, + "No WCS with key '%s' was found in the given header", + key); + return -1; + } + + if (wcscopy(1, wcs + i, &self->x) != 0) { + wcsvfree(&nwcs, &wcs); + PyErr_SetString( + PyExc_MemoryError, + self->x.err->msg); + return -1; + } + + note_change(self); + wcsprm_c2python(&self->x); + wcsvfree(&nwcs, &wcs); + return 0; + } +} + +/*@null@*/ static PyObject* +PyWcsprm_bounds_check( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + unsigned char pix2sky = 1; + unsigned char sky2pix = 1; + int bounds = 0; + const char* keywords[] = {"pix2world", "world2pix", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|bb:bounds_check", (char **)keywords, + &pix2sky, &sky2pix)) { + return NULL; + } + + if (pix2sky) { + bounds |= 2|4; + } + + if (sky2pix) { + bounds |= 1; + } + + wcsprm_python2c(&self->x); + wcsbchk(&self->x, bounds); + + Py_RETURN_NONE; +} + + +/*@null@*/ static PyObject* +PyWcsprm_copy( + PyWcsprm* self) { + + PyWcsprm* copy = NULL; + int status; + + copy = PyWcsprm_cnew(); + if (copy == NULL) { + return NULL; + } + + wcsini(0, self->x.naxis, ©->x); + + wcsprm_python2c(&self->x); + status = wcscopy(1, &self->x, ©->x); + wcsprm_c2python(&self->x); + + if (status == 0) { + if (PyWcsprm_cset(copy, 0)) { + Py_XDECREF(copy); + return NULL; + } + wcsprm_c2python(©->x); + return (PyObject*)copy; + } else { + Py_XDECREF(copy); + wcs_to_python_exc(&(self->x)); + return NULL; + } +} + +PyObject* +PyWcsprm_find_all_wcs( + PyObject* __, + PyObject* args, + PyObject* kwds) { + + PyObject* header_obj = NULL; + char * header = NULL; + Py_ssize_t header_length = 0; + Py_ssize_t nkeyrec = 0; + PyObject* relax_obj = NULL; + int relax = 0; + int keysel = 0; + int warnings = 1; + int nreject = 0; + int nwcs = 0; + struct wcsprm* wcs = NULL; + PyObject* result = NULL; + PyWcsprm* subresult = NULL; + int i = 0; + const char* keywords[] = {"header", "relax", "keysel", "warnings", NULL}; + int status = -1; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O|Oii:find_all_wcs", + (char **)keywords, &header_obj, &relax_obj, &keysel, &warnings)) { + return NULL; + } + + if (PyBytes_AsStringAndSize(header_obj, &header, &header_length)) { + return NULL; + } + + nkeyrec = header_length / 80; + if (nkeyrec > 0x7fffffff) { + PyErr_SetString( + PyExc_MemoryError, + "header is too long"); + return NULL; + } + + if (relax_obj == Py_True) { + relax = WCSHDR_all; + } else if (relax_obj == NULL || relax_obj == Py_False) { + relax = WCSHDR_none; + } else { + relax = (int)PyLong_AsLong(relax_obj); + if (relax == -1) { + PyErr_SetString( + PyExc_ValueError, + "relax must be True, False or an integer."); + return NULL; + } + } + + /* Call the header parser twice, the first time to get warnings + out about "rejected" keywords (which we can then send to Python + as warnings), and the second time to get a corrected wcsprm + object. */ + + Py_BEGIN_ALLOW_THREADS + if (keysel < 0) { + status = wcspih( + header, + (int)nkeyrec, + WCSHDR_reject, + 2, + &nreject, + &nwcs, + &wcs); + } else { + status = wcsbth( + header, + (int)nkeyrec, + WCSHDR_reject, + 2, + keysel, + NULL, + &nreject, + &nwcs, + &wcs); + } + Py_END_ALLOW_THREADS + + if (status != 0) { + wcshdr_err_to_python_exc(status); + return NULL; + } + + wcsvfree(&nwcs, &wcs); + + if (warnings && convert_rejections_to_warnings()) { + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + if (keysel < 0) { + status = wcspih( + header, + (int)nkeyrec, + relax, + 0, + &nreject, + &nwcs, + &wcs); + } else { + status = wcsbth( + header, + (int)nkeyrec, + relax, + 0, + keysel, + NULL, + &nreject, + &nwcs, + &wcs); + } + Py_END_ALLOW_THREADS + + if (status != 0) { + wcshdr_err_to_python_exc(status); + return NULL; + } + + result = PyList_New(nwcs); + if (result == NULL) { + wcsvfree(&nwcs, &wcs); + return NULL; + } + + for (i = 0; i < nwcs; ++i) { + subresult = PyWcsprm_cnew(); + if (wcscopy(1, wcs + i, &subresult->x) != 0) { + Py_DECREF(result); + wcsvfree(&nwcs, &wcs); + PyErr_SetString( + PyExc_MemoryError, + "Could not initialize wcsprm object"); + return NULL; + } + + if (PyList_SetItem(result, i, (PyObject *)subresult) == -1) { + Py_DECREF(subresult); + Py_DECREF(result); + wcsvfree(&nwcs, &wcs); + return NULL; + } + + subresult->x.flag = 0; + wcsprm_c2python(&subresult->x); + } + + wcsvfree(&nwcs, &wcs); + return result; +} + +static PyObject* +PyWcsprm_cdfix( + PyWcsprm* self) { + + int status = 0; + + wcsprm_python2c(&self->x); + status = cdfix(&self->x); + wcsprm_c2python(&self->x); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + +static PyObject* +PyWcsprm_celfix( + PyWcsprm* self) { + + int status = 0; + + wcsprm_python2c(&self->x); + status = celfix(&self->x); + wcsprm_c2python(&self->x); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + +static PyObject * +PyWcsprm_compare( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int cmp = 0; + PyWcsprm *other; + double tolerance = 0.0; + int equal; + int status; + + const char* keywords[] = {"other", "cmp", "tolerance", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O!|id:compare", (char **)keywords, + &PyWcsprmType, &other, &cmp, &tolerance)) { + return NULL; + } + + + wcsprm_python2c(&self->x); + wcsprm_python2c(&other->x); + status = wcscompare(cmp, tolerance, &self->x, &other->x, &equal); + wcsprm_c2python(&self->x); + wcsprm_c2python(&other->x); + + if (status) { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } else { + if (equal) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } +} + +/*@null@*/ static PyObject* +PyWcsprm_cylfix( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + PyObject* naxis_obj = NULL; + PyArrayObject* naxis_array = NULL; + int* naxis = NULL; + int status = 0; + const char* keywords[] = {"naxis", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|O:cylfix", (char **)keywords, + &naxis_obj)) { + return NULL; + } + + if (naxis_obj != NULL && naxis_obj != Py_None) { + naxis_array = (PyArrayObject*)PyArray_ContiguousFromAny( + naxis_obj, 1, 1, NPY_INT); + if (naxis_array == NULL) { + return NULL; + } + if (PyArray_DIM(naxis_array, 0) != self->x.naxis) { + PyErr_Format( + PyExc_ValueError, + "naxis must be same length as the number of axes of " + "the Wcsprm object (%d).", + self->x.naxis); + Py_DECREF(naxis_array); + return NULL; + } + naxis = (int*)PyArray_DATA(naxis_array); + } + + wcsprm_python2c(&self->x); + status = cylfix(naxis, &self->x); + wcsprm_c2python(&self->x); + + Py_XDECREF(naxis_array); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + +static PyObject* +PyWcsprm_datfix( + PyWcsprm* self) { + + int status = 0; + + wcsprm_python2c(&self->x); + status = datfix(&self->x); + wcsprm_c2python(&self->x); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + +/*@null@*/ static PyObject* +PyWcsprm_fix( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + const char* translate_units = NULL; + int ctrl = 0; + PyObject* naxis_obj = NULL; + PyArrayObject* naxis_array = NULL; + int* naxis = NULL; + int stat[NWCSFIX]; + struct wcserr err[NWCSFIX]; + PyObject* subresult; + PyObject* result; + int i = 0; + int msg_index = 0; + const char* message; + + struct message_map_entry { + const char* name; + const int index; + }; + const struct message_map_entry message_map[NWCSFIX] = { + {"cdfix", CDFIX}, + {"datfix", DATFIX}, +#if (NWCSFIX > 6) + {"obsfix", OBSFIX}, +#endif + {"unitfix", UNITFIX}, + {"celfix", CELFIX}, + {"spcfix", SPCFIX}, + {"cylfix", CYLFIX} + }; + const char* keywords[] = {"translate_units", "naxis", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|sO:fix", (char **)keywords, + &translate_units, &naxis_obj)) { + return NULL; + } + + if (translate_units != NULL) { + if (parse_unsafe_unit_conversion_spec(translate_units, &ctrl)) { + return NULL; + } + } + + if (naxis_obj != NULL && naxis_obj != Py_None) { + naxis_array = (PyArrayObject*)PyArray_ContiguousFromAny( + naxis_obj, 1, 1, NPY_INT); + if (naxis_array == NULL) { + return NULL; + } + if (PyArray_DIM(naxis_array, 0) != self->x.naxis) { + PyErr_Format( + PyExc_ValueError, + "naxis must be same length as the number of axes of " + "the Wcprm object (%d).", + self->x.naxis); + Py_DECREF(naxis_array); + return NULL; + } + naxis = (int*)PyArray_DATA(naxis_array); + } + + memset(err, 0, sizeof(struct wcserr) * NWCSFIX); + + wcsprm_python2c(&self->x); + wcsfixi(ctrl, naxis, &self->x, stat, err); + wcsprm_c2python(&self->x); + + /* We're done with this already, so deref now so we don't have to remember + later */ + Py_XDECREF(naxis_array); + + result = PyDict_New(); + if (result == NULL) { + return NULL; + } + + for (i = 0; i < NWCSFIX; ++i) { + msg_index = stat[message_map[i].index]; + message = err[message_map[i].index].msg; + if (message == NULL || message[0] == 0) { + if (msg_index == FIXERR_SUCCESS) { + message = "Success"; + } else { + message = "No change"; + } + } + subresult = PyUnicode_FromString(message); + if (subresult == NULL || + PyDict_SetItemString(result, message_map[i].name, subresult)) { + Py_XDECREF(subresult); + Py_XDECREF(result); + return NULL; + } + Py_XDECREF(subresult); + } + + return result; +} + +/*@null@*/ static PyObject* +PyWcsprm_get_cdelt_func( + PyWcsprm* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.cdelt)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + naxis = self->x.naxis; + + return get_double_array_readonly("cdelt", self->x.cdelt, 1, &naxis, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_pc_func( + PyWcsprm* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + npy_intp dims[2]; + + if (is_null(self->x.pc)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + return get_double_array_readonly("pc", self->x.pc, 2, dims, (PyObject*)self); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_ps( + PyWcsprm* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + return get_pscards("ps", self->x.ps, self->x.nps); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_pv( + PyWcsprm* self, + /*@unused@*/ PyObject* args, + /*@unused@*/ PyObject* kwds) { + + return get_pvcards("pv", self->x.pv, self->x.npv); +} + +static PyObject* +PyWcsprm_has_cdi_ja( + PyWcsprm* self) { + + int result = 0; + + result = self->x.altlin & has_cd; + + return PyBool_FromLong(result); +} + +static PyObject* +PyWcsprm_has_crotaia( + PyWcsprm* self) { + + int result = 0; + + result = self->x.altlin & has_crota; + + return PyBool_FromLong(result); +} + +static PyObject* +PyWcsprm_has_pci_ja( + PyWcsprm* self) { + + int result = 0; + + result = (self->x.altlin == 0 || self->x.altlin & has_pc); + + return PyBool_FromLong(result); +} + +static PyObject* +PyWcsprm_is_unity( + PyWcsprm* self) { + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + return PyBool_FromLong(self->x.lin.unity); +} + +/*@null@*/ static PyObject* +PyWcsprm_mix( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int mixpix = 0; + int mixcel = 0; + double vspan[2] = {0, 0}; + double vstep = 0; + int viter = 0; + Py_ssize_t naxis = 0; + PyObject* world_obj = NULL; + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* world = NULL; + PyArrayObject* phi = NULL; + PyArrayObject* theta = NULL; + PyArrayObject* imgcrd = NULL; + PyArrayObject* pixcrd = NULL; + int status = -1; + PyObject* result = NULL; + const char* keywords[] = { + "mixpix", "mixcel", "vspan", "vstep", "viter", "world", "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "ii(dd)diOOi:mix", (char **)keywords, + &mixpix, &mixcel, &vspan[0], &vspan[1], &vstep, &viter, &world_obj, + &pixcrd_obj, &origin)) { + return NULL; + } + + if (viter < 5 || viter > 10) { + PyErr_SetString( + PyExc_ValueError, + "viter must be in the range 5 - 10"); + goto exit; + } + + world = (PyArrayObject*)PyArray_ContiguousFromAny + (world_obj, NPY_DOUBLE, 1, 1); + if (world == NULL) { + PyErr_SetString( + PyExc_TypeError, + "Argument 6 (world) must be a 1-dimensional numpy array"); + goto exit; + } + if ((int)PyArray_DIM(world, 0) != self->x.naxis) { + PyErr_Format( + PyExc_TypeError, + "Argument 6 (world) must be the same length as the number " + "of axes (%d)", + self->x.naxis); + goto exit; + } + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny + (pixcrd_obj, NPY_DOUBLE, 1, 1); + if (pixcrd == NULL) { + PyErr_SetString( + PyExc_TypeError, + "Argument 7 (pixcrd) must be a 1-dimensional numpy array"); + goto exit; + } + if ((int)PyArray_DIM(pixcrd, 0) != self->x.naxis) { + PyErr_Format( + PyExc_TypeError, + "Argument 7 (pixcrd) must be the same length as the " + "number of axes (%d)", + self->x.naxis); + goto exit; + } + + if (mixpix < 1 || mixpix > self->x.naxis) { + PyErr_SetString( + PyExc_ValueError, + "Argument 1 (mixpix) must specify a pixel coordinate " + "axis number"); + goto exit; + } + + if (mixcel < 1 || mixcel > 2) { + PyErr_SetString( + PyExc_ValueError, + "Argument 2 (mixcel) must specify a celestial coordinate " + "axis number (1 for latitude, 2 for longitude)"); + goto exit; + } + + /* Now we allocate a bunch of numpy arrays to store the + * results in. + */ + naxis = (Py_ssize_t)self->x.naxis; + phi = (PyArrayObject*)PyArray_SimpleNew + (1, &naxis, NPY_DOUBLE); + if (phi == NULL) { + goto exit; + } + + theta = (PyArrayObject*)PyArray_SimpleNew + (1, &naxis, NPY_DOUBLE); + if (theta == NULL) { + goto exit; + } + + imgcrd = (PyArrayObject*)PyArray_SimpleNew + (1, &naxis, NPY_DOUBLE); + if (imgcrd == NULL) { + goto exit; + } + + /* Convert pixel coordinates to 1-based */ + Py_BEGIN_ALLOW_THREADS + preoffset_array(pixcrd, origin); + wcsprm_python2c(&self->x); + status = wcsmix( + &self->x, + mixpix, + mixcel, + vspan, + vstep, + viter, + (double*)PyArray_DATA(world), + (double*)PyArray_DATA(phi), + (double*)PyArray_DATA(theta), + (double*)PyArray_DATA(imgcrd), + (double*)PyArray_DATA(pixcrd)); + wcsprm_c2python(&self->x); + unoffset_array(pixcrd, origin); + unoffset_array(imgcrd, origin); + Py_END_ALLOW_THREADS + + if (status == 0) { + result = PyDict_New(); + if (result == NULL || + PyDict_SetItemString(result, "imgcrd", (PyObject*)imgcrd) || + PyDict_SetItemString(result, "phi", (PyObject*)phi) || + PyDict_SetItemString(result, "theta", (PyObject*)theta) || + PyDict_SetItemString(result, "world", (PyObject*)world)) { + goto exit; + } + } + + exit: + Py_XDECREF(world); + Py_XDECREF(phi); + Py_XDECREF(theta); + Py_XDECREF(imgcrd); + Py_XDECREF(pixcrd); + + if (status == 0) { + return result; + } else { + Py_XDECREF(result); + if (status == -1) { + /* The error message has already been set */ + return NULL; + } else { + wcs_to_python_exc(&(self->x)); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +PyWcsprm_p2s( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int naxis = 2; + int ncoord = 0; + int nelem = 0; + PyObject* pixcrd_obj = NULL; + int origin = 1; + PyArrayObject* pixcrd = NULL; + PyArrayObject* imgcrd = NULL; + PyArrayObject* phi = NULL; + PyArrayObject* theta = NULL; + PyArrayObject* world = NULL; + PyArrayObject* stat = NULL; + PyObject* result = NULL; + int status = 0; + const char* keywords[] = { + "pixcrd", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "Oi:p2s", (char **)keywords, + &pixcrd_obj, &origin)) { + return NULL; + } + + naxis = self->x.naxis; + + pixcrd = (PyArrayObject*)PyArray_ContiguousFromAny + (pixcrd_obj, NPY_DOUBLE, 2, 2); + if (pixcrd == NULL) { + return NULL; + } + + if (PyArray_DIM(pixcrd, 1) < naxis) { + PyErr_Format( + PyExc_RuntimeError, + "Input array must be 2-dimensional, where the second dimension >= %d", + naxis); + goto exit; + } + + /* Now we allocate a bunch of numpy arrays to store the results in. + */ + imgcrd = (PyArrayObject*)PyArray_SimpleNew( + 2, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (imgcrd == NULL) { + goto exit; + } + + phi = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (phi == NULL) { + goto exit; + } + + theta = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (theta == NULL) { + goto exit; + } + + world = (PyArrayObject*)PyArray_SimpleNew( + 2, PyArray_DIMS(pixcrd), NPY_DOUBLE); + if (world == NULL) { + goto exit; + } + + stat = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(pixcrd), NPY_INT); + if (stat == NULL) { + goto exit; + } + + /* Make the call */ + Py_BEGIN_ALLOW_THREADS + ncoord = PyArray_DIM(pixcrd, 0); + nelem = PyArray_DIM(pixcrd, 1); + preoffset_array(pixcrd, origin); + wcsprm_python2c(&self->x); + status = wcsp2s( + &self->x, + ncoord, + nelem, + (double*)PyArray_DATA(pixcrd), + (double*)PyArray_DATA(imgcrd), + (double*)PyArray_DATA(phi), + (double*)PyArray_DATA(theta), + (double*)PyArray_DATA(world), + (int*)PyArray_DATA(stat)); + wcsprm_c2python(&self->x); + unoffset_array(pixcrd, origin); + /* unoffset_array(world, origin); */ + unoffset_array(imgcrd, origin); + if (status == 8) { + set_invalid_to_nan( + ncoord, nelem, (double*)PyArray_DATA(imgcrd), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, 1, (double*)PyArray_DATA(phi), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, 1, (double*)PyArray_DATA(theta), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, nelem, (double*)PyArray_DATA(world), (int*)PyArray_DATA(stat)); + } + Py_END_ALLOW_THREADS + + if (status == 0 || status == 8) { + result = PyDict_New(); + if (result == NULL || + PyDict_SetItemString(result, "imgcrd", (PyObject*)imgcrd) || + PyDict_SetItemString(result, "phi", (PyObject*)phi) || + PyDict_SetItemString(result, "theta", (PyObject*)theta) || + PyDict_SetItemString(result, "world", (PyObject*)world) || + PyDict_SetItemString(result, "stat", (PyObject*)stat)) { + goto exit; + } + } + + exit: + Py_XDECREF(pixcrd); + Py_XDECREF(imgcrd); + Py_XDECREF(phi); + Py_XDECREF(theta); + Py_XDECREF(world); + Py_XDECREF(stat); + + if (status == 0 || status == 8) { + return result; + } else { + Py_XDECREF(result); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + wcs_to_python_exc(&(self->x)); + return NULL; + } + } +} + +/*@null@*/ static PyObject* +PyWcsprm_s2p( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int naxis = 2; + int ncoord = 0; + int nelem = 0; + PyObject* world_obj = NULL; + int origin = 1; + PyArrayObject* world = NULL; + PyArrayObject* phi = NULL; + PyArrayObject* theta = NULL; + PyArrayObject* imgcrd = NULL; + PyArrayObject* pixcrd = NULL; + PyArrayObject* stat = NULL; + PyObject* result = NULL; + int status = -1; + const char* keywords[] = { + "world", "origin", NULL }; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "Oi:s2p", (char **)keywords, + &world_obj, &origin)) { + return NULL; + } + + naxis = self->x.naxis; + + world = (PyArrayObject*)PyArray_ContiguousFromAny( + world_obj, NPY_DOUBLE, 2, 2); + if (world == NULL) { + return NULL; + } + + if (PyArray_DIM(world, 1) < naxis) { + PyErr_Format( + PyExc_RuntimeError, + "Input array must be 2-dimensional, where the second dimension >= %d", + naxis); + goto exit; + } + + /* Now we allocate a bunch of numpy arrays to store the + * results in. + */ + phi = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(world), NPY_DOUBLE); + if (phi == NULL) { + goto exit; + } + + theta = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(world), NPY_DOUBLE); + if (phi == NULL) { + goto exit; + } + + imgcrd = (PyArrayObject*)PyArray_SimpleNew( + 2, PyArray_DIMS(world), NPY_DOUBLE); + if (theta == NULL) { + goto exit; + } + + pixcrd = (PyArrayObject*)PyArray_SimpleNew( + 2, PyArray_DIMS(world), NPY_DOUBLE); + if (pixcrd == NULL) { + goto exit; + } + + stat = (PyArrayObject*)PyArray_SimpleNew( + 1, PyArray_DIMS(world), NPY_INT); + if (stat == NULL) { + goto exit; + } + + /* Make the call */ + Py_BEGIN_ALLOW_THREADS + ncoord = (int)PyArray_DIM(world, 0); + nelem = (int)PyArray_DIM(world, 1); + /* preoffset_array(world, origin); */ + wcsprm_python2c(&self->x); + status = wcss2p( + &self->x, + ncoord, + nelem, + (double*)PyArray_DATA(world), + (double*)PyArray_DATA(phi), + (double*)PyArray_DATA(theta), + (double*)PyArray_DATA(imgcrd), + (double*)PyArray_DATA(pixcrd), + (int*)PyArray_DATA(stat)); + wcsprm_c2python(&self->x); + /* unoffset_array(world, origin); */ + unoffset_array(pixcrd, origin); + unoffset_array(imgcrd, origin); + if (status == 9) { + set_invalid_to_nan( + ncoord, 1, (double*)PyArray_DATA(phi), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, 1, (double*)PyArray_DATA(theta), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, nelem, (double*)PyArray_DATA(imgcrd), (int*)PyArray_DATA(stat)); + set_invalid_to_nan( + ncoord, nelem, (double*)PyArray_DATA(pixcrd), (int*)PyArray_DATA(stat)); + } + Py_END_ALLOW_THREADS + + if (status == 0 || status == 9) { + result = PyDict_New(); + if (result == NULL || + PyDict_SetItemString(result, "phi", (PyObject*)phi) || + PyDict_SetItemString(result, "theta", (PyObject*)theta) || + PyDict_SetItemString(result, "imgcrd", (PyObject*)imgcrd) || + PyDict_SetItemString(result, "pixcrd", (PyObject*)pixcrd) || + PyDict_SetItemString(result, "stat", (PyObject*)stat)) { + goto exit; + } + } + + exit: + Py_XDECREF(pixcrd); + Py_XDECREF(imgcrd); + Py_XDECREF(phi); + Py_XDECREF(theta); + Py_XDECREF(world); + Py_XDECREF(stat); + + if (status == 0 || status == 9) { + return result; + } else { + Py_XDECREF(result); + if (status == -1) { + /* Exception already set */ + return NULL; + } else { + wcs_to_python_exc(&(self->x)); + return NULL; + } + } +} + +static int +PyWcsprm_cset( + PyWcsprm* self, + const int convert) { + + int status = 0; + + if (convert) wcsprm_python2c(&self->x); + status = wcsset(&self->x); + if (convert) wcsprm_c2python(&self->x); + + if (status == 0) { + return 0; + } else { + wcs_to_python_exc(&(self->x)); + return 1; + } +} + +/*@null@*/ static PyObject* +PyWcsprm_set( + PyWcsprm* self) { + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + Py_INCREF(Py_None); + return Py_None; +} + +/*@null@*/ static PyObject* +PyWcsprm_set_ps( + PyWcsprm* self, + PyObject* arg, + /*@unused@*/ PyObject* kwds) { + + if (is_null(self->x.ps)) { + return NULL; + } + + if (set_pscards("ps", arg, &self->x.ps, &self->x.nps, &self->x.npsmax)) { + self->x.m_ps = self->x.ps; + return NULL; + } + self->x.m_ps = self->x.ps; + + note_change(self); + + Py_INCREF(Py_None); + return Py_None; +} + +/*@null@*/ static PyObject* +PyWcsprm_set_pv( + PyWcsprm* self, + PyObject* arg, + /*@unused@*/ PyObject* kwds) { + + if (is_null(self->x.pv)) { + return NULL; + } else if (set_pvcards("pv", arg, &self->x.pv, &self->x.npv, &self->x.npvmax)) { + return NULL; + } else { + self->x.m_pv = self->x.pv; + note_change(self); + Py_INCREF(Py_None); + return Py_None; + } +} + +/* TODO: This is convenient for debugging for now -- but it's not very + * Pythonic. It should probably be hooked into __str__ or something. + */ +/*@null@*/ static PyObject* +PyWcsprm_print_contents( + PyWcsprm* self) { + + /* This is not thread-safe, but since we're holding onto the GIL, + we can assume we won't have thread conflicts */ + wcsprintf_set(NULL); + + wcsprm_python2c(&self->x); + if (PyWcsprm_cset(self, 0)) { + wcsprm_c2python(&self->x); + return NULL; + } + wcsprt(&self->x); + wcsprm_c2python(&self->x); + + printf("%s", wcsprintf_buf()); + + Py_INCREF(Py_None); + return Py_None; +} + +/*@null@*/ static PyObject* +PyWcsprm_spcfix( + PyWcsprm* self) { + + int status = 0; + + wcsprm_python2c(&self->x); + status = spcfix(&self->x); + wcsprm_c2python(&self->x); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + +/*@null@*/ static PyObject* +PyWcsprm_sptr( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int i = -1; + const char* py_ctype = NULL; + char ctype[9]; + int status = 0; + const char* keywords[] = {"ctype", "i", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "s|i:sptr", (char **)keywords, + &py_ctype, &i)) { + return NULL; + } + + if (strlen(py_ctype) > 8) { + PyErr_SetString( + PyExc_ValueError, + "ctype string has more than 8 characters."); + } + + strncpy(ctype, py_ctype, 9); + + wcsprm_python2c(&self->x); + status = wcssptr(&self->x, &i, ctype); + wcsprm_c2python(&self->x); + + if (status == 0) { + Py_INCREF(Py_None); + return Py_None; + } else { + wcs_to_python_exc(&(self->x)); + return NULL; + } +} + +/*@null@*/ static PyObject* +PyWcsprm___str__( + PyWcsprm* self) { + + /* This is not thread-safe, but since we're holding onto the GIL, + we can assume we won't have thread conflicts */ + wcsprintf_set(NULL); + + wcsprm_python2c(&self->x); + if (PyWcsprm_cset(self, 0)) { + wcsprm_c2python(&self->x); + return NULL; + } + wcsprt(&self->x); + wcsprm_c2python(&self->x); + + return PyUnicode_FromString(wcsprintf_buf()); +} + +PyObject *PyWcsprm_richcompare(PyObject *a, PyObject *b, int op) { + int equal; + int status; + + struct wcsprm *ax; + struct wcsprm *bx; + + if ((op == Py_EQ || op == Py_NE) && + PyObject_TypeCheck(b, &PyWcsprmType)) { + ax = &((PyWcsprm *)a)->x; + bx = &((PyWcsprm *)b)->x; + + wcsprm_python2c(ax); + wcsprm_python2c(bx); + status = wcscompare( + WCSCOMPARE_ANCILLARY, 0.0, + ax, bx, &equal); + wcsprm_c2python(ax); + wcsprm_c2python(bx); + + if (status == 0) { + if (op == Py_NE) { + equal = !equal; + } + if (equal) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } else { + wcs_to_python_exc(&(((PyWcsprm *)a)->x)); + return NULL; + } + } + + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; +} + +/*@null@*/ static PyObject* +PyWcsprm_sub( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + int i = -1; + Py_ssize_t tmp = 0; + PyObject* py_axes = NULL; + PyWcsprm* py_dest_wcs = NULL; + PyObject* element = NULL; + PyObject* element_utf8 = NULL; + char* element_str = NULL; + int element_val = 0; + int nsub = 0; + int* axes = NULL; + int status = -1; + const char* keywords[] = {"axes", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|O:sub", (char **)keywords, + &py_axes)) { + goto exit; + } + + if (py_axes == NULL || py_axes == Py_None) { + /* leave all variables as is */ + } else if (PyList_Check(py_axes) || PyTuple_Check(py_axes)) { + tmp = PySequence_Size(py_axes); + if (tmp == -1) { + goto exit; + } + nsub = (int)tmp; + + axes = malloc(nsub * sizeof(int) * 2); + if (axes == NULL) { + PyErr_SetString(PyExc_MemoryError, "Out of memory"); + goto exit; + } + + for (i = 0; i < nsub; ++i) { + element = PySequence_GetItem(py_axes, i); + if (element == NULL) { + goto exit; + } + + if (PyUnicode_Check(element) || PyBytes_Check(element)) { + if (PyUnicode_Check(element)) { + element_utf8 = PyUnicode_AsUTF8String(element); + if (element_utf8 == NULL) { + goto exit; + } + + element_str = PyBytes_AsString(element_utf8); + Py_DECREF(element_utf8); element_utf8 = NULL; + } else if (PyBytes_Check(element)) { + element_str = PyBytes_AsString(element); + } + + if (strncmp(element_str, "longitude", 10) == 0) { + element_val = WCSSUB_LONGITUDE; + } else if (strncmp(element_str, "latitude", 9) == 0) { + element_val = WCSSUB_LATITUDE; + } else if (strncmp(element_str, "cubeface", 9) == 0) { + element_val = WCSSUB_CUBEFACE; + } else if (strncmp(element_str, "spectral", 9) == 0) { + element_val = WCSSUB_SPECTRAL; + } else if (strncmp(element_str, "stokes", 7) == 0) { + element_val = WCSSUB_STOKES; + } else if (strncmp(element_str, "celestial", 10) == 0) { + element_val = WCSSUB_CELESTIAL; + } else { + PyErr_SetString( + PyExc_ValueError, + "string values for axis sequence must be one of 'latitude', 'longitude', 'cubeface', 'spectral', 'stokes', or 'celestial'"); + goto exit; + } + } else if (PyLong_Check(element)) { + tmp = (Py_ssize_t)PyLong_AsSsize_t(element); + if (tmp == -1 && PyErr_Occurred()) { + goto exit; + } + element_val = (int)tmp; + } else { + PyErr_SetString( + PyExc_TypeError, + "axes sequence must contain either strings or ints"); + goto exit; + } + + axes[i] = element_val; + + Py_DECREF(element); + element = NULL; + } + } else if (PyLong_Check(py_axes)) { + tmp = (Py_ssize_t)PyLong_AsSsize_t(py_axes); + if (tmp == -1 && PyErr_Occurred()) { + goto exit; + } + nsub = (int)tmp; + + if (nsub < 0 || nsub > self->x.naxis) { + PyErr_Format( + PyExc_ValueError, + "If axes is an int, it must be in the range 0-self.naxis (%d)", + self->x.naxis); + goto exit; + } + } else { + PyErr_SetString( + PyExc_TypeError, + "axes must None, a sequence or an integer"); + goto exit; + } + + py_dest_wcs = (PyWcsprm*)PyWcsprm_cnew(); + py_dest_wcs->x.flag = -1; + status = wcsini(0, nsub, &py_dest_wcs->x); + if (status != 0) { + goto exit; + } + + wcsprm_python2c(&self->x); + status = wcssub(1, &self->x, &nsub, axes, &py_dest_wcs->x); + wcsprm_c2python(&self->x); + if (PyWcsprm_cset(py_dest_wcs, 0)) { + status = -1; + goto exit; + } + wcsprm_c2python(&py_dest_wcs->x); + + if (status != 0) { + goto exit; + } + + exit: + free(axes); + Py_XDECREF(element); + Py_XDECREF(element_utf8); + + if (status == 0) { + return (PyObject*)py_dest_wcs; + } else if (status == -1) { + Py_XDECREF(py_dest_wcs); + /* Exception already set */ + return NULL; + } else { + wcs_to_python_exc(&(py_dest_wcs->x)); + Py_XDECREF(py_dest_wcs); + return NULL; + } +} + +/*@null@*/ static PyObject* +PyWcsprm_to_header( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + PyObject* relax_obj = NULL; + int relax = 0; + int nkeyrec = 0; + char* header = NULL; + int status = -1; + PyObject* result = NULL; + const char* keywords[] = {"relax", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|O:to_header", + (char **)keywords, &relax_obj)) { + goto exit; + } + + if (relax_obj == Py_True) { + relax = WCSHDO_all; + } else if (relax_obj == NULL || relax_obj == Py_False) { + relax = WCSHDO_safe; + } else { + relax = (int)PyLong_AsLong(relax_obj); + if (relax == -1) { + PyErr_SetString( + PyExc_ValueError, + "relax must be True, False or an integer."); + return NULL; + } + } + + wcsprm_python2c(&self->x); + status = wcshdo(relax, &self->x, &nkeyrec, &header); + wcsprm_c2python(&self->x); + + if (status != 0) { + wcs_to_python_exc(&(self->x)); + goto exit; + } + + /* Just return the raw header string. astropy.io.fits on the Python side will + help to parse and use this information. */ + result = PyUnicode_FromStringAndSize(header, (Py_ssize_t)nkeyrec * 80); + + exit: + free(header); + return result; +} + +/*@null@*/ static PyObject* +PyWcsprm_unitfix( + PyWcsprm* self, + PyObject* args, + PyObject* kwds) { + + const char* translate_units = NULL; + int ctrl = 0; + int status = 0; + const char* keywords[] = {"translate_units", NULL}; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|s:unitfix", (char **)keywords, + &translate_units)) { + return NULL; + } + + if (translate_units != NULL) { + if (parse_unsafe_unit_conversion_spec(translate_units, &ctrl)) { + return NULL; + } + } + + status = unitfix(ctrl, &self->x); + + if (status == -1 || status == 0) { + return PyLong_FromLong((long)status); + } else { + wcserr_fix_to_python_exc(self->x.err); + return NULL; + } +} + + +/*************************************************************************** + * Member getters/setters (properties) + */ +/*@null@*/ static PyObject* +PyWcsprm_get_alt( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.alt)) { + return NULL; + } + + /* Force a null-termination of this single-character string */ + self->x.alt[1] = '\0'; + return get_string("alt", self->x.alt); +} + +static int +PyWcsprm_set_alt( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + char value_string[2]; + + if (is_null(self->x.alt)) { + return -1; + } + + if (value == NULL) { /* deletion */ + self->x.alt[0] = ' '; + self->x.alt[1] = '\0'; + note_change(self); + return 0; + } + + if (set_string("alt", value, value_string, 2)) { + return -1; + } + + if (!is_valid_alt_key(value_string)) { + return -1; + } + + strncpy(self->x.alt, value_string, 2); + + return 0; +} + +/*@null@*/ static PyObject* +PyWcsprm_get_axis_types( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.types)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_int_array("axis_types", self->x.types, 1, &naxis, (PyObject*)self); +} + +static PyObject* +PyWcsprm_get_bepoch( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("bepoch", self->x.bepoch); +} + +static int +PyWcsprm_set_bepoch( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.bepoch = (double)NPY_NAN; + return 0; + } + + return set_double("bepoch", value, &self->x.bepoch); +} + + +/*@null@*/ static PyObject* +PyWcsprm_get_cd( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (is_null(self->x.cd)) { + return NULL; + } + + if ((self->x.altlin & has_cd) == 0) { + PyErr_SetString(PyExc_AttributeError, "No cd is present."); + return NULL; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + return get_double_array("cd", self->x.cd, 2, dims, (PyObject*)self); +} + +static int +PyWcsprm_set_cd( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (is_null(self->x.cd)) { + return -1; + } + + + if (value == NULL) { + self->x.altlin &= ~has_cd; + note_change(self); + return 0; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + if (set_double_array("cd", value, 2, dims, self->x.cd)) { + return -1; + } + + self->x.altlin |= has_cd; + + note_change(self); + + return 0; +} + + /*@null@*/ static PyObject* +PyWcsprm_get_cdelt( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.cdelt)) { + return NULL; + } + + naxis = self->x.naxis; + + if (self->x.altlin & has_cd) { + PyErr_WarnEx(NULL, "cdelt will be ignored since cd is present", 1); + } + + return get_double_array("cdelt", self->x.cdelt, 1, &naxis, (PyObject*)self); +} + +/*@null@*/ static int +PyWcsprm_set_cdelt( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp dims; + + if (is_null(self->x.cdelt)) { + return -1; + } + + dims = (npy_int)self->x.naxis; + + if (self->x.altlin & has_cd) { + PyErr_WarnEx(NULL, "cdelt will be ignored since cd is present", 1); + } + + note_change(self); + + return set_double_array("cdelt", value, 1, &dims, self->x.cdelt); +} + +static PyObject* +PyWcsprm_get_cel_offset( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_bool("cel_offset", self->x.cel.offset); +} + +static int +PyWcsprm_set_cel_offset( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + return set_bool("cel_offset", value, &self->x.cel.offset); +} + + +/*@null@*/ static PyObject* +PyWcsprm_get_cname( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.cname)) { + return NULL; + } + + return get_str_list("cname", self->x.cname, (Py_ssize_t)self->x.naxis, 68, (PyObject*)self); +} + +/*@null@*/ static int +PyWcsprm_set_cname( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + if (is_null(self->x.cname)) { + return -1; + } + + return set_str_list("cname", value, (Py_ssize_t)self->x.naxis, 0, self->x.cname); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_colax( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.colax)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_int_array("colax", self->x.colax, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_colax( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 0; + + if (is_null(self->x.colax)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return set_int_array("colax", value, 1, &naxis, self->x.colax); +} + +static PyObject* +PyWcsprm_get_colnum( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_int("colnum", self->x.colnum); +} + +static int +PyWcsprm_set_colnum( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + return set_int("colnum", value, &self->x.colnum); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_crder( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.crder)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("crder", self->x.crder, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_crder( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 0; + + if (is_null(self->x.crder)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return set_double_array("crder", value, 1, &naxis, self->x.crder); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_crota( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.crota)) { + return NULL; + } + + if ((self->x.altlin & has_crota) == 0) { + PyErr_SetString(PyExc_AttributeError, "No crota is present."); + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("crota", self->x.crota, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_crota( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 0; + + if (is_null(self->x.crota)) { + return -1; + } + + if (value == NULL) { /* Deletion */ + self->x.altlin &= ~has_crota; + note_change(self); + return 0; + } + + naxis = (Py_ssize_t)self->x.naxis; + + if (set_double_array("crota", value, 1, &naxis, self->x.crota)) { + return -1; + } + + self->x.altlin |= has_crota; + + note_change(self); + + return 0; +} + +/*@null@*/ static PyObject* +PyWcsprm_get_crpix( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.crpix)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("crpix", self->x.crpix, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_crpix( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis = 0; + + if (is_null(self->x.crpix)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + note_change(self); + + return set_double_array("crpix", value, 1, &naxis, self->x.crpix); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_crval( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis = 0; + + if (is_null(self->x.crval)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("crval", self->x.crval, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_crval( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis; + + if (is_null(self->x.crval)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + note_change(self); + + return set_double_array("crval", value, 1, &naxis, self->x.crval); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_csyer( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis; + + if (is_null(self->x.csyer)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("csyer", self->x.csyer, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_csyer( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis; + + if (is_null(self->x.csyer)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return set_double_array("csyer", value, 1, &naxis, self->x.csyer); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_ctype( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ctype)) { + return NULL; + } + + return get_str_list("ctype", self->x.ctype, self->x.naxis, 68, (PyObject*)self); +} + +static int +PyWcsprm_set_ctype( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ctype)) { + return -1; + } + + note_change(self); + + return set_str_list("ctype", value, (Py_ssize_t)self->x.naxis, 0, self->x.ctype); +} + +static PyObject* +PyWcsprm_get_cubeface( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_int("cubeface", self->x.cubeface); +} + +static int +PyWcsprm_set_cubeface( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + return set_int("cubeface", value, &self->x.cubeface); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_cunit( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.cunit)) { + return NULL; + } + + return get_unit_list( + "cunit", self->x.cunit, (Py_ssize_t)self->x.naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_cunit( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.cunit)) { + return -1; + } + + note_change(self); + + return set_unit_list( + (PyObject *)self, "cunit", value, (Py_ssize_t)self->x.naxis, self->x.cunit); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_czphs( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis; + + if (is_null(self->x.czphs)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("czphs", self->x.czphs, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_czphs( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis; + + if (is_null(self->x.czphs)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return set_double_array("czphs", value, 1, &naxis, self->x.czphs); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_cperi( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t naxis; + + if (is_null(self->x.cperi)) { + return NULL; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return get_double_array("cperi", self->x.cperi, 1, &naxis, (PyObject*)self); +} + +static int +PyWcsprm_set_cperi( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp naxis; + + if (is_null(self->x.cperi)) { + return -1; + } + + naxis = (Py_ssize_t)self->x.naxis; + + return set_double_array("cperi", value, 1, &naxis, self->x.cperi); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_dateavg( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateavg)) { + return NULL; + } + + return get_string("dateavg", self->x.dateavg); +} + +static int +PyWcsprm_set_dateavg( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateavg)) { + return -1; + } + + /* TODO: Verify that this looks like a date string */ + + return set_string("dateavg", value, self->x.dateavg, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_datebeg( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.datebeg)) { + return NULL; + } + + return get_string("datebeg", self->x.datebeg); +} + +static int +PyWcsprm_set_datebeg( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.datebeg)) { + return -1; + } + + return set_string("datebeg", value, self->x.datebeg, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_dateend( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateend)) { + return NULL; + } + + return get_string("dateend", self->x.dateend); +} + +static int +PyWcsprm_set_dateend( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateend)) { + return -1; + } + + return set_string("dateend", value, self->x.dateend, 72); +} + + +/*@null@*/ static PyObject* +PyWcsprm_get_dateobs( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateobs)) { + return NULL; + } + + return get_string("dateobs", self->x.dateobs); +} + +static int +PyWcsprm_set_dateobs( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateobs)) { + return -1; + } + + return set_string("dateobs", value, self->x.dateobs, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_dateref( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateref)) { + return NULL; + } + + return get_string("dateref", self->x.dateref); +} + +static int +PyWcsprm_set_dateref( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.dateref)) { + return -1; + } + + return set_string("dateref", value, self->x.dateref, 72); +} + +static PyObject* +PyWcsprm_get_equinox( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("equinox", self->x.equinox); +} + +static int +PyWcsprm_set_equinox( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.equinox = (double)NPY_NAN; + return 0; + } + + return set_double("equinox", value, &self->x.equinox); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_imgpix_matrix( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (is_null(self->x.lin.imgpix)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + return get_double_array("imgpix_matrix", self->x.lin.imgpix, 2, dims, + (PyObject*)self); +} + +static PyObject* +PyWcsprm_get_jepoch( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("jepoch", self->x.jepoch); +} + +static int +PyWcsprm_set_jepoch( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.jepoch = (double)NPY_NAN; + return 0; + } + + return set_double("jepoch", value, &self->x.jepoch); +} + + +static PyObject* +PyWcsprm_get_lat( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + return get_int("lat", self->x.lat); +} + +static PyObject* +PyWcsprm_get_latpole( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("latpole", self->x.latpole); +} + +static int +PyWcsprm_set_latpole( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.latpole = 90.0; + return 0; + } + + return set_double("latpole", value, &self->x.latpole); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_lattyp( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.lattyp)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + return get_string("lattyp", self->x.lattyp); +} + +static PyObject* +PyWcsprm_get_lng( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + return get_int("lng", self->x.lng); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_lngtyp( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.lngtyp)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + return get_string("lngtyp", self->x.lngtyp); +} + +static PyObject* +PyWcsprm_get_lonpole( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("lonpole", self->x.lonpole); +} + +static int +PyWcsprm_set_lonpole( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.lonpole = (double)NPY_NAN; + return 0; + } + + return set_double("lonpole", value, &self->x.lonpole); +} + +static PyObject* +PyWcsprm_get_mjdavg( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("mjdavg", self->x.mjdavg); +} + +static int +PyWcsprm_set_mjdavg( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.mjdavg = (double)NPY_NAN; + return 0; + } + + return set_double("mjdavg", value, &self->x.mjdavg); +} + +static PyObject* +PyWcsprm_get_mjdbeg( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("mjdbeg", self->x.mjdbeg); +} + +static int +PyWcsprm_set_mjdbeg( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.mjdbeg = (double)NPY_NAN; + return 0; + } + + return set_double("mjdbeg", value, &self->x.mjdbeg); +} + +static PyObject* +PyWcsprm_get_mjdend( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("mjdend", self->x.mjdend); +} + +static int +PyWcsprm_set_mjdend( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.mjdend = (double)NPY_NAN; + return 0; + } + + return set_double("mjdend", value, &self->x.mjdend); +} + +static PyObject* +PyWcsprm_get_mjdobs( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("mjdobs", self->x.mjdobs); +} + +static int +PyWcsprm_set_mjdobs( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.mjdobs = (double)NPY_NAN; + return 0; + } + + return set_double("mjdobs", value, &self->x.mjdobs); +} + +static PyObject* +PyWcsprm_get_mjdref( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + npy_intp size = 2; + + return get_double_array("mjdref", self->x.mjdref, 1, &size, (PyObject*)self); +} + +static int +PyWcsprm_set_mjdref( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp size = 2; + + if (value == NULL) { + self->x.mjdref[0] = NPY_NAN; + self->x.mjdref[1] = NPY_NAN; + return 0; + } + return set_double_array("mjdref", value, 1, &size, self->x.mjdref); +} + + +/*@null@*/ static PyObject* +PyWcsprm_get_timesys( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.timesys)) { + return NULL; + } + + return get_string("timesys", self->x.timesys); +} + +static int +PyWcsprm_set_timesys( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.timesys)) { + return -1; + } + + return set_string("timesys", value, self->x.timesys, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_trefpos( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.trefpos)) { + return NULL; + } + + return get_string("trefpos", self->x.trefpos); +} + +static int +PyWcsprm_set_trefpos( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.trefpos)) { + return -1; + } + + return set_string("trefpos", value, self->x.trefpos, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_trefdir( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.trefdir)) { + return NULL; + } + + return get_string("trefdir", self->x.trefdir); +} + +static int +PyWcsprm_set_trefdir( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.trefdir)) { + return -1; + } + + return set_string("trefdir", value, self->x.trefdir, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_timeunit( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.timeunit)) { + return NULL; + } + + return get_string("timeunit", self->x.timeunit); +} + +static int +PyWcsprm_set_timeunit( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.timeunit)) { + return -1; + } + + return set_string("timeunit", value, self->x.timeunit, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_plephem( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.plephem)) { + return NULL; + } + + return get_string("plephem", self->x.plephem); +} + +static int +PyWcsprm_set_plephem( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.plephem)) { + return -1; + } + + return set_string("plephem", value, self->x.plephem, 72); +} + +static PyObject* +PyWcsprm_get_tstart( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("tstart", self->x.tstart); +} + +static int +PyWcsprm_set_tstart( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.tstart = (double)NPY_NAN; + return 0; + } + + return set_double("tstart", value, &self->x.tstart); +} + +static PyObject* +PyWcsprm_get_tstop( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("tstop", self->x.tstop); +} + +static int +PyWcsprm_set_tstop( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.tstop = (double)NPY_NAN; + return 0; + } + + return set_double("tstop", value, &self->x.tstop); +} + +static PyObject* +PyWcsprm_get_telapse( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("telapse", self->x.telapse); +} + +static int +PyWcsprm_set_telapse( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.telapse = (double)NPY_NAN; + return 0; + } + + return set_double("telapse", value, &self->x.telapse); +} + +static PyObject* +PyWcsprm_get_timeoffs( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("timeoffs", self->x.timeoffs); +} + +static int +PyWcsprm_set_timeoffs( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.timeoffs = (double)NPY_NAN; + return 0; + } + + return set_double("timeoffs", value, &self->x.timeoffs); +} + +static PyObject* +PyWcsprm_get_timsyer( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("timsyer", self->x.timsyer); +} + +static int +PyWcsprm_set_timsyer( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.timsyer = (double)NPY_NAN; + return 0; + } + + return set_double("timsyer", value, &self->x.timsyer); +} + +static PyObject* +PyWcsprm_get_timrder( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("timrder", self->x.timrder); +} + +static int +PyWcsprm_set_timrder( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.timrder = (double)NPY_NAN; + return 0; + } + + return set_double("timrder", value, &self->x.timrder); +} + +static PyObject* +PyWcsprm_get_timedel( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("timedel", self->x.timedel); +} + +static int +PyWcsprm_set_timedel( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.timedel = (double)NPY_NAN; + return 0; + } + + return set_double("timedel", value, &self->x.timedel); +} + +static PyObject* +PyWcsprm_get_timepixr( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("timepixr", self->x.timepixr); +} + +static int +PyWcsprm_set_timepixr( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.timepixr = (double)NPY_NAN; + return 0; + } + + return set_double("timepixr", value, &self->x.timepixr); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_obsorbit( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.obsorbit)) { + return NULL; + } + + return get_string("obsorbit", self->x.obsorbit); +} + +static int +PyWcsprm_set_obsorbit( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.obsorbit)) { + return -1; + } + + return set_string("obsorbit", value, self->x.obsorbit, 72); +} + +static PyObject* +PyWcsprm_get_xposure( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("xposure", self->x.xposure); +} + +static int +PyWcsprm_set_xposure( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { + self->x.xposure = (double)NPY_NAN; + return 0; + } + + return set_double("xposure", value, &self->x.xposure); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_name( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.wcsname)) { + return NULL; + } + + return get_string("name", self->x.wcsname); +} + +static int +PyWcsprm_set_name( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.wcsname)) { + return -1; + } + + return set_string("name", value, self->x.wcsname, 72); +} + +static PyObject* +PyWcsprm_get_naxis( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_int("naxis", self->x.naxis); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_obsgeo( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + Py_ssize_t size = 6; + + if (is_null(self->x.obsgeo)) { + return NULL; + } + + return get_double_array("obsgeo", self->x.obsgeo, 1, &size, (PyObject*)self); +} + +static int +PyWcsprm_set_obsgeo( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp size = 6; + + if (is_null(self->x.obsgeo)) { + return -1; + } + + if (value == NULL) { + self->x.obsgeo[0] = NPY_NAN; + self->x.obsgeo[1] = NPY_NAN; + self->x.obsgeo[2] = NPY_NAN; + self->x.obsgeo[3] = NPY_NAN; + self->x.obsgeo[4] = NPY_NAN; + self->x.obsgeo[5] = NPY_NAN; + return 0; + } + + return set_double_array("obsgeo", value, 1, &size, self->x.obsgeo); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_pc( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (is_null(self->x.pc)) { + return NULL; + } + + if (self->x.altlin != 0 && (self->x.altlin & has_pc) == 0) { + PyErr_SetString(PyExc_AttributeError, "No pc is present."); + return NULL; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + return get_double_array("pc", self->x.pc, 2, dims, (PyObject*)self); +} + +static int +PyWcsprm_set_pc( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + int i, j, naxis; + double* pc; + + if (is_null(self->x.pc)) { + return -1; + } + + note_change(self); + + if (value == NULL) { /* deletion */ + self->x.altlin &= ~has_pc; + + /* If this results in deleting all flags, pc is still the default, + so we should set the pc matrix itself to default values. */ + naxis = self->x.naxis; + pc = self->x.pc; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + if (j == i) { + *pc = 1.0; + } else { + *pc = 0.0; + } + pc++; + } + } + + note_change(self); + + return 0; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + if (set_double_array("pc", value, 2, dims, self->x.pc)) { + return -1; + } + + self->x.altlin |= has_pc; + + note_change(self); + + return 0; +} + +static PyObject* +PyWcsprm_get_phi0( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("phi0", self->x.cel.phi0); +} + +static int +PyWcsprm_set_phi0( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.cel.phi0 = (double)NPY_NAN; + return 0; + } + + return set_double("phi0", value, &(self->x.cel.phi0)); +} + +static PyObject* +PyWcsprm_get_piximg_matrix( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + npy_intp dims[2]; + + if (is_null(self->x.lin.piximg)) { + return NULL; + } + + if (PyWcsprm_cset(self, 1)) { + return NULL; + } + + dims[0] = self->x.naxis; + dims[1] = self->x.naxis; + + return get_double_array("piximg_matrix", self->x.lin.piximg, 2, dims, + (PyObject*)self); +} + +static PyObject* +PyWcsprm_get_radesys( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.radesys)) { + return NULL; + } + + return get_string("radesys", self->x.radesys); +} + +static int +PyWcsprm_set_radesys( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.radesys)) { + return -1; + } + + return set_string("radesys", value, self->x.radesys, 72); +} + +static PyObject* +PyWcsprm_get_restfrq( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("restfrq", self->x.restfrq); +} + +static int +PyWcsprm_set_restfrq( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.restfrq = (double)NPY_NAN; + return 0; + } + + note_change(self); + + return set_double("restfrq", value, &self->x.restfrq); +} + +static PyObject* +PyWcsprm_get_restwav( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("restwav", self->x.restwav); +} + +static int +PyWcsprm_set_restwav( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.restwav = (double)NPY_NAN; + return 0; + } + + note_change(self); + + return set_double("restwav", value, &self->x.restwav); +} + +static PyObject* +PyWcsprm_get_spec( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_int("spec", self->x.spec); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_specsys( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.specsys)) { + return NULL; + } + + return get_string("specsys", self->x.specsys); +} + +static int +PyWcsprm_set_specsys( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.specsys)) { + return -1; + } + + return set_string("specsys", value, self->x.specsys, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_ssysobs( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ssysobs)) { + return NULL; + } + + return get_string("ssysobs", self->x.ssysobs); +} + +static int +PyWcsprm_set_ssysobs( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ssysobs)) { + return -1; + } + + note_change(self); + + return set_string("ssysobs", value, self->x.ssysobs, 72); +} + +/*@null@*/ static PyObject* +PyWcsprm_get_ssyssrc( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ssyssrc)) { + return NULL; + } + + return get_string("ssyssrc", self->x.ssyssrc); +} + +static int +PyWcsprm_set_ssyssrc( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (is_null(self->x.ssyssrc)) { + return -1; + } + + return set_string("ssyssrc", value, self->x.ssyssrc, 72); +} + +static PyObject* +PyWcsprm_get_tab( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + PyObject* result; + PyObject* subresult; + int i, ntab; + + ntab = self->x.ntab; + + result = PyList_New(ntab); + if (result == NULL) { + return NULL; + } + + for (i = 0; i < ntab; ++i) { + subresult = (PyObject *)PyTabprm_cnew((PyObject *)self, &(self->x.tab[i])); + if (subresult == NULL) { + Py_DECREF(result); + return NULL; + } + + if (PyList_SetItem(result, i, subresult) == -1) { + Py_DECREF(subresult); + Py_DECREF(result); + return NULL; + } + } + + return result; +} + +static PyObject* +PyWcsprm_get_theta0( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("theta0", self->x.cel.theta0); +} + +static int +PyWcsprm_set_theta0( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + note_change(self); + + if (value == NULL) { + self->x.cel.theta0 = (double)NPY_NAN; + return 0; + } + + return set_double("theta0", value, &self->x.cel.theta0); +} + +static PyObject* +PyWcsprm_get_velangl( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("velangl", self->x.velangl); +} + +static int +PyWcsprm_set_velangl( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.velangl = (double)NPY_NAN; + return 0; + } + + return set_double("velangl", value, &self->x.velangl); +} + +static PyObject* +PyWcsprm_get_velosys( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("velosys", self->x.velosys); +} + +static int +PyWcsprm_set_velosys( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.velosys = (double)NPY_NAN; + return 0; + } + + return set_double("velosys", value, &self->x.velosys); +} + +static PyObject* +PyWcsprm_get_velref( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_int("velref", self->x.velref); +} + +static int +PyWcsprm_set_velref( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.velref = 0; + return 0; + } + + return set_int("velref", value, &self->x.velref); +} + +/* static PyObject* */ +/* PyWcsprm_get_wtb( */ +/* PyWcsprm* self, */ +/* /\*@unused@*\/ void* closure) { */ + +/* PyObject* result; */ +/* PyObject* subresult; */ +/* int i, nwtb; */ + +/* nwtb = self->x.nwtb; */ + +/* result = PyList_New(nwtb); */ +/* if (result == NULL) { */ +/* return NULL; */ +/* } */ + +/* for (i = 0; i < nwtb; ++i) { */ +/* subresult = (PyObject *)PyWtbarr_cnew((PyObject *)self, &(self->x.wtb[i])); */ +/* if (subresult == NULL) { */ +/* Py_DECREF(result); */ +/* return NULL; */ +/* } */ + +/* if (PyList_SetItem(result, i, subresult) == -1) { */ +/* Py_DECREF(subresult); */ +/* Py_DECREF(result); */ +/* return NULL; */ +/* } */ +/* } */ + +/* return result; */ +/* } */ + +static PyObject* +PyWcsprm_get_zsource( + PyWcsprm* self, + /*@unused@*/ void* closure) { + + return get_double("zsource", self->x.zsource); +} + +static int +PyWcsprm_set_zsource( + PyWcsprm* self, + PyObject* value, + /*@unused@*/ void* closure) { + + if (value == NULL) { /* deletion */ + self->x.zsource = (double)NPY_NAN; + return 0; + } + + return set_double("zsource", value, &self->x.zsource); +} + +/*************************************************************************** + * PyWcsprm definition structures + */ + +static PyGetSetDef PyWcsprm_getset[] = { + {"alt", (getter)PyWcsprm_get_alt, (setter)PyWcsprm_set_alt, (char *)doc_alt}, + {"axis_types", (getter)PyWcsprm_get_axis_types, NULL, (char *)doc_axis_types}, + {"bepoch", (getter)PyWcsprm_get_bepoch, (setter)PyWcsprm_set_bepoch, (char *)doc_bepoch}, + {"cd", (getter)PyWcsprm_get_cd, (setter)PyWcsprm_set_cd, (char *)doc_cd}, + {"cdelt", (getter)PyWcsprm_get_cdelt, (setter)PyWcsprm_set_cdelt, (char *)doc_cdelt}, + {"cel_offset", (getter)PyWcsprm_get_cel_offset, (setter)PyWcsprm_set_cel_offset, (char *)doc_cel_offset}, + {"cname", (getter)PyWcsprm_get_cname, (setter)PyWcsprm_set_cname, (char *)doc_cname}, + {"colax", (getter)PyWcsprm_get_colax, (setter)PyWcsprm_set_colax, (char *)doc_colax}, + {"colnum", (getter)PyWcsprm_get_colnum, (setter)PyWcsprm_set_colnum, (char *)doc_colnum}, + {"crder", (getter)PyWcsprm_get_crder, (setter)PyWcsprm_set_crder, (char *)doc_crder}, + {"crota", (getter)PyWcsprm_get_crota, (setter)PyWcsprm_set_crota, (char *)doc_crota}, + {"crpix", (getter)PyWcsprm_get_crpix, (setter)PyWcsprm_set_crpix, (char *)doc_crpix}, + {"crval", (getter)PyWcsprm_get_crval, (setter)PyWcsprm_set_crval, (char *)doc_crval}, + {"csyer", (getter)PyWcsprm_get_csyer, (setter)PyWcsprm_set_csyer, (char *)doc_csyer}, + {"ctype", (getter)PyWcsprm_get_ctype, (setter)PyWcsprm_set_ctype, (char *)doc_ctype}, + {"cubeface", (getter)PyWcsprm_get_cubeface, (setter)PyWcsprm_set_cubeface, (char *)doc_cubeface}, + {"cunit", (getter)PyWcsprm_get_cunit, (setter)PyWcsprm_set_cunit, (char *)doc_cunit}, + {"czphs", (getter)PyWcsprm_get_czphs, (setter)PyWcsprm_set_czphs, (char *)doc_czphs}, + {"cperi", (getter)PyWcsprm_get_cperi, (setter)PyWcsprm_set_cperi, (char *)doc_cperi}, + {"dateavg", (getter)PyWcsprm_get_dateavg, (setter)PyWcsprm_set_dateavg, (char *)doc_dateavg}, + {"datebeg", (getter)PyWcsprm_get_datebeg, (setter)PyWcsprm_set_datebeg, (char *)doc_datebeg}, + {"dateend", (getter)PyWcsprm_get_dateend, (setter)PyWcsprm_set_dateend, (char *)doc_dateend}, + {"dateobs", (getter)PyWcsprm_get_dateobs, (setter)PyWcsprm_set_dateobs, (char *)doc_dateobs}, + {"dateref", (getter)PyWcsprm_get_dateref, (setter)PyWcsprm_set_dateref, (char *)doc_dateref}, + {"equinox", (getter)PyWcsprm_get_equinox, (setter)PyWcsprm_set_equinox, (char *)doc_equinox}, + {"imgpix_matrix", (getter)PyWcsprm_get_imgpix_matrix, NULL, (char *)doc_imgpix_matrix}, + {"jepoch", (getter)PyWcsprm_get_jepoch, (setter)PyWcsprm_set_jepoch, (char *)doc_jepoch}, + {"lat", (getter)PyWcsprm_get_lat, NULL, (char *)doc_lat}, + {"latpole", (getter)PyWcsprm_get_latpole, (setter)PyWcsprm_set_latpole, (char *)doc_latpole}, + {"lattyp", (getter)PyWcsprm_get_lattyp, NULL, (char *)doc_lattyp}, + {"lng", (getter)PyWcsprm_get_lng, NULL, (char *)doc_lng}, + {"lngtyp", (getter)PyWcsprm_get_lngtyp, NULL, (char *)doc_lngtyp}, + {"lonpole", (getter)PyWcsprm_get_lonpole, (setter)PyWcsprm_set_lonpole, (char *)doc_lonpole}, + {"mjdavg", (getter)PyWcsprm_get_mjdavg, (setter)PyWcsprm_set_mjdavg, (char *)doc_mjdavg}, + {"mjdbeg", (getter)PyWcsprm_get_mjdbeg, (setter)PyWcsprm_set_mjdbeg, (char *)doc_mjdbeg}, + {"mjdend", (getter)PyWcsprm_get_mjdend, (setter)PyWcsprm_set_mjdend, (char *)doc_mjdend}, + {"mjdobs", (getter)PyWcsprm_get_mjdobs, (setter)PyWcsprm_set_mjdobs, (char *)doc_mjdobs}, + {"mjdref", (getter)PyWcsprm_get_mjdref, (setter)PyWcsprm_set_mjdref, (char *)doc_mjdref}, + {"name", (getter)PyWcsprm_get_name, (setter)PyWcsprm_set_name, (char *)doc_name}, + {"naxis", (getter)PyWcsprm_get_naxis, NULL, (char *)doc_naxis}, + {"obsgeo", (getter)PyWcsprm_get_obsgeo, (setter)PyWcsprm_set_obsgeo, (char *)doc_obsgeo}, + {"obsorbit", (getter)PyWcsprm_get_obsorbit, (setter)PyWcsprm_set_obsorbit, (char *)doc_obsorbit}, + {"pc", (getter)PyWcsprm_get_pc, (setter)PyWcsprm_set_pc, (char *)doc_pc}, + {"phi0", (getter)PyWcsprm_get_phi0, (setter)PyWcsprm_set_phi0, (char *)doc_phi0}, + {"piximg_matrix", (getter)PyWcsprm_get_piximg_matrix, NULL, (char *)doc_piximg_matrix}, + {"plephem", (getter)PyWcsprm_get_plephem, (setter)PyWcsprm_set_plephem, (char *) doc_plephem}, + {"radesys", (getter)PyWcsprm_get_radesys, (setter)PyWcsprm_set_radesys, (char *)doc_radesys}, + {"restfrq", (getter)PyWcsprm_get_restfrq, (setter)PyWcsprm_set_restfrq, (char *)doc_restfrq}, + {"restwav", (getter)PyWcsprm_get_restwav, (setter)PyWcsprm_set_restwav, (char *)doc_restwav}, + {"spec", (getter)PyWcsprm_get_spec, NULL, (char *)doc_spec}, + {"specsys", (getter)PyWcsprm_get_specsys, (setter)PyWcsprm_set_specsys, (char *)doc_specsys}, + {"ssysobs", (getter)PyWcsprm_get_ssysobs, (setter)PyWcsprm_set_ssysobs, (char *)doc_ssysobs}, + {"ssyssrc", (getter)PyWcsprm_get_ssyssrc, (setter)PyWcsprm_set_ssyssrc, (char *)doc_ssyssrc}, + {"tab", (getter)PyWcsprm_get_tab, NULL, (char *)doc_tab}, + {"theta0", (getter)PyWcsprm_get_theta0, (setter)PyWcsprm_set_theta0, (char *)doc_theta0}, + {"timesys", (getter)PyWcsprm_get_timesys, (setter)PyWcsprm_set_timesys, (char *) doc_timesys}, + {"trefpos", (getter)PyWcsprm_get_trefpos, (setter)PyWcsprm_set_trefpos, (char *) doc_trefpos}, + {"trefdir", (getter)PyWcsprm_get_trefdir, (setter)PyWcsprm_set_trefdir, (char *) doc_trefdir}, + {"tstart", (getter)PyWcsprm_get_tstart, (setter)PyWcsprm_set_tstart, (char *) doc_tstart}, + {"tstop", (getter)PyWcsprm_get_tstop, (setter)PyWcsprm_set_tstop, (char *) doc_tstop}, + {"telapse", (getter)PyWcsprm_get_telapse, (setter)PyWcsprm_set_telapse, (char *) doc_telapse}, + {"timeoffs", (getter)PyWcsprm_get_timeoffs, (setter)PyWcsprm_set_timeoffs, (char *) doc_timeoffs}, + {"timsyer", (getter)PyWcsprm_get_timsyer, (setter)PyWcsprm_set_timsyer, (char *) doc_timsyer}, + {"timrder", (getter)PyWcsprm_get_timrder, (setter)PyWcsprm_set_timrder, (char *) doc_timrder}, + {"timedel", (getter)PyWcsprm_get_timedel, (setter)PyWcsprm_set_timedel, (char *) doc_timedel}, + {"timepixr", (getter)PyWcsprm_get_timepixr, (setter)PyWcsprm_set_timepixr, (char *) doc_timepixr}, + {"timeunit", (getter)PyWcsprm_get_timeunit, (setter)PyWcsprm_set_timeunit, (char *) doc_timeunit}, + {"velangl", (getter)PyWcsprm_get_velangl, (setter)PyWcsprm_set_velangl, (char *)doc_velangl}, + {"velosys", (getter)PyWcsprm_get_velosys, (setter)PyWcsprm_set_velosys, (char *)doc_velosys}, + {"velref", (getter)PyWcsprm_get_velref, (setter)PyWcsprm_set_velref, (char *)doc_velref}, + {"xposure", (getter)PyWcsprm_get_xposure, (setter)PyWcsprm_set_xposure, (char *)doc_xposure}, + /* {"wtb", (getter)PyWcsprm_get_wtb, NULL, (char *)doc_tab}, */ + {"zsource", (getter)PyWcsprm_get_zsource, (setter)PyWcsprm_set_zsource, (char *)doc_zsource}, + {NULL} +}; + +static PyMethodDef PyWcsprm_methods[] = { + {"bounds_check", (PyCFunction)PyWcsprm_bounds_check, METH_VARARGS|METH_KEYWORDS, doc_bounds_check}, + {"cdfix", (PyCFunction)PyWcsprm_cdfix, METH_NOARGS, doc_cdfix}, + {"celfix", (PyCFunction)PyWcsprm_celfix, METH_NOARGS, doc_celfix}, + {"compare", (PyCFunction)PyWcsprm_compare, METH_VARARGS|METH_KEYWORDS, doc_compare}, + {"__copy__", (PyCFunction)PyWcsprm_copy, METH_NOARGS, doc_copy}, + {"cylfix", (PyCFunction)PyWcsprm_cylfix, METH_VARARGS|METH_KEYWORDS, doc_cylfix}, + {"datfix", (PyCFunction)PyWcsprm_datfix, METH_NOARGS, doc_datfix}, + {"__deepcopy__", (PyCFunction)PyWcsprm_copy, METH_O, doc_copy}, + {"fix", (PyCFunction)PyWcsprm_fix, METH_VARARGS|METH_KEYWORDS, doc_fix}, + {"get_cdelt", (PyCFunction)PyWcsprm_get_cdelt_func, METH_NOARGS, doc_get_cdelt}, + {"get_pc", (PyCFunction)PyWcsprm_get_pc_func, METH_NOARGS, doc_get_pc}, + {"get_ps", (PyCFunction)PyWcsprm_get_ps, METH_NOARGS, doc_get_ps}, + {"get_pv", (PyCFunction)PyWcsprm_get_pv, METH_NOARGS, doc_get_pv}, + {"has_cd", (PyCFunction)PyWcsprm_has_cdi_ja, METH_NOARGS, doc_has_cd}, + {"has_cdi_ja", (PyCFunction)PyWcsprm_has_cdi_ja, METH_NOARGS, doc_has_cdi_ja}, + {"has_crota", (PyCFunction)PyWcsprm_has_crotaia, METH_NOARGS, doc_has_crota}, + {"has_crotaia", (PyCFunction)PyWcsprm_has_crotaia, METH_NOARGS, doc_has_crotaia}, + {"has_pc", (PyCFunction)PyWcsprm_has_pci_ja, METH_NOARGS, doc_has_pc}, + {"has_pci_ja", (PyCFunction)PyWcsprm_has_pci_ja, METH_NOARGS, doc_has_pci_ja}, + {"is_unity", (PyCFunction)PyWcsprm_is_unity, METH_NOARGS, doc_is_unity}, + {"mix", (PyCFunction)PyWcsprm_mix, METH_VARARGS|METH_KEYWORDS, doc_mix}, + {"p2s", (PyCFunction)PyWcsprm_p2s, METH_VARARGS|METH_KEYWORDS, doc_p2s}, + {"print_contents", (PyCFunction)PyWcsprm_print_contents, METH_NOARGS, doc_print_contents}, + {"s2p", (PyCFunction)PyWcsprm_s2p, METH_VARARGS|METH_KEYWORDS, doc_s2p}, + {"set", (PyCFunction)PyWcsprm_set, METH_NOARGS, doc_set}, + {"set_ps", (PyCFunction)PyWcsprm_set_ps, METH_O, doc_set_ps}, + {"set_pv", (PyCFunction)PyWcsprm_set_pv, METH_O, doc_set_pv}, + {"spcfix", (PyCFunction)PyWcsprm_spcfix, METH_NOARGS, doc_spcfix}, + {"sptr", (PyCFunction)PyWcsprm_sptr, METH_VARARGS|METH_KEYWORDS, doc_sptr}, + {"sub", (PyCFunction)PyWcsprm_sub, METH_VARARGS|METH_KEYWORDS, doc_sub}, + {"to_header", (PyCFunction)PyWcsprm_to_header, METH_VARARGS|METH_KEYWORDS, doc_to_header}, + {"unitfix", (PyCFunction)PyWcsprm_unitfix, METH_VARARGS|METH_KEYWORDS, doc_unitfix}, + {NULL} +}; + +PyTypeObject PyWcsprmType = { + PyVarObject_HEAD_INIT(NULL, 0) + "astropy.wcs.Wcsprm", /*tp_name*/ + sizeof(PyWcsprm), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)PyWcsprm_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)PyWcsprm___str__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + (reprfunc)PyWcsprm___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + doc_Wcsprm, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + PyWcsprm_richcompare, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + PyWcsprm_methods, /* tp_methods */ + 0, /* tp_members */ + PyWcsprm_getset, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)PyWcsprm_init, /* tp_init */ + 0, /* tp_alloc */ + PyWcsprm_new, /* tp_new */ +}; + +#define CONSTANT(a) PyModule_AddIntConstant(m, #a, a) + +#define XSTRINGIFY(s) STRINGIFY(s) +#define STRINGIFY(s) #s + +int +_setup_wcsprm_type( + PyObject* m) { + + if (PyType_Ready(&PyWcsprmType) < 0) { + return -1; + } + + Py_INCREF(&PyWcsprmType); + + wcsprintf_set(NULL); + wcserr_enable(1); + + return ( + PyModule_AddObject(m, "Wcsprm", (PyObject *)&PyWcsprmType) || + CONSTANT(WCSSUB_LONGITUDE) || + CONSTANT(WCSSUB_LATITUDE) || + CONSTANT(WCSSUB_CUBEFACE) || + CONSTANT(WCSSUB_SPECTRAL) || + CONSTANT(WCSSUB_STOKES) || + CONSTANT(WCSSUB_CELESTIAL) || + CONSTANT(WCSHDR_IMGHEAD) || + CONSTANT(WCSHDR_BIMGARR) || + CONSTANT(WCSHDR_PIXLIST) || + CONSTANT(WCSHDR_none) || + CONSTANT(WCSHDR_all) || + CONSTANT(WCSHDR_reject) || +#ifdef WCSHDR_strict + CONSTANT(WCSHDR_strict) || +#endif + CONSTANT(WCSHDR_CROTAia) || + CONSTANT(WCSHDR_EPOCHa) || + CONSTANT(WCSHDR_VELREFa) || + CONSTANT(WCSHDR_CD00i00j) || + CONSTANT(WCSHDR_PC00i00j) || + CONSTANT(WCSHDR_PROJPn) || +#ifdef WCSHDR_CD0i_0ja + CONSTANT(WCSHDR_CD0i_0ja) || +#endif +#ifdef WCSHDR_PC0i_0ja + CONSTANT(WCSHDR_PC0i_0ja) || +#endif +#ifdef WCSHDR_PV0i_0ma + CONSTANT(WCSHDR_PV0i_0ma) || +#endif +#ifdef WCSHDR_PS0i_0ma + CONSTANT(WCSHDR_PS0i_0ma) || +#endif + CONSTANT(WCSHDR_RADECSYS) || + CONSTANT(WCSHDR_VSOURCE) || + CONSTANT(WCSHDR_DOBSn) || + CONSTANT(WCSHDR_LONGKEY) || + CONSTANT(WCSHDR_CNAMn) || + CONSTANT(WCSHDR_AUXIMG) || + CONSTANT(WCSHDR_ALLIMG) || + CONSTANT(WCSHDO_none) || + CONSTANT(WCSHDO_all) || + CONSTANT(WCSHDO_safe) || + CONSTANT(WCSHDO_DOBSn) || + CONSTANT(WCSHDO_TPCn_ka) || + CONSTANT(WCSHDO_PVn_ma) || + CONSTANT(WCSHDO_CRPXna) || + CONSTANT(WCSHDO_CNAMna) || + CONSTANT(WCSHDO_WCSNna) || + CONSTANT(WCSHDO_P12) || + CONSTANT(WCSHDO_P13) || + CONSTANT(WCSHDO_P14) || + CONSTANT(WCSHDO_P15) || + CONSTANT(WCSHDO_P16) || + CONSTANT(WCSHDO_P17) || + CONSTANT(WCSHDO_EFMT) || + CONSTANT(WCSCOMPARE_ANCILLARY) || + CONSTANT(WCSCOMPARE_TILING) || + CONSTANT(WCSCOMPARE_CRPIX)); +} diff --git a/testbed/astropy__astropy/astropy/wcs/tests/__init__.py b/testbed/astropy__astropy/astropy/wcs/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9dce85d06f83264a6e502be0906d86bd976e1677 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/__init__.py @@ -0,0 +1 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/2wcses.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/2wcses.hdr new file mode 100644 index 0000000000000000000000000000000000000000..8e4a11b97ba57de586104122f730a04d4ad9d478 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/2wcses.hdr @@ -0,0 +1 @@ +SIMPLE = T / conforms to FITS standard BITPIX = -32 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 2048 NAXIS2 = 4096 EXTEND = T RUN = 418552 / Run number OBSERVAT= 'LAPALMA ' / Name of observatory (IRAF style) OBSERVER= 'Drew ' / Name of principal investigator OBJECT = 'intphas_4970 Ha' / Title of observation LATITUDE= 28.761929 / Telescope latitude (degrees), +28:45:42.9 LONGITUD= -17.877577 / Telescope longitude (degrees), -17:52:39.3 HEIGHT = 2348 / [m] Height above sea level. SLATEL = 'LPO2.5 ' / Telescope name known to SLALIB TELESCOP= 'INT ' / 2.5m Isaac Newton Telescope MJD-OBS = 53240.9816151 / Modified Julian Date of midtime of observation JD = 2453241.4816151 / Julian Date of midtime of observation PLATESCA= 6.856013 / [d/m] Platescale ( 24.68arcsec/mm) TELFOCUS= 0.043969 / Telescope focus (metres) AIRMASS = 1.048846 / Effective mean airmass DATE-OBS= '2004-08-23T23:32:32.4' / UTC date start of observation UTSTART = '23:32:32.4' / UTC of start of observation TEMPTUBE= 10.15365 / Truss Temperature (degrees Celsius) INSTRUME= 'WFC ' / INT wide-field camera is in use. WFFPOS = 1 / Position-number of deployed filter WFFBAND = 'Halpha ' / Waveband of filter WFFID = '197 ' / Unique identifier of filter SECPPIX = 0.333 / Arcseconds per pixel DETECTOR= 'WFC ' / Formal name of camera CCDSPEED= 'FAST ' / Readout speed CCDXBIN = 1 / Binning factor in x axis CCDYBIN = 1 / Binning factor in y axis CCDSUM = '1 1 ' / Binning factors (IRAF style) CCDTEMP = 156.114 / [K] Cryostat temperature NWINDOWS= 0 / Number of readout windows CCDNAME = 'A5506-4 ' / Name of detector chip. CCDXPIXE= 1.35E-05 / [m] Size of pixels in x. CCDYPIXE= 1.35E-05 / [m] Size of pixels in y. AMPNAME = 'LH ' / Name of output amplifier. GAIN = 2.8 / Nominal Photo-electrons per ADU. READNOIS= 6.4 / Nominal Readout noise in electrons. NUMBRMS = 257 / Number of standards used STDCRMS = 0.067 / Astrometric fit error (arcsec) PERCORR = 0.0 / Sky calibration correction (mags) EXTINCT = 0.09 / Extinction coefficient (mags) RADESYSA= 'ICRS ' EQUINOX = 2000.0 CTYPE1 = 'RA---ZPN' / Algorithm type for axis 1 CTYPE2 = 'DEC--ZPN' / Algorithm type for axis 2 CRPIX1 = -337.20001 / [pixel] Reference pixel along axis 1 CRPIX2 = 3040.5 / [pixel] Reference pixel along axis 2 CRVAL1 = 292.20508 / [deg] Right ascension at the reference pixel CRVAL2 = 18.582556 / [deg] Declination at the reference pixel CRUNIT1 = 'deg ' / Unit of right ascension coordinates CRUNIT2 = 'deg ' / Unit of declination coordinates CD1_1 = -1.3007094E-06 / Transformation matrix element CD1_2 = -9.2396054E-05 / Transformation matrix element CD2_1 = -9.2389091E-05 / Transformation matrix element CD2_2 = 1.3203634E-06 / Transformation matrix element PV2_1 = 1.0 / Coefficient for r term PV2_2 = 0.0 / Coefficient for r**2 term PV2_3 = 220.0 / Coefficient for r**3 term ORIGZPT = 21.53 / Original nightly ZP; uncorrected for extinctionMAGZPT = 21.40896253966641 / Re-calibrated DR2 zeropoint EXPTIME = 120.02 / [sec] Exposure time assumed by the pipeline CHECKSUM= '7RREBPRB9PRBAPRB' / HDU checksum updated 2014-02-06T12:02:07 DATASUM = '1660673036' / data unit checksum updated 2014-02-06T12:02:07 HISTORY 20041004 14:45:42 HISTORY $Id: cir_create_file.c,v 1.10 2004/09/03 10:48:45 jim Exp $ HISTORY 20041004 14:45:43 HISTORY $Id: cir_ccdproc.c,v 1.9 2004/09/07 14:18:51 jim Exp $ HISTORY 20041004 22:52:54 HISTORY $Id: cir_imcore.c,v 1.11 2004/09/07 14:18:52 jim Exp $ HISTORY 20041004 22:52:56 HISTORY $Id: cir_platesol.c,v 1.9 2004/09/07 14:18:54 jim Exp $ HISTORY 20041005 16:05:06 HISTORY $Id: cir_imcore.c,v 1.11 2004/09/07 14:18:52 jim Exp $ HISTORY 20041006 07:31:07 HISTORY $Id: cir_platesol.c,v 1.9 2004/09/07 14:18:54 jim Exp $ HISTORY 20131220 22:36:15 HISTORY Headers updated by Geert Barentsen as part of DR2. HISTORY This included changes to MAGZPT, EXPTIME and the WCS. COMMENT Calibration info COMMENT ================ COMMENT The MAGZPT keyword in this header has been corrected for atmospheric COMMENT extinction and gain (PERCORR) and has been re-calibrated as part of DR2.COMMENT COMMENT Hence to obtain calibrated magnitudes relative to Vega, use: COMMENT mag(Vega) = MAGZPT - 2.5*log(pixel value / EXPTIME) END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/3d_cd.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/3d_cd.hdr new file mode 100644 index 0000000000000000000000000000000000000000..be4ce2f1f88ed07d5c4fe57a57358b2e1d80a527 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/3d_cd.hdr @@ -0,0 +1,16 @@ +CD1_2 = -3.72E-05 +CD1_3 = 0 +CD1_1 = -4.12E-05 +CUNIT3 = 'nm ' +CUNIT2 = 'deg ' +CTYPE1 = 'RA---TAN' +NAXIS = 3 +CTYPE3 = 'AWAV ' +CD2_1 = -3.72E-05 +CTYPE2 = 'DEC--TAN' +CD2_3 = 0 +CD2_2 = 4.12E-05 +CUNIT1 = 'deg ' +CD3_1 = 0 +CD3_2 = 0 +CD3_3 = 0.2 \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/defunct_keywords.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/defunct_keywords.hdr new file mode 100644 index 0000000000000000000000000000000000000000..61ba12ba487089549947e46ea16fa86d262bb1e1 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/defunct_keywords.hdr @@ -0,0 +1 @@ +SIMPLE = T / Uncompressed file's conforms to FITS BITPIX = 16 / data type of original image NAXIS = 2 / dimension of original image NAXIS1 = 720 / length of original image axis NAXIS2 = 720 / length of original image axis PSLIB_V = '34286 ' MODULE_V= '34287:34288' PHOT_V = '34286:34322' STATS_V = '34286 ' STACK_V = '34286 ' HISTORY ppStack source: 60eb6cdc-a59c-4636-a4e0-dba66a9721fd NINPUTS = 18 / Number of input images STK_TYPE= 'DEEP_STACK' / type of stack STK_ID = '1237984 ' / type of stack SKYCELL = 'skycell.0680.071' / type of stack TESS_ID = 'RINGS.V3' / type of stack AIRM_SLP= 0. / airmass slope PSCAMERA= 'GPC1 ' / Camera name PSFORMAT= 'SKYCELL ' / Camera format IMAGEID = 1237984 / Image identifier SOURCEID= 35 / Source identifier CTYPE1 = 'RA---TAN' CTYPE2 = 'DEC--TAN' CRVAL1 = 205.063293456991 CRVAL2 = -29.9999999999985 CRPIX1 = 17900.5 CRPIX2 = -13877.5 CDELT1 = 6.94444461259981E-05 CDELT2 = 6.94444461259981E-05 PC001001= -1. PC001002= 0. PC002001= 0. PC002002= 1. RA_DEG = 206.45559692 / Right Ascension of stamp center DEC_DEG = -29.00419807 / Declination of stamp center BSCALE = 1.073792648315E+01 / Scaling: TRUE = BZERO + BSCALE * DISK BZERO = 3.501794623489E+05 / Scaling: TRUE = BZERO + BSCALE * DISK BLANK = 32767 / Value for undefined pixels ZBLANK = 32767 / Value for undefined pixels END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/dist.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/dist.fits new file mode 100644 index 0000000000000000000000000000000000000000..457c63fc6bf7adb6f1219afd4df2c34aa540b1be Binary files /dev/null and b/testbed/astropy__astropy/astropy/wcs/tests/data/dist.fits differ diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/header_newlines.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/header_newlines.fits new file mode 100644 index 0000000000000000000000000000000000000000..f024c9b954e5cf714ac05be2e3b06a1481beaa23 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/header_newlines.fits @@ -0,0 +1 @@ +SIMPLE = T / Fits standard BITPIX = -64 / FOUR-BYTE SINGLE PRECISION FLOATING POINT NAXIS = 2 / STANDARD FITS FORMAT NAXIS1 = 1 / STANDARD FITS FORMAT NAXIS2 = 1 / STANDARD FITS FORMAT ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file DATE = '2011-08-01T15:14:04' / File creation date (YYYY-MM-DDThh:mm:ss UT) / PTF DMASK BIT DEFINITIONS BIT00 = 0 / AIRCRAFT/SATELLITE TRACK BIT01 = 1 / OBJECT (detected by SExtractor) BIT02 = 2 / HIGH DARK-CURRENT BIT03 = 3 / RESERVED FOR FUTURE USE BIT04 = 4 / NOISY BIT05 = 5 / GHOST BIT06 = 6 / CCD BLEED BIT07 = 7 / RAD HIT BIT08 = 8 / SATURATED BIT09 = 9 / DEAD/BAD BIT10 = 10 / NAN (not a number) BIT11 = 11 / DIRTY (10-sigma below coarse local median) BIT12 = 12 / HALO BIT13 = 13 / RESERVED FOR FUTURE USE BIT14 = 14 / RESERVED FOR FUTURE USE BIT15 = 15 / RESERVED FOR FUTURE USE / DATA FLOW PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pixel-mask pathname PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Pixel-mask filename UDMPROC = 'updatemask' / Update bit in dmask UDMVERSN= 1. / Version of updatemask program UDMOP = 0 / Operation type UDMMBT = 4 / Mask bit template UDMIFIL = 'bpm_2009060s_c07.v1.fits' / Program updatemask input file UDMOFIL = 'bpm_2009060s_c07.v2.fits' / Program updatemask output file MCVERSN = 1. / Version of ptfMaskCombine program PTFPPROC= 'ptfPostProc' / Flags proc NaNs, CCD-bleeds and rad hits PPRVERSN= 3. / Version of ptfPostProc program / COPY OF IMAGE HEADER BELOW ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file TELESCOP= 'P48 ' / Name of telescope INSTRUME= 'PTF/MOSAIC' / Instrument name OBSERVER= 'KulkarniPTF' / Observer name and project CCDID = '7 ' / CCD number (0..11) DATE-OBS= '2009-06-25T08:41:23.970' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS DATE = '2011-07-30T15:04:59' / File creation date (YYYY-MM-DDThh:mm:ss UT) REFERENC= 'http://www.astro.caltech.edu/ptf' / URL of PTF website / PROPOSAL INFORMATION PTFPRPI = 'Kulkarni' / PTF Project PI PTFPID = '20000 ' / Project type: 00000-49999 OBJECT = 'PTF_survey' / Fields object PTFFIELD= '2899 ' / PTF unique field ID PTFFLAG = '1 ' / 1 = PTF; 0 = non-PTF category / TIME AND EXPOSURE INFORMATION FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '2 ' / Filter changer slot position EXPTIME = 60. / [s] Requested exposure time AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2009-06-25T08:41:23.970' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.OBSJD = 2455007.86207 / [day] Julian day corresponds to UTC-OBS OBSMJD = 55007.36207 / MJD corresponds to UTC-OBS (day) OBSLST = '19:08:26.70' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '-3:09:09.78' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2455007.86457 / [day] Heliocentric Julian Day OBSTYPE = 'object ' / Image type (dark,science,bias,focus) IMGTYP = 'object ' / Image type (dark,science,bias,focus) / MOON AND SUN MOONRA = 131.676395 / [deg] Moon J2000.0 R.A. MOONDEC = 16.207046 / [deg] Moon J2000.0 Dec. MOONILLF= 0.095389 / [frac] Moon illuminated fraction MOONPHAS= 144.0201 / [deg] Moon phase angle MOONESB = -0. / Moon excess in sky brightness V-band MOONALT = -35.16959 / [deg] Moon altitude SUNAZ = 13.90467 / [deg] Sun azimuth SUNALT = -31.96011 / [deg] Sun altitude / PHOTOMETRY BUNIT = 'DN ' / Data number (analog-to-digital units or ADU) PHTCALEX= 1 / Was phot.-cal. module executed? PHTCALFL= 0 / Flag for image is photometric (0=N, 1=Y) PCALRMSE= 0.030059 / RMSE from (zeropoint, extinction) data fit IMAGEZPT= 22.43948 / Image magnitude zeropoint IZPORIG = 'CALTRANS' / Photometric-calibration origin ZPRULE = 'COMPUTE ' / Photometric-calibration method MAGZPT = 22.73683 / Magnitude zeropoint at airmass=1 EXTINCT = 0.17995 / Extinction APSFILT = 'r ' / SDSS filter used in abs phot cal APSCOL = 'r-i ' / SDSS color used in abs phot cal APRMS = 0.0554857 / RMS in mag of final abs phot cal APBSRMS = 0.03911367 / RMS in mag of final abs phot cal for bright staAPNSTDI1= 69501 / Number of standard stars in first iteration APNSTDIF= 64858 / Number of standard stars in final iteration APCHI2 = 325618.88012443 / Chi2 of final abs phot cal APDOF = 64858. / Dof of chi2 of final abs phot cal APMEDJD = 2455007.84500722 / Median JD used in abs phot cal APPN01 = 'ZeroPoint' / Name of parameter abs phot cal 01 APPAR01 = 22.81878918 / Value of parameter abs phot cal 01 APPARE01= 0.00198923 / Error of parameter abs phot cal 01 APPN02 = 'ColorTerm' / Name of parameter abs phot cal 02 APPAR02 = 0.20481246 / Value of parameter abs phot cal 02 APPARE02= 0.00278076 / Error of parameter abs phot cal 02 APPN03 = 'AirMassTerm' / Name of parameter abs phot cal 03 APPAR03 = -0.12104427 / Value of parameter abs phot cal 03 APPARE03= 0.0011621 / Error of parameter abs phot cal 03 APPN04 = 'AirMassColorTerm' / Name of parameter abs phot cal 04 APPAR04 = 0.00904321 / Value of parameter abs phot cal 04 APPARE04= 0.00176968 / Error of parameter abs phot cal 04 APPN05 = 'TimeTerm' / Name of parameter abs phot cal 05 APPAR05 = 0.03012546 / Value of parameter abs phot cal 05 APPARE05= 0.00459951 / Error of parameter abs phot cal 05 APPN06 = 'Time2Term' / Name of parameter abs phot cal 06 APPAR06 = 1.27460327 / Value of parameter abs phot cal 06 APPARE06= 0.07646497 / Error of parameter abs phot cal 06 APPN07 = 'XTerm ' / Name of parameter abs phot cal 07 APPAR07 = 0.00768843 / Value of parameter abs phot cal 07 APPARE07= 0.00083226 / Error of parameter abs phot cal 07 APPN08 = 'YTerm ' / Name of parameter abs phot cal 08 APPAR08 = 0.06680527 / Value of parameter abs phot cal 08 APPARE08= 0.00203667 / Error of parameter abs phot cal 08 APPN09 = 'Y2Term ' / Name of parameter abs phot cal 09 APPAR09 = 0.31486016 / Value of parameter abs phot cal 09 APPARE09= 0.00318862 / Error of parameter abs phot cal 09 APPN10 = 'Y3Term ' / Name of parameter abs phot cal 10 APPAR10 = 0.69934253 / Value of parameter abs phot cal 10 APPARE10= 0.01257477 / Error of parameter abs phot cal 10 APPN11 = 'XYTerm ' / Name of parameter abs phot cal 11 APPAR11 = -0.04590337 / Value of parameter abs phot cal 11 APPARE11= 0.00286729 / Error of parameter abs phot cal 11 / ASTROMETRY CRVAL1 = 333.443801401309 / [deg] RA of reference point CRVAL2 = 3.08905544069643 / [deg] DEC of reference point CRPIX1 = 1175.019 / [pix] Image reference point CRPIX2 = 945.8826 / [pix] Image reference point CTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions CTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions CUNIT1 = 'deg ' / Image axis-1 celestial-coordinate units CUNIT2 = 'deg ' / Image axis-2 celestial-coordinate units CRTYPE1 = 'deg ' / Data units of CRVAL1 CRTYPE2 = 'deg ' / Data units of CRVAL2 CD1_1 = 0.000281094342514378 / Transformation matrix CD1_2 = -5.00875320999652E-09 CD2_1 = -2.08930602680508E-07 CD2_2 = -0.000281284158795544 OBJRA = '22:17:08.571' / Requested field J2000.0 Ra. OBJDEC = '+03:22:30.00' / Requested field J2000.0 Dec. OBJRAD = 334.285714 / [deg] Requested field RA (J2000.0) OBJDECD = 3.375 / [deg] Requested field Dec (J2000.0) PIXSCALE= 1.01 / [arcsec/pix] Pixel scale WCSAXES = 2 EQUINOX = 2000. / [yr] Equatorial coordinates definition LONPOLE = 180. LATPOLE = 0. / IMAGE QUALITY SEEING = 2.04 / [pix] Seeing FWHM PEAKDIST= 0.396793397122491 / [pix] Mean dist brightest pixel-centroid pixel ELLIP = 0.063 / Mean image ellipticity A/B ELLIPPA = 48.65 / [deg] Mean image ellipticity PA FBIAS = 1060.884 / [DN] Floating bias of the image SATURVAL= 17000. / [DN] Saturation value of the CCD array FWHMSEX = 2.45 / [arcsec] SExtractor SEEING estimate MDSKYMAG= 20.53072 / [mag/s-arcsec^2] Median sky obsolete MSMAPCZP= 20.70926 / [mag/s-arcsec^2] Median sky abs. phot. cal. LIMITMAG= 20.92587 / [mag/s-arcsec^2] Limiting magnitude obsolete LMGAPCZP= 21.10442 / [mag/s-arcsec^2] Limiting mag. abs. phot. cal. MEDFWHM = 2.931446 / [arcsecond] Median FWHM MEDELONG= 1.132416 / [dimensionless] Median elongation STDELONG= 0.3298569 / [dimensionless] Std. dev. of elongation MEDTHETA= -42.28234 / [deg] Atan(median sin(theta)/median cos(theta))STDTHETA= 66.21399 / [deg] Atan(stddev sin(theta)/stddev cos(theta))MEDDLMAG= 33.85928 / [mag/s-arcsec^2] Median (MU_MAX-MAG_AUTO) STDDLMAG= 0.4367887 / [mag/s-arcsec^2] Stddev of (MU_MAX-MAG_AUTO) / OBSERVATORY AND TCS OCS_TIME= '2009-06-25T08:41:23.978' / UTC Date for OCS calc time-dep params OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode OBSLAT = 33.3574 / [deg] Telescope geodetic latitude in WGS84 OBSLON = 116.8599 / [deg] Telescope geodetic longitude in WGS84 OBSALT = 1703.2 / [m] Telescope geodetic altitude in WGS84 DEFOCUS = 0. / [mm] Focus position - nominal focus FOCUSPOS= 1.3851 / [mm] Exposures focusPos DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 23.7 / [arcsec/hr] Track speed RA rel to sidereal TRACKDEC= -11.2 / [arcsec/hr] Track speed Dec rel to sidereal AZIMUTH = 113.8682 / [deg] Telescope Azimuth ALTITUDE= 36.81047 / [deg] Telescope altitude AIRMASS = 1.666232 / Telescope airmass TELRA = 334.402 / [deg] Telescope ap equinox of date RA TELDEC = 3.4225 / [deg] Telescope ap equinox of date Dec TELHA = 312.7096 / [deg] Telescope ap equinox of date HA DOMEAZ = 112.8563 / [deg] Dome azimuth WINDSCAL= 10.466 / [deg] Wind screen altitude WINDDIR = 2.2 / [deg] Azimuth of wind direction WINDSPED= 14.6328 / Wind speed (km/hour) OUTTEMP = 20.94444 / [C] Outside temperature OUTRELHU= 0.09 / [frac] Outside relative humidity OUTDEWPT= -12.94444 / [C] Outside dew point / INSTRUMENT TELEMETRY PANID = '_p48s ' / PAN identification DHSID = '_p48s ' / DHS identification ROISTATE= 'ROI ' / ROI State (FULL | ROI) CCDSEC = '[1:2048,1:4096]' / CCD section CCDSIZE = '[1:2048,1:4096]' / CCD size DATASEC = '[1:2048,1:4096]' / Data section DETSEC = '[1:2048,1:4096]' / Detector section ROISEC = '[1:2048,1:4096]' / ROI section FPA = 'P48MOSAIC' / Focal plan array CCDNAME = 'W94C2 ' / Detector mfg serial number CHECKSUM= 'O3aBP1ZBO1aBO1YB' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = '395763289' / Data unit checksum updated 2010-03-15T13:06:37 DHEINF = 'SDSU, Gen-III' / Controller info DHEFIRM = '/usr/src/dsp/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / Camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / Astropci software version DETID = 'PTF/MOSAIC' / Detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / Source for header information DATAMIN = 0. / Minimum value for array ROISTATE= 'ROI ' / ROI State (FULL | ROI) LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 175.003 / [K] 0x0 servo temp sensor on CCD09 HSTEMP = 148.207 / [K] 0x1 heat spreader temp DHE0TEMP= 295.951 / [K] 0x2 detector head electronics temp, master DHE1TEMP= 298.162 / [K] 0x3 detector head electronics temp, slave DEWWTEMP= 284.71 / [K] 0x4 dewar wall temp HEADTEMP= 138.414 / [K] 0x5 cryo cooler cold head temp CCD5TEMP= 174.91 / [K] 0x6 temp sensor on CCD05 CCD11TEM= 176.061 / [K] 0x7 temp sensor on CCD11 CCD0TEMP= 169.515 / [K] 0x8 temp sensor on CCD00 RSTEMP = 232.61 / [K] 0x9 temp sensor on radiation shield DEWPRESS= 0.82 / [milli-torr] Dewar pressure DETHEAT = 38. / [%] Detector focal plane heater power NAMPSXY = '6 2 ' / Number of amplifiers in x y CCDSUM = '1 1 ' / [pix] Binning in x and y MODELFOC= 'N/A ' / MODELFOC CHECKSUM= '6aLZ8ZKZ6aKZ6YKZ' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = ' 0' / Data unit checksum (2010-03-15T13:06:37) GAIN = 1.7 / [e-/D.N.] Gain of detector. READNOI = 5.1 / [e-] Read noise of detector. DARKCUR = 0.1 / [e-/s] Dark current of detector / SCAMP DISTORTION KEYWORDS RADECSYS= 'ICRS ' / Astrometric system PV1_0 = 0. / Projection distortion parameter PV1_1 = 1. / Projection distortion parameter PV1_2 = 0. / Projection distortion parameter PV1_4 = 0.000811808026654439 / Projection distortion parameter PV1_5 = 0.000610424561546246 / Projection distortion parameter PV1_6 = 0.000247550637436069 / Projection distortion parameter PV1_7 = 0.000103962986153903 / Projection distortion parameter PV1_8 = -0.000463678684598807 / Projection distortion parameter PV1_9 = -0.000431244263972048 / Projection distortion parameter PV1_10 = -0.000152691163850316 / Projection distortion parameter PV1_12 = -0.00204628855915067 / Projection distortion parameter PV1_13 = -0.00173071932398225 / Projection distortion parameter PV1_14 = 0.000212015319199711 / Projection distortion parameter PV1_15 = -0.000489268678679085 / Projection distortion parameter PV1_16 = -0.000182891514774611 / Projection distortion parameter PV2_0 = 0. / Projection distortion parameter PV2_1 = 1. / Projection distortion parameter PV2_2 = 0. / Projection distortion parameter PV2_4 = 0.000273521447624334 / Projection distortion parameter PV2_5 = 0.000876139200581004 / Projection distortion parameter PV2_6 = -0.000122736852992318 / Projection distortion parameter PV2_7 = -0.00115870481394187 / Projection distortion parameter PV2_8 = 0.000744209714565589 / Projection distortion parameter PV2_9 = -0.00031431316953523 / Projection distortion parameter PV2_10 = -0.00025720525696749 / Projection distortion parameter PV2_12 = -0.00074859772103692 / Projection distortion parameter PV2_13 = 0.000838107200656415 / Projection distortion parameter PV2_14 = -0.00012633881376049 / Projection distortion parameter PV2_15 = -0.0020312867769692 / Projection distortion parameter PV2_16 = 0.00524608854745148 / Projection distortion parameter FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0. / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0. / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 3.620458E-05 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 3.332156E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 0. / SCAMP relative flux scale MAGZEROP= 0. / SCAMP zero-point PHOTIRMS= 0. / mag dispersion RMS (internal, high S/N) RA_RMS = 0.1655724 / [arcsec] RMS of SCAMP fit from 2MASS matching DEC_RMS = 0.1891921 / [arcsec] RMS of SCAMP fit from 2MASS matching ASTROMN = 384 / Number of stars in SCAMP astrometric solution SCAMPPTH= '/ptf/pos/archive/fallbackcal/scamp/7/' / SCAMP catalog path SCAMPFIL= 'PTF_201006174759_c_e_uca3_t112521_u001916251_f02_p002899_c07.fits' / SIP DISTORTION KEYWORDS A_ORDER = 4 / Distortion order for A A_0_2 = 6.96807813586153E-08 / Projection distortion parameter A_0_3 = 1.20881759870351E-11 / Projection distortion parameter A_0_4 = -4.07297345125509E-15 / Projection distortion parameter A_1_1 = -1.71602989085006E-07 / Projection distortion parameter A_1_2 = -3.40958003336147E-11 / Projection distortion parameter A_1_3 = 1.08769435952671E-14 / Projection distortion parameter A_2_0 = 2.28067760155696E-07 / Projection distortion parameter A_2_1 = 3.6610309234789E-11 / Projection distortion parameter A_2_2 = 4.73755078335384E-15 / Projection distortion parameter A_3_0 = 8.24210855193549E-12 / Projection distortion parameter A_3_1 = 3.84753767306115E-14 / Projection distortion parameter A_4_0 = -4.54223812412034E-14 / Projection distortion parameter A_DMAX = 1.53122472683886 / Projection distortion parameter B_ORDER = 4 / Distortion order for B B_0_2 = -7.69933957449607E-08 / Projection distortion parameter B_0_3 = -9.16855566272424E-11 / Projection distortion parameter B_0_4 = 1.66630509620112E-14 / Projection distortion parameter B_1_1 = 2.46289708854316E-07 / Projection distortion parameter B_1_2 = -5.90207917198792E-11 / Projection distortion parameter B_1_3 = 1.86811615261732E-14 / Projection distortion parameter B_2_0 = 3.44908367419592E-08 / Projection distortion parameter B_2_1 = -2.49509936365959E-11 / Projection distortion parameter B_2_2 = 2.84841315780067E-15 / Projection distortion parameter B_3_0 = 2.02845080441181E-11 / Projection distortion parameter B_3_1 = -4.51317603382652E-14 / Projection distortion parameter B_4_0 = -1.16438849571175E-13 / Projection distortion parameter B_DMAX = 2.89468553502114 / Projection distortion parameter AP_ORDER= 4 / Distortion order for AP AP_0_1 = -2.3927681685928E-08 / Projection distortion parameter AP_0_2 = -6.97379868441328E-08 / Projection distortion parameter AP_0_3 = -1.21069584606865E-11 / Projection distortion parameter AP_0_4 = 4.07524721573973E-15 / Projection distortion parameter AP_1_0 = 5.65239128994064E-08 / Projection distortion parameter AP_1_1 = 1.71734217296344E-07 / Projection distortion parameter AP_1_2 = 3.41724875038451E-11 / Projection distortion parameter AP_1_3 = -1.08775499102067E-14 / Projection distortion parameter AP_2_0 = -2.28068482487158E-07 / Projection distortion parameter AP_2_1 = -3.66548961802381E-11 / Projection distortion parameter AP_2_2 = -4.75858241735224E-15 / Projection distortion parameter AP_3_0 = -8.24781966878619E-12 / Projection distortion parameter AP_3_1 = -3.85281201904104E-14 / Projection distortion parameter AP_4_0 = 4.54275049666924E-14 / Projection distortion parameter BP_ORDER= 4 / Distortion order for BP BP_0_1 = -1.50638746640517E-07 / Projection distortion parameter BP_0_2 = 7.70565767927487E-08 / Projection distortion parameter BP_0_3 = 9.18374546897802E-11 / Projection distortion parameter BP_0_4 = -1.66839467627906E-14 / Projection distortion parameter BP_1_0 = -4.87195269294628E-08 / Projection distortion parameter BP_1_1 = -2.46371690411844E-07 / Projection distortion parameter BP_1_2 = 5.9111535979953E-11 / Projection distortion parameter BP_1_3 = -1.87729776729012E-14 / Projection distortion parameter BP_2_0 = -3.46046151217313E-08 / Projection distortion parameter BP_2_1 = 2.51320825919019E-11 / Projection distortion parameter BP_2_2 = -2.85758325791527E-15 / Projection distortion parameter BP_3_0 = -2.04221364218494E-11 / Projection distortion parameter BP_3_1 = 4.51336286236569E-14 / Projection distortion parameter BP_4_0 = 1.16567578965612E-13 / Projection distortion parameter / DATA FLOW ORIGNAME= '/data/PTF_default_38068.fits' / Filename as written by the camera FILENAME= 'PTF200906253621_2_o_38068.fits' / Filename of delivered camera image PROCORIG= 'IPAC-PTF pipelines' / Processing origin PROCDATE= 'Tue Feb 21 03:34:46 2012' / Processing date/time (Pacific time) PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pathname of pixel mask PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Filename of pixel mask SFLATPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p4/cId45986/' / Pathname of super SFLATFIL= 'PTF_200906250000_i_s_flat_t120000_u000045986_f02_p000000_c07.fits' SBIASPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p1/cId45922/' / Pathname of super SBIASFIL= 'PTF_200906250000_i_s_bias_t120000_u000045922_f00_p000000_c07.fits' DBNID = 121 / Database night ID DBEXPID = 22920 / Database exposure ID DBRID = 3663141 / Database raw-image ID DBPID = 12052003 / Database processed-image ID DBFID = 2 / Database filter ID DBPIID = 1 / Database P.I. ID DBPRID = 3 / Database project ID DBFIELD = 22920 / Database field ID DBSVID = 50 / Database software-version ID DBCVID = 56 / Database config-data-file ID END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/header_with_time.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/header_with_time.fits new file mode 100644 index 0000000000000000000000000000000000000000..17cc4f3f86aabcb0ee00b532c3b3aab095fe1888 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/header_with_time.fits @@ -0,0 +1 @@ +SIMPLE = F / Conforms to FITS standard? NO! BITPIX = -32 / IEEE single precision floating point NAXIS = 0 / No image data CRPIX1A = 513.0 / Pixel coordinate of reference point CRPIX2A = 513.0 / Pixel coordinate of reference point CRPIX3A = 1025.0 / Pixel coordinate of reference point CRPIX4A = 1.0 / Pixel coordinate of reference point PC1_1A = 0.866025404 / Linear transformation matrix element PC1_2A = 0.500000000 / Linear transformation matrix element PC2_1A = -0.500000000 / Linear transformation matrix element PC2_2A = 0.866025404 / Linear transformation matrix element CDELT1A = -0.10 / [deg] x-scale CUNIT1A = 'deg' / Degree units are required CTYPE1A = 'RA---SZP' / Right ascension in slant zenithal projection CRVAL1A = 150.0 / [deg] Right ascension at the reference point CNAME1A = 'Right ascension (J2000)' / Axis name for labelling purposes CDELT2A = 0.10 / [deg] y-scale CUNIT2A = 'deg' / Degree units are required CTYPE2A = 'DEC--SZP' / Declination in a slant zenithal projection CRVAL2A = -30.0 / [deg] Declination at the reference point CNAME2A = 'Declination (J2000)' / Axis name for labelling purposes PV1_1A = 0.0 / [deg] Native longitude of the reference point PV1_2A = 90.0 / [deg] Native latitude of the reference point PV1_3A = 195.0 / [deg] LONPOLEa by another name (precedence) PV1_4A = 999.0 / [deg] LATPOLEa by another name (precedence) PV2_1A = 0.0 / SZP distance, in spherical radii PV2_2A = 180.0 / [deg] SZP P-longitude PV2_3A = 45.0 / [deg] SZP P-latitude LONPOLEA= 195.0 / [deg] Native longitude of the NCP LATPOLEA= 999.0 / [deg] Native latitude of the NCP RADESYSA= 'FK5' / Mean equatorial coordinates, IAU 1984 system EQUINOXA= 2000.0 / [yr] Equinox of equatorial coordinates CDELT3A = -9.635265432E-6 / [m] Wavelength scale CUNIT3A = 'm' / Wavelength units CTYPE3A = 'WAVE-F2W' / Frequency axis expressed as wavelength CRVAL3A = 0.214982042 / [m] Reference wavelength CNAME3A = 'Wavelength' / Axis name for labelling purposes CRDER3A = 1.0E-11 / [m] Wavelength calibration, random error CSYER3A = 1.0E-12 / [m] Wavelength calibration, systematic error RESTFRQA= 1.42040575E9 / [Hz] HI rest frequency RESTWAVA= 0.211061141 / [m] HI rest wavelength SPECSYSA= 'BARYCENT' / Reference frame of spectral coordinates SSYSOBSA= 'TOPOCENT' / Reference frame of observation VELOSYSA= 1500.0 / [m/s] Bary-topo velocity towards the source SSYSSRCA= 'LSRK' / Reference frame of source redshift ZSOURCEA= 0.0025 / Redshift of the source CDELT4A = 1.0 / [s] Time scale CUNIT4A = 's' / Time units CTYPE4A = 'TIME ' / String value and comment containing quotes (') CRVAL4A = -2E3 / [s] Time at the reference point CNAME4A = 'Time offset' / Axis name for labelling purposes PS4_0A = 'UTC' / Time measurement system UNDEF = / Undefined keyvalue TRUE = T / Logical FALSE = F / Logical INT32 = 00000012345 / Not a 64-bit integer INT32 = -000000123456789 / Not a 64-bit integer INT32 = -2147483648 / Not a 64-bit integer (INT_MIN) INT32 = 2147483647 / Not a 64-bit integer (INT_MAX) INT32 = 0000000000000000000000000000000000012345 / Not a very long integer INT32 = -000000000000000000000000000123456789 / Not a very long integer INT64 = -2147483649 / 64-bit integer (INT_MIN - 1) INT64 = +2147483648 / 64-bit integer (INT_MAX + 1) INT64 = +100000000000000000 / 64-bit integer INT64 = -876543210987654321 / 64-bit integer INT64 = -9223372036854775808 / Not a very long integer (LONG_MIN) INT64 = +9223372036854775807 / Not a very long integer (LONG_MAX) INT64 = -000000000000000000000000000000876543210987654321 / 64-bit integer INTVL = -9223372036854775809 / Very long integer (LONG_MIN - 1) INTVL = +9223372036854775808 / Very long integer (LONG_MAX + 1) INTVL = -100000000000000000000000000000876543210987654321 / Very-long integer INTVL = +123456789012345678901234567890123456789012345678901234567890123456789INTVL = 1234567890123456789012345678901234567890123456789012345678901234567890FLOAT = 3.14159265358 / Floating point FLOAT = 1.602176565E-19 / Floating point, lower-case exp allowed FLOAT = 2.99792458E8 / Floating point FLOAT = 6.62606957D-34 / Floating point, lower-case exp allowed FLOAT = 6.02214129D23 / Floating point COMPLEX = (137, -1) / An integer complex keyvalue COMPLEX = (10E5, -0.1) / A floating point complex keyvalue GOODSTR = '"G''DAY" ' / A valid string keyvalue BLANKS = ' ' / An all-blank string equals a single blank LONGSTR = 'The loooooongest possible non-continued string value, 68 characters.'END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/invalid_header.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/invalid_header.hdr new file mode 100644 index 0000000000000000000000000000000000000000..c783a54c24b2100bf287200ff34f05aecee59115 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/invalid_header.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 2 / number of data axes NAXIS1 = 2048 / length of data axis 1 NAXIS2 = 4096 / length of data axis 2 COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H PANID = '_p48m ' / PAN identification DHSID = '_p48m ' / DHS identification ROISTATE= 'FULL ' / ROI State (FULL | ROI) EXPTIME = 60. / requested exposure time (sec) AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2012-03-05T04:39:20.696' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.PIXSCALE= 1.01 / pixel scale ("/pix) CRTYPE1 = 'deg ' CRTYPE2 = 'deg ' COMMENT Original key: "CRVAL1" _RVAL1 = 61.8573769316265 COMMENT Original key: "CRVAL2" _RVAL2 = 4.554355555555555 COMMENT Original key: "CRPIX1" _RPIX1 = 0 COMMENT Original key: "CRPIX2" _RPIX2 = 0 COMMENT Original key: "CDELT1" _DELT1 = 0.0002805555555555555 COMMENT Original key: "CDELT2" _DELT2 = -0.0002805555555555555 COMMENT Original key: "CROTA2" _ROTA2 = 0.0 RA = '04:13:42.857' / Rquested field RA (J2000.0) HH:MM:SS.SSSS DEC = '+03:22:30.00' / Rquested field DEC (J2000.0) sDD:MM:SS.SSSS COMMENT Original key: "CTYPE1" _TYPE1 = 'RA---TAN' / type of coordinates in axis=1 COMMENT Original key: "CTYPE2" _TYPE2 = 'DEC--TAN' / type of coordinates in axis=2 AMPSEC = '[1:2048,1:4096]' / amplifier section CCDSEC = '[1:2048,1:4096]' / ccd section CCDSIZE = '[1:2048,1:4096]' / ccd size TRIMSEC = '[15:2062,1:4096]' / trim section DATASEC = '[15:2062,1:4096]' / data section BIASSEC = '[2063:2078,1:4096]' / bias section DETSEC = '[1:2048,1:4096]' / detector section ROISEC = '[1:2048,1:4096]' / roi section FPA = 'P48MOSAIC' / focal plan array CCDID = '0 ' / CCD number (0..11) CCDNAME = 'W21C2 ' / detector mfg serial number GAIN = '1.5 ' / Gain e-/adu READNOI = '4.2 ' / Read noise e- DARKCUR = '< 0.1 ' / Dark current e-/s @ 150 K CHECKSUM= '3S4aAP2a5P2aAP2a' / HDU checksum updated 2012-03-05T04:40:54 DATASUM = '1654834290' / data unit checksum updated 2012-03-05T04:40:54 BSCALE = 1 / default scaling factor DHEINF = 'SDSU, Gen-III' / controller info DHEFIRM = '/usr/src/dsp/20090618/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / astropci software version ORIGIN = 'Palomar Transient Factory' / origin of the data TELESCOP= 'P48 ' / name of telescope INSTRUME= 'PTF/MOSAIC' / instrument name DETID = 'PTF/MOSAIC' / detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / source for header information OBSLAT = 33.3574 / telescope geodetic latitude (dec deg) in WGS84 OBSLON = -116.8599 / telescope geodetic longitude (dec deg) in WGS84OBSALT = 1703.2 / telescope geodetic altitude (meters) in WGS84 DATAMIN = 0. / minimum value for array DATAMAX = 65535. / maximum value for array OBSTYPE = 'object ' / image type (dark,science,bias,focus) IMGTYP = 'object ' / image type (dark,science,bias,focus) ROISTATE= 'FULL ' / ROI State (FULL | ROI) FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '1 ' / Filter changer slot position LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 175. / 0x0 servo temp sensor on CCD09 (K) HSTEMP = 147.919 / 0x1 heat spreader temp (K) DHE0TEMP= 290.409 / 0x2 detector head electronics temp, master (K) DHE1TEMP= 292.513 / 0x3 detector head electronics temp, slave (K) DEWWTEMP= 276.405 / 0x4 dewar wall temp (K) HEADTEMP= 137.562 / 0x5 cryo cooler cold head temp (K) CCD5TEMP= 175.129 / 0x6 temp sensor on CCD05 (K) CCD11TEM= 176.167 / 0x7 temp sensor on CCD11 (K) CCD0TEMP= 169.115 / 0x8 temp sensor on CCD00 (K) RSTEMP = 230.99 / 0x9 temp sensor on radiation shield (K) DEWPRESS= 3.5 / dewar pressure (milli-torr) DETHEAT = 37.4 / detector focal plane heater power (%) DATE = '2012-03-05' / UTC date when file was written YYYY-MM-DD EXPTIME = 60. / requested exposure time (sec) AEXPTIME= 60. / actual exposure time (sec) NAMPSXY = '6 2 ' / number of amplifiers in x y CCDSUM = '1 1 ' / binning in x and y (pix pix) PIXSCALE= 1.01 / pixel scale ("/pix) ORIGNAME= '/data/PTF_default_62108.fits' / filename as written by the camera REFERENC= 'http://www.astro.caltech.edu/ptf' / reference - PTF website PTFPRPI = 'Kulkarni' / PTF Project PI OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A OBJECT = 'PTF_survey' / Fields object PTFFIELD= '2820 ' / PTF unique field ID SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr MOONRA = 124.394847 / Moon J2000.0 R.A. (deg) MOONDEC = 15.249532 / Moon J2000.0 Dec. (deg) MOONILLF= 0.87268 / Moon illuminated fraction (frac) MOONPHAS= 41.809906 / Moon phase angle (deg) MOONESB = -2.77365 / Moon excess in sky brightness V-band MOONALT = 70.469083 / Moon altitude (deg) SUNAZ = 289.304104 / Sun azimuth (deg) SUNALT = -36.291647 / Sun altitude (deg) COMMENT Original key: "EQUINOX" _QUINOX = 2000. / Equinox (Julian years) OBJRA = '04:13:42.857' / Rquested field J2000.0 Ra. OBJDEC = '+03:22:30.00' / Rquested field J2000.0 Dec. OBJRAD = 63.428571 / Rquested field RA (J2000.0) (deg) OBJDECD = 3.375 / Rquested field Dec (J2000.0) (deg) AZIMUTH = 250.486706 / Telescope Azimuth (deg) ALTITUDE= 32.381913 / Telescope altitude (deg) AIRMASS = 1.862939 / Telescope airmass OCS_TIME= '2012-03-05T04:39:20.600' / UTC Date for OCS calc time-dep params OBSERVER= 'KulkarniPTF' / Observer name and project PTFPID = '20000 ' / Project type: 00000-49999 PTFFLAG = '1 ' / 1 = PTF ; 0 = non-PTF category DEFOCUS = 0. / Focus position - nominal focus (mm) FOCUSPOS= 1.3405 / Exposures focusPos (mm) DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 29.7 / Track speed RA rel to sidereal "/hr TRACKDEC= 15.2 / Track speed Dec rel to sidereal "/hr TELRA = 63.584159 / Telescope ap equinox of date RA (deg) TELDEC = 3.4052 / Telescope ap equinox of date Dec(deg) TELHA = 52.7247 / Telescope ap equinox of date HA(deg) DOMEAZ = 251.5333 / Dome azimuth (deg) WINDSCAL= 9.5761 / Wind screen altitude (deg) TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode WINDDIR = 2.2 / Azimuth of wind direction (deg) WINDSPED= 5.628 / Wind speed (km/hour) OUTTEMP = 15.555556 / Outside temperature (C) OUTRELHU= 0.273 / Outside relative humidity (frac) OUTDEWPT= -3.222222 / Outside dew point (C) SEEING = 2.3 / seeing FWHM (pix) PEAKDIST= 0.3846153923077622 / Mean dist brightest pixel-centeroid pixel (pix)ELLIP = 0.277 / Mean image ellipticity A/B ELLIPPA = 51.34 / Mean image ellipticity PA (deg) MODELFOC= 'N/A ' / MODELFOC FILENAME= 'PTF201203051940_2_o_62108.fits' / Image File name as wriited by ptf-dDATE-OBS= '2012-03-05T04:39:20.696' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS OBSJD = 2455991.69398 / Julian day corresponds to UTC-OBS (day) OBSMJD = 55991.19398 / MJD corresponds to UTC-OBS (day) OBSLST = '7:45:14.56' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '3:30:54.36' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2455991.69276 / Heliocentric Julian Day (days) UTC-OBS = '2012-03-05T04:39:20.696' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.CHECKSUM= 'Y6baa6ZUZ6aZa6YZ' / HDU checksum updated 2012-03-05T04:40:54 DATASUM = ' 0' / data unit checksum updated 2012-03-05T04:40:54 MEDOVER = 810 / Median overscan subtraction in cts MEDSKY = 10091.425 / Median sky in cts SKYSIG = 69.755859 / Median skysig in cts COMMENT Original key: "END" COMMENT COMMENT --Start of Astrometry.net WCS solution-- COMMENT OCTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions OCTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions OWCSAXES= 2 / no comment OEQUINOX= 2000.0 / Equatorial coordinates definition (yr) OLONPOLE= 180.0 / no comment OLATPOLE= 0.0 / no comment OCRVAL1 = 61.8877560481 / RA of reference point OCRVAL2 = 4.38091087278 / DEC of reference point OCRPIX1 = 789.496032715 / X reference pixel OCRPIX2 = 397.558751106 / Y reference pixel OCUNIT1 = 'deg ' / X pixel scale units OCUNIT2 = 'deg ' / Y pixel scale units OCD1_1 = 0.000280414050836 / Transformation matrix OCD1_2 = 1.69743814134E-06 / no comment OCD2_1 = 2.56032122491E-06 / no comment OCD2_2 = -0.000280673285207 / no comment OIMAGEW = 2048 / Image width, in pixels. OIMAGEH = 4096 / Image height, in pixels. OA_ORDER= 2 / Polynomial order, axis 1 OA_0_2 = 1.73489369986E-07 / no comment OA_1_1 = 1.58657555974E-07 / no comment OA_2_0 = 6.71067642128E-07 / no comment OB_ORDER= 2 / Polynomial order, axis 2 OB_0_2 = 2.45361183805E-07 / no comment OB_1_1 = 4.36889035802E-07 / no comment OB_2_0 = 5.22991769535E-08 / no comment OAP_ORDE= 2 / Inv polynomial order, axis 1 OAP_0_1 = -9.79930635325E-07 / no comment OAP_0_2 = -1.72800310908E-07 / no comment OAP_1_0 = -4.2478779666E-07 / no comment OAP_1_1 = -1.5696285653E-07 / no comment OAP_2_0 = -6.69877894679E-07 / no comment OBP_ORDE= 2 / Inv polynomial order, axis 2 OBP_0_1 = -1.33340266283E-06 / no comment OBP_0_2 = -2.44275619788E-07 / no comment OBP_1_0 = -8.75289177595E-07 / no comment OBP_1_1 = -4.35275784504E-07 / no comment OBP_2_0 = -5.14575668137E-08 / no comment HISTORY Created by the Astrometry.net suite. HISTORY For more details, see http://astrometry.net . HISTORY Subversion URL HISTORY svn+ssh://astrometry.net/svn/tags/tarball-0.25/astrometry/ HISTORY util/ HISTORY Subversion revision 10193 HISTORY Subversion date 2008-12-09 17:58:39 -0500 (Tue, 09 Dec HISTORY 2008) HISTORY This WCS header was created by the program "blind". DATE = '2012-03-04T20:56:39' / Date this file was created. COMMENT -- blind solver parameters: -- COMMENT Index(0): COMMENT /project/projectdirs/boss/usr/local/data/index-205.quad.fi COMMENT ts COMMENT Index(1): COMMENT /project/projectdirs/boss/usr/local/data/index-204-00.quad COMMENT .fits COMMENT Index(2): COMMENT /project/projectdirs/boss/usr/local/data/index-204-05.quad COMMENT .fits COMMENT Index(3): COMMENT /project/projectdirs/boss/usr/local/data/index-204-08.quad COMMENT .fits COMMENT Index(4): COMMENT /project/projectdirs/boss/usr/local/data/index-203-00.quad COMMENT .fits COMMENT Index(5): COMMENT /project/projectdirs/boss/usr/local/data/index-203-05.quad COMMENT .fits COMMENT Index(6): COMMENT /project/projectdirs/boss/usr/local/data/index-203-08.quad COMMENT .fits COMMENT Index(7): COMMENT /project/projectdirs/boss/usr/local/data/index-202-00.quad COMMENT .fits COMMENT Index(8): COMMENT /project/projectdirs/boss/usr/local/data/index-202-05.quad COMMENT .fits COMMENT Index(9): COMMENT /project/projectdirs/boss/usr/local/data/index-202-08.quad COMMENT .fits COMMENT Field name: PTF201203051940_2_o_62108_00.axy COMMENT Field scale lower: 0.98 arcsec/pixel COMMENT Field scale upper: 1.03 arcsec/pixel COMMENT X col name: X_IMAGE COMMENT Y col name: Y_IMAGE COMMENT Start obj: 0 COMMENT End obj: 0 COMMENT Solved_in: (null) COMMENT Solved_out: (null) COMMENT Solvedserver: (null) COMMENT Parity: 2 COMMENT Codetol: 0.01 COMMENT Verify pixels: 1 pix COMMENT Maxquads: 0 COMMENT Maxmatches: 0 COMMENT Cpu limit: 30.000000 s COMMENT Time limit: 0 s COMMENT Total time limit: 0 s COMMENT Total CPU limit: 0.000000 s COMMENT Tweak: yes COMMENT Tweak AB order: 2 COMMENT Tweak ABP order: 2 COMMENT -- COMMENT -- properties of the matching quad: -- COMMENT index id: 205 COMMENT index healpix: -1 COMMENT index hpnside: 1 COMMENT log odds: 570.945 COMMENT odds: 9.08044e+247 COMMENT quadno: 13818269 COMMENT stars: 9968100,9968090,9968098,9968093 COMMENT field: 3,0,4,2 COMMENT code error: 0.00127394 COMMENT noverlap: 172 COMMENT nconflict: 0 COMMENT nfield: 172 COMMENT nindex: 176 COMMENT scale: 1.00895 arcsec/pix COMMENT parity: 0 COMMENT quads tried: 1 COMMENT quads matched: 2 COMMENT quads verified: 1 COMMENT objs tried: 5 COMMENT cpu time: 0.003999 COMMENT -- COMMENT COMMENT --End of Astrometry.net WCS-- COMMENT UB1_ZP = 27.5 LMT_MG = 19.192 ASTSOL = 'scamp ' HISTORY Astrometric solution by SCAMP version 1.7.0 (2010-08-05) COMMENT (c) Emmanuel BERTIN COMMENT EQUINOX = 2000.0000 / Mean equinox RADECSYS= 'ICRS ' / Astrometric system CTYPE1 = 'RA---TAN' / WCS projection type for this axis CTYPE2 = 'DEC--TAN' / WCS projection type for this axis CUNIT1 = 'deg ' / Axis unit CUNIT2 = 'deg ' / Axis unit CRVAL1 = 6.188763218E+01 / World coordinate on this axis CRVAL2 = 4.380823580E+00 / World coordinate on this axis CRPIX1 = 7.894960327E+02 / Reference pixel on this axis CRPIX2 = 3.975587511E+02 / Reference pixel on this axis CD1_1 = 2.804743351E-04 / Linear projection matrix CD1_2 = 1.807931352E-06 / Linear projection matrix CD2_1 = 2.367504576E-06 / Linear projection matrix CD2_2 = -2.808315811E-04 / Linear projection matrix PV1_0 = 1.456397190E-04 / Projection distortion parameter PV1_1 = 9.998189362E-01 / Projection distortion parameter PV1_2 = 3.901789582E-04 / Projection distortion parameter PV1_4 = 2.684396013E-03 / Projection distortion parameter PV1_5 = -7.179465569E-04 / Projection distortion parameter PV1_6 = 5.132011264E-04 / Projection distortion parameter PV1_7 = -1.672242131E-03 / Projection distortion parameter PV1_8 = 5.565322076E-04 / Projection distortion parameter PV1_9 = -8.240132461E-04 / Projection distortion parameter PV1_10 = -3.698351238E-05 / Projection distortion parameter PV1_12 = 3.777486931E-03 / Projection distortion parameter PV1_13 = -1.658254611E-03 / Projection distortion parameter PV1_14 = 2.989635088E-04 / Projection distortion parameter PV1_15 = -4.907197064E-04 / Projection distortion parameter PV1_16 = 2.889486855E-05 / Projection distortion parameter PV2_0 = 1.104553949E-04 / Projection distortion parameter PV2_1 = 1.000001456E+00 / Projection distortion parameter PV2_2 = 5.771870225E-04 / Projection distortion parameter PV2_4 = 2.836854693E-04 / Projection distortion parameter PV2_5 = -1.340251514E-04 / Projection distortion parameter PV2_6 = -7.102989931E-04 / Projection distortion parameter PV2_7 = 1.022790097E-03 / Projection distortion parameter PV2_8 = 2.436846754E-04 / Projection distortion parameter PV2_9 = 9.322698310E-04 / Projection distortion parameter PV2_10 = -7.413484043E-03 / Projection distortion parameter PV2_12 = 5.280834355E-04 / Projection distortion parameter PV2_13 = 4.532076725E-04 / Projection distortion parameter PV2_14 = -1.305400687E-04 / Projection distortion parameter PV2_15 = 6.693583421E-03 / Projection distortion parameter PV2_16 = 2.823700675E-02 / Projection distortion parameter FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0.000000000E+00 / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0.000000000E+00 / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 8.822499895E-06 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 2.438161774E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 1.666666667E-01 / SCAMP relative flux scale MAGZEROP= 30.0000 / SCAMP zero-point PHOTIRMS= 0.0000 / mag dispersion RMS (internal, high S/N) PHOTINST= 1 / SCAMP photometric instrument label PHOTLINK= ' F' / True if linked to a photometric field END diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/irac_sip.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/irac_sip.hdr new file mode 100644 index 0000000000000000000000000000000000000000..08d370b747c733bc8575e618c2b1fc86b7e5ef2a --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/irac_sip.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / FOUR-BYTE SINGLE PRECISION FLOATING POINT NAXIS = 2 / STANDARD FITS FORMAT NAXIS1 = 256 / STANDARD FITS FORMAT NAXIS2 = 256 / STANDARD FITS FORMAT EXTEND = T / TAPE MAY HAVE STANDARD FITS EXTENSIONS ORIGIN = 'SIRTF Science Center' / Organization generating this FITS file CREATOR = 'S8.9.0' / SW version used to create this FITS file TELESCOP= 'SIRTF ' / SIRTF spacecraft INSTRUME= 'IRAC ' / SIRTF instrument ID COMMENT Controlled data files (CDFs) used: COMMENT w_bqd_files_to_copy_to_sandbox.nl, fileID = 2 COMMENT w_bqd_pointrefine.nl, fileID = 120903 CHNLNUM = 1 / 1 digit instrument channel number EXPTYPE = 'sci ' / Exposure Type REQTYPE = 'AOR ' / Request type (AOR, IER, or SER) AOT_TYPE= 'IracMap ' / Observation template type AORLABEL= 'NSMLT-0013 HP' / AOR Label FOVID = 74 / Field of View ID FOVNAME = 'IRAC_Center_of_4.5&8.0umArray' / Field of View Name / PROPOSAL INFORMATION OBSRVR = 'Giovanni Fazio' / Observer Name (Last, First) OBSRVRID= 2 / Observer ID of Principal Investigator PROCYCL = 1 / Proposal Cycle PROGID = 35 / Program ID PROTITLE= 'MULTIPLICTY AND INFRARED COLORS OF NEARBY MLT DWARFS' / Program TitlePROGCAT = 29 / Program Category / TIME AND EXPOSURE INFORMATION DATE_OBS= '2003-12-06T10:46:35.021' / Date & time at DCE start MJD_OBS = 52979.449 / [days] MJD at DCE start (,JD-2400000.05) UTCS_OBS= 123979595.021 / [sec] J2000 ephem. time at DCE start SCLK_OBS= 755174834.035 / [sec] SCLK time (since 1/1/1980) at DCE start SAMPTIME= 0.2 / [sec] Sample integration time FRAMTIME= 30. / [sec] Time spent integrating (whole array) COMMENT Photons in Well = Flux[photons/sec/pixel] * FRAMTIME EXPTIME = 26.8 / [sec] Effective integration time per pixel COMMENT DN per pixel = Flux[photons/sec/pixel] / GAIN * EXPTIME AINTBEG = 43146779. / [Secs since IRAC turn-on] Time of integ. start ATIMEEND= 431497.75 / [Secs since IRAC turn-on] Time of integ. end AFOWLNUM= 16 / Fowler number AWAITPER= 118 / [0.2 sec] Wait period ANUMREPS= 1 / Number of repeat integrations AREADMOD= 0 / Full (0) or subarray (1) ABARREL = 4 / Barrel shift APEDSIG = 0 / 0=Normal, 1=Pedestal, 2=Signal / TARGET AND POINTING INFORMATION OBJECT = 'BRI0021-02' / Target Name OBJTYPE = 'TargetFixedSingle' / Object Type CRVAL1 = 6.15501347619052 / [deg] RA at CRPIX1,CRPIX2 averaged over DCE CRVAL2 = -2.07230798888938 / [deg] DEC at CRPIX1,CRPIX2 averaged over DCE RA_HMS = '00h24m37.2s' / [hh:mm:ss.s] CRVAL1 as sexagesimal DEC_DMS = '-02d04m20s' / [dd:mm:ss] CRVAL2 as sexagesimal RADESYS = 'ICRS ' / International Celestial Reference System EQUINOX = 2000. / Equinox for ICRF celestial coord. system CD1_1 = -0.000147943581033529 CD1_2 = 0.000305150643914974 CD2_1 = 0.000305100010374518 CD2_2 = 0.000147710276207053 CTYPE1 = 'RA---TAN-SIP' / RA---TAN with distortion in pixel space CTYPE2 = 'DEC--TAN-SIP' / DEC--TAN with distortion in pixel space CRPIX1 = 128. / Reference pixel along axis 1 CRPIX2 = 128. / Reference pixel along axis 2 CRDER1 = 0.000630078723280563 / [deg] Uncertainty in CRVAL1 CRDER2 = 0.000630066308654874 / [deg] Uncertainty in CRVAL2 UNCRTPA = 0.00186634833181778 / [deg] Uncertainty in position angle CSDRADEC= 5.27382080384386E-06 / [deg] Costandard deviation in RA and Dec SIGRA = 0.141175326515381 / [arcsec] RMS dispersion of RA over DCE SIGDEC = 0.0260011516228373 / [arcsec] RMS dispersion of DEC over DCE SIGPA = 0.786707814443969 / [arcsec] RMS dispersion of PA over DCE PA = 64.170376337596 / [deg] Position angle of axis 2 (E of N) (was ORRA_RQST = 6.15510111508666 / [deg] Requested RA at CRPIX1, CRPIX2 DEC_RQST= -2.07249338178042 / [deg] Requested Dec at CRPIX1, CRPIX2 PM_RA = -1.4108 / [arcsec/yr] Proper Motion in RA (J2000) PM_DEC = 1.50775 / [arcsec/yr] Proper Motion in Dec (J200) RMS_JIT = 0.00840644136311876 / [arcsec] RMS jitter during DCE RMS_JITY= 0.00544908399993541 / [arcsec] RMS jitter during DCE along Y RMS_JITZ= 0.00640122956573203 / [arcsec] RMS jitter during DCE along Z SIG_JTYZ= 0.00350446005496643 / [arcsec] Costadard deviation of jitter in YZ PTGDIFF = 0.738140521808859 / [arcsec] Offset btwn actual and rqsted pntng RA_REF = 6.10241222222221 / [deg] Commanded RA (J2000) of ref. position DEC_REF = -1.97235500000001 / [deg] Commanded Dec (J2000) of ref. position USEDBPHF= T / T if Boresight Pointing History File was used / DISTORTION KEYWORDS A_ORDER = 2 / polynomial order, axis 1, detector to sky A_0_2 = 6.666E-06 / distortion coefficient A_1_1 = 1.801E-05 / distortion coefficient A_2_0 = -2.353E-05 / distortion coefficient A_DMAX = 0.58 / [pixel] maximum correction B_ORDER = 2 / polynomial order, axis 2, detector to sky B_0_2 = 2.601E-05 / distortion coefficient B_1_1 = -2.944E-05 / distortion coefficient B_2_0 = -1.226E-06 / distortion coefficient B_DMAX = 0.902 / [pixel] maximum correction AP_ORDER= 2 / polynomial order, axis 1, sky to detector AP_0_1 = -5.463E-06 / distortion coefficient AP_0_2 = -6.666E-06 / distortion coefficient AP_1_0 = 1.14E-05 / distortion coefficient AP_1_1 = -1.801E-05 / distortion coefficient AP_2_0 = 2.353E-05 / distortion coefficient BP_ORDER= 2 / polynomial order, axis 2, sky to detector BP_0_1 = 1.975E-05 / distortion coefficient BP_0_2 = -2.601E-05 / distortion coefficient BP_1_0 = -1.495E-05 / distortion coefficient BP_1_1 = 2.944E-05 / distortion coefficient BP_2_0 = 1.225E-06 / distortion coefficient / PHOTOMETRY BUNIT = 'MJy/sr ' / Units of image data FLUXCONV= 0.111 / Flux Conv. factor (MJy/Str per DN/sec) GAIN = 3.3 / e/DN conversion / GENERAL MAPPING KEYWORDS CYCLENUM= 6 / Current cycle number DITHPOS = 1 / Current dither position / IRAC MAPPING KEYWORDS READMODE= 'FULL ' / Readout mode DITHSCAL= 'small ' / Dither scale (small, medium, large) / INSTRUMENT TELEMETRY DATA ASHTCON = 2 / Shutter condition (1:closed, 2: open) AWEASIDE= 0 / WEA side in use (0:B, 1:A) ACTXSTAT= 0 / Cmded transcal status ATXSTAT = 0 / transcal status ACFLSTAT= 0 / Cmded floodcal status AFLSTAT = 0 / floodcal status AVRSTUCC= -3.5 / [Volts] Cmded VRSTUC Bias AVRSTBEG= -3.51078391 / [Volts] VRSTUC Bias at start integration AVDETC = -2.75 / [Volts] Cmded VDET Bias AVDETBEG= -2.75721574 / [Volts] VDET Bias at start of integration AVGG1C = -3.6500001 / [Volts] Cmded VGG1 Bias AVGG1BEG= -3.2065742 / [Volts] VGG1 Bias at start of integration AVDDUCC = -3 / [Volts] Cmded VDDUC Bias AVDDUBEG= -3 / [Volts] VDDUC Bias at start integration AVGGCLC = 1 / [Volts] Cmnded VGGCL clock rail voltage AVGGCBEG= 1 / [Volts] VGGCL clock rail voltage AHTRIBEG= 204.70100403 / [uAmps] Heater current at start of integ AHTRVBEG= 2.39006352 / [Volts] Heater Voltage at start integ. AFPAT2B = 15.02370644 / [Deg_K] FPA Temp sensor #2 at start integ. AFPAT2BT= 431446.8125 / [Sec] FPA Temp sensor #2 time tag AFPAT2E = 15.02312088 / [Deg_K] FPA temp sensor #2, end integ. AFPAT2ET= 431476.9375 / [Sec] FPA temp sensor #2 time tag ACTENDT = 20.46821594 / [Deg_C] C&T board thermistor AFPECTE = 18.34936523 / [Deg_C] FPE control board thermistor AFPEATE = 21.90242577 / [Deg_C] FPE analog board thermistor ASHTEMPE= 21.59600639 / [Deg_C] Shutter board thermistor ATCTEMPE= 22.81523895 / [Deg_C] Temp. controller board thermistor ACETEMPE= 20.49869537 / [Deg_C] Calib. electronics board thermistor APDTEMPE= 21.47408295 / [Deg_C] PDU board thermistor ACATMP1E= 1.31549275 / [Deg_K] CA Temp, end integration for temp1 ACATMP2E= 1.29850066 / [Deg_K] CA Temp, end integration for temp2 ACATMP3E= 1.33064687 / [Deg_K] CA Temp, end integration for temp3 ACATMP4E= 1.3274169 / [Deg_K] CA Temp, end integration for temp4 ACATMP5E= 1.3255291 / [Deg_K] CA Temp, end integration for temp5 ACATMP6E= 1.32403958 / [Deg_K] CA Temp, end integration for temp6 ACATMP7E= 1.32282794 / [Deg_K] CA Temp, end integration for temp7 ACATMP8E= 1.31592035 / [Deg_K] CA Temp, end integration for temp8 / DATA FLOW KEYWORDS ORIGIN0 = 'JPL_FOS ' / Site where RAW FITS file was written CREATOR0= 'J5.1.0 ' / SW system that created RAW FITS DATE = '2003-12-17T00:52:57' / [YYYY-MM-DDThh:mm:ss UTC] file creation date AORKEY = 3937792 / AOR or EIR key. Astrnmy Obs Req/Instr Eng Req EXPID = 11 / Exposure ID (0-9999) DCENUM = 0 / DCE number (0-9999) TLMGRPS = 1 / expected number of groups FILE_VER= 1 / Version of the raw file made by SIS RAWFILE = 'IRAC.1.0003937792.0011.0000.01.mipl.fits' / Raw data file name CPT_VER = '3.0.94 ' / Channel Param Table FOS versioN CTD_VER = '3.0.94S ' / Cmded telemetry data version EXPDFLAG= F / (T/F) expedited DCE MISS_LCT= 0 / Total Missed Line Cnt in this FITS MANCPKT = F / T if this FITS is Missing Ancillary Data MISSDATA= F / T if this FITS is Missing Image Data PAONUM = 206 / PAO Number CAMPAIGN= 'IRAC003500' / Campaign DCEID = 6086781 / Data-Collection-Event ID DCEINSID= 626089 / DCE Instance ID DPID = 2631728 / Data Product Instance ID PIPENUM = 107 / Pipeline Script Number SOS_VER = 2 / Data-Product Version PLVID = 4 / Pipeline Version ID CALID = 6 / CalTrans Version ID SDRKEPID= 28809 / Sky Dark ensemble product ID PMSKFBID= 341 / Pixel mask ID LINCFBID= 357 / Fall-back Linearity correction ID FLATFBID= 718 / Fall-back flat ID FLXCFBID= 349 / Flux conversion ID MBLTFBID= 696 / Muxbleed Lookup Table ID MBCFFBID= 704 / Muxbleed Coefficients ID / PROCESSING HISTORY HISTORY job.c ver: 1.000000 HISTORY TRANHEAD v. 11.9, ran Tue Dec 16 16:52:35 2003 HISTORY CALTRANS v. 2.7, ran Tue Dec 16 16:52:44 2003 HISTORY cvti2r4 v. 1.25 A30501, generated 12/16/03 at 16:52:44 HISTORY FFCORR v. 1.000, ran Tue Dec 16 16:52:46 2003 HISTORY MUXBLEEDCORR v. 1.600, ran Tue Dec 16 16:52:50 2003 HISTORY FOWLINEARIZE v. 4.800000, ran Tue Dec 16 16:52:50 2003 HISTORY DARKSUBNG v. 1.000, ran Tue Dec 16 16:52:51 2003 HISTORY DARKDRIFT v. 3.5, ran Tue Dec 16 16:52:52 2003 HISTORY FLATAP v. 1.300 Tue Dec 16 16:52:53 2003 HISTORY DNTOFLUX v. 3.7, ran Tue Dec 16 16:52:57 2003 HISTORY PREDICTSAT v. 3.500000, ran Tue Dec 16 16:57:59 2003 HISTORY CALTRANS v. 2.7, ran Tue Dec 16 17:07:31 2003 HISTORY PTNTRAN v. 1.2, ran Tue Dec 16 17:07:32 2003 HISTORY FPGen v. 1.22, ran Tue Dec 16 17:07:33 2003 HISTORY CALTRANS v. 2.7, ran Wed Dec 17 06:14:18 2003 SOFTWARE= 'pointingrefine' / Pointing refinement using pnt-src correlation PTGVERSN= 5.3 / Version number of pointingrefine program RARFND = 6.15526023786181 / [deg] Refined RA DECRFND = -2.07244250543341 / [deg] Refined DEC CT2RFND = -64.5569826743286 / [deg] Refined CROTA2 PA_RFND = 64.5569826743286 / [deg] Refined PA (= -CROTA2_refined) ERARFND = 0.000535377007940228 / [deg] Error in refined RA EDECRFND= 0.00123072014833503 / [deg] Error in refined DEC EPA_RFND= 2.28015678741471 / [deg] Error in refined PA or CROTA2 NASTROM = 6 / # Astrometric sources for absolute refinement RARESID = -0.887761029918005 / [arcsec] Residual: Observed-Refined RA DECRESID= 0.484259558515454 / [arcsec] Residual: Observed-Refined DEC PA_RESID= -1391.7828122373 / [arcsec] Residual: Observed-Refined PA CD11RFND= -0.000145881550132727 / [deg/pix] Refined CD matrix element 1_1 CD12RFND= 0.000306140372692502 / [deg/pix] Refined CD matrix element 1_2 CD21RFND= 0.00030609131452955 / [deg/pix] Refined CD matrix element 2_1 CD22RFND= 0.000145647908967425 / [deg/pix] Refined CD matrix element 2_2 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/j94f05bgq_flt.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/j94f05bgq_flt.fits new file mode 100644 index 0000000000000000000000000000000000000000..502a5b3643df89685a6945cba9b450b3dc2b8367 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/j94f05bgq_flt.fits @@ -0,0 +1 @@ +SIMPLE = T / Fits standard BITPIX = 16 / Bits per pixel NAXIS = 0 / Number of axes EXTEND = T / File may contain extensions ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator IRAF-TLM= '10:43:32 (18/12/2008)' / Time of last modification NEXTEND = 6 / Number of standard extensions DATE = '2007-02-08T21:38:46' / date this file was written (yyyy-mm-dd) FILENAME= 'j94f05bgq_flt.fits' / name of file FILETYPE= 'SCI ' / type of data found in data file TELESCOP= 'HST' / telescope used to acquire data INSTRUME= 'ACS ' / identifier for instrument used to acquire data EQUINOX = 2000.0 / equinox of celestial coord. system / DATA DESCRIPTION KEYWORDS ROOTNAME= 'j94f05bgq ' / rootname of the observation setIMAGETYP= 'EXT ' / type of exposure identifier PRIMESI = 'ACS ' / instrument designated as prime / TARGET INFORMATION TARGNAME= 'NGC104 ' / proposer's target name RA_TARG = 5.655000000000E+00 / right ascension of the target (deg) (J2000) DEC_TARG= -7.207055555556E+01 / declination of the target (deg) (J2000) / PROPOSAL INFORMATION PROPOSID= 10368 / PEP proposal identifier LINENUM = '05.004 ' / proposal logsheet line number PR_INV_L= 'Riess ' / last name of principal investigatorPR_INV_F= 'Adam ' / first name of principal investigator PR_INV_M= ' ' / middle name / initial of principal investigat / EXPOSURE INFORMATION SUNANGLE= 67.819656 / angle between sun and V1 axis MOONANGL= 57.400970 / angle between moon and V1 axis SUN_ALT = -5.746915 / altitude of the sun above Earth's limb FGSLOCK = 'FINE ' / commanded FGS lock (FINE,COARSE,GYROS,UNKNOWN) GYROMODE= '3' / observation scheduled with only two gyros (Y/N)REFFRAME= 'GSC1 ' / guide star catalog version DATE-OBS= '2005-03-07' / UT date of start of observation (yyyy-mm-dd) TIME-OBS= '06:51:26' / UT time of start of observation (hh:mm:ss) EXPSTART= 5.343628571938E+04 / exposure start time (Modified Julian Date) EXPEND = 5.343629036114E+04 / exposure end time (Modified Julian Date) EXPTIME = 400.000000 / exposure duration (seconds)--calculated EXPFLAG = 'NORMAL ' / Exposure interruption indicator QUALCOM1= ' 'QUALCOM2= ' 'QUALCOM3= ' 'QUALITY = ' ' / POINTING INFORMATION PA_V3 = 337.125305 / position angle of V3-axis of HST (deg) / TARGET OFFSETS (POSTARGS) POSTARG1= 0.000000 / POSTARG in axis 1 direction POSTARG2= 0.000000 / POSTARG in axis 2 direction / DIAGNOSTIC KEYWORDS OPUS_VER= 'OPUS 2006_6 ' / OPUS software system version number CAL_VER = '4.6.1 (13-Mar-2006)' / CALACS code version PROCTIME= 5.413989813657E+04 / Pipeline processing time (MJD) / SCIENCE INSTRUMENT CONFIGURATION OBSTYPE = 'IMAGING ' / observation type - imaging or spectroscopic OBSMODE = 'ACCUM ' / operating mode CTEIMAGE= 'NONE' / type of Charge Transfer Image, if applicable SCLAMP = 'NONE ' / lamp status, NONE or name of lamp which is on NRPTEXP = 1 / number of repeat exposures in set: default 1 SUBARRAY= F / data from a subarray (T) or full frame (F) DETECTOR= 'WFC' / detector in use: WFC, HRC, or SBC FILTER1 = 'F606W ' / element selected from filter wheel 1 FILTER2 = 'CLEAR2L ' / element selected from filter wheel 2 FWOFFSET= 0 / computed filter wheel offset FWERROR = F / filter wheel position error flag LRFWAVE = 0.000000 / proposed linear ramp filter wavelength APERTURE= 'WFC ' / aperture name PROPAPER= 'WFC ' / proposed aperture name DIRIMAGE= 'NONE ' / direct image for grism or prism exposure CTEDIR = 'NONE ' / CTE measurement direction: serial or parallel CRSPLIT = 1 / number of cosmic ray split exposures / CALIBRATION SWITCHES: PERFORM, OMIT, COMPLETE STATFLAG= F / Calculate statistics? WRTERR = T / write out error array extension DQICORR = 'COMPLETE' / data quality initialization ATODCORR= 'OMIT ' / correct for A to D conversion errors BLEVCORR= 'COMPLETE' / subtract bias level computed from overscan img BIASCORR= 'COMPLETE' / Subtract bias image FLSHCORR= 'OMIT ' / post flash correction CRCORR = 'OMIT ' / combine observations to reject cosmic rays EXPSCORR= 'COMPLETE' / process individual observations after cr-rejectSHADCORR= 'OMIT ' / apply shutter shading correction DARKCORR= 'COMPLETE' / Subtract dark image FLATCORR= 'COMPLETE' / flat field data PHOTCORR= 'COMPLETE' / populate photometric header keywords RPTCORR = 'OMIT ' / add individual repeat observations DRIZCORR= 'COMPLETE' / drizzle processing / CALIBRATION REFERENCE FILES BPIXTAB = 'jref$q860440tj_bpx.fits' / bad pixel table CCDTAB = 'jref$o151506fj_ccd.fits' / CCD calibration parameters ATODTAB = 'jref$kcb1734hj_a2d.fits' / analog to digital correction file OSCNTAB = 'jref$lch1459bj_osc.fits' / CCD overscan table BIASFILE= 'jref$p3v2228mj_bia.fits' / bias image file name FLSHFILE= 'jref$nad14594j_fls.fits' / post flash correction file name CRREJTAB= 'jref$n4e12511j_crr.fits' / cosmic ray rejection parameters SHADFILE= 'jref$kcb17349j_shd.fits' / shutter shading correction file DARKFILE= 'jref$p3v2228qj_drk.fits' / dark image file name PFLTFILE= 'jref$nar1136nj_pfl.fits' / pixel to pixel flat field file name DFLTFILE= 'N/A ' / delta flat field file name LFLTFILE= 'N/A ' / low order flat PHOTTAB = 'N/A ' / Photometric throughput table GRAPHTAB= 'mtab$r1m18595m_tmg.fits' / the HST graph table COMPTAB = 'mtab$r1j2146sm_tmc.fits' / the HST components table IDCTAB = 'jref$qbu1641sj_idc.fits' / image distortion correction table DGEOFILE= 'jref$qbu16424j_dxy.fits' / Distortion correction image MDRIZTAB= 'jref$p3p16511j_mdz.fits' / MultiDrizzle parameter table CFLTFILE= 'N/A ' / Coronagraphic spot image SPOTTAB = 'N/A ' / Coronagraphic spot offset table / COSMIC RAY REJECTION ALGORITHM PARAMETERS MEANEXP = 0.000000 / reference exposure time for parameters SCALENSE= 0.000000 / multiplicative scale factor applied to noise INITGUES= ' ' / initial guess method (MIN or MED) SKYSUB = ' ' / sky value subtracted (MODE or NONE) SKYSUM = 0.0 / sky level from the sum of all constituent imageCRSIGMAS= ' ' / statistical rejection criteria CRRADIUS= 0.000000 / rejection propagation radius (pixels) CRTHRESH= 0.000000 / rejection propagation threshold BADINPDQ= 0 / data quality flag bits to reject REJ_RATE= 0.0 / rate at which pixels are affected by cosmic rayCRMASK = F / flag CR-rejected pixels in input files (T/F) MDRIZSKY= 115.9195664624303 / Sky value computed by MultiDrizzle / OTFR KEYWORDS T_SGSTAR= ' ' / OMS calculated guide star control / PATTERN KEYWORDS PATTERN1= 'NONE ' / primary pattern type P1_SHAPE= ' ' / primary pattern shape P1_PURPS= ' ' / primary pattern purpose P1_NPTS = 0 / number of points in primary pattern P1_PSPAC= 0.000000 / point spacing for primary pattern (arc-sec) P1_LSPAC= 0.000000 / line spacing for primary pattern (arc-sec) P1_ANGLE= 0.000000 / angle between sides of parallelogram patt (deg)P1_FRAME= ' ' / coordinate frame of primary pattern P1_ORINT= 0.000000 / orientation of pattern to coordinate frame (degP1_CENTR= ' ' / center pattern relative to pointing (yes/no) PATTSTEP= 0 / position number of this point in the pattern / POST FLASH PARAMETERS FLASHDUR= 1.0 / Exposure time in seconds: 0.1 to 409.5 FLASHCUR= 'MED ' / Post flash current: OFF, LOW, MED, HIGH FLASHSTA= 'SUCCESSFUL ' / Status: SUCCESSFUL, ABORTED, NOT PERFORMED SHUTRPOS= 'B ' / Shutter position: A or B / ENGINEERING PARAMETERS CCDAMP = 'ABCD' / CCD Amplifier Readout Configuration CCDGAIN = 1 / commanded gain of CCD CCDOFSTA= 3 / commanded CCD bias offset for amplifier A CCDOFSTB= 3 / commanded CCD bias offset for amplifier B CCDOFSTC= 3 / commanded CCD bias offset for amplifier C CCDOFSTD= 3 / commanded CCD bias offset for amplifier D / CALIBRATED ENGINEERING PARAMETERS ATODGNA = 9.9989998E-01 / calibrated gain for amplifier A ATODGNB = 9.7210002E-01 / calibrated gain for amplifier B ATODGNC = 1.0107000E+00 / calibrated gain for amplifier C ATODGND = 1.0180000E+00 / calibrated gain for amplifier D READNSEA= 4.9699998E+00 / calibrated read noise for amplifier A READNSEB= 4.8499999E+00 / calibrated read noise for amplifier B READNSEC= 5.2399998E+00 / calibrated read noise for amplifier C READNSED= 4.8499999E+00 / calibrated read noise for amplifier D BIASLEVA= 2.4281760E+03 / bias level for amplifier A BIASLEVB= 2.5189324E+03 / bias level for amplifier B BIASLEVC= 2.4417756E+03 / bias level for amplifier C BIASLEVD= 2.4699448E+03 / bias level for amplifier D / ASSOCIATION KEYWORDS ASN_ID = 'NONE ' / unique identifier assigned to association ASN_TAB = 'NONE ' / name of the association table ASN_MTYP= ' ' / Role of the Member in the Association UPWCSVER= '1.1.3.dev30781' / Version of STWCS used to updated the WCS PYWCSVER= '1.12.1.dev3982' / Version of PYWCS used to updated the WCS HISTORY CCD parameters table: HISTORY reference table jref$o151506fj_ccd.fits HISTORY inflight HISTORY June 2002 HISTORY Uncertainty array initialized. HISTORY DQICORR complete ... HISTORY values checked for saturation HISTORY DQ array initialized ... HISTORY reference table jref$q860440tj_bpx.fits HISTORY BLEVCORR complete; bias level from overscan was subtracted. HISTORY BLEVCORR does not include correction for drift along lines. HISTORY Overscan region table: HISTORY reference table jref$lch1459bj_osc.fits HISTORY BIASCORR complete ... HISTORY reference image jref$p3v2228mj_bia.fits HISTORY INFLIGHT 05/03/2005 23/03/2005 HISTORY Superbias by Ray Lucas from proposal 10367 or 10370 HISTORY CCD parameters table: HISTORY reference table jref$o151506fj_ccd.fits HISTORY inflight HISTORY June 2002 HISTORY DARKCORR complete ... HISTORY reference image jref$p3v2228qj_drk.fits HISTORY INFLIGHT 05/03/2005 23/03/2005 HISTORY Superdark by Ray Lucas from proposal 10367 or 10370 HISTORY FLATCORR complete ... HISTORY reference image jref$nar1136nj_pfl.fits HISTORY InFlight 18/04/2002 - 09/05/2002 HISTORY F606W step +1 flat w/ mote shifted to -1 step HISTORY PHOTCORR complete ... HISTORY reference table mtab$r1m18595m_tmg.fits HISTORY reference table mtab$r1j2146sm_tmc.fits HISTORY EXPSCORR complete ... TDDCORR = 'PERFORM ' WFCTDD = 'T ' DISTNAME= 'j94f05bgq_qbu1641sj-NOMODEL-NOMODEL' SIPNAME = 'j94f05bgq_qbu1641sj' END XTENSION= 'IMAGE ' / Image extension BITPIX = -32 / Bits per pixel NAXIS = 2 / Number of axes NAXIS1 = 1 / Axis length NAXIS2 = 1 / Axis length PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'SCI ' / Extension name EXTVER = 1 / Extension version DATE = '2007-02-08T21:38:47' / Date FITS file was generated IRAF-TLM= '13:38:23 (20/08/2008)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'ELECTRONS' / brightness units / WFC CCD CHIP IDENTIFICATION CCDCHIP = 2 / CCD chip (1 or 2) / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048.0 / x-coordinate of reference pixel CRPIX2 = 1024.0 / y-coordinate of reference pixel CRVAL1 = 5.63056810618 / first axis value at reference pixel CRVAL2 = -72.05457184278998 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.29056256197165E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.95309123310338E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 5.0220581265601E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.2644774105568E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.7891975615892 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor / READOUT DEFINITION PARAMETERS CENTERA1= 2073 / subarray axis1 center pt in unbinned dect. pix CENTERA2= 1035 / subarray axis2 center pt in unbinned dect. pix SIZAXIS1= 4096 / subarray axis1 size in unbinned detector pixelsSIZAXIS2= 2048 / subarray axis2 size in unbinned detector pixelsBINAXIS1= 1 / axis1 data bin size in unbinned detector pixelsBINAXIS2= 1 / axis2 data bin size in unbinned detector pixels / PHOTOMETRY KEYWORDS PHOTMODE= 'ACS WFC1 F606W' / observation con PHOTFLAM= 7.9064521E-20 / inverse sensitivity, ergs/cm2/Ang/electron PHOTZPT = -2.1100000E+01 / ST magnitude zero point PHOTPLAM= 5.9176797E+03 / Pivot wavelength (Angstroms) PHOTBW = 6.7231146E+02 / RMS bandwidth of filter plus detector / REPEATED EXPOSURES INFO NCOMBINE= 1 / number of image sets combined during CR rejecti / DATA PACKET INFORMATION FILLCNT = 0 / number of segments containing fill ERRCNT = 0 / number of segments containing errors PODPSFF = F / podps fill present (T/F) STDCFFF = F / ST DDF fill present (T/F) STDCFFP = 'x5569 ' / ST DDF fill pattern (hex) / ON-BOARD COMPRESSION INFORMATION WFCMPRSD= F / was WFC data compressed? (T/F) CBLKSIZ = 0 / size of compression block in 2-byte words LOSTPIX = 0 / #pixels lost due to buffer overflow COMPTYP = 'None ' / compression type performed (Partial/Full/None) / IMAGE STATISTICS AND DATA QUALITY FLAGS NGOODPIX= 7822781 / number of good pixels SDQFLAGS= 31743 / serious data quality flags GOODMIN = -2.5959351E+02 / minimum value of good pixels GOODMAX = 6.5220551E+04 / maximum value of good pixels GOODMEAN= 2.0491536E+02 / mean value of good pixels SOFTERRS= 0 / number of soft error pixels (DQF=1) SNRMIN = -8.0327058E-01 / minimum signal to noise of good pixels SNRMAX = 2.1379723E+02 / maximum signal to noise of good pixels SNRMEAN = 1.0889255E+01 / mean value of signal to noise of good pixels MEANDARK= 1.5474443E+00 / average of the dark values subtracted MEANBLEV= 2.4558604E+03 / average of all bias levels subtracted MEANFLSH= 0.000000 / Mean number of counts in post flash exposure OCRVAL1 = 5.63056810618 / first axis value at reference pixel OCRVAL2 = -72.05457184279 / second axis value at reference pixel OCRPIX2 = 1024.0 / y-coordinate of reference pixel OCRPIX1 = 2048.0 / x-coordinate of reference pixel ONAXIS2 = 2048 / Axis length ONAXIS1 = 4096 / Axis length OCD2_2 = -1.26445E-05 / partial of second axis coordinate w.r.t. y OCD2_1 = 5.02243E-06 / partial of second axis coordinate w.r.t. x OORIENTA= 154.7886863186197 / position angle of image y axis (deg. e of n) OCTYPE1 = 'RA---TAN' / the coordinate type for the first axis OCD1_1 = 1.29046E-05 / partial of first axis coordinate w.r.t. x OCD1_2 = 5.9531E-06 / partial of first axis coordinate w.r.t. y OCTYPE2 = 'DEC--TAN' / the coordinate type for the second axis WCSCDATE= '21:39:44 (08/02/2007)' / Time WCS keywords were copied. A_0_2 = 2.16615952976212E-06 B_0_2 = -7.2168814507744E-06 A_1_1 = -5.1974576466834E-06 B_1_1 = 6.18443235774478E-06 A_2_0 = 8.551277582556502E-06 B_2_0 = -1.7464918770586E-06 A_0_3 = 1.08193519820265E-11 B_0_3 = -4.1754720492749E-10 A_1_2 = -5.234870743692412E-10 B_1_2 = -6.169265268681388E-11 A_2_1 = -3.9771547747287E-11 B_2_1 = -5.085716167386211E-10 A_3_0 = -4.7304448292227E-10 B_3_0 = 8.56763542781631E-11 A_0_4 = 1.49356171166049E-14 B_0_4 = -9.9570490655478E-15 A_1_3 = -2.456997553774615E-14 B_1_3 = 1.21743011568848E-14 A_2_2 = 3.46791267104378E-14 B_2_2 = -3.6614325928657E-14 A_3_1 = 1.971022971660309E-15 B_3_1 = -3.7795068054874E-15 A_4_0 = 2.37430106240231E-14 B_4_0 = -1.7687653826004E-14 A_ORDER = 4 B_ORDER = 4 HISTORY The following throughput tables were used: crotacomp$hst_ota_007_syn.fitHISTORY s, cracscomp$acs_wfc_im123_004_syn.fits, cracscomp$acs_f606w_005_syn.fitHISTORY s, cracscomp$acs_wfc_ebe_win12f_005_syn.fits, cracscomp$acs_wfc_ccd1_017HISTORY _syn.fits TDDALPHA= 0.1195051334702275 TDDBETA = -0.03716837782340918 IDCSCALE= 0.05 IDCV2REF= 256.6222229003906 IDCV3REF= 302.2264099121094 IDCTHETA= 0.0 OCX10 = 0.001961771095643072 OCX11 = 0.0498307741748614 OCY10 = 0.05027452911198226 OCY11 = 0.001490550115269471 SORIENTA= 154.7925383197021 / position angle of image y axis (deg. e of n) SCRVAL1 = 5.63056810618 / first axis value at reference pixel SNAXIS2 = 2048 / Axis length SNAXIS1 = 4096 / Axis length SCRVAL2 = -72.05457184279 / second axis value at reference pixel SCTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis SCTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis SCD2_2 = -1.264489181627715E-05 / partial of second axis coordinate w.r.t. y SCD2_1 = 5.022886862247075E-06 / partial of second axis coordinate w.r.t. x SCD1_2 = 5.952245949610081E-06 / partial of first axis coordinate w.r.t. y SCRPIX2 = 1024.0 / y-coordinate of reference pixel SCRPIX1 = 2048.0 / x-coordinate of reference pixel SCD1_1 = 1.290545120875315E-05 / partial of first axis coordinate w.r.t. x IDCXREF = 2048.0 IDCYREF = 1024.0 WCSNAMEO= 'OPUS ' WCSAXESO= 2 CRPIX1O = 2048 CRPIX2O = 1024 CDELT1O = 1 CDELT2O = 1 CUNIT1O = 'deg ' CUNIT2O = 'deg ' CTYPE1O = 'RA---TAN-SIP' CTYPE2O = 'DEC--TAN-SIP' CRVAL1O = 5.63056810618 CRVAL2O = -72.0545718428 LONPOLEO= 180 LATPOLEO= -72.0545718428 RESTFRQO= 0 RESTWAVO= 0 CD1_1O = 1.29056256334E-05 CD1_2O = 5.9530912342E-06 CD2_1O = 5.02205812656E-06 CD2_2O = -1.26447741482E-05 IDCTAB = 'jref$qbu1641sj_idc.fits' WCSNAME = 'IDC_qbu1641sj' END XTENSION= 'IMAGE ' / Image extension BITPIX = -32 / Bits per pixel NAXIS = 0 / Number of axes PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'ERR ' / Extension name EXTVER = 1 / Extension version DATE = '2007-02-08T21:38:48' / Date FITS file was generated IRAF-TLM= '13:38:31 (20/08/2008)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'ELECTRONS' / brightness units / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048 / x-coordinate of reference pixel CRPIX2 = 1024 / y-coordinate of reference pixel CRVAL1 = 5.63056810618 / first axis value at reference pixel CRVAL2 = -72.0545718428 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.29056256197E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.9530912331E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 5.02205812656E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.26447741056E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.789 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor / IMAGE STATISTICS AND DATA QUALITY FLAGS NGOODPIX= 7822781 / number of good pixels SDQFLAGS= 31743 / serious data quality flags GOODMIN = 5.0154119E+00 / minimum value of good pixels GOODMAX = 4.6192120E+02 / maximum value of good pixels GOODMEAN= 1.3078087E+01 / mean value of good pixels TDDBETA = 0. TDDALPHA= 0. CDELT1 = 1 CDELT2 = 1 CUNIT1 = 'deg ' CUNIT2 = 'deg ' LONPOLE = 180 LATPOLE = -72.0545718428 RESTFRQ = 0 RESTWAV = 0 WCSNAME = 'IDC_qbu1641sj' END XTENSION= 'IMAGE ' / Image extension BITPIX = 16 / Bits per pixel NAXIS = 0 / Number of axes PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'DQ ' / Extension name EXTVER = 1 / Extension version DATE = '2007-02-08T21:38:48' / Date FITS file was generated IRAF-TLM= '21:38:48 (08/02/2007)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'UNITLESS ' / brightness units / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048 / x-coordinate of reference pixel CRPIX2 = 1024 / y-coordinate of reference pixel CRVAL1 = 5.63056810618 / first axis value at reference pixel CRVAL2 = -72.0545718428 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.29056256197E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.9530912331E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 5.02205812656E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.26447741056E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.789 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor CDELT1 = 1 CDELT2 = 1 CUNIT1 = 'deg ' CUNIT2 = 'deg ' LONPOLE = 180 LATPOLE = -72.0545718428 RESTFRQ = 0 RESTWAV = 0 WCSNAME = 'IDC_qbu1641sj' END XTENSION= 'IMAGE ' / Image extension BITPIX = -32 / Bits per pixel NAXIS = 2 / Number of axes NAXIS1 = 1 / Axis length NAXIS2 = 1 / Axis length PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'SCI ' / Extension name EXTVER = 2 / Extension version DATE = '2007-02-08T21:39:08' / Date FITS file was generated IRAF-TLM= '21:39:07 (08/02/2007)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'ELECTRONS' / brightness units / WFC CCD CHIP IDENTIFICATION CCDCHIP = 1 / CCD chip (1 or 2) / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048.0 / x-coordinate of reference pixel CRPIX2 = 1024.0 / y-coordinate of reference pixel CRVAL1 = 5.670733269328501 / first axis value at reference pixel CRVAL2 = -72.08067552067514 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.28168672384053E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.85585924019860E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 4.80078206009106E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.2175120783707E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.3138744206447 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor / READOUT DEFINITION PARAMETERS CENTERA1= 2073 / subarray axis1 center pt in unbinned dect. pix CENTERA2= 1035 / subarray axis2 center pt in unbinned dect. pix SIZAXIS1= 4096 / subarray axis1 size in unbinned detector pixelsSIZAXIS2= 2048 / subarray axis2 size in unbinned detector pixelsBINAXIS1= 1 / axis1 data bin size in unbinned detector pixelsBINAXIS2= 1 / axis2 data bin size in unbinned detector pixels / PHOTOMETRY KEYWORDS PHOTMODE= 'ACS WFC1 F606W' / observation con PHOTFLAM= 7.9064521E-20 / inverse sensitivity, ergs/cm2/Ang/electron PHOTZPT = -2.1100000E+01 / ST magnitude zero point PHOTPLAM= 5.9176797E+03 / Pivot wavelength (Angstroms) PHOTBW = 6.7231146E+02 / RMS bandwidth of filter plus detector / REPEATED EXPOSURES INFO NCOMBINE= 1 / number of image sets combined during CR rejecti / DATA PACKET INFORMATION FILLCNT = 0 / number of segments containing fill ERRCNT = 0 / number of segments containing errors PODPSFF = F / podps fill present (T/F) STDCFFF = F / ST DDF fill present (T/F) STDCFFP = '0x5569' / ST DDF fill pattern (hex) / ON-BOARD COMPRESSION INFORMATION WFCMPRSD= F / was WFC data compressed? (T/F) CBLKSIZ = 0 / size of compression block in 2-byte words LOSTPIX = 0 / #pixels lost due to buffer overflow COMPTYP = 'None ' / compression type performed (Partial/Full/None) / IMAGE STATISTICS AND DATA QUALITY FLAGS NGOODPIX= 7842694 / number of good pixels SDQFLAGS= 31743 / serious data quality flags GOODMIN = -7.0795517E+01 / minimum value of good pixels GOODMAX = 6.9170820E+04 / maximum value of good pixels GOODMEAN= 2.3160507E+02 / mean value of good pixels SOFTERRS= 0 / number of soft error pixels (DQF=1) SNRMIN = -2.9959621E+00 / minimum signal to noise of good pixels SNRMAX = 2.1083392E+02 / maximum signal to noise of good pixels SNRMEAN = 1.1493363E+01 / mean value of signal to noise of good pixels MEANDARK= 1.7685415E+00 / average of the dark values subtracted MEANBLEV= 2.4735542E+03 / average of all bias levels subtracted MEANFLSH= 0.000000 / Mean number of counts in post flash exposure OCRVAL1 = 5.670732627827 / first axis value at reference pixel OCRVAL2 = -72.08067512165999 / second axis value at reference pixel OCRPIX2 = 1024.0 / y-coordinate of reference pixel OCRPIX1 = 2048.0 / x-coordinate of reference pixel ONAXIS2 = 2048 / Axis length ONAXIS1 = 4096 / Axis length OCD2_2 = -1.21751E-05 / partial of second axis coordinate w.r.t. y OCD2_1 = 4.80165E-06 / partial of second axis coordinate w.r.t. x OORIENTA= 154.3148269477964 / position angle of image y axis (deg. e of n) OCTYPE1 = 'RA---TAN' / the coordinate type for the first axis OCD1_1 = 1.28162E-05 / partial of first axis coordinate w.r.t. x OCD1_2 = 5.8556E-06 / partial of first axis coordinate w.r.t. y OCTYPE2 = 'DEC--TAN' / the coordinate type for the second axis WCSCDATE= '21:40:01 (08/02/2007)' / Time WCS keywords were copied. A_0_2 = 2.261941311576225E-06 B_0_2 = -9.798580190744584E-06 A_1_1 = -7.5302899956868E-06 B_1_1 = 6.42569978230108E-06 A_2_0 = 8.518868718265025E-06 B_2_0 = -2.965892204849563E-06 A_0_3 = 6.510508887319651E-11 B_0_3 = -4.14215027648948E-10 A_1_2 = -5.253920848284526E-10 B_1_2 = -3.0354268445463E-11 A_2_1 = -1.0714005144979E-10 B_2_1 = -4.4034920544682E-10 A_3_0 = -4.693635321207041E-10 B_3_0 = 9.00334226345491E-11 A_0_4 = 1.35191450637820E-13 B_0_4 = -1.5248976030166E-13 A_1_3 = -1.4269338934146E-14 B_1_3 = 2.75911359120267E-14 A_2_2 = 9.70199525902786E-14 B_2_2 = -1.0403608182763E-13 A_3_1 = 3.800597894287968E-14 B_3_1 = -3.8363936250847E-14 A_4_0 = 1.836278740012908E-14 B_4_0 = -1.6913942401142E-14 A_ORDER = 4 B_ORDER = 4 IDCSCALE= 0.05 IDCV2REF= 260.8870544433594 IDCV3REF= 198.3322296142578 IDCTHETA= 0.0 OCX10 = 0.002267080585457191 OCX11 = 0.0492242502262243 OCY10 = 0.04858284026784934 OCY11 = 0.002132039303452174 TDDALPHA= 0.1195051334702275 TDDBETA = -0.03716837782340918 SORIENTA= 154.3172042452752 / position angle of image y axis (deg. e of n) SCRVAL1 = 5.670727606678185 / first axis value at reference pixel SNAXIS2 = 2048 / Axis length SNAXIS1 = 4096 / Axis length SCRVAL2 = -72.08067576427173 / second axis value at reference pixel SCTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis SCTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis SCD2_2 = -1.217522934245482E-05 / partial of second axis coordinate w.r.t. y SCD2_1 = 4.801597437325027E-06 / partial of second axis coordinate w.r.t. x SCD1_2 = 5.855040197035933E-06 / partial of first axis coordinate w.r.t. y SCRPIX2 = 1024.0 / y-coordinate of reference pixel SCRPIX1 = 2048.0 / x-coordinate of reference pixel SCD1_1 = 1.281668382601152E-05 / partial of first axis coordinate w.r.t. x WCSNAMEO= 'OPUS ' WCSAXESO= 2 CRPIX1O = 2048 CRPIX2O = 1024 CDELT1O = 1 CDELT2O = 1 CUNIT1O = 'deg ' CUNIT2O = 'deg ' CTYPE1O = 'RA---TAN-SIP' CTYPE2O = 'DEC--TAN-SIP' CRVAL1O = 5.67073326894 CRVAL2O = -72.0806755207 LONPOLEO= 180 LATPOLEO= -72.0806755207 RESTFRQO= 0 RESTWAVO= 0 CD1_1O = 1.28168672365E-05 CD1_2O = 5.8558592186E-06 CD2_1O = 4.80078206009E-06 CD2_2O = -1.21751207695E-05 IDCXREF = 2048.0 IDCYREF = 1024.0 IDCTAB = 'jref$qbu1641sj_idc.fits' WCSNAME = 'IDC_qbu1641sj' HISTORY The following throughput tables were used: crotacomp$hst_ota_007_syn.fitHISTORY s, cracscomp$acs_wfc_im123_004_syn.fits, cracscomp$acs_f606w_005_syn.fitHISTORY s, cracscomp$acs_wfc_ebe_win12f_005_syn.fits, cracscomp$acs_wfc_ccd1_017HISTORY _syn.fits END XTENSION= 'IMAGE ' / Image extension BITPIX = -32 / Bits per pixel NAXIS = 0 / Number of axes PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'ERR ' / Extension name EXTVER = 2 / Extension version DATE = '2007-02-08T21:39:09' / Date FITS file was generated IRAF-TLM= '21:39:08 (08/02/2007)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'ELECTRONS' / brightness units / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048 / x-coordinate of reference pixel CRPIX2 = 1024 / y-coordinate of reference pixel CRVAL1 = 5.67073326933 / first axis value at reference pixel CRVAL2 = -72.0806755207 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.28168672384E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.8558592402E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 4.80078206009E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.21751207837E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.315 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor / IMAGE STATISTICS AND DATA QUALITY FLAGS NGOODPIX= 7842694 / number of good pixels SDQFLAGS= 31743 / serious data quality flags GOODMIN = 4.8147907E+00 / minimum value of good pixels GOODMAX = 6.5271405E+02 / maximum value of good pixels GOODMEAN= 1.3935461E+01 / mean value of good pixels CDELT1 = 1 CDELT2 = 1 CUNIT1 = 'deg ' CUNIT2 = 'deg ' LONPOLE = 180 LATPOLE = -72.0806755207 RESTFRQ = 0 RESTWAV = 0 WCSNAME = 'IDC_qbu1641sj' END XTENSION= 'IMAGE ' / Image extension BITPIX = 16 / Bits per pixel NAXIS = 0 / Number of axes PCOUNT = 0 / No 'random' parameters GCOUNT = 1 / Only one group ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'DQ ' / Extension name EXTVER = 2 / Extension version DATE = '2007-02-08T21:39:09' / Date FITS file was generated IRAF-TLM= '21:39:09 (08/02/2007)' / Time of last modification INHERIT = T / inherit the primary header EXPNAME = 'j94f05bgq ' / exposure identifier BUNIT = 'UNITLESS ' / brightness units / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048 / x-coordinate of reference pixel CRPIX2 = 1024 / y-coordinate of reference pixel CRVAL1 = 5.67073326933 / first axis value at reference pixel CRVAL2 = -72.0806755207 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 1.28168672384E-05 / partial of first axis coordinate w.r.t. x CD1_2 = 5.8558592402E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 4.80078206009E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -1.21751207837E-05 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y ORIENTAT= 154.315 / position angle of image y axis (deg. e of n) RA_APER = 5.655000000000E+00 / RA of aperture reference position DEC_APER= -7.207055555556E+01 / Declination of aperture reference position PA_APER = 154.533 / Position Angle of reference aperture center (deVAFACTOR= 1.000018683511E+00 / velocity aberration plate scale factor CDELT1 = 1 CDELT2 = 1 CUNIT1 = 'deg ' CUNIT2 = 'deg ' LONPOLE = 180 LATPOLE = -72.0806755207 RESTFRQ = 0 RESTWAV = 0 WCSNAME = 'IDC_qbu1641sj' END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/locale.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/locale.hdr new file mode 100644 index 0000000000000000000000000000000000000000..bf210f206ef182e4a628c4e7a130a2289755671e --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/locale.hdr @@ -0,0 +1 @@ +WCSAXES = 2 / Number of coordinate axes CRPIX1 = 1920.5 / Pixel coordinate of reference point CRPIX2 = 1920.5 / Pixel coordinate of reference point CDELT1 = -0.000416666666667 / [deg] Coordinate increment at reference point CDELT2 = 0.000416666666667 / [deg] Coordinate increment at reference point CUNIT1 = 'deg' / Units of coordinate increment and value CUNIT2 = 'deg' / Units of coordinate increment and value CTYPE1 = 'RA---TAN' / Right ascension, gnomonic projection CTYPE2 = 'DEC--TAN' / Declination, gnomonic projection CRVAL1 = 36.661 / [deg] Coordinate value at reference point CRVAL2 = -4.48 / [deg] Coordinate value at reference point LONPOLE = 180 / [deg] Native longitude of celestial pole LATPOLE = -4.48 / [deg] Native latitude of celestial pole RESTFRQ = 0 / [Hz] Line rest frequency RESTWAV = 0 / [Hz] Line rest wavelength EQUINOX = 2000 / [yr] Equinox of equatorial coordinates END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIR.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIR.hdr new file mode 100644 index 0000000000000000000000000000000000000000..991b62ec209761dbe0fe824a02af802b77269a4a --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIR.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---AIR' CRPIX1 = -2.347545010835E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--AIR' CRPIX2 = 8.339330824422E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_1 = 4.500000000000E+01 / Projection parameter 1 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:43:31 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_AIR.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIT.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIT.hdr new file mode 100644 index 0000000000000000000000000000000000000000..74ad39080fbf7bdc5c677110ed567c169df090fe --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AIT.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---AIT' CRPIX1 = -2.462317116277E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--AIT' CRPIX2 = 7.115850027049E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:04:34 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_AIT.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ARC.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ARC.hdr new file mode 100644 index 0000000000000000000000000000000000000000..cf18a1bc0c36a6c606406ac550659da3e535c9a0 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ARC.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---ARC' CRPIX1 = -2.469419019050E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--ARC' CRPIX2 = 5.082274450444E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:35:43 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_ARC.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AZP.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AZP.hdr new file mode 100644 index 0000000000000000000000000000000000000000..f6a11a68c7a0c4f8167cb8a1ddd0c242b3dfea6c --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_AZP.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---AZP' CRPIX1 = -2.541100848779E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--AZP' CRPIX2 = -1.134948542534E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_1 = 2.000000000000E+00 / Projection parameter 1 PV2_2 = 3.000000000000E+01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:16:54 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_AZP.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_BON.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_BON.hdr new file mode 100644 index 0000000000000000000000000000000000000000..28ef74f263b66114059a54f2dd50d1022ebdb09e --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_BON.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---BON' CRPIX1 = -2.431263982441E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--BON' CRPIX2 = -3.307412668190E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole PV2_1 = 4.500000000000E+01 / Projection parameter 1 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:17:44 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_BON.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CAR.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CAR.hdr new file mode 100644 index 0000000000000000000000000000000000000000..80ba8e95b5ea965e2a55cee166d3a0ed07f6bf0d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CAR.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---CAR' CRPIX1 = -2.482173814412E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--CAR' CRPIX2 = 7.527038199745E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:51:20 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_CAR.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CEA.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CEA.hdr new file mode 100644 index 0000000000000000000000000000000000000000..9f3ef48adac877a1fa0ae9ad8ea207bb3b9022fe --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CEA.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---CEA' CRPIX1 = -2.482173814412E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--CEA' CRPIX2 = 7.688571124876E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole PV2_1 = 1.000000000000E+00 / Projection parameter 1 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:48:41 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_CEA.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COD.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COD.hdr new file mode 100644 index 0000000000000000000000000000000000000000..5bbc5c30685baa477e04fdeb03e2ec6af9d1d050 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COD.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---COD' CRPIX1 = -2.153431714695E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--COD' CRPIX2 = 1.561302682707E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -4.500000000000E+01 / Native latitude of celestial pole PV2_1 = 4.500000000000E+01 / Projection parameter 1 PV2_2 = 2.500000000000E+01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:12:30 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_COD.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COE.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COE.hdr new file mode 100644 index 0000000000000000000000000000000000000000..e154dc22c73541ba5185d53efeecc283585b0499 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COE.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---COE' CRPIX1 = -2.230375366798E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--COE' CRPIX2 = -1.435249668783E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 4.500000000000E+01 / Native latitude of celestial pole PV2_1 = -4.500000000000E+01 / Projection parameter 1 PV2_2 = 2.500000000000E+01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:09:50 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_COE.continuum.fits". HISTORY Noise level of continuum map: 62 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COO.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COO.hdr new file mode 100644 index 0000000000000000000000000000000000000000..6e38fd956c5f85cfc2b7bf1bb498aa8105d669ee --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COO.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---COO' CRPIX1 = -2.136486051767E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--COO' CRPIX2 = 1.292640949564E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -4.500000000000E+01 / Native latitude of celestial pole PV2_1 = 4.500000000000E+01 / Projection parameter 1 PV2_2 = 2.500000000000E+01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:15:07 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_COO.continuum.fits". HISTORY Noise level of continuum map: 62 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COP.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COP.hdr new file mode 100644 index 0000000000000000000000000000000000000000..fd5cec62bab252bb142b3a0713338beddb6c13d4 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_COP.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---COP' CRPIX1 = -2.151923139086E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--COP' CRPIX2 = 1.505768272737E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -4.500000000000E+01 / Native latitude of celestial pole PV2_1 = 4.500000000000E+01 / Projection parameter 1 PV2_2 = 2.500000000000E+01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:07:13 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_COP.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CSC.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CSC.hdr new file mode 100644 index 0000000000000000000000000000000000000000..bc3c08e229c0666d71b9443afbfa3e9d0e497c27 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CSC.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---CSC' CRPIX1 = -2.686531829635E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--CSC' CRPIX2 = -7.043520126533E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:25:39 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_CSC.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CYP.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CYP.hdr new file mode 100644 index 0000000000000000000000000000000000000000..896308899a952320555ec3c0f3e8dc3f6d4efd15 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_CYP.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---CYP' CRPIX1 = -1.471055514007E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--CYP' CRPIX2 = 2.056099939277E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole PV2_1 = 1.000000000000E+00 / Projection parameter 1 PV2_2 = 7.071067811870E-01 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:46:07 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_CYP.continuum.fits". HISTORY Noise level of continuum map: 62 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_HPX.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_HPX.hdr new file mode 100644 index 0000000000000000000000000000000000000000..44b7d1ea4eb8812865ad6ce790c89942a3ee76fd --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_HPX.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 / number of data axes NAXIS1 = 192 / length of data axis 1 NAXIS2 = 192 / length of data axis 2 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H BUNIT = 'Jy/beam ' / Pixel value is flux density CTYPE1 = 'RA---HPX' CRPIX1 = -248.217381441188 CDELT1 = -0.0666666666666667 CRVAL1 = 0. CTYPE2 = 'DEC--HPX' CRPIX2 = -8.21754831338666 CDELT2 = 0.0666666666666667 CRVAL2 = -90. LONPOLE = 180. / Native longitude of celestial pole LATPOLE = 0. / Native latitude of celestial pole RADESYS = 'FK5 ' / Equatorial coordinate system EQUINOX = 2000.0 / Equinox of equatorial coordinates BMAJ = 0.24000 / Beam major axis in degrees BMIN = 0.24000 / Beam minor axis in degrees BPA = 0.0 / Beam position angle in degrees HISTORY Single-dish continuum map HISTORY Formed on Mon 2005/03/07 04:03:52 GMT by "pksgridzilla" which was HISTORY compiled on Mar 6 2005 08:00:15 (local time) within HISTORY AIPS++ version 19.986.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_HPX.continuum.fits". HISTORY Noise level of continuum map: 57 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MER.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MER.hdr new file mode 100644 index 0000000000000000000000000000000000000000..03bd7e59530a363d7bd9f661c1f1364e25550292 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MER.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---MER' CRPIX1 = -2.482173814412E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--MER' CRPIX2 = 7.364978412864E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:53:59 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_MER.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MOL.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MOL.hdr new file mode 100644 index 0000000000000000000000000000000000000000..7b5aec6d7fddaf1a7bb006392e11e9726882a7cf --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_MOL.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---MOL' CRPIX1 = -2.127655947497E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--MOL' CRPIX2 = -2.310670994515E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:01:55 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_MOL.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_NCP.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_NCP.hdr new file mode 100644 index 0000000000000000000000000000000000000000..a71d74af34134a88018c6352312b85404ebf4367 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_NCP.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---SIN' CRPIX1 = -2.371895431541E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--SIN' CRPIX2 = 7.688572009351E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_1 = 0.000000000000E+00 / Projection parameter 1 PV2_2 = -1.216796447506E-08 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:33:03 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_NCP.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PAR.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PAR.hdr new file mode 100644 index 0000000000000000000000000000000000000000..bf7868fb493963b9952485e3adc1cf76517f3251 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PAR.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---PAR' CRPIX1 = -2.465551494284E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--PAR' CRPIX2 = 3.322937769653E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:59:17 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_PAR.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PCO.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PCO.hdr new file mode 100644 index 0000000000000000000000000000000000000000..8ff5b4cbfc0ef5f02c7ad8b4717920cd8228f73f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_PCO.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---PCO' CRPIX1 = -2.462486098896E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--PCO' CRPIX2 = 3.620782775517E-01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:20:22 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_PCO.continuum.fits". HISTORY Noise level of continuum map: 62 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_QSC.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_QSC.hdr new file mode 100644 index 0000000000000000000000000000000000000000..3cc0a1321dec4c7abb5570fbd501a4e7f1cca757 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_QSC.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---QSC' CRPIX1 = -2.583408175994E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--QSC' CRPIX2 = -8.258194421088E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:28:25 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_QSC.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SFL.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SFL.hdr new file mode 100644 index 0000000000000000000000000000000000000000..a4486285cabe3423912d9013b8740c4c77a9f9f9 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SFL.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---SFL' CRPIX1 = -2.463483086237E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--SFL' CRPIX2 = 7.527038199745E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:56:37 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_SFL.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SIN.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SIN.hdr new file mode 100644 index 0000000000000000000000000000000000000000..8f20896f6c8f5a883333e0476bcf4e31ca303f42 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SIN.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---SIN' CRPIX1 = -2.371895431541E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--SIN' CRPIX2 = 7.688571124876E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_1 = 0.000000000000E+00 / Projection parameter 1 PV2_2 = 0.000000000000E+00 / Projection parameter 2 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:30:25 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_SIN.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_STG.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_STG.hdr new file mode 100644 index 0000000000000000000000000000000000000000..f0eeb702a038fdb2f0c18bedad0a41ee72c08b1a --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_STG.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---STG' CRPIX1 = -2.519459909290E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--STG' CRPIX2 = 3.744942537739E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:26:55 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_STG.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SZP.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SZP.hdr new file mode 100644 index 0000000000000000000000000000000000000000..c88530d42b7dfdec79975a4eaca6389d4c9aaf5b --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_SZP.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---SZP' CRPIX1 = -2.478656972779E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--SZP' CRPIX2 = -2.262051956373E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_1 = 2.000000000000E+00 / Projection parameter 1 PV2_2 = 1.800000000000E+02 / Projection parameter 2 PV2_3 = 6.000000000000E+01 / Projection parameter 3 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:20:19 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_SZP.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TAN.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TAN.hdr new file mode 100644 index 0000000000000000000000000000000000000000..ec436d083ce61883e3c9e1a4505bd871ccac0c3c --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TAN.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---TAN' CRPIX1 = -2.680658087122E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--TAN' CRPIX2 = -5.630437201085E-01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:23:37 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_TAN.continuum.fits". HISTORY Noise level of continuum map: 59 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TSC.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TSC.hdr new file mode 100644 index 0000000000000000000000000000000000000000..5c821f326adf6e70568dfa67838c875632afe72c --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_TSC.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---TSC' CRPIX1 = -1.897220156818E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--TSC' CRPIX2 = 2.037416464676E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = 0.000000000000E+00 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 02:23:02 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_TSC.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZEA.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZEA.hdr new file mode 100644 index 0000000000000000000000000000000000000000..4fed853723dcd90a0479ed10cf291f1f5c5d0cf0 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZEA.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---ZEA' CRPIX1 = -2.444880690361E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--ZEA' CRPIX2 = 5.738055949994E+00 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:40:52 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_ZEA.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZPN.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZPN.hdr new file mode 100644 index 0000000000000000000000000000000000000000..d377c3bcbef62dfc8c1b19ff9659fc6b0b5029f3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/maps/1904-66_ZPN.hdr @@ -0,0 +1 @@ +SIMPLE = T BITPIX = -32 / IEEE (big-endian) 32-bit floating point data NAXIS = 2 NAXIS1 = 192 NAXIS2 = 192 BUNIT = 'JY/BEAM ' CTYPE1 = 'RA---ZPN' CRPIX1 = -1.832937255632E+02 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--ZPN' CRPIX2 = 2.209211120575E+01 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_0 = 5.000000000000E-02 / Projection parameter 0 PV2_1 = 9.750000000000E-01 / Projection parameter 1 PV2_2 = -8.070000000000E-01 / Projection parameter 2 PV2_3 = 3.370000000000E-01 / Projection parameter 3 PV2_4 = -6.500000000000E-02 / Projection parameter 4 PV2_5 = 1.000000000000E-02 / Projection parameter 5 PV2_6 = 3.000000000000E-03 / Projection parameter 6 PV2_7 = -1.000000000000E-03 / Projection parameter 7 PV2_8 = 0.000000000000E+00 / Projection parameter 8 PV2_9 = 0.000000000000E+00 / Projection parameter 9 PV2_10 = 0.000000000000E+00 / Projection parameter 10 PV2_11 = 0.000000000000E+00 / Projection parameter 11 PV2_12 = 0.000000000000E+00 / Projection parameter 12 PV2_13 = 0.000000000000E+00 / Projection parameter 13 PV2_14 = 0.000000000000E+00 / Projection parameter 14 PV2_15 = 0.000000000000E+00 / Projection parameter 15 PV2_16 = 0.000000000000E+00 / Projection parameter 16 PV2_17 = 0.000000000000E+00 / Projection parameter 17 PV2_18 = 0.000000000000E+00 / Projection parameter 18 PV2_19 = 0.000000000000E+00 / Projection parameter 19 EQUINOX = 2.000000000000E+03 / Equinox of equatorial coordinates BMAJ = 2.399999936422E-01 / Beam major axis in degrees BMIN = 2.399999936422E-01 / Beam minor axis in degrees BPA = 0.000000000000E+00 / Beam position angle in degrees RESTFRQ = 1.420405750000E+09 / Line rest frequency, Hz HISTORY Parkes Multibeam continuum map HISTORY Formed on Mon 2004/02/09 01:38:20 GMT by "pksgridzilla" which was HISTORY compiled on Feb 9 2004 12:08:02 (local time) within HISTORY AIPS++ version 19.405.00 dated . HISTORY Polarization mode: A and B aggregated HISTORY Gridding parameters: HISTORY Method: WGTMED HISTORY Clip fraction: 0.000 HISTORY Tsys weighting: applied HISTORY Beam weight order: 1 HISTORY Beam FWHM: 14.4 arcmin HISTORY Beam normalization: applied HISTORY Smoothing kernel type: TOP-HAT HISTORY Kernel FWHM: 12.0 arcmin HISTORY Cutoff radius: 6.0 arcmin HISTORY Beam RSS cutoff: 0.0 HISTORY Input data sets: HISTORY 97-10-09_0356_193558-66_206a.sdfits HISTORY 97-10-12_0142_182123-66_193a.sdfits HISTORY 97-10-12_0151_182707-66_194a.sdfits HISTORY 97-10-12_0200_183252-66_195a.sdfits HISTORY 97-11-07_0510_183836-66_196a.sdfits HISTORY 97-11-07_0519_184420-66_197a.sdfits HISTORY 97-11-07_0528_185004-66_198a.sdfits HISTORY 97-11-07_0537_185548-66_199a.sdfits HISTORY 97-11-07_0546_190132-66_200a.sdfits HISTORY 97-11-07_0556_190717-66_201a.sdfits HISTORY 97-11-07_0645_191301-66_202a.sdfits HISTORY 97-11-07_0654_191845-66_203a.sdfits HISTORY 97-11-07_0703_192429-66_204a.sdfits HISTORY 97-11-07_0712_193013-66_205a.sdfits HISTORY 97-11-07_0724_194142-66_207a.sdfits HISTORY 97-11-18_0256_193815-66_206c.sdfits HISTORY 97-11-18_0306_194359-66_207c.sdfits HISTORY 97-11-19_0447_182341-66_193c.sdfits HISTORY 97-11-19_0456_182925-66_194c.sdfits HISTORY 97-11-19_0507_190350-66_200c.sdfits HISTORY 97-11-19_0516_190934-66_201c.sdfits HISTORY 97-11-19_0525_191519-66_202c.sdfits HISTORY 97-11-19_0534_192103-66_203c.sdfits HISTORY 97-11-19_0544_192647-66_204c.sdfits HISTORY 97-11-19_0553_193231-66_205c.sdfits HISTORY 97-11-19_0602_183509-66_195c.sdfits HISTORY 97-11-19_0612_184053-66_196c.sdfits HISTORY 97-11-19_0622_184638-66_197c.sdfits HISTORY 97-11-19_0631_185222-66_198c.sdfits HISTORY 97-11-19_0640_185806-66_199c.sdfits HISTORY 98-03-24_2107_193706-66_206b.sdfits HISTORY 98-03-24_2116_194251-66_207b.sdfits HISTORY 98-03-25_2020_190826-66_201b.sdfits HISTORY 98-03-25_2029_191410-66_202b.sdfits HISTORY 98-03-25_2038_191954-66_203b.sdfits HISTORY 98-03-25_2047_192538-66_204b.sdfits HISTORY 98-03-25_2056_193122-66_205b.sdfits HISTORY 98-03-26_2048_190459-66_200d.sdfits HISTORY 98-03-27_2034_191627-66_202d.sdfits HISTORY 98-03-27_2043_192212-66_203d.sdfits HISTORY 98-03-27_2052_192756-66_204d.sdfits HISTORY 98-03-27_2102_193340-66_205d.sdfits HISTORY 98-03-27_2111_193924-66_206d.sdfits HISTORY 98-03-27_2120_194508-66_207d.sdfits HISTORY 98-03-27_2130_191043-66_201d.sdfits HISTORY 98-05-10_2123_182232-66_193b.sdfits HISTORY 98-05-10_2133_182816-66_194b.sdfits HISTORY 98-05-10_2142_183400-66_195b.sdfits HISTORY 98-05-10_2151_183945-66_196b.sdfits HISTORY 98-05-10_2200_184529-66_197b.sdfits HISTORY 98-05-10_2209_185113-66_198b.sdfits HISTORY 98-05-10_2219_185657-66_199b.sdfits HISTORY 98-05-10_2228_190241-66_200b.sdfits HISTORY 98-05-13_2132_182450-66_193d.sdfits HISTORY 98-05-13_2151_183034-66_194d.sdfits HISTORY 98-05-13_2200_183618-66_195d.sdfits HISTORY 98-05-13_2210_184202-66_196d.sdfits HISTORY 98-05-13_2219_184746-66_197d.sdfits HISTORY 98-05-13_2228_185331-66_198d.sdfits HISTORY 98-05-13_2237_185915-66_199d.sdfits HISTORY 98-05-25_1711_182559-66_193e.sdfits HISTORY 98-05-25_1720_183143-66_194e.sdfits HISTORY 98-05-25_1729_183727-66_195e.sdfits HISTORY 98-05-25_1738_184311-66_196e.sdfits HISTORY 98-05-25_1747_184855-66_197e.sdfits HISTORY 98-05-25_1756_185439-66_198e.sdfits HISTORY 98-05-25_1806_190024-66_199e.sdfits HISTORY 98-05-25_1815_190608-66_200e.sdfits HISTORY 98-05-25_1824_191152-66_201e.sdfits HISTORY 98-05-25_1833_191736-66_202e.sdfits HISTORY 98-05-25_1842_192320-66_203e.sdfits HISTORY 98-05-25_1851_192905-66_204e.sdfits HISTORY 98-05-25_1901_193449-66_205e.sdfits HISTORY 98-05-25_1910_194033-66_206e.sdfits HISTORY 98-05-25_1919_194617-66_207e.sdfits HISTORY Original FITS filename "1904-66_ZPN.continuum.fits". HISTORY Noise level of continuum map: 61 mJy (RMS) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/nonstandard_units.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/nonstandard_units.hdr new file mode 100644 index 0000000000000000000000000000000000000000..255dbfc6971628fc69438bae0251dcc1e828d4c7 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/nonstandard_units.hdr @@ -0,0 +1 @@ +CD1_2 = -3.72E-05 CD1_3 = 0 CD1_1 = -4.12E-05 CUNIT3 = 'HZ ' CUNIT2 = 'M/S ' CTYPE1 = 'RA---TAN' NAXIS = 3 CTYPE3 = 'AWAV ' CD2_1 = -3.72E-05 CTYPE2 = 'DEC--TAN' CD2_3 = 0 CD2_2 = 4.12E-05 CUNIT1 = 'deg ' CD3_1 = 0 CD3_2 = 0 CD3_3 = 0.2 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/outside_sky.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/outside_sky.hdr new file mode 100644 index 0000000000000000000000000000000000000000..cd3f5b811343223d337bc11b1ddbed3735d74e23 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/outside_sky.hdr @@ -0,0 +1 @@ +SIMPLE = T / BITPIX = -32 / NAXIS = 2 / NAXIS1 = 2048 / NAXIS2 = 2048 / EXTEND = T / BSCALE = 1.00000000000E+00 / BZERO = 0.00000000000E+00 / CDELT1 = -8.19629704013E-02 / CRPIX1 = 1.02500000000E+03 / CRVAL1 = 79.95701 CTYPE1 = 'RA---SIN' / CDELT2 = 8.19629704013E-02 / CRPIX2 = 1.02500000000E+03 / CRVAL2 = -45.779 CTYPE2 = 'DEC--SIN' / EPOCH = 2.00000000000E+03 / PV2_1 = -0.755124458581295 PV2_2 = 0.209028857410973 diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/sip-broken.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/sip-broken.hdr new file mode 100644 index 0000000000000000000000000000000000000000..61e7a74f41307eba81bb0bbf925a10b97542074f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/sip-broken.hdr @@ -0,0 +1 @@ +XTENSION= 'IMAGE ' / Image extension BITPIX = -32 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 10 NAXIS2 = 10 PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator EXTNAME = 'SCI ' / Extension name EXTVER = 1 / Extension version IRAF-TLM= '2010-01-28T21:42:25' / Time of last modification DATE = '2010-01-15T03:23:55' / Date FITS file was generated INHERIT = T / inherit the primary header EXPNAME = 'ibc301qrq ' / exposure identifier BUNIT = 'electrons' / brightness units / CCD CHIP IDENTIFICATION CCDCHIP = 2 / CCD chip (1 or 2) / World Coordinate System and Related Parameters WCSAXES = 2 / number of World Coordinate System axes CRPIX1 = 2048.0 / x-coordinate of reference pixel CRPIX2 = 1026.0 / y-coordinate of reference pixel CRVAL1 = 201.682062444 / first axis value at reference pixel CRVAL2 = -47.46654604529999 / second axis value at reference pixel CTYPE1 = 'RA---TAN-SIP' / the coordinate type for the first axis CTYPE2 = 'DEC--TAN-SIP' / the coordinate type for the second axis CD1_1 = 9.89532021391661E-06 / partial of first axis coordinate w.r.t. x CD1_2 = 5.57454535620407E-06 / partial of first axis coordinate w.r.t. y CD2_1 = 4.96143358219569E-06 / partial of second axis coordinate w.r.t. x CD2_2 = -9.5612017076973E-06 / partial of second axis coordinate w.r.t. y LTV1 = 0.0000000E+00 / offset in X to subsection start LTV2 = 0.0000000E+00 / offset in Y to subsection start LTM1_1 = 1.0 / reciprocal of sampling rate in X LTM2_2 = 1.0 / reciprocal of sampling rate in Y PA_APER = 149.806 / Position Angle of reference aperture center (deVAFACTOR= 1.0 / velocity aberration plate scale factor ORIENTAT= 149.7956191662691 / position angle of image y axis (deg. e of n) RA_APER = 2.016928333333E+02 / RA of aperture reference position DEC_APER= -4.747905555556E+01 / Declination of aperture reference position / REPEATED EXPOSURES INFORMATION NCOMBINE= 1 / number of image sets combined during CR rejecti / PHOTOMETRY KEYWORDS PHOTMODE= 'WFC3 UVIS2 F606W CAL' / observation con PHOTFLAM= 1.1598989E-19 / inverse sensitivity, ergs/cm2/Ang/electron PHOTFNU = 1.3410633E-07 / inverse sensitivity, Jy*sec/electron PHOTZPT = -2.1100000E+01 / ST magnitude zero point PHOTPLAM= 5.8874194E+03 / Pivot wavelength (Angstroms) PHOTBW = 6.5663947E+02 / RMS bandwidth of filter plus detector / READOUT DEFINITION PARAMETERS CENTERA1= 2104 / subarray axis1 center pt in unbinned dect. pix CENTERA2= 1036 / subarray axis2 center pt in unbinned dect. pix SIZAXIS1= 4096 / subarray axis1 size in unbinned detector pixelsSIZAXIS2= 2051 / subarray axis2 size in unbinned detector pixelsBINAXIS1= 1 / axis1 data bin size in unbinned detector pixelsBINAXIS2= 1 / axis2 data bin size in unbinned detector pixels / DATA PACKET INFORMATION FILLCNT = 0 / number of segments containing fill ERRCNT = 0 / number of segments containing errors PODPSFF = F / podps fill present (T/F) STDCFFF = F / science telemetry fill data present (T=1/F=0) STDCFFP = 'x5569 ' / science telemetry fill pattern (hex) / IMAGE STATISTICS AND DATA QUALITY FLAGS NGOODPIX= 8361737 / number of good pixels SDQFLAGS= 31743 / serious data quality flags GOODMIN = -1.5353586E+10 / minimum value of good pixels GOODMAX = 4.4784176E+08 / maximum value of good pixels GOODMEAN= -1.7965331E+03 / mean value of good pixels SNRMIN = -4.0580401E+00 / minimum signal to noise of good pixels SNRMAX = 2.0669971E+02 / maximum signal to noise of good pixels SNRMEAN = 9.1055450E+00 / mean value of signal to noise of good pixels SOFTERRS= 0 / number of soft error pixels (DQF=1) MEANDARK= -9.8821044E-04 / average of the dark values subtracted MEANBLEV= 2.5543987E+03 / average of all bias levels subtracted MEANFLSH= 0.000000 / Mean number of counts in post flash exposure OCX10 = 0.000175023073097690 OCX11 = 0.03978145867586136 OCY10 = 0.03984303399920464 OCY11 = 0.002337893005460501 IDCSCALE= 0.03962 WCSNAMEO= 'OPUS ' WCSAXESO= 2 CRPIX1O = 2048.0 CRPIX2O = 1026.0 CDELT1O = 1 CDELT2O = 1 CUNIT1O = 'deg ' CUNIT2O = 'deg ' CTYPE1O = 'RA---TAN' CTYPE2O = 'DEC--TAN' CRVAL1O = 201.682062444 CRVAL2O = -47.4665460453 LONPOLEO= 180 LATPOLEO= -47.4665460453 RESTFRQO= 0 RESTWAVO= 0 CD1_1O = 9.90756999999999E-06 CD1_2O = 5.55896E-06 CD2_1O = 4.9244E-06 CD2_2O = -9.54957E-06 IDCTAB = 'iref$v5r1512gi_idc.fits' A_3_1 = -5.1021945200133E-16 A_3_0 = 2.01645819721643E-11 B_3_0 = 1.69320438397225E-12 B_3_1 = 1.63251006567400E-15 B_1_2 = -1.4255424755601E-11 B_1_3 = -2.7323406250153E-15 B_1_1 = 2.81503635244692E-06 B_2_1 = 1.84371537198681E-11 B_2_0 = -4.1200147469028E-08 B_2_2 = 1.39530876683604E-14 A_4_0 = 1.93073916740935E-15 A_ORDER = 4 B_0_4 = 7.44136342655120E-15 B_0_3 = 1.35699782198128E-11 B_0_2 = -3.0813836048843E-06 B_ORDER = 4 B_4_0 = 6.75894948156410E-16 A_1_1 = -2.9689459039407E-06 A_1_3 = -2.5561816554973E-15 A_1_2 = 1.61518535366509E-11 A_0_4 = -1.7441112473874E-14 A_0_2 = 9.41762068657988E-08 A_0_3 = 2.11281723091275E-11 A_2_2 = -1.7127070982784E-14 A_2_0 = 2.87050290904523E-06 A_2_1 = -1.4037704327792E-11 IDCTHETA= 45.0 IDCXREF = 2048.0 IDCYREF = 1026.0 IDCV2REF= -27.56800079345703 IDCV3REF= -33.30899810791016 WCSNAMEA= 'IDC_v5r1512gi' WCSAXESA= 2 CRPIX1A = 2048 CRPIX2A = 1026 CDELT1A = 1 CDELT2A = 1 CUNIT1A = 'deg ' CUNIT2A = 'deg ' CTYPE1A = 'RA---TAN-SIP' CTYPE2A = 'DEC--TAN-SIP' CRVAL1A = 201.682062444 CRVAL2A = -47.4665460453 LONPOLEA= 180 LATPOLEA= -47.4665460453 RESTFRQA= 0 RESTWAVA= 0 CD1_1A = 9.89532021392E-06 CD1_2A = 5.5745453562E-06 CD2_1A = 4.9614335822E-06 CD2_2A = -9.5612017077E-06 A_3_1O = -5.1021945200133E-16 A_3_0O = 2.01645819721643E-11 B_3_0O = 1.69320438397225E-12 B_3_1O = 1.632510065674E-15 B_1_2O = -1.4255424755601E-11 B_1_3O = -2.7323406250153E-15 B_1_1O = 2.81503635244692E-06 B_2_1O = 1.84371537198681E-11 B_2_0O = -4.1200147469028E-08 B_2_2O = 1.39530876683604E-14 B_ORDERO= 4 A_ORDERO= 4 B_0_4O = 7.4413634265512E-15 B_0_3O = 1.35699782198128E-11 B_0_2O = -3.0813836048843E-06 A_4_0O = 1.93073916740935E-15 B_4_0O = 6.7589494815641E-16 A_1_1O = -2.9689459039407E-06 A_1_3O = -2.5561816554973E-15 A_1_2O = 1.61518535366509E-11 A_0_4O = -1.7441112473874E-14 A_0_2O = 9.41762068657988E-08 A_0_3O = 2.11281723091275E-11 A_2_2O = -1.7127070982784E-14 A_2_0O = 2.87050290904523E-06 A_2_1O = -1.4037704327792E-11 WCSNAME = 'IDC_v5r1512gi' WCSNAMEB= 'IDC_v5r1512gi' WCSAXESB= 2 CRPIX1B = 2048.0 CRPIX2B = 1026.0 CDELT1B = 1 CDELT2B = 1 CUNIT1B = 'deg ' CUNIT2B = 'deg ' CTYPE1B = 'RA---TAN-SIP' CTYPE2B = 'DEC--TAN-SIP' CRVAL1B = 201.682062444 CRVAL2B = -47.4665460453 LONPOLEB= 180 LATPOLEB= -47.4665460453 RESTFRQB= 0 RESTWAVB= 0 A_3_1B = -5.1021945200133E-16 A_3_0B = 2.01645819721643E-11 B_3_0B = 1.69320438397225E-12 B_3_1B = 1.632510065674E-15 B_1_2B = -1.4255424755601E-11 B_1_3B = -2.7323406250153E-15 B_1_1B = 2.81503635244692E-06 B_2_1B = 1.84371537198681E-11 B_2_0B = -4.1200147469028E-08 B_2_2B = 1.39530876683604E-14 B_ORDERB= 4 A_ORDERB= 4 B_0_4B = 7.4413634265512E-15 B_0_3B = 1.35699782198128E-11 B_0_2B = -3.0813836048843E-06 A_4_0B = 1.93073916740935E-15 B_4_0B = 6.7589494815641E-16 A_1_1B = -2.9689459039407E-06 A_1_3B = -2.5561816554973E-15 A_1_2B = 1.61518535366509E-11 A_0_4B = -1.7441112473874E-14 A_0_2B = 9.41762068657988E-08 A_0_3B = 2.11281723091275E-11 A_2_2B = -1.7127070982784E-14 A_2_0B = 2.87050290904523E-06 A_2_1B = -1.4037704327792E-11 CD1_1B = 9.89532021392E-06 CD1_2B = 5.5745453562E-06 CD2_1B = 4.9614335822E-06 CD2_2B = -9.5612017077E-06 WCSNAMEC= 'TWEAK_A ' WCSAXESC= 2 CRPIX1C = 2048.0 CRPIX2C = 1026.0 CDELT1C = 1 CDELT2C = 1 CUNIT1C = 'deg ' CUNIT2C = 'deg ' CTYPE1C = 'RA---TAN-SIP' CTYPE2C = 'DEC--TAN-SIP' CRVAL1C = 201.682062444 CRVAL2C = -47.4665460453 LONPOLEC= 180 LATPOLEC= -47.4665460453 RESTFRQC= 0 RESTWAVC= 0 A_3_1C = -5.1021945200133E-16 A_3_0C = 2.01645819721643E-11 B_3_0C = 1.69320438397225E-12 B_3_1C = 1.632510065674E-15 B_1_2C = -1.4255424755601E-11 B_1_3C = -2.7323406250153E-15 B_1_1C = 2.81503635244692E-06 B_2_1C = 1.84371537198681E-11 B_2_0C = -4.1200147469028E-08 B_2_2C = 1.39530876683604E-14 B_ORDERC= 4 A_ORDERC= 4 B_0_4C = 7.4413634265512E-15 B_0_3C = 1.35699782198128E-11 B_0_2C = -3.0813836048843E-06 A_4_0C = 1.93073916740935E-15 B_4_0C = 6.7589494815641E-16 A_1_1C = -2.9689459039407E-06 A_1_3C = -2.5561816554973E-15 A_1_2C = 1.61518535366509E-11 A_0_4C = -1.7441112473874E-14 A_0_2C = 9.41762068657988E-08 A_0_3C = 2.11281723091275E-11 A_2_2C = -1.7127070982784E-14 A_2_0C = 2.87050290904523E-06 A_2_1C = -1.4037704327792E-11 CD1_1C = 9.89532021392E-06 CD1_2C = 5.5745453562E-06 CD2_1C = 4.9614335822E-06 CD2_2C = -9.5612017077E-06 FITNAMEC= 'TWEAK_A ' NMATCHC = 0 RMS_RAC = 0.0 RMS_DECC= 0.0 HISTORY The following throughput tables were used: crotacomp$hst_ota_007_syn.fitHISTORY s, crwfc3comp$wfc3_pom_001_syn.fits, crwfc3comp$wfc3_uvis_mir1_002_syn.fHISTORY its, crwfc3comp$wfc3_uvis_mir2_002_syn.fits, crwfc3comp$wfc3_uvis_f606w_HISTORY 002_syn.fits, crwfc3comp$wfc3_uvis_owin_002_syn.fits, crwfc3comp$wfc3_uvHISTORY is_iwin_002_syn.fits, crwfc3comp$wfc3_uvis_ccd2_003_syn.fits, crwfc3compHISTORY $wfc3_uvis_f606wf2_001_syn.fits, crwfc3comp$wfc3_uvis_cor_003_syn.fits END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/sip.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/sip.fits new file mode 100644 index 0000000000000000000000000000000000000000..5c9940dd5ffe2f0197176173f1b28c15700e5988 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/sip.fits @@ -0,0 +1 @@ +SIMPLE = T / conforms to FITS standard BITPIX = 8 / array data type NAXIS = 0 / number of array dimensions WCSAXES = 2 / Number of coordinate axes CRPIX1 = 128.0 / Pixel coordinate of reference point CRPIX2 = 128.0 / Pixel coordinate of reference point PC1_1 = 0.000249756880272 / Coordinate transformation matrix element PC1_2 = 0.000230177809744 / Coordinate transformation matrix element PC2_1 = 0.000230428519265 / Coordinate transformation matrix element PC2_2 = -0.000249965770577 / Coordinate transformation matrix element CDELT1 = 1 / [deg] Coordinate increment at reference point CDELT2 = 1 / [deg] Coordinate increment at reference point CUNIT1 = 'deg' / Units of coordinate increment and value CUNIT2 = 'deg' / Units of coordinate increment and value CTYPE1 = 'RA---TAN-SIP' / Right ascension, gnomonic projection CTYPE2 = 'DEC--TAN-SIP' / Declination, gnomonic projection CRVAL1 = 202.482322805 / [deg] Coordinate value at reference point CRVAL2 = 47.17511893 / [deg] Coordinate value at reference point LONPOLE = 180 / [deg] Native longitude of celestial pole LATPOLE = 47.17511893 / [deg] Native latitude of celestial pole RESTFRQ = 0 / [Hz] Line rest frequency RESTWAV = 0 / [Hz] Line rest wavelength CRDER1 = 4.02509762361E-05 / [deg] Random error in coordinate CRDER2 = 3.42746131953E-05 / [deg] Random error in coordinate RADESYS = 'ICRS' / Equatorial coordinate system EQUINOX = 2000 / [yr] Equinox of equatorial coordinates BP_0_1 = -1.6588E-05 BP_0_2 = -2.3424E-05 A_3_0 = -1.4172E-07 B_3_0 = -2.0249E-08 BP_3_0 = 2.0482E-08 B_1_2 = -5.7813E-09 B_1_1 = -2.4386E-05 B_2_1 = -1.6583E-07 B_2_0 = 2.1197E-06 A_ORDER = 3 B_0_3 = -1.6168E-07 B_0_2 = 2.31E-05 BP_0_3 = 1.651E-07 B_ORDER = 3 BP_ORDER= 3 BP_1_2 = 3.8917E-09 AP_ORDER= 3 AP_3_0 = 1.4492E-07 A_1_1 = 2.1886E-05 BP_2_0 = -2.151E-06 A_1_2 = -1.6847E-07 AP_2_1 = 6.709E-09 AP_2_0 = 2.4146E-05 A_0_2 = 2.9656E-06 A_0_3 = 3.7746E-09 BP_1_1 = 2.4753E-05 BP_1_0 = -2.6783E-06 A_2_0 = -2.3863E-05 A_2_1 = -8.561E-09 AP_1_0 = -1.4897E-05 AP_1_1 = -2.225E-05 AP_1_2 = 1.7195E-07 BP_2_1 = 1.7E-07 AP_0_1 = -6.4275E-07 AP_0_3 = -3.582E-09 AP_0_2 = -2.9425E-06 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/sip2.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/sip2.fits new file mode 100644 index 0000000000000000000000000000000000000000..af97b2233dac2f2bf7a2df4a5cd6cbc5946cc559 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/sip2.fits @@ -0,0 +1 @@ +SIMPLE = T / conforms to FITS standard BITPIX = 8 / array data type NAXIS = 0 / number of array dimensions WCSAXES = 2 / Number of coordinate axes CRPIX1 = 128.0 / Pixel coordinate of reference point CRPIX2 = 128.0 / Pixel coordinate of reference point PC1_1 = 0.000249756880272 / Coordinate transformation matrix element PC1_2 = 0.000230177809744 / Coordinate transformation matrix element PC2_1 = 0.000230428519265 / Coordinate transformation matrix element PC2_2 = -0.000249965770577 / Coordinate transformation matrix element CDELT1 = 1 / [deg] Coordinate increment at reference point CDELT2 = 1 / [deg] Coordinate increment at reference point CUNIT1 = 'deg' / Units of coordinate increment and value CUNIT2 = 'deg' / Units of coordinate increment and value CTYPE1 = 'RA---TAN-SIP' / Right ascension, gnomonic projection CTYPE2 = 'DEC--TAN-SIP' / Declination, gnomonic projection CRVAL1 = 202.482322805 / [deg] Coordinate value at reference point CRVAL2 = 47.17511893 / [deg] Coordinate value at reference point LONPOLE = 180 / [deg] Native longitude of celestial pole LATPOLE = 47.17511893 / [deg] Native latitude of celestial pole RESTFRQ = 0 / [Hz] Line rest frequency RESTWAV = 0 / [Hz] Line rest wavelength CRDER1 = 4.02509762361E-05 / [deg] Random error in coordinate CRDER2 = 3.42746131953E-05 / [deg] Random error in coordinate RADESYS = 'ICRS' / Equatorial coordinate system EQUINOX = 2000 / [yr] Equinox of equatorial coordinates A_3_0 = -1.4172E-07 B_3_0 = -2.0249E-08 B_1_2 = -5.7813E-09 B_1_1 = -2.4386E-05 B_2_1 = -1.6583E-07 B_2_0 = 2.1197E-06 A_ORDER = 3 B_0_3 = -1.6168E-07 B_0_2 = 2.31E-05 B_ORDER = 3 A_1_1 = 2.1886E-05 A_1_2 = -1.6847E-07 A_0_2 = 2.9656E-06 A_0_3 = 3.7746E-09 A_2_0 = -2.3863E-05 A_2_1 = -8.561E-09 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/siponly.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/siponly.hdr new file mode 100644 index 0000000000000000000000000000000000000000..8b33f9363714924d3d2c4207cd3ca3e8d28b76c1 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/siponly.hdr @@ -0,0 +1 @@ +SIMPLE = T / Fits standard BITPIX = -32 / FOUR-BYTE SINGLE PRECISION FLOATING POINT NAXIS = 2 / STANDARD FITS FORMAT NAXIS1 = 2048 / STANDARD FITS FORMAT NAXIS2 = 4096 / STANDARD FITS FORMAT ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file TELESCOP= 'P48 ' / Name of telescope INSTRUME= 'PTF/MOSAIC' / Instrument name OBSERVER= 'KulkarniPTF' / Observer name and project CCDID = '5 ' / CCD number (0..11) DATE-OBS= '2014-07-31T04:49:58.673' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS DATE = '2014-07-31T19:20:32' / File creation date (YYYY-MM-DDThh:mm:ss UT) REFERENC= 'http://www.astro.caltech.edu/ptf' / URL of PTF website / PROPOSAL INFORMATION PTFPRPI = 'Kulkarni' / PTF Project PI PTFPID = '52002 ' / Project type: 00000-49999 OBJECT = 'Galactic_Plane' / Fields object PTFFIELD= '1549 ' / PTF unique field ID PTFFLAG = '1 ' / 1 = PTF; 0 = non-PTF category / TIME AND EXPOSURE INFORMATION FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '1 ' / Filter changer slot position EXPTIME = 60. / [s] Requested exposure time AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2014-07-31T04:49:58.673' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.OBSJD = 2456869.70137 / [day] Julian day corresponds to UTC-OBS OBSMJD = 56869.20137 / MJD corresponds to UTC-OBS (day) OBSLST = '17:37:29.36' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '-0:42:20.82' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2456869.70618 / [day] Heliocentric Julian Day OBSTYPE = 'object ' / Image type (dark,science,bias,focus) IMGTYP = 'object ' / Image type (dark,science,bias,focus) / MOON AND SUN MOONRA = 173.116974 / [deg] Moon J2000.0 R.A. MOONDEC = -0.404999 / [deg] Moon J2000.0 Dec. MOONILLF= 0.155837 / [frac] Moon illuminated fraction MOONPHAS= 133.4978 / [deg] Moon phase angle MOONESB = -0. / Moon excess in sky brightness V-band MOONALT = -1.271649 / [deg] Moon altitude SUNAZ = 312.4731 / [deg] Sun azimuth SUNALT = -22.25475 / [deg] Sun altitude / PHOTOMETRY BUNIT = 'DN ' / Data number (analog-to-digital units or ADU) PHTCALEX= 1 / Was phot.-cal. module executed? PHTCALFL= 0 / Flag for image is photometric (0=N, 1=Y) PCALRMSE= 0.171135 / RMSE from (zeropoint, extinction) data fit IMAGEZPT= 21.22791 / Image magnitude zeropoint IZPORIG = 'CALTRANS' / Photometric-calibration origin ZPRULE = 'COMPUTE ' / Photometric-calibration method MAGZPT = 23.55079 / Magnitude zeropoint at airmass=1 EXTINCT = 1.163014 / Extinction APSFILT = 'r ' / SDSS filter used in abs phot cal APSCOL = 'r-i ' / SDSS color used in abs phot cal APRMS = 0.06677995 / RMS in mag of final abs phot cal APBSRMS = 0.05033556 / RMS in mag of final abs phot cal for bright staAPNSTDI1= 308233 / Number of standard stars in first iteration APNSTDIF= 274569 / Number of standard stars in final iteration APCHI2 = 1861590.34570444 / Chi2 of final abs phot cal APDOF = 274569. / Dof of chi2 of final abs phot cal APMEDJD = 2456869.84882722 / Median JD used in abs phot cal APPN01 = 'ZeroPoint' / Name of parameter abs phot cal 01 APPAR01 = 23.67499643 / Value of parameter abs phot cal 01 APPARE01= 0.00324545 / Error of parameter abs phot cal 01 APPN02 = 'ColorTerm' / Name of parameter abs phot cal 02 APPAR02 = 0.44908632 / Value of parameter abs phot cal 02 APPARE02= 0.00423336 / Error of parameter abs phot cal 02 APPN03 = 'AirMassTerm' / Name of parameter abs phot cal 03 APPAR03 = -0.18342823 / Value of parameter abs phot cal 03 APPARE03= 0.00288243 / Error of parameter abs phot cal 03 APPN04 = 'AirMassColorTerm' / Name of parameter abs phot cal 04 APPAR04 = -0.14534473 / Value of parameter abs phot cal 04 APPARE04= 0.00381178 / Error of parameter abs phot cal 04 APPN05 = 'TimeTerm' / Name of parameter abs phot cal 05 APPAR05 = 0.42239539 / Value of parameter abs phot cal 05 APPARE05= 0.0019644 / Error of parameter abs phot cal 05 APPN06 = 'Time2Term' / Name of parameter abs phot cal 06 APPAR06 = 0.16770061 / Value of parameter abs phot cal 06 APPARE06= 0.01549427 / Error of parameter abs phot cal 06 APPN07 = 'XTerm ' / Name of parameter abs phot cal 07 APPAR07 = 0.02152189 / Value of parameter abs phot cal 07 APPARE07= 0.00047932 / Error of parameter abs phot cal 07 APPN08 = 'YTerm ' / Name of parameter abs phot cal 08 APPAR08 = 0.02739724 / Value of parameter abs phot cal 08 APPARE08= 0.00117248 / Error of parameter abs phot cal 08 APPN09 = 'Y2Term ' / Name of parameter abs phot cal 09 APPAR09 = 0.01522565 / Value of parameter abs phot cal 09 APPARE09= 0.0018581 / Error of parameter abs phot cal 09 APPN10 = 'Y3Term ' / Name of parameter abs phot cal 10 APPAR10 = -0.23390906 / Value of parameter abs phot cal 10 APPARE10= 0.00723349 / Error of parameter abs phot cal 10 APPN11 = 'XYTerm ' / Name of parameter abs phot cal 11 APPAR11 = -0.00677493 / Value of parameter abs phot cal 11 APPARE11= 0.00169149 / Error of parameter abs phot cal 11 / ASTROMETRY CRVAL1 = 274.806945708898 / [deg] RA of reference point CRVAL2 = -25.9746476963393 / [deg] DEC of reference point CRPIX1 = -3925.16 / [pix] Image reference point CRPIX2 = 4360.23 / [pix] Image reference point CTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions CTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions CUNIT1 = 'deg ' / Image axis-1 celestial-coordinate units CUNIT2 = 'deg ' / Image axis-2 celestial-coordinate units CRTYPE1 = 'deg ' / Data units of CRVAL1 CRTYPE2 = 'deg ' / Data units of CRVAL2 CD1_1 = 0.000286102658601581 / Transformation matrix CD1_2 = -6.28816628331811E-07 CD2_1 = -5.77207018114522E-06 CD2_2 = -0.000281525256171892 OBJRA = '18:18:56.842' / Requested field J2000.0 Ra. OBJDEC = '-25:52:30.00' / Requested field J2000.0 Dec. OBJRAD = 274.73684 / [deg] Requested field RA (J2000.0) OBJDECD = -25.875 / [deg] Requested field Dec (J2000.0) PIXSCALE= 1.01 / [arcsec/pix] Pixel scale EQUINOX = 2000. / [yr] Equatorial coordinates definition / IMAGE QUALITY SEEING = 2.95 / [pix] Seeing FWHM PEAKDIST= 0.481336680505667 / [pix] Mean dist brightest pixel-centroid pixel ELLIP = 0.313 / Mean image ellipticity A/B ELLIPPA = 48.58 / [deg] Mean image ellipticity PA FBIAS = 785.8855 / [DN] Floating bias of the image SATURVAL= 50000. / [DN] Saturation value of the CCD array FWHMSEX = 2.45 / [arcsec] SExtractor SEEING estimate MSMAPCZP= 19.20814 / [mag/s-arcsec^2] Median sky abs. phot. cal. LMGAPCZP= 20.68008 / [mag/s-arcsec^2] Limiting mag. abs. phot. cal. MEDFWHM = 3.417924 / [arcsecond] Median FWHM MEDELONG= 1.406608 / [dimensionless] Median elongation STDELONG= 0.592749 / [dimensionless] Std. dev. of elongation MEDTHETA= -31.22347 / [deg] Atan(median sin(theta)/median cos(theta))STDTHETA= 65.37225 / [deg] Atan(stddev sin(theta)/stddev cos(theta))MEDDLMAG= 2.444709 / [mag/s-arcsec^2] Median (MU_MAX-MAG_AUTO) STDDLMAG= 0.4154117 / [mag/s-arcsec^2] Stddev of (MU_MAX-MAG_AUTO) / OBSERVATORY AND TCS OCS_TIME= '2014-07-31T04:49:58.613' / UTC Date for OCS calc time-dep params OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode OBSLAT = 33.3574 / [deg] Telescope geodetic latitude in WGS84 OBSLON = -116.8599 / [deg] Telescope geodetic longitude in WGS84 OBSALT = 1703.2 / [m] Telescope geodetic altitude in WGS84 DEFOCUS = 0. / [mm] Focus position - nominal focus FOCUSPOS= 1.3655 / [mm] Exposures focusPos DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 20.4 / [arcsec/hr] Track speed RA rel to sidereal TRACKDEC= -3.9 / [arcsec/hr] Track speed Dec rel to sidereal AZIMUTH = 169.2328 / [deg] Telescope Azimuth ALTITUDE= 29.95342 / [deg] Telescope altitude AIRMASS = 1.997293 / Telescope airmass TELRA = 274.9591 / [deg] Telescope ap equinox of date RA TELDEC = -25.8684 / [deg] Telescope ap equinox of date Dec TELHA = 349.4138 / [deg] Telescope ap equinox of date HA DOMEAZ = 169.4477 / [deg] Dome azimuth WINDSCAL= 12.8995 / [deg] Wind screen altitude WINDDIR = 1.3 / [deg] Azimuth of wind direction WINDSPED= 14.472 / Wind speed (km/hour) OUTTEMP = 22.16667 / [C] Outside temperature OUTRELHU= 0.513 / [frac] Outside relative humidity OUTDEWPT= 11.61111 / [C] Outside dew point / INSTRUMENT TELEMETRY PANID = '_p48m ' / PAN identification DHSID = '_p48m ' / DHS identification CCDSEC = '[1:2048,1:4096]' / CCD section CCDSIZE = '[1:2048,1:4096]' / CCD size DATASEC = '[1:2048,1:4096]' / Data section DETSEC = '[1:2048,1:4096]' / Detector section ROISEC = '[1:2048,1:4096]' / ROI section FPA = 'P48MOSAIC' / Focal plan array CCDNAME = 'W53C2 ' / Detector mfg serial number CHECKSUM= 'fGoXhEmXfEmXfEmX' / Image header unit checksum DATASUM = '2019013917' / Image data unit checksum DHEINF = 'SDSU, Gen-III' / Controller info DHEFIRM = '/usr/src/dsp/20090618/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / Camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / Astropci software version DETID = 'PTF/MOSAIC' / Detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / Source for header information DATAMIN = 0. / Minimum value for array ROISTATE= 'ROI ' / ROI State (FULL | ROI) LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 174.988 / [K] 0x0 servo temp sensor on CCD09 HSTEMP = 152.111 / [K] 0x1 heat spreader temp DHE0TEMP= 301.098 / [K] 0x2 detector head electronics temp, master DHE1TEMP= 303.178 / [K] 0x3 detector head electronics temp, slave DEWWTEMP= 287.05 / [K] 0x4 dewar wall temp HEADTEMP= 142.103 / [K] 0x5 cryo cooler cold head temp CCD5TEMP= 175.963 / [K] 0x6 temp sensor on CCD05 CCD11TEM= 177.375 / [K] 0x7 temp sensor on CCD11 CCD0TEMP= 170.213 / [K] 0x8 temp sensor on CCD00 RSTEMP = 238.936 / [K] 0x9 temp sensor on radiation shield DEWPRESS= 40. / [milli-torr] Dewar pressure DETHEAT = 1.6 / [%] Detector focal plane heater power NAMPSXY = '6 2 ' / Number of amplifiers in x y CCDSUM = '1 1 ' / [pix] Binning in x and y MODELFOC= 'N/A ' / MODELFOC EXPCKSUM= 'fGoXhEmXfEmXfEmX' / Primary header unit checksum EXPDTSUM= '2019013917' / Primary data unit checksum GAIN = 1.7 / [e-/D.N.] Gain of detector. READNOI = 3.4 / [e-] Read noise of detector. DARKCUR = 0.1 / [e-/s] Dark current of detector / SCAMP DISTORTION KEYWORDS RADECSYS= 'ICRS ' / Astrometric system FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0. / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0. / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 2.362887E-05 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 2.36868E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 0. / SCAMP relative flux scale MAGZEROP= 0. / SCAMP zero-point PHOTIRMS= 0. / mag dispersion RMS (internal, high S/N) RA_RMS = 0.1040474 / [arcsec] RMS of SCAMP fit from 2MASS matching DEC_RMS = 0.1017731 / [arcsec] RMS of SCAMP fit from 2MASS matching ASTROMN = 2636 / Number of stars in SCAMP astrometric solution SCAMPPTH= 'NotAvailable' / SCAMP catalog path SCAMPFIL= 'NotAvailable' / SCAMP catalog file / SIP DISTORTION KEYWORDS A_ORDER = 4 / Distortion order for A A_0_2 = -6.88320772436348E-08 / Projection distortion parameter A_0_3 = -3.9165520771852E-11 / Projection distortion parameter A_0_4 = -1.37347903340862E-15 / Projection distortion parameter A_1_1 = 1.47451309698268E-06 / Projection distortion parameter A_1_2 = -5.47895978084324E-11 / Projection distortion parameter A_1_3 = 4.32571760220798E-15 / Projection distortion parameter A_2_0 = -4.61014380203131E-06 / Projection distortion parameter A_2_1 = -3.25701227339755E-10 / Projection distortion parameter A_2_2 = 5.87253012315133E-15 / Projection distortion parameter A_3_0 = 5.10801798928538E-10 / Projection distortion parameter A_3_1 = 2.40245891539354E-14 / Projection distortion parameter A_4_0 = -2.24100384816689E-14 / Projection distortion parameter A_DMAX = 96.5018681533569 / Projection distortion parameter B_ORDER = 4 / Distortion order for B B_0_2 = 2.10619568626298E-07 / Projection distortion parameter B_0_3 = -5.06225421390773E-12 / Projection distortion parameter B_0_4 = 5.17539616845577E-16 / Projection distortion parameter B_1_1 = 5.91465601878924E-08 / Projection distortion parameter B_1_2 = -5.12374109506712E-11 / Projection distortion parameter B_1_3 = -1.85594858389364E-15 / Projection distortion parameter B_2_0 = -6.29264904991201E-06 / Projection distortion parameter B_2_1 = -6.77151075883653E-11 / Projection distortion parameter B_2_2 = 3.33079437463431E-15 / Projection distortion parameter B_3_0 = 8.62409953895856E-10 / Projection distortion parameter B_3_1 = 4.00773353822356E-15 / Projection distortion parameter B_4_0 = -4.38536973214709E-14 / Projection distortion parameter B_DMAX = 95.5403565807527 / Projection distortion parameter AP_ORDER= 4 / Distortion order for AP AP_0_1 = -8.35636338195056E-06 / Projection distortion parameter AP_0_2 = 6.41919370738511E-08 / Projection distortion parameter AP_0_3 = 3.82575929801279E-11 / Projection distortion parameter AP_0_4 = 1.34695941598154E-15 / Projection distortion parameter AP_1_0 = 5.96496231342059E-06 / Projection distortion parameter AP_1_1 = -1.47551597085589E-06 / Projection distortion parameter AP_1_2 = 5.9682183111397E-11 / Projection distortion parameter AP_1_3 = -4.07431356348696E-15 / Projection distortion parameter AP_2_0 = 4.63912798241099E-06 / Projection distortion parameter AP_2_1 = 3.2299095062767E-10 / Projection distortion parameter AP_2_2 = -6.30497770263709E-15 / Projection distortion parameter AP_3_0 = -5.03018200403734E-10 / Projection distortion parameter AP_3_1 = -2.35315281608906E-14 / Projection distortion parameter AP_4_0 = 2.13944449467657E-14 / Projection distortion parameter BP_ORDER= 4 / Distortion order for BP BP_0_1 = -5.35341799909328E-06 / Projection distortion parameter BP_0_2 = -2.17548011382368E-07 / Projection distortion parameter BP_0_3 = 3.46141884836402E-12 / Projection distortion parameter BP_0_4 = -5.50225060304376E-16 / Projection distortion parameter BP_1_0 = 2.24406272193445E-05 / Projection distortion parameter BP_1_1 = -5.78663264876419E-08 / Projection distortion parameter BP_1_2 = 5.4445150144274E-11 / Projection distortion parameter BP_1_3 = 2.29942375548271E-15 / Projection distortion parameter BP_2_0 = 6.33813482510013E-06 / Projection distortion parameter BP_2_1 = 5.99623548359284E-11 / Projection distortion parameter BP_2_2 = -3.3053766170687E-15 / Projection distortion parameter BP_3_0 = -8.55094688760831E-10 / Projection distortion parameter BP_3_1 = -2.73327308556661E-15 / Projection distortion parameter BP_4_0 = 4.26704732113368E-14 / Projection distortion parameter / DATA FLOW ORIGNAME= '/data/PTF_default_37806.fits' / Filename as written by the camera FILENAME= 'PTF201407312014_2_o_37806.fits' / Filename of delivered camera image PROCORIG= 'IPAC-PTF pipelines' / Processing origin PROCDATE= 'Fri Sep 26 14:52:55 2014' / Processing date/time (Pacific time) PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pathname of pixel mask PMASKFIL= '70sOn35s_pixmask_chip5.trimmed.v4.fits' / Filename of pixel mask SFLATPTH= '/ptf/pos/sbx2/2014/07/31/f2/c5/cal/p4/cId112103/' / Pathname of superSFLATFIL= 'PTF_201407310000_i_s_flat_t120000_u000112103_f02_p000000_c05.fits' SBIASPTH= '/ptf/pos/sbx2/2014/07/31/f2/c5/cal/p1/cId112095/' / Pathname of superSBIASFIL= 'PTF_201407310000_i_s_bias_t120000_u000112095_f00_p000000_c05.fits' DBNID = 1938 / Database night ID DBEXPID = 446050 / Database exposure ID DBRID = 6985566 / Database raw-image ID DBPID = 21528832 / Database processed-image ID DBFID = 2 / Database filter ID DBPIID = 1 / Database P.I. ID DBPRID = 31 / Database project ID DBFIELD = 446050 / Database field ID DBSVID = 54 / Database software-version ID DBCVID = 60 / Database config-data-file ID INFOBITS= 0 / Database infobits (2^2 and 2^3 excluded) END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-1.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-1.hdr new file mode 100644 index 0000000000000000000000000000000000000000..987284031f1157714b95a27b9a458a2562d3a7a4 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-1.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 1 / number of data axes NAXIS1 = 4096 / length of data axis 1 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in frequency, as COMMENT observed, it being the Fourier transform of a lag spectrum produced COMMENT by a correlating spectrometer. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT Frequency (default) ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT W: Wavelength ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT V: Relativistic velocity ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'FREQ ' / Linear frequency axis (FFT of lag spectrum) CRVAL1 = 102.1189414E+9 / [Hz] Frequency of reference channel CDELT1 = -2.695372970E+5 / [Hz] Channel spacing (lower sideband) CUNIT1 = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER ' / Photon energy, linear frequency axis CRVAL1E = 4.223303869E-4 / [eV] Photon energy of reference channel CDELT1E = -1.114717695E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT N: Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN ' / Wave number, linear frequency axis CRVAL1N = 3.406321229E+2 / [/m] Wave number of reference channel CDELT1N = -8.990796460E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT N: Wave number COMMENT R: Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD ' / Radio velocity, linear frequency axis CRVAL1R = 2.198744369E+7 / [m/s] Radio velocity of reference channel CDELT1R = 7.332509683E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT N: Wave number COMMENT R: Radio velocity COMMENT W: Wavelength COMMENT CRPIX1W = 32768.0 / Pixel coordinate of reference point CTYPE1W = 'WAVE-F2W' / Wavelength in vacuuo, non-linear axis CRVAL1W = 2.935718427E-3 / [m] Wavelength of reference channel CDELT1W = 7.748666397E-9 / [m] Channel spacing CUNIT1W = 'm ' / Units of coordinate increment and value COMMENT SPECSYSW= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSW= 'TOPOCENT' / Reference frame of observation VELOSYSW= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCW= 'LSRK ' / Reference frame of source redshift ZSOURCEW= 0.0000 / Redshift of the source COMMENT CRPIX2W = 1 CDELT2W = 1.0 CTYPE2W = 'RA ' CRVAL2W = 83.81042 / [deg] (05h35m14.5s) CUNIT2W = 'deg ' COMMENT CRPIX3W = 1 CDELT3W = 1.0 CTYPE3W = 'DEC ' CRVAL3W = -5.375222 / [deg] (-05:22:30.8) CUNIT3W = 'deg ' COMMENT RADESYSW= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXW= 2000.0 / Equinox J2000.0 COMMENT CRPIX4W = 1 CDELT4W = 1.0 CTYPE4W = 'STOKES ' CRVAL4W = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT-F2W' / Optical velocity, non-linear axis CRVAL1O = 2.372768470E+7 / [m/s] Optical velocity of reference channel CDELT1O = 8.539135209E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT N: Wave number COMMENT R: Radio velocity COMMENT W: Wavelength COMMENT O: Optical velocity COMMENT Z: Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT-F2W' / Redshift, non-linear axis CRVAL1Z = 7.914703679E-2 / [] Redshift of reference channel CDELT1Z = 2.848348910E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1V = 32768.0 / Pixel coordinate of reference point CTYPE1V = 'VELO-F2V' / Relativistic velocity, non-linear axis CRVAL1V = 2.279141418E+7 / [m/s] Velocity of reference channel CDELT1V = 7.867122599E+2 / [m/s] Channel spacing CUNIT1V = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQV= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVV= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSV= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSV= 'TOPOCENT' / Reference frame of observation VELOSYSV= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCV= 'LSRK ' / Reference frame of source redshift ZSOURCEV= 0.0000 / Redshift of the source COMMENT CRPIX2V = 1 CDELT2V = 1.0 CTYPE2V = 'RA ' CRVAL2V = 83.81042 / [deg] (05h35m14.5s) CUNIT2V = 'deg ' COMMENT CRPIX3V = 1 CDELT3V = 1.0 CTYPE3V = 'DEC ' CRVAL3V = -5.375222 / [deg] (-05:22:30.8) CUNIT3V = 'deg ' COMMENT RADESYSV= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXV= 2000.0 / Equinox J2000.0 COMMENT CRPIX4V = 1 CDELT4V = 1.0 CTYPE4V = 'STOKES ' CRVAL4V = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA-F2V' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.602397448E-2 / [] Relativistic beta of reference channel CDELT1B = 2.624189632E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:27:55 DATE = '2009-04-22T04:27:55' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-4.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-4.hdr new file mode 100644 index 0000000000000000000000000000000000000000..7d7e219d9282f7d38457fc49d7becbd9d8fb6ab3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-freq-4.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 4 / number of data axes NAXIS1 = 4096 / length of data axis 1 NAXIS2 = 1 / length of data axis 2 NAXIS3 = 1 / length of data axis 3 NAXIS4 = 1 / length of data axis 4 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in frequency, as COMMENT observed, it being the Fourier transform of a lag spectrum produced COMMENT by a correlating spectrometer. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT Frequency (default) ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT W: Wavelength ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT V: Relativistic velocity ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'FREQ ' / Linear frequency axis (FFT of lag spectrum) CRVAL1 = 102.1189414E+9 / [Hz] Frequency of reference channel CDELT1 = -2.695372970E+5 / [Hz] Channel spacing (lower sideband) CUNIT1 = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER ' / Photon energy, linear frequency axis CRVAL1E = 4.223303869E-4 / [eV] Photon energy of reference channel CDELT1E = -1.114717695E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT N: Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN ' / Wave number, linear frequency axis CRVAL1N = 3.406321229E+2 / [/m] Wave number of reference channel CDELT1N = -8.990796460E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT N: Wave number COMMENT R: Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD ' / Radio velocity, linear frequency axis CRVAL1R = 2.198744369E+7 / [m/s] Radio velocity of reference channel CDELT1R = 7.332509683E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT N: Wave number COMMENT R: Radio velocity COMMENT W: Wavelength COMMENT CRPIX1W = 32768.0 / Pixel coordinate of reference point CTYPE1W = 'WAVE-F2W' / Wavelength in vacuuo, non-linear axis CRVAL1W = 2.935718427E-3 / [m] Wavelength of reference channel CDELT1W = 7.748666397E-9 / [m] Channel spacing CUNIT1W = 'm ' / Units of coordinate increment and value COMMENT SPECSYSW= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSW= 'TOPOCENT' / Reference frame of observation VELOSYSW= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCW= 'LSRK ' / Reference frame of source redshift ZSOURCEW= 0.0000 / Redshift of the source COMMENT CRPIX2W = 1 CDELT2W = 1.0 CTYPE2W = 'RA ' CRVAL2W = 83.81042 / [deg] (05h35m14.5s) CUNIT2W = 'deg ' COMMENT CRPIX3W = 1 CDELT3W = 1.0 CTYPE3W = 'DEC ' CRVAL3W = -5.375222 / [deg] (-05:22:30.8) CUNIT3W = 'deg ' COMMENT RADESYSW= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXW= 2000.0 / Equinox J2000.0 COMMENT CRPIX4W = 1 CDELT4W = 1.0 CTYPE4W = 'STOKES ' CRVAL4W = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT-F2W' / Optical velocity, non-linear axis CRVAL1O = 2.372768470E+7 / [m/s] Optical velocity of reference channel CDELT1O = 8.539135209E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT N: Wave number COMMENT R: Radio velocity COMMENT W: Wavelength COMMENT O: Optical velocity COMMENT Z: Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT-F2W' / Redshift, non-linear axis CRVAL1Z = 7.914703679E-2 / [] Redshift of reference channel CDELT1Z = 2.848348910E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1V = 32768.0 / Pixel coordinate of reference point CTYPE1V = 'VELO-F2V' / Relativistic velocity, non-linear axis CRVAL1V = 2.279141418E+7 / [m/s] Velocity of reference channel CDELT1V = 7.867122599E+2 / [m/s] Channel spacing CUNIT1V = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQV= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVV= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSV= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSV= 'TOPOCENT' / Reference frame of observation VELOSYSV= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCV= 'LSRK ' / Reference frame of source redshift ZSOURCEV= 0.0000 / Redshift of the source COMMENT CRPIX2V = 1 CDELT2V = 1.0 CTYPE2V = 'RA ' CRVAL2V = 83.81042 / [deg] (05h35m14.5s) CUNIT2V = 'deg ' COMMENT CRPIX3V = 1 CDELT3V = 1.0 CTYPE3V = 'DEC ' CRVAL3V = -5.375222 / [deg] (-05:22:30.8) CUNIT3V = 'deg ' COMMENT RADESYSV= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXV= 2000.0 / Equinox J2000.0 COMMENT CRPIX4V = 1 CDELT4V = 1.0 CTYPE4V = 'STOKES ' CRVAL4V = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA-F2V' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.602397448E-2 / [] Relativistic beta of reference channel CDELT1B = 2.624189632E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:28:02 DATE = '2009-04-22T04:28:02' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-1.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-1.hdr new file mode 100644 index 0000000000000000000000000000000000000000..8f3af36af9eae877ffcf41f64537c92b85cb19c3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-1.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 1 / number of data axes NAXIS1 = 4096 / length of data axis 1 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in relativistic COMMENT velocity having been regridded from a linear frequency axis, as COMMENT observed. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT F: Frequency ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT W: Wavelength ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT Relativistic velocity (default) ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1F = 32768.0 / Pixel coordinate of reference point CTYPE1F = 'FREQ-V2F' / Frequency, non-linear axis CRVAL1F = 102.4071237E+9 / [Hz] Frequency of reference channel CDELT1F = -2.513721996E+5 / [Hz] Channel spacing CUNIT1F = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQF= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVF= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSF= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSF= 'TOPOCENT' / Reference frame of observation VELOSYSF= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCF= 'LSRK ' / Reference frame of source redshift ZSOURCEF= 0.0000 / Redshift of the source COMMENT CRPIX2F = 1 CDELT2F = 1.0 CTYPE2F = 'RA ' CRVAL2F = 83.81042 / [deg] (05h35m14.5s) CUNIT2F = 'deg ' COMMENT CRPIX3F = 1 CDELT3F = 1.0 CTYPE3F = 'DEC ' CRVAL3F = -5.375222 / [deg] (-05:22:30.8) CUNIT3F = 'deg ' COMMENT RADESYSF= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXF= 2000.0 / Equinox J2000.0 COMMENT CRPIX4F = 1 CDELT4F = 1.0 CTYPE4F = 'STOKES ' CRVAL4F = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER-V2F' / Photon energy, non-linear axis CRVAL1E = 4.235222141E-4 / [eV] Photon energy of reference channel CDELT1E = -1.039592821E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN-V2F' / Wave number, non-linear axis CRVAL1N = 3.415933955E+2 / [/m] Wave number of reference channel CDELT1N = -8.384874032E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD-V2F' / Radio velocity, non-linear axis CRVAL1R = 2.120347082E+7 / [m/s] Radio velocity of reference channel CDELT1R = 6.838345224E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT CRPIX1W = 32768.0 / Pixel coordinate of reference point CTYPE1W = 'WAVE-V2W' / Wavelength in vacuuo, linear axis CRVAL1W = 2.927457068E-3 / [m] Wavelength of reference channel CDELT1W = 7.185841143E-9 / [m] Channel spacing CUNIT1W = 'm ' / Units of coordinate increment and value COMMENT RESTFRQW= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVW= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSW= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSW= 'TOPOCENT' / Reference frame of observation VELOSYSW= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCW= 'LSRK ' / Reference frame of source redshift ZSOURCEW= 0.0000 / Redshift of the source COMMENT CRPIX2W = 1 CDELT2W = 1.0 CTYPE2W = 'RA ' CRVAL2W = 83.81042 / [deg] (05h35m14.5s) CUNIT2W = 'deg ' COMMENT CRPIX3W = 1 CDELT3W = 1.0 CTYPE3W = 'DEC ' CRVAL3W = -5.375222 / [deg] (-05:22:30.8) CUNIT3W = 'deg ' COMMENT RADESYSW= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXW= 2000.0 / Equinox J2000.0 COMMENT CRPIX4W = 1 CDELT4W = 1.0 CTYPE4W = 'STOKES ' CRVAL4W = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT-V2W' / Optical velocity, linear axis CRVAL1O = 2.281727178E+7 / [m/s] Optical velocity of reference channel CDELT1O = 7.918894164E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT-V2W' / Redshift, linear axis CRVAL1Z = 7.611022615E-2 / [] Redshift of reference channel CDELT1Z = 2.641458767E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'VELO ' / Relativistic velocity, non-linear axis CRVAL1 = 2.195128874E+7 / [m/s] Velocity of reference channel CDELT1 = 7.319359645E+2 / [m/s] Channel spacing CUNIT1 = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA ' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.322161766E-2 / [] Relativistic beta of reference channel CDELT1B = 2.441475578E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:28:25 DATE = '2009-04-22T04:28:25' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-4.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-4.hdr new file mode 100644 index 0000000000000000000000000000000000000000..b982d2db32bb832314efddc403d4a7639ba25115 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-velo-4.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 4 / number of data axes NAXIS1 = 4096 / length of data axis 1 NAXIS2 = 1 / length of data axis 2 NAXIS3 = 1 / length of data axis 3 NAXIS4 = 1 / length of data axis 4 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in relativistic COMMENT velocity having been regridded from a linear frequency axis, as COMMENT observed. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT F: Frequency ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT W: Wavelength ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT Relativistic velocity (default) ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1F = 32768.0 / Pixel coordinate of reference point CTYPE1F = 'FREQ-V2F' / Frequency, non-linear axis CRVAL1F = 102.4071237E+9 / [Hz] Frequency of reference channel CDELT1F = -2.513721996E+5 / [Hz] Channel spacing CUNIT1F = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQF= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVF= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSF= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSF= 'TOPOCENT' / Reference frame of observation VELOSYSF= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCF= 'LSRK ' / Reference frame of source redshift ZSOURCEF= 0.0000 / Redshift of the source COMMENT CRPIX2F = 1 CDELT2F = 1.0 CTYPE2F = 'RA ' CRVAL2F = 83.81042 / [deg] (05h35m14.5s) CUNIT2F = 'deg ' COMMENT CRPIX3F = 1 CDELT3F = 1.0 CTYPE3F = 'DEC ' CRVAL3F = -5.375222 / [deg] (-05:22:30.8) CUNIT3F = 'deg ' COMMENT RADESYSF= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXF= 2000.0 / Equinox J2000.0 COMMENT CRPIX4F = 1 CDELT4F = 1.0 CTYPE4F = 'STOKES ' CRVAL4F = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER-V2F' / Photon energy, non-linear axis CRVAL1E = 4.235222141E-4 / [eV] Photon energy of reference channel CDELT1E = -1.039592821E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN-V2F' / Wave number, non-linear axis CRVAL1N = 3.415933955E+2 / [/m] Wave number of reference channel CDELT1N = -8.384874032E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD-V2F' / Radio velocity, non-linear axis CRVAL1R = 2.120347082E+7 / [m/s] Radio velocity of reference channel CDELT1R = 6.838345224E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT CRPIX1W = 32768.0 / Pixel coordinate of reference point CTYPE1W = 'WAVE-V2W' / Wavelength in vacuuo, linear axis CRVAL1W = 2.927457068E-3 / [m] Wavelength of reference channel CDELT1W = 7.185841143E-9 / [m] Channel spacing CUNIT1W = 'm ' / Units of coordinate increment and value COMMENT RESTFRQW= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVW= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSW= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSW= 'TOPOCENT' / Reference frame of observation VELOSYSW= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCW= 'LSRK ' / Reference frame of source redshift ZSOURCEW= 0.0000 / Redshift of the source COMMENT CRPIX2W = 1 CDELT2W = 1.0 CTYPE2W = 'RA ' CRVAL2W = 83.81042 / [deg] (05h35m14.5s) CUNIT2W = 'deg ' COMMENT CRPIX3W = 1 CDELT3W = 1.0 CTYPE3W = 'DEC ' CRVAL3W = -5.375222 / [deg] (-05:22:30.8) CUNIT3W = 'deg ' COMMENT RADESYSW= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXW= 2000.0 / Equinox J2000.0 COMMENT CRPIX4W = 1 CDELT4W = 1.0 CTYPE4W = 'STOKES ' CRVAL4W = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT-V2W' / Optical velocity, linear axis CRVAL1O = 2.281727178E+7 / [m/s] Optical velocity of reference channel CDELT1O = 7.918894164E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT-V2W' / Redshift, linear axis CRVAL1Z = 7.611022615E-2 / [] Redshift of reference channel CDELT1Z = 2.641458767E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'VELO ' / Relativistic velocity, non-linear axis CRVAL1 = 2.195128874E+7 / [m/s] Velocity of reference channel CDELT1 = 7.319359645E+2 / [m/s] Channel spacing CUNIT1 = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA ' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.322161766E-2 / [] Relativistic beta of reference channel CDELT1B = 2.441475578E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:28:33 DATE = '2009-04-22T04:28:33' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-1.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-1.hdr new file mode 100644 index 0000000000000000000000000000000000000000..a7ba2789d193311db3b918d6c61a6984cea0a443 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-1.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 1 / number of data axes NAXIS1 = 4096 / length of data axis 1 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in wavelength, COMMENT having been regridded from a linear frequency axis, as observed. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT F: Frequency ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT Wavelength (default) ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT V: Relativistic velocity ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1F = 32768.0 / Pixel coordinate of reference point CTYPE1F = 'FREQ-W2F' / Frequency, non-linear axis CRVAL1F = 102.6940613E+9 / [Hz] Frequency of reference channel CDELT1F = -2.332330873E+5 / [Hz] Channel spacing CUNIT1F = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQF= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVF= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSF= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSF= 'TOPOCENT' / Reference frame of observation VELOSYSF= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCF= 'LSRK ' / Reference frame of source redshift ZSOURCEF= 0.0000 / Redshift of the source COMMENT CRPIX2F = 1 CDELT2F = 1.0 CTYPE2F = 'RA ' CRVAL2F = 83.81042 / [deg] (05h35m14.5s) CUNIT2F = 'deg ' COMMENT CRPIX3F = 1 CDELT3F = 1.0 CTYPE3F = 'DEC ' CRVAL3F = -5.375222 / [deg] (-05:22:30.8) CUNIT3F = 'deg ' COMMENT RADESYSF= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXF= 2000.0 / Equinox J2000.0 COMMENT CRPIX4F = 1 CDELT4F = 1.0 CTYPE4F = 'STOKES ' CRVAL4F = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER-W2F' / Photon energy, non-linear axis CRVAL1E = 4.247088937E-4 / [eV] Photon energy of reference channel CDELT1E = -0.9645754124E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN-W2F' / Wave number, non-linear axis CRVAL1N = 3.425505162E+2 / [/m] Wave number of reference channel CDELT1N = -7.779818375E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD-W2F' / Radio velocity, non-linear axis CRVAL1R = 2.042288396E+7 / [m/s] Radio velocity of reference channel CDELT1R = 6.344887666E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'WAVE ' / Wavelength in vacuuo, linear axis CRVAL1 = 2.919277457E-3 / [m] Wavelength of reference channel CDELT1 = 6.630101933E-9 / [m] Channel spacing CUNIT1 = 'm ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT ' / Optical velocity, linear axis CRVAL1O = 2.191586755E+7 / [m/s] Optical velocity of reference channel CDELT1O = 7.306462036E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT ' / Redshift, linear axis CRVAL1Z = 7.310346531E-2 / [] Redshift of reference channel CDELT1Z = 2.437173398E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1V = 32768.0 / Pixel coordinate of reference point CTYPE1V = 'VELO-W2V' / Relativistic velocity, non-linear axis CRVAL1V = 2.111679434E+7 / [m/s] Velocity of reference channel CDELT1V = 6.774939349E+2 / [m/s] Channel spacing CUNIT1V = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQV= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVV= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSV= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSV= 'TOPOCENT' / Reference frame of observation VELOSYSV= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCV= 'LSRK ' / Reference frame of source redshift ZSOURCEV= 0.0000 / Redshift of the source COMMENT CRPIX2V = 1 CDELT2V = 1.0 CTYPE2V = 'RA ' CRVAL2V = 83.81042 / [deg] (05h35m14.5s) CUNIT2V = 'deg ' COMMENT CRPIX3V = 1 CDELT3V = 1.0 CTYPE3V = 'DEC ' CRVAL3V = -5.375222 / [deg] (-05:22:30.8) CUNIT3V = 'deg ' COMMENT RADESYSV= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXV= 2000.0 / Equinox J2000.0 COMMENT CRPIX4V = 1 CDELT4V = 1.0 CTYPE4V = 'STOKES ' CRVAL4V = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA-W2V' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.043804396E-2 / [] Relativistic beta of reference channel CDELT1B = 2.259876514E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:28:10 DATE = '2009-04-22T04:28:10' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-4.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-4.hdr new file mode 100644 index 0000000000000000000000000000000000000000..b1c6d1a9d1a81945987cc7bd709b7a3e03d888d2 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/spectra/orion-wave-4.hdr @@ -0,0 +1 @@ +SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 4 / number of data axes NAXIS1 = 4096 / length of data axis 1 NAXIS2 = 1 / length of data axis 2 NAXIS3 = 1 / length of data axis 3 NAXIS4 = 1 / length of data axis 4 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H COMMENT COMMENT This FITS file contains an example spectral WCS header constructed by COMMENT Mark Calabretta (ATNF) and Dirk Petry (ESO) based on an observation COMMENT of the Orion Kleinmann-Low nebula made by Andrew Walsh (JCU) and COMMENT Sven Thorwirth (MPIfR) using the Mopra radio telescope. COMMENT COMMENT The 110GHz 13CO 1-0 spectrum in this file is linear in wavelength, COMMENT having been regridded from a linear frequency axis, as observed. COMMENT COMMENT The reference pixel has been placed deliberately well outside the COMMENT the spectrum in order to test spectral-WCS-interpreting software. COMMENT COMMENT Spectral representations are: COMMENT F: Frequency ...frequency-like COMMENT E: Photon energy ...frequency-like COMMENT N: Wave number ...frequency-like COMMENT R: Radio velocity ...frequency-like COMMENT Wavelength (default) ...wavelength-like COMMENT O: Optical velocity ...wavelength-like COMMENT Z: Redshift ...wavelength-like COMMENT V: Relativistic velocity ...velocity-like COMMENT B: Relativistic beta ...velocity-like COMMENT COMMENT The Mopra radio telescope is operated by the Australia Telescope COMMENT National Facility. COMMENT COMMENT Author: Mark Calabretta, Australia Telescope National Facility COMMENT http://www.atnf.csiro.au/~mcalabre/index.html COMMENT 2009-04-22 COMMENT ---------------------------------------------------------------------- COMMENT OBJECT = 'Orion-KL' / Orion Kleinmann-Low nebula MOLECULE= '13CO ' / Carbon(13) monoxide TRANSITI= '1-0 ' / 1-0 transition DATE-OBS= '2006-07-09T20:29:00' / Date of observation TELESCOP= 'ATNF Mopra' / 22m mm-wave telescope OBSERVER= 'Walsh/Thorwirth' / Observers BUNIT = 'K ' / Brightness units, Kelvin COMMENT COMMENT ------------------------------------------------------------ Frequency COMMENT CRPIX1F = 32768.0 / Pixel coordinate of reference point CTYPE1F = 'FREQ-W2F' / Frequency, non-linear axis CRVAL1F = 102.6940613E+9 / [Hz] Frequency of reference channel CDELT1F = -2.332330873E+5 / [Hz] Channel spacing CUNIT1F = 'Hz ' / Units of coordinate increment and value COMMENT RESTFRQF= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVF= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSF= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSF= 'TOPOCENT' / Reference frame of observation VELOSYSF= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCF= 'LSRK ' / Reference frame of source redshift ZSOURCEF= 0.0000 / Redshift of the source COMMENT CRPIX2F = 1 CDELT2F = 1.0 CTYPE2F = 'RA ' CRVAL2F = 83.81042 / [deg] (05h35m14.5s) CUNIT2F = 'deg ' COMMENT CRPIX3F = 1 CDELT3F = 1.0 CTYPE3F = 'DEC ' CRVAL3F = -5.375222 / [deg] (-05:22:30.8) CUNIT3F = 'deg ' COMMENT RADESYSF= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXF= 2000.0 / Equinox J2000.0 COMMENT CRPIX4F = 1 CDELT4F = 1.0 CTYPE4F = 'STOKES ' CRVAL4F = 1 / Stokes I (total intensity) COMMENT COMMENT -------------------------------------------------------- Photon energy COMMENT CRPIX1E = 32768.0 / Pixel coordinate of reference point CTYPE1E = 'ENER-W2F' / Photon energy, non-linear axis CRVAL1E = 4.247088937E-4 / [eV] Photon energy of reference channel CDELT1E = -0.9645754124E-9 / [eV] Channel spacing CUNIT1E = 'eV ' / Units of coordinate increment and value COMMENT RESTFRQE= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVE= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSE= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSE= 'TOPOCENT' / Reference frame of observation VELOSYSE= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCE= 'LSRK ' / Reference frame of source redshift ZSOURCEE= 0.0000 / Redshift of the source COMMENT CRPIX2E = 1 CDELT2E = 1.0 CTYPE2E = 'RA ' CRVAL2E = 83.81042 / [deg] (05h35m14.5s) CUNIT2E = 'deg ' COMMENT CRPIX3E = 1 CDELT3E = 1.0 CTYPE3E = 'DEC ' CRVAL3E = -5.375222 / [deg] (-05:22:30.8) CUNIT3E = 'deg ' COMMENT RADESYSE= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXE= 2000.0 / Equinox J2000.0 COMMENT CRPIX4E = 1 CDELT4E = 1.0 CTYPE4E = 'STOKES ' CRVAL4E = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------------------- Wave number COMMENT CRPIX1N = 32768.0 / Pixel coordinate of reference point CTYPE1N = 'WAVN-W2F' / Wave number, non-linear axis CRVAL1N = 3.425505162E+2 / [/m] Wave number of reference channel CDELT1N = -7.779818375E-4 / [/m] Channel spacing CUNIT1N = '/m ' / Units of coordinate increment and value COMMENT RESTFRQN= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVN= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSN= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSN= 'TOPOCENT' / Reference frame of observation VELOSYSN= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCN= 'LSRK ' / Reference frame of source redshift ZSOURCEN= 0.0000 / Redshift of the source COMMENT CRPIX2N = 1 CDELT2N = 1.0 CTYPE2N = 'RA ' CRVAL2N = 83.81042 / [deg] (05h35m14.5s) CUNIT2N = 'deg ' COMMENT CRPIX3N = 1 CDELT3N = 1.0 CTYPE3N = 'DEC ' CRVAL3N = -5.375222 / [deg] (-05:22:30.8) CUNIT3N = 'deg ' COMMENT RADESYSN= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXN= 2000.0 / Equinox J2000.0 COMMENT CRPIX4N = 1 CDELT4N = 1.0 CTYPE4N = 'STOKES ' CRVAL4N = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------- Radio velocity COMMENT CRPIX1R = 32768.0 / Pixel coordinate of reference point CTYPE1R = 'VRAD-W2F' / Radio velocity, non-linear axis CRVAL1R = 2.042288396E+7 / [m/s] Radio velocity of reference channel CDELT1R = 6.344887666E+2 / [m/s] Channel spacing CUNIT1R = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQR= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVR= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSR= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSR= 'TOPOCENT' / Reference frame of observation VELOSYSR= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCR= 'LSRK ' / Reference frame of source redshift ZSOURCER= 0.0000 / Redshift of the source COMMENT CRPIX2R = 1 CDELT2R = 1.0 CTYPE2R = 'RA ' CRVAL2R = 83.81042 / [deg] (05h35m14.5s) CUNIT2R = 'deg ' COMMENT CRPIX3R = 1 CDELT3R = 1.0 CTYPE3R = 'DEC ' CRVAL3R = -5.375222 / [deg] (-05:22:30.8) CUNIT3R = 'deg ' COMMENT RADESYSR= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXR= 2000.0 / Equinox J2000.0 COMMENT CRPIX4R = 1 CDELT4R = 1.0 CTYPE4R = 'STOKES ' CRVAL4R = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------------- Wavelength COMMENT CRPIX1 = 32768.0 / Pixel coordinate of reference point CTYPE1 = 'WAVE ' / Wavelength in vacuuo, linear axis CRVAL1 = 2.919277457E-3 / [m] Wavelength of reference channel CDELT1 = 6.630101933E-9 / [m] Channel spacing CUNIT1 = 'm ' / Units of coordinate increment and value COMMENT RESTFRQ = 110201353000.0 / [Hz] 13CO line rest frequency RESTWAV = 0.00272040633 / [m] 13CO line rest wavelength SPECSYS = 'LSRK ' / Reference frame of spectral coordinates SSYSOBS = 'TOPOCENT' / Reference frame of observation VELOSYS = 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRC = 'LSRK ' / Reference frame of source redshift ZSOURCE = 0.0000 / Redshift of the source COMMENT CRPIX2 = 1 CDELT2 = 1.0 CTYPE2 = 'RA ' CRVAL2 = 83.81042 / [deg] (05h35m14.5s) CUNIT2 = 'deg ' COMMENT CRPIX3 = 1 CDELT3 = 1.0 CTYPE3 = 'DEC ' CRVAL3 = -5.375222 / [deg] (-05:22:30.8) CUNIT3 = 'deg ' COMMENT RADESYS = 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOX = 2000.0 / Equinox J2000.0 COMMENT CRPIX4 = 1 CDELT4 = 1.0 CTYPE4 = 'STOKES ' CRVAL4 = 1 / Stokes I (total intensity) COMMENT COMMENT ----------------------------------------------------- Optical velocity COMMENT CRPIX1O = 32768.0 / Pixel coordinate of reference point CTYPE1O = 'VOPT ' / Optical velocity, linear axis CRVAL1O = 2.191586755E+7 / [m/s] Optical velocity of reference channel CDELT1O = 7.306462036E+2 / [m/s] Channel spacing CUNIT1O = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQO= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVO= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSO= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSO= 'TOPOCENT' / Reference frame of observation VELOSYSO= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCO= 'LSRK ' / Reference frame of source redshift ZSOURCEO= 0.0000 / Redshift of the source COMMENT CRPIX2O = 1 CDELT2O = 1.0 CTYPE2O = 'RA ' CRVAL2O = 83.81042 / [deg] (05h35m14.5s) CUNIT2O = 'deg ' COMMENT CRPIX3O = 1 CDELT3O = 1.0 CTYPE3O = 'DEC ' CRVAL3O = -5.375222 / [deg] (-05:22:30.8) CUNIT3O = 'deg ' COMMENT RADESYSO= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXO= 2000.0 / Equinox J2000.0 COMMENT CRPIX4O = 1 CDELT4O = 1.0 CTYPE4O = 'STOKES ' CRVAL4O = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------------------- Redshift COMMENT CRPIX1Z = 32768.0 / Pixel coordinate of reference point CTYPE1Z = 'ZOPT ' / Redshift, linear axis CRVAL1Z = 7.310346531E-2 / [] Redshift of reference channel CDELT1Z = 2.437173398E-6 / [] Channel spacing COMMENT RESTFRQZ= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVZ= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSZ= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSZ= 'TOPOCENT' / Reference frame of observation VELOSYSZ= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCZ= 'LSRK ' / Reference frame of source redshift ZSOURCEZ= 0.0000 / Redshift of the source COMMENT CRPIX2Z = 1 CDELT2Z = 1.0 CTYPE2Z = 'RA ' CRVAL2Z = 83.81042 / [deg] (05h35m14.5s) CUNIT2Z = 'deg ' COMMENT CRPIX3Z = 1 CDELT3Z = 1.0 CTYPE3Z = 'DEC ' CRVAL3Z = -5.375222 / [deg] (-05:22:30.8) CUNIT3Z = 'deg ' COMMENT RADESYSZ= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXZ= 2000.0 / Equinox J2000.0 COMMENT CRPIX4Z = 1 CDELT4Z = 1.0 CTYPE4Z = 'STOKES ' CRVAL4Z = 1 / Stokes I (total intensity) COMMENT COMMENT ------------------------------------------------ Relativistic velocity COMMENT CRPIX1V = 32768.0 / Pixel coordinate of reference point CTYPE1V = 'VELO-W2V' / Relativistic velocity, non-linear axis CRVAL1V = 2.111679434E+7 / [m/s] Velocity of reference channel CDELT1V = 6.774939349E+2 / [m/s] Channel spacing CUNIT1V = 'm/s ' / Units of coordinate increment and value COMMENT RESTFRQV= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVV= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSV= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSV= 'TOPOCENT' / Reference frame of observation VELOSYSV= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCV= 'LSRK ' / Reference frame of source redshift ZSOURCEV= 0.0000 / Redshift of the source COMMENT CRPIX2V = 1 CDELT2V = 1.0 CTYPE2V = 'RA ' CRVAL2V = 83.81042 / [deg] (05h35m14.5s) CUNIT2V = 'deg ' COMMENT CRPIX3V = 1 CDELT3V = 1.0 CTYPE3V = 'DEC ' CRVAL3V = -5.375222 / [deg] (-05:22:30.8) CUNIT3V = 'deg ' COMMENT RADESYSV= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXV= 2000.0 / Equinox J2000.0 COMMENT CRPIX4V = 1 CDELT4V = 1.0 CTYPE4V = 'STOKES ' CRVAL4V = 1 / Stokes I (total intensity) COMMENT COMMENT ---------------------------------------------- Relativistic beta (v/c) COMMENT CRPIX1B = 32768.0 / Pixel coordinate of reference point CTYPE1B = 'BETA-W2V' / Relativistic beta (v/c), non-linear axis CRVAL1B = 7.043804396E-2 / [] Relativistic beta of reference channel CDELT1B = 2.259876514E-6 / [] Channel spacing COMMENT RESTFRQB= 110201353000.0 / [Hz] 13CO line rest frequency RESTWAVB= 0.00272040633 / [m] 13CO line rest wavelength SPECSYSB= 'LSRK ' / Reference frame of spectral coordinates SSYSOBSB= 'TOPOCENT' / Reference frame of observation VELOSYSB= 0.0 / [m/s] Bary-topo velocity towards the source SSYSSRCB= 'LSRK ' / Reference frame of source redshift ZSOURCEB= 0.0000 / Redshift of the source COMMENT CRPIX2B = 1 CDELT2B = 1.0 CTYPE2B = 'RA ' CRVAL2B = 83.81042 / [deg] (05h35m14.5s) CUNIT2B = 'deg ' COMMENT CRPIX3B = 1 CDELT3B = 1.0 CTYPE3B = 'DEC ' CRVAL3B = -5.375222 / [deg] (-05:22:30.8) CUNIT3B = 'deg ' COMMENT RADESYSB= 'FK5 ' / FK5 (IAU 1984) equatorial coordinates EQUINOXB= 2000.0 / Equinox J2000.0 COMMENT CRPIX4B = 1 CDELT4B = 1.0 CTYPE4B = 'STOKES ' CRVAL4B = 1 / Stokes I (total intensity) COMMENT HISTORY fimgcreate 1.0b at 2009-04-22T04:28:18 DATE = '2009-04-22T04:28:18' / file creation date (YYYY-MM-DDThh:mm:ss UT) \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/sub-segfault.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/sub-segfault.hdr new file mode 100644 index 0000000000000000000000000000000000000000..92a00401d8226ee783bbaaf88fe73b2ad949b549 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/sub-segfault.hdr @@ -0,0 +1,28 @@ +WCSAXES = 4 / Number of coordinate axes +CRPIX1 = 8193 / Pixel coordinate of reference point +CRPIX2 = 8193 / Pixel coordinate of reference point +CRPIX3 = 1 / Pixel coordinate of reference point +CRPIX4 = 1 / Pixel coordinate of reference point +CDELT1 = -0.000555555555556 / [deg] Coordinate increment at reference point +CDELT2 = 0.000555555555556 / [deg] Coordinate increment at reference point +CDELT3 = 1 / Coordinate increment at reference point +CDELT4 = 33333332 / [Hz] Coordinate increment at reference point +CUNIT1 = 'deg' / Units of coordinate increment and value +CUNIT2 = 'deg' / Units of coordinate increment and value +CUNIT4 = 'Hz' / Units of coordinate increment and value +CTYPE1 = 'RA---SIN' / Right ascension, orthographic/synthesis project +CTYPE2 = 'DEC--SIN' / Declination, orthographic/synthesis projection +CTYPE3 = 'STOKES' / Coordinate type code +CTYPE4 = 'FREQ' / Frequency (linear) +CRVAL1 = 35.3324166667 / [deg] Coordinate value at reference point +CRVAL2 = -4.51685555556 / [deg] Coordinate value at reference point +CRVAL3 = 1 / Coordinate value at reference point +CRVAL4 = 322601561.836 / [Hz] Coordinate value at reference point +LONPOLE = 180 / [deg] Native longitude of celestial pole +LATPOLE = -4.51685555556 / [deg] Native latitude of celestial pole +RESTFRQ = 306000000 / [Hz] Line rest frequency +RESTWAV = 0 / [Hz] Line rest wavelength +EQUINOX = 2000 / [yr] Equinox of equatorial coordinates +SPECSYS = 'TOPOCENT' / Reference frame of spectral coordinates +MJD-OBS = 55794 / [d] MJD of observation matching DATE-OBS +DATE-OBS= '2011-08-21T00:00:00.000000' / ISO-8601 observation date matching MJD- \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/too_many_pv.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/too_many_pv.hdr new file mode 100644 index 0000000000000000000000000000000000000000..eb1a495fe98f584eec8ae85848c7d0563e65f9f2 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/too_many_pv.hdr @@ -0,0 +1 @@ +SIMPLE = T / Fits standard BITPIX = 16 / FOUR-BYTE SINGLE PRECISION FLOATING POINT NAXIS = 2 / STANDARD FITS FORMAT NAXIS1 = 2048 / STANDARD FITS FORMAT NAXIS2 = 4096 / STANDARD FITS FORMAT ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file DATE = '2011-08-01T15:14:04' / File creation date (YYYY-MM-DDThh:mm:ss UT) / PTF DMASK BIT DEFINITIONS BIT00 = 0 / AIRCRAFT/SATELLITE TRACK BIT01 = 1 / OBJECT (detected by SExtractor) BIT02 = 2 / HIGH DARK-CURRENT BIT03 = 3 / RESERVED FOR FUTURE USE BIT04 = 4 / NOISY BIT05 = 5 / GHOST BIT06 = 6 / CCD BLEED BIT07 = 7 / RAD HIT BIT08 = 8 / SATURATED BIT09 = 9 / DEAD/BAD BIT10 = 10 / NAN (not a number) BIT11 = 11 / DIRTY (10-sigma below coarse local median) BIT12 = 12 / HALO BIT13 = 13 / RESERVED FOR FUTURE USE BIT14 = 14 / RESERVED FOR FUTURE USE BIT15 = 15 / RESERVED FOR FUTURE USE / DATA FLOW PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pixel-mask pathname PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Pixel-mask filename UDMPROC = 'updatemask' / Update bit in dmask UDMVERSN= 1. / Version of updatemask program UDMOP = 0 / Operation type UDMMBT = 4 / Mask bit template UDMIFIL = 'bpm_2009060s_c07.v1.fits' / Program updatemask input file UDMOFIL = 'bpm_2009060s_c07.v2.fits' / Program updatemask output file MCVERSN = 1. / Version of ptfMaskCombine program PTFPPROC= 'ptfPostProc' / Flags proc NaNs, CCD-bleeds and rad hits PPRVERSN= 3. / Version of ptfPostProc program / COPY OF IMAGE HEADER BELOW ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file TELESCOP= 'P48 ' / Name of telescope INSTRUME= 'PTF/MOSAIC' / Instrument name OBSERVER= 'KulkarniPTF' / Observer name and project CCDID = '7 ' / CCD number (0..11) DATE-OBS= '2009-06-25T08:41:23.970' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS DATE = '2011-07-30T15:04:59' / File creation date (YYYY-MM-DDThh:mm:ss UT) REFERENC= 'http://www.astro.caltech.edu/ptf' / URL of PTF website / PROPOSAL INFORMATION PTFPRPI = 'Kulkarni' / PTF Project PI PTFPID = '20000 ' / Project type: 00000-49999 OBJECT = 'PTF_survey' / Fields object PTFFIELD= '2899 ' / PTF unique field ID PTFFLAG = '1 ' / 1 = PTF; 0 = non-PTF category / TIME AND EXPOSURE INFORMATION FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '2 ' / Filter changer slot position EXPTIME = 60. / [s] Requested exposure time AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2009-06-25T08:41:23.970' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.OBSJD = 2455007.86207 / [day] Julian day corresponds to UTC-OBS OBSMJD = 55007.36207 / MJD corresponds to UTC-OBS (day) OBSLST = '19:08:26.70' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '-3:09:09.78' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2455007.86457 / [day] Heliocentric Julian Day OBSTYPE = 'object ' / Image type (dark,science,bias,focus) IMGTYP = 'object ' / Image type (dark,science,bias,focus) / MOON AND SUN MOONRA = 131.676395 / [deg] Moon J2000.0 R.A. MOONDEC = 16.207046 / [deg] Moon J2000.0 Dec. MOONILLF= 0.095389 / [frac] Moon illuminated fraction MOONPHAS= 144.0201 / [deg] Moon phase angle MOONESB = -0. / Moon excess in sky brightness V-band MOONALT = -35.16959 / [deg] Moon altitude SUNAZ = 13.90467 / [deg] Sun azimuth SUNALT = -31.96011 / [deg] Sun altitude / PHOTOMETRY BUNIT = 'DN ' / Data number (analog-to-digital units or ADU) PHTCALEX= 1 / Was phot.-cal. module executed? PHTCALFL= 0 / Flag for image is photometric (0=N, 1=Y) PCALRMSE= 0.030059 / RMSE from (zeropoint, extinction) data fit IMAGEZPT= 22.43948 / Image magnitude zeropoint IZPORIG = 'CALTRANS' / Photometric-calibration origin ZPRULE = 'COMPUTE ' / Photometric-calibration method MAGZPT = 22.73683 / Magnitude zeropoint at airmass=1 EXTINCT = 0.17995 / Extinction APSFILT = 'r ' / SDSS filter used in abs phot cal APSCOL = 'r-i ' / SDSS color used in abs phot cal APRMS = 0.0554857 / RMS in mag of final abs phot cal APBSRMS = 0.03911367 / RMS in mag of final abs phot cal for bright staAPNSTDI1= 69501 / Number of standard stars in first iteration APNSTDIF= 64858 / Number of standard stars in final iteration APCHI2 = 325618.88012443 / Chi2 of final abs phot cal APDOF = 64858. / Dof of chi2 of final abs phot cal APMEDJD = 2455007.84500722 / Median JD used in abs phot cal APPN01 = 'ZeroPoint' / Name of parameter abs phot cal 01 APPAR01 = 22.81878918 / Value of parameter abs phot cal 01 APPARE01= 0.00198923 / Error of parameter abs phot cal 01 APPN02 = 'ColorTerm' / Name of parameter abs phot cal 02 APPAR02 = 0.20481246 / Value of parameter abs phot cal 02 APPARE02= 0.00278076 / Error of parameter abs phot cal 02 APPN03 = 'AirMassTerm' / Name of parameter abs phot cal 03 APPAR03 = -0.12104427 / Value of parameter abs phot cal 03 APPARE03= 0.0011621 / Error of parameter abs phot cal 03 APPN04 = 'AirMassColorTerm' / Name of parameter abs phot cal 04 APPAR04 = 0.00904321 / Value of parameter abs phot cal 04 APPARE04= 0.00176968 / Error of parameter abs phot cal 04 APPN05 = 'TimeTerm' / Name of parameter abs phot cal 05 APPAR05 = 0.03012546 / Value of parameter abs phot cal 05 APPARE05= 0.00459951 / Error of parameter abs phot cal 05 APPN06 = 'Time2Term' / Name of parameter abs phot cal 06 APPAR06 = 1.27460327 / Value of parameter abs phot cal 06 APPARE06= 0.07646497 / Error of parameter abs phot cal 06 APPN07 = 'XTerm ' / Name of parameter abs phot cal 07 APPAR07 = 0.00768843 / Value of parameter abs phot cal 07 APPARE07= 0.00083226 / Error of parameter abs phot cal 07 APPN08 = 'YTerm ' / Name of parameter abs phot cal 08 APPAR08 = 0.06680527 / Value of parameter abs phot cal 08 APPARE08= 0.00203667 / Error of parameter abs phot cal 08 APPN09 = 'Y2Term ' / Name of parameter abs phot cal 09 APPAR09 = 0.31486016 / Value of parameter abs phot cal 09 APPARE09= 0.00318862 / Error of parameter abs phot cal 09 APPN10 = 'Y3Term ' / Name of parameter abs phot cal 10 APPAR10 = 0.69934253 / Value of parameter abs phot cal 10 APPARE10= 0.01257477 / Error of parameter abs phot cal 10 APPN11 = 'XYTerm ' / Name of parameter abs phot cal 11 APPAR11 = -0.04590337 / Value of parameter abs phot cal 11 APPARE11= 0.00286729 / Error of parameter abs phot cal 11 / ASTROMETRY CRVAL1 = 333.443801401309 / [deg] RA of reference point CRVAL2 = 3.08905544069643 / [deg] DEC of reference point CRPIX1 = 1175.019 / [pix] Image reference point CRPIX2 = 945.8826 / [pix] Image reference point CTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions CTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions CUNIT1 = 'deg ' / Image axis-1 celestial-coordinate units CUNIT2 = 'deg ' / Image axis-2 celestial-coordinate units CRTYPE1 = 'deg ' / Data units of CRVAL1 CRTYPE2 = 'deg ' / Data units of CRVAL2 CD1_1 = 0.000281094342514378 / Transformation matrix CD1_2 = -5.00875320999652E-09 CD2_1 = -2.08930602680508E-07 CD2_2 = -0.000281284158795544 OBJRA = '22:17:08.571' / Requested field J2000.0 Ra. OBJDEC = '+03:22:30.00' / Requested field J2000.0 Dec. OBJRAD = 334.285714 / [deg] Requested field RA (J2000.0) OBJDECD = 3.375 / [deg] Requested field Dec (J2000.0) PIXSCALE= 1.01 / [arcsec/pix] Pixel scale WCSAXES = 2 EQUINOX = 2000. / [yr] Equatorial coordinates definition LONPOLE = 180. LATPOLE = 0. / IMAGE QUALITY SEEING = 2.04 / [pix] Seeing FWHM PEAKDIST= 0.396793397122491 / [pix] Mean dist brightest pixel-centroid pixel ELLIP = 0.063 / Mean image ellipticity A/B ELLIPPA = 48.65 / [deg] Mean image ellipticity PA FBIAS = 1060.884 / [DN] Floating bias of the image SATURVAL= 17000. / [DN] Saturation value of the CCD array FWHMSEX = 2.45 / [arcsec] SExtractor SEEING estimate MDSKYMAG= 20.53072 / [mag/s-arcsec^2] Median sky obsolete MSMAPCZP= 20.70926 / [mag/s-arcsec^2] Median sky abs. phot. cal. LIMITMAG= 20.92587 / [mag/s-arcsec^2] Limiting magnitude obsolete LMGAPCZP= 21.10442 / [mag/s-arcsec^2] Limiting mag. abs. phot. cal. MEDFWHM = 2.931446 / [arcsecond] Median FWHM MEDELONG= 1.132416 / [dimensionless] Median elongation STDELONG= 0.3298569 / [dimensionless] Std. dev. of elongation MEDTHETA= -42.28234 / [deg] Atan(median sin(theta)/median cos(theta))STDTHETA= 66.21399 / [deg] Atan(stddev sin(theta)/stddev cos(theta))MEDDLMAG= 33.85928 / [mag/s-arcsec^2] Median (MU_MAX-MAG_AUTO) STDDLMAG= 0.4367887 / [mag/s-arcsec^2] Stddev of (MU_MAX-MAG_AUTO) / OBSERVATORY AND TCS OCS_TIME= '2009-06-25T08:41:23.978' / UTC Date for OCS calc time-dep params OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode OBSLAT = 33.3574 / [deg] Telescope geodetic latitude in WGS84 OBSLON = 116.8599 / [deg] Telescope geodetic longitude in WGS84 OBSALT = 1703.2 / [m] Telescope geodetic altitude in WGS84 DEFOCUS = 0. / [mm] Focus position - nominal focus FOCUSPOS= 1.3851 / [mm] Exposures focusPos DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 23.7 / [arcsec/hr] Track speed RA rel to sidereal TRACKDEC= -11.2 / [arcsec/hr] Track speed Dec rel to sidereal AZIMUTH = 113.8682 / [deg] Telescope Azimuth ALTITUDE= 36.81047 / [deg] Telescope altitude AIRMASS = 1.666232 / Telescope airmass TELRA = 334.402 / [deg] Telescope ap equinox of date RA TELDEC = 3.4225 / [deg] Telescope ap equinox of date Dec TELHA = 312.7096 / [deg] Telescope ap equinox of date HA DOMEAZ = 112.8563 / [deg] Dome azimuth WINDSCAL= 10.466 / [deg] Wind screen altitude WINDDIR = 2.2 / [deg] Azimuth of wind direction WINDSPED= 14.6328 / Wind speed (km/hour) OUTTEMP = 20.94444 / [C] Outside temperature OUTRELHU= 0.09 / [frac] Outside relative humidity OUTDEWPT= -12.94444 / [C] Outside dew point / INSTRUMENT TELEMETRY PANID = '_p48s ' / PAN identification DHSID = '_p48s ' / DHS identification ROISTATE= 'ROI ' / ROI State (FULL | ROI) CCDSEC = '[1:2048,1:4096]' / CCD section CCDSIZE = '[1:2048,1:4096]' / CCD size DATASEC = '[1:2048,1:4096]' / Data section DETSEC = '[1:2048,1:4096]' / Detector section ROISEC = '[1:2048,1:4096]' / ROI section FPA = 'P48MOSAIC' / Focal plan array CCDNAME = 'W94C2 ' / Detector mfg serial number CHECKSUM= 'O3aBP1ZBO1aBO1YB' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = '395763289' / Data unit checksum updated 2010-03-15T13:06:37 DHEINF = 'SDSU, Gen-III' / Controller info DHEFIRM = '/usr/src/dsp/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / Camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / Astropci software version DETID = 'PTF/MOSAIC' / Detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / Source for header information DATAMIN = 0. / Minimum value for array ROISTATE= 'ROI ' / ROI State (FULL | ROI) LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 175.003 / [K] 0x0 servo temp sensor on CCD09 HSTEMP = 148.207 / [K] 0x1 heat spreader temp DHE0TEMP= 295.951 / [K] 0x2 detector head electronics temp, master DHE1TEMP= 298.162 / [K] 0x3 detector head electronics temp, slave DEWWTEMP= 284.71 / [K] 0x4 dewar wall temp HEADTEMP= 138.414 / [K] 0x5 cryo cooler cold head temp CCD5TEMP= 174.91 / [K] 0x6 temp sensor on CCD05 CCD11TEM= 176.061 / [K] 0x7 temp sensor on CCD11 CCD0TEMP= 169.515 / [K] 0x8 temp sensor on CCD00 RSTEMP = 232.61 / [K] 0x9 temp sensor on radiation shield DEWPRESS= 0.82 / [milli-torr] Dewar pressure DETHEAT = 38. / [%] Detector focal plane heater power NAMPSXY = '6 2 ' / Number of amplifiers in x y CCDSUM = '1 1 ' / [pix] Binning in x and y MODELFOC= 'N/A ' / MODELFOC CHECKSUM= '6aLZ8ZKZ6aKZ6YKZ' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = ' 0' / Data unit checksum (2010-03-15T13:06:37) GAIN = 1.7 / [e-/D.N.] Gain of detector. READNOI = 5.1 / [e-] Read noise of detector. DARKCUR = 0.1 / [e-/s] Dark current of detector / SCAMP DISTORTION KEYWORDS RADECSYS= 'ICRS ' / Astrometric system PV1_0 = 0. / Projection distortion parameter PV1_1 = 1. / Projection distortion parameter PV1_2 = 0. / Projection distortion parameter PV1_4 = 0.000811808026654439 / Projection distortion parameter PV1_5 = 0.000610424561546246 / Projection distortion parameter PV1_6 = 0.000247550637436069 / Projection distortion parameter PV1_7 = 0.000103962986153903 / Projection distortion parameter PV1_8 = -0.000463678684598807 / Projection distortion parameter PV1_9 = -0.000431244263972048 / Projection distortion parameter PV1_10 = -0.000152691163850316 / Projection distortion parameter PV1_12 = -0.00204628855915067 / Projection distortion parameter PV1_13 = -0.00173071932398225 / Projection distortion parameter PV1_14 = 0.000212015319199711 / Projection distortion parameter PV1_15 = -0.000489268678679085 / Projection distortion parameter PV1_16 = -0.000182891514774611 / Projection distortion parameter PV2_0 = 0. / Projection distortion parameter PV2_1 = 1. / Projection distortion parameter PV2_2 = 0. / Projection distortion parameter PV2_4 = 0.000273521447624334 / Projection distortion parameter PV2_5 = 0.000876139200581004 / Projection distortion parameter PV2_6 = -0.000122736852992318 / Projection distortion parameter PV2_7 = -0.00115870481394187 / Projection distortion parameter PV2_8 = 0.000744209714565589 / Projection distortion parameter PV2_9 = -0.00031431316953523 / Projection distortion parameter PV2_10 = -0.00025720525696749 / Projection distortion parameter PV2_12 = -0.00074859772103692 / Projection distortion parameter PV2_13 = 0.000838107200656415 / Projection distortion parameter PV2_14 = -0.00012633881376049 / Projection distortion parameter PV2_15 = -0.0020312867769692 / Projection distortion parameter PV2_16 = 0.00524608854745148 / Projection distortion parameter FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0. / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0. / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 3.620458E-05 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 3.332156E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 0. / SCAMP relative flux scale MAGZEROP= 0. / SCAMP zero-point PHOTIRMS= 0. / mag dispersion RMS (internal, high S/N) RA_RMS = 0.1655724 / [arcsec] RMS of SCAMP fit from 2MASS matching DEC_RMS = 0.1891921 / [arcsec] RMS of SCAMP fit from 2MASS matching ASTROMN = 384 / Number of stars in SCAMP astrometric solution SCAMPPTH= '/ptf/pos/archive/fallbackcal/scamp/7/' / SCAMP catalog path SCAMPFIL= 'PTF_201006174759_c_e_uca3_t112521_u001916251_f02_p002899_c07.fits' / SIP DISTORTION KEYWORDS A_ORDER = 4 / Distortion order for A A_0_2 = 6.96807813586153E-08 / Projection distortion parameter A_0_3 = 1.20881759870351E-11 / Projection distortion parameter A_0_4 = -4.07297345125509E-15 / Projection distortion parameter A_1_1 = -1.71602989085006E-07 / Projection distortion parameter A_1_2 = -3.40958003336147E-11 / Projection distortion parameter A_1_3 = 1.08769435952671E-14 / Projection distortion parameter A_2_0 = 2.28067760155696E-07 / Projection distortion parameter A_2_1 = 3.6610309234789E-11 / Projection distortion parameter A_2_2 = 4.73755078335384E-15 / Projection distortion parameter A_3_0 = 8.24210855193549E-12 / Projection distortion parameter A_3_1 = 3.84753767306115E-14 / Projection distortion parameter A_4_0 = -4.54223812412034E-14 / Projection distortion parameter A_DMAX = 1.53122472683886 / Projection distortion parameter B_ORDER = 4 / Distortion order for B B_0_2 = -7.69933957449607E-08 / Projection distortion parameter B_0_3 = -9.16855566272424E-11 / Projection distortion parameter B_0_4 = 1.66630509620112E-14 / Projection distortion parameter B_1_1 = 2.46289708854316E-07 / Projection distortion parameter B_1_2 = -5.90207917198792E-11 / Projection distortion parameter B_1_3 = 1.86811615261732E-14 / Projection distortion parameter B_2_0 = 3.44908367419592E-08 / Projection distortion parameter B_2_1 = -2.49509936365959E-11 / Projection distortion parameter B_2_2 = 2.84841315780067E-15 / Projection distortion parameter B_3_0 = 2.02845080441181E-11 / Projection distortion parameter B_3_1 = -4.51317603382652E-14 / Projection distortion parameter B_4_0 = -1.16438849571175E-13 / Projection distortion parameter B_DMAX = 2.89468553502114 / Projection distortion parameter AP_ORDER= 4 / Distortion order for AP AP_0_1 = -2.3927681685928E-08 / Projection distortion parameter AP_0_2 = -6.97379868441328E-08 / Projection distortion parameter AP_0_3 = -1.21069584606865E-11 / Projection distortion parameter AP_0_4 = 4.07524721573973E-15 / Projection distortion parameter AP_1_0 = 5.65239128994064E-08 / Projection distortion parameter AP_1_1 = 1.71734217296344E-07 / Projection distortion parameter AP_1_2 = 3.41724875038451E-11 / Projection distortion parameter AP_1_3 = -1.08775499102067E-14 / Projection distortion parameter AP_2_0 = -2.28068482487158E-07 / Projection distortion parameter AP_2_1 = -3.66548961802381E-11 / Projection distortion parameter AP_2_2 = -4.75858241735224E-15 / Projection distortion parameter AP_3_0 = -8.24781966878619E-12 / Projection distortion parameter AP_3_1 = -3.85281201904104E-14 / Projection distortion parameter AP_4_0 = 4.54275049666924E-14 / Projection distortion parameter BP_ORDER= 4 / Distortion order for BP BP_0_1 = -1.50638746640517E-07 / Projection distortion parameter BP_0_2 = 7.70565767927487E-08 / Projection distortion parameter BP_0_3 = 9.18374546897802E-11 / Projection distortion parameter BP_0_4 = -1.66839467627906E-14 / Projection distortion parameter BP_1_0 = -4.87195269294628E-08 / Projection distortion parameter BP_1_1 = -2.46371690411844E-07 / Projection distortion parameter BP_1_2 = 5.9111535979953E-11 / Projection distortion parameter BP_1_3 = -1.87729776729012E-14 / Projection distortion parameter BP_2_0 = -3.46046151217313E-08 / Projection distortion parameter BP_2_1 = 2.51320825919019E-11 / Projection distortion parameter BP_2_2 = -2.85758325791527E-15 / Projection distortion parameter BP_3_0 = -2.04221364218494E-11 / Projection distortion parameter BP_3_1 = 4.51336286236569E-14 / Projection distortion parameter BP_4_0 = 1.16567578965612E-13 / Projection distortion parameter / DATA FLOW ORIGNAME= '/data/PTF_default_38068.fits' / Filename as written by the camera FILENAME= 'PTF200906253621_2_o_38068.fits' / Filename of delivered camera image PROCORIG= 'IPAC-PTF pipelines' / Processing origin PROCDATE= 'Tue Feb 21 03:34:46 2012' / Processing date/time (Pacific time) PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pathname of pixel mask PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Filename of pixel mask SFLATPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p4/cId45986/' / Pathname of super SFLATFIL= 'PTF_200906250000_i_s_flat_t120000_u000045986_f02_p000000_c07.fits' SBIASPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p1/cId45922/' / Pathname of super SBIASFIL= 'PTF_200906250000_i_s_bias_t120000_u000045922_f00_p000000_c07.fits' DBNID = 121 / Database night ID DBEXPID = 22920 / Database exposure ID DBRID = 3663141 / Database raw-image ID DBPID = 12052003 / Database processed-image ID DBFID = 2 / Database filter ID DBPIID = 1 / Database P.I. ID DBPRID = 3 / Database project ID DBFIELD = 22920 / Database field ID DBSVID = 50 / Database software-version ID DBCVID = 56 / Database config-data-file ID END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/tpvonly.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/tpvonly.hdr new file mode 100644 index 0000000000000000000000000000000000000000..79f236c8757c2542cb88ea345a3f9507a0d757a9 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/tpvonly.hdr @@ -0,0 +1 @@ +SIMPLE = T / Fits standard BITPIX = -32 / FOUR-BYTE SINGLE PRECISION FLOATING POINT NAXIS = 2 / STANDARD FITS FORMAT NAXIS1 = 2048 / STANDARD FITS FORMAT NAXIS2 = 4096 / STANDARD FITS FORMAT ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file TELESCOP= 'P48 ' / Name of telescope INSTRUME= 'PTF/MOSAIC' / Instrument name OBSERVER= 'KulkarniPTF' / Observer name and project CCDID = '5 ' / CCD number (0..11) DATE-OBS= '2014-07-31T04:49:58.673' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS DATE = '2014-07-31T19:20:32' / File creation date (YYYY-MM-DDThh:mm:ss UT) REFERENC= 'http://www.astro.caltech.edu/ptf' / URL of PTF website / PROPOSAL INFORMATION PTFPRPI = 'Kulkarni' / PTF Project PI PTFPID = '52002 ' / Project type: 00000-49999 OBJECT = 'Galactic_Plane' / Fields object PTFFIELD= '1549 ' / PTF unique field ID PTFFLAG = '1 ' / 1 = PTF; 0 = non-PTF category / TIME AND EXPOSURE INFORMATION FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '1 ' / Filter changer slot position EXPTIME = 60. / [s] Requested exposure time AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2014-07-31T04:49:58.673' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.OBSJD = 2456869.70137 / [day] Julian day corresponds to UTC-OBS OBSMJD = 56869.20137 / MJD corresponds to UTC-OBS (day) OBSLST = '17:37:29.36' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '-0:42:20.82' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2456869.70618 / [day] Heliocentric Julian Day OBSTYPE = 'object ' / Image type (dark,science,bias,focus) IMGTYP = 'object ' / Image type (dark,science,bias,focus) / MOON AND SUN MOONRA = 173.116974 / [deg] Moon J2000.0 R.A. MOONDEC = -0.404999 / [deg] Moon J2000.0 Dec. MOONILLF= 0.155837 / [frac] Moon illuminated fraction MOONPHAS= 133.4978 / [deg] Moon phase angle MOONESB = -0. / Moon excess in sky brightness V-band MOONALT = -1.271649 / [deg] Moon altitude SUNAZ = 312.4731 / [deg] Sun azimuth SUNALT = -22.25475 / [deg] Sun altitude / PHOTOMETRY BUNIT = 'DN ' / Data number (analog-to-digital units or ADU) PHTCALEX= 1 / Was phot.-cal. module executed? PHTCALFL= 0 / Flag for image is photometric (0=N, 1=Y) PCALRMSE= 0.171135 / RMSE from (zeropoint, extinction) data fit IMAGEZPT= 21.22791 / Image magnitude zeropoint IZPORIG = 'CALTRANS' / Photometric-calibration origin ZPRULE = 'COMPUTE ' / Photometric-calibration method MAGZPT = 23.55079 / Magnitude zeropoint at airmass=1 EXTINCT = 1.163014 / Extinction APSFILT = 'r ' / SDSS filter used in abs phot cal APSCOL = 'r-i ' / SDSS color used in abs phot cal APRMS = 0.06677995 / RMS in mag of final abs phot cal APBSRMS = 0.05033556 / RMS in mag of final abs phot cal for bright staAPNSTDI1= 308233 / Number of standard stars in first iteration APNSTDIF= 274569 / Number of standard stars in final iteration APCHI2 = 1861590.34570444 / Chi2 of final abs phot cal APDOF = 274569. / Dof of chi2 of final abs phot cal APMEDJD = 2456869.84882722 / Median JD used in abs phot cal APPN01 = 'ZeroPoint' / Name of parameter abs phot cal 01 APPAR01 = 23.67499643 / Value of parameter abs phot cal 01 APPARE01= 0.00324545 / Error of parameter abs phot cal 01 APPN02 = 'ColorTerm' / Name of parameter abs phot cal 02 APPAR02 = 0.44908632 / Value of parameter abs phot cal 02 APPARE02= 0.00423336 / Error of parameter abs phot cal 02 APPN03 = 'AirMassTerm' / Name of parameter abs phot cal 03 APPAR03 = -0.18342823 / Value of parameter abs phot cal 03 APPARE03= 0.00288243 / Error of parameter abs phot cal 03 APPN04 = 'AirMassColorTerm' / Name of parameter abs phot cal 04 APPAR04 = -0.14534473 / Value of parameter abs phot cal 04 APPARE04= 0.00381178 / Error of parameter abs phot cal 04 APPN05 = 'TimeTerm' / Name of parameter abs phot cal 05 APPAR05 = 0.42239539 / Value of parameter abs phot cal 05 APPARE05= 0.0019644 / Error of parameter abs phot cal 05 APPN06 = 'Time2Term' / Name of parameter abs phot cal 06 APPAR06 = 0.16770061 / Value of parameter abs phot cal 06 APPARE06= 0.01549427 / Error of parameter abs phot cal 06 APPN07 = 'XTerm ' / Name of parameter abs phot cal 07 APPAR07 = 0.02152189 / Value of parameter abs phot cal 07 APPARE07= 0.00047932 / Error of parameter abs phot cal 07 APPN08 = 'YTerm ' / Name of parameter abs phot cal 08 APPAR08 = 0.02739724 / Value of parameter abs phot cal 08 APPARE08= 0.00117248 / Error of parameter abs phot cal 08 APPN09 = 'Y2Term ' / Name of parameter abs phot cal 09 APPAR09 = 0.01522565 / Value of parameter abs phot cal 09 APPARE09= 0.0018581 / Error of parameter abs phot cal 09 APPN10 = 'Y3Term ' / Name of parameter abs phot cal 10 APPAR10 = -0.23390906 / Value of parameter abs phot cal 10 APPARE10= 0.00723349 / Error of parameter abs phot cal 10 APPN11 = 'XYTerm ' / Name of parameter abs phot cal 11 APPAR11 = -0.00677493 / Value of parameter abs phot cal 11 APPARE11= 0.00169149 / Error of parameter abs phot cal 11 / ASTROMETRY CRVAL1 = 274.806945708898 / [deg] RA of reference point CRVAL2 = -25.9746476963393 / [deg] DEC of reference point CRPIX1 = -3925.16 / [pix] Image reference point CRPIX2 = 4360.23 / [pix] Image reference point CTYPE1 = 'RA---TPV' / TAN (gnomic) projection + SIP distortions CTYPE2 = 'DEC--TPV' / TAN (gnomic) projection + SIP distortions CUNIT1 = 'deg ' / Image axis-1 celestial-coordinate units CUNIT2 = 'deg ' / Image axis-2 celestial-coordinate units CRTYPE1 = 'deg ' / Data units of CRVAL1 CRTYPE2 = 'deg ' / Data units of CRVAL2 CD1_1 = 0.000286102658601581 / Transformation matrix CD1_2 = -6.28816628331811E-07 CD2_1 = -5.77207018114522E-06 CD2_2 = -0.000281525256171892 OBJRA = '18:18:56.842' / Requested field J2000.0 Ra. OBJDEC = '-25:52:30.00' / Requested field J2000.0 Dec. OBJRAD = 274.73684 / [deg] Requested field RA (J2000.0) OBJDECD = -25.875 / [deg] Requested field Dec (J2000.0) PIXSCALE= 1.01 / [arcsec/pix] Pixel scale EQUINOX = 2000. / [yr] Equatorial coordinates definition / IMAGE QUALITY SEEING = 2.95 / [pix] Seeing FWHM PEAKDIST= 0.481336680505667 / [pix] Mean dist brightest pixel-centroid pixel ELLIP = 0.313 / Mean image ellipticity A/B ELLIPPA = 48.58 / [deg] Mean image ellipticity PA FBIAS = 785.8855 / [DN] Floating bias of the image SATURVAL= 50000. / [DN] Saturation value of the CCD array FWHMSEX = 2.45 / [arcsec] SExtractor SEEING estimate MSMAPCZP= 19.20814 / [mag/s-arcsec^2] Median sky abs. phot. cal. LMGAPCZP= 20.68008 / [mag/s-arcsec^2] Limiting mag. abs. phot. cal. MEDFWHM = 3.417924 / [arcsecond] Median FWHM MEDELONG= 1.406608 / [dimensionless] Median elongation STDELONG= 0.592749 / [dimensionless] Std. dev. of elongation MEDTHETA= -31.22347 / [deg] Atan(median sin(theta)/median cos(theta))STDTHETA= 65.37225 / [deg] Atan(stddev sin(theta)/stddev cos(theta))MEDDLMAG= 2.444709 / [mag/s-arcsec^2] Median (MU_MAX-MAG_AUTO) STDDLMAG= 0.4154117 / [mag/s-arcsec^2] Stddev of (MU_MAX-MAG_AUTO) / OBSERVATORY AND TCS OCS_TIME= '2014-07-31T04:49:58.613' / UTC Date for OCS calc time-dep params OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode OBSLAT = 33.3574 / [deg] Telescope geodetic latitude in WGS84 OBSLON = -116.8599 / [deg] Telescope geodetic longitude in WGS84 OBSALT = 1703.2 / [m] Telescope geodetic altitude in WGS84 DEFOCUS = 0. / [mm] Focus position - nominal focus FOCUSPOS= 1.3655 / [mm] Exposures focusPos DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 20.4 / [arcsec/hr] Track speed RA rel to sidereal TRACKDEC= -3.9 / [arcsec/hr] Track speed Dec rel to sidereal AZIMUTH = 169.2328 / [deg] Telescope Azimuth ALTITUDE= 29.95342 / [deg] Telescope altitude AIRMASS = 1.997293 / Telescope airmass TELRA = 274.9591 / [deg] Telescope ap equinox of date RA TELDEC = -25.8684 / [deg] Telescope ap equinox of date Dec TELHA = 349.4138 / [deg] Telescope ap equinox of date HA DOMEAZ = 169.4477 / [deg] Dome azimuth WINDSCAL= 12.8995 / [deg] Wind screen altitude WINDDIR = 1.3 / [deg] Azimuth of wind direction WINDSPED= 14.472 / Wind speed (km/hour) OUTTEMP = 22.16667 / [C] Outside temperature OUTRELHU= 0.513 / [frac] Outside relative humidity OUTDEWPT= 11.61111 / [C] Outside dew point / INSTRUMENT TELEMETRY PANID = '_p48m ' / PAN identification DHSID = '_p48m ' / DHS identification CCDSEC = '[1:2048,1:4096]' / CCD section CCDSIZE = '[1:2048,1:4096]' / CCD size DATASEC = '[1:2048,1:4096]' / Data section DETSEC = '[1:2048,1:4096]' / Detector section ROISEC = '[1:2048,1:4096]' / ROI section FPA = 'P48MOSAIC' / Focal plan array CCDNAME = 'W53C2 ' / Detector mfg serial number CHECKSUM= 'fGoXhEmXfEmXfEmX' / Image header unit checksum DATASUM = '2019013917' / Image data unit checksum DHEINF = 'SDSU, Gen-III' / Controller info DHEFIRM = '/usr/src/dsp/20090618/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / Camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / Astropci software version DETID = 'PTF/MOSAIC' / Detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / Source for header information DATAMIN = 0. / Minimum value for array ROISTATE= 'ROI ' / ROI State (FULL | ROI) LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 174.988 / [K] 0x0 servo temp sensor on CCD09 HSTEMP = 152.111 / [K] 0x1 heat spreader temp DHE0TEMP= 301.098 / [K] 0x2 detector head electronics temp, master DHE1TEMP= 303.178 / [K] 0x3 detector head electronics temp, slave DEWWTEMP= 287.05 / [K] 0x4 dewar wall temp HEADTEMP= 142.103 / [K] 0x5 cryo cooler cold head temp CCD5TEMP= 175.963 / [K] 0x6 temp sensor on CCD05 CCD11TEM= 177.375 / [K] 0x7 temp sensor on CCD11 CCD0TEMP= 170.213 / [K] 0x8 temp sensor on CCD00 RSTEMP = 238.936 / [K] 0x9 temp sensor on radiation shield DEWPRESS= 40. / [milli-torr] Dewar pressure DETHEAT = 1.6 / [%] Detector focal plane heater power NAMPSXY = '6 2 ' / Number of amplifiers in x y CCDSUM = '1 1 ' / [pix] Binning in x and y MODELFOC= 'N/A ' / MODELFOC EXPCKSUM= 'fGoXhEmXfEmXfEmX' / Primary header unit checksum EXPDTSUM= '2019013917' / Primary data unit checksum GAIN = 1.7 / [e-/D.N.] Gain of detector. READNOI = 3.4 / [e-] Read noise of detector. DARKCUR = 0.1 / [e-/s] Dark current of detector / SCAMP DISTORTION KEYWORDS RADECSYS= 'ICRS ' / Astrometric system PV1_0 = 0. / Projection distortion parameter PV1_1 = 1. / Projection distortion parameter PV1_2 = 0. / Projection distortion parameter PV1_4 = -0.016169561788921 / Projection distortion parameter PV1_5 = -0.0051747493874632 / Projection distortion parameter PV1_6 = -0.000238504358056776 / Projection distortion parameter PV1_7 = 0.00629760478963159 / Projection distortion parameter PV1_8 = 0.00397207946734115 / Projection distortion parameter PV1_9 = -0.000677296206451849 / Projection distortion parameter PV1_10 = 0.000503546797066621 / Projection distortion parameter PV1_12 = -0.000973553429744082 / Projection distortion parameter PV1_13 = -0.00102312736844768 / Projection distortion parameter PV1_14 = 0.000253623568347818 / Projection distortion parameter PV1_15 = -0.000200211924758127 / Projection distortion parameter PV1_16 = -6.21626607050974E-05 / Projection distortion parameter PV2_0 = 0. / Projection distortion parameter PV2_1 = 1. / Projection distortion parameter PV2_2 = 0. / Projection distortion parameter PV2_4 = -0.000743645656922906 / Projection distortion parameter PV2_5 = 0.000184250025396486 / Projection distortion parameter PV2_6 = 0.0219715919766664 / Projection distortion parameter PV2_7 = -7.54497752637404E-05 / Projection distortion parameter PV2_8 = 0.000649357185110191 / Projection distortion parameter PV2_9 = -0.00081219646536117 / Projection distortion parameter PV2_10 = -0.0105098433615178 / Projection distortion parameter PV2_12 = -2.1755521894303E-05 / Projection distortion parameter PV2_13 = -7.90103717680049E-05 / Projection distortion parameter PV2_14 = -0.000155711703067327 / Projection distortion parameter PV2_15 = 0.000169335617180111 / Projection distortion parameter PV2_16 = 0.00186540574051853 / Projection distortion parameter FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0. / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0. / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 2.362887E-05 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 2.36868E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 0. / SCAMP relative flux scale MAGZEROP= 0. / SCAMP zero-point PHOTIRMS= 0. / mag dispersion RMS (internal, high S/N) RA_RMS = 0.1040474 / [arcsec] RMS of SCAMP fit from 2MASS matching DEC_RMS = 0.1017731 / [arcsec] RMS of SCAMP fit from 2MASS matching ASTROMN = 2636 / Number of stars in SCAMP astrometric solution SCAMPPTH= 'NotAvailable' / SCAMP catalog path SCAMPFIL= 'NotAvailable' / SCAMP catalog file / SIP DISTORTION KEYWORDS / DATA FLOW ORIGNAME= '/data/PTF_default_37806.fits' / Filename as written by the camera FILENAME= 'PTF201407312014_2_o_37806.fits' / Filename of delivered camera image PROCORIG= 'IPAC-PTF pipelines' / Processing origin PROCDATE= 'Fri Sep 26 14:52:55 2014' / Processing date/time (Pacific time) PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pathname of pixel mask PMASKFIL= '70sOn35s_pixmask_chip5.trimmed.v4.fits' / Filename of pixel mask SFLATPTH= '/ptf/pos/sbx2/2014/07/31/f2/c5/cal/p4/cId112103/' / Pathname of superSFLATFIL= 'PTF_201407310000_i_s_flat_t120000_u000112103_f02_p000000_c05.fits' SBIASPTH= '/ptf/pos/sbx2/2014/07/31/f2/c5/cal/p1/cId112095/' / Pathname of superSBIASFIL= 'PTF_201407310000_i_s_bias_t120000_u000112095_f00_p000000_c05.fits' DBNID = 1938 / Database night ID DBEXPID = 446050 / Database exposure ID DBRID = 6985566 / Database raw-image ID DBPID = 21528832 / Database processed-image ID DBFID = 2 / Database filter ID DBPIID = 1 / Database P.I. ID DBPRID = 31 / Database project ID DBFIELD = 446050 / Database field ID DBSVID = 54 / Database software-version ID DBCVID = 60 / Database config-data-file ID INFOBITS= 0 / Database infobits (2^2 and 2^3 excluded) END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/unit.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/unit.hdr new file mode 100644 index 0000000000000000000000000000000000000000..92301774f6afd7d9520343230e735ca3d07d593d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/unit.hdr @@ -0,0 +1 @@ +SIMPLE = T / conforms to FITS standard BITPIX = -64 / array data type NAXIS = 3 / number of array dimensions NAXIS1 = 400 NAXIS2 = 300 NAXIS3 = 251 EQUINOX = 2000.0 CTYPE1 = 'GLON-CAR' CTYPE2 = 'GLAT-CAR' CTYPE3 = 'VRAD' SPECSYS = 'LSRK' CUNIT3 = 'km/s ' BUNIT = 'K ' CRVAL1 = 49.209553 CRVAL2 = 0.0 CRVAL3 = 50.0 CRPIX1 = 200.0 CRPIX2 = 288.0 CRPIX3 = 125.0 CDELT1 = -0.00333333333333333 CDELT2 = 0.003333333333333333 CDELT3 = 0.5 RESTFREQ= 1000. TELESCOP= 'Arecibo' END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.0.txt b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..37545342aec4b8abad73dc3e048d1de8df74d6a3 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.0.txt @@ -0,0 +1,16 @@ +HDU 1: + WCS key ' ': + - RADECSYS= 'ICRS ' / Astrometric system + the RADECSYS keyword is deprecated, use RADESYSa. + - The WCS transformation has more axes (2) than the image it is + associated with (0) + - Removed redundant SCAMP distortion parameters because SIP + parameters are also present + +HDU 2: + WCS key ' ': + - The WCS transformation has more axes (3) than the image it is + associated with (0) + - 'celfix' made the change 'In CUNIT3 : Mismatched units type + 'length': have 'Hz', want 'm''. + - 'unitfix' made the change 'Changed units: 'HZ ' -> 'Hz''. diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.13.txt b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.13.txt new file mode 100644 index 0000000000000000000000000000000000000000..9b5e4c5323b8ba60e6705ac4546ce7d4d415720d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.5.13.txt @@ -0,0 +1,16 @@ +HDU 1: + WCS key ' ': + - RADECSYS= 'ICRS ' / Astrometric system + the RADECSYS keyword is deprecated, use RADESYSa. + - The WCS transformation has more axes (2) than the image it is + associated with (0) + - Removed redundant SCAMP distortion parameters because SIP + parameters are also present + +HDU 2: + WCS key ' ': + - The WCS transformation has more axes (3) than the image it is + associated with (0) + - 'celfix' made the change 'In CUNIT3 : Mismatched units type + 'length': have 'Hz', want 'm''. + - 'unitfix' made the change 'Changed units: 'HZ' -> 'Hz''. diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/validate.6.txt b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.6.txt new file mode 100644 index 0000000000000000000000000000000000000000..bc0dba23e37dad556a8e7a90841760248690cf5f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.6.txt @@ -0,0 +1,17 @@ +HDU 1: + WCS key ' ': + - RADECSYS= 'ICRS ' / Astrometric system + the RADECSYS keyword is deprecated, use RADESYSa. + - The WCS transformation has more axes (2) than the image it is + associated with (0) + - Removed redundant SCAMP distortion parameters because SIP + parameters are also present + +HDU 2: + WCS key ' ': + - The WCS transformation has more axes (3) than the image it is + associated with (0) + - 'unitfix' made the change 'Changed units: + 'HZ' -> 'Hz'. + - 'celfix' made the change 'In CUNIT3 : Mismatched units type + 'length': have 'Hz', want 'm''. diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/validate.fits b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.fits new file mode 100644 index 0000000000000000000000000000000000000000..9c2ae0af33314a97a9ab48a3c2351de258dcc422 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.fits @@ -0,0 +1 @@ +SIMPLE = T / conforms to FITS standard BITPIX = 8 / array data type NAXIS = 0 / number of array dimensions EXTEND = T END XTENSION= 'IMAGE ' / Image extension BITPIX = 8 / array data type NAXIS = 0 / number of array dimensions PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file DATE = '2011-08-01T15:14:04' / File creation date (YYYY-MM-DDThh:mm:ss UT) / PTF DMASK BIT DEFINITIONS BIT00 = 0 / AIRCRAFT/SATELLITE TRACK BIT01 = 1 / OBJECT (detected by SExtractor) BIT02 = 2 / HIGH DARK-CURRENT BIT03 = 3 / RESERVED FOR FUTURE USE BIT04 = 4 / NOISY BIT05 = 5 / GHOST BIT06 = 6 / CCD BLEED BIT07 = 7 / RAD HIT BIT08 = 8 / SATURATED BIT09 = 9 / DEAD/BAD BIT10 = 10 / NAN (not a number) BIT11 = 11 / DIRTY (10-sigma below coarse local median) BIT12 = 12 / HALO BIT13 = 13 / RESERVED FOR FUTURE USE BIT14 = 14 / RESERVED FOR FUTURE USE BIT15 = 15 / RESERVED FOR FUTURE USE / DATA FLOW PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pixel-mask pathname PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Pixel-mask filename UDMPROC = 'updatemask' / Update bit in dmask UDMVERSN= 1. / Version of updatemask program UDMOP = 0 / Operation type UDMMBT = 4 / Mask bit template UDMIFIL = 'bpm_2009060s_c07.v1.fits' / Program updatemask input file UDMOFIL = 'bpm_2009060s_c07.v2.fits' / Program updatemask output file MCVERSN = 1. / Version of ptfMaskCombine program PTFPPROC= 'ptfPostProc' / Flags proc NaNs, CCD-bleeds and rad hits PPRVERSN= 3. / Version of ptfPostProc program / COPY OF IMAGE HEADER BELOW ORIGIN = 'Palomar Transient Factory' / Origin of these image data CREATOR = 'Infrared Processing and Analysis Center' / Creator of this FITS file TELESCOP= 'P48 ' / Name of telescope INSTRUME= 'PTF/MOSAIC' / Instrument name OBSERVER= 'KulkarniPTF' / Observer name and project CCDID = '7 ' / CCD number (0..11) DATE-OBS= '2009-06-25T08:41:23.970' / UTC shutter time YYYY-MM-DDTHH:MM:SS.SSS DATE = '2011-07-30T15:04:59' / File creation date (YYYY-MM-DDThh:mm:ss UT) REFERENC= 'http://www.astro.caltech.edu/ptf' / URL of PTF website / PROPOSAL INFORMATION PTFPRPI = 'Kulkarni' / PTF Project PI PTFPID = '20000 ' / Project type: 00000-49999 OBJECT = 'PTF_survey' / Fields object PTFFIELD= '2899 ' / PTF unique field ID PTFFLAG = '1 ' / 1 = PTF; 0 = non-PTF category / TIME AND EXPOSURE INFORMATION FILTER = 'R ' / Filter name FILTERID= '2 ' / Filter ID FILTERSL= '2 ' / Filter changer slot position EXPTIME = 60. / [s] Requested exposure time AEXPTIME= 60. / actual exposure time (sec) UTC-OBS = '2009-06-25T08:41:23.970' / UTC time shutter open YYYY-MM-DDTHH:MM:SS.OBSJD = 2455007.86207 / [day] Julian day corresponds to UTC-OBS OBSMJD = 55007.36207 / MJD corresponds to UTC-OBS (day) OBSLST = '19:08:26.70' / Mean LST corresponds to UTC-OBS 'HH:MM:SS.S' HOURANG = '-3:09:09.78' / Mean HA (sHH:MM:SS.S) based on LMST at UTC-OBS HJD = 2455007.86457 / [day] Heliocentric Julian Day OBSTYPE = 'object ' / Image type (dark,science,bias,focus) IMGTYP = 'object ' / Image type (dark,science,bias,focus) / MOON AND SUN MOONRA = 131.676395 / [deg] Moon J2000.0 R.A. MOONDEC = 16.207046 / [deg] Moon J2000.0 Dec. MOONILLF= 0.095389 / [frac] Moon illuminated fraction MOONPHAS= 144.0201 / [deg] Moon phase angle MOONESB = -0. / Moon excess in sky brightness V-band MOONALT = -35.16959 / [deg] Moon altitude SUNAZ = 13.90467 / [deg] Sun azimuth SUNALT = -31.96011 / [deg] Sun altitude / PHOTOMETRY BUNIT = 'DN ' / Data number (analog-to-digital units or ADU) PHTCALEX= 1 / Was phot.-cal. module executed? PHTCALFL= 0 / Flag for image is photometric (0=N, 1=Y) PCALRMSE= 0.030059 / RMSE from (zeropoint, extinction) data fit IMAGEZPT= 22.43948 / Image magnitude zeropoint IZPORIG = 'CALTRANS' / Photometric-calibration origin ZPRULE = 'COMPUTE ' / Photometric-calibration method MAGZPT = 22.73683 / Magnitude zeropoint at airmass=1 EXTINCT = 0.17995 / Extinction APSFILT = 'r ' / SDSS filter used in abs phot cal APSCOL = 'r-i ' / SDSS color used in abs phot cal APRMS = 0.0554857 / RMS in mag of final abs phot cal APBSRMS = 0.03911367 / RMS in mag of final abs phot cal for bright staAPNSTDI1= 69501 / Number of standard stars in first iteration APNSTDIF= 64858 / Number of standard stars in final iteration APCHI2 = 325618.88012443 / Chi2 of final abs phot cal APDOF = 64858. / Dof of chi2 of final abs phot cal APMEDJD = 2455007.84500722 / Median JD used in abs phot cal APPN01 = 'ZeroPoint' / Name of parameter abs phot cal 01 APPAR01 = 22.81878918 / Value of parameter abs phot cal 01 APPARE01= 0.00198923 / Error of parameter abs phot cal 01 APPN02 = 'ColorTerm' / Name of parameter abs phot cal 02 APPAR02 = 0.20481246 / Value of parameter abs phot cal 02 APPARE02= 0.00278076 / Error of parameter abs phot cal 02 APPN03 = 'AirMassTerm' / Name of parameter abs phot cal 03 APPAR03 = -0.12104427 / Value of parameter abs phot cal 03 APPARE03= 0.0011621 / Error of parameter abs phot cal 03 APPN04 = 'AirMassColorTerm' / Name of parameter abs phot cal 04 APPAR04 = 0.00904321 / Value of parameter abs phot cal 04 APPARE04= 0.00176968 / Error of parameter abs phot cal 04 APPN05 = 'TimeTerm' / Name of parameter abs phot cal 05 APPAR05 = 0.03012546 / Value of parameter abs phot cal 05 APPARE05= 0.00459951 / Error of parameter abs phot cal 05 APPN06 = 'Time2Term' / Name of parameter abs phot cal 06 APPAR06 = 1.27460327 / Value of parameter abs phot cal 06 APPARE06= 0.07646497 / Error of parameter abs phot cal 06 APPN07 = 'XTerm ' / Name of parameter abs phot cal 07 APPAR07 = 0.00768843 / Value of parameter abs phot cal 07 APPARE07= 0.00083226 / Error of parameter abs phot cal 07 APPN08 = 'YTerm ' / Name of parameter abs phot cal 08 APPAR08 = 0.06680527 / Value of parameter abs phot cal 08 APPARE08= 0.00203667 / Error of parameter abs phot cal 08 APPN09 = 'Y2Term ' / Name of parameter abs phot cal 09 APPAR09 = 0.31486016 / Value of parameter abs phot cal 09 APPARE09= 0.00318862 / Error of parameter abs phot cal 09 APPN10 = 'Y3Term ' / Name of parameter abs phot cal 10 APPAR10 = 0.69934253 / Value of parameter abs phot cal 10 APPARE10= 0.01257477 / Error of parameter abs phot cal 10 APPN11 = 'XYTerm ' / Name of parameter abs phot cal 11 APPAR11 = -0.04590337 / Value of parameter abs phot cal 11 APPARE11= 0.00286729 / Error of parameter abs phot cal 11 / ASTROMETRY CRVAL1 = 333.443801401309 / [deg] RA of reference point CRVAL2 = 3.08905544069643 / [deg] DEC of reference point CRPIX1 = 1175.019 / [pix] Image reference point CRPIX2 = 945.8826 / [pix] Image reference point CTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions CTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions CUNIT1 = 'deg ' / Image axis-1 celestial-coordinate units CUNIT2 = 'deg ' / Image axis-2 celestial-coordinate units CRTYPE1 = 'deg ' / Data units of CRVAL1 CRTYPE2 = 'deg ' / Data units of CRVAL2 CD1_1 = 0.000281094342514378 / Transformation matrix CD1_2 = -5.00875320999652E-09 CD2_1 = -2.08930602680508E-07 CD2_2 = -0.000281284158795544 OBJRA = '22:17:08.571' / Requested field J2000.0 Ra. OBJDEC = '+03:22:30.00' / Requested field J2000.0 Dec. OBJRAD = 334.285714 / [deg] Requested field RA (J2000.0) OBJDECD = 3.375 / [deg] Requested field Dec (J2000.0) PIXSCALE= 1.01 / [arcsec/pix] Pixel scale WCSAXES = 2 EQUINOX = 2000. / [yr] Equatorial coordinates definition LONPOLE = 180. LATPOLE = 0. / IMAGE QUALITY SEEING = 2.04 / [pix] Seeing FWHM PEAKDIST= 0.396793397122491 / [pix] Mean dist brightest pixel-centroid pixel ELLIP = 0.063 / Mean image ellipticity A/B ELLIPPA = 48.65 / [deg] Mean image ellipticity PA FBIAS = 1060.884 / [DN] Floating bias of the image SATURVAL= 17000. / [DN] Saturation value of the CCD array FWHMSEX = 2.45 / [arcsec] SExtractor SEEING estimate MDSKYMAG= 20.53072 / [mag/s-arcsec^2] Median sky obsolete MSMAPCZP= 20.70926 / [mag/s-arcsec^2] Median sky abs. phot. cal. LIMITMAG= 20.92587 / [mag/s-arcsec^2] Limiting magnitude obsolete LMGAPCZP= 21.10442 / [mag/s-arcsec^2] Limiting mag. abs. phot. cal. MEDFWHM = 2.931446 / [arcsecond] Median FWHM MEDELONG= 1.132416 / [dimensionless] Median elongation STDELONG= 0.3298569 / [dimensionless] Std. dev. of elongation MEDTHETA= -42.28234 / [deg] Atan(median sin(theta)/median cos(theta))STDTHETA= 66.21399 / [deg] Atan(stddev sin(theta)/stddev cos(theta))MEDDLMAG= 33.85928 / [mag/s-arcsec^2] Median (MU_MAX-MAG_AUTO) STDDLMAG= 0.4367887 / [mag/s-arcsec^2] Stddev of (MU_MAX-MAG_AUTO) / OBSERVATORY AND TCS OCS_TIME= '2009-06-25T08:41:23.978' / UTC Date for OCS calc time-dep params OPERMODE= 'OCS ' / Mode of operation: OCS | Manual | N/A SOFTVER = '1.1.1.1 ' / Softwere version (TCS.Camera.OCS.Sched) OCS_VER = '1 ' / OCS software version and date TCS_VER = '1 ' / TCS software version and date SCH_VER = '1 ' / OCS-Scheduler software version and date MAT_VER = '7.7.0.471' / Matlab version HDR_VER = '1 ' / Header version TRIGGER = 'N/A ' / trigger ID for TOO, e.g. VOEVENT-Nr TCSMODE = 'Star ' / TCS fundamental mode TCSSMODE= 'Active ' / TCS fundamental submode TCSFMODE= 'Pos ' / TCS focus mode TCSFSMOD= 'On-Target' / TCS focus submode TCSDMODE= 'Stop ' / TCS dome mode TCSDSMOD= 'N/A ' / TCS dome submode TCSWMODE= 'Slave ' / TCS windscreen mode TCSWSMOD= 'N/A ' / TCS windscreen submode OBSLAT = 33.3574 / [deg] Telescope geodetic latitude in WGS84 OBSLON = 116.8599 / [deg] Telescope geodetic longitude in WGS84 OBSALT = 1703.2 / [m] Telescope geodetic altitude in WGS84 DEFOCUS = 0. / [mm] Focus position - nominal focus FOCUSPOS= 1.3851 / [mm] Exposures focusPos DOMESTAT= 'open ' / Dome status at begining of exposure TRACKRA = 23.7 / [arcsec/hr] Track speed RA rel to sidereal TRACKDEC= -11.2 / [arcsec/hr] Track speed Dec rel to sidereal AZIMUTH = 113.8682 / [deg] Telescope Azimuth ALTITUDE= 36.81047 / [deg] Telescope altitude AIRMASS = 1.666232 / Telescope airmass TELRA = 334.402 / [deg] Telescope ap equinox of date RA TELDEC = 3.4225 / [deg] Telescope ap equinox of date Dec TELHA = 312.7096 / [deg] Telescope ap equinox of date HA DOMEAZ = 112.8563 / [deg] Dome azimuth WINDSCAL= 10.466 / [deg] Wind screen altitude WINDDIR = 2.2 / [deg] Azimuth of wind direction WINDSPED= 14.6328 / Wind speed (km/hour) OUTTEMP = 20.94444 / [C] Outside temperature OUTRELHU= 0.09 / [frac] Outside relative humidity OUTDEWPT= -12.94444 / [C] Outside dew point / INSTRUMENT TELEMETRY PANID = '_p48s ' / PAN identification DHSID = '_p48s ' / DHS identification ROISTATE= 'ROI ' / ROI State (FULL | ROI) CCDSEC = '[1:2048,1:4096]' / CCD section CCDSIZE = '[1:2048,1:4096]' / CCD size DATASEC = '[1:2048,1:4096]' / Data section DETSEC = '[1:2048,1:4096]' / Detector section ROISEC = '[1:2048,1:4096]' / ROI section FPA = 'P48MOSAIC' / Focal plan array CCDNAME = 'W94C2 ' / Detector mfg serial number CHECKSUM= 'O3aBP1ZBO1aBO1YB' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = '395763289' / Data unit checksum updated 2010-03-15T13:06:37 DHEINF = 'SDSU, Gen-III' / Controller info DHEFIRM = '/usr/src/dsp/tim_m.lod' / DSP software CAM_VER = '20090615.1.3.100000' / Camera server date.rev.cfitsio LV_VER = '8.5 ' / LabVIEW software version PCI_VER = '2.0c ' / Astropci software version DETID = 'PTF/MOSAIC' / Detector ID AUTHOR = 'PTF/OCS/TCS/Camera' / Source for header information DATAMIN = 0. / Minimum value for array ROISTATE= 'ROI ' / ROI State (FULL | ROI) LEDBLUE = 'OFF ' / 470nm LED state (ON | OFF) LEDRED = 'OFF ' / 660nm LED state (ON | OFF) LEDNIR = 'OFF ' / 880nm LED state (ON | OFF) CCD9TEMP= 175.003 / [K] 0x0 servo temp sensor on CCD09 HSTEMP = 148.207 / [K] 0x1 heat spreader temp DHE0TEMP= 295.951 / [K] 0x2 detector head electronics temp, master DHE1TEMP= 298.162 / [K] 0x3 detector head electronics temp, slave DEWWTEMP= 284.71 / [K] 0x4 dewar wall temp HEADTEMP= 138.414 / [K] 0x5 cryo cooler cold head temp CCD5TEMP= 174.91 / [K] 0x6 temp sensor on CCD05 CCD11TEM= 176.061 / [K] 0x7 temp sensor on CCD11 CCD0TEMP= 169.515 / [K] 0x8 temp sensor on CCD00 RSTEMP = 232.61 / [K] 0x9 temp sensor on radiation shield DEWPRESS= 0.82 / [milli-torr] Dewar pressure DETHEAT = 38. / [%] Detector focal plane heater power NAMPSXY = '6 2 ' / Number of amplifiers in x y CCDSUM = '1 1 ' / [pix] Binning in x and y MODELFOC= 'N/A ' / MODELFOC CHECKSUM= '6aLZ8ZKZ6aKZ6YKZ' / HDU checksum updated 2010-03-15T13:06:37 DATASUM = ' 0' / Data unit checksum (2010-03-15T13:06:37) GAIN = 1.7 / [e-/D.N.] Gain of detector. READNOI = 5.1 / [e-] Read noise of detector. DARKCUR = 0.1 / [e-/s] Dark current of detector / SCAMP DISTORTION KEYWORDS RADECSYS= 'ICRS ' / Astrometric system PV1_0 = 0. / Projection distortion parameter PV1_1 = 1. / Projection distortion parameter PV1_2 = 0. / Projection distortion parameter PV1_4 = 0.000811808026654439 / Projection distortion parameter PV1_5 = 0.000610424561546246 / Projection distortion parameter PV1_6 = 0.000247550637436069 / Projection distortion parameter PV1_7 = 0.000103962986153903 / Projection distortion parameter PV1_8 = -0.000463678684598807 / Projection distortion parameter PV1_9 = -0.000431244263972048 / Projection distortion parameter PV1_10 = -0.000152691163850316 / Projection distortion parameter PV1_12 = -0.00204628855915067 / Projection distortion parameter PV1_13 = -0.00173071932398225 / Projection distortion parameter PV1_14 = 0.000212015319199711 / Projection distortion parameter PV1_15 = -0.000489268678679085 / Projection distortion parameter PV1_16 = -0.000182891514774611 / Projection distortion parameter PV2_0 = 0. / Projection distortion parameter PV2_1 = 1. / Projection distortion parameter PV2_2 = 0. / Projection distortion parameter PV2_4 = 0.000273521447624334 / Projection distortion parameter PV2_5 = 0.000876139200581004 / Projection distortion parameter PV2_6 = -0.000122736852992318 / Projection distortion parameter PV2_7 = -0.00115870481394187 / Projection distortion parameter PV2_8 = 0.000744209714565589 / Projection distortion parameter PV2_9 = -0.00031431316953523 / Projection distortion parameter PV2_10 = -0.00025720525696749 / Projection distortion parameter PV2_12 = -0.00074859772103692 / Projection distortion parameter PV2_13 = 0.000838107200656415 / Projection distortion parameter PV2_14 = -0.00012633881376049 / Projection distortion parameter PV2_15 = -0.0020312867769692 / Projection distortion parameter PV2_16 = 0.00524608854745148 / Projection distortion parameter FGROUPNO= 1 / SCAMP field group label ASTIRMS1= 0. / Astrom. dispersion RMS (intern., high S/N) ASTIRMS2= 0. / Astrom. dispersion RMS (intern., high S/N) ASTRRMS1= 3.620458E-05 / Astrom. dispersion RMS (ref., high S/N) ASTRRMS2= 3.332156E-05 / Astrom. dispersion RMS (ref., high S/N) ASTINST = 1 / SCAMP astrometric instrument label FLXSCALE= 0. / SCAMP relative flux scale MAGZEROP= 0. / SCAMP zero-point PHOTIRMS= 0. / mag dispersion RMS (internal, high S/N) RA_RMS = 0.1655724 / [arcsec] RMS of SCAMP fit from 2MASS matching DEC_RMS = 0.1891921 / [arcsec] RMS of SCAMP fit from 2MASS matching ASTROMN = 384 / Number of stars in SCAMP astrometric solution SCAMPPTH= '/ptf/pos/archive/fallbackcal/scamp/7/' / SCAMP catalog path SCAMPFIL= 'PTF_201006174759_c_e_uca3_t112521_u001916251_f02_p002899_c07.fits' / SIP DISTORTION KEYWORDS A_ORDER = 4 / Distortion order for A A_0_2 = 6.96807813586153E-08 / Projection distortion parameter A_0_3 = 1.20881759870351E-11 / Projection distortion parameter A_0_4 = -4.07297345125509E-15 / Projection distortion parameter A_1_1 = -1.71602989085006E-07 / Projection distortion parameter A_1_2 = -3.40958003336147E-11 / Projection distortion parameter A_1_3 = 1.08769435952671E-14 / Projection distortion parameter A_2_0 = 2.28067760155696E-07 / Projection distortion parameter A_2_1 = 3.6610309234789E-11 / Projection distortion parameter A_2_2 = 4.73755078335384E-15 / Projection distortion parameter A_3_0 = 8.24210855193549E-12 / Projection distortion parameter A_3_1 = 3.84753767306115E-14 / Projection distortion parameter A_4_0 = -4.54223812412034E-14 / Projection distortion parameter A_DMAX = 1.53122472683886 / Projection distortion parameter B_ORDER = 4 / Distortion order for B B_0_2 = -7.69933957449607E-08 / Projection distortion parameter B_0_3 = -9.16855566272424E-11 / Projection distortion parameter B_0_4 = 1.66630509620112E-14 / Projection distortion parameter B_1_1 = 2.46289708854316E-07 / Projection distortion parameter B_1_2 = -5.90207917198792E-11 / Projection distortion parameter B_1_3 = 1.86811615261732E-14 / Projection distortion parameter B_2_0 = 3.44908367419592E-08 / Projection distortion parameter B_2_1 = -2.49509936365959E-11 / Projection distortion parameter B_2_2 = 2.84841315780067E-15 / Projection distortion parameter B_3_0 = 2.02845080441181E-11 / Projection distortion parameter B_3_1 = -4.51317603382652E-14 / Projection distortion parameter B_4_0 = -1.16438849571175E-13 / Projection distortion parameter B_DMAX = 2.89468553502114 / Projection distortion parameter AP_ORDER= 4 / Distortion order for AP AP_0_1 = -2.3927681685928E-08 / Projection distortion parameter AP_0_2 = -6.97379868441328E-08 / Projection distortion parameter AP_0_3 = -1.21069584606865E-11 / Projection distortion parameter AP_0_4 = 4.07524721573973E-15 / Projection distortion parameter AP_1_0 = 5.65239128994064E-08 / Projection distortion parameter AP_1_1 = 1.71734217296344E-07 / Projection distortion parameter AP_1_2 = 3.41724875038451E-11 / Projection distortion parameter AP_1_3 = -1.08775499102067E-14 / Projection distortion parameter AP_2_0 = -2.28068482487158E-07 / Projection distortion parameter AP_2_1 = -3.66548961802381E-11 / Projection distortion parameter AP_2_2 = -4.75858241735224E-15 / Projection distortion parameter AP_3_0 = -8.24781966878619E-12 / Projection distortion parameter AP_3_1 = -3.85281201904104E-14 / Projection distortion parameter AP_4_0 = 4.54275049666924E-14 / Projection distortion parameter BP_ORDER= 4 / Distortion order for BP BP_0_1 = -1.50638746640517E-07 / Projection distortion parameter BP_0_2 = 7.70565767927487E-08 / Projection distortion parameter BP_0_3 = 9.18374546897802E-11 / Projection distortion parameter BP_0_4 = -1.66839467627906E-14 / Projection distortion parameter BP_1_0 = -4.87195269294628E-08 / Projection distortion parameter BP_1_1 = -2.46371690411844E-07 / Projection distortion parameter BP_1_2 = 5.9111535979953E-11 / Projection distortion parameter BP_1_3 = -1.87729776729012E-14 / Projection distortion parameter BP_2_0 = -3.46046151217313E-08 / Projection distortion parameter BP_2_1 = 2.51320825919019E-11 / Projection distortion parameter BP_2_2 = -2.85758325791527E-15 / Projection distortion parameter BP_3_0 = -2.04221364218494E-11 / Projection distortion parameter BP_3_1 = 4.51336286236569E-14 / Projection distortion parameter BP_4_0 = 1.16567578965612E-13 / Projection distortion parameter / DATA FLOW ORIGNAME= '/data/PTF_default_38068.fits' / Filename as written by the camera FILENAME= 'PTF200906253621_2_o_38068.fits' / Filename of delivered camera image PROCORIG= 'IPAC-PTF pipelines' / Processing origin PROCDATE= 'Tue Feb 21 03:34:46 2012' / Processing date/time (Pacific time) PTFVERSN= 5. / Version of PTFSCIENCEPIPELINE program PMASKPTH= '/ptf/pos/archive/fallbackcal/pmasks/' / Pathname of pixel mask PMASKFIL= 'bpm_2009060s_c07.v2.fits' / Filename of pixel mask SFLATPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p4/cId45986/' / Pathname of super SFLATFIL= 'PTF_200906250000_i_s_flat_t120000_u000045986_f02_p000000_c07.fits' SBIASPTH= '/ptf/pos/sbx1/2009/06/25/f2/c7/cal/p1/cId45922/' / Pathname of super SBIASFIL= 'PTF_200906250000_i_s_bias_t120000_u000045922_f00_p000000_c07.fits' DBNID = 121 / Database night ID DBEXPID = 22920 / Database exposure ID DBRID = 3663141 / Database raw-image ID DBPID = 12052003 / Database processed-image ID DBFID = 2 / Database filter ID DBPIID = 1 / Database P.I. ID DBPRID = 3 / Database project ID DBFIELD = 22920 / Database field ID DBSVID = 50 / Database software-version ID DBCVID = 56 / Database config-data-file ID END XTENSION= 'IMAGE ' / Image extension BITPIX = 8 / array data type NAXIS = 0 / number of array dimensions PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups CD1_2 = -3.72E-05 CD1_3 = 0 CD1_1 = -4.12E-05 CUNIT3 = 'HZ ' CUNIT2 = 'deg ' CTYPE1 = 'RA---TAN' CTYPE3 = 'AWAV ' CD2_1 = -3.72E-05 CTYPE2 = 'DEC--TAN' CD2_3 = 0 CD2_2 = 4.12E-05 CUNIT1 = 'deg ' CD3_1 = 0 CD3_2 = 0 CD3_3 = 0.2 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/validate.txt b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.txt new file mode 100644 index 0000000000000000000000000000000000000000..34ade07f3cbd0c6dba89b3e474225d5f35936d93 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/validate.txt @@ -0,0 +1,16 @@ +HDU 1: + WCS key ' ': + - RADECSYS= 'ICRS ' / Astrometric system + RADECSYS is non-standard, use RADESYSa. + - The WCS transformation has more axes (2) than the image it is + associated with (0) + - Removed redundant SCAMP distortion parameters because SIP + parameters are also present + +HDU 2: + WCS key ' ': + - The WCS transformation has more axes (3) than the image it is + associated with (0) + - 'celfix' made the change 'In CUNIT3 : Mismatched units type + 'length': have 'Hz', want 'm''. + - 'unitfix' made the change 'Changed units: 'HZ ' -> 'Hz''. diff --git a/testbed/astropy__astropy/astropy/wcs/tests/data/zpn-hole.hdr b/testbed/astropy__astropy/astropy/wcs/tests/data/zpn-hole.hdr new file mode 100644 index 0000000000000000000000000000000000000000..433659863b8eb4fd17b54b13db25562c28e014d4 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/data/zpn-hole.hdr @@ -0,0 +1 @@ +NAXIS = 2 NAXIS1 = 200 NAXIS2 = 200 CTYPE1 = 'RA---ZPN' CRPIX1 = 100 CDELT1 = -6.666666666667E-02 CRVAL1 = 0.000000000000E+00 CTYPE2 = 'DEC--ZPN' CRPIX2 = 100 CDELT2 = 6.666666666667E-02 CRVAL2 = -9.000000000000E+01 LONPOLE = 1.800000000000E+02 / Native longitude of celestial pole LATPOLE = -9.000000000000E+01 / Native latitude of celestial pole PV2_0 = 10.000000000000E-02 / Projection parameter 0 PV2_1 = 9.750000000000E-01 / Projection parameter 1 END \ No newline at end of file diff --git a/testbed/astropy__astropy/astropy/wcs/tests/extension/.gitignore b/testbed/astropy__astropy/astropy/wcs/tests/extension/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..970d78fd3f93fbb7a54df3a2221757c217f7947a --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/extension/.gitignore @@ -0,0 +1 @@ +!*.c diff --git a/testbed/astropy__astropy/astropy/wcs/tests/extension/__init__.py b/testbed/astropy__astropy/astropy/wcs/tests/extension/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/wcs/tests/extension/setup.py b/testbed/astropy__astropy/astropy/wcs/tests/extension/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..bda6bb9804410c528a25a6291f6e4e62a7330005 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/extension/setup.py @@ -0,0 +1,49 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + + +import os +import sys + +if __name__ == '__main__': + astropy_path = sys.argv[-1] + sys.argv = sys.argv[:-1] + sys.path.insert(0, astropy_path) + + from astropy import wcs + import numpy as np + from distutils.core import setup, Extension + + if sys.platform == 'win32': + # These are written into wcsconfig.h, but that file is not + # used by all parts of wcslib. + define_macros = [ + ('YY_NO_UNISTD_H', None), + ('_CRT_SECURE_NO_WARNINGS', None), + ('_NO_OLDNAMES', None), # for mingw32 + ('NO_OLDNAMES', None), # for mingw64 + ('__STDC__', None) # for MSVC + ] + else: + define_macros = [] + + try: + numpy_include = np.get_include() + except AttributeError: + numpy_include = np.get_numpy_include() + + wcsapi_test_module = Extension( + str('wcsapi_test'), + include_dirs=[ + numpy_include, + os.path.join(wcs.get_include(), 'astropy_wcs'), + os.path.join(wcs.get_include(), 'wcslib') + ], + # Use the *full* name to the c file, since we can't change the cwd + # during testing + sources=[str(os.path.join(os.path.dirname(__file__), + 'wcsapi_test.c'))], + define_macros=define_macros) + + setup( + name='wcsapi_test', + ext_modules=[wcsapi_test_module]) diff --git a/testbed/astropy__astropy/astropy/wcs/tests/extension/test_extension.py b/testbed/astropy__astropy/astropy/wcs/tests/extension/test_extension.py new file mode 100644 index 0000000000000000000000000000000000000000..1db0493ecbb6c04f6a8387d9a3a164aeff4bceb0 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/extension/test_extension.py @@ -0,0 +1,78 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + + +import os +import subprocess +import sys + +import pytest + + +def test_wcsapi_extension(tmpdir): + # Test that we can build a simple C extension with the astropy.wcs C API + + build_dir = tmpdir.mkdir('build').strpath + install_dir = tmpdir.mkdir('install').strpath + + setup_path = os.path.dirname(__file__) + astropy_path = os.path.abspath( + os.path.join(setup_path, '..', '..', '..', '..')) + + env = os.environ.copy() + paths = [install_dir, astropy_path] + if env.get('PYTHONPATH'): + paths.append(env.get('PYTHONPATH')) + env[str('PYTHONPATH')] = str(os.pathsep.join(paths)) + + # Build the extension + # This used to use subprocess.check_call, but on Python 3.4 there was + # a mysterious Heisenbug causing this to fail with a non-zero exit code + # *unless* the output is redirected. This bug also did not occur in an + # interactive session, so it likely had something to do with pytest's + # output capture + p = subprocess.Popen([sys.executable, 'setup.py', 'build', + '--build-base={0}'.format(build_dir), 'install', + '--install-lib={0}'.format(install_dir), + astropy_path], cwd=setup_path, env=env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + # Whether the process fails or not this isn't likely to produce a great + # deal of output so communicate should be fine in almost all cases + stdout, stderr = p.communicate() + + try: + stdout, stderr = stdout.decode('utf8'), stderr.decode('utf8') + except UnicodeDecodeError: + # Don't try to guess about encoding; just display the text + stdout, stderr = stdout.decode('latin1'), stderr.decode('latin1') + + # If compilation fails, we can skip this test, since the + # dependencies necessary to compile an extension may be missing. + # If it passes, however, we want to continue and ensure that the + # extension created is actually usable. However, if we're on + # Travis-CI, or another generic continuous integration setup, we + # don't want to ever skip, because having it fail in that + # environment probably indicates something more serious that we + # want to know about. + if (not (str('CI') in os.environ or + str('TRAVIS') in os.environ or + str('CONTINUOUS_INTEGRATION') in os.environ) and + p.returncode): + pytest.skip("system unable to compile extensions") + return + + assert p.returncode == 0, ( + "setup.py exited with non-zero return code {0}\n" + "stdout:\n\n{1}\n\nstderr:\n\n{2}\n".format( + p.returncode, stdout, stderr)) + + code = """ + import sys + import wcsapi_test + sys.exit(wcsapi_test.test()) + """ + + code = code.strip().replace('\n', '; ') + + # Import and run the extension + subprocess.check_call([sys.executable, '-c', code], env=env) diff --git a/testbed/astropy__astropy/astropy/wcs/tests/extension/wcsapi_test.c b/testbed/astropy__astropy/astropy/wcs/tests/extension/wcsapi_test.c new file mode 100644 index 0000000000000000000000000000000000000000..0c933093e512dccadc998a3061f7740e724c2492 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/extension/wcsapi_test.c @@ -0,0 +1,59 @@ +#include "Python.h" +#include "astropy_wcs_api.h" + +static PyObject* +test( + PyObject* self, + PyObject* args, + PyObject* kwds) { + + pipeline_t p; + + pipeline_clear(&p); + + return Py_None; +} + +static PyMethodDef module_methods[] = { + {"test", (PyCFunction)test, METH_NOARGS, ""}, + {NULL} /* Sentinel */ +}; + +struct module_state { +/* The Sun compiler can't handle empty structs */ +#if defined(__SUNPRO_C) || defined(_MSC_VER) + int _dummy; +#endif +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "wcsapi_test", + NULL, + sizeof(struct module_state), + module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC +PyInit_wcsapi_test(void) + +{ + PyObject* m; + + m = PyModule_Create(&moduledef); + + if (m == NULL) { + return NULL; + } + + import_astropy_wcs(); + + if (PyErr_Occurred()) + return NULL; + else + return m; +} diff --git a/testbed/astropy__astropy/astropy/wcs/tests/test_pickle.py b/testbed/astropy__astropy/astropy/wcs/tests/test_pickle.py new file mode 100644 index 0000000000000000000000000000000000000000..476bc10a6989c1af9ade090703e8672e80c40cbb --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/test_pickle.py @@ -0,0 +1,102 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + + +import os +import pickle + +import numpy as np +from numpy.testing import assert_array_almost_equal + +from astropy.utils.data import get_pkg_data_contents, get_pkg_data_fileobj +from astropy.utils.misc import NumpyRNGContext +from astropy.io import fits +from astropy import wcs + + +def test_basic(): + wcs1 = wcs.WCS() + s = pickle.dumps(wcs1) + wcs2 = pickle.loads(s) + + +def test_dist(): + with get_pkg_data_fileobj( + os.path.join("data", "dist.fits"), encoding='binary') as test_file: + hdulist = fits.open(test_file) + wcs1 = wcs.WCS(hdulist[0].header, hdulist) + assert wcs1.det2im2 is not None + s = pickle.dumps(wcs1) + wcs2 = pickle.loads(s) + + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 16, wcs1.wcs.naxis) + world1 = wcs1.all_pix2world(x, 1) + world2 = wcs2.all_pix2world(x, 1) + + assert_array_almost_equal(world1, world2) + + +def test_sip(): + with get_pkg_data_fileobj( + os.path.join("data", "sip.fits"), encoding='binary') as test_file: + hdulist = fits.open(test_file, ignore_missing_end=True) + wcs1 = wcs.WCS(hdulist[0].header) + assert wcs1.sip is not None + s = pickle.dumps(wcs1) + wcs2 = pickle.loads(s) + + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 16, wcs1.wcs.naxis) + world1 = wcs1.all_pix2world(x, 1) + world2 = wcs2.all_pix2world(x, 1) + + assert_array_almost_equal(world1, world2) + + +def test_sip2(): + with get_pkg_data_fileobj( + os.path.join("data", "sip2.fits"), encoding='binary') as test_file: + hdulist = fits.open(test_file, ignore_missing_end=True) + wcs1 = wcs.WCS(hdulist[0].header) + assert wcs1.sip is not None + s = pickle.dumps(wcs1) + wcs2 = pickle.loads(s) + + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 16, wcs1.wcs.naxis) + world1 = wcs1.all_pix2world(x, 1) + world2 = wcs2.all_pix2world(x, 1) + + assert_array_almost_equal(world1, world2) + + +def test_wcs(): + header = get_pkg_data_contents( + os.path.join("data", "outside_sky.hdr"), encoding='binary') + + wcs1 = wcs.WCS(header) + s = pickle.dumps(wcs1) + wcs2 = pickle.loads(s) + + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 16, wcs1.wcs.naxis) + world1 = wcs1.all_pix2world(x, 1) + world2 = wcs2.all_pix2world(x, 1) + + assert_array_almost_equal(world1, world2) + + +class Sub(wcs.WCS): + def __init__(self, *args, **kwargs): + self.foo = 42 + + +def test_subclass(): + wcs = Sub() + s = pickle.dumps(wcs) + wcs2 = pickle.loads(s) + + assert isinstance(wcs2, Sub) + assert wcs.foo == 42 + assert wcs2.foo == 42 + assert wcs2.wcs is not None diff --git a/testbed/astropy__astropy/astropy/wcs/tests/test_profiling.py b/testbed/astropy__astropy/astropy/wcs/tests/test_profiling.py new file mode 100644 index 0000000000000000000000000000000000000000..4f4994491cf23a1b1c7385a5fdd997b39d556cda --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/test_profiling.py @@ -0,0 +1,70 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + + +import os + +import pytest +import numpy as np + +from astropy.utils.data import get_pkg_data_filenames, get_pkg_data_contents +from astropy.utils.misc import NumpyRNGContext + +from astropy import wcs + +# hdr_map_file_list = list(get_pkg_data_filenames("maps", pattern="*.hdr")) + +# use the base name of the file, because everything we yield +# will show up in the test name in the pandokia report +hdr_map_file_list = [os.path.basename(fname) for fname in get_pkg_data_filenames("data/maps", pattern="*.hdr")] + +# Checking the number of files before reading them in. +# OLD COMMENTS: +# AFTER we tested with every file that we found, check to see that we +# actually have the list we expect. If N=0, we will not have performed +# any tests at all. If N < n_data_files, we are missing some files, +# so we will have skipped some tests. Without this check, both cases +# happen silently! + + +def test_read_map_files(): + # how many map files we expect to see + n_map_files = 28 + + assert len(hdr_map_file_list) == n_map_files, ( + "test_read_map_files has wrong number data files: found {}, expected " + " {}".format(len(hdr_map_file_list), n_map_files)) + + +@pytest.mark.parametrize("filename", hdr_map_file_list) +def test_map(filename): + header = get_pkg_data_contents(os.path.join("data/maps", filename)) + wcsobj = wcs.WCS(header) + + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 12, wcsobj.wcs.naxis) + world = wcsobj.wcs_pix2world(x, 1) + pix = wcsobj.wcs_world2pix(x, 1) + + +hdr_spec_file_list = [os.path.basename(fname) for fname in get_pkg_data_filenames("data/spectra", pattern="*.hdr")] + + +def test_read_spec_files(): + # how many spec files expected + n_spec_files = 6 + + assert len(hdr_spec_file_list) == n_spec_files, ( + "test_spectra has wrong number data files: found {}, expected " + " {}".format(len(hdr_spec_file_list), n_spec_files)) + # b.t.w. If this assert happens, py.test reports one more test + # than it would have otherwise. + + +@pytest.mark.parametrize("filename", hdr_spec_file_list) +def test_spectrum(filename): + header = get_pkg_data_contents(os.path.join("data", "spectra", filename)) + wcsobj = wcs.WCS(header) + with NumpyRNGContext(123456789): + x = np.random.rand(2 ** 16, wcsobj.wcs.naxis) + world = wcsobj.wcs_pix2world(x, 1) + pix = wcsobj.wcs_world2pix(x, 1) diff --git a/testbed/astropy__astropy/astropy/wcs/tests/test_utils.py b/testbed/astropy__astropy/astropy/wcs/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..824e6c8bf82d3acf2c3d9b37d08bc43473731895 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/test_utils.py @@ -0,0 +1,668 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import pytest + +import numpy as np +from numpy.testing import assert_almost_equal +from numpy.testing import assert_allclose + +from astropy.utils.data import get_pkg_data_contents, get_pkg_data_filename +from astropy.time import Time +from astropy import units as u + +from astropy.wcs.wcs import WCS, Sip, WCSSUB_LONGITUDE, WCSSUB_LATITUDE +from astropy.wcs.wcsapi.fitswcs import SlicedFITSWCS +from astropy.wcs.utils import (proj_plane_pixel_scales, + is_proj_plane_distorted, + non_celestial_pixel_scales, + wcs_to_celestial_frame, + celestial_frame_to_wcs, skycoord_to_pixel, + pixel_to_skycoord, custom_wcs_to_frame_mappings, + custom_frame_to_wcs_mappings, + add_stokes_axis_to_wcs) + + +def test_wcs_dropping(): + wcs = WCS(naxis=4) + wcs.wcs.pc = np.zeros([4, 4]) + np.fill_diagonal(wcs.wcs.pc, np.arange(1, 5)) + pc = wcs.wcs.pc # for later use below + + dropped = wcs.dropaxis(0) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([2, 3, 4])) + dropped = wcs.dropaxis(1) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 3, 4])) + dropped = wcs.dropaxis(2) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 2, 4])) + dropped = wcs.dropaxis(3) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 2, 3])) + + wcs = WCS(naxis=4) + wcs.wcs.cd = pc + + dropped = wcs.dropaxis(0) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([2, 3, 4])) + dropped = wcs.dropaxis(1) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 3, 4])) + dropped = wcs.dropaxis(2) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 2, 4])) + dropped = wcs.dropaxis(3) + assert np.all(dropped.wcs.get_pc().diagonal() == np.array([1, 2, 3])) + + +def test_wcs_swapping(): + wcs = WCS(naxis=4) + wcs.wcs.pc = np.zeros([4, 4]) + np.fill_diagonal(wcs.wcs.pc, np.arange(1, 5)) + pc = wcs.wcs.pc # for later use below + + swapped = wcs.swapaxes(0, 1) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([2, 1, 3, 4])) + swapped = wcs.swapaxes(0, 3) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([4, 2, 3, 1])) + swapped = wcs.swapaxes(2, 3) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([1, 2, 4, 3])) + + wcs = WCS(naxis=4) + wcs.wcs.cd = pc + + swapped = wcs.swapaxes(0, 1) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([2, 1, 3, 4])) + swapped = wcs.swapaxes(0, 3) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([4, 2, 3, 1])) + swapped = wcs.swapaxes(2, 3) + assert np.all(swapped.wcs.get_pc().diagonal() == np.array([1, 2, 4, 3])) + + +@pytest.mark.parametrize('ndim', (2, 3)) +def test_add_stokes(ndim): + wcs = WCS(naxis=ndim) + + for ii in range(ndim + 1): + outwcs = add_stokes_axis_to_wcs(wcs, ii) + assert outwcs.wcs.naxis == ndim + 1 + assert outwcs.wcs.ctype[ii] == 'STOKES' + assert outwcs.wcs.cname[ii] == 'STOKES' + + +def test_slice(): + mywcs = WCS(naxis=2) + mywcs.wcs.crval = [1, 1] + mywcs.wcs.cdelt = [0.1, 0.1] + mywcs.wcs.crpix = [1, 1] + mywcs._naxis = [1000, 500] + pscale = 0.1 # from cdelt + + slice_wcs = mywcs.slice([slice(1, None), slice(0, None)]) + assert np.all(slice_wcs.wcs.crpix == np.array([1, 0])) + assert slice_wcs._naxis == [1000, 499] + + # test that CRPIX maps to CRVAL: + assert_allclose( + slice_wcs.wcs_pix2world(*slice_wcs.wcs.crpix, 1), + slice_wcs.wcs.crval, rtol=0.0, atol=1e-6 * pscale + ) + + slice_wcs = mywcs.slice([slice(1, None, 2), slice(0, None, 4)]) + assert np.all(slice_wcs.wcs.crpix == np.array([0.625, 0.25])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.4, 0.2])) + assert slice_wcs._naxis == [250, 250] + + slice_wcs = mywcs.slice([slice(None, None, 2), slice(0, None, 2)]) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.2, 0.2])) + assert slice_wcs._naxis == [500, 250] + + # Non-integral values do not alter the naxis attribute + slice_wcs = mywcs.slice([slice(50.), slice(20.)]) + assert slice_wcs._naxis == [1000, 500] + slice_wcs = mywcs.slice([slice(50.), slice(20)]) + assert slice_wcs._naxis == [20, 500] + slice_wcs = mywcs.slice([slice(50), slice(20.5)]) + assert slice_wcs._naxis == [1000, 50] + + +def test_slice_with_sip(): + mywcs = WCS(naxis=2) + mywcs.wcs.crval = [1, 1] + mywcs.wcs.cdelt = [0.1, 0.1] + mywcs.wcs.crpix = [1, 1] + mywcs._naxis = [1000, 500] + mywcs.wcs.ctype = ['RA---TAN-SIP', 'DEC--TAN-SIP'] + a = np.array( + [[0, 0, 5.33092692e-08, 3.73753773e-11, -2.02111473e-13], + [0, 2.44084308e-05, 2.81394789e-11, 5.17856895e-13, 0.0], + [-2.41334657e-07, 1.29289255e-10, 2.35753629e-14, 0.0, 0.0], + [-2.37162007e-10, 5.43714947e-13, 0.0, 0.0, 0.0], + [ -2.81029767e-13, 0.0, 0.0, 0.0, 0.0]] + ) + b = np.array( + [[0, 0, 2.99270374e-05, -2.38136074e-10, 7.23205168e-13], + [0, -1.71073858e-07, 6.31243431e-11, -5.16744347e-14, 0.0], + [6.95458963e-06, -3.08278961e-10, -1.75800917e-13, 0.0, 0.0], + [3.51974159e-11, 5.60993016e-14, 0.0, 0.0, 0.0], + [-5.92438525e-13, 0.0, 0.0, 0.0, 0.0]] + ) + mywcs.sip = Sip(a, b, None, None, mywcs.wcs.crpix) + mywcs.wcs.set() + pscale = 0.1 # from cdelt + + slice_wcs = mywcs.slice([slice(1, None), slice(0, None)]) + # test that CRPIX maps to CRVAL: + assert_allclose( + slice_wcs.all_pix2world(*slice_wcs.wcs.crpix, 1), + slice_wcs.wcs.crval, rtol=0.0, atol=1e-6 * pscale + ) + + slice_wcs = mywcs.slice([slice(1, None, 2), slice(0, None, 4)]) + # test that CRPIX maps to CRVAL: + assert_allclose( + slice_wcs.all_pix2world(*slice_wcs.wcs.crpix, 1), + slice_wcs.wcs.crval, rtol=0.0, atol=1e-6 * pscale + ) + + +def test_slice_getitem(): + mywcs = WCS(naxis=2) + mywcs.wcs.crval = [1, 1] + mywcs.wcs.cdelt = [0.1, 0.1] + mywcs.wcs.crpix = [1, 1] + + slice_wcs = mywcs[1::2, 0::4] + assert np.all(slice_wcs.wcs.crpix == np.array([0.625, 0.25])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.4, 0.2])) + + mywcs.wcs.crpix = [2, 2] + slice_wcs = mywcs[1::2, 0::4] + assert np.all(slice_wcs.wcs.crpix == np.array([0.875, 0.75])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.4, 0.2])) + + # Default: numpy order + slice_wcs = mywcs[1::2] + assert np.all(slice_wcs.wcs.crpix == np.array([2, 0.75])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.1, 0.2])) + + +def test_slice_fitsorder(): + mywcs = WCS(naxis=2) + mywcs.wcs.crval = [1, 1] + mywcs.wcs.cdelt = [0.1, 0.1] + mywcs.wcs.crpix = [1, 1] + + slice_wcs = mywcs.slice([slice(1, None), slice(0, None)], numpy_order=False) + assert np.all(slice_wcs.wcs.crpix == np.array([0, 1])) + + slice_wcs = mywcs.slice([slice(1, None, 2), slice(0, None, 4)], numpy_order=False) + assert np.all(slice_wcs.wcs.crpix == np.array([0.25, 0.625])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.2, 0.4])) + + slice_wcs = mywcs.slice([slice(1, None, 2)], numpy_order=False) + assert np.all(slice_wcs.wcs.crpix == np.array([0.25, 1])) + assert np.all(slice_wcs.wcs.cdelt == np.array([0.2, 0.1])) + + +def test_slice_wcs(): + mywcs = WCS(naxis=2) + + sub = mywcs[0] + assert isinstance(sub, SlicedFITSWCS) + + with pytest.raises(ValueError) as exc: + mywcs[0, ::2] + assert exc.value.args[0] == "Slicing WCS with a step is not supported." + + +def test_axis_names(): + mywcs = WCS(naxis=4) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'VOPT-LSR', 'STOKES'] + + assert mywcs.axis_type_names == ['RA', 'DEC', 'VOPT', 'STOKES'] + + mywcs.wcs.cname = ['RA', 'DEC', 'VOPT', 'STOKES'] + + assert mywcs.axis_type_names == ['RA', 'DEC', 'VOPT', 'STOKES'] + + +def test_celestial(): + mywcs = WCS(naxis=4) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'VOPT', 'STOKES'] + cel = mywcs.celestial + assert tuple(cel.wcs.ctype) == ('RA---TAN', 'DEC--TAN') + assert cel.axis_type_names == ['RA', 'DEC'] + + +def test_wcs_to_celestial_frame(): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates.builtin_frames import ICRS, ITRS, FK5, FK4, Galactic + + mywcs = WCS(naxis=2) + mywcs.wcs.set() + with pytest.raises(ValueError) as exc: + assert wcs_to_celestial_frame(mywcs) is None + assert exc.value.args[0] == "Could not determine celestial frame corresponding to the specified WCS object" + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['XOFFSET', 'YOFFSET'] + mywcs.wcs.set() + with pytest.raises(ValueError): + assert wcs_to_celestial_frame(mywcs) is None + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ICRS) + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + mywcs.wcs.equinox = 1987. + mywcs.wcs.set() + print(mywcs.to_header()) + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, FK5) + assert frame.equinox == Time(1987., format='jyear') + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + mywcs.wcs.equinox = 1982 + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, FK4) + assert frame.equinox == Time(1982., format='byear') + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['GLON-SIN', 'GLAT-SIN'] + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, Galactic) + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['TLON-CAR', 'TLAT-CAR'] + mywcs.wcs.dateobs = '2017-08-17T12:41:04.430' + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ITRS) + assert frame.obstime == Time('2017-08-17T12:41:04.430') + + for equinox in [np.nan, 1987, 1982]: + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + mywcs.wcs.radesys = 'ICRS' + mywcs.wcs.equinox = equinox + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ICRS) + + # Flipped order + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['DEC--TAN', 'RA---TAN'] + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ICRS) + + # More than two dimensions + mywcs = WCS(naxis=3) + mywcs.wcs.ctype = ['DEC--TAN', 'VELOCITY', 'RA---TAN'] + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ICRS) + + mywcs = WCS(naxis=3) + mywcs.wcs.ctype = ['GLAT-CAR', 'VELOCITY', 'GLON-CAR'] + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, Galactic) + + +def test_wcs_to_celestial_frame_correlated(): + + # Regression test for a bug that caused wcs_to_celestial_frame to fail when + # the celestial axes were correlated with other axes. + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates.builtin_frames import ICRS + + mywcs = WCS(naxis=3) + mywcs.wcs.ctype = 'RA---TAN', 'DEC--TAN', 'FREQ' + mywcs.wcs.cd = np.ones((3, 3)) + mywcs.wcs.set() + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, ICRS) + + +def test_wcs_to_celestial_frame_extend(): + + mywcs = WCS(naxis=2) + mywcs.wcs.ctype = ['XOFFSET', 'YOFFSET'] + mywcs.wcs.set() + with pytest.raises(ValueError): + wcs_to_celestial_frame(mywcs) + + class OffsetFrame: + pass + + def identify_offset(wcs): + if wcs.wcs.ctype[0].endswith('OFFSET') and wcs.wcs.ctype[1].endswith('OFFSET'): + return OffsetFrame() + + with custom_wcs_to_frame_mappings(identify_offset): + frame = wcs_to_celestial_frame(mywcs) + assert isinstance(frame, OffsetFrame) + + # Check that things are back to normal after the context manager + with pytest.raises(ValueError): + wcs_to_celestial_frame(mywcs) + + +def test_celestial_frame_to_wcs(): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import ICRS, ITRS, FK5, FK4, FK4NoETerms, Galactic, BaseCoordinateFrame + + class FakeFrame(BaseCoordinateFrame): + pass + + frame = FakeFrame() + with pytest.raises(ValueError) as exc: + celestial_frame_to_wcs(frame) + assert exc.value.args[0] == ("Could not determine WCS corresponding to " + "the specified coordinate frame.") + + frame = ICRS() + mywcs = celestial_frame_to_wcs(frame) + mywcs.wcs.set() + assert tuple(mywcs.wcs.ctype) == ('RA---TAN', 'DEC--TAN') + assert mywcs.wcs.radesys == 'ICRS' + assert np.isnan(mywcs.wcs.equinox) + assert mywcs.wcs.lonpole == 180 + assert mywcs.wcs.latpole == 0 + + frame = FK5(equinox='J1987') + mywcs = celestial_frame_to_wcs(frame) + assert tuple(mywcs.wcs.ctype) == ('RA---TAN', 'DEC--TAN') + assert mywcs.wcs.radesys == 'FK5' + assert mywcs.wcs.equinox == 1987. + + frame = FK4(equinox='B1982') + mywcs = celestial_frame_to_wcs(frame) + assert tuple(mywcs.wcs.ctype) == ('RA---TAN', 'DEC--TAN') + assert mywcs.wcs.radesys == 'FK4' + assert mywcs.wcs.equinox == 1982. + + frame = FK4NoETerms(equinox='B1982') + mywcs = celestial_frame_to_wcs(frame) + assert tuple(mywcs.wcs.ctype) == ('RA---TAN', 'DEC--TAN') + assert mywcs.wcs.radesys == 'FK4-NO-E' + assert mywcs.wcs.equinox == 1982. + + frame = Galactic() + mywcs = celestial_frame_to_wcs(frame) + assert tuple(mywcs.wcs.ctype) == ('GLON-TAN', 'GLAT-TAN') + assert mywcs.wcs.radesys == '' + assert np.isnan(mywcs.wcs.equinox) + + frame = Galactic() + mywcs = celestial_frame_to_wcs(frame, projection='CAR') + assert tuple(mywcs.wcs.ctype) == ('GLON-CAR', 'GLAT-CAR') + assert mywcs.wcs.radesys == '' + assert np.isnan(mywcs.wcs.equinox) + + frame = Galactic() + mywcs = celestial_frame_to_wcs(frame, projection='CAR') + mywcs.wcs.crval = [100, -30] + mywcs.wcs.set() + assert_allclose((mywcs.wcs.lonpole, mywcs.wcs.latpole), (180, 60)) + + frame = ITRS(obstime=Time('2017-08-17T12:41:04.43')) + mywcs = celestial_frame_to_wcs(frame, projection='CAR') + assert tuple(mywcs.wcs.ctype) == ('TLON-CAR', 'TLAT-CAR') + assert mywcs.wcs.radesys == 'ITRS' + assert mywcs.wcs.dateobs == '2017-08-17T12:41:04.430' + + frame = ITRS() + mywcs = celestial_frame_to_wcs(frame, projection='CAR') + assert tuple(mywcs.wcs.ctype) == ('TLON-CAR', 'TLAT-CAR') + assert mywcs.wcs.radesys == 'ITRS' + assert mywcs.wcs.dateobs == Time('J2000').utc.fits + + +def test_celestial_frame_to_wcs_extend(): + + class OffsetFrame: + pass + + frame = OffsetFrame() + + with pytest.raises(ValueError): + celestial_frame_to_wcs(frame) + + def identify_offset(frame, projection=None): + if isinstance(frame, OffsetFrame): + wcs = WCS(naxis=2) + wcs.wcs.ctype = ['XOFFSET', 'YOFFSET'] + return wcs + + with custom_frame_to_wcs_mappings(identify_offset): + mywcs = celestial_frame_to_wcs(frame) + assert tuple(mywcs.wcs.ctype) == ('XOFFSET', 'YOFFSET') + + # Check that things are back to normal after the context manager + with pytest.raises(ValueError): + celestial_frame_to_wcs(frame) + + +def test_pixscale_nodrop(): + mywcs = WCS(naxis=2) + mywcs.wcs.cdelt = [0.1, 0.2] + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert_almost_equal(proj_plane_pixel_scales(mywcs), (0.1, 0.2)) + + mywcs.wcs.cdelt = [-0.1, 0.2] + assert_almost_equal(proj_plane_pixel_scales(mywcs), (0.1, 0.2)) + + +def test_pixscale_withdrop(): + mywcs = WCS(naxis=3) + mywcs.wcs.cdelt = [0.1, 0.2, 1] + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'VOPT'] + assert_almost_equal(proj_plane_pixel_scales(mywcs.celestial), (0.1, 0.2)) + + mywcs.wcs.cdelt = [-0.1, 0.2, 1] + assert_almost_equal(proj_plane_pixel_scales(mywcs.celestial), (0.1, 0.2)) + + +def test_pixscale_cd(): + mywcs = WCS(naxis=2) + mywcs.wcs.cd = [[-0.1, 0], [0, 0.2]] + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert_almost_equal(proj_plane_pixel_scales(mywcs), (0.1, 0.2)) + + +@pytest.mark.parametrize('angle', + (30, 45, 60, 75)) +def test_pixscale_cd_rotated(angle): + mywcs = WCS(naxis=2) + rho = np.radians(angle) + scale = 0.1 + mywcs.wcs.cd = [[scale * np.cos(rho), -scale * np.sin(rho)], + [scale * np.sin(rho), scale * np.cos(rho)]] + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert_almost_equal(proj_plane_pixel_scales(mywcs), (0.1, 0.1)) + + +@pytest.mark.parametrize('angle', + (30, 45, 60, 75)) +def test_pixscale_pc_rotated(angle): + mywcs = WCS(naxis=2) + rho = np.radians(angle) + scale = 0.1 + mywcs.wcs.cdelt = [-scale, scale] + mywcs.wcs.pc = [[np.cos(rho), -np.sin(rho)], + [np.sin(rho), np.cos(rho)]] + mywcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert_almost_equal(proj_plane_pixel_scales(mywcs), (0.1, 0.1)) + + +@pytest.mark.parametrize(('cdelt', 'pc', 'pccd'), + (([0.1, 0.2], np.eye(2), np.diag([0.1, 0.2])), + ([0.1, 0.2, 0.3], np.eye(3), np.diag([0.1, 0.2, 0.3])), + ([1, 1, 1], np.diag([0.1, 0.2, 0.3]), np.diag([0.1, 0.2, 0.3])))) +def test_pixel_scale_matrix(cdelt, pc, pccd): + + mywcs = WCS(naxis=(len(cdelt))) + mywcs.wcs.cdelt = cdelt + mywcs.wcs.pc = pc + + assert_almost_equal(mywcs.pixel_scale_matrix, pccd) + + +@pytest.mark.parametrize(('ctype', 'cel'), + ((['RA---TAN', 'DEC--TAN'], True), + (['RA---TAN', 'DEC--TAN', 'FREQ'], False), + (['RA---TAN', 'FREQ'], False),)) +def test_is_celestial(ctype, cel): + mywcs = WCS(naxis=len(ctype)) + mywcs.wcs.ctype = ctype + + assert mywcs.is_celestial == cel + + +@pytest.mark.parametrize(('ctype', 'cel'), + ((['RA---TAN', 'DEC--TAN'], True), + (['RA---TAN', 'DEC--TAN', 'FREQ'], True), + (['RA---TAN', 'FREQ'], False),)) +def test_has_celestial(ctype, cel): + mywcs = WCS(naxis=len(ctype)) + mywcs.wcs.ctype = ctype + + assert mywcs.has_celestial == cel + + +def test_has_celestial_correlated(): + # Regression test for astropy/astropy#8416 - has_celestial failed when + # celestial axes were correlated with other axes. + mywcs = WCS(naxis=3) + mywcs.wcs.ctype = 'RA---TAN', 'DEC--TAN', 'FREQ' + mywcs.wcs.cd = np.ones((3, 3)) + mywcs.wcs.set() + assert mywcs.has_celestial + + +@pytest.mark.parametrize(('cdelt', 'pc', 'cd'), + ((np.array([0.1, 0.2]), np.eye(2), np.eye(2)), + (np.array([1, 1]), np.diag([0.1, 0.2]), np.eye(2)), + (np.array([0.1, 0.2]), np.eye(2), None), + (np.array([0.1, 0.2]), None, np.eye(2)), + )) +def test_noncelestial_scale(cdelt, pc, cd): + + mywcs = WCS(naxis=2) + if cd is not None: + mywcs.wcs.cd = cd + if pc is not None: + mywcs.wcs.pc = pc + mywcs.wcs.cdelt = cdelt + + mywcs.wcs.ctype = ['RA---TAN', 'FREQ'] + + ps = non_celestial_pixel_scales(mywcs) + + assert_almost_equal(ps.to_value(u.deg), np.array([0.1, 0.2])) + + +@pytest.mark.parametrize('mode', ['all', 'wcs']) +def test_skycoord_to_pixel(mode): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import SkyCoord + + header = get_pkg_data_contents('data/maps/1904-66_TAN.hdr', encoding='binary') + wcs = WCS(header) + + ref = SkyCoord(0.1 * u.deg, -89. * u.deg, frame='icrs') + + xp, yp = skycoord_to_pixel(ref, wcs, mode=mode) + + # WCS is in FK5 so we need to transform back to ICRS + new = pixel_to_skycoord(xp, yp, wcs, mode=mode).transform_to('icrs') + + assert_allclose(new.ra.degree, ref.ra.degree) + assert_allclose(new.dec.degree, ref.dec.degree) + + # Make sure you can specify a different class using ``cls`` keyword + class SkyCoord2(SkyCoord): + pass + + new2 = pixel_to_skycoord(xp, yp, wcs, mode=mode, + cls=SkyCoord2).transform_to('icrs') + + assert new2.__class__ is SkyCoord2 + assert_allclose(new2.ra.degree, ref.ra.degree) + assert_allclose(new2.dec.degree, ref.dec.degree) + + +def test_skycoord_to_pixel_swapped(): + + # Regression test for a bug that caused skycoord_to_pixel and + # pixel_to_skycoord to not work correctly if the axes were swapped in the + # WCS. + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import SkyCoord + + header = get_pkg_data_contents('data/maps/1904-66_TAN.hdr', encoding='binary') + wcs = WCS(header) + + wcs_swapped = wcs.sub([WCSSUB_LATITUDE, WCSSUB_LONGITUDE]) + + ref = SkyCoord(0.1 * u.deg, -89. * u.deg, frame='icrs') + + xp1, yp1 = skycoord_to_pixel(ref, wcs) + xp2, yp2 = skycoord_to_pixel(ref, wcs_swapped) + + assert_allclose(xp1, xp2) + assert_allclose(yp1, yp2) + + # WCS is in FK5 so we need to transform back to ICRS + new1 = pixel_to_skycoord(xp1, yp1, wcs).transform_to('icrs') + new2 = pixel_to_skycoord(xp1, yp1, wcs_swapped).transform_to('icrs') + + assert_allclose(new1.ra.degree, new2.ra.degree) + assert_allclose(new1.dec.degree, new2.dec.degree) + + +def test_is_proj_plane_distorted(): + # non-orthogonal CD: + wcs = WCS(naxis=2) + wcs.wcs.cd = [[-0.1, 0], [0, 0.2]] + wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert(is_proj_plane_distorted(wcs)) + + # almost orthogonal CD: + wcs.wcs.cd = [[0.1 + 2.0e-7, 1.7e-7], [1.2e-7, 0.1 - 1.3e-7]] + assert(not is_proj_plane_distorted(wcs)) + + # real case: + header = get_pkg_data_filename('data/sip.fits') + wcs = WCS(header) + assert(is_proj_plane_distorted(wcs)) + + +@pytest.mark.parametrize('mode', ['all', 'wcs']) +def test_skycoord_to_pixel_distortions(mode): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import SkyCoord + + header = get_pkg_data_filename('data/sip.fits') + wcs = WCS(header) + + ref = SkyCoord(202.50 * u.deg, 47.19 * u.deg, frame='icrs') + + xp, yp = skycoord_to_pixel(ref, wcs, mode=mode) + + # WCS is in FK5 so we need to transform back to ICRS + new = pixel_to_skycoord(xp, yp, wcs, mode=mode).transform_to('icrs') + + assert_allclose(new.ra.degree, ref.ra.degree) + assert_allclose(new.dec.degree, ref.dec.degree) diff --git a/testbed/astropy__astropy/astropy/wcs/tests/test_wcs.py b/testbed/astropy__astropy/astropy/wcs/tests/test_wcs.py new file mode 100644 index 0000000000000000000000000000000000000000..4f54f0bfb3bccda41ae3c3f63c3b0a579cef0795 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/test_wcs.py @@ -0,0 +1,1260 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import io +import os +import warnings +from datetime import datetime + +import pytest +import numpy as np +from numpy.testing import ( + assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp, + assert_array_equal) + +from astropy.tests.helper import raises, catch_warnings +from astropy import wcs +from astropy.wcs import _wcs +from astropy.utils.data import ( + get_pkg_data_filenames, get_pkg_data_contents, get_pkg_data_filename) +from astropy.utils.misc import NumpyRNGContext +from astropy.utils.exceptions import AstropyUserWarning +from astropy.io import fits +from astropy.coordinates import SkyCoord + + +class TestMaps: + def setup(self): + # get the list of the hdr files that we want to test + self._file_list = list(get_pkg_data_filenames("data/maps", pattern="*.hdr")) + + def test_consistency(self): + # Check to see that we actually have the list we expect, so that we + # do not get in a situation where the list is empty or incomplete and + # the tests still seem to pass correctly. + + # how many do we expect to see? + n_data_files = 28 + + assert len(self._file_list) == n_data_files, ( + "test_spectra has wrong number data files: found {}, expected " + " {}".format(len(self._file_list), n_data_files)) + + def test_maps(self): + for filename in self._file_list: + # use the base name of the file, so we get more useful messages + # for failing tests. + filename = os.path.basename(filename) + # Now find the associated file in the installed wcs test directory. + header = get_pkg_data_contents( + os.path.join("data", "maps", filename), encoding='binary') + # finally run the test. + wcsobj = wcs.WCS(header) + world = wcsobj.wcs_pix2world([[97, 97]], 1) + assert_array_almost_equal(world, [[285.0, -66.25]], decimal=1) + pix = wcsobj.wcs_world2pix([[285.0, -66.25]], 1) + assert_array_almost_equal(pix, [[97, 97]], decimal=0) + + +class TestSpectra: + def setup(self): + self._file_list = list(get_pkg_data_filenames("data/spectra", + pattern="*.hdr")) + + def test_consistency(self): + # Check to see that we actually have the list we expect, so that we + # do not get in a situation where the list is empty or incomplete and + # the tests still seem to pass correctly. + + # how many do we expect to see? + n_data_files = 6 + + assert len(self._file_list) == n_data_files, ( + "test_spectra has wrong number data files: found {}, expected " + " {}".format(len(self._file_list), n_data_files)) + + def test_spectra(self): + for filename in self._file_list: + # use the base name of the file, so we get more useful messages + # for failing tests. + filename = os.path.basename(filename) + # Now find the associated file in the installed wcs test directory. + header = get_pkg_data_contents( + os.path.join("data", "spectra", filename), encoding='binary') + # finally run the test. + all_wcs = wcs.find_all_wcs(header) + assert len(all_wcs) == 9 + + +def test_fixes(): + """ + From github issue #36 + """ + def run(): + header = get_pkg_data_contents( + 'data/nonstandard_units.hdr', encoding='binary') + try: + w = wcs.WCS(header, translate_units='dhs') + except wcs.InvalidTransformError: + pass + else: + assert False, "Expected InvalidTransformError" + + with catch_warnings(wcs.FITSFixedWarning) as w: + run() + + assert len(w) == 2 + for item in w: + if 'unitfix' in str(item.message): + assert 'Hz' in str(item.message) + assert 'M/S' in str(item.message) + assert 'm/s' in str(item.message) + + +def test_outside_sky(): + """ + From github issue #107 + """ + header = get_pkg_data_contents( + 'data/outside_sky.hdr', encoding='binary') + w = wcs.WCS(header) + + assert np.all(np.isnan(w.wcs_pix2world([[100., 500.]], 0))) # outside sky + assert np.all(np.isnan(w.wcs_pix2world([[200., 200.]], 0))) # outside sky + assert not np.any(np.isnan(w.wcs_pix2world([[1000., 1000.]], 0))) + + +def test_pix2world(): + """ + From github issue #1463 + """ + # TODO: write this to test the expected output behavior of pix2world, + # currently this just makes sure it doesn't error out in unexpected ways + filename = get_pkg_data_filename('data/sip2.fits') + with catch_warnings(wcs.wcs.FITSFixedWarning) as caught_warnings: + # this raises a warning unimportant for this testing the pix2world + # FITSFixedWarning(u'The WCS transformation has more axes (2) than the + # image it is associated with (0)') + ww = wcs.WCS(filename) + + # might as well monitor for changing behavior + assert len(caught_warnings) == 1 + + n = 3 + pixels = (np.arange(n) * np.ones((2, n))).T + result = ww.wcs_pix2world(pixels, 0, ra_dec_order=True) + + # Catch #2791 + ww.wcs_pix2world(pixels[..., 0], pixels[..., 1], 0, ra_dec_order=True) + + close_enough = 1e-8 + # assuming that the data of sip2.fits doesn't change + answer = np.array([[0.00024976, 0.00023018], + [0.00023043, -0.00024997]]) + + assert np.all(np.abs(ww.wcs.pc - answer) < close_enough) + + answer = np.array([[202.39265216, 47.17756518], + [202.39335826, 47.17754619], + [202.39406436, 47.1775272]]) + + assert np.all(np.abs(result - answer) < close_enough) + + +def test_load_fits_path(): + fits_name = get_pkg_data_filename('data/sip.fits') + w = wcs.WCS(fits_name) + + +def test_dict_init(): + """ + Test that WCS can be initialized with a dict-like object + """ + + # Dictionary with no actual WCS, returns identity transform + w = wcs.WCS({}) + + xp, yp = w.wcs_world2pix(41., 2., 1) + + assert_array_almost_equal_nulp(xp, 41., 10) + assert_array_almost_equal_nulp(yp, 2., 10) + + # Valid WCS + w = wcs.WCS({'CTYPE1': 'GLON-CAR', + 'CTYPE2': 'GLAT-CAR', + 'CUNIT1': 'deg', + 'CUNIT2': 'deg', + 'CRPIX1': 1, + 'CRPIX2': 1, + 'CRVAL1': 40., + 'CRVAL2': 0., + 'CDELT1': -0.1, + 'CDELT2': 0.1}) + + xp, yp = w.wcs_world2pix(41., 2., 0) + + assert_array_almost_equal_nulp(xp, -10., 10) + assert_array_almost_equal_nulp(yp, 20., 10) + + +@raises(TypeError) +def test_extra_kwarg(): + """ + Issue #444 + """ + w = wcs.WCS() + with NumpyRNGContext(123456789): + data = np.random.rand(100, 2) + w.wcs_pix2world(data, origin=1) + + +def test_3d_shapes(): + """ + Issue #444 + """ + w = wcs.WCS(naxis=3) + with NumpyRNGContext(123456789): + data = np.random.rand(100, 3) + result = w.wcs_pix2world(data, 1) + assert result.shape == (100, 3) + result = w.wcs_pix2world( + data[..., 0], data[..., 1], data[..., 2], 1) + assert len(result) == 3 + + +def test_preserve_shape(): + w = wcs.WCS(naxis=2) + + x = np.random.random((2, 3, 4)) + y = np.random.random((2, 3, 4)) + + xw, yw = w.wcs_pix2world(x, y, 1) + + assert xw.shape == (2, 3, 4) + assert yw.shape == (2, 3, 4) + + xp, yp = w.wcs_world2pix(x, y, 1) + + assert xp.shape == (2, 3, 4) + assert yp.shape == (2, 3, 4) + + +def test_broadcasting(): + w = wcs.WCS(naxis=2) + + x = np.random.random((2, 3, 4)) + y = 1 + + xp, yp = w.wcs_world2pix(x, y, 1) + + assert xp.shape == (2, 3, 4) + assert yp.shape == (2, 3, 4) + + +def test_shape_mismatch(): + w = wcs.WCS(naxis=2) + + x = np.random.random((2, 3, 4)) + y = np.random.random((3, 2, 4)) + + with pytest.raises(ValueError) as exc: + xw, yw = w.wcs_pix2world(x, y, 1) + assert exc.value.args[0] == "Coordinate arrays are not broadcastable to each other" + + with pytest.raises(ValueError) as exc: + xp, yp = w.wcs_world2pix(x, y, 1) + assert exc.value.args[0] == "Coordinate arrays are not broadcastable to each other" + + # There are some ambiguities that need to be worked around when + # naxis == 1 + w = wcs.WCS(naxis=1) + + x = np.random.random((42, 1)) + xw = w.wcs_pix2world(x, 1) + assert xw.shape == (42, 1) + + x = np.random.random((42,)) + xw, = w.wcs_pix2world(x, 1) + assert xw.shape == (42,) + + +def test_invalid_shape(): + # Issue #1395 + w = wcs.WCS(naxis=2) + + xy = np.random.random((2, 3)) + with pytest.raises(ValueError) as exc: + xy2 = w.wcs_pix2world(xy, 1) + assert exc.value.args[0] == 'When providing two arguments, the array must be of shape (N, 2)' + + xy = np.random.random((2, 1)) + with pytest.raises(ValueError) as exc: + xy2 = w.wcs_pix2world(xy, 1) + assert exc.value.args[0] == 'When providing two arguments, the array must be of shape (N, 2)' + + +def test_warning_about_defunct_keywords(): + def run(): + header = get_pkg_data_contents( + 'data/defunct_keywords.hdr', encoding='binary') + w = wcs.WCS(header) + + with catch_warnings(wcs.FITSFixedWarning) as w: + run() + + assert len(w) == 4 + for item in w: + assert 'PCi_ja' in str(item.message) + + # Make sure the warnings come out every time... + + with catch_warnings(wcs.FITSFixedWarning) as w: + run() + + assert len(w) == 4 + for item in w: + assert 'PCi_ja' in str(item.message) + + +def test_warning_about_defunct_keywords_exception(): + def run(): + header = get_pkg_data_contents( + 'data/defunct_keywords.hdr', encoding='binary') + w = wcs.WCS(header) + + with pytest.raises(wcs.FITSFixedWarning): + warnings.simplefilter("error", wcs.FITSFixedWarning) + run() + + # Restore warnings filter to previous state + warnings.simplefilter("default") + + +def test_to_header_string(): + header_string = """ + WCSAXES = 2 / Number of coordinate axes CRPIX1 = 0.0 / Pixel coordinate of reference point CRPIX2 = 0.0 / Pixel coordinate of reference point CDELT1 = 1.0 / Coordinate increment at reference point CDELT2 = 1.0 / Coordinate increment at reference point CRVAL1 = 0.0 / Coordinate value at reference point CRVAL2 = 0.0 / Coordinate value at reference point LATPOLE = 90.0 / [deg] Native latitude of celestial pole END""" + + w = wcs.WCS() + h0 = fits.Header.fromstring(w.to_header_string().strip()) + if 'COMMENT' in h0: + del h0['COMMENT'] + if '' in h0: + del h0[''] + h1 = fits.Header.fromstring(header_string.strip()) + assert dict(h0) == dict(h1) + + +def test_to_fits(): + w = wcs.WCS() + header_string = w.to_header() + wfits = w.to_fits() + assert isinstance(wfits, fits.HDUList) + assert isinstance(wfits[0], fits.PrimaryHDU) + assert header_string == wfits[0].header[-8:] + + +def test_to_header_warning(): + fits_name = get_pkg_data_filename('data/sip.fits') + x = wcs.WCS(fits_name) + with catch_warnings() as w: + x.to_header() + assert len(w) == 1 + assert 'A_ORDER' in str(w[0]) + + +def test_no_comments_in_header(): + w = wcs.WCS() + header = w.to_header() + assert w.wcs.alt not in header + assert 'COMMENT' + w.wcs.alt.strip() not in header + assert 'COMMENT' not in header + wkey = 'P' + header = w.to_header(key=wkey) + assert wkey not in header + assert 'COMMENT' not in header + assert 'COMMENT' + w.wcs.alt.strip() not in header + + +@raises(wcs.InvalidTransformError) +def test_find_all_wcs_crash(): + """ + Causes a double free without a recent fix in wcslib_wrap.C + """ + with open(get_pkg_data_filename("data/too_many_pv.hdr")) as fd: + header = fd.read() + # We have to set fix=False here, because one of the fixing tasks is to + # remove redundant SCAMP distortion parameters when SIP distortion + # parameters are also present. + wcses = wcs.find_all_wcs(header, fix=False) + + +def test_validate(): + with catch_warnings(): + results = wcs.validate(get_pkg_data_filename("data/validate.fits")) + results_txt = repr(results) + version = wcs._wcs.__version__ + if version[0] == '6': + filename = 'data/validate.6.txt' + elif version[0] == '5': + if version >= '5.13': + filename = 'data/validate.5.13.txt' + else: + filename = 'data/validate.5.0.txt' + else: + filename = 'data/validate.txt' + with open(get_pkg_data_filename(filename), "r") as fd: + lines = fd.readlines() + assert set([x.strip() for x in lines]) == set([ + x.strip() for x in results_txt.splitlines()]) + + +def test_validate_with_2_wcses(): + # From Issue #2053 + results = wcs.validate(get_pkg_data_filename("data/2wcses.hdr")) + + assert "WCS key 'A':" in str(results) + + +def test_crpix_maps_to_crval(): + twcs = wcs.WCS(naxis=2) + twcs.wcs.crval = [251.29, 57.58] + twcs.wcs.cdelt = [1, 1] + twcs.wcs.crpix = [507, 507] + twcs.wcs.pc = np.array([[7.7e-6, 3.3e-5], [3.7e-5, -6.8e-6]]) + twcs._naxis = [1014, 1014] + twcs.wcs.ctype = ['RA---TAN-SIP', 'DEC--TAN-SIP'] + a = np.array( + [[0, 0, 5.33092692e-08, 3.73753773e-11, -2.02111473e-13], + [0, 2.44084308e-05, 2.81394789e-11, 5.17856895e-13, 0.0], + [-2.41334657e-07, 1.29289255e-10, 2.35753629e-14, 0.0, 0.0], + [-2.37162007e-10, 5.43714947e-13, 0.0, 0.0, 0.0], + [ -2.81029767e-13, 0.0, 0.0, 0.0, 0.0]] + ) + b = np.array( + [[0, 0, 2.99270374e-05, -2.38136074e-10, 7.23205168e-13], + [0, -1.71073858e-07, 6.31243431e-11, -5.16744347e-14, 0.0], + [6.95458963e-06, -3.08278961e-10, -1.75800917e-13, 0.0, 0.0], + [3.51974159e-11, 5.60993016e-14, 0.0, 0.0, 0.0], + [-5.92438525e-13, 0.0, 0.0, 0.0, 0.0]] + ) + twcs.sip = wcs.Sip(a, b, None, None, twcs.wcs.crpix) + twcs.wcs.set() + pscale = np.sqrt(wcs.utils.proj_plane_pixel_area(twcs)) + + # test that CRPIX maps to CRVAL: + assert_allclose( + twcs.wcs_pix2world(*twcs.wcs.crpix, 1), twcs.wcs.crval, + rtol=0.0, atol=1e-6 * pscale + ) + + # test that CRPIX maps to CRVAL: + assert_allclose( + twcs.all_pix2world(*twcs.wcs.crpix, 1), twcs.wcs.crval, + rtol=0.0, atol=1e-6 * pscale + ) + + +def test_all_world2pix(fname=None, ext=0, + tolerance=1.0e-4, origin=0, + random_npts=25000, + adaptive=False, maxiter=20, + detect_divergence=True): + """Test all_world2pix, iterative inverse of all_pix2world""" + + # Open test FITS file: + if fname is None: + fname = get_pkg_data_filename('data/j94f05bgq_flt.fits') + ext = ('SCI', 1) + if not os.path.isfile(fname): + raise OSError("Input file '{:s}' to 'test_all_world2pix' not found." + .format(fname)) + h = fits.open(fname) + w = wcs.WCS(h[ext].header, h) + h.close() + del h + + crpix = w.wcs.crpix + ncoord = crpix.shape[0] + + # Assume that CRPIX is at the center of the image and that the image has + # a power-of-2 number of pixels along each axis. Only use the central + # 1/64 for this testing purpose: + naxesi_l = list((7. / 16 * crpix).astype(int)) + naxesi_u = list((9. / 16 * crpix).astype(int)) + + # Generate integer indices of pixels (image grid): + img_pix = np.dstack([i.flatten() for i in + np.meshgrid(*map(range, naxesi_l, naxesi_u))])[0] + + # Generage random data (in image coordinates): + with NumpyRNGContext(123456789): + rnd_pix = np.random.rand(random_npts, ncoord) + + # Scale random data to cover the central part of the image + mwidth = 2 * (crpix * 1. / 8) + rnd_pix = crpix - 0.5 * mwidth + (mwidth - 1) * rnd_pix + + # Reference pixel coordinates in image coordinate system (CS): + test_pix = np.append(img_pix, rnd_pix, axis=0) + # Reference pixel coordinates in sky CS using forward transformation: + all_world = w.all_pix2world(test_pix, origin) + + try: + runtime_begin = datetime.now() + # Apply the inverse iterative process to pixels in world coordinates + # to recover the pixel coordinates in image space. + all_pix = w.all_world2pix( + all_world, origin, tolerance=tolerance, adaptive=adaptive, + maxiter=maxiter, detect_divergence=detect_divergence) + runtime_end = datetime.now() + except wcs.wcs.NoConvergence as e: + runtime_end = datetime.now() + ndiv = 0 + if e.divergent is not None: + ndiv = e.divergent.shape[0] + print("There are {} diverging solutions.".format(ndiv)) + print("Indices of diverging solutions:\n{}" + .format(e.divergent)) + print("Diverging solutions:\n{}\n" + .format(e.best_solution[e.divergent])) + print("Mean radius of the diverging solutions: {}" + .format(np.mean( + np.linalg.norm(e.best_solution[e.divergent], axis=1)))) + print("Mean accuracy of the diverging solutions: {}\n" + .format(np.mean( + np.linalg.norm(e.accuracy[e.divergent], axis=1)))) + else: + print("There are no diverging solutions.") + + nslow = 0 + if e.slow_conv is not None: + nslow = e.slow_conv.shape[0] + print("There are {} slowly converging solutions." + .format(nslow)) + print("Indices of slowly converging solutions:\n{}" + .format(e.slow_conv)) + print("Slowly converging solutions:\n{}\n" + .format(e.best_solution[e.slow_conv])) + else: + print("There are no slowly converging solutions.\n") + + print("There are {} converged solutions." + .format(e.best_solution.shape[0] - ndiv - nslow)) + print("Best solutions (all points):\n{}" + .format(e.best_solution)) + print("Accuracy:\n{}\n".format(e.accuracy)) + print("\nFinished running 'test_all_world2pix' with errors.\n" + "ERROR: {}\nRun time: {}\n" + .format(e.args[0], runtime_end - runtime_begin)) + raise e + + # Compute differences between reference pixel coordinates and + # pixel coordinates (in image space) recovered from reference + # pixels in world coordinates: + errors = np.sqrt(np.sum(np.power(all_pix - test_pix, 2), axis=1)) + meanerr = np.mean(errors) + maxerr = np.amax(errors) + print("\nFinished running 'test_all_world2pix'.\n" + "Mean error = {0:e} (Max error = {1:e})\n" + "Run time: {2}\n" + .format(meanerr, maxerr, runtime_end - runtime_begin)) + + assert(maxerr < 2.0 * tolerance) + + +def test_scamp_sip_distortion_parameters(): + """ + Test parsing of WCS parameters with redundant SIP and SCAMP distortion + parameters. + """ + header = get_pkg_data_contents('data/validate.fits', encoding='binary') + w = wcs.WCS(header) + # Just check that this doesn't raise an exception. + w.all_pix2world(0, 0, 0) + + +def test_fixes2(): + """ + From github issue #1854 + """ + header = get_pkg_data_contents( + 'data/nonstandard_units.hdr', encoding='binary') + with pytest.raises(wcs.InvalidTransformError): + w = wcs.WCS(header, fix=False) + + +def test_unit_normalization(): + """ + From github issue #1918 + """ + header = get_pkg_data_contents( + 'data/unit.hdr', encoding='binary') + w = wcs.WCS(header) + assert w.wcs.cunit[2] == 'm/s' + + +def test_footprint_to_file(tmpdir): + """ + From github issue #1912 + """ + # Arbitrary keywords from real data + hdr = {'CTYPE1': 'RA---ZPN', 'CRUNIT1': 'deg', + 'CRPIX1': -3.3495999e+02, 'CRVAL1': 3.185790700000e+02, + 'CTYPE2': 'DEC--ZPN', 'CRUNIT2': 'deg', + 'CRPIX2': 3.0453999e+03, 'CRVAL2': 4.388538000000e+01, + 'PV2_1': 1., 'PV2_3': 220., 'NAXIS1': 2048, 'NAXIS2': 1024} + w = wcs.WCS(hdr) + + testfile = str(tmpdir.join('test.txt')) + w.footprint_to_file(testfile) + + with open(testfile, 'r') as f: + lines = f.readlines() + + assert len(lines) == 4 + assert lines[2] == 'ICRS\n' + assert 'color=green' in lines[3] + + w.footprint_to_file(testfile, coordsys='FK5', color='red') + + with open(testfile, 'r') as f: + lines = f.readlines() + + assert len(lines) == 4 + assert lines[2] == 'FK5\n' + assert 'color=red' in lines[3] + + with pytest.raises(ValueError): + w.footprint_to_file(testfile, coordsys='FOO') + + del hdr['NAXIS1'] + del hdr['NAXIS2'] + w = wcs.WCS(hdr) + with pytest.warns(AstropyUserWarning): + w.footprint_to_file(testfile) + + +def test_validate_faulty_wcs(): + """ + From github issue #2053 + """ + h = fits.Header() + # Illegal WCS: + h['RADESYSA'] = 'ICRS' + h['PV2_1'] = 1.0 + hdu = fits.PrimaryHDU([[0]], header=h) + hdulist = fits.HDUList([hdu]) + # Check that this doesn't raise a NameError exception: + wcs.validate(hdulist) + + +def test_error_message(): + header = get_pkg_data_contents( + 'data/invalid_header.hdr', encoding='binary') + + with pytest.raises(wcs.InvalidTransformError): + # Both lines are in here, because 0.4 calls .set within WCS.__init__, + # whereas 0.3 and earlier did not. + w = wcs.WCS(header, _do_set=False) + c = w.all_pix2world([[536.0, 894.0]], 0) + + +def test_out_of_bounds(): + # See #2107 + header = get_pkg_data_contents('data/zpn-hole.hdr', encoding='binary') + w = wcs.WCS(header) + + ra, dec = w.wcs_pix2world(110, 110, 0) + + assert np.isnan(ra) + assert np.isnan(dec) + + ra, dec = w.wcs_pix2world(0, 0, 0) + + assert not np.isnan(ra) + assert not np.isnan(dec) + + +def test_calc_footprint_1(): + fits = get_pkg_data_filename('data/sip.fits') + w = wcs.WCS(fits) + + axes = (1000, 1051) + ref = np.array([[202.39314493, 47.17753352], + [202.71885939, 46.94630488], + [202.94631893, 47.15855022], + [202.72053428, 47.37893142]]) + footprint = w.calc_footprint(axes=axes) + assert_allclose(footprint, ref) + + +def test_calc_footprint_2(): + """ Test calc_footprint without distortion. """ + fits = get_pkg_data_filename('data/sip.fits') + w = wcs.WCS(fits) + + axes = (1000, 1051) + ref = np.array([[202.39265216, 47.17756518], + [202.7469062, 46.91483312], + [203.11487481, 47.14359319], + [202.76092671, 47.40745948]]) + footprint = w.calc_footprint(axes=axes, undistort=False) + assert_allclose(footprint, ref) + + +def test_calc_footprint_3(): + """ Test calc_footprint with corner of the pixel.""" + w = wcs.WCS() + w.wcs.ctype = ["GLON-CAR", "GLAT-CAR"] + w.wcs.crpix = [1.5, 5.5] + w.wcs.cdelt = [-0.1, 0.1] + axes = (2, 10) + ref = np.array([[0.1, -0.5], + [0.1, 0.5], + [359.9, 0.5], + [359.9, -0.5]]) + + footprint = w.calc_footprint(axes=axes, undistort=False, center=False) + assert_allclose(footprint, ref) + + +def test_sip(): + # See #2107 + header = get_pkg_data_contents('data/irac_sip.hdr', encoding='binary') + w = wcs.WCS(header) + + x0, y0 = w.sip_pix2foc(200, 200, 0) + + assert_allclose(72, x0, 1e-3) + assert_allclose(72, y0, 1e-3) + + x1, y1 = w.sip_foc2pix(x0, y0, 0) + + assert_allclose(200, x1, 1e-3) + assert_allclose(200, y1, 1e-3) + + +def test_printwcs(): + """ + Just make sure that it runs + """ + h = get_pkg_data_contents('data/spectra/orion-freq-1.hdr', encoding='binary') + w = wcs.WCS(h) + w.printwcs() + h = get_pkg_data_contents('data/3d_cd.hdr', encoding='binary') + w = wcs.WCS(h) + w.printwcs() + + +def test_invalid_spherical(): + header = """ +SIMPLE = T / conforms to FITS standard +BITPIX = 8 / array data type +WCSAXES = 2 / no comment +CTYPE1 = 'RA---TAN' / TAN (gnomic) projection +CTYPE2 = 'DEC--TAN' / TAN (gnomic) projection +EQUINOX = 2000.0 / Equatorial coordinates definition (yr) +LONPOLE = 180.0 / no comment +LATPOLE = 0.0 / no comment +CRVAL1 = 16.0531567459 / RA of reference point +CRVAL2 = 23.1148929108 / DEC of reference point +CRPIX1 = 2129 / X reference pixel +CRPIX2 = 1417 / Y reference pixel +CUNIT1 = 'deg ' / X pixel scale units +CUNIT2 = 'deg ' / Y pixel scale units +CD1_1 = -0.00912247310646 / Transformation matrix +CD1_2 = -0.00250608809647 / no comment +CD2_1 = 0.00250608809647 / no comment +CD2_2 = -0.00912247310646 / no comment +IMAGEW = 4256 / Image width, in pixels. +IMAGEH = 2832 / Image height, in pixels. + """ + + f = io.StringIO(header) + header = fits.Header.fromtextfile(f) + + w = wcs.WCS(header) + x, y = w.wcs_world2pix(211, -26, 0) + assert np.isnan(x) and np.isnan(y) + + +def test_no_iteration(): + + # Regression test for #3066 + + w = wcs.WCS(naxis=2) + + with pytest.raises(TypeError) as exc: + iter(w) + assert exc.value.args[0] == "'WCS' object is not iterable" + + class NewWCS(wcs.WCS): + pass + + w = NewWCS(naxis=2) + + with pytest.raises(TypeError) as exc: + iter(w) + assert exc.value.args[0] == "'NewWCS' object is not iterable" + + +@pytest.mark.skipif('_wcs.__version__[0] < "5"', + reason="TPV only works with wcslib 5.x or later") +def test_sip_tpv_agreement(): + sip_header = get_pkg_data_contents( + os.path.join("data", "siponly.hdr"), encoding='binary') + tpv_header = get_pkg_data_contents( + os.path.join("data", "tpvonly.hdr"), encoding='binary') + + w_sip = wcs.WCS(sip_header) + w_tpv = wcs.WCS(tpv_header) + + assert_array_almost_equal( + w_sip.all_pix2world([w_sip.wcs.crpix], 1), + w_tpv.all_pix2world([w_tpv.wcs.crpix], 1)) + + w_sip2 = wcs.WCS(w_sip.to_header()) + w_tpv2 = wcs.WCS(w_tpv.to_header()) + + assert_array_almost_equal( + w_sip.all_pix2world([w_sip.wcs.crpix], 1), + w_sip2.all_pix2world([w_sip.wcs.crpix], 1)) + assert_array_almost_equal( + w_tpv.all_pix2world([w_sip.wcs.crpix], 1), + w_tpv2.all_pix2world([w_sip.wcs.crpix], 1)) + assert_array_almost_equal( + w_sip2.all_pix2world([w_sip.wcs.crpix], 1), + w_tpv2.all_pix2world([w_tpv.wcs.crpix], 1)) + + +@pytest.mark.skipif('_wcs.__version__[0] < "5"', + reason="TPV only works with wcslib 5.x or later") +def test_tpv_copy(): + # See #3904 + + tpv_header = get_pkg_data_contents( + os.path.join("data", "tpvonly.hdr"), encoding='binary') + + w_tpv = wcs.WCS(tpv_header) + + ra, dec = w_tpv.wcs_pix2world([0, 100, 200], [0, -100, 200], 0) + assert ra[0] != ra[1] and ra[1] != ra[2] + assert dec[0] != dec[1] and dec[1] != dec[2] + + +def test_hst_wcs(): + path = get_pkg_data_filename("data/dist_lookup.fits.gz") + + hdulist = fits.open(path) + # wcslib will complain about the distortion parameters if they + # weren't correctly deleted from the header + w = wcs.WCS(hdulist[1].header, hdulist) + + # Exercise the main transformation functions, mainly just for + # coverage + w.p4_pix2foc([0, 100, 200], [0, -100, 200], 0) + w.det2im([0, 100, 200], [0, -100, 200], 0) + + w.cpdis1 = w.cpdis1 + w.cpdis2 = w.cpdis2 + + w.det2im1 = w.det2im1 + w.det2im2 = w.det2im2 + + w.sip = w.sip + + w.cpdis1.cdelt = w.cpdis1.cdelt + w.cpdis1.crpix = w.cpdis1.crpix + w.cpdis1.crval = w.cpdis1.crval + w.cpdis1.data = w.cpdis1.data + + assert w.sip.a_order == 4 + assert w.sip.b_order == 4 + assert w.sip.ap_order == 0 + assert w.sip.bp_order == 0 + assert_array_equal(w.sip.crpix, [2048., 1024.]) + wcs.WCS(hdulist[1].header, hdulist) + hdulist.close() + + +def test_list_naxis(): + path = get_pkg_data_filename("data/dist_lookup.fits.gz") + + hdulist = fits.open(path) + # wcslib will complain about the distortion parameters if they + # weren't correctly deleted from the header + w = wcs.WCS(hdulist[1].header, hdulist, naxis=['celestial']) + assert w.naxis == 2 + assert w.wcs.naxis == 2 + + path = get_pkg_data_filename("data/maps/1904-66_SIN.hdr") + with open(path, 'rb') as fd: + content = fd.read() + w = wcs.WCS(content, naxis=['celestial']) + assert w.naxis == 2 + assert w.wcs.naxis == 2 + + w = wcs.WCS(content, naxis=['spectral']) + assert w.naxis == 0 + assert w.wcs.naxis == 0 + hdulist.close() + + +def test_sip_broken(): + # This header caused wcslib to segfault because it has a SIP + # specification in a non-default keyword + hdr = get_pkg_data_contents("data/sip-broken.hdr") + + w = wcs.WCS(hdr) + + +def test_no_truncate_crval(): + """ + Regression test for https://github.com/astropy/astropy/issues/4612 + """ + w = wcs.WCS(naxis=3) + w.wcs.crval = [50, 50, 2.12345678e11] + w.wcs.cdelt = [1e-3, 1e-3, 1e8] + w.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'FREQ'] + w.wcs.set() + + header = w.to_header() + for ii in range(3): + assert header['CRVAL{0}'.format(ii + 1)] == w.wcs.crval[ii] + assert header['CDELT{0}'.format(ii + 1)] == w.wcs.cdelt[ii] + + +def test_no_truncate_crval_try2(): + """ + Regression test for https://github.com/astropy/astropy/issues/4612 + """ + w = wcs.WCS(naxis=3) + w.wcs.crval = [50, 50, 2.12345678e11] + w.wcs.cdelt = [1e-5, 1e-5, 1e5] + w.wcs.ctype = ['RA---SIN', 'DEC--SIN', 'FREQ'] + w.wcs.cunit = ['deg', 'deg', 'Hz'] + w.wcs.crpix = [1, 1, 1] + w.wcs.restfrq = 2.34e11 + w.wcs.set() + + header = w.to_header() + for ii in range(3): + assert header['CRVAL{0}'.format(ii + 1)] == w.wcs.crval[ii] + assert header['CDELT{0}'.format(ii + 1)] == w.wcs.cdelt[ii] + + +def test_no_truncate_crval_p17(): + """ + Regression test for https://github.com/astropy/astropy/issues/5162 + """ + w = wcs.WCS(naxis=2) + w.wcs.crval = [50.1234567890123456, 50.1234567890123456] + w.wcs.cdelt = [1e-3, 1e-3] + w.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + w.wcs.set() + + header = w.to_header() + assert header['CRVAL1'] != w.wcs.crval[0] + assert header['CRVAL2'] != w.wcs.crval[1] + header = w.to_header(relax=wcs.WCSHDO_P17) + assert header['CRVAL1'] == w.wcs.crval[0] + assert header['CRVAL2'] == w.wcs.crval[1] + + +def test_no_truncate_using_compare(): + """ + Regression test for https://github.com/astropy/astropy/issues/4612 + + This one uses WCS.wcs.compare and some slightly different values + """ + w = wcs.WCS(naxis=3) + w.wcs.crval = [2.409303333333E+02, 50, 2.12345678e11] + w.wcs.cdelt = [1e-3, 1e-3, 1e8] + w.wcs.ctype = ['RA---TAN', 'DEC--TAN', 'FREQ'] + w.wcs.set() + w2 = wcs.WCS(w.to_header()) + w.wcs.compare(w2.wcs) + + +def test_passing_ImageHDU(): + """ + Passing ImageHDU or PrimaryHDU and comparing it with + wcs initialized from header. For #4493. + """ + path = get_pkg_data_filename('data/validate.fits') + hdulist = fits.open(path) + wcs_hdu = wcs.WCS(hdulist[0]) + wcs_header = wcs.WCS(hdulist[0].header) + assert wcs_hdu.wcs.compare(wcs_header.wcs) + wcs_hdu = wcs.WCS(hdulist[1]) + wcs_header = wcs.WCS(hdulist[1].header) + assert wcs_hdu.wcs.compare(wcs_header.wcs) + hdulist.close() + + +def test_inconsistent_sip(): + """ + Test for #4814 + """ + hdr = get_pkg_data_contents("data/sip-broken.hdr") + w = wcs.WCS(hdr) + newhdr = w.to_header(relax=None) + # CTYPE should not include "-SIP" if relax is None + wnew = wcs.WCS(newhdr) + assert all(not ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + newhdr = w.to_header(relax=False) + assert('A_0_2' not in newhdr) + # CTYPE should not include "-SIP" if relax is False + wnew = wcs.WCS(newhdr) + assert all(not ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + newhdr = w.to_header(key="C") + assert('A_0_2' not in newhdr) + # Test writing header with a different key + wnew = wcs.WCS(newhdr, key='C') + assert all(not ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + newhdr = w.to_header(key=" ") + # Test writing a primary WCS to header + wnew = wcs.WCS(newhdr) + assert all(not ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + # Test that "-SIP" is kept into CTYPE if relax=True and + # "-SIP" was in the original header + newhdr = w.to_header(relax=True) + wnew = wcs.WCS(newhdr) + assert all(ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + assert('A_0_2' in newhdr) + # Test that SIP coefficients are also written out. + assert wnew.sip is not None + # ######### broken header ########### + # Test that "-SIP" is added to CTYPE if relax=True and + # "-SIP" was not in the original header but SIP coefficients + # are present. + w = wcs.WCS(hdr) + w.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + newhdr = w.to_header(relax=True) + wnew = wcs.WCS(newhdr) + assert all(ctyp.endswith('-SIP') for ctyp in wnew.wcs.ctype) + + +def test_bounds_check(): + """Test for #4957""" + w = wcs.WCS(naxis=2) + w.wcs.ctype = ["RA---CAR", "DEC--CAR"] + w.wcs.cdelt = [10, 10] + w.wcs.crval = [-90, 90] + w.wcs.crpix = [1, 1] + w.wcs.bounds_check(False, False) + ra, dec = w.wcs_pix2world(300, 0, 0) + assert_allclose(ra, -180) + assert_allclose(dec, -30) + + +def test_naxis(): + w = wcs.WCS(naxis=2) + w.wcs.crval = [1, 1] + w.wcs.cdelt = [0.1, 0.1] + w.wcs.crpix = [1, 1] + w._naxis = [1000, 500] + assert w.pixel_shape == (1000, 500) + assert w.array_shape == (500, 1000) + + w.pixel_shape = (99, 59) + assert w._naxis == [99, 59] + + w.array_shape = (45, 23) + assert w._naxis == [23, 45] + assert w.pixel_shape == (23, 45) + + w.pixel_shape = None + assert w.pixel_bounds is None + + +def test_sip_with_altkey(): + """ + Test that when creating a WCS object using a key, CTYPE with + that key is looked at and not the primary CTYPE. + fix for #5443. + """ + with fits.open(get_pkg_data_filename('data/sip.fits')) as f: + w = wcs.WCS(f[0].header) + # create a header with two WCSs. + h1 = w.to_header(relax=True, key='A') + h2 = w.to_header(relax=False) + h1['CTYPE1A'] = "RA---SIN-SIP" + h1['CTYPE2A'] = "DEC--SIN-SIP" + h1.update(h2) + w = wcs.WCS(h1, key='A') + assert (w.wcs.ctype == np.array(['RA---SIN-SIP', 'DEC--SIN-SIP'])).all() + + +def test_to_fits_1(): + """ + Test to_fits() with LookupTable distortion. + """ + fits_name = get_pkg_data_filename('data/dist.fits') + w = wcs.WCS(fits_name) + wfits = w.to_fits() + assert isinstance(wfits, fits.HDUList) + assert isinstance(wfits[0], fits.PrimaryHDU) + assert isinstance(wfits[1], fits.ImageHDU) + +def test_keyedsip(): + """ + Test sip reading with extra key. + """ + hdr_name = get_pkg_data_filename('data/sip-broken.hdr') + header = fits.Header.fromfile(hdr_name) + del header[str("CRPIX1")] + del header[str("CRPIX2")] + + w = wcs.WCS(header=header, key="A") + assert isinstance( w.sip, wcs.Sip ) + assert w.sip.crpix[0] == 2048 + assert w.sip.crpix[1] == 1026 + +def test_zero_size_input(): + with fits.open(get_pkg_data_filename('data/sip.fits')) as f: + w = wcs.WCS(f[0].header) + + inp = np.zeros((0, 2)) + assert_array_equal(inp, w.all_pix2world(inp, 0)) + assert_array_equal(inp, w.all_world2pix(inp, 0)) + + inp = [], [1] + result = w.all_pix2world([], [1], 0) + assert_array_equal(inp[0], result[0]) + assert_array_equal(inp[1], result[1]) + + result = w.all_world2pix([], [1], 0) + assert_array_equal(inp[0], result[0]) + assert_array_equal(inp[1], result[1]) + + +def test_scalar_inputs(): + """ + Issue #7845 + """ + wcsobj = wcs.WCS(naxis=1) + result = wcsobj.all_pix2world(2, 1) + assert_array_equal(result, [np.array(2.)]) + assert result[0].shape == () + + result = wcsobj.all_pix2world([2], 1) + assert_array_equal(result, [np.array([2.])]) + assert result[0].shape == (1,) + +def test_footprint_contains(): + """ + Test WCS.footprint_contains(skycoord) + """ + + header = """ +WCSAXES = 2 / Number of coordinate axes +CRPIX1 = 1045.0 / Pixel coordinate of reference point +CRPIX2 = 1001.0 / Pixel coordinate of reference point +PC1_1 = -0.00556448550786 / Coordinate transformation matrix element +PC1_2 = -0.001042120133257 / Coordinate transformation matrix element +PC2_1 = 0.001181477028705 / Coordinate transformation matrix element +PC2_2 = -0.005590809742987 / Coordinate transformation matrix element +CDELT1 = 1.0 / [deg] Coordinate increment at reference point +CDELT2 = 1.0 / [deg] Coordinate increment at reference point +CUNIT1 = 'deg' / Units of coordinate increment and value +CUNIT2 = 'deg' / Units of coordinate increment and value +CTYPE1 = 'RA---TAN' / TAN (gnomonic) projection + SIP distortions +CTYPE2 = 'DEC--TAN' / TAN (gnomonic) projection + SIP distortions +CRVAL1 = 250.34971683647 / [deg] Coordinate value at reference point +CRVAL2 = 2.2808772582495 / [deg] Coordinate value at reference point +LONPOLE = 180.0 / [deg] Native longitude of celestial pole +LATPOLE = 2.2808772582495 / [deg] Native latitude of celestial pole +RADESYS = 'ICRS' / Equatorial coordinate system +MJD-OBS = 58612.339199259 / [d] MJD of observation matching DATE-OBS +DATE-OBS= '2019-05-09T08:08:26.816Z' / ISO-8601 observation date matching MJD-OB +NAXIS = 2 / NAXIS +NAXIS1 = 2136 / length of first array dimension +NAXIS2 = 2078 / length of second array dimension + """ + + header = fits.Header.fromstring(header.strip(),'\n') + test_wcs = wcs.WCS(header) + + hasCoord = test_wcs.footprint_contains(SkyCoord(254,2,unit='deg')) + assert hasCoord == True + + hasCoord = test_wcs.footprint_contains(SkyCoord(240,2,unit='deg')) + assert hasCoord == False + + hasCoord = test_wcs.footprint_contains(SkyCoord(24,2,unit='deg')) + assert hasCoord == False + + +def test_cunit(): + # Initializing WCS + w1 = wcs.WCS(naxis=2) + w2 = wcs.WCS(naxis=2) + w3 = wcs.WCS(naxis=2) + # Initializing the values of cunit + w1.wcs.cunit = ['deg', 'm/s'] + w2.wcs.cunit = ['km/h', 'km/h'] + w3.wcs.cunit = ['deg', 'm/s'] + + # Equality checking a cunit with itself + assert w1.wcs.cunit == w1.wcs.cunit + # Equality checking of two different cunit object having same values + assert w1.wcs.cunit == w3.wcs.cunit + # Inequality checking of two different cunit object having different values + assert not w1.wcs.cunit == w2.wcs.cunit + # Inequality checking of cunit with a list of literals + assert not w1.wcs.cunit == [1, 2, 3] + # Inequality checking with some characters + assert w1.wcs.cunit != ['a', 'b', 'c'] + # Comparison is not implemented TypeError will raise + with pytest.raises(TypeError): + w1.wcs.cunit < w2.wcs.cunit + + +class TestWcsWithTime: + def setup(self): + fname = get_pkg_data_filename( + 'data/header_with_time.fits') + self.header = fits.Header.fromfile(fname) + self.w = wcs.WCS(self.header, key='A') + + def test_keywods2wcsprm(self): + """ Make sure Wcsprm is populated correctly from the header.""" + + ctype = [self.header[val] for val in self.header["CTYPE*"]] + crval = [self.header[val] for val in self.header["CRVAL*"]] + crpix = [self.header[val] for val in self.header["CRPIX*"]] + cdelt = [self.header[val] for val in self.header["CDELT*"]] + cunit = [self.header[val] for val in self.header["CUNIT*"]] + assert list(self.w.wcs.ctype) == ctype + assert list(self.w.wcs.axis_types) == [2200, 2201, 3300, 0] + assert_allclose(self.w.wcs.crval, crval) + assert_allclose(self.w.wcs.crpix, crpix) + assert_allclose(self.w.wcs.cdelt, cdelt) + assert list(self.w.wcs.cunit) == cunit + + naxis = self.w.naxis + assert naxis == 4 + pc = np.zeros((naxis, naxis), dtype=np.float64) + for i in range(1, 5): + for j in range(1, 5): + if i == j: + pc[i-1, j-1] = self.header.get('PC{}_{}A'.format(i, j), 1) + else: + pc[i-1, j-1] = self.header.get('PC{}_{}A'.format(i, j), 0) + assert_allclose(self.w.wcs.pc, pc) + + char_keys = ['timesys', 'trefpos', 'trefdir', 'plephem', 'timeunit', + 'dateref', 'dateobs', 'datebeg', 'dateavg', 'dateend'] + for key in char_keys: + assert getattr(self.w.wcs, key) == self.header.get(key, "") + + num_keys = ['mjdref', 'mjdobs', 'mjdbeg', 'mjdend', + 'jepoch', 'bepoch', 'tstart', 'tstop', 'xposure', + 'timsyer', 'timrder', 'timedel', 'timepixr', + 'timeoffs', 'telapse', 'czphs', 'cperi'] + + for key in num_keys: + assert_allclose(getattr(self.w.wcs, key), self.header.get(key, np.nan)) + + def test_transforms(self): + assert_allclose(self.w.all_pix2world(*self.w.wcs.crpix, 1), self.w.wcs.crval) diff --git a/testbed/astropy__astropy/astropy/wcs/tests/test_wcsprm.py b/testbed/astropy__astropy/astropy/wcs/tests/test_wcsprm.py new file mode 100644 index 0000000000000000000000000000000000000000..d97c32188db838afb2f48ced7c026df055838920 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/tests/test_wcsprm.py @@ -0,0 +1,1152 @@ +# -*- coding: utf-8 -*- + +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import gc +import locale +import re + +import pytest +import numpy as np +from numpy.testing import (assert_array_equal, assert_array_almost_equal, + assert_allclose) + +from astropy.tests.helper import raises, catch_warnings +from astropy.io import fits +from astropy.wcs import wcs +from astropy.wcs import _wcs +from astropy.utils.data import get_pkg_data_contents, get_pkg_data_fileobj, get_pkg_data_filename +from astropy import units as u + + +###################################################################### + + +def test_alt(): + w = _wcs.Wcsprm() + assert w.alt == " " + w.alt = "X" + assert w.alt == "X" + del w.alt + assert w.alt == " " + + +@raises(ValueError) +def test_alt_invalid1(): + w = _wcs.Wcsprm() + w.alt = "$" + + +@raises(ValueError) +def test_alt_invalid2(): + w = _wcs.Wcsprm() + w.alt = " " + + +def test_axis_types(): + w = _wcs.Wcsprm() + assert_array_equal(w.axis_types, [0, 0]) + + +def test_cd(): + w = _wcs.Wcsprm() + w.cd = [[1, 0], [0, 1]] + assert w.cd.dtype == float + assert w.has_cd() is True + assert_array_equal(w.cd, [[1, 0], [0, 1]]) + del w.cd + assert w.has_cd() is False + + +@raises(AttributeError) +def test_cd_missing(): + w = _wcs.Wcsprm() + assert w.has_cd() is False + w.cd + + +@raises(AttributeError) +def test_cd_missing2(): + w = _wcs.Wcsprm() + w.cd = [[1, 0], [0, 1]] + assert w.has_cd() is True + del w.cd + assert w.has_cd() is False + w.cd + + +@raises(ValueError) +def test_cd_invalid(): + w = _wcs.Wcsprm() + w.cd = [1, 0, 0, 1] + + +def test_cdfix(): + w = _wcs.Wcsprm() + w.cdfix() + + +def test_cdelt(): + w = _wcs.Wcsprm() + assert_array_equal(w.cdelt, [1, 1]) + w.cdelt = [42, 54] + assert_array_equal(w.cdelt, [42, 54]) + + +@raises(TypeError) +def test_cdelt_delete(): + w = _wcs.Wcsprm() + del w.cdelt + + +def test_cel_offset(): + w = _wcs.Wcsprm() + assert w.cel_offset is False + w.cel_offset = 'foo' + assert w.cel_offset is True + w.cel_offset = 0 + assert w.cel_offset is False + + +def test_celfix(): + # TODO: We need some data with -NCP or -GLS projections to test + # with. For now, this is just a smoke test + w = _wcs.Wcsprm() + assert w.celfix() == -1 + + +def test_cname(): + w = _wcs.Wcsprm() + # Test that this works as an iterator + for x in w.cname: + assert x == '' + assert list(w.cname) == ['', ''] + w.cname = [b'foo', 'bar'] + assert list(w.cname) == ['foo', 'bar'] + + +@raises(TypeError) +def test_cname_invalid(): + w = _wcs.Wcsprm() + w.cname = [42, 54] + + +def test_colax(): + w = _wcs.Wcsprm() + assert w.colax.dtype == np.intc + assert_array_equal(w.colax, [0, 0]) + w.colax = [42, 54] + assert_array_equal(w.colax, [42, 54]) + w.colax[0] = 0 + assert_array_equal(w.colax, [0, 54]) + + with pytest.raises(ValueError): + w.colax = [1, 2, 3] + + +def test_colnum(): + w = _wcs.Wcsprm() + assert w.colnum == 0 + w.colnum = 42 + assert w.colnum == 42 + + with pytest.raises(OverflowError): + w.colnum = 0xffffffffffffffffffff + + with pytest.raises(OverflowError): + w.colnum = 0xffffffff + + with pytest.raises(TypeError): + del w.colnum + + +@raises(TypeError) +def test_colnum_invalid(): + w = _wcs.Wcsprm() + w.colnum = 'foo' + + +def test_crder(): + w = _wcs.Wcsprm() + assert w.crder.dtype == float + assert np.all(np.isnan(w.crder)) + w.crder[0] = 0 + assert np.isnan(w.crder[1]) + assert w.crder[0] == 0 + w.crder = w.crder + + +def test_crota(): + w = _wcs.Wcsprm() + w.crota = [1, 0] + assert w.crota.dtype == float + assert w.has_crota() is True + assert_array_equal(w.crota, [1, 0]) + del w.crota + assert w.has_crota() is False + + +@raises(AttributeError) +def test_crota_missing(): + w = _wcs.Wcsprm() + assert w.has_crota() is False + w.crota + + +@raises(AttributeError) +def test_crota_missing2(): + w = _wcs.Wcsprm() + w.crota = [1, 0] + assert w.has_crota() is True + del w.crota + assert w.has_crota() is False + w.crota + + +def test_crpix(): + w = _wcs.Wcsprm() + assert w.crpix.dtype == float + assert_array_equal(w.crpix, [0, 0]) + w.crpix = [42, 54] + assert_array_equal(w.crpix, [42, 54]) + w.crpix[0] = 0 + assert_array_equal(w.crpix, [0, 54]) + + with pytest.raises(ValueError): + w.crpix = [1, 2, 3] + + +def test_crval(): + w = _wcs.Wcsprm() + assert w.crval.dtype == float + assert_array_equal(w.crval, [0, 0]) + w.crval = [42, 54] + assert_array_equal(w.crval, [42, 54]) + w.crval[0] = 0 + assert_array_equal(w.crval, [0, 54]) + + +def test_csyer(): + w = _wcs.Wcsprm() + assert w.csyer.dtype == float + assert np.all(np.isnan(w.csyer)) + w.csyer[0] = 0 + assert np.isnan(w.csyer[1]) + assert w.csyer[0] == 0 + w.csyer = w.csyer + + +def test_ctype(): + w = _wcs.Wcsprm() + assert list(w.ctype) == ['', ''] + w.ctype = [b'RA---TAN', 'DEC--TAN'] + assert_array_equal(w.axis_types, [2200, 2201]) + assert w.lat == 1 + assert w.lng == 0 + assert w.lattyp == 'DEC' + assert w.lngtyp == 'RA' + assert list(w.ctype) == ['RA---TAN', 'DEC--TAN'] + w.ctype = ['foo', 'bar'] + assert_array_equal(w.axis_types, [0, 0]) + assert list(w.ctype) == ['foo', 'bar'] + assert w.lat == -1 + assert w.lng == -1 + assert w.lattyp == 'DEC' + assert w.lngtyp == 'RA' + + +def test_ctype_repr(): + w = _wcs.Wcsprm() + assert list(w.ctype) == ['', ''] + w.ctype = [b'RA-\t--TAN', 'DEC-\n-TAN'] + assert repr(w.ctype == '["RA-\t--TAN", "DEC-\n-TAN"]') + + +def test_ctype_index_error(): + w = _wcs.Wcsprm() + assert list(w.ctype) == ['', ''] + with pytest.raises(IndexError): + w.ctype[2] = 'FOO' + + +def test_ctype_invalid_error(): + w = _wcs.Wcsprm() + assert list(w.ctype) == ['', ''] + with pytest.raises(ValueError): + w.ctype[0] = 'X' * 100 + with pytest.raises(TypeError): + w.ctype[0] = True + with pytest.raises(TypeError): + w.ctype = ['a', 0] + with pytest.raises(TypeError): + w.ctype = None + with pytest.raises(ValueError): + w.ctype = ['a', 'b', 'c'] + with pytest.raises(ValueError): + w.ctype = ['FOO', 'A' * 100] + + +def test_cubeface(): + w = _wcs.Wcsprm() + assert w.cubeface == -1 + w.cubeface = 0 + with pytest.raises(OverflowError): + w.cubeface = -1 + + +def test_cunit(): + w = _wcs.Wcsprm() + assert list(w.cunit) == [u.Unit(''), u.Unit('')] + w.cunit = [u.m, 'km'] + assert w.cunit[0] == u.m + assert w.cunit[1] == u.km + + +def test_cunit_invalid(): + w = _wcs.Wcsprm() + with catch_warnings() as warns: + w.cunit[0] = 'foo' + assert len(warns) == 1 + assert 'foo' in str(warns[0].message) + + +def test_cunit_invalid2(): + w = _wcs.Wcsprm() + with catch_warnings() as warns: + w.cunit = ['foo', 'bar'] + assert len(warns) == 2 + assert 'foo' in str(warns[0].message) + assert 'bar' in str(warns[1].message) + + +def test_unit(): + w = wcs.WCS() + w.wcs.cunit[0] = u.erg + assert w.wcs.cunit[0] == u.erg + + assert repr(w.wcs.cunit) == "['erg', '']" + + +def test_unit2(): + w = wcs.WCS() + myunit = u.Unit("FOOBAR", parse_strict="warn") + w.wcs.cunit[0] = myunit + + +def test_unit3(): + w = wcs.WCS() + with pytest.raises(IndexError): + w.wcs.cunit[2] = u.m + with pytest.raises(ValueError): + w.wcs.cunit = [u.m, u.m, u.m] + + +def test_unitfix(): + w = _wcs.Wcsprm() + w.unitfix() + + +def test_cylfix(): + # TODO: We need some data with broken cylindrical projections to + # test with. For now, this is just a smoke test. + w = _wcs.Wcsprm() + assert w.cylfix() == -1 + + assert w.cylfix([0, 1]) == -1 + + with pytest.raises(ValueError): + w.cylfix([0, 1, 2]) + + +def test_dateavg(): + w = _wcs.Wcsprm() + assert w.dateavg == '' + # TODO: When dateavg is verified, check that it works + + +def test_dateobs(): + w = _wcs.Wcsprm() + assert w.dateobs == '' + # TODO: When dateavg is verified, check that it works + + +def test_datfix(): + w = _wcs.Wcsprm() + w.dateobs = '31/12/99' + assert w.datfix() == 0 + assert w.dateobs == '1999-12-31' + assert w.mjdobs == 51543.0 + + +def test_equinox(): + w = _wcs.Wcsprm() + assert np.isnan(w.equinox) + w.equinox = 0 + assert w.equinox == 0 + del w.equinox + assert np.isnan(w.equinox) + + with pytest.raises(TypeError): + w.equinox = None + + +def test_fix(): + w = _wcs.Wcsprm() + fix_ref = { + 'cdfix': 'No change', + 'cylfix': 'No change', + 'obsfix': 'No change', + 'datfix': 'No change', + 'spcfix': 'No change', + 'unitfix': 'No change', + 'celfix': 'No change', + 'obsfix': 'No change',} + version = wcs._wcs.__version__ + if version[0] <= "5": + del fix_ref['obsfix'] + assert w.fix() == fix_ref + + +def test_fix2(): + w = _wcs.Wcsprm() + w.dateobs = '31/12/99' + fix_ref = { + 'cdfix': 'No change', + 'cylfix': 'No change', + 'obsfix': 'No change', + 'datfix': "Set MJD-OBS to 51543.000000 from DATE-OBS.\nChanged DATE-OBS from '31/12/99' to '1999-12-31'", + 'spcfix': 'No change', + 'unitfix': 'No change', + 'celfix': 'No change'} + version = wcs._wcs.__version__ + if version[0] <= "5": + del fix_ref['obsfix'] + fix_ref['datfix'] = "Changed '31/12/99' to '1999-12-31'" + assert w.fix() == fix_ref + assert w.dateobs == '1999-12-31' + assert w.mjdobs == 51543.0 + + +def test_fix3(): + w = _wcs.Wcsprm() + w.dateobs = '31/12/F9' + fix_ref = { + 'cdfix': 'No change', + 'cylfix': 'No change', + 'obsfix': 'No change', + 'datfix': "Invalid DATE-OBS format '31/12/F9'", + 'spcfix': 'No change', + 'unitfix': 'No change', + 'celfix': 'No change'} + version = wcs._wcs.__version__ + if version[0] <= "5": + del fix_ref['obsfix'] + fix_ref['datfix'] = "Invalid parameter value: invalid date '31/12/F9'" + assert w.fix() == fix_ref + assert w.dateobs == '31/12/F9' + assert np.isnan(w.mjdobs) + + +def test_fix4(): + w = _wcs.Wcsprm() + with pytest.raises(ValueError): + w.fix('X') + + +def test_fix5(): + w = _wcs.Wcsprm() + with pytest.raises(ValueError): + w.fix(naxis=[0, 1, 2]) + + +def test_get_ps(): + # TODO: We need some data with PSi_ma keywords + w = _wcs.Wcsprm() + assert len(w.get_ps()) == 0 + + +def test_get_pv(): + # TODO: We need some data with PVi_ma keywords + w = _wcs.Wcsprm() + assert len(w.get_pv()) == 0 + + +@raises(AssertionError) +def test_imgpix_matrix(): + w = _wcs.Wcsprm() + w.imgpix_matrix + + +@raises(AttributeError) +def test_imgpix_matrix2(): + w = _wcs.Wcsprm() + w.imgpix_matrix = None + + +def test_isunity(): + w = _wcs.Wcsprm() + assert(w.is_unity()) + + +def test_lat(): + w = _wcs.Wcsprm() + assert w.lat == -1 + + +@raises(AttributeError) +def test_lat_set(): + w = _wcs.Wcsprm() + w.lat = 0 + + +def test_latpole(): + w = _wcs.Wcsprm() + assert w.latpole == 90.0 + w.latpole = 45.0 + assert w.latpole == 45.0 + del w.latpole + assert w.latpole == 90.0 + + +def test_lattyp(): + w = _wcs.Wcsprm() + print(repr(w.lattyp)) + assert w.lattyp == " " + + +@raises(AttributeError) +def test_lattyp_set(): + w = _wcs.Wcsprm() + w.lattyp = 0 + + +def test_lng(): + w = _wcs.Wcsprm() + assert w.lng == -1 + + +@raises(AttributeError) +def test_lng_set(): + w = _wcs.Wcsprm() + w.lng = 0 + + +def test_lngtyp(): + w = _wcs.Wcsprm() + assert w.lngtyp == " " + + +@raises(AttributeError) +def test_lngtyp_set(): + w = _wcs.Wcsprm() + w.lngtyp = 0 + + +def test_lonpole(): + w = _wcs.Wcsprm() + assert np.isnan(w.lonpole) + w.lonpole = 45.0 + assert w.lonpole == 45.0 + del w.lonpole + assert np.isnan(w.lonpole) + + +def test_mix(): + w = _wcs.Wcsprm() + w.ctype = [b'RA---TAN', 'DEC--TAN'] + with pytest.raises(_wcs.InvalidCoordinateError): + w.mix(1, 1, [240, 480], 1, 5, [0, 2], [54, 32], 1) + + +def test_mjdavg(): + w = _wcs.Wcsprm() + assert np.isnan(w.mjdavg) + w.mjdavg = 45.0 + assert w.mjdavg == 45.0 + del w.mjdavg + assert np.isnan(w.mjdavg) + + +def test_mjdobs(): + w = _wcs.Wcsprm() + assert np.isnan(w.mjdobs) + w.mjdobs = 45.0 + assert w.mjdobs == 45.0 + del w.mjdobs + assert np.isnan(w.mjdobs) + + +def test_name(): + w = _wcs.Wcsprm() + assert w.name == '' + w.name = 'foo' + assert w.name == 'foo' + + +def test_naxis(): + w = _wcs.Wcsprm() + assert w.naxis == 2 + + +@raises(AttributeError) +def test_naxis_set(): + w = _wcs.Wcsprm() + w.naxis = 4 + + +def test_obsgeo(): + w = _wcs.Wcsprm() + assert np.all(np.isnan(w.obsgeo)) + w.obsgeo = [1, 2, 3, 4, 5, 6] + assert_array_equal(w.obsgeo, [1, 2, 3, 4, 5, 6]) + del w.obsgeo + assert np.all(np.isnan(w.obsgeo)) + + +def test_pc(): + w = _wcs.Wcsprm() + assert w.has_pc() + assert_array_equal(w.pc, [[1, 0], [0, 1]]) + w.cd = [[1, 0], [0, 1]] + assert not w.has_pc() + del w.cd + assert w.has_pc() + assert_array_equal(w.pc, [[1, 0], [0, 1]]) + w.pc = w.pc + + +@raises(AttributeError) +def test_pc_missing(): + w = _wcs.Wcsprm() + w.cd = [[1, 0], [0, 1]] + assert not w.has_pc() + w.pc + + +def test_phi0(): + w = _wcs.Wcsprm() + assert np.isnan(w.phi0) + w.phi0 = 42.0 + assert w.phi0 == 42.0 + del w.phi0 + assert np.isnan(w.phi0) + + +@raises(AssertionError) +def test_piximg_matrix(): + w = _wcs.Wcsprm() + w.piximg_matrix + + +@raises(AttributeError) +def test_piximg_matrix2(): + w = _wcs.Wcsprm() + w.piximg_matrix = None + + +def test_print_contents(): + # In general, this is human-consumable, so we don't care if the + # content changes, just check the type + w = _wcs.Wcsprm() + assert isinstance(str(w), str) + + +def test_radesys(): + w = _wcs.Wcsprm() + assert w.radesys == '' + w.radesys = 'foo' + assert w.radesys == 'foo' + + +def test_restfrq(): + w = _wcs.Wcsprm() + assert w.restfrq == 0.0 + w.restfrq = np.nan + assert np.isnan(w.restfrq) + del w.restfrq + + +def test_restwav(): + w = _wcs.Wcsprm() + assert w.restwav == 0.0 + w.restwav = np.nan + assert np.isnan(w.restwav) + del w.restwav + + +def test_set_ps(): + w = _wcs.Wcsprm() + data = [(0, 0, "param1"), (1, 1, "param2")] + w.set_ps(data) + assert w.get_ps() == data + + +def test_set_ps_realloc(): + w = _wcs.Wcsprm() + w.set_ps([(0, 0, "param1")] * 16) + + +def test_set_pv(): + w = _wcs.Wcsprm() + data = [(0, 0, 42.), (1, 1, 54.)] + w.set_pv(data) + assert w.get_pv() == data + + +def test_set_pv_realloc(): + w = _wcs.Wcsprm() + w.set_pv([(0, 0, 42.)] * 16) + + +def test_spcfix(): + # TODO: We need some data with broken spectral headers here to + # really test + header = get_pkg_data_contents( + 'data/spectra/orion-velo-1.hdr', encoding='binary') + w = _wcs.Wcsprm(header) + assert w.spcfix() == -1 + + +def test_spec(): + w = _wcs.Wcsprm() + assert w.spec == -1 + + +@raises(AttributeError) +def test_spec_set(): + w = _wcs.Wcsprm() + w.spec = 0 + + +def test_specsys(): + w = _wcs.Wcsprm() + assert w.specsys == '' + w.specsys = 'foo' + assert w.specsys == 'foo' + + +def test_sptr(): + # TODO: Write me + pass + + +def test_ssysobs(): + w = _wcs.Wcsprm() + assert w.ssysobs == '' + w.ssysobs = 'foo' + assert w.ssysobs == 'foo' + + +def test_ssyssrc(): + w = _wcs.Wcsprm() + assert w.ssyssrc == '' + w.ssyssrc = 'foo' + assert w.ssyssrc == 'foo' + + +def test_tab(): + w = _wcs.Wcsprm() + assert len(w.tab) == 0 + # TODO: Inject some headers that have tables and test + + +def test_theta0(): + w = _wcs.Wcsprm() + assert np.isnan(w.theta0) + w.theta0 = 42.0 + assert w.theta0 == 42.0 + del w.theta0 + assert np.isnan(w.theta0) + + +def test_toheader(): + w = _wcs.Wcsprm() + assert isinstance(w.to_header(), str) + + +def test_velangl(): + w = _wcs.Wcsprm() + assert np.isnan(w.velangl) + w.velangl = 42.0 + assert w.velangl == 42.0 + del w.velangl + assert np.isnan(w.velangl) + + +def test_velosys(): + w = _wcs.Wcsprm() + assert np.isnan(w.velosys) + w.velosys = 42.0 + assert w.velosys == 42.0 + del w.velosys + assert np.isnan(w.velosys) + + +def test_velref(): + w = _wcs.Wcsprm() + assert w.velref == 0.0 + w.velref = 42.0 + assert w.velref == 42.0 + del w.velref + assert w.velref == 0.0 + + +def test_zsource(): + w = _wcs.Wcsprm() + assert np.isnan(w.zsource) + w.zsource = 42.0 + assert w.zsource == 42.0 + del w.zsource + assert np.isnan(w.zsource) + + +def test_cd_3d(): + header = get_pkg_data_contents('data/3d_cd.hdr', encoding='binary') + w = _wcs.Wcsprm(header) + assert w.cd.shape == (3, 3) + assert w.get_pc().shape == (3, 3) + assert w.get_cdelt().shape == (3,) + + +def test_get_pc(): + header = get_pkg_data_contents('data/3d_cd.hdr', encoding='binary') + w = _wcs.Wcsprm(header) + pc = w.get_pc() + try: + pc[0, 0] = 42 + except (RuntimeError, ValueError): + pass + else: + raise AssertionError() + + +@raises(_wcs.SingularMatrixError) +def test_detailed_err(): + w = _wcs.Wcsprm() + w.pc = [[0, 0], [0, 0]] + w.set() + + +def test_header_parse(): + from astropy.io import fits + with get_pkg_data_fileobj( + 'data/header_newlines.fits', encoding='binary') as test_file: + hdulist = fits.open(test_file) + w = wcs.WCS(hdulist[0].header) + assert w.wcs.ctype[0] == 'RA---TAN-SIP' + + +def test_locale(): + orig_locale = locale.getlocale(locale.LC_NUMERIC)[0] + + try: + locale.setlocale(locale.LC_NUMERIC, 'fr_FR') + except locale.Error: + pytest.xfail( + "Can't set to 'fr_FR' locale, perhaps because it is not installed " + "on this system") + try: + header = get_pkg_data_contents('data/locale.hdr', encoding='binary') + w = _wcs.Wcsprm(header) + assert re.search("[0-9]+,[0-9]*", w.to_header()) is None + finally: + if orig_locale is None: + # reset to the default setting + locale.resetlocale(locale.LC_NUMERIC) + else: + # restore to whatever the previous value had been set to for + # whatever reason + locale.setlocale(locale.LC_NUMERIC, orig_locale) + + +@raises(UnicodeEncodeError) +def test_unicode(): + w = _wcs.Wcsprm() + w.alt = "‰" + + +def test_sub_segfault(): + # Issue #1960 + header = fits.Header.fromtextfile( + get_pkg_data_filename('data/sub-segfault.hdr')) + w = wcs.WCS(header) + sub = w.sub([wcs.WCSSUB_CELESTIAL]) + gc.collect() + + +def test_bounds_check(): + w = _wcs.Wcsprm() + w.bounds_check(False) + + +def test_wcs_sub_error_message(): + # Issue #1587 + w = _wcs.Wcsprm() + with pytest.raises(TypeError) as e: + w.sub('latitude') + assert str(e).endswith("axes must None, a sequence or an integer") + + +def test_wcs_sub(): + # Issue #3356 + w = _wcs.Wcsprm() + w.sub(['latitude']) + + w = _wcs.Wcsprm() + w.sub([b'latitude']) + + +def test_compare(): + header = get_pkg_data_contents('data/3d_cd.hdr', encoding='binary') + w = _wcs.Wcsprm(header) + w2 = _wcs.Wcsprm(header) + + assert w == w2 + + w.equinox = 42 + assert w == w2 + + assert not w.compare(w2) + assert w.compare(w2, _wcs.WCSCOMPARE_ANCILLARY) + + w = _wcs.Wcsprm(header) + w2 = _wcs.Wcsprm(header) + + w.cdelt[0] = np.float32(0.00416666666666666666666666) + w2.cdelt[0] = np.float64(0.00416666666666666666666666) + + assert not w.compare(w2) + assert w.compare(w2, tolerance=1e-6) + + +def test_radesys_defaults(): + w = _wcs.Wcsprm() + w.ctype = ['RA---TAN', 'DEC--TAN'] + w.set() + assert w.radesys == "ICRS" + + +def test_radesys_defaults_full(): + + # As described in Section 3.1 of the FITS standard "Equatorial and ecliptic + # coordinates", for those systems the RADESYS keyword can be used to + # indicate the equatorial/ecliptic frame to use. From the standard: + + # "For RADESYSa values of FK4 and FK4-NO-E, any stated equinox is Besselian + # and, if neither EQUINOXa nor EPOCH are given, a default of 1950.0 is to + # be taken. For FK5, any stated equinox is Julian and, if neither keyword + # is given, it defaults to 2000.0. + + # "If the EQUINOXa keyword is given it should always be accompanied by + # RADESYS a. However, if it should happen to ap- pear by itself then + # RADESYSa defaults to FK4 if EQUINOXa < 1984.0, or to FK5 if EQUINOXa + # 1984.0. Note that these defaults, while probably true of older files + # using the EPOCH keyword, are not required of them. + + # By default RADESYS is empty + w = _wcs.Wcsprm(naxis=2) + assert w.radesys == '' + assert np.isnan(w.equinox) + + # For non-ecliptic or equatorial systems it is still empty + w = _wcs.Wcsprm(naxis=2) + for ctype in [('GLON-CAR', 'GLAT-CAR'), + ('SLON-SIN', 'SLAT-SIN')]: + w.ctype = ctype + w.set() + assert w.radesys == '' + assert np.isnan(w.equinox) + + for ctype in [('RA---TAN', 'DEC--TAN'), + ('ELON-TAN', 'ELAT-TAN'), + ('DEC--TAN', 'RA---TAN'), + ('ELAT-TAN', 'ELON-TAN')]: + + # Check defaults for RADESYS + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.set() + assert w.radesys == 'ICRS' + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.equinox = 1980 + w.set() + assert w.radesys == 'FK4' + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.equinox = 1984 + w.set() + assert w.radesys == 'FK5' + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.radesys = 'foo' + w.set() + assert w.radesys == 'foo' + + # Check defaults for EQUINOX + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.set() + assert np.isnan(w.equinox) # frame is ICRS, no equinox + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.radesys = 'ICRS' + w.set() + assert np.isnan(w.equinox) + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.radesys = 'FK5' + w.set() + assert w.equinox == 2000. + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.radesys = 'FK4' + w.set() + assert w.equinox == 1950 + + w = _wcs.Wcsprm(naxis=2) + w.ctype = ctype + w.radesys = 'FK4-NO-E' + w.set() + assert w.equinox == 1950 + + +def test_iteration(): + world = np.array( + [[-0.58995335, -0.5], + [0.00664326, -0.5], + [-0.58995335, -0.25], + [0.00664326, -0.25], + [-0.58995335, 0.], + [0.00664326, 0.], + [-0.58995335, 0.25], + [0.00664326, 0.25], + [-0.58995335, 0.5], + [0.00664326, 0.5]], + float + ) + + w = wcs.WCS() + w.wcs.ctype = ['GLON-CAR', 'GLAT-CAR'] + w.wcs.cdelt = [-0.006666666828, 0.006666666828] + w.wcs.crpix = [75.907, 74.8485] + x = w.wcs_world2pix(world, 1) + + expected = np.array( + [[1.64400000e+02, -1.51498185e-01], + [7.49105110e+01, -1.51498185e-01], + [1.64400000e+02, 3.73485009e+01], + [7.49105110e+01, 3.73485009e+01], + [1.64400000e+02, 7.48485000e+01], + [7.49105110e+01, 7.48485000e+01], + [1.64400000e+02, 1.12348499e+02], + [7.49105110e+01, 1.12348499e+02], + [1.64400000e+02, 1.49848498e+02], + [7.49105110e+01, 1.49848498e+02]], + float) + + assert_array_almost_equal(x, expected) + + w2 = w.wcs_pix2world(x, 1) + + world[:, 0] %= 360. + + assert_array_almost_equal(w2, world) + + +def test_invalid_args(): + with pytest.raises(TypeError): + w = _wcs.Wcsprm(keysel='A') + + with pytest.raises(ValueError): + w = _wcs.Wcsprm(keysel=2) + + with pytest.raises(ValueError): + w = _wcs.Wcsprm(colsel=2) + + with pytest.raises(ValueError): + w = _wcs.Wcsprm(naxis=64) + + header = get_pkg_data_contents( + 'data/spectra/orion-velo-1.hdr', encoding='binary') + with pytest.raises(ValueError): + w = _wcs.Wcsprm(header, relax='FOO') + + with pytest.raises(ValueError): + w = _wcs.Wcsprm(header, naxis=3) + + with pytest.raises(KeyError): + w = _wcs.Wcsprm(header, key='A') + + +# Test keywords in the Time standard + + +def test_datebeg(): + w = _wcs.Wcsprm() + assert w.datebeg == '' + w.datebeg = '2001-02-11' + assert w.datebeg == '2001-02-11' + w.datebeg = '31/12/99' + fix_ref = { + 'cdfix': 'No change', + 'cylfix': 'No change', + 'obsfix': 'No change', + 'datfix': "Invalid DATE-BEG format '31/12/99'", + 'spcfix': 'No change', + 'unitfix': 'No change', + 'celfix': 'No change'} + assert w.fix() == fix_ref + + +char_keys = ['timesys', 'trefpos', 'trefdir', 'plephem', 'timeunit', + 'dateref', 'dateavg', 'dateend'] + + +@pytest.mark.parametrize('key', char_keys) +def test_char_keys(key): + w = _wcs.Wcsprm() + assert getattr(w, key) == '' + setattr(w, key, "foo") + assert getattr(w, key) == 'foo' + with pytest.raises(TypeError): + setattr(w, key, 42) + + +num_keys = ['mjdobs', 'mjdbeg', 'mjdend', 'jepoch', + 'bepoch', 'tstart', 'tstop', 'xposure', 'timsyer', + 'timrder', 'timedel', 'timepixr', 'timeoffs', + 'telapse', 'xposure'] + + +@pytest.mark.parametrize('key', num_keys) +def test_num_keys(key): + w = _wcs.Wcsprm() + assert np.isnan(getattr(w, key)) + setattr(w, key, 42.0) + assert getattr(w, key) == 42.0 + delattr(w, key) + assert np.isnan(getattr(w, key)) + with pytest.raises(TypeError): + setattr(w, key, "foo") + +array_keys = ['czphs', 'cperi', 'mjdref'] + +@pytest.mark.parametrize('key', array_keys) +def test_array_keys(key): + w = _wcs.Wcsprm() + attr = getattr(w, key) + assert np.all(np.isnan(attr)) + assert attr.dtype == float + setattr(w, key, [1., 2.]) + assert_array_equal(getattr(w, key), [1., 2.]) + with pytest.raises(ValueError): + setattr(w, key, ["foo", "bar"]) + with pytest.raises(ValueError): + setattr(w, key, "foo") diff --git a/testbed/astropy__astropy/astropy/wcs/utils.py b/testbed/astropy__astropy/astropy/wcs/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..069b81b4ca775aab57eedd21b715c84f3f71543d --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/utils.py @@ -0,0 +1,634 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +import numpy as np + +from astropy import units as u + +from .wcs import WCS, WCSSUB_LONGITUDE, WCSSUB_LATITUDE, WCSSUB_CELESTIAL + +__doctest_skip__ = ['wcs_to_celestial_frame', 'celestial_frame_to_wcs'] + +__all__ = ['add_stokes_axis_to_wcs', 'celestial_frame_to_wcs', + 'wcs_to_celestial_frame', 'proj_plane_pixel_scales', + 'proj_plane_pixel_area', 'is_proj_plane_distorted', + 'non_celestial_pixel_scales', 'skycoord_to_pixel', + 'pixel_to_skycoord', 'custom_wcs_to_frame_mappings', + 'custom_frame_to_wcs_mappings'] + + +def add_stokes_axis_to_wcs(wcs, add_before_ind): + """ + Add a new Stokes axis that is uncorrelated with any other axes. + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + The WCS to add to + add_before_ind : int + Index of the WCS to insert the new Stokes axis in front of. + To add at the end, do add_before_ind = wcs.wcs.naxis + The beginning is at position 0. + + Returns + ------- + A new `~astropy.wcs.WCS` instance with an additional axis + """ + + inds = [i + 1 for i in range(wcs.wcs.naxis)] + inds.insert(add_before_ind, 0) + newwcs = wcs.sub(inds) + newwcs.wcs.ctype[add_before_ind] = 'STOKES' + newwcs.wcs.cname[add_before_ind] = 'STOKES' + return newwcs + + +def _wcs_to_celestial_frame_builtin(wcs): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import FK4, FK4NoETerms, FK5, ICRS, ITRS, Galactic + + # Import astropy.time here otherwise setup.py fails before extensions are compiled + from astropy.time import Time + + if wcs.wcs.lng == -1 or wcs.wcs.lat == -1: + return None + + radesys = wcs.wcs.radesys + + if np.isnan(wcs.wcs.equinox): + equinox = None + else: + equinox = wcs.wcs.equinox + + xcoord = wcs.wcs.ctype[wcs.wcs.lng][:4] + ycoord = wcs.wcs.ctype[wcs.wcs.lat][:4] + + # Apply logic from FITS standard to determine the default radesys + if radesys == '' and xcoord == 'RA--' and ycoord == 'DEC-': + if equinox is None: + radesys = "ICRS" + elif equinox < 1984.: + radesys = "FK4" + else: + radesys = "FK5" + + if radesys == 'FK4': + if equinox is not None: + equinox = Time(equinox, format='byear') + frame = FK4(equinox=equinox) + elif radesys == 'FK4-NO-E': + if equinox is not None: + equinox = Time(equinox, format='byear') + frame = FK4NoETerms(equinox=equinox) + elif radesys == 'FK5': + if equinox is not None: + equinox = Time(equinox, format='jyear') + frame = FK5(equinox=equinox) + elif radesys == 'ICRS': + frame = ICRS() + else: + if xcoord == 'GLON' and ycoord == 'GLAT': + frame = Galactic() + elif xcoord == 'TLON' and ycoord == 'TLAT': + frame = ITRS(obstime=wcs.wcs.dateobs or None) + else: + frame = None + + return frame + + +def _celestial_frame_to_wcs_builtin(frame, projection='TAN'): + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import BaseRADecFrame, FK4, FK4NoETerms, FK5, ICRS, ITRS, Galactic + + # Create a 2-dimensional WCS + wcs = WCS(naxis=2) + + if isinstance(frame, BaseRADecFrame): + + xcoord = 'RA--' + ycoord = 'DEC-' + if isinstance(frame, ICRS): + wcs.wcs.radesys = 'ICRS' + elif isinstance(frame, FK4NoETerms): + wcs.wcs.radesys = 'FK4-NO-E' + wcs.wcs.equinox = frame.equinox.byear + elif isinstance(frame, FK4): + wcs.wcs.radesys = 'FK4' + wcs.wcs.equinox = frame.equinox.byear + elif isinstance(frame, FK5): + wcs.wcs.radesys = 'FK5' + wcs.wcs.equinox = frame.equinox.jyear + else: + return None + elif isinstance(frame, Galactic): + xcoord = 'GLON' + ycoord = 'GLAT' + elif isinstance(frame, ITRS): + xcoord = 'TLON' + ycoord = 'TLAT' + wcs.wcs.radesys = 'ITRS' + wcs.wcs.dateobs = frame.obstime.utc.isot + else: + return None + + wcs.wcs.ctype = [xcoord + '-' + projection, ycoord + '-' + projection] + + return wcs + + +WCS_FRAME_MAPPINGS = [[_wcs_to_celestial_frame_builtin]] +FRAME_WCS_MAPPINGS = [[_celestial_frame_to_wcs_builtin]] + + +class custom_wcs_to_frame_mappings: + def __init__(self, mappings=[]): + if hasattr(mappings, '__call__'): + mappings = [mappings] + WCS_FRAME_MAPPINGS.append(mappings) + + def __enter__(self): + pass + + def __exit__(self, type, value, tb): + WCS_FRAME_MAPPINGS.pop() + + +# Backward-compatibility +custom_frame_mappings = custom_wcs_to_frame_mappings + + +class custom_frame_to_wcs_mappings: + def __init__(self, mappings=[]): + if hasattr(mappings, '__call__'): + mappings = [mappings] + FRAME_WCS_MAPPINGS.append(mappings) + + def __enter__(self): + pass + + def __exit__(self, type, value, tb): + FRAME_WCS_MAPPINGS.pop() + + +def wcs_to_celestial_frame(wcs): + """ + For a given WCS, return the coordinate frame that matches the celestial + component of the WCS. + + Parameters + ---------- + wcs : :class:`~astropy.wcs.WCS` instance + The WCS to find the frame for + + Returns + ------- + frame : :class:`~astropy.coordinates.baseframe.BaseCoordinateFrame` subclass instance + An instance of a :class:`~astropy.coordinates.baseframe.BaseCoordinateFrame` + subclass instance that best matches the specified WCS. + + Notes + ----- + + To extend this function to frames not defined in astropy.coordinates, you + can write your own function which should take a :class:`~astropy.wcs.WCS` + instance and should return either an instance of a frame, or `None` if no + matching frame was found. You can register this function temporarily with:: + + >>> from astropy.wcs.utils import wcs_to_celestial_frame, custom_wcs_to_frame_mappings + >>> with custom_wcs_to_frame_mappings(my_function): + ... wcs_to_celestial_frame(...) + + """ + for mapping_set in WCS_FRAME_MAPPINGS: + for func in mapping_set: + frame = func(wcs) + if frame is not None: + return frame + raise ValueError("Could not determine celestial frame corresponding to " + "the specified WCS object") + + +def celestial_frame_to_wcs(frame, projection='TAN'): + """ + For a given coordinate frame, return the corresponding WCS object. + + Note that the returned WCS object has only the elements corresponding to + coordinate frames set (e.g. ctype, equinox, radesys). + + Parameters + ---------- + frame : :class:`~astropy.coordinates.baseframe.BaseCoordinateFrame` subclass instance + An instance of a :class:`~astropy.coordinates.baseframe.BaseCoordinateFrame` + subclass instance for which to find the WCS + projection : str + Projection code to use in ctype, if applicable + + Returns + ------- + wcs : :class:`~astropy.wcs.WCS` instance + The corresponding WCS object + + Examples + -------- + + :: + + >>> from astropy.wcs.utils import celestial_frame_to_wcs + >>> from astropy.coordinates import FK5 + >>> frame = FK5(equinox='J2010') + >>> wcs = celestial_frame_to_wcs(frame) + >>> wcs.to_header() + WCSAXES = 2 / Number of coordinate axes + CRPIX1 = 0.0 / Pixel coordinate of reference point + CRPIX2 = 0.0 / Pixel coordinate of reference point + CDELT1 = 1.0 / [deg] Coordinate increment at reference point + CDELT2 = 1.0 / [deg] Coordinate increment at reference point + CUNIT1 = 'deg' / Units of coordinate increment and value + CUNIT2 = 'deg' / Units of coordinate increment and value + CTYPE1 = 'RA---TAN' / Right ascension, gnomonic projection + CTYPE2 = 'DEC--TAN' / Declination, gnomonic projection + CRVAL1 = 0.0 / [deg] Coordinate value at reference point + CRVAL2 = 0.0 / [deg] Coordinate value at reference point + LONPOLE = 180.0 / [deg] Native longitude of celestial pole + LATPOLE = 0.0 / [deg] Native latitude of celestial pole + RADESYS = 'FK5' / Equatorial coordinate system + EQUINOX = 2010.0 / [yr] Equinox of equatorial coordinates + + + Notes + ----- + + To extend this function to frames not defined in astropy.coordinates, you + can write your own function which should take a + :class:`~astropy.coordinates.baseframe.BaseCoordinateFrame` subclass + instance and a projection (given as a string) and should return either a WCS + instance, or `None` if the WCS could not be determined. You can register + this function temporarily with:: + + >>> from astropy.wcs.utils import celestial_frame_to_wcs, custom_frame_to_wcs_mappings + >>> with custom_frame_to_wcs_mappings(my_function): + ... celestial_frame_to_wcs(...) + + """ + for mapping_set in FRAME_WCS_MAPPINGS: + for func in mapping_set: + wcs = func(frame, projection=projection) + if wcs is not None: + return wcs + raise ValueError("Could not determine WCS corresponding to the specified " + "coordinate frame.") + + +def proj_plane_pixel_scales(wcs): + """ + For a WCS returns pixel scales along each axis of the image pixel at + the ``CRPIX`` location once it is projected onto the + "plane of intermediate world coordinates" as defined in + `Greisen & Calabretta 2002, A&A, 395, 1061 `_. + + .. note:: + This function is concerned **only** about the transformation + "image plane"->"projection plane" and **not** about the + transformation "celestial sphere"->"projection plane"->"image plane". + Therefore, this function ignores distortions arising due to + non-linear nature of most projections. + + .. note:: + In order to compute the scales corresponding to celestial axes only, + make sure that the input `~astropy.wcs.WCS` object contains + celestial axes only, e.g., by passing in the + `~astropy.wcs.WCS.celestial` WCS object. + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + A world coordinate system object. + + Returns + ------- + scale : `~numpy.ndarray` + A vector (`~numpy.ndarray`) of projection plane increments + corresponding to each pixel side (axis). The units of the returned + results are the same as the units of `~astropy.wcs.Wcsprm.cdelt`, + `~astropy.wcs.Wcsprm.crval`, and `~astropy.wcs.Wcsprm.cd` for + the celestial WCS and can be obtained by inquiring the value + of `~astropy.wcs.Wcsprm.cunit` property of the input + `~astropy.wcs.WCS` WCS object. + + See Also + -------- + astropy.wcs.utils.proj_plane_pixel_area + + """ + return np.sqrt((wcs.pixel_scale_matrix**2).sum(axis=0, dtype=float)) + + +def proj_plane_pixel_area(wcs): + """ + For a **celestial** WCS (see `astropy.wcs.WCS.celestial`) returns pixel + area of the image pixel at the ``CRPIX`` location once it is projected + onto the "plane of intermediate world coordinates" as defined in + `Greisen & Calabretta 2002, A&A, 395, 1061 `_. + + .. note:: + This function is concerned **only** about the transformation + "image plane"->"projection plane" and **not** about the + transformation "celestial sphere"->"projection plane"->"image plane". + Therefore, this function ignores distortions arising due to + non-linear nature of most projections. + + .. note:: + In order to compute the area of pixels corresponding to celestial + axes only, this function uses the `~astropy.wcs.WCS.celestial` WCS + object of the input ``wcs``. This is different from the + `~astropy.wcs.utils.proj_plane_pixel_scales` function + that computes the scales for the axes of the input WCS itself. + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + A world coordinate system object. + + Returns + ------- + area : float + Area (in the projection plane) of the pixel at ``CRPIX`` location. + The units of the returned result are the same as the units of + the `~astropy.wcs.Wcsprm.cdelt`, `~astropy.wcs.Wcsprm.crval`, + and `~astropy.wcs.Wcsprm.cd` for the celestial WCS and can be + obtained by inquiring the value of `~astropy.wcs.Wcsprm.cunit` + property of the `~astropy.wcs.WCS.celestial` WCS object. + + Raises + ------ + ValueError + Pixel area is defined only for 2D pixels. Most likely the + `~astropy.wcs.Wcsprm.cd` matrix of the `~astropy.wcs.WCS.celestial` + WCS is not a square matrix of second order. + + Notes + ----- + + Depending on the application, square root of the pixel area can be used to + represent a single pixel scale of an equivalent square pixel + whose area is equal to the area of a generally non-square pixel. + + See Also + -------- + astropy.wcs.utils.proj_plane_pixel_scales + + """ + psm = wcs.celestial.pixel_scale_matrix + if psm.shape != (2, 2): + raise ValueError("Pixel area is defined only for 2D pixels.") + return np.abs(np.linalg.det(psm)) + + +def is_proj_plane_distorted(wcs, maxerr=1.0e-5): + r""" + For a WCS returns `False` if square image (detector) pixels stay square + when projected onto the "plane of intermediate world coordinates" + as defined in + `Greisen & Calabretta 2002, A&A, 395, 1061 `_. + It will return `True` if transformation from image (detector) coordinates + to the focal plane coordinates is non-orthogonal or if WCS contains + non-linear (e.g., SIP) distortions. + + .. note:: + Since this function is concerned **only** about the transformation + "image plane"->"focal plane" and **not** about the transformation + "celestial sphere"->"focal plane"->"image plane", + this function ignores distortions arising due to non-linear nature + of most projections. + + Let's denote by *C* either the original or the reconstructed + (from ``PC`` and ``CDELT``) CD matrix. `is_proj_plane_distorted` + verifies that the transformation from image (detector) coordinates + to the focal plane coordinates is orthogonal using the following + check: + + .. math:: + \left \| \frac{C \cdot C^{\mathrm{T}}} + {| det(C)|} - I \right \|_{\mathrm{max}} < \epsilon . + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + World coordinate system object + + maxerr : float, optional + Accuracy to which the CD matrix, **normalized** such + that :math:`|det(CD)|=1`, should be close to being an + orthogonal matrix as described in the above equation + (see :math:`\epsilon`). + + Returns + ------- + distorted : bool + Returns `True` if focal (projection) plane is distorted and `False` + otherwise. + + """ + cwcs = wcs.celestial + return (not _is_cd_orthogonal(cwcs.pixel_scale_matrix, maxerr) or + _has_distortion(cwcs)) + + +def _is_cd_orthogonal(cd, maxerr): + shape = cd.shape + if not (len(shape) == 2 and shape[0] == shape[1]): + raise ValueError("CD (or PC) matrix must be a 2D square matrix.") + + pixarea = np.abs(np.linalg.det(cd)) + if (pixarea == 0.0): + raise ValueError("CD (or PC) matrix is singular.") + + # NOTE: Technically, below we should use np.dot(cd, np.conjugate(cd.T)) + # However, I am not aware of complex CD/PC matrices... + I = np.dot(cd, cd.T) / pixarea + cd_unitary_err = np.amax(np.abs(I - np.eye(shape[0]))) + + return (cd_unitary_err < maxerr) + + +def non_celestial_pixel_scales(inwcs): + """ + Calculate the pixel scale along each axis of a non-celestial WCS, + for example one with mixed spectral and spatial axes. + + Parameters + ---------- + inwcs : `~astropy.wcs.WCS` + The world coordinate system object. + + Returns + ------- + scale : `numpy.ndarray` + The pixel scale along each axis. + """ + + if inwcs.is_celestial: + raise ValueError("WCS is celestial, use celestial_pixel_scales instead") + + pccd = inwcs.pixel_scale_matrix + + if np.allclose(np.extract(1-np.eye(*pccd.shape), pccd), 0): + return np.abs(np.diagonal(pccd))*u.deg + else: + raise ValueError("WCS is rotated, cannot determine consistent pixel scales") + + +def _has_distortion(wcs): + """ + `True` if contains any SIP or image distortion components. + """ + return any(getattr(wcs, dist_attr) is not None + for dist_attr in ['cpdis1', 'cpdis2', 'det2im1', 'det2im2', 'sip']) + + +# TODO: in future, we should think about how the following two functions can be +# integrated better into the WCS class. + +def skycoord_to_pixel(coords, wcs, origin=0, mode='all'): + """ + Convert a set of SkyCoord coordinates into pixels. + + Parameters + ---------- + coords : `~astropy.coordinates.SkyCoord` + The coordinates to convert. + wcs : `~astropy.wcs.WCS` + The WCS transformation to use. + origin : int + Whether to return 0 or 1-based pixel coordinates. + mode : 'all' or 'wcs' + Whether to do the transformation including distortions (``'all'``) or + only including only the core WCS transformation (``'wcs'``). + + Returns + ------- + xp, yp : `numpy.ndarray` + The pixel coordinates + + See Also + -------- + astropy.coordinates.SkyCoord.from_pixel + """ + + if _has_distortion(wcs) and wcs.naxis != 2: + raise ValueError("Can only handle WCS with distortions for 2-dimensional WCS") + + # Keep only the celestial part of the axes, also re-orders lon/lat + wcs = wcs.sub([WCSSUB_LONGITUDE, WCSSUB_LATITUDE]) + + if wcs.naxis != 2: + raise ValueError("WCS should contain celestial component") + + # Check which frame the WCS uses + frame = wcs_to_celestial_frame(wcs) + + # Check what unit the WCS needs + xw_unit = u.Unit(wcs.wcs.cunit[0]) + yw_unit = u.Unit(wcs.wcs.cunit[1]) + + # Convert positions to frame + coords = coords.transform_to(frame) + + # Extract longitude and latitude. We first try and use lon/lat directly, + # but if the representation is not spherical or unit spherical this will + # fail. We should then force the use of the unit spherical + # representation. We don't do that directly to make sure that we preserve + # custom lon/lat representations if available. + try: + lon = coords.data.lon.to(xw_unit) + lat = coords.data.lat.to(yw_unit) + except AttributeError: + lon = coords.spherical.lon.to(xw_unit) + lat = coords.spherical.lat.to(yw_unit) + + # Convert to pixel coordinates + if mode == 'all': + xp, yp = wcs.all_world2pix(lon.value, lat.value, origin) + elif mode == 'wcs': + xp, yp = wcs.wcs_world2pix(lon.value, lat.value, origin) + else: + raise ValueError("mode should be either 'all' or 'wcs'") + + return xp, yp + + +def pixel_to_skycoord(xp, yp, wcs, origin=0, mode='all', cls=None): + """ + Convert a set of pixel coordinates into a `~astropy.coordinates.SkyCoord` + coordinate. + + Parameters + ---------- + xp, yp : float or `numpy.ndarray` + The coordinates to convert. + wcs : `~astropy.wcs.WCS` + The WCS transformation to use. + origin : int + Whether to return 0 or 1-based pixel coordinates. + mode : 'all' or 'wcs' + Whether to do the transformation including distortions (``'all'``) or + only including only the core WCS transformation (``'wcs'``). + cls : class or None + The class of object to create. Should be a + `~astropy.coordinates.SkyCoord` subclass. If None, defaults to + `~astropy.coordinates.SkyCoord`. + + Returns + ------- + coords : Whatever ``cls`` is (a subclass of `~astropy.coordinates.SkyCoord`) + The celestial coordinates + + See Also + -------- + astropy.coordinates.SkyCoord.from_pixel + """ + + # Import astropy.coordinates here to avoid circular imports + from astropy.coordinates import SkyCoord, UnitSphericalRepresentation + + # we have to do this instead of actually setting the default to SkyCoord + # because importing SkyCoord at the module-level leads to circular + # dependencies. + if cls is None: + cls = SkyCoord + + if _has_distortion(wcs) and wcs.naxis != 2: + raise ValueError("Can only handle WCS with distortions for 2-dimensional WCS") + + # Keep only the celestial part of the axes, also re-orders lon/lat + wcs = wcs.sub([WCSSUB_LONGITUDE, WCSSUB_LATITUDE]) + + if wcs.naxis != 2: + raise ValueError("WCS should contain celestial component") + + # Check which frame the WCS uses + frame = wcs_to_celestial_frame(wcs) + + # Check what unit the WCS gives + lon_unit = u.Unit(wcs.wcs.cunit[0]) + lat_unit = u.Unit(wcs.wcs.cunit[1]) + + # Convert pixel coordinates to celestial coordinates + if mode == 'all': + lon, lat = wcs.all_pix2world(xp, yp, origin) + elif mode == 'wcs': + lon, lat = wcs.wcs_pix2world(xp, yp, origin) + else: + raise ValueError("mode should be either 'all' or 'wcs'") + + # Add units to longitude/latitude + lon = lon * lon_unit + lat = lat * lat_unit + + # Create a SkyCoord-like object + data = UnitSphericalRepresentation(lon=lon, lat=lat) + coords = cls(frame.realize_frame(data)) + + return coords diff --git a/testbed/astropy__astropy/astropy/wcs/wcs.py b/testbed/astropy__astropy/astropy/wcs/wcs.py new file mode 100644 index 0000000000000000000000000000000000000000..027694e03fb545487dc9b36f56722afa28c074e2 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcs.py @@ -0,0 +1,3347 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +Under the hood, there are 3 separate classes that perform different +parts of the transformation: + + - `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS + functionality in `wcslib`_. (This includes TPV and TPD + polynomial distortion, but not SIP distortion). + + - `~astropy.wcs.Sip`: Handles polynomial distortion as defined in the + `SIP`_ convention. + + - `~astropy.wcs.DistortionLookupTable`: Handles `distortion paper`_ + lookup tables. + +Additionally, the class `WCS` aggregates all of these transformations +together in a pipeline: + + - Detector to image plane correction (by a pair of + `~astropy.wcs.DistortionLookupTable` objects). + + - `SIP`_ distortion correction (by an underlying `~astropy.wcs.Sip` + object) + + - `distortion paper`_ table-lookup correction (by a pair of + `~astropy.wcs.DistortionLookupTable` objects). + + - `wcslib`_ WCS transformation (by a `~astropy.wcs.Wcsprm` object) + +""" + +# STDLIB +import copy +import io +import itertools +import os +import re +import textwrap +import warnings +import builtins + +# THIRD-PARTY +import numpy as np + +# LOCAL +from astropy import log +from astropy.io import fits +from . import docstrings +from . import _wcs + +from astropy.utils.compat import possible_filename +from astropy.utils.exceptions import AstropyWarning, AstropyUserWarning, AstropyDeprecationWarning + + +# Mix-in class that provides the APE 14 API +from .wcsapi.fitswcs import FITSWCSAPIMixin, SlicedFITSWCS + +__all__ = ['FITSFixedWarning', 'WCS', 'find_all_wcs', + 'DistortionLookupTable', 'Sip', 'Tabprm', 'Wcsprm', + 'WCSBase', 'validate', 'WcsError', 'SingularMatrixError', + 'InconsistentAxisTypesError', 'InvalidTransformError', + 'InvalidCoordinateError', 'NoSolutionError', + 'InvalidSubimageSpecificationError', 'NoConvergence', + 'NonseparableSubimageCoordinateSystemError', + 'NoWcsKeywordsFoundError', 'InvalidTabularParametersError'] + + +__doctest_skip__ = ['WCS.all_world2pix'] + +NAXIS_DEPRECATE_MESSAGE = """ +Private attributes "_naxis1" and "_naxis2" have been deprecated since v3.1. +Instead use the "pixel_shape" property which returns a list of NAXISj keyword values. +""" + +if _wcs is not None: + _parsed_version = _wcs.__version__.split('.') + if int(_parsed_version[0]) == 5 and int(_parsed_version[1]) < 8: + raise ImportError( + "astropy.wcs is built with wcslib {0}, but only versions 5.8 and " + "later on the 5.x series are known to work. The version of wcslib " + "that ships with astropy may be used.") + + if not _wcs._sanity_check(): + raise RuntimeError( + "astropy.wcs did not pass its sanity check for your build " + "on your platform.") + + WCSBase = _wcs._Wcs + DistortionLookupTable = _wcs.DistortionLookupTable + Sip = _wcs.Sip + Wcsprm = _wcs.Wcsprm + Tabprm = _wcs.Tabprm + WcsError = _wcs.WcsError + SingularMatrixError = _wcs.SingularMatrixError + InconsistentAxisTypesError = _wcs.InconsistentAxisTypesError + InvalidTransformError = _wcs.InvalidTransformError + InvalidCoordinateError = _wcs.InvalidCoordinateError + NoSolutionError = _wcs.NoSolutionError + InvalidSubimageSpecificationError = _wcs.InvalidSubimageSpecificationError + NonseparableSubimageCoordinateSystemError = _wcs.NonseparableSubimageCoordinateSystemError + NoWcsKeywordsFoundError = _wcs.NoWcsKeywordsFoundError + InvalidTabularParametersError = _wcs.InvalidTabularParametersError + + # Copy all the constants from the C extension into this module's namespace + for key, val in _wcs.__dict__.items(): + if key.startswith(('WCSSUB', 'WCSHDR', 'WCSHDO')): + locals()[key] = val + __all__.append(key) +else: + WCSBase = object + Wcsprm = object + DistortionLookupTable = object + Sip = object + Tabprm = object + WcsError = None + SingularMatrixError = None + InconsistentAxisTypesError = None + InvalidTransformError = None + InvalidCoordinateError = None + NoSolutionError = None + InvalidSubimageSpecificationError = None + NonseparableSubimageCoordinateSystemError = None + NoWcsKeywordsFoundError = None + InvalidTabularParametersError = None + + +# Additional relax bit flags +WCSHDO_SIP = 0x80000 + +# Regular expression defining SIP keyword It matches keyword that starts with A +# or B, optionally followed by P, followed by an underscore then a number in +# range of 0-19, followed by an underscore and another number in range of 0-19. +# Keyword optionally ends with a capital letter. +SIP_KW = re.compile('''^[AB]P?_1?[0-9]_1?[0-9][A-Z]?$''') + + +def _parse_keysel(keysel): + keysel_flags = 0 + if keysel is not None: + for element in keysel: + if element.lower() == 'image': + keysel_flags |= _wcs.WCSHDR_IMGHEAD + elif element.lower() == 'binary': + keysel_flags |= _wcs.WCSHDR_BIMGARR + elif element.lower() == 'pixel': + keysel_flags |= _wcs.WCSHDR_PIXLIST + else: + raise ValueError( + "keysel must be a list of 'image', 'binary' " + + "and/or 'pixel'") + else: + keysel_flags = -1 + + return keysel_flags + + +class NoConvergence(Exception): + """ + An error class used to report non-convergence and/or divergence + of numerical methods. It is used to report errors in the + iterative solution used by + the :py:meth:`~astropy.wcs.WCS.all_world2pix`. + + Attributes + ---------- + + best_solution : `numpy.ndarray` + Best solution achieved by the numerical method. + + accuracy : `numpy.ndarray` + Accuracy of the ``best_solution``. + + niter : `int` + Number of iterations performed by the numerical method + to compute ``best_solution``. + + divergent : None, `numpy.ndarray` + Indices of the points in ``best_solution`` array + for which the solution appears to be divergent. If the + solution does not diverge, ``divergent`` will be set to `None`. + + slow_conv : None, `numpy.ndarray` + Indices of the solutions in ``best_solution`` array + for which the solution failed to converge within the + specified maximum number of iterations. If there are no + non-converging solutions (i.e., if the required accuracy + has been achieved for all input data points) + then ``slow_conv`` will be set to `None`. + + """ + + def __init__(self, *args, best_solution=None, accuracy=None, niter=None, + divergent=None, slow_conv=None, **kwargs): + super().__init__(*args) + + self.best_solution = best_solution + self.accuracy = accuracy + self.niter = niter + self.divergent = divergent + self.slow_conv = slow_conv + + if kwargs: + warnings.warn("Function received unexpected arguments ({}) these " + "are ignored but will raise an Exception in the " + "future.".format(list(kwargs)), + AstropyDeprecationWarning) + + +class FITSFixedWarning(AstropyWarning): + """ + The warning raised when the contents of the FITS header have been + modified to be standards compliant. + """ + pass + + +class WCS(FITSWCSAPIMixin, WCSBase): + """WCS objects perform standard WCS transformations, and correct for + `SIP`_ and `distortion paper`_ table-lookup transformations, based + on the WCS keywords and supplementary data read from a FITS file. + + See also: http://docs.astropy.org/en/stable/wcs/ + + Parameters + ---------- + header : astropy.io.fits header object, Primary HDU, Image HDU, string, dict-like, or None, optional + If *header* is not provided or None, the object will be + initialized to default values. + + fobj : An astropy.io.fits file (hdulist) object, optional + It is needed when header keywords point to a `distortion + paper`_ lookup table stored in a different extension. + + key : str, optional + The name of a particular WCS transform to use. This may be + either ``' '`` or ``'A'``-``'Z'`` and corresponds to the + ``\"a\"`` part of the ``CTYPEia`` cards. *key* may only be + provided if *header* is also provided. + + minerr : float, optional + The minimum value a distortion correction must have in order + to be applied. If the value of ``CQERRja`` is smaller than + *minerr*, the corresponding distortion is not applied. + + relax : bool or int, optional + Degree of permissiveness: + + - `True` (default): Admit all recognized informal extensions + of the WCS standard. + + - `False`: Recognize only FITS keywords defined by the + published WCS standard. + + - `int`: a bit field selecting specific extensions to accept. + See :ref:`relaxread` for details. + + naxis : int or sequence, optional + Extracts specific coordinate axes using + :meth:`~astropy.wcs.Wcsprm.sub`. If a header is provided, and + *naxis* is not ``None``, *naxis* will be passed to + :meth:`~astropy.wcs.Wcsprm.sub` in order to select specific + axes from the header. See :meth:`~astropy.wcs.Wcsprm.sub` for + more details about this parameter. + + keysel : sequence of flags, optional + A sequence of flags used to select the keyword types + considered by wcslib. When ``None``, only the standard image + header keywords are considered (and the underlying wcspih() C + function is called). To use binary table image array or pixel + list keywords, *keysel* must be set. + + Each element in the list should be one of the following + strings: + + - 'image': Image header keywords + + - 'binary': Binary table image array keywords + + - 'pixel': Pixel list keywords + + Keywords such as ``EQUIna`` or ``RFRQna`` that are common to + binary table image arrays and pixel lists (including + ``WCSNna`` and ``TWCSna``) are selected by both 'binary' and + 'pixel'. + + colsel : sequence of int, optional + A sequence of table column numbers used to restrict the WCS + transformations considered to only those pertaining to the + specified columns. If `None`, there is no restriction. + + fix : bool, optional + When `True` (default), call `~astropy.wcs.Wcsprm.fix` on + the resulting object to fix any non-standard uses in the + header. `FITSFixedWarning` Warnings will be emitted if any + changes were made. + + translate_units : str, optional + Specify which potentially unsafe translations of non-standard + unit strings to perform. By default, performs none. See + `WCS.fix` for more information about this parameter. Only + effective when ``fix`` is `True`. + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid key. + + KeyError + Key not found in FITS header. + + ValueError + Lookup table distortion present in the header but *fobj* was + not provided. + + Notes + ----- + + 1. astropy.wcs supports arbitrary *n* dimensions for the core WCS + (the transformations handled by WCSLIB). However, the + `distortion paper`_ lookup table and `SIP`_ distortions must be + two dimensional. Therefore, if you try to create a WCS object + where the core WCS has a different number of dimensions than 2 + and that object also contains a `distortion paper`_ lookup + table or `SIP`_ distortion, a `ValueError` + exception will be raised. To avoid this, consider using the + *naxis* kwarg to select two dimensions from the core WCS. + + 2. The number of coordinate axes in the transformation is not + determined directly from the ``NAXIS`` keyword but instead from + the highest of: + + - ``NAXIS`` keyword + + - ``WCSAXESa`` keyword + + - The highest axis number in any parameterized WCS keyword. + The keyvalue, as well as the keyword, must be + syntactically valid otherwise it will not be considered. + + If none of these keyword types is present, i.e. if the header + only contains auxiliary WCS keywords for a particular + coordinate representation, then no coordinate description is + constructed for it. + + The number of axes, which is set as the ``naxis`` member, may + differ for different coordinate representations of the same + image. + + 3. When the header includes duplicate keywords, in most cases the + last encountered is used. + + 4. `~astropy.wcs.Wcsprm.set` is called immediately after + construction, so any invalid keywords or transformations will + be raised by the constructor, not when subsequently calling a + transformation method. + + """ + + def __init__(self, header=None, fobj=None, key=' ', minerr=0.0, + relax=True, naxis=None, keysel=None, colsel=None, + fix=True, translate_units='', _do_set=True): + close_fds = [] + + if header is None: + if naxis is None: + naxis = 2 + wcsprm = _wcs.Wcsprm(header=None, key=key, + relax=relax, naxis=naxis) + self.naxis = wcsprm.naxis + # Set some reasonable defaults. + det2im = (None, None) + cpdis = (None, None) + sip = None + else: + keysel_flags = _parse_keysel(keysel) + + if isinstance(header, (str, bytes)): + try: + is_path = (possible_filename(header) and + os.path.exists(header)) + except (OSError, ValueError): + is_path = False + + if is_path: + if fobj is not None: + raise ValueError( + "Can not provide both a FITS filename to " + "argument 1 and a FITS file object to argument 2") + fobj = fits.open(header) + close_fds.append(fobj) + header = fobj[0].header + elif isinstance(header, fits.hdu.image._ImageBaseHDU): + header = header.header + elif not isinstance(header, fits.Header): + try: + # Accept any dict-like object + orig_header = header + header = fits.Header() + for dict_key in orig_header.keys(): + header[dict_key] = orig_header[dict_key] + except TypeError: + raise TypeError( + "header must be a string, an astropy.io.fits.Header " + "object, or a dict-like object") + + if isinstance(header, fits.Header): + header_string = header.tostring().rstrip() + else: + header_string = header + + # Importantly, header is a *copy* of the passed-in header + # because we will be modifying it + if isinstance(header_string, str): + header_bytes = header_string.encode('ascii') + header_string = header_string + else: + header_bytes = header_string + header_string = header_string.decode('ascii') + + try: + tmp_header = fits.Header.fromstring(header_string) + self._remove_sip_kw(tmp_header) + tmp_header_bytes = tmp_header.tostring().rstrip() + if isinstance(tmp_header_bytes, str): + tmp_header_bytes = tmp_header_bytes.encode('ascii') + tmp_wcsprm = _wcs.Wcsprm(header=tmp_header_bytes, key=key, + relax=relax, keysel=keysel_flags, + colsel=colsel, warnings=False) + except _wcs.NoWcsKeywordsFoundError: + est_naxis = 0 + else: + if naxis is not None: + try: + tmp_wcsprm.sub(naxis) + except ValueError: + pass + est_naxis = tmp_wcsprm.naxis + else: + est_naxis = 2 + + header = fits.Header.fromstring(header_string) + + if est_naxis == 0: + est_naxis = 2 + self.naxis = est_naxis + + det2im = self._read_det2im_kw(header, fobj, err=minerr) + cpdis = self._read_distortion_kw( + header, fobj, dist='CPDIS', err=minerr) + sip = self._read_sip_kw(header, wcskey=key) + self._remove_sip_kw(header) + + header_string = header.tostring() + header_string = header_string.replace('END' + ' ' * 77, '') + + if isinstance(header_string, str): + header_bytes = header_string.encode('ascii') + header_string = header_string + else: + header_bytes = header_string + header_string = header_string.decode('ascii') + + try: + wcsprm = _wcs.Wcsprm(header=header_bytes, key=key, + relax=relax, keysel=keysel_flags, + colsel=colsel) + except _wcs.NoWcsKeywordsFoundError: + # The header may have SIP or distortions, but no core + # WCS. That isn't an error -- we want a "default" + # (identity) core Wcs transformation in that case. + if colsel is None: + wcsprm = _wcs.Wcsprm(header=None, key=key, + relax=relax, keysel=keysel_flags, + colsel=colsel) + else: + raise + + if naxis is not None: + wcsprm = wcsprm.sub(naxis) + self.naxis = wcsprm.naxis + + if (wcsprm.naxis != 2 and + (det2im[0] or det2im[1] or cpdis[0] or cpdis[1] or sip)): + raise ValueError( + """ +FITS WCS distortion paper lookup tables and SIP distortions only work +in 2 dimensions. However, WCSLIB has detected {0} dimensions in the +core WCS keywords. To use core WCS in conjunction with FITS WCS +distortion paper lookup tables or SIP distortion, you must select or +reduce these to 2 dimensions using the naxis kwarg. +""".format(wcsprm.naxis)) + + header_naxis = header.get('NAXIS', None) + if header_naxis is not None and header_naxis < wcsprm.naxis: + warnings.warn( + "The WCS transformation has more axes ({0:d}) than the " + "image it is associated with ({1:d})".format( + wcsprm.naxis, header_naxis), FITSFixedWarning) + + self._get_naxis(header) + WCSBase.__init__(self, sip, cpdis, wcsprm, det2im) + + if fix: + self.fix(translate_units=translate_units) + + if _do_set: + self.wcs.set() + + for fd in close_fds: + fd.close() + + self._pixel_bounds = None + + def __copy__(self): + new_copy = self.__class__() + WCSBase.__init__(new_copy, self.sip, + (self.cpdis1, self.cpdis2), + self.wcs, + (self.det2im1, self.det2im2)) + new_copy.__dict__.update(self.__dict__) + return new_copy + + def __deepcopy__(self, memo): + from copy import deepcopy + + new_copy = self.__class__() + new_copy.naxis = deepcopy(self.naxis, memo) + WCSBase.__init__(new_copy, deepcopy(self.sip, memo), + (deepcopy(self.cpdis1, memo), + deepcopy(self.cpdis2, memo)), + deepcopy(self.wcs, memo), + (deepcopy(self.det2im1, memo), + deepcopy(self.det2im2, memo))) + for key, val in self.__dict__.items(): + new_copy.__dict__[key] = deepcopy(val, memo) + return new_copy + + def copy(self): + """ + Return a shallow copy of the object. + + Convenience method so user doesn't have to import the + :mod:`copy` stdlib module. + + .. warning:: + Use `deepcopy` instead of `copy` unless you know why you need a + shallow copy. + """ + return copy.copy(self) + + def deepcopy(self): + """ + Return a deep copy of the object. + + Convenience method so user doesn't have to import the + :mod:`copy` stdlib module. + """ + return copy.deepcopy(self) + + def sub(self, axes=None): + copy = self.deepcopy() + copy.wcs = self.wcs.sub(axes) + copy.naxis = copy.wcs.naxis + return copy + if _wcs is not None: + sub.__doc__ = _wcs.Wcsprm.sub.__doc__ + + def _fix_scamp(self): + """ + Remove SCAMP's PVi_m distortion parameters if SIP distortion parameters + are also present. Some projects (e.g., Palomar Transient Factory) + convert SCAMP's distortion parameters (which abuse the PVi_m cards) to + SIP. However, wcslib gets confused by the presence of both SCAMP and + SIP distortion parameters. + + See https://github.com/astropy/astropy/issues/299. + """ + # Nothing to be done if no WCS attached + if self.wcs is None: + return + + # Nothing to be done if no PV parameters attached + pv = self.wcs.get_pv() + if not pv: + return + + # Nothing to be done if axes don't use SIP distortion parameters + if self.sip is None: + return + + # Nothing to be done if any radial terms are present... + # Loop over list to find any radial terms. + # Certain values of the `j' index are used for storing + # radial terms; refer to Equation (1) in + # . + pv = np.asarray(pv) + # Loop over distinct values of `i' index + for i in set(pv[:, 0]): + # Get all values of `j' index for this value of `i' index + js = set(pv[:, 1][pv[:, 0] == i]) + # Find max value of `j' index + max_j = max(js) + for j in (3, 11, 23, 39): + if j < max_j and j in js: + return + + self.wcs.set_pv([]) + warnings.warn("Removed redundant SCAMP distortion parameters " + + "because SIP parameters are also present", FITSFixedWarning) + + def fix(self, translate_units='', naxis=None): + """ + Perform the fix operations from wcslib, and warn about any + changes it has made. + + Parameters + ---------- + translate_units : str, optional + Specify which potentially unsafe translations of + non-standard unit strings to perform. By default, + performs none. + + Although ``"S"`` is commonly used to represent seconds, + its translation to ``"s"`` is potentially unsafe since the + standard recognizes ``"S"`` formally as Siemens, however + rarely that may be used. The same applies to ``"H"`` for + hours (Henry), and ``"D"`` for days (Debye). + + This string controls what to do in such cases, and is + case-insensitive. + + - If the string contains ``"s"``, translate ``"S"`` to + ``"s"``. + + - If the string contains ``"h"``, translate ``"H"`` to + ``"h"``. + + - If the string contains ``"d"``, translate ``"D"`` to + ``"d"``. + + Thus ``''`` doesn't do any unsafe translations, whereas + ``'shd'`` does all of them. + + naxis : int array[naxis], optional + Image axis lengths. If this array is set to zero or + ``None``, then `~astropy.wcs.Wcsprm.cylfix` will not be + invoked. + """ + if self.wcs is not None: + self._fix_scamp() + fixes = self.wcs.fix(translate_units, naxis) + for key, val in fixes.items(): + if val != "No change": + warnings.warn( + ("'{0}' made the change '{1}'."). + format(key, val), + FITSFixedWarning) + + def calc_footprint(self, header=None, undistort=True, axes=None, center=True): + """ + Calculates the footprint of the image on the sky. + + A footprint is defined as the positions of the corners of the + image on the sky after all available distortions have been + applied. + + Parameters + ---------- + header : `~astropy.io.fits.Header` object, optional + Used to get ``NAXIS1`` and ``NAXIS2`` + header and axes are mutually exclusive, alternative ways + to provide the same information. + + undistort : bool, optional + If `True`, take SIP and distortion lookup table into + account + + axes : length 2 sequence ints, optional + If provided, use the given sequence as the shape of the + image. Otherwise, use the ``NAXIS1`` and ``NAXIS2`` + keywords from the header that was used to create this + `WCS` object. + + center : bool, optional + If `True` use the center of the pixel, otherwise use the corner. + + Returns + ------- + coord : (4, 2) array of (*x*, *y*) coordinates. + The order is clockwise starting with the bottom left corner. + """ + if axes is not None: + naxis1, naxis2 = axes + else: + if header is None: + try: + # classes that inherit from WCS and define naxis1/2 + # do not require a header parameter + naxis1, naxis2 = self.pixel_shape + except (AttributeError, TypeError): + warnings.warn("Need a valid header in order to calculate footprint\n", AstropyUserWarning) + return None + else: + naxis1 = header.get('NAXIS1', None) + naxis2 = header.get('NAXIS2', None) + + if naxis1 is None or naxis2 is None: + raise ValueError( + "Image size could not be determined.") + + if center: + corners = np.array([[1, 1], + [1, naxis2], + [naxis1, naxis2], + [naxis1, 1]], dtype=np.float64) + else: + corners = np.array([[0.5, 0.5], + [0.5, naxis2 + 0.5], + [naxis1 + 0.5, naxis2 + 0.5], + [naxis1 + 0.5, 0.5]], dtype=np.float64) + + if undistort: + return self.all_pix2world(corners, 1) + else: + return self.wcs_pix2world(corners, 1) + + def _read_det2im_kw(self, header, fobj, err=0.0): + """ + Create a `distortion paper`_ type lookup table for detector to + image plane correction. + """ + if fobj is None: + return (None, None) + + if not isinstance(fobj, fits.HDUList): + return (None, None) + + try: + axiscorr = header[str('AXISCORR')] + d2imdis = self._read_d2im_old_format(header, fobj, axiscorr) + return d2imdis + except KeyError: + pass + + dist = 'D2IMDIS' + d_kw = 'D2IM' + err_kw = 'D2IMERR' + tables = {} + for i in range(1, self.naxis + 1): + d_error = header.get(err_kw + str(i), 0.0) + if d_error < err: + tables[i] = None + continue + distortion = dist + str(i) + if distortion in header: + dis = header[distortion].lower() + if dis == 'lookup': + del header[distortion] + assert isinstance(fobj, fits.HDUList), ('An astropy.io.fits.HDUList' + 'is required for Lookup table distortion.') + dp = (d_kw + str(i)).strip() + dp_extver_key = dp + str('.EXTVER') + if dp_extver_key in header: + d_extver = header[dp_extver_key] + del header[dp_extver_key] + else: + d_extver = 1 + dp_axis_key = dp + str('.AXIS.{0:d}').format(i) + if i == header[dp_axis_key]: + d_data = fobj[str('D2IMARR'), d_extver].data + else: + d_data = (fobj[str('D2IMARR'), d_extver].data).transpose() + del header[dp_axis_key] + d_header = fobj[str('D2IMARR'), d_extver].header + d_crpix = (d_header.get(str('CRPIX1'), 0.0), d_header.get(str('CRPIX2'), 0.0)) + d_crval = (d_header.get(str('CRVAL1'), 0.0), d_header.get(str('CRVAL2'), 0.0)) + d_cdelt = (d_header.get(str('CDELT1'), 1.0), d_header.get(str('CDELT2'), 1.0)) + d_lookup = DistortionLookupTable(d_data, d_crpix, + d_crval, d_cdelt) + tables[i] = d_lookup + else: + warnings.warn('Polynomial distortion is not implemented.\n', AstropyUserWarning) + for key in set(header): + if key.startswith(dp + str('.')): + del header[key] + else: + tables[i] = None + if not tables: + return (None, None) + else: + return (tables.get(1), tables.get(2)) + + def _read_d2im_old_format(self, header, fobj, axiscorr): + warnings.warn("The use of ``AXISCORR`` for D2IM correction has been deprecated." + "`~astropy.wcs` will read in files with ``AXISCORR`` but ``to_fits()`` will write " + "out files without it.", + AstropyDeprecationWarning) + cpdis = [None, None] + crpix = [0., 0.] + crval = [0., 0.] + cdelt = [1., 1.] + try: + d2im_data = fobj[(str('D2IMARR'), 1)].data + except KeyError: + return (None, None) + except AttributeError: + return (None, None) + + d2im_data = np.array([d2im_data]) + d2im_hdr = fobj[(str('D2IMARR'), 1)].header + naxis = d2im_hdr[str('NAXIS')] + + for i in range(1, naxis + 1): + crpix[i - 1] = d2im_hdr.get(str('CRPIX') + str(i), 0.0) + crval[i - 1] = d2im_hdr.get(str('CRVAL') + str(i), 0.0) + cdelt[i - 1] = d2im_hdr.get(str('CDELT') + str(i), 1.0) + + cpdis = DistortionLookupTable(d2im_data, crpix, crval, cdelt) + + if axiscorr == 1: + return (cpdis, None) + elif axiscorr == 2: + return (None, cpdis) + else: + warnings.warn("Expected AXISCORR to be 1 or 2", AstropyUserWarning) + return (None, None) + + def _write_det2im(self, hdulist): + """ + Writes a `distortion paper`_ type lookup table to the given + `astropy.io.fits.HDUList`. + """ + + if self.det2im1 is None and self.det2im2 is None: + return + dist = 'D2IMDIS' + d_kw = 'D2IM' + err_kw = 'D2IMERR' + + def write_d2i(num, det2im): + if det2im is None: + return + str('{0}{1:d}').format(dist, num), + hdulist[0].header[str('{0}{1:d}').format(dist, num)] = ( + 'LOOKUP', 'Detector to image correction type') + hdulist[0].header[str('{0}{1:d}.EXTVER').format(d_kw, num)] = ( + num, 'Version number of WCSDVARR extension') + hdulist[0].header[str('{0}{1:d}.NAXES').format(d_kw, num)] = ( + len(det2im.data.shape), 'Number of independent variables in d2im function') + for i in range(det2im.data.ndim): + hdulist[0].header[str('{0}{1:d}.AXIS.{2:d}').format(d_kw, num, i + 1)] = ( + i + 1, 'Axis number of the jth independent variable in a d2im function') + + image = fits.ImageHDU(det2im.data, name=str('D2IMARR')) + header = image.header + + header[str('CRPIX1')] = (det2im.crpix[0], + 'Coordinate system reference pixel') + header[str('CRPIX2')] = (det2im.crpix[1], + 'Coordinate system reference pixel') + header[str('CRVAL1')] = (det2im.crval[0], + 'Coordinate system value at reference pixel') + header[str('CRVAL2')] = (det2im.crval[1], + 'Coordinate system value at reference pixel') + header[str('CDELT1')] = (det2im.cdelt[0], + 'Coordinate increment along axis') + header[str('CDELT2')] = (det2im.cdelt[1], + 'Coordinate increment along axis') + image.ver = int(hdulist[0].header[str('{0}{1:d}.EXTVER').format(d_kw, num)]) + hdulist.append(image) + write_d2i(1, self.det2im1) + write_d2i(2, self.det2im2) + + def _read_distortion_kw(self, header, fobj, dist='CPDIS', err=0.0): + """ + Reads `distortion paper`_ table-lookup keywords and data, and + returns a 2-tuple of `~astropy.wcs.DistortionLookupTable` + objects. + + If no `distortion paper`_ keywords are found, ``(None, None)`` + is returned. + """ + if isinstance(header, (str, bytes)): + return (None, None) + + if dist == 'CPDIS': + d_kw = str('DP') + err_kw = str('CPERR') + else: + d_kw = str('DQ') + err_kw = str('CQERR') + + tables = {} + for i in range(1, self.naxis + 1): + d_error_key = err_kw + str(i) + if d_error_key in header: + d_error = header[d_error_key] + del header[d_error_key] + else: + d_error = 0.0 + if d_error < err: + tables[i] = None + continue + distortion = dist + str(i) + if distortion in header: + dis = header[distortion].lower() + del header[distortion] + if dis == 'lookup': + if not isinstance(fobj, fits.HDUList): + raise ValueError('an astropy.io.fits.HDUList is ' + 'required for Lookup table distortion.') + dp = (d_kw + str(i)).strip() + dp_extver_key = dp + str('.EXTVER') + if dp_extver_key in header: + d_extver = header[dp_extver_key] + del header[dp_extver_key] + else: + d_extver = 1 + dp_axis_key = dp + str('.AXIS.{0:d}'.format(i)) + if i == header[dp_axis_key]: + d_data = fobj[str('WCSDVARR'), d_extver].data + else: + d_data = (fobj[str('WCSDVARR'), d_extver].data).transpose() + del header[dp_axis_key] + d_header = fobj[str('WCSDVARR'), d_extver].header + d_crpix = (d_header.get(str('CRPIX1'), 0.0), + d_header.get(str('CRPIX2'), 0.0)) + d_crval = (d_header.get(str('CRVAL1'), 0.0), + d_header.get(str('CRVAL2'), 0.0)) + d_cdelt = (d_header.get(str('CDELT1'), 1.0), + d_header.get(str('CDELT2'), 1.0)) + d_lookup = DistortionLookupTable(d_data, d_crpix, d_crval, d_cdelt) + tables[i] = d_lookup + + for key in set(header): + if key.startswith(dp + str('.')): + del header[key] + else: + warnings.warn('Polynomial distortion is not implemented.\n', AstropyUserWarning) + else: + tables[i] = None + + if not tables: + return (None, None) + else: + return (tables.get(1), tables.get(2)) + + def _write_distortion_kw(self, hdulist, dist='CPDIS'): + """ + Write out `distortion paper`_ keywords to the given + `fits.HDUList`. + """ + if self.cpdis1 is None and self.cpdis2 is None: + return + + if dist == 'CPDIS': + d_kw = str('DP') + err_kw = str('CPERR') + else: + d_kw = str('DQ') + err_kw = str('CQERR') + + def write_dist(num, cpdis): + if cpdis is None: + return + + hdulist[0].header[str('{0}{1:d}').format(dist, num)] = ( + 'LOOKUP', 'Prior distortion function type') + hdulist[0].header[str('{0}{1:d}.EXTVER').format(d_kw, num)] = ( + num, 'Version number of WCSDVARR extension') + hdulist[0].header[str('{0}{1:d}.NAXES').format(d_kw, num)] = ( + len(cpdis.data.shape), 'Number of independent variables in distortion function') + + for i in range(cpdis.data.ndim): + hdulist[0].header[str('{0}{1:d}.AXIS.{2:d}').format(d_kw, num, i + 1)] = ( + i + 1, + 'Axis number of the jth independent variable in a distortion function') + + image = fits.ImageHDU(cpdis.data, name=str('WCSDVARR')) + header = image.header + + header[str('CRPIX1')] = (cpdis.crpix[0], 'Coordinate system reference pixel') + header[str('CRPIX2')] = (cpdis.crpix[1], 'Coordinate system reference pixel') + header[str('CRVAL1')] = (cpdis.crval[0], 'Coordinate system value at reference pixel') + header[str('CRVAL2')] = (cpdis.crval[1], 'Coordinate system value at reference pixel') + header[str('CDELT1')] = (cpdis.cdelt[0], 'Coordinate increment along axis') + header[str('CDELT2')] = (cpdis.cdelt[1], 'Coordinate increment along axis') + image.ver = int(hdulist[0].header[str('{0}{1:d}.EXTVER').format(d_kw, num)]) + hdulist.append(image) + + write_dist(1, self.cpdis1) + write_dist(2, self.cpdis2) + + def _remove_sip_kw(self, header): + """ + Remove SIP information from a header. + """ + # Never pass SIP coefficients to wcslib + # CTYPE must be passed with -SIP to wcslib + for key in (m.group() for m in map(SIP_KW.match, list(header)) + if m is not None): + del header[key] + + def _read_sip_kw(self, header, wcskey=""): + """ + Reads `SIP`_ header keywords and returns a `~astropy.wcs.Sip` + object. + + If no `SIP`_ header keywords are found, ``None`` is returned. + """ + if isinstance(header, (str, bytes)): + # TODO: Parse SIP from a string without pyfits around + return None + + if str("A_ORDER") in header and header[str('A_ORDER')] > 1: + if str("B_ORDER") not in header: + raise ValueError( + "A_ORDER provided without corresponding B_ORDER " + "keyword for SIP distortion") + + m = int(header[str("A_ORDER")]) + a = np.zeros((m + 1, m + 1), np.double) + for i in range(m + 1): + for j in range(m - i + 1): + key = str("A_{0}_{1}").format(i, j) + if key in header: + a[i, j] = header[key] + del header[key] + + m = int(header[str("B_ORDER")]) + if m > 1: + b = np.zeros((m + 1, m + 1), np.double) + for i in range(m + 1): + for j in range(m - i + 1): + key = str("B_{0}_{1}").format(i, j) + if key in header: + b[i, j] = header[key] + del header[key] + else: + a = None + b = None + + del header[str('A_ORDER')] + del header[str('B_ORDER')] + + ctype = [header['CTYPE{0}{1}'.format(nax, wcskey)] for nax in range(1, self.naxis + 1)] + if any(not ctyp.endswith('-SIP') for ctyp in ctype): + message = """ + Inconsistent SIP distortion information is present in the FITS header and the WCS object: + SIP coefficients were detected, but CTYPE is missing a "-SIP" suffix. + astropy.wcs is using the SIP distortion coefficients, + therefore the coordinates calculated here might be incorrect. + + If you do not want to apply the SIP distortion coefficients, + please remove the SIP coefficients from the FITS header or the + WCS object. As an example, if the image is already distortion-corrected + (e.g., drizzled) then distortion components should not apply and the SIP + coefficients should be removed. + + While the SIP distortion coefficients are being applied here, if that was indeed the intent, + for consistency please append "-SIP" to the CTYPE in the FITS header or the WCS object. + + """ + log.info(message) + elif str("B_ORDER") in header and header[str('B_ORDER')] > 1: + raise ValueError( + "B_ORDER provided without corresponding A_ORDER " + + "keyword for SIP distortion") + else: + a = None + b = None + + if str("AP_ORDER") in header and header[str('AP_ORDER')] > 1: + if str("BP_ORDER") not in header: + raise ValueError( + "AP_ORDER provided without corresponding BP_ORDER " + "keyword for SIP distortion") + + m = int(header[str("AP_ORDER")]) + ap = np.zeros((m + 1, m + 1), np.double) + for i in range(m + 1): + for j in range(m - i + 1): + key = str("AP_{0}_{1}").format(i, j) + if key in header: + ap[i, j] = header[key] + del header[key] + + m = int(header[str("BP_ORDER")]) + if m > 1: + bp = np.zeros((m + 1, m + 1), np.double) + for i in range(m + 1): + for j in range(m - i + 1): + key = str("BP_{0}_{1}").format(i, j) + if key in header: + bp[i, j] = header[key] + del header[key] + else: + ap = None + bp = None + + del header[str('AP_ORDER')] + del header[str('BP_ORDER')] + elif str("BP_ORDER") in header and header[str('BP_ORDER')] > 1: + raise ValueError( + "BP_ORDER provided without corresponding AP_ORDER " + "keyword for SIP distortion") + else: + ap = None + bp = None + + if a is None and b is None and ap is None and bp is None: + return None + + if str("CRPIX1{0}".format(wcskey)) not in header or str("CRPIX2{0}".format(wcskey)) not in header: + raise ValueError( + "Header has SIP keywords without CRPIX keywords") + + crpix1 = header.get("CRPIX1{0}".format(wcskey)) + crpix2 = header.get("CRPIX2{0}".format(wcskey)) + + return Sip(a, b, ap, bp, (crpix1, crpix2)) + + def _write_sip_kw(self): + """ + Write out SIP keywords. Returns a dictionary of key-value + pairs. + """ + if self.sip is None: + return {} + + keywords = {} + + def write_array(name, a): + if a is None: + return + size = a.shape[0] + keywords[str('{0}_ORDER').format(name)] = size - 1 + for i in range(size): + for j in range(size - i): + if a[i, j] != 0.0: + keywords[ + str('{0}_{1:d}_{2:d}').format(name, i, j)] = a[i, j] + + write_array(str('A'), self.sip.a) + write_array(str('B'), self.sip.b) + write_array(str('AP'), self.sip.ap) + write_array(str('BP'), self.sip.bp) + + return keywords + + def _denormalize_sky(self, sky): + if self.wcs.lngtyp != 'RA': + raise ValueError( + "WCS does not have longitude type of 'RA', therefore " + + "(ra, dec) data can not be used as input") + if self.wcs.lattyp != 'DEC': + raise ValueError( + "WCS does not have longitude type of 'DEC', therefore " + + "(ra, dec) data can not be used as input") + if self.wcs.naxis == 2: + if self.wcs.lng == 0 and self.wcs.lat == 1: + return sky + elif self.wcs.lng == 1 and self.wcs.lat == 0: + # Reverse the order of the columns + return sky[:, ::-1] + else: + raise ValueError( + "WCS does not have longitude and latitude celestial " + + "axes, therefore (ra, dec) data can not be used as input") + else: + if self.wcs.lng < 0 or self.wcs.lat < 0: + raise ValueError( + "WCS does not have both longitude and latitude " + "celestial axes, therefore (ra, dec) data can not be " + + "used as input") + out = np.zeros((sky.shape[0], self.wcs.naxis)) + out[:, self.wcs.lng] = sky[:, 0] + out[:, self.wcs.lat] = sky[:, 1] + return out + + def _normalize_sky(self, sky): + if self.wcs.lngtyp != 'RA': + raise ValueError( + "WCS does not have longitude type of 'RA', therefore " + + "(ra, dec) data can not be returned") + if self.wcs.lattyp != 'DEC': + raise ValueError( + "WCS does not have longitude type of 'DEC', therefore " + + "(ra, dec) data can not be returned") + if self.wcs.naxis == 2: + if self.wcs.lng == 0 and self.wcs.lat == 1: + return sky + elif self.wcs.lng == 1 and self.wcs.lat == 0: + # Reverse the order of the columns + return sky[:, ::-1] + else: + raise ValueError( + "WCS does not have longitude and latitude celestial " + "axes, therefore (ra, dec) data can not be returned") + else: + if self.wcs.lng < 0 or self.wcs.lat < 0: + raise ValueError( + "WCS does not have both longitude and latitude celestial " + "axes, therefore (ra, dec) data can not be returned") + out = np.empty((sky.shape[0], 2)) + out[:, 0] = sky[:, self.wcs.lng] + out[:, 1] = sky[:, self.wcs.lat] + return out + + def _array_converter(self, func, sky, *args, ra_dec_order=False): + """ + A helper function to support reading either a pair of arrays + or a single Nx2 array. + """ + + def _return_list_of_arrays(axes, origin): + if any([x.size == 0 for x in axes]): + return axes + + try: + axes = np.broadcast_arrays(*axes) + except ValueError: + raise ValueError( + "Coordinate arrays are not broadcastable to each other") + + xy = np.hstack([x.reshape((x.size, 1)) for x in axes]) + + if ra_dec_order and sky == 'input': + xy = self._denormalize_sky(xy) + output = func(xy, origin) + if ra_dec_order and sky == 'output': + output = self._normalize_sky(output) + return (output[:, 0].reshape(axes[0].shape), + output[:, 1].reshape(axes[0].shape)) + return [output[:, i].reshape(axes[0].shape) + for i in range(output.shape[1])] + + def _return_single_array(xy, origin): + if xy.shape[-1] != self.naxis: + raise ValueError( + "When providing two arguments, the array must be " + "of shape (N, {0})".format(self.naxis)) + if 0 in xy.shape: + return xy + if ra_dec_order and sky == 'input': + xy = self._denormalize_sky(xy) + result = func(xy, origin) + if ra_dec_order and sky == 'output': + result = self._normalize_sky(result) + return result + + if len(args) == 2: + try: + xy, origin = args + xy = np.asarray(xy) + origin = int(origin) + except Exception: + raise TypeError( + "When providing two arguments, they must be " + "(coords[N][{0}], origin)".format(self.naxis)) + if xy.shape == () or len(xy.shape) == 1: + return _return_list_of_arrays([xy], origin) + return _return_single_array(xy, origin) + + elif len(args) == self.naxis + 1: + axes = args[:-1] + origin = args[-1] + try: + axes = [np.asarray(x) for x in axes] + origin = int(origin) + except Exception: + raise TypeError( + "When providing more than two arguments, they must be " + + "a 1-D array for each axis, followed by an origin.") + + return _return_list_of_arrays(axes, origin) + + raise TypeError( + "WCS projection has {0} dimensions, so expected 2 (an Nx{0} array " + "and the origin argument) or {1} arguments (the position in each " + "dimension, and the origin argument). Instead, {2} arguments were " + "given.".format( + self.naxis, self.naxis + 1, len(args))) + + def all_pix2world(self, *args, **kwargs): + return self._array_converter( + self._all_pix2world, 'output', *args, **kwargs) + all_pix2world.__doc__ = """ + Transforms pixel coordinates to world coordinates. + + Performs all of the following in series: + + - Detector to image plane correction (if present in the + FITS file) + + - `SIP`_ distortion correction (if present in the FITS + file) + + - `distortion paper`_ table-lookup correction (if present + in the FITS file) + + - `wcslib`_ "core" WCS transformation + + Parameters + ---------- + {0} + + For a transformation that is not two-dimensional, the + two-argument form must be used. + + {1} + + Returns + ------- + + {2} + + Notes + ----- + The order of the axes for the result is determined by the + ``CTYPEia`` keywords in the FITS header, therefore it may not + always be of the form (*ra*, *dec*). The + `~astropy.wcs.Wcsprm.lat`, `~astropy.wcs.Wcsprm.lng`, + `~astropy.wcs.Wcsprm.lattyp` and `~astropy.wcs.Wcsprm.lngtyp` + members can be used to determine the order of the axes. + + Raises + ------ + MemoryError + Memory allocation failed. + + SingularMatrixError + Linear transformation matrix is singular. + + InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + + ValueError + Invalid parameter value. + + ValueError + Invalid coordinate transformation parameters. + + ValueError + x- and y-coordinate arrays are not the same size. + + InvalidTransformError + Invalid coordinate transformation parameters. + + InvalidTransformError + Ill-conditioned coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('naxis', 8), + docstrings.RA_DEC_ORDER(8), + docstrings.RETURNS('sky coordinates, in degrees', 8)) + + def wcs_pix2world(self, *args, **kwargs): + if self.wcs is None: + raise ValueError("No basic WCS settings were created.") + return self._array_converter( + lambda xy, o: self.wcs.p2s(xy, o)['world'], + 'output', *args, **kwargs) + wcs_pix2world.__doc__ = """ + Transforms pixel coordinates to world coordinates by doing + only the basic `wcslib`_ transformation. + + No `SIP`_ or `distortion paper`_ table lookup correction is + applied. To perform distortion correction, see + `~astropy.wcs.WCS.all_pix2world`, + `~astropy.wcs.WCS.sip_pix2foc`, `~astropy.wcs.WCS.p4_pix2foc`, + or `~astropy.wcs.WCS.pix2foc`. + + Parameters + ---------- + {0} + + For a transformation that is not two-dimensional, the + two-argument form must be used. + + {1} + + Returns + ------- + + {2} + + Raises + ------ + MemoryError + Memory allocation failed. + + SingularMatrixError + Linear transformation matrix is singular. + + InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + + ValueError + Invalid parameter value. + + ValueError + Invalid coordinate transformation parameters. + + ValueError + x- and y-coordinate arrays are not the same size. + + InvalidTransformError + Invalid coordinate transformation parameters. + + InvalidTransformError + Ill-conditioned coordinate transformation parameters. + + Notes + ----- + The order of the axes for the result is determined by the + ``CTYPEia`` keywords in the FITS header, therefore it may not + always be of the form (*ra*, *dec*). The + `~astropy.wcs.Wcsprm.lat`, `~astropy.wcs.Wcsprm.lng`, + `~astropy.wcs.Wcsprm.lattyp` and `~astropy.wcs.Wcsprm.lngtyp` + members can be used to determine the order of the axes. + + """.format(docstrings.TWO_OR_MORE_ARGS('naxis', 8), + docstrings.RA_DEC_ORDER(8), + docstrings.RETURNS('world coordinates, in degrees', 8)) + + def _all_world2pix(self, world, origin, tolerance, maxiter, adaptive, + detect_divergence, quiet): + # ############################################################ + # # DESCRIPTION OF THE NUMERICAL METHOD ## + # ############################################################ + # In this section I will outline the method of solving + # the inverse problem of converting world coordinates to + # pixel coordinates (*inverse* of the direct transformation + # `all_pix2world`) and I will summarize some of the aspects + # of the method proposed here and some of the issues of the + # original `all_world2pix` (in relation to this method) + # discussed in https://github.com/astropy/astropy/issues/1977 + # A more detailed discussion can be found here: + # https://github.com/astropy/astropy/pull/2373 + # + # + # ### Background ### + # + # + # I will refer here to the [SIP Paper] + # (http://fits.gsfc.nasa.gov/registry/sip/SIP_distortion_v1_0.pdf). + # According to this paper, the effect of distortions as + # described in *their* equation (1) is: + # + # (1) x = CD*(u+f(u)), + # + # where `x` is a *vector* of "intermediate spherical + # coordinates" (equivalent to (x,y) in the paper) and `u` + # is a *vector* of "pixel coordinates", and `f` is a vector + # function describing geometrical distortions + # (see equations 2 and 3 in SIP Paper. + # However, I prefer to use `w` for "intermediate world + # coordinates", `x` for pixel coordinates, and assume that + # transformation `W` performs the **linear** + # (CD matrix + projection onto celestial sphere) part of the + # conversion from pixel coordinates to world coordinates. + # Then we can re-write (1) as: + # + # (2) w = W*(x+f(x)) = T(x) + # + # In `astropy.wcs.WCS` transformation `W` is represented by + # the `wcs_pix2world` member, while the combined ("total") + # transformation (linear part + distortions) is performed by + # `all_pix2world`. Below I summarize the notations and their + # equivalents in `astropy.wcs.WCS`: + # + # | Equation term | astropy.WCS/meaning | + # | ------------- | ---------------------------- | + # | `x` | pixel coordinates | + # | `w` | world coordinates | + # | `W` | `wcs_pix2world()` | + # | `W^{-1}` | `wcs_world2pix()` | + # | `T` | `all_pix2world()` | + # | `x+f(x)` | `pix2foc()` | + # + # + # ### Direct Solving of Equation (2) ### + # + # + # In order to find the pixel coordinates that correspond to + # given world coordinates `w`, it is necessary to invert + # equation (2): `x=T^{-1}(w)`, or solve equation `w==T(x)` + # for `x`. However, this approach has the following + # disadvantages: + # 1. It requires unnecessary transformations (see next + # section). + # 2. It is prone to "RA wrapping" issues as described in + # https://github.com/astropy/astropy/issues/1977 + # (essentially because `all_pix2world` may return points with + # a different phase than user's input `w`). + # + # + # ### Description of the Method Used here ### + # + # + # By applying inverse linear WCS transformation (`W^{-1}`) + # to both sides of equation (2) and introducing notation `x'` + # (prime) for the pixels coordinates obtained from the world + # coordinates by applying inverse *linear* WCS transformation + # ("focal plane coordinates"): + # + # (3) x' = W^{-1}(w) + # + # we obtain the following equation: + # + # (4) x' = x+f(x), + # + # or, + # + # (5) x = x'-f(x) + # + # This equation is well suited for solving using the method + # of fixed-point iterations + # (http://en.wikipedia.org/wiki/Fixed-point_iteration): + # + # (6) x_{i+1} = x'-f(x_i) + # + # As an initial value of the pixel coordinate `x_0` we take + # "focal plane coordinate" `x'=W^{-1}(w)=wcs_world2pix(w)`. + # We stop iterations when `|x_{i+1}-x_i||x_i-x_{i-1}|` + # **when** `|x_{i+1}-x_i|>=tolerance` (when current + # approximation is close to the true solution, + # `|x_{i+1}-x_i|>|x_i-x_{i-1}|` may be due to rounding errors + # and we ignore such "divergences" when + # `|x_{i+1}-x_i|world transformations). + # + # As an added benefit, the process converges to the correct + # solution in just one iteration when distortions are not + # present (compare to + # https://github.com/astropy/astropy/issues/1977 and + # https://github.com/astropy/astropy/pull/2294): in this case + # `pix2foc` is the identical transformation + # `x_i=pix2foc(x_i)` and from equation (7) we get: + # + # x' = x_0 = wcs_world2pix(w) + # x_1 = x' - pix2foc(x_0) + x_0 = x' - pix2foc(x') + x' = x' + # = wcs_world2pix(w) = x_0 + # => + # |x_1-x_0| = 0 < tolerance (with tolerance > 0) + # + # However, for performance reasons, it is still better to + # avoid iterations altogether and return the exact linear + # solution (`wcs_world2pix`) right-away when non-linear + # distortions are not present by checking that attributes + # `sip`, `cpdis1`, `cpdis2`, `det2im1`, and `det2im2` are + # *all* `None`. + # + # + # ### Outline of the Algorithm ### + # + # + # While the proposed code is relatively long (considering + # the simplicity of the algorithm), this is due to: 1) + # checking if iterative solution is necessary at all; 2) + # checking for divergence; 3) re-implementation of the + # completely vectorized algorithm as an "adaptive" vectorized + # algorithm (for cases when some points diverge for which we + # want to stop iterations). In my tests, the adaptive version + # of the algorithm is about 50% slower than non-adaptive + # version for all HST images. + # + # The essential part of the vectorized non-adaptive algorithm + # (without divergence and other checks) can be described + # as follows: + # + # pix0 = self.wcs_world2pix(world, origin) + # pix = pix0.copy() # 0-order solution + # + # for k in range(maxiter): + # # find correction to the previous solution: + # dpix = self.pix2foc(pix, origin) - pix0 + # + # # compute norm (L2) of the correction: + # dn = np.linalg.norm(dpix, axis=1) + # + # # apply correction: + # pix -= dpix + # + # # check convergence: + # if np.max(dn) < tolerance: + # break + # + # return pix + # + # Here, the input parameter `world` can be a `MxN` array + # where `M` is the number of coordinate axes in WCS and `N` + # is the number of points to be converted simultaneously to + # image coordinates. + # + # + # ### IMPORTANT NOTE: ### + # + # If, in the future releases of the `~astropy.wcs`, + # `pix2foc` will not apply all the required distortion + # corrections then in the code below, calls to `pix2foc` will + # have to be replaced with + # wcs_world2pix(all_pix2world(pix_list, origin), origin) + # + + # ############################################################ + # # INITIALIZE ITERATIVE PROCESS: ## + # ############################################################ + + # initial approximation (linear WCS based only) + pix0 = self.wcs_world2pix(world, origin) + + # Check that an iterative solution is required at all + # (when any of the non-CD-matrix-based corrections are + # present). If not required return the initial + # approximation (pix0). + if not self.has_distortion: + # No non-WCS corrections detected so + # simply return initial approximation: + return pix0 + + pix = pix0.copy() # 0-order solution + + # initial correction: + dpix = self.pix2foc(pix, origin) - pix0 + + # Update initial solution: + pix -= dpix + + # Norm (L2) squared of the correction: + dn = np.sum(dpix*dpix, axis=1) + dnprev = dn.copy() # if adaptive else dn + tol2 = tolerance**2 + + # Prepare for iterative process + k = 1 + ind = None + inddiv = None + + # Turn off numpy runtime warnings for 'invalid' and 'over': + old_invalid = np.geterr()['invalid'] + old_over = np.geterr()['over'] + np.seterr(invalid='ignore', over='ignore') + + # ############################################################ + # # NON-ADAPTIVE ITERATIONS: ## + # ############################################################ + if not adaptive: + # Fixed-point iterations: + while (np.nanmax(dn) >= tol2 and k < maxiter): + # Find correction to the previous solution: + dpix = self.pix2foc(pix, origin) - pix0 + + # Compute norm (L2) squared of the correction: + dn = np.sum(dpix*dpix, axis=1) + + # Check for divergence (we do this in two stages + # to optimize performance for the most common + # scenario when successive approximations converge): + if detect_divergence: + divergent = (dn >= dnprev) + if np.any(divergent): + # Find solutions that have not yet converged: + slowconv = (dn >= tol2) + inddiv, = np.where(divergent & slowconv) + + if inddiv.shape[0] > 0: + # Update indices of elements that + # still need correction: + conv = (dn < dnprev) + iconv = np.where(conv) + + # Apply correction: + dpixgood = dpix[iconv] + pix[iconv] -= dpixgood + dpix[iconv] = dpixgood + + # For the next iteration choose + # non-divergent points that have not yet + # converged to the requested accuracy: + ind, = np.where(slowconv & conv) + pix0 = pix0[ind] + dnprev[ind] = dn[ind] + k += 1 + + # Switch to adaptive iterations: + adaptive = True + break + # Save current correction magnitudes for later: + dnprev = dn + + # Apply correction: + pix -= dpix + k += 1 + + # ############################################################ + # # ADAPTIVE ITERATIONS: ## + # ############################################################ + if adaptive: + if ind is None: + ind, = np.where(np.isfinite(pix).all(axis=1)) + pix0 = pix0[ind] + + # "Adaptive" fixed-point iterations: + while (ind.shape[0] > 0 and k < maxiter): + # Find correction to the previous solution: + dpixnew = self.pix2foc(pix[ind], origin) - pix0 + + # Compute norm (L2) of the correction: + dnnew = np.sum(np.square(dpixnew), axis=1) + + # Bookeeping of corrections: + dnprev[ind] = dn[ind].copy() + dn[ind] = dnnew + + if detect_divergence: + # Find indices of pixels that are converging: + conv = (dnnew < dnprev[ind]) + iconv = np.where(conv) + iiconv = ind[iconv] + + # Apply correction: + dpixgood = dpixnew[iconv] + pix[iiconv] -= dpixgood + dpix[iiconv] = dpixgood + + # Find indices of solutions that have not yet + # converged to the requested accuracy + # AND that do not diverge: + subind, = np.where((dnnew >= tol2) & conv) + + else: + # Apply correction: + pix[ind] -= dpixnew + dpix[ind] = dpixnew + + # Find indices of solutions that have not yet + # converged to the requested accuracy: + subind, = np.where(dnnew >= tol2) + + # Choose solutions that need more iterations: + ind = ind[subind] + pix0 = pix0[subind] + + k += 1 + + # ############################################################ + # # FINAL DETECTION OF INVALID, DIVERGING, ## + # # AND FAILED-TO-CONVERGE POINTS ## + # ############################################################ + # Identify diverging and/or invalid points: + invalid = ((~np.all(np.isfinite(pix), axis=1)) & + (np.all(np.isfinite(world), axis=1))) + + # When detect_divergence==False, dnprev is outdated + # (it is the norm of the very first correction). + # Still better than nothing... + inddiv, = np.where(((dn >= tol2) & (dn >= dnprev)) | invalid) + if inddiv.shape[0] == 0: + inddiv = None + + # Identify points that did not converge within 'maxiter' + # iterations: + if k >= maxiter: + ind, = np.where((dn >= tol2) & (dn < dnprev) & (~invalid)) + if ind.shape[0] == 0: + ind = None + else: + ind = None + + # Restore previous numpy error settings: + np.seterr(invalid=old_invalid, over=old_over) + + # ############################################################ + # # RAISE EXCEPTION IF DIVERGING OR TOO SLOWLY CONVERGING ## + # # DATA POINTS HAVE BEEN DETECTED: ## + # ############################################################ + if (ind is not None or inddiv is not None) and not quiet: + if inddiv is None: + raise NoConvergence( + "'WCS.all_world2pix' failed to " + "converge to the requested accuracy after {:d} " + "iterations.".format(k), best_solution=pix, + accuracy=np.abs(dpix), niter=k, + slow_conv=ind, divergent=None) + else: + raise NoConvergence( + "'WCS.all_world2pix' failed to " + "converge to the requested accuracy.\n" + "After {0:d} iterations, the solution is diverging " + "at least for one input point." + .format(k), best_solution=pix, + accuracy=np.abs(dpix), niter=k, + slow_conv=ind, divergent=inddiv) + + return pix + + def all_world2pix(self, *args, tolerance=1e-4, maxiter=20, adaptive=False, + detect_divergence=True, quiet=False, **kwargs): + if self.wcs is None: + raise ValueError("No basic WCS settings were created.") + + return self._array_converter( + lambda *args, **kwargs: + self._all_world2pix( + *args, tolerance=tolerance, maxiter=maxiter, + adaptive=adaptive, detect_divergence=detect_divergence, + quiet=quiet), + 'input', *args, **kwargs + ) + + all_world2pix.__doc__ = """ + all_world2pix(*arg, accuracy=1.0e-4, maxiter=20, + adaptive=False, detect_divergence=True, quiet=False) + + Transforms world coordinates to pixel coordinates, using + numerical iteration to invert the full forward transformation + `~astropy.wcs.WCS.all_pix2world` with complete + distortion model. + + + Parameters + ---------- + {0} + + For a transformation that is not two-dimensional, the + two-argument form must be used. + + {1} + + tolerance : float, optional (Default = 1.0e-4) + Tolerance of solution. Iteration terminates when the + iterative solver estimates that the "true solution" is + within this many pixels current estimate, more + specifically, when the correction to the solution found + during the previous iteration is smaller + (in the sense of the L2 norm) than ``tolerance``. + + maxiter : int, optional (Default = 20) + Maximum number of iterations allowed to reach a solution. + + quiet : bool, optional (Default = False) + Do not throw :py:class:`NoConvergence` exceptions when + the method does not converge to a solution with the + required accuracy within a specified number of maximum + iterations set by ``maxiter`` parameter. Instead, + simply return the found solution. + + Other Parameters + ---------------- + adaptive : bool, optional (Default = False) + Specifies whether to adaptively select only points that + did not converge to a solution within the required + accuracy for the next iteration. Default is recommended + for HST as well as most other instruments. + + .. note:: + The :py:meth:`all_world2pix` uses a vectorized + implementation of the method of consecutive + approximations (see ``Notes`` section below) in which it + iterates over *all* input points *regardless* until + the required accuracy has been reached for *all* input + points. In some cases it may be possible that + *almost all* points have reached the required accuracy + but there are only a few of input data points for + which additional iterations may be needed (this + depends mostly on the characteristics of the geometric + distortions for a given instrument). In this situation + it may be advantageous to set ``adaptive`` = `True` in + which case :py:meth:`all_world2pix` will continue + iterating *only* over the points that have not yet + converged to the required accuracy. However, for the + HST's ACS/WFC detector, which has the strongest + distortions of all HST instruments, testing has + shown that enabling this option would lead to a about + 50-100% penalty in computational time (depending on + specifics of the image, geometric distortions, and + number of input points to be converted). Therefore, + for HST and possibly instruments, it is recommended + to set ``adaptive`` = `False`. The only danger in + getting this setting wrong will be a performance + penalty. + + .. note:: + When ``detect_divergence`` is `True`, + :py:meth:`all_world2pix` will automatically switch + to the adaptive algorithm once divergence has been + detected. + + detect_divergence : bool, optional (Default = True) + Specifies whether to perform a more detailed analysis + of the convergence to a solution. Normally + :py:meth:`all_world2pix` may not achieve the required + accuracy if either the ``tolerance`` or ``maxiter`` arguments + are too low. However, it may happen that for some + geometric distortions the conditions of convergence for + the the method of consecutive approximations used by + :py:meth:`all_world2pix` may not be satisfied, in which + case consecutive approximations to the solution will + diverge regardless of the ``tolerance`` or ``maxiter`` + settings. + + When ``detect_divergence`` is `False`, these divergent + points will be detected as not having achieved the + required accuracy (without further details). In addition, + if ``adaptive`` is `False` then the algorithm will not + know that the solution (for specific points) is diverging + and will continue iterating and trying to "improve" + diverging solutions. This may result in ``NaN`` or + ``Inf`` values in the return results (in addition to a + performance penalties). Even when ``detect_divergence`` + is `False`, :py:meth:`all_world2pix`, at the end of the + iterative process, will identify invalid results + (``NaN`` or ``Inf``) as "diverging" solutions and will + raise :py:class:`NoConvergence` unless the ``quiet`` + parameter is set to `True`. + + When ``detect_divergence`` is `True`, + :py:meth:`all_world2pix` will detect points for which + current correction to the coordinates is larger than + the correction applied during the previous iteration + **if** the requested accuracy **has not yet been + achieved**. In this case, if ``adaptive`` is `True`, + these points will be excluded from further iterations and + if ``adaptive`` is `False`, :py:meth:`all_world2pix` will + automatically switch to the adaptive algorithm. Thus, the + reported divergent solution will be the latest converging + solution computed immediately *before* divergence + has been detected. + + .. note:: + When accuracy has been achieved, small increases in + current corrections may be possible due to rounding + errors (when ``adaptive`` is `False`) and such + increases will be ignored. + + .. note:: + Based on our testing using HST ACS/WFC images, setting + ``detect_divergence`` to `True` will incur about 5-20% + performance penalty with the larger penalty + corresponding to ``adaptive`` set to `True`. + Because the benefits of enabling this + feature outweigh the small performance penalty, + especially when ``adaptive`` = `False`, it is + recommended to set ``detect_divergence`` to `True`, + unless extensive testing of the distortion models for + images from specific instruments show a good stability + of the numerical method for a wide range of + coordinates (even outside the image itself). + + .. note:: + Indices of the diverging inverse solutions will be + reported in the ``divergent`` attribute of the + raised :py:class:`NoConvergence` exception object. + + Returns + ------- + + {2} + + Notes + ----- + The order of the axes for the input world array is determined by + the ``CTYPEia`` keywords in the FITS header, therefore it may + not always be of the form (*ra*, *dec*). The + `~astropy.wcs.Wcsprm.lat`, `~astropy.wcs.Wcsprm.lng`, + `~astropy.wcs.Wcsprm.lattyp`, and + `~astropy.wcs.Wcsprm.lngtyp` + members can be used to determine the order of the axes. + + Using the method of fixed-point iterations approximations we + iterate starting with the initial approximation, which is + computed using the non-distortion-aware + :py:meth:`wcs_world2pix` (or equivalent). + + The :py:meth:`all_world2pix` function uses a vectorized + implementation of the method of consecutive approximations and + therefore it is highly efficient (>30x) when *all* data points + that need to be converted from sky coordinates to image + coordinates are passed at *once*. Therefore, it is advisable, + whenever possible, to pass as input a long array of all points + that need to be converted to :py:meth:`all_world2pix` instead + of calling :py:meth:`all_world2pix` for each data point. Also + see the note to the ``adaptive`` parameter. + + Raises + ------ + NoConvergence + The method did not converge to a + solution to the required accuracy within a specified + number of maximum iterations set by the ``maxiter`` + parameter. To turn off this exception, set ``quiet`` to + `True`. Indices of the points for which the requested + accuracy was not achieved (if any) will be listed in the + ``slow_conv`` attribute of the + raised :py:class:`NoConvergence` exception object. + + See :py:class:`NoConvergence` documentation for + more details. + + MemoryError + Memory allocation failed. + + SingularMatrixError + Linear transformation matrix is singular. + + InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + + ValueError + Invalid parameter value. + + ValueError + Invalid coordinate transformation parameters. + + ValueError + x- and y-coordinate arrays are not the same size. + + InvalidTransformError + Invalid coordinate transformation parameters. + + InvalidTransformError + Ill-conditioned coordinate transformation parameters. + + Examples + -------- + >>> import astropy.io.fits as fits + >>> import astropy.wcs as wcs + >>> import numpy as np + >>> import os + + >>> filename = os.path.join(wcs.__path__[0], 'tests/data/j94f05bgq_flt.fits') + >>> hdulist = fits.open(filename) + >>> w = wcs.WCS(hdulist[('sci',1)].header, hdulist) + >>> hdulist.close() + + >>> ra, dec = w.all_pix2world([1,2,3], [1,1,1], 1) + >>> print(ra) # doctest: +FLOAT_CMP + [ 5.52645627 5.52649663 5.52653698] + >>> print(dec) # doctest: +FLOAT_CMP + [-72.05171757 -72.05171276 -72.05170795] + >>> radec = w.all_pix2world([[1,1], [2,1], [3,1]], 1) + >>> print(radec) # doctest: +FLOAT_CMP + [[ 5.52645627 -72.05171757] + [ 5.52649663 -72.05171276] + [ 5.52653698 -72.05170795]] + >>> x, y = w.all_world2pix(ra, dec, 1) + >>> print(x) # doctest: +FLOAT_CMP + [ 1.00000238 2.00000237 3.00000236] + >>> print(y) # doctest: +FLOAT_CMP + [ 0.99999996 0.99999997 0.99999997] + >>> xy = w.all_world2pix(radec, 1) + >>> print(xy) # doctest: +FLOAT_CMP + [[ 1.00000238 0.99999996] + [ 2.00000237 0.99999997] + [ 3.00000236 0.99999997]] + >>> xy = w.all_world2pix(radec, 1, maxiter=3, + ... tolerance=1.0e-10, quiet=False) + Traceback (most recent call last): + ... + NoConvergence: 'WCS.all_world2pix' failed to converge to the + requested accuracy. After 3 iterations, the solution is + diverging at least for one input point. + + >>> # Now try to use some diverging data: + >>> divradec = w.all_pix2world([[1.0, 1.0], + ... [10000.0, 50000.0], + ... [3.0, 1.0]], 1) + >>> print(divradec) # doctest: +FLOAT_CMP + [[ 5.52645627 -72.05171757] + [ 7.15976932 -70.8140779 ] + [ 5.52653698 -72.05170795]] + + >>> # First, turn detect_divergence on: + >>> try: # doctest: +FLOAT_CMP + ... xy = w.all_world2pix(divradec, 1, maxiter=20, + ... tolerance=1.0e-4, adaptive=False, + ... detect_divergence=True, + ... quiet=False) + ... except wcs.wcs.NoConvergence as e: + ... print("Indices of diverging points: {{0}}" + ... .format(e.divergent)) + ... print("Indices of poorly converging points: {{0}}" + ... .format(e.slow_conv)) + ... print("Best solution:\\n{{0}}".format(e.best_solution)) + ... print("Achieved accuracy:\\n{{0}}".format(e.accuracy)) + Indices of diverging points: [1] + Indices of poorly converging points: None + Best solution: + [[ 1.00000238e+00 9.99999965e-01] + [ -1.99441636e+06 1.44309097e+06] + [ 3.00000236e+00 9.99999966e-01]] + Achieved accuracy: + [[ 6.13968380e-05 8.59638593e-07] + [ 8.59526812e+11 6.61713548e+11] + [ 6.09398446e-05 8.38759724e-07]] + >>> raise e + Traceback (most recent call last): + ... + NoConvergence: 'WCS.all_world2pix' failed to converge to the + requested accuracy. After 5 iterations, the solution is + diverging at least for one input point. + + >>> # This time turn detect_divergence off: + >>> try: # doctest: +FLOAT_CMP + ... xy = w.all_world2pix(divradec, 1, maxiter=20, + ... tolerance=1.0e-4, adaptive=False, + ... detect_divergence=False, + ... quiet=False) + ... except wcs.wcs.NoConvergence as e: + ... print("Indices of diverging points: {{0}}" + ... .format(e.divergent)) + ... print("Indices of poorly converging points: {{0}}" + ... .format(e.slow_conv)) + ... print("Best solution:\\n{{0}}".format(e.best_solution)) + ... print("Achieved accuracy:\\n{{0}}".format(e.accuracy)) + Indices of diverging points: [1] + Indices of poorly converging points: None + Best solution: + [[ 1.00000009 1. ] + [ nan nan] + [ 3.00000009 1. ]] + Achieved accuracy: + [[ 2.29417358e-06 3.21222995e-08] + [ nan nan] + [ 2.27407877e-06 3.13005639e-08]] + >>> raise e + Traceback (most recent call last): + ... + NoConvergence: 'WCS.all_world2pix' failed to converge to the + requested accuracy. After 6 iterations, the solution is + diverging at least for one input point. + + """.format(docstrings.TWO_OR_MORE_ARGS('naxis', 8), + docstrings.RA_DEC_ORDER(8), + docstrings.RETURNS('pixel coordinates', 8)) + + def wcs_world2pix(self, *args, **kwargs): + if self.wcs is None: + raise ValueError("No basic WCS settings were created.") + return self._array_converter( + lambda xy, o: self.wcs.s2p(xy, o)['pixcrd'], + 'input', *args, **kwargs) + wcs_world2pix.__doc__ = """ + Transforms world coordinates to pixel coordinates, using only + the basic `wcslib`_ WCS transformation. No `SIP`_ or + `distortion paper`_ table lookup transformation is applied. + + Parameters + ---------- + {0} + + For a transformation that is not two-dimensional, the + two-argument form must be used. + + {1} + + Returns + ------- + + {2} + + Notes + ----- + The order of the axes for the input world array is determined by + the ``CTYPEia`` keywords in the FITS header, therefore it may + not always be of the form (*ra*, *dec*). The + `~astropy.wcs.Wcsprm.lat`, `~astropy.wcs.Wcsprm.lng`, + `~astropy.wcs.Wcsprm.lattyp` and `~astropy.wcs.Wcsprm.lngtyp` + members can be used to determine the order of the axes. + + Raises + ------ + MemoryError + Memory allocation failed. + + SingularMatrixError + Linear transformation matrix is singular. + + InconsistentAxisTypesError + Inconsistent or unrecognized coordinate axis types. + + ValueError + Invalid parameter value. + + ValueError + Invalid coordinate transformation parameters. + + ValueError + x- and y-coordinate arrays are not the same size. + + InvalidTransformError + Invalid coordinate transformation parameters. + + InvalidTransformError + Ill-conditioned coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('naxis', 8), + docstrings.RA_DEC_ORDER(8), + docstrings.RETURNS('pixel coordinates', 8)) + + def pix2foc(self, *args): + return self._array_converter(self._pix2foc, None, *args) + pix2foc.__doc__ = """ + Convert pixel coordinates to focal plane coordinates using the + `SIP`_ polynomial distortion convention and `distortion + paper`_ table-lookup correction. + + The output is in absolute pixel coordinates, not relative to + ``CRPIX``. + + Parameters + ---------- + + {0} + + Returns + ------- + + {1} + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('2', 8), + docstrings.RETURNS('focal coordinates', 8)) + + def p4_pix2foc(self, *args): + return self._array_converter(self._p4_pix2foc, None, *args) + p4_pix2foc.__doc__ = """ + Convert pixel coordinates to focal plane coordinates using + `distortion paper`_ table-lookup correction. + + The output is in absolute pixel coordinates, not relative to + ``CRPIX``. + + Parameters + ---------- + + {0} + + Returns + ------- + + {1} + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('2', 8), + docstrings.RETURNS('focal coordinates', 8)) + + def det2im(self, *args): + return self._array_converter(self._det2im, None, *args) + det2im.__doc__ = """ + Convert detector coordinates to image plane coordinates using + `distortion paper`_ table-lookup correction. + + The output is in absolute pixel coordinates, not relative to + ``CRPIX``. + + Parameters + ---------- + + {0} + + Returns + ------- + + {1} + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('2', 8), + docstrings.RETURNS('pixel coordinates', 8)) + + def sip_pix2foc(self, *args): + if self.sip is None: + if len(args) == 2: + return args[0] + elif len(args) == 3: + return args[:2] + else: + raise TypeError("Wrong number of arguments") + return self._array_converter(self.sip.pix2foc, None, *args) + sip_pix2foc.__doc__ = """ + Convert pixel coordinates to focal plane coordinates using the + `SIP`_ polynomial distortion convention. + + The output is in pixel coordinates, relative to ``CRPIX``. + + FITS WCS `distortion paper`_ table lookup correction is not + applied, even if that information existed in the FITS file + that initialized this :class:`~astropy.wcs.WCS` object. To + correct for that, use `~astropy.wcs.WCS.pix2foc` or + `~astropy.wcs.WCS.p4_pix2foc`. + + Parameters + ---------- + + {0} + + Returns + ------- + + {1} + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('2', 8), + docstrings.RETURNS('focal coordinates', 8)) + + def sip_foc2pix(self, *args): + if self.sip is None: + if len(args) == 2: + return args[0] + elif len(args) == 3: + return args[:2] + else: + raise TypeError("Wrong number of arguments") + return self._array_converter(self.sip.foc2pix, None, *args) + sip_foc2pix.__doc__ = """ + Convert focal plane coordinates to pixel coordinates using the + `SIP`_ polynomial distortion convention. + + FITS WCS `distortion paper`_ table lookup distortion + correction is not applied, even if that information existed in + the FITS file that initialized this `~astropy.wcs.WCS` object. + + Parameters + ---------- + + {0} + + Returns + ------- + + {1} + + Raises + ------ + MemoryError + Memory allocation failed. + + ValueError + Invalid coordinate transformation parameters. + """.format(docstrings.TWO_OR_MORE_ARGS('2', 8), + docstrings.RETURNS('pixel coordinates', 8)) + + def to_fits(self, relax=False, key=None): + """ + Generate an `astropy.io.fits.HDUList` object with all of the + information stored in this object. This should be logically identical + to the input FITS file, but it will be normalized in a number of ways. + + See `to_header` for some warnings about the output produced. + + Parameters + ---------- + + relax : bool or int, optional + Degree of permissiveness: + + - `False` (default): Write all extensions that are + considered to be safe and recommended. + + - `True`: Write all recognized informal extensions of the + WCS standard. + + - `int`: a bit field selecting specific extensions to + write. See :ref:`relaxwrite` for details. + + key : str + The name of a particular WCS transform to use. This may be + either ``' '`` or ``'A'``-``'Z'`` and corresponds to the ``"a"`` + part of the ``CTYPEia`` cards. + + Returns + ------- + hdulist : `astropy.io.fits.HDUList` + """ + + header = self.to_header(relax=relax, key=key) + + hdu = fits.PrimaryHDU(header=header) + hdulist = fits.HDUList(hdu) + + self._write_det2im(hdulist) + self._write_distortion_kw(hdulist) + + return hdulist + + def to_header(self, relax=None, key=None): + """Generate an `astropy.io.fits.Header` object with the basic WCS + and SIP information stored in this object. This should be + logically identical to the input FITS file, but it will be + normalized in a number of ways. + + .. warning:: + + This function does not write out FITS WCS `distortion + paper`_ information, since that requires multiple FITS + header data units. To get a full representation of + everything in this object, use `to_fits`. + + Parameters + ---------- + relax : bool or int, optional + Degree of permissiveness: + + - `False` (default): Write all extensions that are + considered to be safe and recommended. + + - `True`: Write all recognized informal extensions of the + WCS standard. + + - `int`: a bit field selecting specific extensions to + write. See :ref:`relaxwrite` for details. + + If the ``relax`` keyword argument is not given and any + keywords were omitted from the output, an + `~astropy.utils.exceptions.AstropyWarning` is displayed. + To override this, explicitly pass a value to ``relax``. + + key : str + The name of a particular WCS transform to use. This may be + either ``' '`` or ``'A'``-``'Z'`` and corresponds to the ``"a"`` + part of the ``CTYPEia`` cards. + + Returns + ------- + header : `astropy.io.fits.Header` + + Notes + ----- + The output header will almost certainly differ from the input in a + number of respects: + + 1. The output header only contains WCS-related keywords. In + particular, it does not contain syntactically-required + keywords such as ``SIMPLE``, ``NAXIS``, ``BITPIX``, or + ``END``. + + 2. Deprecated (e.g. ``CROTAn``) or non-standard usage will + be translated to standard (this is partially dependent on + whether ``fix`` was applied). + + 3. Quantities will be converted to the units used internally, + basically SI with the addition of degrees. + + 4. Floating-point quantities may be given to a different decimal + precision. + + 5. Elements of the ``PCi_j`` matrix will be written if and + only if they differ from the unit matrix. Thus, if the + matrix is unity then no elements will be written. + + 6. Additional keywords such as ``WCSAXES``, ``CUNITia``, + ``LONPOLEa`` and ``LATPOLEa`` may appear. + + 7. The original keycomments will be lost, although + `to_header` tries hard to write meaningful comments. + + 8. Keyword order may be changed. + + """ + # default precision for numerical WCS keywords + precision = WCSHDO_P14 + display_warning = False + if relax is None: + display_warning = True + relax = False + + if relax not in (True, False): + do_sip = relax & WCSHDO_SIP + relax &= ~WCSHDO_SIP + else: + do_sip = relax + relax = WCSHDO_all if relax is True else WCSHDO_safe + + relax = precision | relax + + if self.wcs is not None: + if key is not None: + orig_key = self.wcs.alt + self.wcs.alt = key + header_string = self.wcs.to_header(relax) + header = fits.Header.fromstring(header_string) + keys_to_remove = ["", " ", "COMMENT"] + for kw in keys_to_remove: + if kw in header: + del header[kw] + else: + header = fits.Header() + + if do_sip and self.sip is not None: + if self.wcs is not None and any(not ctyp.endswith('-SIP') for ctyp in self.wcs.ctype): + self._fix_ctype(header, add_sip=True) + + for kw, val in self._write_sip_kw().items(): + header[kw] = val + + if not do_sip and self.wcs is not None and any(self.wcs.ctype) and self.sip is not None: + # This is called when relax is not False or WCSHDO_SIP + # The default case of ``relax=None`` is handled further in the code. + header = self._fix_ctype(header, add_sip=False) + + if display_warning: + full_header = self.to_header(relax=True, key=key) + missing_keys = [] + for kw, val in full_header.items(): + if kw not in header: + missing_keys.append(kw) + + if len(missing_keys): + warnings.warn( + "Some non-standard WCS keywords were excluded: {0} " + "Use the ``relax`` kwarg to control this.".format( + ', '.join(missing_keys)), + AstropyWarning) + # called when ``relax=None`` + # This is different from the case of ``relax=False``. + if any(self.wcs.ctype) and self.sip is not None: + header = self._fix_ctype(header, add_sip=False, log_message=False) + # Finally reset the key. This must be called after ``_fix_ctype``. + if key is not None: + self.wcs.alt = orig_key + return header + + def _fix_ctype(self, header, add_sip=True, log_message=True): + """ + Parameters + ---------- + header : `~astropy.io.fits.Header` + FITS header. + add_sip : bool + Flag indicating whether "-SIP" should be added or removed from CTYPE keywords. + + Remove "-SIP" from CTYPE when writing out a header with relax=False. + This needs to be done outside ``to_header`` because ``to_header`` runs + twice when ``relax=False`` and the second time ``relax`` is set to ``True`` + to display the missing keywords. + + If the user requested SIP distortion to be written out add "-SIP" to + CTYPE if it is missing. + """ + + _add_sip_to_ctype = """ + Inconsistent SIP distortion information is present in the current WCS: + SIP coefficients were detected, but CTYPE is missing "-SIP" suffix, + therefore the current WCS is internally inconsistent. + + Because relax has been set to True, the resulting output WCS will have + "-SIP" appended to CTYPE in order to make the header internally consistent. + + However, this may produce incorrect astrometry in the output WCS, if + in fact the current WCS is already distortion-corrected. + + Therefore, if current WCS is already distortion-corrected (eg, drizzled) + then SIP distortion components should not apply. In that case, for a WCS + that is already distortion-corrected, please remove the SIP coefficients + from the header. + + """ + if log_message: + if add_sip: + log.info(_add_sip_to_ctype) + for i in range(1, self.naxis+1): + # strip() must be called here to cover the case of alt key= " " + kw = 'CTYPE{0}{1}'.format(i, self.wcs.alt).strip() + if kw in header: + if add_sip: + val = header[kw].strip("-SIP") + "-SIP" + else: + val = header[kw].strip("-SIP") + header[kw] = val + else: + continue + return header + + def to_header_string(self, relax=None): + """ + Identical to `to_header`, but returns a string containing the + header cards. + """ + return str(self.to_header(relax)) + + def footprint_to_file(self, filename='footprint.reg', color='green', + width=2, coordsys=None): + """ + Writes out a `ds9`_ style regions file. It can be loaded + directly by `ds9`_. + + Parameters + ---------- + filename : str, optional + Output file name - default is ``'footprint.reg'`` + + color : str, optional + Color to use when plotting the line. + + width : int, optional + Width of the region line. + + coordsys : str, optional + Coordinate system. If not specified (default), the ``radesys`` + value is used. For all possible values, see + http://ds9.si.edu/doc/ref/region.html#RegionFileFormat + + """ + comments = ('# Region file format: DS9 version 4.0 \n' + '# global color=green font="helvetica 12 bold ' + 'select=1 highlite=1 edit=1 move=1 delete=1 ' + 'include=1 fixed=0 source\n') + + coordsys = coordsys or self.wcs.radesys + + if coordsys not in ('PHYSICAL', 'IMAGE', 'FK4', 'B1950', 'FK5', + 'J2000', 'GALACTIC', 'ECLIPTIC', 'ICRS', 'LINEAR', + 'AMPLIFIER', 'DETECTOR'): + raise ValueError("Coordinate system '{}' is not supported. A valid" + " one can be given with the 'coordsys' argument." + .format(coordsys)) + + with open(filename, mode='w') as f: + f.write(comments) + f.write('{}\n'.format(coordsys)) + f.write('polygon(') + ftpr = self.calc_footprint() + if ftpr is not None: + ftpr.tofile(f, sep=',') + f.write(') # color={0}, width={1:d} \n'.format(color, width)) + + @property + def _naxis1(self): + warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning) + return self._naxis[0] + + @_naxis1.setter + def _naxis1(self, value): + warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning) + self._naxis[0] = value + + @property + def _naxis2(self): + warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning) + return self._naxis[1] + + @_naxis2.setter + def _naxis2(self, value): + warnings.warn(NAXIS_DEPRECATE_MESSAGE, AstropyDeprecationWarning) + self._naxis[1] = value + + def _get_naxis(self, header=None): + _naxis = [] + if (header is not None and + not isinstance(header, (str, bytes))): + for naxis in itertools.count(1): + try: + _naxis.append(header['NAXIS{}'.format(naxis)]) + except KeyError: + break + if len(_naxis) == 0: + _naxis = [0, 0] + elif len(_naxis) == 1: + _naxis.append(0) + self._naxis = _naxis + + def printwcs(self): + print(repr(self)) + + def __repr__(self): + ''' + Return a short description. Simply porting the behavior from + the `printwcs()` method. + ''' + description = ["WCS Keywords\n", + "Number of WCS axes: {0!r}".format(self.naxis)] + sfmt = ' : ' + "".join(["{"+"{0}".format(i)+"!r} " for i in range(self.naxis)]) + + keywords = ['CTYPE', 'CRVAL', 'CRPIX'] + values = [self.wcs.ctype, self.wcs.crval, self.wcs.crpix] + for keyword, value in zip(keywords, values): + description.append(keyword+sfmt.format(*value)) + + if hasattr(self.wcs, 'pc'): + for i in range(self.naxis): + s = '' + for j in range(self.naxis): + s += ''.join(['PC', str(i+1), '_', str(j+1), ' ']) + s += sfmt + description.append(s.format(*self.wcs.pc[i])) + s = 'CDELT' + sfmt + description.append(s.format(*self.wcs.cdelt)) + elif hasattr(self.wcs, 'cd'): + for i in range(self.naxis): + s = '' + for j in range(self.naxis): + s += "".join(['CD', str(i+1), '_', str(j+1), ' ']) + s += sfmt + description.append(s.format(*self.wcs.cd[i])) + + description.append('NAXIS : {}'.format(' '.join(map(str, self._naxis)))) + return '\n'.join(description) + + def get_axis_types(self): + """ + Similar to `self.wcsprm.axis_types ` + but provides the information in a more Python-friendly format. + + Returns + ------- + result : list of dicts + + Returns a list of dictionaries, one for each axis, each + containing attributes about the type of that axis. + + Each dictionary has the following keys: + + - 'coordinate_type': + + - None: Non-specific coordinate type. + + - 'stokes': Stokes coordinate. + + - 'celestial': Celestial coordinate (including ``CUBEFACE``). + + - 'spectral': Spectral coordinate. + + - 'scale': + + - 'linear': Linear axis. + + - 'quantized': Quantized axis (``STOKES``, ``CUBEFACE``). + + - 'non-linear celestial': Non-linear celestial axis. + + - 'non-linear spectral': Non-linear spectral axis. + + - 'logarithmic': Logarithmic axis. + + - 'tabular': Tabular axis. + + - 'group' + + - Group number, e.g. lookup table number + + - 'number' + + - For celestial axes: + + - 0: Longitude coordinate. + + - 1: Latitude coordinate. + + - 2: ``CUBEFACE`` number. + + - For lookup tables: + + - the axis number in a multidimensional table. + + ``CTYPEia`` in ``"4-3"`` form with unrecognized algorithm code will + generate an error. + """ + if self.wcs is None: + raise AttributeError( + "This WCS object does not have a wcsprm object.") + + coordinate_type_map = { + 0: None, + 1: 'stokes', + 2: 'celestial', + 3: 'spectral'} + + scale_map = { + 0: 'linear', + 1: 'quantized', + 2: 'non-linear celestial', + 3: 'non-linear spectral', + 4: 'logarithmic', + 5: 'tabular'} + + result = [] + for axis_type in self.wcs.axis_types: + subresult = {} + + coordinate_type = (axis_type // 1000) % 10 + subresult['coordinate_type'] = coordinate_type_map[coordinate_type] + + scale = (axis_type // 100) % 10 + subresult['scale'] = scale_map[scale] + + group = (axis_type // 10) % 10 + subresult['group'] = group + + number = axis_type % 10 + subresult['number'] = number + + result.append(subresult) + + return result + + def __reduce__(self): + """ + Support pickling of WCS objects. This is done by serializing + to an in-memory FITS file and dumping that as a string. + """ + + hdulist = self.to_fits(relax=True) + + buffer = io.BytesIO() + hdulist.writeto(buffer) + + return (__WCS_unpickle__, + (self.__class__, self.__dict__, buffer.getvalue(),)) + + def dropaxis(self, dropax): + """ + Remove an axis from the WCS. + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + The WCS with naxis to be chopped to naxis-1 + dropax : int + The index of the WCS to drop, counting from 0 (i.e., python convention, + not FITS convention) + + Returns + ------- + A new `~astropy.wcs.WCS` instance with one axis fewer + """ + inds = list(range(self.wcs.naxis)) + inds.pop(dropax) + + # axis 0 has special meaning to sub + # if wcs.wcs.ctype == ['RA','DEC','VLSR'], you want + # wcs.sub([1,2]) to get 'RA','DEC' back + return self.sub([i+1 for i in inds]) + + def swapaxes(self, ax0, ax1): + """ + Swap axes in a WCS. + + Parameters + ---------- + wcs : `~astropy.wcs.WCS` + The WCS to have its axes swapped + ax0 : int + ax1 : int + The indices of the WCS to be swapped, counting from 0 (i.e., python + convention, not FITS convention) + + Returns + ------- + A new `~astropy.wcs.WCS` instance with the same number of axes, but two + swapped + """ + inds = list(range(self.wcs.naxis)) + inds[ax0], inds[ax1] = inds[ax1], inds[ax0] + + return self.sub([i+1 for i in inds]) + + def reorient_celestial_first(self): + """ + Reorient the WCS such that the celestial axes are first, followed by + the spectral axis, followed by any others. + Assumes at least celestial axes are present. + """ + return self.sub([WCSSUB_CELESTIAL, WCSSUB_SPECTRAL, WCSSUB_STOKES]) + + def slice(self, view, numpy_order=True): + """ + Slice a WCS instance using a Numpy slice. The order of the slice should + be reversed (as for the data) compared to the natural WCS order. + + Parameters + ---------- + view : tuple + A tuple containing the same number of slices as the WCS system. + The ``step`` method, the third argument to a slice, is not + presently supported. + numpy_order : bool + Use numpy order, i.e. slice the WCS so that an identical slice + applied to a numpy array will slice the array and WCS in the same + way. If set to `False`, the WCS will be sliced in FITS order, + meaning the first slice will be applied to the *last* numpy index + but the *first* WCS axis. + + Returns + ------- + wcs_new : `~astropy.wcs.WCS` + A new resampled WCS axis + """ + if hasattr(view, '__len__') and len(view) > self.wcs.naxis: + raise ValueError("Must have # of slices <= # of WCS axes") + elif not hasattr(view, '__len__'): # view MUST be an iterable + view = [view] + + if not all(isinstance(x, slice) for x in view): + # We need to drop some dimensions, but this may not always be + # possible with .sub due to correlated axes, so instead we use the + # generalized slicing infrastructure from astropy.wcs.wcsapi. + return SlicedFITSWCS(self, view) + + # NOTE: we could in principle use SlicedFITSWCS as above for all slicing, + # but in the simple case where there are no axes dropped, we can just + # create a full WCS object with updated WCS parameters which is faster + # for this specific case and also backward-compatible. + + wcs_new = self.deepcopy() + if wcs_new.sip is not None: + sip_crpix = wcs_new.sip.crpix.tolist() + + for i, iview in enumerate(view): + if iview.step is not None and iview.step < 0: + raise NotImplementedError("Reversing an axis is not " + "implemented.") + + if numpy_order: + wcs_index = self.wcs.naxis - 1 - i + else: + wcs_index = i + + if iview.step is not None and iview.start is None: + # Slice from "None" is equivalent to slice from 0 (but one + # might want to downsample, so allow slices with + # None,None,step or None,stop,step) + iview = slice(0, iview.stop, iview.step) + + if iview.start is not None: + if iview.step not in (None, 1): + crpix = self.wcs.crpix[wcs_index] + cdelt = self.wcs.cdelt[wcs_index] + # equivalently (keep this comment so you can compare eqns): + # wcs_new.wcs.crpix[wcs_index] = + # (crpix - iview.start)*iview.step + 0.5 - iview.step/2. + crp = ((crpix - iview.start - 1.)/iview.step + + 0.5 + 1./iview.step/2.) + wcs_new.wcs.crpix[wcs_index] = crp + if wcs_new.sip is not None: + sip_crpix[wcs_index] = crp + wcs_new.wcs.cdelt[wcs_index] = cdelt * iview.step + else: + wcs_new.wcs.crpix[wcs_index] -= iview.start + if wcs_new.sip is not None: + sip_crpix[wcs_index] -= iview.start + + try: + # range requires integers but the other attributes can also + # handle arbitrary values, so this needs to be in a try/except. + nitems = len(builtins.range(self._naxis[wcs_index])[iview]) + except TypeError as exc: + if 'indices must be integers' not in str(exc): + raise + warnings.warn("NAXIS{0} attribute is not updated because at " + "least one index ('{1}') is no integer." + "".format(wcs_index, iview), AstropyUserWarning) + else: + wcs_new._naxis[wcs_index] = nitems + + if wcs_new.sip is not None: + wcs_new.sip = Sip(self.sip.a, self.sip.b, self.sip.ap, self.sip.bp, + sip_crpix) + + return wcs_new + + def __getitem__(self, item): + # "getitem" is a shortcut for self.slice; it is very limited + # there is no obvious and unambiguous interpretation of wcs[1,2,3] + # We COULD allow wcs[1] to link to wcs.sub([2]) + # (wcs[i] -> wcs.sub([i+1]) + return self.slice(item) + + def __iter__(self): + # Having __getitem__ makes Python think WCS is iterable. However, + # Python first checks whether __iter__ is present, so we can raise an + # exception here. + raise TypeError("'{0}' object is not iterable".format(self.__class__.__name__)) + + @property + def axis_type_names(self): + """ + World names for each coordinate axis + + Returns + ------- + A list of names along each axis + """ + names = list(self.wcs.cname) + types = self.wcs.ctype + for i in range(len(names)): + if len(names[i]) > 0: + continue + names[i] = types[i].split('-')[0] + return names + + @property + def celestial(self): + """ + A copy of the current WCS with only the celestial axes included + """ + return self.sub([WCSSUB_CELESTIAL]) + + @property + def is_celestial(self): + return self.has_celestial and self.naxis == 2 + + @property + def has_celestial(self): + try: + return self.wcs.lng >= 0 and self.wcs.lat >= 0 + except InconsistentAxisTypesError: + return False + + @property + def has_distortion(self): + """ + Returns `True` if any distortion terms are present. + """ + return (self.sip is not None or + self.cpdis1 is not None or self.cpdis2 is not None or + self.det2im1 is not None and self.det2im2 is not None) + + @property + def pixel_scale_matrix(self): + + try: + cdelt = np.diag(self.wcs.get_cdelt()) + pc = self.wcs.get_pc() + except InconsistentAxisTypesError: + try: + # for non-celestial axes, get_cdelt doesn't work + cdelt = np.dot(self.wcs.cd, np.diag(self.wcs.cdelt)) + except AttributeError: + cdelt = np.diag(self.wcs.cdelt) + + try: + pc = self.wcs.pc + except AttributeError: + pc = 1 + + pccd = np.array(np.dot(cdelt, pc)) + + return pccd + + def _as_mpl_axes(self): + """ + Compatibility hook for Matplotlib and WCSAxes. + + With this method, one can do: + + from astropy.wcs import WCS + import matplotlib.pyplot as plt + + wcs = WCS('filename.fits') + + fig = plt.figure() + ax = fig.add_axes([0.15, 0.1, 0.8, 0.8], projection=wcs) + ... + + and this will generate a plot with the correct WCS coordinates on the + axes. + """ + from astropy.visualization.wcsaxes import WCSAxes + return WCSAxes, {'wcs': self} + + def footprint_contains(self, coord, **kwargs): + """ + Determines if a given SkyCoord is contained in the wcs footprint. + + Parameters + ---------- + coord : `~astropy.coordinates.SkyCoord` + The coordinate to check if it is within the wcs coordinate. + **kwargs : + Additional arguments to pass to `~astropy.coordinates.SkyCoord.to_pixel` + + Returns + ------- + response : bool + True means the WCS footprint contains the coordinate, False means it does not. + """ + + return coord.contained_by(self, **kwargs) + + +def __WCS_unpickle__(cls, dct, fits_data): + """ + Unpickles a WCS object from a serialized FITS string. + """ + + self = cls.__new__(cls) + self.__dict__.update(dct) + + buffer = io.BytesIO(fits_data) + hdulist = fits.open(buffer) + + WCS.__init__(self, hdulist[0].header, hdulist) + + return self + + +def find_all_wcs(header, relax=True, keysel=None, fix=True, + translate_units='', + _do_set=True): + """ + Find all the WCS transformations in the given header. + + Parameters + ---------- + header : str or astropy.io.fits header object. + + relax : bool or int, optional + Degree of permissiveness: + + - `True` (default): Admit all recognized informal extensions of the + WCS standard. + + - `False`: Recognize only FITS keywords defined by the + published WCS standard. + + - `int`: a bit field selecting specific extensions to accept. + See :ref:`relaxread` for details. + + keysel : sequence of flags, optional + A list of flags used to select the keyword types considered by + wcslib. When ``None``, only the standard image header + keywords are considered (and the underlying wcspih() C + function is called). To use binary table image array or pixel + list keywords, *keysel* must be set. + + Each element in the list should be one of the following strings: + + - 'image': Image header keywords + + - 'binary': Binary table image array keywords + + - 'pixel': Pixel list keywords + + Keywords such as ``EQUIna`` or ``RFRQna`` that are common to + binary table image arrays and pixel lists (including + ``WCSNna`` and ``TWCSna``) are selected by both 'binary' and + 'pixel'. + + fix : bool, optional + When `True` (default), call `~astropy.wcs.Wcsprm.fix` on + the resulting objects to fix any non-standard uses in the + header. `FITSFixedWarning` warnings will be emitted if any + changes were made. + + translate_units : str, optional + Specify which potentially unsafe translations of non-standard + unit strings to perform. By default, performs none. See + `WCS.fix` for more information about this parameter. Only + effective when ``fix`` is `True`. + + Returns + ------- + wcses : list of `WCS` objects + """ + + if isinstance(header, (str, bytes)): + header_string = header + elif isinstance(header, fits.Header): + header_string = header.tostring() + else: + raise TypeError( + "header must be a string or astropy.io.fits.Header object") + + keysel_flags = _parse_keysel(keysel) + + if isinstance(header_string, str): + header_bytes = header_string.encode('ascii') + else: + header_bytes = header_string + + wcsprms = _wcs.find_all_wcs(header_bytes, relax, keysel_flags) + + result = [] + for wcsprm in wcsprms: + subresult = WCS(fix=False, _do_set=False) + subresult.wcs = wcsprm + result.append(subresult) + + if fix: + subresult.fix(translate_units) + + if _do_set: + subresult.wcs.set() + + return result + + +def validate(source): + """ + Prints a WCS validation report for the given FITS file. + + Parameters + ---------- + source : str path, readable file-like object or `astropy.io.fits.HDUList` object + The FITS file to validate. + + Returns + ------- + results : WcsValidateResults instance + The result is returned as nested lists. The first level + corresponds to the HDUs in the given file. The next level has + an entry for each WCS found in that header. The special + subclass of list will pretty-print the results as a table when + printed. + """ + class _WcsValidateWcsResult(list): + def __init__(self, key): + self._key = key + + def __repr__(self): + result = [" WCS key '{0}':".format(self._key or ' ')] + if len(self): + for entry in self: + for i, line in enumerate(entry.splitlines()): + if i == 0: + initial_indent = ' - ' + else: + initial_indent = ' ' + result.extend( + textwrap.wrap( + line, + initial_indent=initial_indent, + subsequent_indent=' ')) + else: + result.append(" No issues.") + return '\n'.join(result) + + class _WcsValidateHduResult(list): + def __init__(self, hdu_index, hdu_name): + self._hdu_index = hdu_index + self._hdu_name = hdu_name + list.__init__(self) + + def __repr__(self): + if len(self): + if self._hdu_name: + hdu_name = ' ({0})'.format(self._hdu_name) + else: + hdu_name = '' + result = ['HDU {0}{1}:'.format(self._hdu_index, hdu_name)] + for wcs in self: + result.append(repr(wcs)) + return '\n'.join(result) + return '' + + class _WcsValidateResults(list): + def __repr__(self): + result = [] + for hdu in self: + content = repr(hdu) + if len(content): + result.append(content) + return '\n\n'.join(result) + + global __warningregistry__ + + if isinstance(source, fits.HDUList): + hdulist = source + else: + hdulist = fits.open(source) + + results = _WcsValidateResults() + + for i, hdu in enumerate(hdulist): + hdu_results = _WcsValidateHduResult(i, hdu.name) + results.append(hdu_results) + + with warnings.catch_warnings(record=True) as warning_lines: + wcses = find_all_wcs( + hdu.header, relax=_wcs.WCSHDR_reject, + fix=False, _do_set=False) + + for wcs in wcses: + wcs_results = _WcsValidateWcsResult(wcs.wcs.alt) + hdu_results.append(wcs_results) + + try: + del __warningregistry__ + except NameError: + pass + + with warnings.catch_warnings(record=True) as warning_lines: + warnings.resetwarnings() + warnings.simplefilter( + "always", FITSFixedWarning, append=True) + + try: + WCS(hdu.header, + key=wcs.wcs.alt or ' ', + relax=_wcs.WCSHDR_reject, + fix=True, _do_set=False) + except WcsError as e: + wcs_results.append(str(e)) + + wcs_results.extend([str(x.message) for x in warning_lines]) + + return results diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/__init__.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..32abe0bb9477c4d3b90e207497bf8cf128d3616f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/__init__.py @@ -0,0 +1,4 @@ +from .low_level_api import * +from .high_level_api import * +from .high_level_wcs_wrapper import * +from .sliced_low_level_wcs import * diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/data/ucds.txt b/testbed/astropy__astropy/astropy/wcs/wcsapi/data/ucds.txt new file mode 100644 index 0000000000000000000000000000000000000000..5e522cd78dc9a10e4652ba7875c587dbec3155d7 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/data/ucds.txt @@ -0,0 +1,474 @@ +# Copied from UCD1+ v1.23 +arith +arith.diff +arith.factor +arith.grad +arith.rate +arith.ratio +arith.zp +em +em.radio +em.radio.20-100MHz +em.radio.100-200MHz +em.radio.200-400MHz +em.radio.400-750MHz +em.radio.750-1500MHz +em.radio.1500-3000MHz +em.radio.3-6GHz +em.radio.6-12GHz +em.radio.12-30GHz +em.mm +em.mm.30-50GHz +em.mm.50-100GHz +em.mm.100-200GHz +em.mm.200-400GHz +em.mm.400-750GHz +em.mm.750-1500GHz +em.mm.1500-3000GHz +em.IR +em.IR.J +em.IR.H +em.IR.K +em.IR.3-4um +em.IR.4-8um +em.IR.8-15um +em.IR.15-30um +em.IR.30-60um +em.IR.60-100um +em.IR.NIR +em.IR.MIR +em.IR.FIR +em.opt +em.opt.U +em.opt.B +em.opt.V +em.opt.R +em.opt.I +em.UV +em.UV.10-50nm +em.UV.50-100nm +em.UV.100-200nm +em.UV.200-300nm +em.UV.FUV +em.X-ray +em.X-ray.soft +em.X-ray.medium +em.X-ray.hard +em.gamma +em.gamma.soft +em.gamma.hard +em.line +em.line.Brgamma +em.line.HI +em.line.Halpha +em.line.Hbeta +em.line.Hgamma +em.line.Hdelta +em.line.Lyalpha +em.line.OIII +em.line.CO +em.bin +em.energy +em.freq +em.wavenumber +em.wl +em.wl.central +em.wl.effective +instr +instr.background +instr.bandpass +instr.bandwidth +instr.baseline +instr.beam +instr.calib +instr.det +instr.det.noise +instr.det.psf +instr.det.qe +instr.dispersion +instr.filter +instr.fov +instr.obsty +instr.obsty.seeing +instr.offset +instr.order +instr.param +instr.pixel +instr.plate +instr.plate.emulsion +instr.precision +instr.saturation +instr.scale +instr.sensitivity +instr.setup +instr.skyLevel +instr.skyTemp +instr.tel +instr.tel.focalLength +meta +meta.abstract +meta.bib +meta.bib.author +meta.bib.bibcode +meta.bib.fig +meta.bib.journal +meta.bib.page +meta.bib.volume +meta.code +meta.code.class +meta.code.error +meta.code.member +meta.code.mime +meta.code.multip +meta.code.qual +meta.code.status +meta.cryptic +meta.curation +meta.dataset +meta.email +meta.file +meta.fits +meta.id +meta.id.assoc +meta.id.CoI +meta.id.cross +meta.id.parent +meta.id.part +meta.id.PI +meta.main +meta.modelled +meta.note +meta.number +meta.record +meta.ref +meta.ref.ivorn +meta.ref.uri +meta.ref.url +meta.software +meta.table +meta.title +meta.ucd +meta.unit +meta.version +obs +obs.airMass +obs.atmos +obs.atmos.extinction +obs.atmos.refractAngle +obs.calib +obs.calib.flat +obs.exposure +obs.field +obs.image +obs.observer +obs.param +obs.proposal +obs.proposal.cycle +obs.sequence +phot +phot.antennaTemp +phot.calib +phot.color +phot.color.excess +phot.color.reddFree +phot.count +phot.fluence +phot.flux +phot.flux.bol +phot.flux.density +phot.flux.density.sb +phot.flux.sb +phot.limbDark +phot.mag +phot.mag.bc +phot.mag.bol +phot.mag.distMod +phot.mag.reddFree +phot.mag.sb +phys +phys.SFR +phys.absorption +phys.absorption.coeff +phys.absorption.gal +phys.absorption.opticalDepth +phys.abund +phys.abund.Fe +phys.abund.X +phys.abund.Y +phys.abund.Z +phys.acceleration +phys.albedo +phys.angArea +phys.angMomentum +phys.angSize +phys.angSize.smajAxis +phys.angSize.sminAxis +phys.area +phys.atmol +phys.atmol.branchingRatio +phys.atmol.collStrength +phys.atmol.collisional +phys.atmol.configuration +phys.atmol.crossSection +phys.atmol.element +phys.atmol.excitation +phys.atmol.final +phys.atmol.initial +phys.atmol.ionStage +phys.atmol.ionization +phys.atmol.lande +phys.atmol.level +phys.atmol.lifetime +phys.atmol.lineShift +phys.atmol.number +phys.atmol.oscStrength +phys.atmol.parity +phys.atmol.qn +phys.atmol.radiationType +phys.atmol.symmetry +phys.atmol.sWeight +phys.atmol.sWeight.nuclear +phys.atmol.term +phys.atmol.transProb +phys.atmol.transition +phys.atmol.wOscStrength +phys.atmol.weight +phys.columnDensity +phys.composition +phys.composition.massLightRatio +phys.composition.yield +phys.cosmology +phys.damping +phys.density +phys.dielectric +phys.dispMeasure +phys.electField +phys.electron +phys.electron.degen +phys.emissMeasure +phys.emissivity +phys.energy +phys.energy.density +phys.entropy +phys.eos +phys.excitParam +phys.gauntFactor +phys.gravity +phys.ionizParam +phys.ionizParam.coll +phys.ionizParam.rad +phys.luminosity +phys.luminosity.fun +phys.magAbs +phys.magAbs.bol +phys.magField +phys.mass +phys.mass.loss +phys.mol +phys.mol.dipole +phys.mol.dipole.electric +phys.mol.dipole.magnetic +phys.mol.dissociation +phys.mol.formationHeat +phys.mol.quadrupole +phys.mol.quadrupole.electric +phys.mol.rotation +phys.mol.vibration +phys.particle.neutrino +phys.polarization +phys.polarization.circular +phys.polarization.linear +phys.polarization.rotMeasure +phys.polarization.stokes +phys.pressure +phys.recombination.coeff +phys.refractIndex +phys.size +phys.size.axisRatio +phys.size.diameter +phys.size.radius +phys.size.smajAxis +phys.size.sminAxis +phys.temperature +phys.temperature.effective +phys.temperature.electron +phys.transmission +phys.veloc +phys.veloc.ang +phys.veloc.dispersion +phys.veloc.escape +phys.veloc.expansion +phys.veloc.microTurb +phys.veloc.orbital +phys.veloc.pulsat +phys.veloc.rotat +phys.veloc.transverse +phys.virial +pos +pos.angDistance +pos.angResolution +pos.az +pos.az.alt +pos.az.azi +pos.az.zd +pos.barycenter +pos.bodyrc +pos.bodyrc.alt +pos.bodyrc.lat +pos.bodyrc.lon +pos.cartesian +pos.cartesian.x +pos.cartesian.y +pos.cartesian.z +pos.cmb +pos.dirCos +pos.distance +pos.earth +pos.earth.altitude +pos.earth.lat +pos.earth.lon +pos.ecliptic +pos.ecliptic.lat +pos.ecliptic.lon +pos.eop +pos.eop.nutation +pos.ephem +pos.eq +pos.eq.dec +pos.eq.ha +pos.eq.ra +pos.eq.spd +pos.errorEllipse +pos.frame +pos.galactic +pos.galactic.lat +pos.galactic.lon +pos.galactocentric +pos.geocentric +pos.healpix +pos.heliocentric +pos.HTM +pos.lambert +pos.lg +pos.lsr +pos.lunar +pos.lunar.occult +pos.parallax +pos.parallax.dyn +pos.parallax.phot +pos.parallax.spect +pos.parallax.trig +pos.phaseAng +pos.pm +pos.posAng +pos.precess +pos.supergalactic +pos.supergalactic.lat +pos.supergalactic.lon +pos.wcs +pos.wcs.cdmatrix +pos.wcs.crpix +pos.wcs.crval +pos.wcs.ctype +pos.wcs.naxes +pos.wcs.naxis +pos.wcs.scale +spect +spect.binSize +spect.continuum +spect.dopplerParam +spect.dopplerVeloc +spect.dopplerVeloc.opt +spect.dopplerVeloc.radio +spect.index +spect.line +spect.line.asymmetry +spect.line.broad +spect.line.broad.Stark +spect.line.broad.Zeeman +spect.line.eqWidth +spect.line.intensity +spect.line.profile +spect.line.strength +spect.line.width +spect.resolution +src +src.calib +src.calib.guideStar +src.class +src.class.color +src.class.distance +src.class.luminosity +src.class.richness +src.class.starGalaxy +src.class.struct +src.density +src.ellipticity +src.impactParam +src.morph +src.morph.param +src.morph.scLength +src.morph.type +src.net +src.orbital +src.orbital.eccentricity +src.orbital.inclination +src.orbital.meanAnomaly +src.orbital.meanMotion +src.orbital.node +src.orbital.periastron +src.redshift +src.redshift.phot +src.sample +src.spType +src.var +src.var.amplitude +src.var.index +src.var.pulse +stat +stat.Fourier +stat.Fourier.amplitude +stat.correlation +stat.covariance +stat.error +stat.error.sys +stat.filling +stat.fit +stat.fit.chi2 +stat.fit.dof +stat.fit.goodness +stat.fit.omc +stat.fit.param +stat.fit.residual +stat.likelihood +stat.max +stat.mean +stat.median +stat.min +stat.param +stat.probability +stat.snr +stat.stdev +stat.uncalib +stat.value +stat.variance +stat.weight +time +time.age +time.creation +time.crossing +time.duration +time.end +time.epoch +time.equinox +time.interval +time.lifetime +time.period +time.phase +time.processing +time.publiYear +time.relax +time.release +time.resolution +time.scale +time.start diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/fitswcs.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/fitswcs.py new file mode 100644 index 0000000000000000000000000000000000000000..76979cd3be055ac2088abb774fdc9513589074d5 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/fitswcs.py @@ -0,0 +1,338 @@ +# 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 .low_level_api import BaseLowLevelWCS +from .high_level_api import HighLevelWCSMixin +from .sliced_low_level_wcs import SlicedLowLevelWCS + +__all__ = ['custom_ctype_to_ucd_mapping', 'SlicedFITSWCS', 'FITSWCSAPIMixin'] + +# Mapping from CTYPE axis name to UCD1 + +CTYPE_TO_UCD1 = { + + # Celestial coordinates + 'RA': 'pos.eq.ra', + 'DEC': 'pos.eq.dec', + 'GLON': 'pos.galactic.lon', + 'GLAT': 'pos.galactic.lat', + 'ELON': 'pos.ecliptic.lon', + 'ELAT': 'pos.ecliptic.lat', + 'TLON': 'pos.bodyrc.lon', + 'TLAT': 'pos.bodyrc.lat', + 'HPLT': 'custom:pos.helioprojective.lat', + 'HPLN': 'custom:pos.helioprojective.lon', + + # Spectral coordinates (WCS paper 3) + 'FREQ': 'em.freq', # Frequency + 'ENER': 'em.energy', # Energy + 'WAVN': 'em.wavenumber', # Wavenumber + 'WAVE': 'em.wl', # Vacuum wavelength + 'VRAD': 'spect.dopplerVeloc.radio', # Radio velocity + 'VOPT': 'spect.dopplerVeloc.opt', # Optical velocity + 'ZOPT': 'src.redshift', # Redshift + 'AWAV': 'em.wl', # Air wavelength + 'VELO': 'spect.dopplerVeloc', # Apparent radial velocity + 'BETA': 'custom:spect.doplerVeloc.beta', # Beta factor (v/c) + + # Time coordinates (https://www.aanda.org/articles/aa/pdf/2015/02/aa24653-14.pdf) + 'TIME': 'time', + 'TAI': 'time', + 'TT': 'time', + 'TDT': 'time', + 'ET': 'time', + 'IAT': 'time', + 'UT1': 'time', + 'UTC': 'time', + 'GMT': 'time', + 'GPS': 'time', + 'TCG': 'time', + 'TCB': 'time', + 'TDB': 'time', + 'LOCAL': 'time' + + # UT() is handled separately in world_axis_physical_types + +} + +# Keep a list of additional custom mappings that have been registered. This +# is kept as a list in case nested context managers are used +CTYPE_TO_UCD1_CUSTOM = [] + + +class custom_ctype_to_ucd_mapping: + """ + A context manager that makes it possible to temporarily add new CTYPE to + UCD1+ mapping used by :attr:`FITSWCSAPIMixin.world_axis_physical_types`. + + Parameters + ---------- + mapping : dict + A dictionary mapping a CTYPE value to a UCD1+ value + + Examples + -------- + + Consider a WCS with the following CTYPE:: + + >>> from astropy.wcs import WCS + >>> wcs = WCS(naxis=1) + >>> wcs.wcs.ctype = ['SPAM'] + + By default, :attr:`FITSWCSAPIMixin.world_axis_physical_types` returns `None`, + but this can be overriden:: + + >>> wcs.world_axis_physical_types + [None] + >>> with custom_ctype_to_ucd_mapping({'SPAM': 'food.spam'}): + ... wcs.world_axis_physical_types + ['food.spam'] + """ + + def __init__(self, mapping): + CTYPE_TO_UCD1_CUSTOM.insert(0, mapping) + self.mapping = mapping + + def __enter__(self): + pass + + def __exit__(self, type, value, tb): + CTYPE_TO_UCD1_CUSTOM.remove(self.mapping) + + +class SlicedFITSWCS(SlicedLowLevelWCS, HighLevelWCSMixin): + pass + + +class FITSWCSAPIMixin(BaseLowLevelWCS, HighLevelWCSMixin): + """ + A mix-in class that is intended to be inherited by the + :class:`~astropy.wcs.WCS` class and provides the low- and high-level WCS API + """ + + @property + def pixel_n_dim(self): + return self.naxis + + @property + def world_n_dim(self): + return len(self.wcs.ctype) + + @property + def array_shape(self): + if self._naxis == [0, 0]: + return None + else: + return tuple(self._naxis[::-1]) + + @array_shape.setter + def array_shape(self, value): + if value is None: + self._naxis = [0, 0] + else: + if len(value) != self.naxis: + raise ValueError("The number of data axes, " + "{}, does not equal the " + "shape {}.".format(self.naxis, len(value))) + self._naxis = list(value)[::-1] + + @property + def pixel_shape(self): + if self._naxis == [0, 0]: + return None + else: + return tuple(self._naxis) + + @pixel_shape.setter + def pixel_shape(self, value): + if value is None: + self._naxis = [0, 0] + else: + if len(value) != self.naxis: + raise ValueError("The number of data axes, " + "{}, does not equal the " + "shape {}.".format(self.naxis, len(value))) + self._naxis = list(value) + + @property + def pixel_bounds(self): + return self._pixel_bounds + + @pixel_bounds.setter + def pixel_bounds(self, value): + if value is None: + self._pixel_bounds = value + else: + if len(value) != self.naxis: + raise ValueError("The number of data axes, " + "{}, does not equal the number of " + "pixel bounds {}.".format(self.naxis, len(value))) + self._pixel_bounds = list(value) + + @property + def world_axis_physical_types(self): + types = [] + for axis_type in self.axis_type_names: + if axis_type.startswith('UT('): + types.append('time') + else: + for custom_mapping in CTYPE_TO_UCD1_CUSTOM: + if axis_type in custom_mapping: + types.append(custom_mapping[axis_type]) + break + else: + types.append(CTYPE_TO_UCD1.get(axis_type, None)) + return types + + @property + def world_axis_units(self): + units = [] + for unit in self.wcs.cunit: + if unit is None: + unit = '' + elif isinstance(unit, u.Unit): + unit = unit.to_string(format='vounit') + else: + try: + unit = u.Unit(unit).to_string(format='vounit') + except u.UnitsError: + unit = '' + units.append(unit) + return units + + @property + def axis_correlation_matrix(self): + + # If there are any distortions present, we assume that there may be + # correlations between all axes. Maybe if some distortions only apply + # to the image plane we can improve this? + if self.has_distortion: + return np.ones((self.world_n_dim, self.pixel_n_dim), dtype=bool) + + # Assuming linear world coordinates along each axis, the correlation + # matrix would be given by whether or not the PC matrix is zero + matrix = self.wcs.get_pc() != 0 + + # We now need to check specifically for celestial coordinates since + # these can assume correlations because of spherical distortions. For + # each celestial coordinate we copy over the pixel dependencies from + # the other celestial coordinates. + celestial = (self.wcs.axis_types // 1000) % 10 == 2 + celestial_indices = np.nonzero(celestial)[0] + for world1 in celestial_indices: + for world2 in celestial_indices: + if world1 != world2: + matrix[world1] |= matrix[world2] + matrix[world2] |= matrix[world1] + + return matrix + + def pixel_to_world_values(self, *pixel_arrays): + world = self.all_pix2world(*pixel_arrays, 0) + return world[0] if self.world_n_dim == 1 else world + + def array_index_to_world_values(self, *indices): + world = self.all_pix2world(*indices[::-1], 0) + return world[0] if self.world_n_dim == 1 else world + + def world_to_pixel_values(self, *world_arrays): + pixel = self.all_world2pix(*world_arrays, 0) + return pixel[0] if self.pixel_n_dim == 1 else pixel + + def world_to_array_index_values(self, *world_arrays): + pixel_arrays = self.all_world2pix(*world_arrays, 0)[::-1] + array_indices = tuple(np.asarray(np.floor(pixel + 0.5), dtype=np.int) for pixel in pixel_arrays) + return array_indices[0] if self.pixel_n_dim == 1 else array_indices + + @property + def world_axis_object_components(self): + return self._get_components_and_classes()[0] + + @property + def world_axis_object_classes(self): + return self._get_components_and_classes()[1] + + @property + def serialized_classes(self): + return False + + def _get_components_and_classes(self): + + # The aim of this function is to return whatever is needed for + # world_axis_object_components and world_axis_object_classes. It's easier + # to figure it out in one go and then return the values and let the + # properties return part of it. + + # Since this method might get called quite a few times, we need to cache + # it. We start off by defining a hash based on the attributes of the + # WCS that matter here (we can't just use the WCS object as a hash since + # it is mutable) + wcs_hash = (self.naxis, + list(self.wcs.ctype), + list(self.wcs.cunit), + self.wcs.radesys, + self.wcs.equinox, + self.wcs.dateobs, + self.wcs.lng, + self.wcs.lat) + + # If the cache is present, we need to check that the 'hash' matches. + if getattr(self, '_components_and_classes_cache', None) is not None: + cache = self._components_and_classes_cache + if cache[0] == wcs_hash: + return cache[1] + else: + self._components_and_classes_cache = None + + # Avoid circular imports by importing here + from astropy.wcs.utils import wcs_to_celestial_frame + from astropy.coordinates import SkyCoord + + components = [None] * self.naxis + classes = {} + + # Let's start off by checking whether the WCS has a pair of celestial + # components + + if self.has_celestial: + + frame = wcs_to_celestial_frame(self) + + kwargs = {} + kwargs['frame'] = frame + kwargs['unit'] = u.deg + + classes['celestial'] = (SkyCoord, (), kwargs) + + components[self.wcs.lng] = ('celestial', 0, 'spherical.lon.degree') + components[self.wcs.lat] = ('celestial', 1, 'spherical.lat.degree') + + # Fallback: for any remaining components that haven't been identified, just + # return Quantity as the class to use + + if 'time' in self.world_axis_physical_types: + warnings.warn('In future, times will be represented by the Time class ' + 'instead of Quantity', FutureWarning) + + for i in range(self.naxis): + if components[i] is None: + name = self.axis_type_names[i].lower() + if name == '': + name = 'world' + while name in classes: + name += "_" + classes[name] = (u.Quantity, (), {'unit': self.wcs.cunit[i]}) + components[i] = (name, 0, 'value') + + # Keep a cached version of result + self._components_and_classes_cache = wcs_hash, (components, classes) + + return components, classes diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_api.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_api.py new file mode 100644 index 0000000000000000000000000000000000000000..6528a5a81e0f6bcc1b0f186c9b80f577b120a56c --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_api.py @@ -0,0 +1,241 @@ +import abc +from collections import defaultdict, OrderedDict + +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 = [] + for key, _, _ in components: + if key not in order: + order.append(key) + return order + + +class BaseHighLevelWCS(metaclass=abc.ABCMeta): + """ + Abstract base class for the high-level WCS interface. + + This is described in `APE 14: A shared Python interface for World Coordinate + Systems `_. + """ + + @property + @abc.abstractmethod + def low_level_wcs(self): + """ + Returns a reference to the underlying low-level WCS object. + """ + + @abc.abstractmethod + def pixel_to_world(self, *pixel_arrays): + """ + Convert pixel coordinates to world coordinates (represented by + high-level objects). + + If a single high-level object is used to represent the world coordinates + (i.e., if ``len(wcs.world_axis_object_classes) == 1``), it is returned + as-is (not in a tuple/list), otherwise a tuple of high-level objects is + returned. See + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_to_world_values` for pixel + indexing and ordering conventions. + """ + + @abc.abstractmethod + def array_index_to_world(self, *index_arrays): + """ + Convert array indices to world coordinates (represented by Astropy + objects). + + If a single high-level object is used to represent the world coordinates + (i.e., if ``len(wcs.world_axis_object_classes) == 1``), it is returned + as-is (not in a tuple/list), otherwise a tuple of high-level objects is + returned. See + `~astropy.wcs.wcsapi.BaseLowLevelWCS.array_index_to_world_values` for + pixel indexing and ordering conventions. + """ + + @abc.abstractmethod + def world_to_pixel(self, *world_objects): + """ + Convert world coordinates (represented by Astropy objects) to pixel + coordinates. + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. See + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_to_pixel_values` for pixel + indexing and ordering conventions. + """ + + @abc.abstractmethod + def world_to_array_index(self, *world_objects): + """ + Convert world coordinates (represented by Astropy objects) to array + indices. + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. See + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_to_array_index_values` for + pixel indexing and ordering conventions. The indices should be returned + as rounded integers. + """ + + +class HighLevelWCSMixin(BaseHighLevelWCS): + """ + Mix-in class that automatically provides the high-level WCS API for the + low-level WCS object given by the `~HighLevelWCSMixin.low_level_wcs` + property. + """ + + @property + def low_level_wcs(self): + return self + + def world_to_pixel(self, *world_objects): + + # Cache the classes and components since this may be expensive + serialized_classes = self.low_level_wcs.world_axis_object_classes + components = self.low_level_wcs.world_axis_object_components + + # Deserialize world_axis_object_classes using the default order + classes = OrderedDict() + for key in default_order(components): + if self.low_level_wcs.serialized_classes: + classes[key] = deserialize_class(serialized_classes[key], + construct=False) + else: + classes[key] = serialized_classes[key] + + # Check that the number of classes matches the number of inputs + if len(world_objects) != len(classes): + raise ValueError("Number of world inputs ({0}) does not match " + "expected ({1})".format(len(world_objects), len(classes))) + + # Determine whether the classes are uniquely matched, that is we check + # whether there is only one of each class. + world_by_key = {} + unique_match = True + for w in world_objects: + matches = [] + for key, (klass, _, _) in classes.items(): + if isinstance(w, klass): + matches.append(key) + if len(matches) == 1: + world_by_key[matches[0]] = w + else: + unique_match = False + break + + # If the match is not unique, the order of the classes needs to match, + # whereas if all classes are unique, we can still intelligently match + # them even if the order is wrong. + + objects = {} + + if unique_match: + + for key, (klass, args, kwargs) in classes.items(): + + # FIXME: For now SkyCoord won't auto-convert upon initialization + # https://github.com/astropy/astropy/issues/7689 + from astropy.coordinates import SkyCoord + if isinstance(world_by_key[key], SkyCoord): + if 'frame' in kwargs: + objects[key] = world_by_key[key].transform_to(kwargs['frame']) + else: + objects[key] = world_by_key[key] + else: + objects[key] = klass(world_by_key[key], *args, **kwargs) + + else: + + for ikey, key in enumerate(classes): + klass, args, kwargs = classes[key] + w = world_objects[ikey] + if not isinstance(w, klass): + raise ValueError("Expected the following order of world " + "arguments: {0}".format(', '.join([k.__name__ for (k, _, _) in classes.values()]))) + + # FIXME: For now SkyCoord won't auto-convert upon initialization + # https://github.com/astropy/astropy/issues/7689 + from astropy.coordinates import SkyCoord + if isinstance(w, SkyCoord): + if 'frame' in kwargs: + objects[key] = w.transform_to(kwargs['frame']) + else: + objects[key] = w + else: + objects[key] = klass(w, *args, **kwargs) + + # We now extract the attributes needed for the world values + world = [] + for key, _, attr in components: + world.append(rec_getattr(objects[key], attr)) + + # Finally we convert to pixel coordinates + pixel = self.low_level_wcs.world_to_pixel_values(*world) + + return pixel + + def pixel_to_world(self, *pixel_arrays): + + # Compute the world coordinate values + world = self.low_level_wcs.pixel_to_world_values(*pixel_arrays) + + if self.world_n_dim == 1: + world = (world,) + + # Cache the classes and components since this may be expensive + components = self.low_level_wcs.world_axis_object_components + classes = self.low_level_wcs.world_axis_object_classes + + # Deserialize classes + if self.low_level_wcs.serialized_classes: + classes_new = {} + for key, value in classes.items(): + classes_new[key] = deserialize_class(value, construct=False) + classes = classes_new + + args = defaultdict(list) + kwargs = defaultdict(dict) + + for i, (key, attr, _) in enumerate(components): + if isinstance(attr, str): + kwargs[key][attr] = world[i] + else: + while attr > len(args[key]) - 1: + args[key].append(None) + args[key][attr] = world[i] + + result = [] + + for key in default_order(components): + klass, ar, kw = classes[key] + result.append(klass(*args[key], *ar, **kwargs[key], **kw)) + + if len(result) == 1: + return result[0] + else: + return result + + def array_index_to_world(self, *index_arrays): + return self.pixel_to_world(*index_arrays[::-1]) + + def world_to_array_index(self, *world_objects): + if self.pixel_n_dim == 1: + return np.round(self.world_to_pixel(*world_objects)).astype(int) + else: + return tuple(np.round(self.world_to_pixel(*world_objects)[::-1]).astype(int).tolist()) diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_wcs_wrapper.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_wcs_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..d4121e7e5fe2ec7c528290bca5dc856193e5ebf6 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/high_level_wcs_wrapper.py @@ -0,0 +1,71 @@ +from .high_level_api import HighLevelWCSMixin + +from . import BaseLowLevelWCS + +__all__ = ['HighLevelWCSWrapper'] + + +class HighLevelWCSWrapper(HighLevelWCSMixin): + """ + Wrapper class that can take any :class:`~astropy.wcs.wcsapi.BaseLowLevelWCS` + object and expose the high-level WCS API. + """ + + def __init__(self, low_level_wcs): + if not isinstance(low_level_wcs, BaseLowLevelWCS): + raise TypeError('Input to a HighLevelWCSWrapper must be a low level WCS object') + + self._low_level_wcs = low_level_wcs + + @property + def low_level_wcs(self): + return self._low_level_wcs + + @property + def pixel_n_dim(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` + """ + return self.low_level_wcs.pixel_n_dim + + @property + def world_n_dim(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` + """ + return self.low_level_wcs.world_n_dim + + @property + def world_axis_physical_types(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_physical_types` + """ + return self.low_level_wcs.world_axis_physical_types + + @property + def world_axis_units(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_units` + """ + return self.low_level_wcs.world_axis_units + + @property + def array_shape(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.array_shape` + """ + return self.low_level_wcs.array_shape + + @property + def pixel_bounds(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_bounds` + """ + return self.low_level_wcs.pixel_bounds + + @property + def axis_correlation_matrix(self): + """ + See `~astropy.wcs.wcsapi.BaseLowLevelWCS.axis_correlation_matrix` + """ + return self.low_level_wcs.pixel_bounds diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/low_level_api.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/low_level_api.py new file mode 100644 index 0000000000000000000000000000000000000000..62c504c8fe8a75c8cf08336cacb998dc14844eec --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/low_level_api.py @@ -0,0 +1,378 @@ +import os +import abc + +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 `_. + """ + + @property + @abc.abstractmethod + def pixel_n_dim(self): + """ + The number of axes in the pixel coordinate system. + """ + + @property + @abc.abstractmethod + def world_n_dim(self): + """ + The number of axes in the world coordinate system. + """ + + @property + @abc.abstractmethod + def world_axis_physical_types(self): + """ + An iterable of strings describing the physical type for each world axis. + + These should be names from the VO UCD1+ controlled Vocabulary + (http://www.ivoa.net/documents/latest/UCDlist.html). If no matching UCD + type exists, this can instead be ``"custom:xxx"``, where ``xxx`` is an + arbitrary string. Alternatively, if the physical type is + unknown/undefined, an element can be `None`. + """ + + @property + @abc.abstractmethod + def world_axis_units(self): + """ + An iterable of strings given the units of the world coordinates for each + axis. + + The strings should follow the `IVOA VOUnit standard + `_ (though as noted in the VOUnit + specification document, units that do not follow this standard are still + allowed, but just not recommended). + """ + + @abc.abstractmethod + def pixel_to_world_values(self, *pixel_arrays): + """ + Convert pixel coordinates to world coordinates. + + This method takes `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` scalars or arrays as + input, and pixel coordinates should be zero-based. Returns + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` scalars or arrays in units given by + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_units`. Note that pixel coordinates are + assumed to be 0 at the center of the first pixel in each dimension. If a + pixel is in a region where the WCS is not defined, NaN can be returned. + The coordinates should be specified in the ``(x, y)`` order, where for + an image, ``x`` is the horizontal coordinate and ``y`` is the vertical + coordinate. + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. + """ + + @abc.abstractmethod + def array_index_to_world_values(self, *index_arrays): + """ + Convert array indices to world coordinates. + + This is the same as `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_to_world_values` except that + the indices should be given in ``(i, j)`` order, where for an image + ``i`` is the row and ``j`` is the column (i.e. the opposite order to + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_to_world_values`). + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. + """ + + @abc.abstractmethod + def world_to_pixel_values(self, *world_arrays): + """ + Convert world coordinates to pixel coordinates. + + This method takes `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` scalars or arrays as + input in units given by `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_units`. Returns + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` scalars or arrays. Note that pixel + coordinates are assumed to be 0 at the center of the first pixel in each + dimension. If a world coordinate does not have a matching pixel + coordinate, NaN can be returned. The coordinates should be returned in + the ``(x, y)`` order, where for an image, ``x`` is the horizontal + coordinate and ``y`` is the vertical coordinate. + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. + """ + + @abc.abstractmethod + def world_to_array_index_values(self, *world_arrays): + """ + Convert world coordinates to array indices. + + This is the same as `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_to_pixel_values` except that + the indices should be returned in ``(i, j)`` order, where for an image + ``i`` is the row and ``j`` is the column (i.e. the opposite order to + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_to_world_values`). The indices should be + returned as rounded integers. + + If `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` is ``1``, this + method returns a single scalar or array, otherwise a tuple of scalars or + arrays is returned. + """ + + @property + @abc.abstractmethod + def world_axis_object_components(self): + """ + A list with `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim` elements giving information + on constructing high-level objects for the world coordinates. + + Each element of the list is a tuple with three items: + + * The first is a name for the world object this world array + corresponds to, which *must* match the string names used in + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_object_classes`. Note that names might + appear twice because two world arrays might correspond to a single + world object (e.g. a celestial coordinate might have both “ra” and + “dec” arrays, which correspond to a single sky coordinate object). + + * The second element is either a string keyword argument name or a + positional index for the corresponding class from + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_object_classes`. + + * The third argument is a string giving the name of the property + to access on the corresponding class from + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_object_classes` in order to get numerical + values. + + See the document + `APE 14: A shared Python interface for World Coordinate Systems + `_ for examples. + """ + + @property + @abc.abstractmethod + def world_axis_object_classes(self): + """ + A dictionary giving information on constructing high-level objects for + the world coordinates. + + Each key of the dictionary is a string key from + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_object_components`, and each value is a + tuple with three elements: + + * The first element of the tuple must be a class or a string specifying + the fully-qualified name of a class, which will specify the actual + Python object to be created. + + * The second element, should be a tuple specifying the positional + arguments required to initialize the class. If + `~astropy.wcs.wcsapi.BaseLowLevelWCS.world_axis_object_components` specifies that the + world coordinates should be passed as a positional argument, this this + tuple should include `None` placeholders for the world coordinates. + + * The last tuple element must be a dictionary with the keyword + arguments required to initialize the class. + + Note that we don't require the classes to be Astropy classes since there + is no guarantee that Astropy will have all the classes to represent all + kinds of world coordinates. Furthermore, we recommend that the output be + kept as human-readable as possible. + + The classes used here should have the ability to do conversions by + passing an instance as the first argument to the same class with + different arguments (e.g. ``Time(Time(...), scale='tai')``). This is + a requirement for the implementation of the high-level interface. + + The second and third tuple elements for each value of this dictionary + can in turn contain either instances of classes, or if necessary can + contain serialized versions that should take the same form as the main + classes described above (a tuple with three elements with the fully + qualified name of the class, then the positional arguments and the + keyword arguments). For low-level API objects implemented in Python, we + recommend simply returning the actual objects (not the serialized form) + for optimal performance. Implementations should either always or never + use serialized classes to represent Python objects, and should indicate + which of these they follow using the + `~astropy.wcs.wcsapi.BaseLowLevelWCS.serialized_classes` attribute. + + See the document + `APE 14: A shared Python interface for World Coordinate Systems + `_ for examples . + """ + + # The following three properties have default fallback implementations, so + # they are not abstract. + + @property + def array_shape(self): + """ + The shape of the data that the WCS applies to as a tuple of length + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` in ``(row, column)`` + order (the convention for arrays in Python). + + If the WCS is valid in the context of a dataset with a particular + shape, then this property can be used to store the shape of the + data. This can be used for example if implementing slicing of WCS + objects. This is an optional property, and it should return `None` + if a shape is not known or relevant. + """ + return None + + @property + def pixel_shape(self): + """ + The shape of the data that the WCS applies to as a tuple of length + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` in ``(x, y)`` + order (where for an image, ``x`` is the horizontal coordinate and ``y`` + is the vertical coordinate). + + If the WCS is valid in the context of a dataset with a particular + shape, then this property can be used to store the shape of the + data. This can be used for example if implementing slicing of WCS + objects. This is an optional property, and it should return `None` + if a shape is not known or relevant. + + If you are interested in getting a shape that is comparable to that of + a Numpy array, you should use + `~astropy.wcs.wcsapi.BaseLowLevelWCS.array_shape` instead. + """ + return None + + @property + def pixel_bounds(self): + """ + The bounds (in pixel coordinates) inside which the WCS is defined, + as a list with `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim` ``(min, max)`` tuples. + + The bounds should be given in ``[(xmin, xmax), (ymin, ymax)]`` + order. WCS solutions are sometimes only guaranteed to be accurate + within a certain range of pixel values, for example when defining a + WCS that includes fitted distortions. This is an optional property, + and it should return `None` if a shape is not known or relevant. + """ + return None + + @property + def axis_correlation_matrix(self): + """ + Returns an (`~astropy.wcs.wcsapi.BaseLowLevelWCS.world_n_dim`, + `~astropy.wcs.wcsapi.BaseLowLevelWCS.pixel_n_dim`) matrix that indicates using booleans + whether a given world coordinate depends on a given pixel coordinate. + + This defaults to a matrix where all elements are `True` in the absence of + any further information. For completely independent axes, the diagonal + would be `True` and all other entries `False`. + """ + return np.ones((self.world_n_dim, self.pixel_n_dim), dtype=bool) + + @property + def serialized_classes(self): + """ + Indicates whether Python objects are given in serialized form or as + actual Python objects. + """ + return False + + def __str__(self): + + # Overall header + + s = '{0} Transformation\n\n'.format(self.__class__.__name__) + s += ('This transformation has {0} pixel and {1} world dimensions\n\n' + .format(self.pixel_n_dim, self.world_n_dim)) + s += 'Array shape (Numpy order): {0}\n\n'.format(self.array_shape) + + # Pixel dimensions table + + array_shape = self.array_shape or (0,) + pixel_shape = self.pixel_shape or (None,) * self.pixel_n_dim + + # Find largest between header size and value length + pixel_dim_width = max(9, len(str(self.pixel_n_dim))) + pixel_siz_width = max(9, len(str(max(array_shape)))) + + s += (('{0:' + str(pixel_dim_width) + 's}').format('Pixel Dim') + ' ' + + ('{0:' + str(pixel_siz_width) + 's}').format('Data size') + ' ' + + 'Bounds\n') + + for ipix in range(self.pixel_n_dim): + s += (('{0:' + str(pixel_dim_width) + 'd}').format(ipix) + ' ' + + (" "*5 + str(None) if pixel_shape[ipix] is None else + ('{0:' + str(pixel_siz_width) + 'd}').format(pixel_shape[ipix])) + ' ' + + '{0:s}'.format(str(None if self.pixel_bounds is None else self.pixel_bounds[ipix]) + '\n')) + + s += '\n' + + # World dimensions table + + # Find largest between header size and value length + world_dim_width = max(9, len(str(self.world_n_dim))) + world_typ_width = max(13, max(len(x) if x is not None else 0 for x in self.world_axis_physical_types)) + + s += (('{0:' + str(world_dim_width) + 's}').format('World Dim') + ' ' + + ('{0:' + str(world_typ_width) + 's}').format('Physical Type') + ' ' + + 'Units\n') + + for iwrl in range(self.world_n_dim): + + if self.world_axis_physical_types[iwrl] is not None: + s += (('{0:' + str(world_dim_width) + 'd}').format(iwrl) + ' ' + + ('{0:' + str(world_typ_width) + 's}').format(self.world_axis_physical_types[iwrl]) + ' ' + + '{0:s}'.format(self.world_axis_units[iwrl] + '\n')) + else: + s += (('{0:' + str(world_dim_width) + 'd}').format(iwrl) + ' ' + + ('{0:' + str(world_typ_width) + 's}').format('None') + ' ' + + '{0:s}'.format('unknown' + '\n')) + s += '\n' + + # Axis correlation matrix + + pixel_dim_width = max(3, len(str(self.world_n_dim))) + + s += 'Correlation between pixel and world axes:\n\n' + + s += (' ' * world_dim_width + ' ' + + ('{0:^' + str(self.pixel_n_dim * 5 - 2) + 's}').format('Pixel Dim') + + '\n') + + s += (('{0:' + str(world_dim_width) + 's}').format('World Dim') + + ''.join([' ' + ('{0:' + str(pixel_dim_width) + 'd}').format(ipix) + for ipix in range(self.pixel_n_dim)]) + + '\n') + + matrix = self.axis_correlation_matrix + matrix_str = np.empty(matrix.shape, dtype='U3') + matrix_str[matrix] = 'yes' + matrix_str[~matrix] = 'no' + + for iwrl in range(self.world_n_dim): + s += (('{0:' + str(world_dim_width) + 'd}').format(iwrl) + + ''.join([' ' + ('{0:>' + str(pixel_dim_width) + 's}').format(matrix_str[iwrl, ipix]) + for ipix in range(self.pixel_n_dim)]) + + '\n') + + # Make sure we get rid of the extra whitespace at the end of some lines + return '\n'.join([l.rstrip() for l in s.splitlines()]) + + __repr__ = __str__ + + +UCDS_FILE = os.path.join(os.path.dirname(__file__), 'data', 'ucds.txt') +with open(UCDS_FILE) as f: + VALID_UCDS = set([x.strip() for x in f.read().splitlines()[1:]]) + + +def validate_physical_types(physical_types): + """ + Validate a list of physical types against the UCD1+ standard + """ + for physical_type in physical_types: + if (physical_type is not None and + physical_type not in VALID_UCDS and + not physical_type.startswith('custom:')): + raise ValueError("Invalid physical type: {0}".format(physical_type)) diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/sliced_low_level_wcs.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/sliced_low_level_wcs.py new file mode 100644 index 0000000000000000000000000000000000000000..d67bfab8d449e5e0d3895e4d10fbdc55e361a8a2 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/sliced_low_level_wcs.py @@ -0,0 +1,157 @@ +import numbers +import numpy as np +from astropy.wcs.wcsapi import BaseLowLevelWCS + +__all__ = ['sanitize_slices', 'SlicedLowLevelWCS'] + + +def sanitize_slices(slices, ndim): + """ + Given a set of input + """ + + if not isinstance(slices, (tuple, list)): # We just have a single int + slices = (slices,) + + slices = list(slices) + + if Ellipsis in slices: + if slices.count(Ellipsis) > 1: + raise IndexError("an index can only have a single ellipsis ('...')") + + # Replace the Ellipsis with the correct number of slice(None)s + e_ind = slices.index(Ellipsis) + slices.remove(Ellipsis) + n_e = ndim - len(slices) + for i in range(n_e): + ind = e_ind + i + slices.insert(ind, slice(None)) + + for i in range(ndim): + if i < len(slices): + slc = slices[i] + if isinstance(slc, slice): + if slc.step and slc.step != 1: + raise ValueError("Slicing WCS with a step is not supported.") + elif not isinstance(slc, numbers.Integral): + raise ValueError("Only integer or range slices are accepted.") + else: + slices.append(slice(None)) + + return slices + + +class SlicedLowLevelWCS(BaseLowLevelWCS): + + def __init__(self, wcs, slices): + + self._wcs = wcs + self._slices_array = sanitize_slices(slices, self._wcs.pixel_n_dim) + self._slices_pixel = self._slices_array[::-1] + + # figure out which pixel dimensions have been kept, then use axis correlation + # matrix to figure out which world dims are kept + self._pixel_keep = np.nonzero([not isinstance(self._slices_pixel[ip], numbers.Integral) + for ip in range(self._wcs.pixel_n_dim)])[0] + + # axis_correlation_matrix[world, pixel] + self._world_keep = np.nonzero( + self._wcs.axis_correlation_matrix[:, self._pixel_keep].any(axis=1))[0] + + @property + def pixel_n_dim(self): + return len(self._pixel_keep) + + @property + def world_n_dim(self): + return len(self._world_keep) + + @property + def world_axis_physical_types(self): + return [self._wcs.world_axis_physical_types[i] for i in self._world_keep] + + @property + def world_axis_units(self): + return [self._wcs.world_axis_units[i] for i in self._world_keep] + + def pixel_to_world_values(self, *pixel_arrays): + pixel_arrays_new = [] + ipix_curr = -1 + for ipix in range(self._wcs.pixel_n_dim): + if isinstance(self._slices_pixel[ipix], int): + pixel_arrays_new.append(self._slices_pixel[ipix]) + else: + ipix_curr += 1 + if self._slices_pixel[ipix].start is not None: + pixel_arrays_new.append(pixel_arrays[ipix_curr] + self._slices_pixel[ipix].start) + else: + pixel_arrays_new.append(pixel_arrays[ipix_curr]) + + world_arrays = self._wcs.pixel_to_world_values(*pixel_arrays_new) + return [world_arrays[iw] for iw in self._world_keep] + + def array_index_to_world_values(self, *index_arrays): + return self.pixel_to_world_values(*index_arrays[::-1]) + + def world_to_pixel_values(self, *world_arrays): + world_arrays_new = [] + iworld_curr = -1 + for iworld in range(self._wcs.world_n_dim): + if iworld in self._world_keep: + iworld_curr += 1 + world_arrays_new.append(world_arrays[iworld_curr]) + else: + world_arrays_new.append(1.) + + pixel_arrays = list(self._wcs.world_to_pixel_values(*world_arrays_new)) + + for ipixel in range(self._wcs.pixel_n_dim): + if isinstance(self._slices_pixel[ipixel], slice) and self._slices_pixel[ipixel].start is not None: + pixel_arrays[ipixel] -= self._slices_pixel[ipixel].start + + return [pixel_arrays[ip] for ip in self._pixel_keep] + + def world_to_array_index_values(self, *world_arrays): + pixel_arrays = self.world_to_pixel_values(*world_arrays, 0)[::-1] + array_indices = tuple(np.asarray(np.floor(pixel + 0.5), dtype=np.int) for pixel in pixel_arrays) + return array_indices + + @property + def world_axis_object_components(self): + return [self._wcs.world_axis_object_components[idx] for idx in self._world_keep] + + @property + def world_axis_object_classes(self): + keys_keep = [item[0] for item in self.world_axis_object_components] + return dict([item for item in self._wcs.world_axis_object_classes.items() if item[0] in keys_keep]) + + @property + def array_shape(self): + if self._wcs.array_shape: + return np.broadcast_to(0, self._wcs.array_shape)[tuple(self._slices_array)].shape + + @property + def pixel_shape(self): + if self.array_shape: + return self.array_shape[::-1] + + @property + def pixel_bounds(self): + + if self._wcs.pixel_bounds is None: + return None + + bounds = [] + for idx in self._pixel_keep: + if self._slices_pixel[idx].start is None: + bounds.append(self._wcs.pixel_bounds[idx]) + else: + imin, imax = self._wcs.pixel_bounds[idx] + start = self._slices_pixel[idx].start + bounds.append((imin - start, imax - start)) + + return bounds + + @property + def axis_correlation_matrix(self): + return self._wcs.axis_correlation_matrix[self._world_keep][:,self._pixel_keep] diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/__init__.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_fitswcs.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_fitswcs.py new file mode 100644 index 0000000000000000000000000000000000000000..ad60e4541e7711307a90bb50235cc7630d0dd2fc --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_fitswcs.py @@ -0,0 +1,548 @@ +# Note that we test the main astropy.wcs.WCS class directly rather than testing +# the mix-in class on its own (since it's not functional without being used as +# a mix-in) + +import warnings + +import numpy as np +import pytest +from numpy.testing import assert_equal, assert_allclose + +from astropy import units as u +from astropy.tests.helper import assert_quantity_allclose +from astropy.units import Quantity +from astropy.coordinates import ICRS, FK5, Galactic, SkyCoord +from astropy.io.fits import Header +from astropy.utils.data import get_pkg_data_filename +from astropy.wcs.wcs import WCS +from astropy.wcs.wcsapi.fitswcs import custom_ctype_to_ucd_mapping + +############################################################################### +# The following example is the simplest WCS with default values +############################################################################### + + +WCS_EMPTY = WCS(naxis=1) +WCS_EMPTY.wcs.crpix = [1] + + +def test_empty(): + + wcs = WCS_EMPTY + + # Low-level API + + assert wcs.pixel_n_dim == 1 + assert wcs.world_n_dim == 1 + assert wcs.array_shape is None + assert wcs.pixel_shape is None + assert wcs.world_axis_physical_types == [None] + assert wcs.world_axis_units == [''] + + assert_equal(wcs.axis_correlation_matrix, True) + + assert wcs.world_axis_object_components == [('world', 0, 'value')] + + assert wcs.world_axis_object_classes['world'][0] is Quantity + assert wcs.world_axis_object_classes['world'][1] == () + assert wcs.world_axis_object_classes['world'][2]['unit'] is u.one + + assert_allclose(wcs.pixel_to_world_values(29), 29) + assert_allclose(wcs.array_index_to_world_values(29), 29) + + assert np.ndim(wcs.pixel_to_world_values(29)) == 0 + assert np.ndim(wcs.array_index_to_world_values(29)) == 0 + + assert_allclose(wcs.world_to_pixel_values(29), 29) + assert_equal(wcs.world_to_array_index_values(29), (29,)) + + assert np.ndim(wcs.world_to_pixel_values(29)) == 0 + assert np.ndim(wcs.world_to_array_index_values(29)) == 0 + + # High-level API + + coord = wcs.pixel_to_world(29) + assert_quantity_allclose(coord, 29 * u.one) + assert np.ndim(coord) == 0 + + coord = wcs.array_index_to_world(29) + assert_quantity_allclose(coord, 29 * u.one) + assert np.ndim(coord) == 0 + + coord = 15 * u.one + + x = wcs.world_to_pixel(coord) + assert_allclose(x, 15.) + assert np.ndim(x) == 0 + + i = wcs.world_to_array_index(coord) + assert_equal(i, 15) + assert np.ndim(i) == 0 + + +############################################################################### +# The following example is a simple 2D image with celestial coordinates +############################################################################### + +HEADER_SIMPLE_CELESTIAL = """ +WCSAXES = 2 +CTYPE1 = RA---TAN +CTYPE2 = DEC--TAN +CRVAL1 = 10 +CRVAL2 = 20 +CRPIX1 = 30 +CRPIX2 = 40 +CDELT1 = -0.1 +CDELT2 = 0.1 +CROTA2 = 0. +CUNIT1 = deg +CUNIT2 = deg +""" + +WCS_SIMPLE_CELESTIAL = WCS(Header.fromstring(HEADER_SIMPLE_CELESTIAL, sep='\n')) + + +def test_simple_celestial(): + + wcs = WCS_SIMPLE_CELESTIAL + + # Low-level API + + assert wcs.pixel_n_dim == 2 + assert wcs.world_n_dim == 2 + assert wcs.array_shape is None + assert wcs.pixel_shape is None + assert wcs.world_axis_physical_types == ['pos.eq.ra', 'pos.eq.dec'] + assert wcs.world_axis_units == ['deg', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, True) + + assert wcs.world_axis_object_components == [('celestial', 0, 'spherical.lon.degree'), + ('celestial', 1, 'spherical.lat.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], ICRS) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert_allclose(wcs.pixel_to_world_values(29, 39), (10, 20)) + assert_allclose(wcs.array_index_to_world_values(39, 29), (10, 20)) + + assert_allclose(wcs.world_to_pixel_values(10, 20), (29., 39.)) + assert_equal(wcs.world_to_array_index_values(10, 20), (39, 29)) + + # High-level API + + coord = wcs.pixel_to_world(29, 39) + assert isinstance(coord, SkyCoord) + assert isinstance(coord.frame, ICRS) + assert coord.ra.deg == 10 + assert coord.dec.deg == 20 + + coord = wcs.array_index_to_world(39, 29) + assert isinstance(coord, SkyCoord) + assert isinstance(coord.frame, ICRS) + assert coord.ra.deg == 10 + assert coord.dec.deg == 20 + + coord = SkyCoord(10, 20, unit='deg', frame='icrs') + + x, y = wcs.world_to_pixel(coord) + assert_allclose(x, 29.) + assert_allclose(y, 39.) + + i, j = wcs.world_to_array_index(coord) + assert_equal(i, 39) + assert_equal(j, 29) + + # Check that if the coordinates are passed in a different frame things still + # work properly + + coord_galactic = coord.galactic + + x, y = wcs.world_to_pixel(coord_galactic) + assert_allclose(x, 29.) + assert_allclose(y, 39.) + + i, j = wcs.world_to_array_index(coord_galactic) + assert_equal(i, 39) + assert_equal(j, 29) + + # Check that we can actually index the array + + data = np.arange(3600).reshape((60, 60)) + + coord = SkyCoord(10, 20, unit='deg', frame='icrs') + index = wcs.world_to_array_index(coord) + assert_equal(data[index], 2369) + + coord = SkyCoord([10, 12], [20, 22], unit='deg', frame='icrs') + index = wcs.world_to_array_index(coord) + assert_equal(data[index], [2369, 3550]) + + +############################################################################### +# The following example is a spectral cube with axes in an unusual order +############################################################################### + +HEADER_SPECTRAL_CUBE = """ +WCSAXES = 3 +CTYPE1 = GLAT-CAR +CTYPE2 = FREQ +CTYPE3 = GLON-CAR +CRVAL1 = 10 +CRVAL2 = 20 +CRVAL3 = 25 +CRPIX1 = 30 +CRPIX2 = 40 +CRPIX3 = 45 +CDELT1 = -0.1 +CDELT2 = 0.5 +CDELT3 = 0.1 +CUNIT1 = deg +CUNIT2 = Hz +CUNIT3 = deg +""" + +WCS_SPECTRAL_CUBE = WCS(Header.fromstring(HEADER_SPECTRAL_CUBE, sep='\n')) + + +def test_spectral_cube(): + + # Spectral cube with a weird axis ordering + + wcs = WCS_SPECTRAL_CUBE + + # Low-level API + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape is None + assert wcs.pixel_shape is None + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(29, 39, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39, 29), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (29., 39., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 39, 29)) + + # High-level API + + coord, spec = wcs.pixel_to_world(29, 39, 44) + assert isinstance(coord, SkyCoord) + assert isinstance(coord.frame, Galactic) + assert coord.l.deg == 25 + assert coord.b.deg == 10 + assert isinstance(spec, Quantity) + assert spec.to_value(u.Hz) == 20 + + coord, spec = wcs.array_index_to_world(44, 39, 29) + assert isinstance(coord, SkyCoord) + assert isinstance(coord.frame, Galactic) + assert coord.l.deg == 25 + assert coord.b.deg == 10 + assert isinstance(spec, Quantity) + assert spec.to_value(u.Hz) == 20 + + coord = SkyCoord(25, 10, unit='deg', frame='galactic') + spec = 20 * u.Hz + + x, y, z = wcs.world_to_pixel(coord, spec) + assert_allclose(x, 29.) + assert_allclose(y, 39.) + assert_allclose(z, 44.) + + # Order of world coordinates shouldn't matter + x, y, z = wcs.world_to_pixel(spec, coord) + assert_allclose(x, 29.) + assert_allclose(y, 39.) + assert_allclose(z, 44.) + + i, j, k = wcs.world_to_array_index(coord, spec) + assert_equal(i, 44) + assert_equal(j, 39) + assert_equal(k, 29) + + # Order of world coordinates shouldn't matter + i, j, k = wcs.world_to_array_index(spec, coord) + assert_equal(i, 44) + assert_equal(j, 39) + assert_equal(k, 29) + + +HEADER_SPECTRAL_CUBE_NONALIGNED = HEADER_SPECTRAL_CUBE.strip() + '\n' + """ +PC2_3 = -0.5 +PC3_2 = +0.5 +""" + +WCS_SPECTRAL_CUBE_NONALIGNED = WCS(Header.fromstring(HEADER_SPECTRAL_CUBE_NONALIGNED, sep='\n')) + + +def test_spectral_cube_nonaligned(): + + # Make sure that correlation matrix gets adjusted if there are non-identity + # CD matrix terms. + + wcs = WCS_SPECTRAL_CUBE_NONALIGNED + + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, True, True], [False, True, True], [True, True, True]]) + + # NOTE: we check world_axis_object_components and world_axis_object_classes + # again here because in the past this failed when non-aligned axes were + # present, so this serves as a regression test. + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + +############################################################################### +# The following example is from Rots et al (2015), Table 5. It represents a +# cube with two spatial dimensions and one time dimension +############################################################################### + +HEADER_TIME_CUBE = """ +SIMPLE = T / Fits standard +BITPIX = -32 / Bits per pixel +NAXIS = 3 / Number of axes +NAXIS1 = 2048 / Axis length +NAXIS2 = 2048 / Axis length +NAXIS3 = 11 / Axis length +DATE = '2008-10-28T14:39:06' / Date FITS file was generated +OBJECT = '2008 TC3' / Name of the object observed +EXPTIME = 1.0011 / Integration time +MJD-OBS = 54746.02749237 / Obs start +DATE-OBS= '2008-10-07T00:39:35.3342' / Observing date +TELESCOP= 'VISTA' / ESO Telescope Name +INSTRUME= 'VIRCAM' / Instrument used. +TIMESYS = 'UTC' / From Observatory Time System +TREFPOS = 'TOPOCENT' / Topocentric +MJDREF = 54746.0 / Time reference point in MJD +RADESYS = 'ICRS' / Not equinoctal +CTYPE2 = 'RA---ZPN' / Zenithal Polynomial Projection +CRVAL2 = 2.01824372640628 / RA at ref pixel +CUNIT2 = 'deg' / Angles are degrees always +CRPIX2 = 2956.6 / Pixel coordinate at ref point +CTYPE1 = 'DEC--ZPN' / Zenithal Polynomial Projection +CRVAL1 = 14.8289418840003 / Dec at ref pixel +CUNIT1 = 'deg' / Angles are degrees always +CRPIX1 = -448.2 / Pixel coordinate at ref point +CTYPE3 = 'UTC' / linear time (UTC) +CRVAL3 = 2375.341 / Relative time of first frame +CUNIT3 = 's' / Time unit +CRPIX3 = 1.0 / Pixel coordinate at ref point +CTYPE3A = 'TT' / alternative linear time (TT) +CRVAL3A = 2440.525 / Relative time of first frame +CUNIT3A = 's' / Time unit +CRPIX3A = 1.0 / Pixel coordinate at ref point +OBSGEO-B= -24.6157 / [deg] Tel geodetic latitute (=North)+ +OBSGEO-L= -70.3976 / [deg] Tel geodetic longitude (=East)+ +OBSGEO-H= 2530.0000 / [m] Tel height above reference ellipsoid +CRDER3 = 0.0819 / random error in timings from fit +CSYER3 = 0.0100 / absolute time error +PC1_1 = 0.999999971570892 / WCS transform matrix element +PC1_2 = 0.000238449608932 / WCS transform matrix element +PC2_1 = -0.000621542859395 / WCS transform matrix element +PC2_2 = 0.999999806842218 / WCS transform matrix element +CDELT1 = -9.48575432499806E-5 / Axis scale at reference point +CDELT2 = 9.48683176211164E-5 / Axis scale at reference point +CDELT3 = 13.3629 / Axis scale at reference point +PV1_1 = 1. / ZPN linear term +PV1_3 = 42. / ZPN cubic term +""" + +WCS_TIME_CUBE = WCS(Header.fromstring(HEADER_TIME_CUBE, sep='\n')) + + +def test_time_cube(): + + # Spectral cube with a weird axis ordering + + wcs = WCS_TIME_CUBE + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (11, 2048, 2048) + assert wcs.pixel_shape == (2048, 2048, 11) + assert wcs.world_axis_physical_types == ['pos.eq.dec', 'pos.eq.ra', 'time'] + assert wcs.world_axis_units == ['deg', 'deg', 's'] + + assert_equal(wcs.axis_correlation_matrix, [[True, True, False], [True, True, False], [False, False, True]]) + + with pytest.warns(FutureWarning): + assert wcs.world_axis_object_components == [ + ('celestial', 1, 'spherical.lat.degree'), + ('celestial', 0, 'spherical.lon.degree'), + ('utc', 0, 'value')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], ICRS) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['utc'][0] is Quantity + assert wcs.world_axis_object_classes['utc'][1] == () + assert wcs.world_axis_object_classes['utc'][2] == {'unit': 's'} + + assert_allclose(wcs.pixel_to_world_values(-449.2, 2955.6, 0), + (14.8289418840003, 2.01824372640628, 2375.341)) + + assert_allclose(wcs.array_index_to_world_values(0, 2955.6, -449.2), + (14.8289418840003, 2.01824372640628, 2375.341)) + + assert_allclose(wcs.world_to_pixel_values(14.8289418840003, 2.01824372640628, 2375.341), + (-449.2, 2955.6, 0)) + assert_equal(wcs.world_to_array_index_values(14.8289418840003, 2.01824372640628, 2375.341), + (0, 2956, -449)) + + # High-level API + + # Make sure that we get a FutureWarning about the time column + with warnings.catch_warnings(record=True) as warning_entries: + warnings.resetwarnings() + coord, time = wcs.pixel_to_world(29, 39, 44) + + # Check that there's at least one warning of the right category/message + assert len(warning_entries) > 0 + found_warning = False + for w in warning_entries: + msg = 'In future, times will be represented by the Time class' + if w.category is FutureWarning and str(w.message).startswith(msg): + found_warning = True + assert found_warning + + assert isinstance(coord, SkyCoord) + assert isinstance(time, Quantity) + +############################################################################### +# Extra corner cases +############################################################################### + + +def test_unrecognized_unit(): + # TODO: Determine whether the following behavior is desirable + wcs = WCS(naxis=1) + wcs.wcs.cunit = ['bananas // sekonds'] + assert wcs.world_axis_units == ['bananas // sekonds'] + + +def test_distortion_correlations(): + + filename = get_pkg_data_filename('../../tests/data/sip.fits') + w = WCS(filename) + assert_equal(w.axis_correlation_matrix, True) + + # Changing PC to an identity matrix doesn't change anything since + # distortions are still present. + w.wcs.pc = [[1, 0], [0, 1]] + assert_equal(w.axis_correlation_matrix, True) + + # Nor does changing the name of the axes to make them non-celestial + w.wcs.ctype = ['X', 'Y'] + assert_equal(w.axis_correlation_matrix, True) + + # However once we turn off the distortions the matrix changes + w.sip = None + assert_equal(w.axis_correlation_matrix, [[True, False], [False, True]]) + + # If we go back to celestial coordinates then the matrix is all True again + w.wcs.ctype = ['RA---TAN', 'DEC--TAN'] + assert_equal(w.axis_correlation_matrix, True) + + # Or if we change to X/Y but have a non-identity PC + w.wcs.pc = [[0.9, -0.1], [0.1, 0.9]] + w.wcs.ctype = ['X', 'Y'] + assert_equal(w.axis_correlation_matrix, True) + + +def test_custom_ctype_to_ucd_mappings(): + + wcs = WCS(naxis=1) + wcs.wcs.ctype = ['SPAM'] + + assert wcs.world_axis_physical_types == [None] + + # Check simple behavior + + with custom_ctype_to_ucd_mapping({'APPLE': 'food.fruit'}): + assert wcs.world_axis_physical_types == [None] + + with custom_ctype_to_ucd_mapping({'APPLE': 'food.fruit', 'SPAM': 'food.spam'}): + assert wcs.world_axis_physical_types == ['food.spam'] + + # Check nesting + + with custom_ctype_to_ucd_mapping({'SPAM': 'food.spam'}): + with custom_ctype_to_ucd_mapping({'APPLE': 'food.fruit'}): + assert wcs.world_axis_physical_types == ['food.spam'] + + with custom_ctype_to_ucd_mapping({'APPLE': 'food.fruit'}): + with custom_ctype_to_ucd_mapping({'SPAM': 'food.spam'}): + assert wcs.world_axis_physical_types == ['food.spam'] + + # Check priority in nesting + + with custom_ctype_to_ucd_mapping({'SPAM': 'notfood'}): + with custom_ctype_to_ucd_mapping({'SPAM': 'food.spam'}): + assert wcs.world_axis_physical_types == ['food.spam'] + + with custom_ctype_to_ucd_mapping({'SPAM': 'food.spam'}): + with custom_ctype_to_ucd_mapping({'SPAM': 'notfood'}): + assert wcs.world_axis_physical_types == ['notfood'] + + +def test_caching_components_and_classes(): + + # Make sure that when we change the WCS object, the classes and components + # are updated (we use a cache internally, so we need to make sure the cache + # is invalidated if needed) + + wcs = WCS_SIMPLE_CELESTIAL + + assert wcs.world_axis_object_components == [('celestial', 0, 'spherical.lon.degree'), + ('celestial', 1, 'spherical.lat.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], ICRS) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + wcs.wcs.radesys = 'FK5' + + frame = wcs.world_axis_object_classes['celestial'][2]['frame'] + assert isinstance(frame, FK5) + assert frame.equinox.jyear == 2000. + + wcs.wcs.equinox = 2010 + + frame = wcs.world_axis_object_classes['celestial'][2]['frame'] + assert isinstance(frame, FK5) + assert frame.equinox.jyear == 2010. diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_api.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_api.py new file mode 100644 index 0000000000000000000000000000000000000000..7748d24598af9db9eec6a090cdb1546f7501d92e --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_api.py @@ -0,0 +1,180 @@ +import numpy as np +from numpy.testing import assert_allclose + +from astropy.units import Quantity +from astropy.coordinates import SkyCoord + +from astropy.wcs.wcsapi.low_level_api import BaseLowLevelWCS +from astropy.wcs.wcsapi.high_level_api import HighLevelWCSMixin + + +class DoubleLowLevelWCS(BaseLowLevelWCS): + """ + Basic dummy transformation that doubles values. + """ + + def pixel_to_world_values(self, *pixel_arrays): + return [np.asarray(pix) * 2 for pix in pixel_arrays] + + def array_index_to_world_values(self, *index_arrays): + return [np.asarray(pix) * 2 for pix in index_arrays] + + def world_to_pixel_values(self, *world_arrays): + return [np.asarray(world) / 2 for world in world_arrays] + + def world_to_array_index_values(self, *world_arrays): + return [np.asarray(world) / 2 for world in world_arrays] + + +class SimpleDuplicateWCS(DoubleLowLevelWCS, HighLevelWCSMixin): + """ + This example WCS has two of the world coordinates that use the same class, + which triggers a different path in the high level WCS code. + """ + + @property + def pixel_n_dim(self): + return 2 + + @property + def world_n_dim(self): + return 2 + + @property + def world_axis_physical_types(self): + return ['pos.eq.ra', 'pos.eq.dec'] + + @property + def world_axis_units(self): + return ['deg', 'deg'] + + @property + def world_axis_object_components(self): + return [('test1', 0, 'value'), + ('test2', 0, 'value')] + + @property + def world_axis_object_classes(self): + return {'test1': (Quantity, (), {'unit': 'deg'}), + 'test2': (Quantity, (), {'unit': 'deg'})} + + +def test_simple_duplicate(): + + # Make sure that things work properly when the low-level WCS uses the same + # class for two of the coordinates. + + wcs = SimpleDuplicateWCS() + q1, q2 = wcs.pixel_to_world(1, 2) + + assert isinstance(q1, Quantity) + assert isinstance(q2, Quantity) + + x, y = wcs.world_to_pixel(q1, q2) + + assert_allclose(x, 1) + assert_allclose(y, 2) + + + +class SkyCoordDuplicateWCS(DoubleLowLevelWCS, HighLevelWCSMixin): + """ + This example WCS returns two SkyCoord objects which, which triggers a + different path in the high level WCS code. + """ + + @property + def pixel_n_dim(self): + return 4 + + @property + def world_n_dim(self): + return 4 + + @property + def world_axis_physical_types(self): + return ['pos.eq.ra', 'pos.eq.dec', 'pos.galactic.lon', 'pos.galactic.lat'] + + @property + def world_axis_units(self): + return ['deg', 'deg', 'deg', 'deg'] + + @property + def world_axis_object_components(self): + # Deliberately use 'ra'/'dec' here to make sure that string argument + # names work properly. + return [('test1', 'ra', 'spherical.lon.degree'), + ('test1', 'dec', 'spherical.lat.degree'), + ('test2', 0, 'spherical.lon.degree'), + ('test2', 1, 'spherical.lat.degree')] + + @property + def world_axis_object_classes(self): + return {'test1': (SkyCoord, (), {'unit': 'deg'}), + 'test2': (SkyCoord, (), {'unit': 'deg', 'frame': 'galactic'})} + + +def test_skycoord_duplicate(): + + # Make sure that things work properly when the low-level WCS uses the same + # class, and specifically a SkyCoord for two of the coordinates. + + wcs = SkyCoordDuplicateWCS() + c1, c2 = wcs.pixel_to_world(1, 2, 3, 4) + + assert isinstance(c1, SkyCoord) + assert isinstance(c2, SkyCoord) + + x, y, z, a = wcs.world_to_pixel(c1, c2) + + assert_allclose(x, 1) + assert_allclose(y, 2) + assert_allclose(z, 3) + assert_allclose(a, 4) + + +class SerializedWCS(DoubleLowLevelWCS, HighLevelWCSMixin): + """ + WCS with serialized classes + """ + + @property + def serialized_classes(self): + return True + + @property + def pixel_n_dim(self): + return 2 + + @property + def world_n_dim(self): + return 2 + + @property + def world_axis_physical_types(self): + return ['pos.eq.ra', 'pos.eq.dec'] + + @property + def world_axis_units(self): + return ['deg', 'deg'] + + @property + def world_axis_object_components(self): + return [('test', 0, 'value')] + + @property + def world_axis_object_classes(self): + return {'test': ('astropy.units.Quantity', (), + {'unit': ('astropy.units.Unit', ('deg',), {})})} + + +def test_serialized_classes(): + + wcs = SerializedWCS() + q = wcs.pixel_to_world(1) + + assert isinstance(q, Quantity) + + x = wcs.world_to_pixel(q) + + assert_allclose(x, 1) diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_wcs_wrapper.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_wcs_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..7b4e233bec676403347ee52560001c8599955d2f --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_high_level_wcs_wrapper.py @@ -0,0 +1,89 @@ +import pytest +import numpy as np +from numpy.testing import assert_allclose + +from astropy.coordinates import SkyCoord + +from astropy.wcs.wcsapi.low_level_api import BaseLowLevelWCS +from astropy.wcs.wcsapi.high_level_wcs_wrapper import HighLevelWCSWrapper + + +class CustomLowLevelWCS(BaseLowLevelWCS): + + @property + def pixel_n_dim(self): + return 2 + + @property + def world_n_dim(self): + return 2 + + @property + def world_axis_physical_types(self): + return ['pos.eq.ra', 'pos.eq.dec'] + + @property + def world_axis_units(self): + return ['deg', 'deg'] + + def pixel_to_world_values(self, *pixel_arrays): + return [np.asarray(pix) * 2 for pix in pixel_arrays] + + def array_index_to_world_values(self, *index_arrays): + return [np.asarray(pix) * 2 for pix in index_arrays] + + def world_to_pixel_values(self, *world_arrays): + return [np.asarray(world) / 2 for world in world_arrays] + + def world_to_array_index_values(self, *world_arrays): + return [np.asarray(world) / 2 for world in world_arrays] + + @property + def world_axis_object_components(self): + return [('test', 0, 'spherical.lon.degree'), + ('test', 1, 'spherical.lat.degree')] + + @property + def world_axis_object_classes(self): + return {'test': (SkyCoord, (), {'unit': 'deg'})} + + +def test_wrapper(): + + wcs = CustomLowLevelWCS() + + wrapper = HighLevelWCSWrapper(wcs) + + coord = wrapper.pixel_to_world(1, 2) + + assert isinstance(coord, SkyCoord) + assert coord.isscalar + + x, y = wrapper.world_to_pixel(coord) + + assert_allclose(x, 1) + assert_allclose(y, 2) + + assert wrapper.low_level_wcs is wcs + assert wrapper.pixel_n_dim == 2 + assert wrapper.world_n_dim == 2 + assert wrapper.world_axis_physical_types == ['pos.eq.ra', 'pos.eq.dec'] + assert wrapper.world_axis_units == ['deg', 'deg'] + assert wrapper.array_shape is None + assert wrapper.pixel_bounds is None + assert wrapper.axis_correlation_matrix is None + + +def test_wrapper_invalid(): + + class InvalidCustomLowLevelWCS(CustomLowLevelWCS): + @property + def world_axis_object_classes(self): + return {} + + wcs = InvalidCustomLowLevelWCS() + + wrapper = HighLevelWCSWrapper(wcs) + + with pytest.raises(KeyError): + wrapper.pixel_to_world(1, 2) diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_low_level_api.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_low_level_api.py new file mode 100644 index 0000000000000000000000000000000000000000..55b2878059a6ad55579109f1db44c3c5ddc8e992 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_low_level_api.py @@ -0,0 +1,21 @@ +from pytest import raises + +from astropy.wcs.wcsapi.low_level_api import validate_physical_types + + +def test_validate_physical_types(): + + # Check valid cases + validate_physical_types(['pos.eq.ra', 'pos.eq.ra']) + validate_physical_types(['spect.dopplerVeloc.radio', 'custom:spam']) + validate_physical_types(['time', None]) + + # Make sure validation is case sensitive + with raises(ValueError) as exc: + validate_physical_types(['pos.eq.ra', 'Pos.eq.dec']) + assert exc.value.args[0] == 'Invalid physical type: Pos.eq.dec' + + # Make sure nonsense types are picked up + with raises(ValueError) as exc: + validate_physical_types(['spam']) + assert exc.value.args[0] == 'Invalid physical type: spam' diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_sliced_low_level_wcs.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_sliced_low_level_wcs.py new file mode 100644 index 0000000000000000000000000000000000000000..9ff2374a89568ed2479f2ab394aa653e887bec77 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_sliced_low_level_wcs.py @@ -0,0 +1,604 @@ +import pytest + +from numpy.testing import assert_equal, assert_allclose +from astropy.wcs import WCS +from astropy.io.fits import Header +from astropy.coordinates import SkyCoord, Galactic +from astropy.units import Quantity +from astropy.wcs.wcsapi.sliced_low_level_wcs import SlicedLowLevelWCS, sanitize_slices +import astropy.units as u + +# To test the slicing we start off from standard FITS WCS +# objects since those implement the low-level API. We create +# a WCS for a spectral cube with axes in non-standard order +# and with correlated celestial axes and an uncorrelated +# spectral axis. + +HEADER_SPECTRAL_CUBE = """ +NAXIS = 3 +NAXIS1 = 10 +NAXIS2 = 20 +NAXIS3 = 30 +CTYPE1 = GLAT-CAR +CTYPE2 = FREQ +CTYPE3 = GLON-CAR +CRVAL1 = 10 +CRVAL2 = 20 +CRVAL3 = 25 +CRPIX1 = 30 +CRPIX2 = 40 +CRPIX3 = 45 +CDELT1 = -0.1 +CDELT2 = 0.5 +CDELT3 = 0.1 +CUNIT1 = deg +CUNIT2 = Hz +CUNIT3 = deg +""" + +WCS_SPECTRAL_CUBE = WCS(Header.fromstring(HEADER_SPECTRAL_CUBE, sep='\n')) +WCS_SPECTRAL_CUBE.pixel_bounds = [(-1, 11), (-2, 18), (5, 15)] + + +@pytest.mark.parametrize("item, ndim, expected", ( + ([Ellipsis, 10], 4, [slice(None)] * 3 + [10]), + ([10, slice(20, 30)], 5, [10, slice(20, 30)] + [slice(None)] * 3), + ([10, Ellipsis, 8], 10, [10] + [slice(None)] * 8 + [8]) +)) +def test_sanitize_slice(item, ndim, expected): + new_item = sanitize_slices(item, ndim) + # FIXME: do we still need the first two since the third assert + # should cover it all? + assert len(new_item) == ndim + assert all(isinstance(i, (slice, int)) for i in new_item) + assert new_item == expected + + +EXPECTED_ELLIPSIS_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 20, 10) + +Pixel Dim Data size Bounds + 0 10 (-1, 11) + 1 20 (-2, 18) + 2 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + + +def test_ellipsis(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE, Ellipsis) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 20, 10) + assert wcs.pixel_shape == (10, 20, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(29, 39, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39, 29), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (29., 39., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 39, 29)) + + assert_equal(wcs.pixel_bounds, [(-1, 11), (-2, 18), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_ELLIPSIS_REPR.strip() + + +EXPECTED_SPECTRAL_SLICE_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 2 pixel and 2 world dimensions + +Array shape (Numpy order): (30, 10) + +Pixel Dim Data size Bounds + 0 10 (-1, 11) + 1 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 + 0 yes yes + 1 yes yes +""" + +def test_spectral_slice(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE, [slice(None), 10]) + + assert wcs.pixel_n_dim == 2 + assert wcs.world_n_dim == 2 + assert wcs.array_shape == (30, 10) + assert wcs.pixel_shape == (10, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, True], [True, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert_allclose(wcs.pixel_to_world_values(29, 44), (10, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 29), (10, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 25), (29., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 25), (44, 29)) + + assert_equal(wcs.pixel_bounds, [(-1, 11), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_SPECTRAL_SLICE_REPR.strip() + + +EXPECTED_SPECTRAL_RANGE_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 6, 10) + +Pixel Dim Data size Bounds + 0 10 (-1, 11) + 1 6 (-6, 14) + 2 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + + +def test_spectral_range(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE, [slice(None), slice(4, 10)]) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 6, 10) + assert wcs.pixel_shape == (10, 6, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(29, 35, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 35, 29), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (29., 35., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 35, 29)) + + assert_equal(wcs.pixel_bounds, [(-1, 11), (-6, 14), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_SPECTRAL_RANGE_REPR.strip() + + +EXPECTED_CELESTIAL_SLICE_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 2 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 20) + +Pixel Dim Data size Bounds + 0 20 (-2, 18) + 1 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 + 0 no yes + 1 yes no + 2 no yes +""" + + +def test_celestial_slice(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE, [Ellipsis, 5]) + + assert wcs.pixel_n_dim == 2 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 20) + assert wcs.pixel_shape == (20, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[False, True], [True, False], [False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(39, 44), (12.4, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39), (12.4, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(12.4, 20, 25), (39., 44.)) + assert_equal(wcs.world_to_array_index_values(12.4, 20, 25), (44, 39)) + + assert_equal(wcs.pixel_bounds, [(-2, 18), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_CELESTIAL_SLICE_REPR.strip() + + +EXPECTED_CELESTIAL_RANGE_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 20, 5) + +Pixel Dim Data size Bounds + 0 5 (-6, 6) + 1 20 (-2, 18) + 2 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + + +def test_celestial_range(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE, [Ellipsis, slice(5, 10)]) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 20, 5) + assert wcs.pixel_shape == (5, 20, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(24, 39, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39, 24), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (24., 39., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 39, 24)) + + assert_equal(wcs.pixel_bounds, [(-6, 6), (-2, 18), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_CELESTIAL_RANGE_REPR.strip() + + +# Now try with a 90 degree rotation + +WCS_SPECTRAL_CUBE_ROT = WCS(Header.fromstring(HEADER_SPECTRAL_CUBE, sep='\n')) +WCS_SPECTRAL_CUBE_ROT.wcs.pc = [[0, 0, 1], [0, 1, 0], [1, 0, 0]] +WCS_SPECTRAL_CUBE_ROT.wcs.crval[0] = 0 +WCS_SPECTRAL_CUBE_ROT.pixel_bounds = [(-1, 11), (-2, 18), (5, 15)] + +EXPECTED_CELESTIAL_RANGE_ROT_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 20, 5) + +Pixel Dim Data size Bounds + 0 5 (-6, 6) + 1 20 (-2, 18) + 2 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + +def test_celestial_range_rot(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE_ROT, [Ellipsis, slice(5, 10)]) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 20, 5) + assert wcs.pixel_shape == (5, 20, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(14, 29, 34), (1, 15, 24)) + assert_allclose(wcs.array_index_to_world_values(34, 29, 14), (1, 15, 24)) + + assert_allclose(wcs.world_to_pixel_values(1, 15, 24), (14., 29., 34.)) + assert_equal(wcs.world_to_array_index_values(1, 15, 24), (34, 29, 14)) + + assert_equal(wcs.pixel_bounds, [(-6, 6), (-2, 18), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_CELESTIAL_RANGE_ROT_REPR.strip() + + +HEADER_NO_SHAPE_CUBE = """ +NAXIS = 3 +CTYPE1 = GLAT-CAR +CTYPE2 = FREQ +CTYPE3 = GLON-CAR +CRVAL1 = 10 +CRVAL2 = 20 +CRVAL3 = 25 +CRPIX1 = 30 +CRPIX2 = 40 +CRPIX3 = 45 +CDELT1 = -0.1 +CDELT2 = 0.5 +CDELT3 = 0.1 +CUNIT1 = deg +CUNIT2 = Hz +CUNIT3 = deg +""" + +WCS_NO_SHAPE_CUBE = WCS(Header.fromstring(HEADER_NO_SHAPE_CUBE, sep='\n')) + +EXPECTED_NO_SHAPE_REPR = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): None + +Pixel Dim Data size Bounds + 0 None None + 1 None None + 2 None None + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 em.freq Hz + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + + +def test_no_array_shape(): + + wcs = SlicedLowLevelWCS(WCS_NO_SHAPE_CUBE, Ellipsis) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape is None + assert wcs.pixel_shape is None + assert wcs.world_axis_physical_types == ['pos.galactic.lat', 'em.freq', 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('freq', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert wcs.world_axis_object_classes['freq'][0] is Quantity + assert wcs.world_axis_object_classes['freq'][1] == () + assert wcs.world_axis_object_classes['freq'][2] == {'unit': 'Hz'} + + assert_allclose(wcs.pixel_to_world_values(29, 39, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39, 29), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (29., 39., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 39, 29)) + + assert str(wcs) == repr(wcs) == EXPECTED_NO_SHAPE_REPR.strip() + + +# Testing the WCS object having some physical types as None/Unknown +HEADER_SPECTRAL_CUBE_NONE_TYPES = { + 'CTYPE1': 'GLAT-CAR', + 'CUNIT1': 'deg', + 'CDELT1': -0.1, + 'CRPIX1': 30, + 'CRVAL1': 10, + 'NAXIS1': 10, + 'CTYPE2': '', + 'CUNIT2': 'Hz', + 'CDELT2': 0.5, + 'CRPIX2': 40, + 'CRVAL2': 20, + 'NAXIS2': 20, + 'CTYPE3': 'GLON-CAR', + 'CUNIT3': 'deg', + 'CDELT3': 0.1, + 'CRPIX3': 45, + 'CRVAL3': 25, + 'NAXIS3': 30 +} + +WCS_SPECTRAL_CUBE_NONE_TYPES = WCS(header=HEADER_SPECTRAL_CUBE_NONE_TYPES) +WCS_SPECTRAL_CUBE_NONE_TYPES.pixel_bounds = [(-1, 11), (-2, 18), (5, 15)] + + +EXPECTED_ELLIPSIS_REPR_NONE_TYPES = """ +SlicedLowLevelWCS Transformation + +This transformation has 3 pixel and 3 world dimensions + +Array shape (Numpy order): (30, 20, 10) + +Pixel Dim Data size Bounds + 0 10 (-1, 11) + 1 20 (-2, 18) + 2 30 (5, 15) + +World Dim Physical Type Units + 0 pos.galactic.lat deg + 1 None unknown + 2 pos.galactic.lon deg + +Correlation between pixel and world axes: + + Pixel Dim +World Dim 0 1 2 + 0 yes no yes + 1 no yes no + 2 yes no yes +""" + + +def test_ellipsis_none_types(): + + wcs = SlicedLowLevelWCS(WCS_SPECTRAL_CUBE_NONE_TYPES, Ellipsis) + + assert wcs.pixel_n_dim == 3 + assert wcs.world_n_dim == 3 + assert wcs.array_shape == (30, 20, 10) + assert wcs.pixel_shape == (10, 20, 30) + assert wcs.world_axis_physical_types == ['pos.galactic.lat', None, 'pos.galactic.lon'] + assert wcs.world_axis_units == ['deg', 'Hz', 'deg'] + + assert_equal(wcs.axis_correlation_matrix, [[True, False, True], + [False, True, False], [True, False, True]]) + + assert wcs.world_axis_object_components == [('celestial', 1, 'spherical.lat.degree'), + ('world', 0, 'value'), + ('celestial', 0, 'spherical.lon.degree')] + + assert wcs.world_axis_object_classes['celestial'][0] is SkyCoord + assert wcs.world_axis_object_classes['celestial'][1] == () + assert isinstance(wcs.world_axis_object_classes['celestial'][2]['frame'], Galactic) + assert wcs.world_axis_object_classes['celestial'][2]['unit'] is u.deg + + assert_allclose(wcs.pixel_to_world_values(29, 39, 44), (10, 20, 25)) + assert_allclose(wcs.array_index_to_world_values(44, 39, 29), (10, 20, 25)) + + assert_allclose(wcs.world_to_pixel_values(10, 20, 25), (29., 39., 44.)) + assert_equal(wcs.world_to_array_index_values(10, 20, 25), (44, 39, 29)) + + assert_equal(wcs.pixel_bounds, [(-1, 11), (-2, 18), (5, 15)]) + + assert str(wcs) == repr(wcs) == EXPECTED_ELLIPSIS_REPR_NONE_TYPES.strip() diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_utils.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..02f10caa1e8c5fbb011985553e6f536d742fddbc --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/tests/test_utils.py @@ -0,0 +1,25 @@ +from pytest import raises + +from astropy.tests.helper import assert_quantity_allclose +from astropy import units as u + +from astropy.wcs.wcsapi.utils import deserialize_class + + +def test_construct(): + + result = deserialize_class(('astropy.units.Quantity', (10,), {'unit': 'deg'})) + assert_quantity_allclose(result, 10 * u.deg) + + +def test_noconstruct(): + + result = deserialize_class(('astropy.units.Quantity', (), {'unit': 'deg'}), construct=False) + assert result == (u.Quantity, (), {'unit': 'deg'}) + + +def test_invalid(): + + with raises(ValueError) as exc: + deserialize_class(('astropy.units.Quantity', (), {'unit': 'deg'}, ())) + assert exc.value.args[0] == 'Expected a tuple of three values' diff --git a/testbed/astropy__astropy/astropy/wcs/wcsapi/utils.py b/testbed/astropy__astropy/astropy/wcs/wcsapi/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..53379b993dc646aa57a45e54f4c0a676d7dfff9e --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcsapi/utils.py @@ -0,0 +1,23 @@ +import importlib + + +def deserialize_class(tpl, construct=True): + """ + Deserialize classes recursively. + """ + + if not isinstance(tpl, tuple) or len(tpl) != 3: + raise ValueError("Expected a tuple of three values") + + module, klass = tpl[0].rsplit('.', 1) + module = importlib.import_module(module) + klass = getattr(module, klass) + + args = tuple([deserialize_class(arg) if isinstance(arg, tuple) else arg for arg in tpl[1]]) + + kwargs = dict((key, deserialize_class(val)) if isinstance(val, tuple) else (key, val) for (key, val) in tpl[2].items()) + + if construct: + return klass(*args, **kwargs) + else: + return klass, args, kwargs diff --git a/testbed/astropy__astropy/astropy/wcs/wcslint.py b/testbed/astropy__astropy/astropy/wcs/wcslint.py new file mode 100644 index 0000000000000000000000000000000000000000..5dc51bddda68ce41b21d7c2afabba76a2550f588 --- /dev/null +++ b/testbed/astropy__astropy/astropy/wcs/wcslint.py @@ -0,0 +1,18 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +Script support for validating the WCS keywords in a FITS file. +""" + + +def main(args=None): + from . import wcs + import argparse + + parser = argparse.ArgumentParser( + description=("Check the WCS keywords in a FITS file for " + "compliance against the standards")) + parser.add_argument( + 'filename', nargs=1, help='Path to FITS file to check') + args = parser.parse_args(args) + + print(wcs.validate(args.filename[0])) diff --git a/testbed/astropy__astropy/cextern/.gitignore b/testbed/astropy__astropy/cextern/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..970d78fd3f93fbb7a54df3a2221757c217f7947a --- /dev/null +++ b/testbed/astropy__astropy/cextern/.gitignore @@ -0,0 +1 @@ +!*.c diff --git a/testbed/astropy__astropy/cextern/README.rst b/testbed/astropy__astropy/cextern/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..9e8caca9f3d213a77588beff963b02cd9b6f6d42 --- /dev/null +++ b/testbed/astropy__astropy/cextern/README.rst @@ -0,0 +1,8 @@ +External Packages/Libraries +=========================== + +This directory contains C libraries included with Astropy. Note that only C +libraries without python-specific code should be included in this directory. +Cython or C code intended for use with Astropy or wrapper code should be in +the Astropy source tree. + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/buffers.c b/testbed/astropy__astropy/cextern/cfitsio/lib/buffers.c new file mode 100644 index 0000000000000000000000000000000000000000..d3795e3f25005cc543ac93c831730497c9ad5be9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/buffers.c @@ -0,0 +1,1377 @@ +/* This file, buffers.c, contains the core set of FITSIO routines */ +/* that use or manage the internal set of IO buffers. */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include "fitsio2.h" + +/*--------------------------------------------------------------------------*/ +int ffmbyt(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG bytepos, /* I - byte position in file to move to */ + int err_mode, /* I - 1=ignore error, 0 = return error */ + int *status) /* IO - error status */ +{ +/* + Move to the input byte location in the file. When writing to a file, a move + may sometimes be made to a position beyond the current EOF. The err_mode + parameter determines whether such conditions should be returned as an error + or simply ignored. +*/ + long record; + + if (*status > 0) + return(*status); + + if (bytepos < 0) + return(*status = NEG_FILE_POS); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + record = (long) (bytepos / IOBUFLEN); /* zero-indexed record number */ + + /* if this is not the current record, then load it */ + if ( ((fptr->Fptr)->curbuf < 0) || + (record != (fptr->Fptr)->bufrecnum[(fptr->Fptr)->curbuf])) + ffldrc(fptr, record, err_mode, status); + + if (*status <= 0) + (fptr->Fptr)->bytepos = bytepos; /* save new file position */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpbyt(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG nbytes, /* I - number of bytes to write */ + void *buffer, /* I - buffer containing the bytes to write */ + int *status) /* IO - error status */ +/* + put (write) the buffer of bytes to the output FITS file, starting at + the current file position. Write large blocks of data directly to disk; + write smaller segments to intermediate IO buffers to improve efficiency. +*/ +{ + int ii, nbuff; + LONGLONG filepos; + long recstart, recend; + long ntodo, bufpos, nspace, nwrite; + char *cptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + if (nbytes > LONG_MAX) { + ffpmsg("Number of bytes to write is greater than LONG_MAX (ffpbyt)."); + *status = WRITE_ERROR; + return(*status); + } + + ntodo = (long) nbytes; + cptr = (char *)buffer; + + if ((fptr->Fptr)->curbuf < 0) /* no current data buffer for this file */ + { /* so reload the last one that was used */ + ffldrc(fptr, (long) (((fptr->Fptr)->bytepos) / IOBUFLEN), REPORT_EOF, status); + } + + if (nbytes >= MINDIRECT) + { + /* write large blocks of data directly to disk instead of via buffers */ + /* first, fill up the current IO buffer before flushing it to disk */ + + nbuff = (fptr->Fptr)->curbuf; /* current IO buffer number */ + filepos = (fptr->Fptr)->bytepos; /* save the write starting position */ + recstart = (fptr->Fptr)->bufrecnum[nbuff]; /* starting record */ + recend = (long) ((filepos + nbytes - 1) / IOBUFLEN); /* ending record */ + + /* bufpos is the starting position within the IO buffer */ + bufpos = (long) (filepos - ((LONGLONG)recstart * IOBUFLEN)); + nspace = IOBUFLEN - bufpos; /* amount of space left in the buffer */ + + if (nspace) + { /* fill up the IO buffer */ + memcpy((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN) + bufpos, cptr, nspace); + ntodo -= nspace; /* decrement remaining number of bytes */ + cptr += nspace; /* increment user buffer pointer */ + filepos += nspace; /* increment file position pointer */ + (fptr->Fptr)->dirty[nbuff] = TRUE; /* mark record as having been modified */ + } + + for (ii = 0; ii < NIOBUF; ii++) /* flush any affected buffers to disk */ + { + if ((fptr->Fptr)->bufrecnum[ii] >= recstart + && (fptr->Fptr)->bufrecnum[ii] <= recend ) + { + if ((fptr->Fptr)->dirty[ii]) /* flush modified buffer to disk */ + ffbfwt(fptr->Fptr, ii, status); + + (fptr->Fptr)->bufrecnum[ii] = -1; /* disassociate buffer from the file */ + } + } + + /* move to the correct write position */ + if ((fptr->Fptr)->io_pos != filepos) + ffseek(fptr->Fptr, filepos); + + nwrite = ((ntodo - 1) / IOBUFLEN) * IOBUFLEN; /* don't write last buff */ + + ffwrite(fptr->Fptr, nwrite, cptr, status); /* write the data */ + ntodo -= nwrite; /* decrement remaining number of bytes */ + cptr += nwrite; /* increment user buffer pointer */ + (fptr->Fptr)->io_pos = filepos + nwrite; /* update the file position */ + + if ((fptr->Fptr)->io_pos >= (fptr->Fptr)->filesize) /* at the EOF? */ + { + (fptr->Fptr)->filesize = (fptr->Fptr)->io_pos; /* increment file size */ + + /* initialize the current buffer with the correct fill value */ + if ((fptr->Fptr)->hdutype == ASCII_TBL) + memset((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), 32, IOBUFLEN); /* blank fill */ + else + memset((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), 0, IOBUFLEN); /* zero fill */ + } + else + { + /* read next record */ + ffread(fptr->Fptr, IOBUFLEN, (fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), status); + (fptr->Fptr)->io_pos += IOBUFLEN; + } + + /* copy remaining bytes from user buffer into current IO buffer */ + memcpy((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), cptr, ntodo); + (fptr->Fptr)->dirty[nbuff] = TRUE; /* mark record as having been modified */ + (fptr->Fptr)->bufrecnum[nbuff] = recend; /* record number */ + + (fptr->Fptr)->logfilesize = maxvalue((fptr->Fptr)->logfilesize, + (LONGLONG)(recend + 1) * IOBUFLEN); + (fptr->Fptr)->bytepos = filepos + nwrite + ntodo; + } + else + { + /* bufpos is the starting position in IO buffer */ + bufpos = (long) ((fptr->Fptr)->bytepos - ((LONGLONG)(fptr->Fptr)->bufrecnum[(fptr->Fptr)->curbuf] * + IOBUFLEN)); + nspace = IOBUFLEN - bufpos; /* amount of space left in the buffer */ + + while (ntodo) + { + nwrite = minvalue(ntodo, nspace); + + /* copy bytes from user's buffer to the IO buffer */ + memcpy((fptr->Fptr)->iobuffer + ((fptr->Fptr)->curbuf * IOBUFLEN) + bufpos, cptr, nwrite); + ntodo -= nwrite; /* decrement remaining number of bytes */ + cptr += nwrite; + (fptr->Fptr)->bytepos += nwrite; /* increment file position pointer */ + (fptr->Fptr)->dirty[(fptr->Fptr)->curbuf] = TRUE; /* mark record as modified */ + + if (ntodo) /* load next record into a buffer */ + { + ffldrc(fptr, (long) ((fptr->Fptr)->bytepos / IOBUFLEN), IGNORE_EOF, status); + bufpos = 0; + nspace = IOBUFLEN; + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpbytoff(fitsfile *fptr, /* I - FITS file pointer */ + long gsize, /* I - size of each group of bytes */ + long ngroups, /* I - number of groups to write */ + long offset, /* I - size of gap between groups */ + void *buffer, /* I - buffer to be written */ + int *status) /* IO - error status */ +/* + put (write) the buffer of bytes to the output FITS file, with an offset + between each group of bytes. This function combines ffmbyt and ffpbyt + for increased efficiency. +*/ +{ + int bcurrent; + long ii, bufpos, nspace, nwrite, record; + char *cptr, *ioptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + if ((fptr->Fptr)->curbuf < 0) /* no current data buffer for this file */ + { /* so reload the last one that was used */ + ffldrc(fptr, (long) (((fptr->Fptr)->bytepos) / IOBUFLEN), REPORT_EOF, status); + } + + cptr = (char *)buffer; + bcurrent = (fptr->Fptr)->curbuf; /* number of the current IO buffer */ + record = (fptr->Fptr)->bufrecnum[bcurrent]; /* zero-indexed record number */ + bufpos = (long) ((fptr->Fptr)->bytepos - ((LONGLONG)record * IOBUFLEN)); /* start pos */ + nspace = IOBUFLEN - bufpos; /* amount of space left in buffer */ + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN) + bufpos; + + for (ii = 1; ii < ngroups; ii++) /* write all but the last group */ + { + /* copy bytes from user's buffer to the IO buffer */ + nwrite = minvalue(gsize, nspace); + memcpy(ioptr, cptr, nwrite); + cptr += nwrite; /* increment buffer pointer */ + + if (nwrite < gsize) /* entire group did not fit */ + { + (fptr->Fptr)->dirty[bcurrent] = TRUE; /* mark record as having been modified */ + record++; + ffldrc(fptr, record, IGNORE_EOF, status); /* load next record */ + bcurrent = (fptr->Fptr)->curbuf; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN); + + nwrite = gsize - nwrite; + memcpy(ioptr, cptr, nwrite); + cptr += nwrite; /* increment buffer pointer */ + ioptr += (offset + nwrite); /* increment IO buffer pointer */ + nspace = IOBUFLEN - offset - nwrite; /* amount of space left */ + } + else + { + ioptr += (offset + nwrite); /* increment IO bufer pointer */ + nspace -= (offset + nwrite); + } + + if (nspace <= 0) /* beyond current record? */ + { + (fptr->Fptr)->dirty[bcurrent] = TRUE; + record += ((IOBUFLEN - nspace) / IOBUFLEN); /* new record number */ + ffldrc(fptr, record, IGNORE_EOF, status); + bcurrent = (fptr->Fptr)->curbuf; + + bufpos = (-nspace) % IOBUFLEN; /* starting buffer pos */ + nspace = IOBUFLEN - bufpos; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN) + bufpos; + } + } + + /* now write the last group */ + nwrite = minvalue(gsize, nspace); + memcpy(ioptr, cptr, nwrite); + cptr += nwrite; /* increment buffer pointer */ + + if (nwrite < gsize) /* entire group did not fit */ + { + (fptr->Fptr)->dirty[bcurrent] = TRUE; /* mark record as having been modified */ + record++; + ffldrc(fptr, record, IGNORE_EOF, status); /* load next record */ + bcurrent = (fptr->Fptr)->curbuf; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN); + + nwrite = gsize - nwrite; + memcpy(ioptr, cptr, nwrite); + } + + (fptr->Fptr)->dirty[bcurrent] = TRUE; /* mark record as having been modified */ + (fptr->Fptr)->bytepos = (fptr->Fptr)->bytepos + (ngroups * gsize) + + (ngroups - 1) * offset; + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgbyt(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG nbytes, /* I - number of bytes to read */ + void *buffer, /* O - buffer to read into */ + int *status) /* IO - error status */ +/* + get (read) the requested number of bytes from the file, starting at + the current file position. Read large blocks of data directly from disk; + read smaller segments via intermediate IO buffers to improve efficiency. +*/ +{ + int ii; + LONGLONG filepos; + long recstart, recend, ntodo, bufpos, nspace, nread; + char *cptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + cptr = (char *)buffer; + + if (nbytes >= MINDIRECT) + { + /* read large blocks of data directly from disk instead of via buffers */ + filepos = (fptr->Fptr)->bytepos; /* save the read starting position */ + +/* note that in this case, ffmbyt has not been called, and so */ +/* bufrecnum[(fptr->Fptr)->curbuf] does not point to the intended */ +/* output buffer */ + + recstart = (long) (filepos / IOBUFLEN); /* starting record */ + recend = (long) ((filepos + nbytes - 1) / IOBUFLEN); /* ending record */ + + for (ii = 0; ii < NIOBUF; ii++) /* flush any affected buffers to disk */ + { + if ((fptr->Fptr)->dirty[ii] && + (fptr->Fptr)->bufrecnum[ii] >= recstart && (fptr->Fptr)->bufrecnum[ii] <= recend) + { + ffbfwt(fptr->Fptr, ii, status); /* flush modified buffer to disk */ + } + } + + /* move to the correct read position */ + if ((fptr->Fptr)->io_pos != filepos) + ffseek(fptr->Fptr, filepos); + + ffread(fptr->Fptr, (long) nbytes, cptr, status); /* read the data */ + (fptr->Fptr)->io_pos = filepos + nbytes; /* update the file position */ + } + else + { + /* read small chucks of data using the IO buffers for efficiency */ + + if ((fptr->Fptr)->curbuf < 0) /* no current data buffer for this file */ + { /* so reload the last one that was used */ + ffldrc(fptr, (long) (((fptr->Fptr)->bytepos) / IOBUFLEN), REPORT_EOF, status); + } + + /* bufpos is the starting position in IO buffer */ + bufpos = (long) ((fptr->Fptr)->bytepos - ((LONGLONG)(fptr->Fptr)->bufrecnum[(fptr->Fptr)->curbuf] * + IOBUFLEN)); + nspace = IOBUFLEN - bufpos; /* amount of space left in the buffer */ + + ntodo = (long) nbytes; + while (ntodo) + { + nread = minvalue(ntodo, nspace); + + /* copy bytes from IO buffer to user's buffer */ + memcpy(cptr, (fptr->Fptr)->iobuffer + ((fptr->Fptr)->curbuf * IOBUFLEN) + bufpos, nread); + ntodo -= nread; /* decrement remaining number of bytes */ + cptr += nread; + (fptr->Fptr)->bytepos += nread; /* increment file position pointer */ + + if (ntodo) /* load next record into a buffer */ + { + ffldrc(fptr, (long) ((fptr->Fptr)->bytepos / IOBUFLEN), REPORT_EOF, status); + bufpos = 0; + nspace = IOBUFLEN; + } + } + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgbytoff(fitsfile *fptr, /* I - FITS file pointer */ + long gsize, /* I - size of each group of bytes */ + long ngroups, /* I - number of groups to read */ + long offset, /* I - size of gap between groups (may be < 0) */ + void *buffer, /* I - buffer to be filled */ + int *status) /* IO - error status */ +/* + get (read) the requested number of bytes from the file, starting at + the current file position. This function combines ffmbyt and ffgbyt + for increased efficiency. +*/ +{ + int bcurrent; + long ii, bufpos, nspace, nread, record; + char *cptr, *ioptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + if ((fptr->Fptr)->curbuf < 0) /* no current data buffer for this file */ + { /* so reload the last one that was used */ + ffldrc(fptr, (long) (((fptr->Fptr)->bytepos) / IOBUFLEN), REPORT_EOF, status); + } + + cptr = (char *)buffer; + bcurrent = (fptr->Fptr)->curbuf; /* number of the current IO buffer */ + record = (fptr->Fptr)->bufrecnum[bcurrent]; /* zero-indexed record number */ + bufpos = (long) ((fptr->Fptr)->bytepos - ((LONGLONG)record * IOBUFLEN)); /* start pos */ + nspace = IOBUFLEN - bufpos; /* amount of space left in buffer */ + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN) + bufpos; + + for (ii = 1; ii < ngroups; ii++) /* read all but the last group */ + { + /* copy bytes from IO buffer to the user's buffer */ + nread = minvalue(gsize, nspace); + memcpy(cptr, ioptr, nread); + cptr += nread; /* increment buffer pointer */ + + if (nread < gsize) /* entire group did not fit */ + { + record++; + ffldrc(fptr, record, REPORT_EOF, status); /* load next record */ + bcurrent = (fptr->Fptr)->curbuf; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN); + + nread = gsize - nread; + memcpy(cptr, ioptr, nread); + cptr += nread; /* increment buffer pointer */ + ioptr += (offset + nread); /* increment IO buffer pointer */ + nspace = IOBUFLEN - offset - nread; /* amount of space left */ + } + else + { + ioptr += (offset + nread); /* increment IO bufer pointer */ + nspace -= (offset + nread); + } + + if (nspace <= 0 || nspace > IOBUFLEN) /* beyond current record? */ + { + if (nspace <= 0) + { + record += ((IOBUFLEN - nspace) / IOBUFLEN); /* new record number */ + bufpos = (-nspace) % IOBUFLEN; /* starting buffer pos */ + } + else + { + record -= ((nspace - 1 ) / IOBUFLEN); /* new record number */ + bufpos = IOBUFLEN - (nspace % IOBUFLEN); /* starting buffer pos */ + } + + ffldrc(fptr, record, REPORT_EOF, status); + bcurrent = (fptr->Fptr)->curbuf; + + nspace = IOBUFLEN - bufpos; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN) + bufpos; + } + } + + /* now read the last group */ + nread = minvalue(gsize, nspace); + memcpy(cptr, ioptr, nread); + cptr += nread; /* increment buffer pointer */ + + if (nread < gsize) /* entire group did not fit */ + { + record++; + ffldrc(fptr, record, REPORT_EOF, status); /* load next record */ + bcurrent = (fptr->Fptr)->curbuf; + ioptr = (fptr->Fptr)->iobuffer + (bcurrent * IOBUFLEN); + + nread = gsize - nread; + memcpy(cptr, ioptr, nread); + } + + (fptr->Fptr)->bytepos = (fptr->Fptr)->bytepos + (ngroups * gsize) + + (ngroups - 1) * offset; + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffldrc(fitsfile *fptr, /* I - FITS file pointer */ + long record, /* I - record number to be loaded */ + int err_mode, /* I - 1=ignore EOF, 0 = return EOF error */ + int *status) /* IO - error status */ +{ +/* + low-level routine to load a specified record from a file into + a physical buffer, if it is not already loaded. Reset all + pointers to make this the new current record for that file. + Update ages of all the physical buffers. +*/ + int ibuff, nbuff; + LONGLONG rstart; + + /* check if record is already loaded in one of the buffers */ + /* search from youngest to oldest buffer for efficiency */ + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + for (ibuff = NIOBUF - 1; ibuff >= 0; ibuff--) + { + nbuff = (fptr->Fptr)->ageindex[ibuff]; + if (record == (fptr->Fptr)->bufrecnum[nbuff]) { + goto updatebuf; /* use 'goto' for efficiency */ + } + } + + /* record is not already loaded */ + rstart = (LONGLONG)record * IOBUFLEN; + + if ( !err_mode && (rstart >= (fptr->Fptr)->logfilesize) ) /* EOF? */ + return(*status = END_OF_FILE); + + if (ffwhbf(fptr, &nbuff) < 0) /* which buffer should we reuse? */ + return(*status = TOO_MANY_FILES); + + if ((fptr->Fptr)->dirty[nbuff]) + ffbfwt(fptr->Fptr, nbuff, status); /* write dirty buffer to disk */ + + if (rstart >= (fptr->Fptr)->filesize) /* EOF? */ + { + /* initialize an empty buffer with the correct fill value */ + if ((fptr->Fptr)->hdutype == ASCII_TBL) + memset((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), 32, IOBUFLEN); /* blank fill */ + else + memset((fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), 0, IOBUFLEN); /* zero fill */ + + (fptr->Fptr)->logfilesize = maxvalue((fptr->Fptr)->logfilesize, + rstart + IOBUFLEN); + + (fptr->Fptr)->dirty[nbuff] = TRUE; /* mark record as having been modified */ + } + else /* not EOF, so read record from disk */ + { + if ((fptr->Fptr)->io_pos != rstart) + ffseek(fptr->Fptr, rstart); + + ffread(fptr->Fptr, IOBUFLEN, (fptr->Fptr)->iobuffer + (nbuff * IOBUFLEN), status); + (fptr->Fptr)->io_pos = rstart + IOBUFLEN; /* set new IO position */ + } + + (fptr->Fptr)->bufrecnum[nbuff] = record; /* record number contained in buffer */ + +updatebuf: + + (fptr->Fptr)->curbuf = nbuff; /* this is the current buffer for this file */ + + if (ibuff < 0) + { + /* find the current position of the buffer in the age index */ + for (ibuff = 0; ibuff < NIOBUF; ibuff++) + if ((fptr->Fptr)->ageindex[ibuff] == nbuff) + break; + } + + /* increment the age of all the buffers that were younger than it */ + for (ibuff++; ibuff < NIOBUF; ibuff++) + (fptr->Fptr)->ageindex[ibuff - 1] = (fptr->Fptr)->ageindex[ibuff]; + + (fptr->Fptr)->ageindex[NIOBUF - 1] = nbuff; /* this is now the youngest buffer */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffwhbf(fitsfile *fptr, /* I - FITS file pointer */ + int *nbuff) /* O - which buffer to use */ +{ +/* + decide which buffer to (re)use to hold a new file record +*/ + return(*nbuff = (fptr->Fptr)->ageindex[0]); /* return oldest buffer */ +} +/*--------------------------------------------------------------------------*/ +int ffflus(fitsfile *fptr, /* I - FITS file pointer */ + int *status) /* IO - error status */ +/* + Flush all the data in the current FITS file to disk. This ensures that if + the program subsequently dies, the disk FITS file will be closed correctly. +*/ +{ + int hdunum, hdutype; + + if (*status > 0) + return(*status); + + ffghdn(fptr, &hdunum); /* get the current HDU number */ + + if (ffchdu(fptr,status) > 0) /* close out the current HDU */ + ffpmsg("ffflus could not close the current HDU."); + + ffflsh(fptr, FALSE, status); /* flush any modified IO buffers to disk */ + + if (ffgext(fptr, hdunum - 1, &hdutype, status) > 0) /* reopen HDU */ + ffpmsg("ffflus could not reopen the current HDU."); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffflsh(fitsfile *fptr, /* I - FITS file pointer */ + int clearbuf, /* I - also clear buffer contents? */ + int *status) /* IO - error status */ +{ +/* + flush all dirty IO buffers associated with the file to disk +*/ + int ii; + +/* + no need to move to a different HDU + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); +*/ + for (ii = 0; ii < NIOBUF; ii++) + { + /* flush modified buffer to disk */ + if ((fptr->Fptr)->bufrecnum[ii] >= 0 &&(fptr->Fptr)->dirty[ii]) + ffbfwt(fptr->Fptr, ii, status); + + if (clearbuf) + (fptr->Fptr)->bufrecnum[ii] = -1; /* set contents of buffer as undefined */ + } + + if (*status != READONLY_FILE) + ffflushx(fptr->Fptr); /* flush system buffers to disk */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffbfeof(fitsfile *fptr, /* I - FITS file pointer */ + int *status) /* IO - error status */ +{ +/* + clear any buffers beyond the end of file +*/ + int ii; + + for (ii = 0; ii < NIOBUF; ii++) + { + if ( (LONGLONG) (fptr->Fptr)->bufrecnum[ii] * IOBUFLEN >= fptr->Fptr->filesize) + { + (fptr->Fptr)->bufrecnum[ii] = -1; /* set contents of buffer as undefined */ + } + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffbfwt(FITSfile *Fptr, /* I - FITS file pointer */ + int nbuff, /* I - which buffer to write */ + int *status) /* IO - error status */ +{ +/* + write contents of buffer to file; If the position of the buffer + is beyond the current EOF, then the file may need to be extended + with fill values, and/or with the contents of some of the other + i/o buffers. +*/ + int ii,ibuff; + long jj, irec, minrec, nloop; + LONGLONG filepos; + + static char zeros[IOBUFLEN]; /* initialized to zero by default */ + + if (!(Fptr->writemode) ) + { + ffpmsg("Error: trying to write to READONLY file."); + if (Fptr->driver == 8) { /* gzip compressed file */ + ffpmsg("Cannot write to a GZIP or COMPRESS compressed file."); + } + Fptr->dirty[nbuff] = FALSE; /* reset buffer status to prevent later probs */ + *status = READONLY_FILE; + return(*status); + } + + filepos = (LONGLONG)Fptr->bufrecnum[nbuff] * IOBUFLEN; + + if (filepos <= Fptr->filesize) + { + /* record is located within current file, so just write it */ + + /* move to the correct write position */ + if (Fptr->io_pos != filepos) + ffseek(Fptr, filepos); + + ffwrite(Fptr, IOBUFLEN, Fptr->iobuffer + (nbuff * IOBUFLEN), status); + Fptr->io_pos = filepos + IOBUFLEN; + + if (filepos == Fptr->filesize) /* appended new record? */ + Fptr->filesize += IOBUFLEN; /* increment the file size */ + + Fptr->dirty[nbuff] = FALSE; + } + + else /* if record is beyond the EOF, append any other records */ + /* and/or insert fill values if necessary */ + { + /* move to EOF */ + if (Fptr->io_pos != Fptr->filesize) + ffseek(Fptr, Fptr->filesize); + + ibuff = NIOBUF; /* initialize to impossible value */ + while(ibuff != nbuff) /* repeat until requested buffer is written */ + { + minrec = (long) (Fptr->filesize / IOBUFLEN); + + /* write lowest record beyond the EOF first */ + + irec = Fptr->bufrecnum[nbuff]; /* initially point to the requested buffer */ + ibuff = nbuff; + + for (ii = 0; ii < NIOBUF; ii++) + { + if (Fptr->bufrecnum[ii] >= minrec && + Fptr->bufrecnum[ii] < irec) + { + irec = Fptr->bufrecnum[ii]; /* found a lower record */ + ibuff = ii; + } + } + + filepos = (LONGLONG)irec * IOBUFLEN; /* byte offset of record in file */ + + /* append 1 or more fill records if necessary */ + if (filepos > Fptr->filesize) + { + nloop = (long) ((filepos - (Fptr->filesize)) / IOBUFLEN); + for (jj = 0; jj < nloop && !(*status); jj++) + ffwrite(Fptr, IOBUFLEN, zeros, status); + +/* +ffseek(Fptr, filepos); +*/ + Fptr->filesize = filepos; /* increment the file size */ + } + + /* write the buffer itself */ + ffwrite(Fptr, IOBUFLEN, Fptr->iobuffer + (ibuff * IOBUFLEN), status); + Fptr->dirty[ibuff] = FALSE; + + Fptr->filesize += IOBUFLEN; /* increment the file size */ + } /* loop back if more buffers need to be written */ + + Fptr->io_pos = Fptr->filesize; /* currently positioned at EOF */ + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgrsz( fitsfile *fptr, /* I - FITS file pionter */ + long *ndata, /* O - optimal amount of data to access */ + int *status) /* IO - error status */ +/* + Returns an optimal value for the number of rows in a binary table + or the number of pixels in an image that should be read or written + at one time for maximum efficiency. Accessing more data than this + may cause excessive flushing and rereading of buffers to/from disk. +*/ +{ + int typecode, bytesperpixel; + + /* There are NIOBUF internal buffers available each IOBUFLEN bytes long. */ + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) /* rescan header to get hdu struct */ + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU ) /* calc pixels per buffer size */ + { + /* image pixels are in column 2 of the 'table' */ + ffgtcl(fptr, 2, &typecode, NULL, NULL, status); + bytesperpixel = typecode / 10; + *ndata = ((NIOBUF - 1) * IOBUFLEN) / bytesperpixel; + } + else /* calc number of rows that fit in buffers */ + { + *ndata = (long) (((NIOBUF - 1) * IOBUFLEN) / maxvalue(1, + (fptr->Fptr)->rowlength)); + *ndata = maxvalue(1, *ndata); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgtbb(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG firstrow, /* I - starting row (1 = first row) */ + LONGLONG firstchar, /* I - starting byte in row (1=first) */ + LONGLONG nchars, /* I - number of bytes to read */ + unsigned char *values, /* I - array of bytes to read */ + int *status) /* IO - error status */ +/* + read a consecutive string of bytes from an ascii or binary table. + This will span multiple rows of the table if nchars + firstchar is + greater than the length of a row. +*/ +{ + LONGLONG bytepos, endrow; + + if (*status > 0 || nchars <= 0) + return(*status); + + else if (firstrow < 1) + return(*status=BAD_ROW_NUM); + + else if (firstchar < 1) + return(*status=BAD_ELEM_NUM); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + /* check that we do not exceed number of rows in the table */ + endrow = ((firstchar + nchars - 2) / (fptr->Fptr)->rowlength) + firstrow; + if (endrow > (fptr->Fptr)->numrows) + { + ffpmsg("attempt to read past end of table (ffgtbb)"); + return(*status=BAD_ROW_NUM); + } + + /* move the i/o pointer to the start of the sequence of characters */ + bytepos = (fptr->Fptr)->datastart + + ((fptr->Fptr)->rowlength * (firstrow - 1)) + + firstchar - 1; + + ffmbyt(fptr, bytepos, REPORT_EOF, status); + ffgbyt(fptr, nchars, values, status); /* read the bytes */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgi1b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + unsigned char *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + LONGLONG postemp; + + if (incre == 1) /* read all the values at once (contiguous bytes) */ + { + if (nvals < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 1, nvals, incre - 1, values, status); + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgi2b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + short *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + LONGLONG postemp; + + if (incre == 2) /* read all the values at once (contiguous bytes) */ + { + if (nvals * 2 < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals * 2, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals * 2, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 2, nvals, incre - 2, values, status); + } + +#if BYTESWAPPED + ffswap2(values, nvals); /* reverse order of bytes in each value */ +#endif + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgi4b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + INT32BIT *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + LONGLONG postemp; + + if (incre == 4) /* read all the values at once (contiguous bytes) */ + { + if (nvals * 4 < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals * 4, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals * 4, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 4, nvals, incre - 4, values, status); + } + +#if BYTESWAPPED + ffswap4(values, nvals); /* reverse order of bytes in each value */ +#endif + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgi8b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + long *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + This routine reads 'nvals' 8-byte integers into 'values'. + This works both on platforms that have sizeof(long) = 64, and 32, + as long as 'values' has been allocated to large enough to hold + 8 * nvals bytes of data. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +*/ +{ + LONGLONG postemp; + + if (incre == 8) /* read all the values at once (contiguous bytes) */ + { + if (nvals * 8 < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals * 8, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals * 8, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 8, nvals, incre - 8, values, status); + } + +#if BYTESWAPPED + ffswap8((double *) values, nvals); /* reverse bytes in each value */ +#endif + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgr4b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + float *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + LONGLONG postemp; + +#if MACHINE == VAXVMS + long ii; + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + short *sptr; + long ii; + +#endif + + + if (incre == 4) /* read all the values at once (contiguous bytes) */ + { + if (nvals * 4 < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals * 4, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals * 4, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 4, nvals, incre - 4, values, status); + } + + +#if MACHINE == VAXVMS + + ii = nvals; /* call VAX macro routine to convert */ + ieevur(values, values, &ii); /* from IEEE float -> F float */ + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + + ffswap2( (short *) values, nvals * 2); /* swap pairs of bytes */ + + /* convert from IEEE float format to VMS GFLOAT float format */ + sptr = (short *) values; + for (ii = 0; ii < nvals; ii++, sptr += 2) + { + if (!fnan(*sptr) ) /* test for NaN or underflow */ + values[ii] *= 4.0; + } + +#elif BYTESWAPPED + ffswap4((INT32BIT *)values, nvals); /* reverse order of bytes in values */ +#endif + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgr8b(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG byteloc, /* I - position within file to start reading */ + long nvals, /* I - number of pixels to read */ + long incre, /* I - byte increment between pixels */ + double *values, /* O - returned array of values */ + int *status) /* IO - error status */ +/* + get (read) the array of values from the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + LONGLONG postemp; + +#if MACHINE == VAXVMS + long ii; + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + short *sptr; + long ii; + +#endif + + if (incre == 8) /* read all the values at once (contiguous bytes) */ + { + if (nvals * 8 < MINDIRECT) /* read normally via IO buffers */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbyt(fptr, nvals * 8, values, status); + } + else /* read directly from disk, bypassing IO buffers */ + { + postemp = (fptr->Fptr)->bytepos; /* store current file position */ + (fptr->Fptr)->bytepos = byteloc; /* set to the desired position */ + ffgbyt(fptr, nvals * 8, values, status); + (fptr->Fptr)->bytepos = postemp; /* reset to original position */ + } + } + else /* have to read each value individually (not contiguous ) */ + { + ffmbyt(fptr, byteloc, REPORT_EOF, status); + ffgbytoff(fptr, 8, nvals, incre - 8, values, status); + } + +#if MACHINE == VAXVMS + ii = nvals; /* call VAX macro routine to convert */ + ieevud(values, values, &ii); /* from IEEE float -> D float */ + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + ffswap2( (short *) values, nvals * 4); /* swap pairs of bytes */ + + /* convert from IEEE float format to VMS GFLOAT float format */ + sptr = (short *) values; + for (ii = 0; ii < nvals; ii++, sptr += 4) + { + if (!dnan(*sptr) ) /* test for NaN or underflow */ + values[ii] *= 4.0; + } + +#elif BYTESWAPPED + ffswap8(values, nvals); /* reverse order of bytes in each value */ +#endif + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffptbb(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG firstrow, /* I - starting row (1 = first row) */ + LONGLONG firstchar, /* I - starting byte in row (1=first) */ + LONGLONG nchars, /* I - number of bytes to write */ + unsigned char *values, /* I - array of bytes to write */ + int *status) /* IO - error status */ +/* + write a consecutive string of bytes to an ascii or binary table. + This will span multiple rows of the table if nchars + firstchar is + greater than the length of a row. +*/ +{ + LONGLONG bytepos, endrow, nrows; + char message[FLEN_ERRMSG]; + + if (*status > 0 || nchars <= 0) + return(*status); + + else if (firstrow < 1) + return(*status=BAD_ROW_NUM); + + else if (firstchar < 1) + return(*status=BAD_ELEM_NUM); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + else if ((fptr->Fptr)->datastart < 0) /* rescan header if data undefined */ + ffrdef(fptr, status); + + endrow = ((firstchar + nchars - 2) / (fptr->Fptr)->rowlength) + firstrow; + + /* check if we are writing beyond the current end of table */ + if (endrow > (fptr->Fptr)->numrows) + { + /* if there are more HDUs following the current one, or */ + /* if there is a data heap, then we must insert space */ + /* for the new rows. */ + if ( !((fptr->Fptr)->lasthdu) || (fptr->Fptr)->heapsize > 0) + { + nrows = endrow - ((fptr->Fptr)->numrows); + + /* ffirow also updates the heap address and numrows */ + if (ffirow(fptr, (fptr->Fptr)->numrows, nrows, status) > 0) + { + snprintf(message, FLEN_ERRMSG, + "ffptbb failed to add space for %.0f new rows in table.", + (double) nrows); + ffpmsg(message); + return(*status); + } + } + else + { + /* manally update heap starting address */ + (fptr->Fptr)->heapstart += + ((LONGLONG)(endrow - (fptr->Fptr)->numrows) * + (fptr->Fptr)->rowlength ); + + (fptr->Fptr)->numrows = endrow; /* update number of rows */ + } + } + + /* move the i/o pointer to the start of the sequence of characters */ + bytepos = (fptr->Fptr)->datastart + + ((fptr->Fptr)->rowlength * (firstrow - 1)) + + firstchar - 1; + + ffmbyt(fptr, bytepos, IGNORE_EOF, status); + ffpbyt(fptr, nchars, values, status); /* write the bytes */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpi1b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + unsigned char *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ + if (incre == 1) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 1, nvals, incre - 1, values, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpi2b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + short *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ +#if BYTESWAPPED + ffswap2(values, nvals); /* reverse order of bytes in each value */ +#endif + + if (incre == 2) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals * 2, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 2, nvals, incre - 2, values, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpi4b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + INT32BIT *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ +#if BYTESWAPPED + ffswap4(values, nvals); /* reverse order of bytes in each value */ +#endif + + if (incre == 4) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals * 4, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 4, nvals, incre - 4, values, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpi8b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + long *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + This routine writes 'nvals' 8-byte integers from 'values'. + This works both on platforms that have sizeof(long) = 64, and 32, + as long as 'values' has been allocated to large enough to hold + 8 * nvals bytes of data. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +*/ +{ +#if BYTESWAPPED + ffswap8((double *) values, nvals); /* reverse bytes in each value */ +#endif + + if (incre == 8) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals * 8, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 8, nvals, incre - 8, values, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpr4b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + float *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ +#if MACHINE == VAXVMS + long ii; + + ii = nvals; /* call VAX macro routine to convert */ + ieevpr(values, values, &ii); /* from F float -> IEEE float */ + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + long ii; + + /* convert from VMS FFLOAT float format to IEEE float format */ + for (ii = 0; ii < nvals; ii++) + values[ii] *= 0.25; + + ffswap2( (short *) values, nvals * 2); /* swap pairs of bytes */ + +#elif BYTESWAPPED + ffswap4((INT32BIT *) values, nvals); /* reverse order of bytes in values */ +#endif + + if (incre == 4) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals * 4, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 4, nvals, incre - 4, values, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffpr8b(fitsfile *fptr, /* I - FITS file pointer */ + long nvals, /* I - number of pixels in the values array */ + long incre, /* I - byte increment between pixels */ + double *values, /* I - array of values to write */ + int *status) /* IO - error status */ +/* + put (write) the array of values to the FITS file, doing machine dependent + format conversion (e.g. byte-swapping) if necessary. +*/ +{ +#if MACHINE == VAXVMS + long ii; + + ii = nvals; /* call VAX macro routine to convert */ + ieevpd(values, values, &ii); /* from D float -> IEEE float */ + +#elif (MACHINE == ALPHAVMS) && (FLOATTYPE == GFLOAT) + long ii; + + /* convert from VMS GFLOAT float format to IEEE float format */ + for (ii = 0; ii < nvals; ii++) + values[ii] *= 0.25; + + ffswap2( (short *) values, nvals * 4); /* swap pairs of bytes */ + +#elif BYTESWAPPED + ffswap8(values, nvals); /* reverse order of bytes in each value */ +#endif + + if (incre == 8) /* write all the values at once (contiguous bytes) */ + + ffpbyt(fptr, nvals * 8, values, status); + + else /* have to write each value individually (not contiguous ) */ + + ffpbytoff(fptr, 8, nvals, incre - 8, values, status); + + return(*status); +} + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/cfileio.c b/testbed/astropy__astropy/cextern/cfitsio/lib/cfileio.c new file mode 100644 index 0000000000000000000000000000000000000000..783d41453dc60b3476ddc5a3a58a281bb5c65cdc --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/cfileio.c @@ -0,0 +1,7618 @@ +/* This file, cfileio.c, contains the low-level file access routines. */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include +#include +#include +#include /* apparently needed to define size_t */ +#include "fitsio2.h" +#include "group.h" +#ifdef CFITSIO_HAVE_CURL + #include +#endif + +#define MAX_PREFIX_LEN 20 /* max length of file type prefix (e.g. 'http://') */ +#define MAX_DRIVERS 27 /* max number of file I/O drivers */ + +typedef struct /* structure containing pointers to I/O driver functions */ +{ char prefix[MAX_PREFIX_LEN]; + int (*init)(void); + int (*shutdown)(void); + int (*setoptions)(int option); + int (*getoptions)(int *options); + int (*getversion)(int *version); + int (*checkfile)(char *urltype, char *infile, char *outfile); + int (*open)(char *filename, int rwmode, int *driverhandle); + int (*create)(char *filename, int *drivehandle); + int (*truncate)(int drivehandle, LONGLONG size); + int (*close)(int drivehandle); + int (*remove)(char *filename); + int (*size)(int drivehandle, LONGLONG *size); + int (*flush)(int drivehandle); + int (*seek)(int drivehandle, LONGLONG offset); + int (*read)(int drivehandle, void *buffer, long nbytes); + int (*write)(int drivehandle, void *buffer, long nbytes); +} fitsdriver; + +fitsdriver driverTable[MAX_DRIVERS]; /* allocate driver tables */ + +FITSfile *FptrTable[NMAXFILES]; /* this table of Fptr pointers is */ + /* used by fits_already_open */ + +int need_to_initialize = 1; /* true if CFITSIO has not been initialized */ +int no_of_drivers = 0; /* number of currently defined I/O drivers */ + +static int pixel_filter_helper(fitsfile **fptr, char *outfile, + char *expr, int *status); +static int find_quote(char **string); +static int find_doublequote(char **string); +static int find_paren(char **string); +static int find_bracket(char **string); +static int find_curlybracket(char **string); +int comma2semicolon(char *string); + +#ifdef _REENTRANT + +pthread_mutex_t Fitsio_InitLock = PTHREAD_MUTEX_INITIALIZER; + +#endif + +/*--------------------------------------------------------------------------*/ +int fitsio_init_lock(void) +{ + int status = 0; + +#ifdef _REENTRANT + + static int need_to_init = 1; + + pthread_mutexattr_t mutex_init; + + FFLOCK1(Fitsio_InitLock); + + if (need_to_init) { + + /* Init the main fitsio lock here since we need a a recursive lock */ + + status = pthread_mutexattr_init(&mutex_init); + if (status) { + ffpmsg("pthread_mutexattr_init failed (fitsio_init_lock)"); + return(status); + } + +#ifdef __GLIBC__ + status = pthread_mutexattr_settype(&mutex_init, + PTHREAD_MUTEX_RECURSIVE_NP); +#else + status = pthread_mutexattr_settype(&mutex_init, + PTHREAD_MUTEX_RECURSIVE); +#endif + if (status) { + ffpmsg("pthread_mutexattr_settype failed (fitsio_init_lock)"); + return(status); + } + + status = pthread_mutex_init(&Fitsio_Lock,&mutex_init); + if (status) { + ffpmsg("pthread_mutex_init failed (fitsio_init_lock)"); + return(status); + } + + need_to_init = 0; + } + + FFUNLOCK1(Fitsio_InitLock); + +#endif + + return(status); +} +/*--------------------------------------------------------------------------*/ +int ffomem(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + void **buffptr, /* I - address of memory pointer */ + size_t *buffsize, /* I - size of buffer, in bytes */ + size_t deltasize, /* I - increment for future realloc's */ + void *(*mem_realloc)(void *p, size_t newsize), /* function */ + int *status) /* IO - error status */ +/* + Open an existing FITS file in core memory. This is a specialized version + of ffopen. +*/ +{ + int ii, driver, handle, hdutyp, slen, movetotype, extvers, extnum; + char extname[FLEN_VALUE]; + LONGLONG filesize; + char urltype[MAX_PREFIX_LEN], infile[FLEN_FILENAME], outfile[FLEN_FILENAME]; + char extspec[FLEN_FILENAME], rowfilter[FLEN_FILENAME]; + char binspec[FLEN_FILENAME], colspec[FLEN_FILENAME]; + char imagecolname[FLEN_VALUE], rowexpress[FLEN_FILENAME]; + char *url, errmsg[FLEN_ERRMSG]; + char *hdtype[3] = {"IMAGE", "TABLE", "BINTABLE"}; + + if (*status > 0) + return(*status); + + *fptr = 0; /* initialize null file pointer */ + + if (need_to_initialize) /* this is called only once */ + { + *status = fits_init_cfitsio(); + + if (*status > 0) + return(*status); + } + + url = (char *) name; + while (*url == ' ') /* ignore leading spaces in the file spec */ + url++; + + /* parse the input file specification */ + fits_parse_input_url(url, urltype, infile, outfile, extspec, + rowfilter, binspec, colspec, status); + + strcpy(urltype, "memkeep://"); /* URL type for pre-existing memory file */ + + *status = urltype2driver(urltype, &driver); + + if (*status > 0) + { + ffpmsg("could not find driver for pre-existing memory file: (ffomem)"); + return(*status); + } + + /* call driver routine to open the memory file */ + FFLOCK; /* lock this while searching for vacant handle */ + *status = mem_openmem( buffptr, buffsize,deltasize, + mem_realloc, &handle); + FFUNLOCK; + + if (*status > 0) + { + ffpmsg("failed to open pre-existing memory file: (ffomem)"); + return(*status); + } + + /* get initial file size */ + *status = (*driverTable[driver].size)(handle, &filesize); + + if (*status > 0) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed get the size of the memory file: (ffomem)"); + return(*status); + } + + /* allocate fitsfile structure and initialize = 0 */ + *fptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + if (!(*fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffomem)"); + ffpmsg(url); + return(*status = MEMORY_ALLOCATION); + } + + /* allocate FITSfile structure and initialize = 0 */ + (*fptr)->Fptr = (FITSfile *) calloc(1, sizeof(FITSfile)); + + if (!((*fptr)->Fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffomem)"); + ffpmsg(url); + free(*fptr); + *fptr = 0; + return(*status = MEMORY_ALLOCATION); + } + + slen = strlen(url) + 1; + slen = maxvalue(slen, 32); /* reserve at least 32 chars */ + ((*fptr)->Fptr)->filename = (char *) malloc(slen); /* mem for file name */ + + if ( !(((*fptr)->Fptr)->filename) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for filename: (ffomem)"); + ffpmsg(url); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for headstart array */ + ((*fptr)->Fptr)->headstart = (LONGLONG *) calloc(1001, sizeof(LONGLONG)); + + if ( !(((*fptr)->Fptr)->headstart) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for headstart array: (ffomem)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for file I/O buffers */ + ((*fptr)->Fptr)->iobuffer = (char *) calloc(NIOBUF, IOBUFLEN); + + if ( !(((*fptr)->Fptr)->iobuffer) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for iobuffer array: (ffomem)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->headstart); /* free memory for headstart array */ + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* initialize the ageindex array (relative age of the I/O buffers) */ + /* and initialize the bufrecnum array as being empty */ + for (ii = 0; ii < NIOBUF; ii++) { + ((*fptr)->Fptr)->ageindex[ii] = ii; + ((*fptr)->Fptr)->bufrecnum[ii] = -1; + } + + /* store the parameters describing the file */ + ((*fptr)->Fptr)->MAXHDU = 1000; /* initial size of headstart */ + ((*fptr)->Fptr)->filehandle = handle; /* file handle */ + ((*fptr)->Fptr)->driver = driver; /* driver number */ + strcpy(((*fptr)->Fptr)->filename, url); /* full input filename */ + ((*fptr)->Fptr)->filesize = filesize; /* physical file size */ + ((*fptr)->Fptr)->logfilesize = filesize; /* logical file size */ + ((*fptr)->Fptr)->writemode = mode; /* read-write mode */ + ((*fptr)->Fptr)->datastart = DATA_UNDEFINED; /* unknown start of data */ + ((*fptr)->Fptr)->curbuf = -1; /* undefined current IO buffer */ + ((*fptr)->Fptr)->open_count = 1; /* structure is currently used once */ + ((*fptr)->Fptr)->validcode = VALIDSTRUC; /* flag denoting valid structure */ + + ffldrc(*fptr, 0, REPORT_EOF, status); /* load first record */ + + fits_store_Fptr( (*fptr)->Fptr, status); /* store Fptr address */ + + if (ffrhdu(*fptr, &hdutyp, status) > 0) /* determine HDU structure */ + { + ffpmsg( + "ffomem could not interpret primary array header of file: (ffomem)"); + ffpmsg(url); + + if (*status == UNKNOWN_REC) + ffpmsg("This does not look like a FITS file."); + + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + } + + /* ---------------------------------------------------------- */ + /* move to desired extension, if specified as part of the URL */ + /* ---------------------------------------------------------- */ + + imagecolname[0] = '\0'; + rowexpress[0] = '\0'; + + if (*extspec) + { + /* parse the extension specifier into individual parameters */ + ffexts(extspec, &extnum, + extname, &extvers, &movetotype, imagecolname, rowexpress, status); + + + if (*status > 0) + return(*status); + + if (extnum) + { + ffmahd(*fptr, extnum + 1, &hdutyp, status); + } + else if (*extname) /* move to named extension, if specified */ + { + ffmnhd(*fptr, movetotype, extname, extvers, status); + } + + if (*status > 0) + { + ffpmsg("ffomem could not move to the specified extension:"); + if (extnum > 0) + { + snprintf(errmsg, FLEN_ERRMSG, + " extension number %d doesn't exist or couldn't be opened.",extnum); + ffpmsg(errmsg); + } + else + { + snprintf(errmsg, FLEN_ERRMSG, + " extension with EXTNAME = %s,", extname); + ffpmsg(errmsg); + + if (extvers) + { + snprintf(errmsg, FLEN_ERRMSG, + " and with EXTVERS = %d,", extvers); + ffpmsg(errmsg); + } + + if (movetotype != ANY_HDU) + { + snprintf(errmsg, FLEN_ERRMSG, + " and with XTENSION = %s,", hdtype[movetotype]); + ffpmsg(errmsg); + } + + ffpmsg(" doesn't exist or couldn't be opened."); + } + return(*status); + } + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdkopn(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file on magnetic disk with either readonly or + read/write access. The routine does not support CFITSIO's extended + filename syntax and simply uses the entire input 'name' string as + the name of the file. +*/ +{ + if (*status > 0) + return(*status); + + *status = OPEN_DISK_FILE; + + ffopen(fptr, name, mode, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdopn(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. and + move to the first HDU that contains 'interesting' data, if the primary + array contains a null image (i.e., NAXIS = 0). +*/ +{ + if (*status > 0) + return(*status); + + *status = SKIP_NULL_PRIMARY; + + ffopen(fptr, name, mode, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffeopn(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + char *extlist, /* I - list of 'good' extensions to move to */ + int *hdutype, /* O - type of extension that is moved to */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. and + if the primary array contains a null image (i.e., NAXIS = 0) then attempt to + move to the first extension named in the extlist of extension names. If + none are found, then simply move to the 2nd extension. +*/ +{ + int hdunum, naxis, thdutype, gotext=0; + char *ext, *textlist; + char *saveptr; + + if (*status > 0) + return(*status); + + if (ffopen(fptr, name, mode, status) > 0) + return(*status); + + fits_get_hdu_num(*fptr, &hdunum); + fits_get_img_dim(*fptr, &naxis, status); + + if( (hdunum == 1) && (naxis == 0) ){ + /* look through the extension list */ + if( extlist ){ + gotext = 0; + textlist = malloc(strlen(extlist) + 1); + if (!textlist) { + *status = MEMORY_ALLOCATION; + return(*status); + } + + strcpy(textlist, extlist); + for(ext=(char *)ffstrtok(textlist, " ",&saveptr); ext != NULL; + ext=(char *)ffstrtok(NULL," ",&saveptr)){ + fits_movnam_hdu(*fptr, ANY_HDU, ext, 0, status); + if( *status == 0 ){ + gotext = 1; + break; + } else { + *status = 0; + } + } + free(textlist); + } + if( !gotext ){ + /* if all else fails, move to extension #2 and hope for the best */ + fits_movabs_hdu(*fptr, 2, &thdutype, status); + } + } + fits_get_hdu_type(*fptr, hdutype, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fftopn(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. and + move to the first HDU that contains 'interesting' table (not an image). +*/ +{ + int hdutype; + + if (*status > 0) + return(*status); + + *status = SKIP_IMAGE; + + ffopen(fptr, name, mode, status); + + if (ffghdt(*fptr, &hdutype, status) <= 0) { + if (hdutype == IMAGE_HDU) + *status = NOT_TABLE; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffiopn(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. and + move to the first HDU that contains 'interesting' image (not an table). +*/ +{ + int hdutype; + + if (*status > 0) + return(*status); + + *status = SKIP_TABLE; + + ffopen(fptr, name, mode, status); + + if (ffghdt(*fptr, &hdutype, status) <= 0) { + if (hdutype != IMAGE_HDU) + *status = NOT_IMAGE; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffopentest(int soname, /* I - CFITSIO shared library version */ + /* application program (fitsio.h file) */ + fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. + First test that the SONAME of fitsio.h used to build the CFITSIO library + is the same as was used in compiling the application program that + links to the library. +*/ +{ + if (soname != CFITSIO_SONAME) + { + printf("\nERROR: Mismatch in the CFITSIO_SONAME value in the fitsio.h include file\n"); + printf("that was used to build the CFITSIO library, and the value in the include file\n"); + printf("that was used when compiling the application program:\n"); + printf(" Version used to build the CFITSIO library = %d\n",CFITSIO_SONAME); + printf(" Version included by the application program = %d\n",soname); + printf("\nFix this by recompiling and then relinking this application program \n"); + printf("with the CFITSIO library.\n"); + + *status = FILE_NOT_OPENED; + return(*status); + } + + /* now call the normal file open routine */ + ffopen(fptr, name, mode, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffopen(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - full name of file to open */ + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *status) /* IO - error status */ +/* + Open an existing FITS file with either readonly or read/write access. +*/ +{ + fitsfile *newptr; + int ii, driver, hdutyp, hdunum, slen, writecopy, isopen; + LONGLONG filesize; + long rownum, nrows, goodrows; + int extnum, extvers, handle, movetotype, tstatus = 0, only_one = 0; + char urltype[MAX_PREFIX_LEN], infile[FLEN_FILENAME], outfile[FLEN_FILENAME]; + char origurltype[MAX_PREFIX_LEN], extspec[FLEN_FILENAME]; + char extname[FLEN_VALUE], rowfilter[FLEN_FILENAME], tblname[FLEN_VALUE]; + char imagecolname[FLEN_VALUE], rowexpress[FLEN_FILENAME]; + char binspec[FLEN_FILENAME], colspec[FLEN_FILENAME], pixfilter[FLEN_FILENAME]; + char histfilename[FLEN_FILENAME]; + char filtfilename[FLEN_FILENAME], compspec[FLEN_FILENAME]; + char wtcol[FLEN_VALUE]; + char minname[4][FLEN_VALUE], maxname[4][FLEN_VALUE]; + char binname[4][FLEN_VALUE]; + + char *url; + double minin[4], maxin[4], binsizein[4], weight; + int imagetype, naxis = 1, haxis, recip; + int skip_null = 0, skip_image = 0, skip_table = 0, open_disk_file = 0; + char colname[4][FLEN_VALUE]; + char errmsg[FLEN_ERRMSG]; + char *hdtype[3] = {"IMAGE", "TABLE", "BINTABLE"}; + char *rowselect = 0; + + if (*status > 0) + return(*status); + + if (*status == SKIP_NULL_PRIMARY) + { + /* this special status value is used as a flag by ffdopn to tell */ + /* ffopen to skip over a null primary array when opening the file. */ + + skip_null = 1; + *status = 0; + } + else if (*status == SKIP_IMAGE) + { + /* this special status value is used as a flag by fftopn to tell */ + /* ffopen to move to 1st significant table when opening the file. */ + + skip_image = 1; + *status = 0; + } + else if (*status == SKIP_TABLE) + { + /* this special status value is used as a flag by ffiopn to tell */ + /* ffopen to move to 1st significant image when opening the file. */ + + skip_table = 1; + *status = 0; + } + else if (*status == OPEN_DISK_FILE) + { + /* this special status value is used as a flag by ffdkopn to tell */ + /* ffopen to not interpret the input filename using CFITSIO's */ + /* extended filename syntax, and simply open the specified disk file */ + + open_disk_file = 1; + *status = 0; + } + + *fptr = 0; /* initialize null file pointer */ + writecopy = 0; /* have we made a write-able copy of the input file? */ + + if (need_to_initialize) { /* this is called only once */ + *status = fits_init_cfitsio(); + } + + if (*status > 0) + return(*status); + + url = (char *) name; + while (*url == ' ') /* ignore leading spaces in the filename */ + url++; + + if (*url == '\0') + { + ffpmsg("Name of file to open is blank. (ffopen)"); + return(*status = FILE_NOT_OPENED); + } + + if (open_disk_file) + { + /* treat the input URL literally as the name of the file to open */ + /* and don't try to parse the URL using the extended filename syntax */ + + if (strlen(url) > FLEN_FILENAME - 1) { + ffpmsg("Name of file to open is too long. (ffopen)"); + return(*status = FILE_NOT_OPENED); + } + + strcpy(infile,url); + strcpy(urltype, "file://"); + outfile[0] = '\0'; + extspec[0] = '\0'; + binspec[0] = '\0'; + colspec[0] = '\0'; + rowfilter[0] = '\0'; + pixfilter[0] = '\0'; + compspec[0] = '\0'; + } + else + { + /* parse the input file specification */ + + /* NOTE: This routine tests that all the strings do not */ + /* overflow the standard buffer sizes (FLEN_FILENAME, etc.) */ + /* therefore in general we do not have to worry about buffer */ + /* overflow of any of the returned strings. */ + + /* call the newer version of this parsing routine that supports 'compspec' */ + ffifile2(url, urltype, infile, outfile, extspec, + rowfilter, binspec, colspec, pixfilter, compspec, status); + } + + if (*status > 0) + { + ffpmsg("could not parse the input filename: (ffopen)"); + ffpmsg(url); + return(*status); + } + + imagecolname[0] = '\0'; + rowexpress[0] = '\0'; + + if (*extspec) + { + slen = strlen(extspec); + if (extspec[slen - 1] == '#') { /* special symbol to mean only copy this extension */ + extspec[slen - 1] = '\0'; + only_one = 1; + } + + /* parse the extension specifier into individual parameters */ + ffexts(extspec, &extnum, + extname, &extvers, &movetotype, imagecolname, rowexpress, status); + + if (*status > 0) + return(*status); + } + + /*-------------------------------------------------------------------*/ + /* special cases: */ + /*-------------------------------------------------------------------*/ + + histfilename[0] = '\0'; + filtfilename[0] = '\0'; + if (*outfile && (*binspec || *imagecolname || *pixfilter)) + { + /* if binspec or imagecolumn are specified, then the */ + /* output file name is intended for the final image, */ + /* and not a copy of the input file. */ + + strcpy(histfilename, outfile); + outfile[0] = '\0'; + } + else if (*outfile && (*rowfilter || *colspec)) + { + /* if rowfilter or colspece are specified, then the */ + /* output file name is intended for the filtered file */ + /* and not a copy of the input file. */ + + strcpy(filtfilename, outfile); + outfile[0] = '\0'; + } + + /*-------------------------------------------------------------------*/ + /* check if this same file is already open, and if so, attach to it */ + /*-------------------------------------------------------------------*/ + + FFLOCK; + if (fits_already_open(fptr, url, urltype, infile, extspec, rowfilter, + binspec, colspec, mode, &isopen, status) > 0) + { + FFUNLOCK; + return(*status); + } + FFUNLOCK; + + if (isopen) { + goto move2hdu; + } + + /* get the driver number corresponding to this urltype */ + *status = urltype2driver(urltype, &driver); + + if (*status > 0) + { + ffpmsg("could not find driver for this file: (ffopen)"); + ffpmsg(urltype); + ffpmsg(url); + return(*status); + } + + /*------------------------------------------------------------------- + deal with all those messy special cases which may require that + a different driver be used: + - is disk file compressed? + - are ftp:, gsiftp:, or http: files compressed? + - has user requested that a local copy be made of + the ftp or http file? + -------------------------------------------------------------------*/ + + if (driverTable[driver].checkfile) + { + strcpy(origurltype,urltype); /* Save the urltype */ + + /* 'checkfile' may modify the urltype, infile and outfile strings */ + *status = (*driverTable[driver].checkfile)(urltype, infile, outfile); + + if (*status) + { + ffpmsg("checkfile failed for this file: (ffopen)"); + ffpmsg(url); + return(*status); + } + + if (strcmp(origurltype, urltype)) /* did driver changed on us? */ + { + *status = urltype2driver(urltype, &driver); + if (*status > 0) + { + ffpmsg("could not change driver for this file: (ffopen)"); + ffpmsg(url); + ffpmsg(urltype); + return(*status); + } + } + } + + /* call appropriate driver to open the file */ + if (driverTable[driver].open) + { + FFLOCK; /* lock this while searching for vacant handle */ + *status = (*driverTable[driver].open)(infile, mode, &handle); + FFUNLOCK; + if (*status > 0) + { + ffpmsg("failed to find or open the following file: (ffopen)"); + ffpmsg(url); + return(*status); + } + } + else + { + ffpmsg("cannot open an existing file of this type: (ffopen)"); + ffpmsg(url); + return(*status = FILE_NOT_OPENED); + } + + /* get initial file size */ + *status = (*driverTable[driver].size)(handle, &filesize); + if (*status > 0) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed get the size of the following file: (ffopen)"); + ffpmsg(url); + return(*status); + } + + /* allocate fitsfile structure and initialize = 0 */ + *fptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + if (!(*fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffopen)"); + ffpmsg(url); + return(*status = MEMORY_ALLOCATION); + } + + /* allocate FITSfile structure and initialize = 0 */ + (*fptr)->Fptr = (FITSfile *) calloc(1, sizeof(FITSfile)); + + if (!((*fptr)->Fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffopen)"); + ffpmsg(url); + free(*fptr); + *fptr = 0; + return(*status = MEMORY_ALLOCATION); + } + + slen = strlen(url) + 1; + slen = maxvalue(slen, 32); /* reserve at least 32 chars */ + ((*fptr)->Fptr)->filename = (char *) malloc(slen); /* mem for file name */ + + if ( !(((*fptr)->Fptr)->filename) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for filename: (ffopen)"); + ffpmsg(url); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for headstart array */ + ((*fptr)->Fptr)->headstart = (LONGLONG *) calloc(1001, sizeof(LONGLONG)); + + if ( !(((*fptr)->Fptr)->headstart) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for headstart array: (ffopen)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for file I/O buffers */ + ((*fptr)->Fptr)->iobuffer = (char *) calloc(NIOBUF, IOBUFLEN); + + if ( !(((*fptr)->Fptr)->iobuffer) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for iobuffer array: (ffopen)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->headstart); /* free memory for headstart array */ + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* initialize the ageindex array (relative age of the I/O buffers) */ + /* and initialize the bufrecnum array as being empty */ + for (ii = 0; ii < NIOBUF; ii++) { + ((*fptr)->Fptr)->ageindex[ii] = ii; + ((*fptr)->Fptr)->bufrecnum[ii] = -1; + } + + /* store the parameters describing the file */ + ((*fptr)->Fptr)->MAXHDU = 1000; /* initial size of headstart */ + ((*fptr)->Fptr)->filehandle = handle; /* file handle */ + ((*fptr)->Fptr)->driver = driver; /* driver number */ + strcpy(((*fptr)->Fptr)->filename, url); /* full input filename */ + ((*fptr)->Fptr)->filesize = filesize; /* physical file size */ + ((*fptr)->Fptr)->logfilesize = filesize; /* logical file size */ + ((*fptr)->Fptr)->writemode = mode; /* read-write mode */ + ((*fptr)->Fptr)->datastart = DATA_UNDEFINED; /* unknown start of data */ + ((*fptr)->Fptr)->curbuf = -1; /* undefined current IO buffer */ + ((*fptr)->Fptr)->open_count = 1; /* structure is currently used once */ + ((*fptr)->Fptr)->validcode = VALIDSTRUC; /* flag denoting valid structure */ + ((*fptr)->Fptr)->only_one = only_one; /* flag denoting only copy single extension */ + + ffldrc(*fptr, 0, REPORT_EOF, status); /* load first record */ + + fits_store_Fptr( (*fptr)->Fptr, status); /* store Fptr address */ + + if (ffrhdu(*fptr, &hdutyp, status) > 0) /* determine HDU structure */ + { + ffpmsg( + "ffopen could not interpret primary array header of file: "); + ffpmsg(url); + + if (*status == UNKNOWN_REC) + ffpmsg("This does not look like a FITS file."); + + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + /* ------------------------------------------------------------- */ + /* At this point, the input file has been opened. If outfile was */ + /* specified, then we have opened a copy of the file, not the */ + /* original file so it is safe to modify it if necessary */ + /* ------------------------------------------------------------- */ + + if (*outfile) + writecopy = 1; + +move2hdu: + + /* ---------------------------------------------------------- */ + /* move to desired extension, if specified as part of the URL */ + /* ---------------------------------------------------------- */ + + if (*extspec) + { + if (extnum) /* extension number was specified */ + { + ffmahd(*fptr, extnum + 1, &hdutyp, status); + } + else if (*extname) /* move to named extension, if specified */ + { + ffmnhd(*fptr, movetotype, extname, extvers, status); + } + + if (*status > 0) /* clean up after error */ + { + ffpmsg("ffopen could not move to the specified extension:"); + if (extnum > 0) + { + snprintf(errmsg, FLEN_ERRMSG, + " extension number %d doesn't exist or couldn't be opened.",extnum); + ffpmsg(errmsg); + } + else + { + snprintf(errmsg, FLEN_ERRMSG, + " extension with EXTNAME = %s,", extname); + ffpmsg(errmsg); + + if (extvers) + { + snprintf(errmsg, FLEN_ERRMSG, + " and with EXTVERS = %d,", extvers); + ffpmsg(errmsg); + } + + if (movetotype != ANY_HDU) + { + snprintf(errmsg, FLEN_ERRMSG, + " and with XTENSION = %s,", hdtype[movetotype]); + ffpmsg(errmsg); + } + + ffpmsg(" doesn't exist or couldn't be opened."); + } + + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + } + else if (skip_null || skip_image || skip_table || + (*imagecolname || *colspec || *rowfilter || *binspec)) + { + /* ------------------------------------------------------------------ + + If no explicit extension specifier is given as part of the file + name, and, if a) skip_null is true (set if ffopen is called by + ffdopn) or b) skip_image or skip_table is true (set if ffopen is + called by fftopn or ffdopn) or c) other file filters are + specified, then CFITSIO will attempt to move to the first + 'interesting' HDU after opening an existing FITS file (or to + first interesting table HDU if skip_image is true); + + An 'interesting' HDU is defined to be either an image with NAXIS + > 0 (i.e., not a null array) or a table which has an EXTNAME + value which does not contain any of the following strings: + 'GTI' - Good Time Interval extension + 'OBSTABLE' - used in Beppo SAX data files + + The main purpose for this is to allow CFITSIO to skip over a null + primary and other non-interesting HDUs when opening an existing + file, and move directly to the first extension that contains + significant data. + ------------------------------------------------------------------ */ + + fits_get_hdu_num(*fptr, &hdunum); + if (hdunum == 1) { + + fits_get_img_dim(*fptr, &naxis, status); + + if (naxis == 0 || skip_image) /* skip primary array */ + { + while(1) + { + /* see if the next HDU is 'interesting' */ + if (fits_movrel_hdu(*fptr, 1, &hdutyp, status)) + { + if (*status == END_OF_FILE) + *status = 0; /* reset expected error */ + + /* didn't find an interesting HDU so move back to beginning */ + fits_movabs_hdu(*fptr, 1, &hdutyp, status); + break; + } + + if (hdutyp == IMAGE_HDU && skip_image) { + + continue; /* skip images */ + + } else if (hdutyp != IMAGE_HDU && skip_table) { + + continue; /* skip tables */ + + } else if (hdutyp == IMAGE_HDU) { + + fits_get_img_dim(*fptr, &naxis, status); + if (naxis > 0) + break; /* found a non-null image */ + + } else { + + tstatus = 0; + tblname[0] = '\0'; + fits_read_key(*fptr, TSTRING, "EXTNAME", tblname, NULL,&tstatus); + + if ( (!strstr(tblname, "GTI") && !strstr(tblname, "gti")) && + fits_strncasecmp(tblname, "OBSTABLE", 8) ) + break; /* found an interesting table */ + } + } /* end while */ + } + } /* end if (hdunum==1) */ + } + + if (*imagecolname) + { + /* ----------------------------------------------------------------- */ + /* we need to open an image contained in a single table cell */ + /* First, determine which row of the table to use. */ + /* ----------------------------------------------------------------- */ + + if (isdigit((int) *rowexpress)) /* is the row specification a number? */ + { + sscanf(rowexpress, "%ld", &rownum); + if (rownum < 1) + { + ffpmsg("illegal rownum for image cell:"); + ffpmsg(rowexpress); + ffpmsg("Could not open the following image in a table cell:"); + ffpmsg(extspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status = BAD_ROW_NUM); + } + } + else if (fits_find_first_row(*fptr, rowexpress, &rownum, status) > 0) + { + ffpmsg("Failed to find row matching this expression:"); + ffpmsg(rowexpress); + ffpmsg("Could not open the following image in a table cell:"); + ffpmsg(extspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + if (rownum == 0) + { + ffpmsg("row statisfying this expression doesn't exist::"); + ffpmsg(rowexpress); + ffpmsg("Could not open the following image in a table cell:"); + ffpmsg(extspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status = BAD_ROW_NUM); + } + + /* determine the name of the new file to contain copy of the image */ + if (*histfilename && !(*pixfilter) ) + strcpy(outfile, histfilename); /* the original outfile name */ + else + strcpy(outfile, "mem://_1"); /* create image file in memory */ + + /* Copy the image into new primary array and open it as the current */ + /* fptr. This will close the table that contains the original image. */ + + /* create new empty file to hold copy of the image */ + if (ffinit(&newptr, outfile, status) > 0) + { + ffpmsg("failed to create file for copy of image in table cell:"); + ffpmsg(outfile); + return(*status); + } + + if (fits_copy_cell2image(*fptr, newptr, imagecolname, rownum, + status) > 0) + { + ffpmsg("Failed to copy table cell to new primary array:"); + ffpmsg(extspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + /* close the original file and set fptr to the new image */ + ffclos(*fptr, status); + + *fptr = newptr; /* reset the pointer to the new table */ + + writecopy = 1; /* we are now dealing with a copy of the original file */ + + + /* leave it up to calling routine to write any HISTORY keywords */ + } + + /* --------------------------------------------------------------------- */ + /* edit columns (and/or keywords) in the table, if specified in the URL */ + /* --------------------------------------------------------------------- */ + + if (*colspec) + { + /* the column specifier will modify the file, so make sure */ + /* we are already dealing with a copy, or else make a new copy */ + + if (!writecopy) /* Is the current file already a copy? */ + writecopy = fits_is_this_a_copy(urltype); + + if (!writecopy) + { + if (*filtfilename && *outfile == '\0') + strcpy(outfile, filtfilename); /* the original outfile name */ + else + strcpy(outfile, "mem://_1"); /* will create copy in memory */ + + writecopy = 1; + } + else + { + ((*fptr)->Fptr)->writemode = READWRITE; /* we have write access */ + outfile[0] = '\0'; + } + + if (ffedit_columns(fptr, outfile, colspec, status) > 0) + { + ffpmsg("editing columns in input table failed (ffopen)"); + ffpmsg(" while trying to perform the following operation:"); + ffpmsg(colspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + } + + /* ------------------------------------------------------------------- */ + /* select rows from the table, if specified in the URL */ + /* or select a subimage (if this is an image HDU and not a table) */ + /* ------------------------------------------------------------------- */ + + if (*rowfilter) + { + fits_get_hdu_type(*fptr, &hdutyp, status); /* get type of HDU */ + if (hdutyp == IMAGE_HDU) + { + /* this is an image so 'rowfilter' is an image section specification */ + + if (*filtfilename && *outfile == '\0') + strcpy(outfile, filtfilename); /* the original outfile name */ + else if (*outfile == '\0') /* output file name not already defined? */ + strcpy(outfile, "mem://_2"); /* will create file in memory */ + + /* create new file containing the image section, plus a copy of */ + /* any other HDUs that exist in the input file. This routine */ + /* will close the original image file and return a pointer */ + /* to the new file. */ + + if (fits_select_image_section(fptr, outfile, rowfilter, status) > 0) + { + ffpmsg("on-the-fly selection of image section failed (ffopen)"); + ffpmsg(" while trying to use the following section filter:"); + ffpmsg(rowfilter); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + } + else + { + /* this is a table HDU, so the rowfilter is really a row filter */ + + if (*binspec) + { + /* since we are going to make a histogram of the selected rows, */ + /* it would be a waste of time and memory to make a whole copy of */ + /* the selected rows. Instead, just construct an array of TRUE */ + /* or FALSE values that indicate which rows are to be included */ + /* in the histogram and pass that to the histogram generating */ + /* routine */ + + fits_get_num_rows(*fptr, &nrows, status); /* get no. of rows */ + + rowselect = (char *) calloc(nrows, 1); + if (!rowselect) + { + ffpmsg( + "failed to allocate memory for selected columns array (ffopen)"); + ffpmsg(" while trying to select rows with the following filter:"); + ffpmsg(rowfilter); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + if (fits_find_rows(*fptr, rowfilter, 1L, nrows, &goodrows, + rowselect, status) > 0) + { + ffpmsg("selection of rows in input table failed (ffopen)"); + ffpmsg(" while trying to select rows with the following filter:"); + ffpmsg(rowfilter); + free(rowselect); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + } + else + { + if (!writecopy) /* Is the current file already a copy? */ + writecopy = fits_is_this_a_copy(urltype); + + if (!writecopy) + { + if (*filtfilename && *outfile == '\0') + strcpy(outfile, filtfilename); /* the original outfile name */ + else if (*outfile == '\0') /* output filename not already defined? */ + strcpy(outfile, "mem://_2"); /* will create copy in memory */ + } + else + { + ((*fptr)->Fptr)->writemode = READWRITE; /* we have write access */ + outfile[0] = '\0'; + } + + /* select rows in the table. If a copy of the input file has */ + /* not already been made, then this routine will make a copy */ + /* and then close the input file, so that the modifications will */ + /* only be made on the copy, not the original */ + + if (ffselect_table(fptr, outfile, rowfilter, status) > 0) + { + ffpmsg("on-the-fly selection of rows in input table failed (ffopen)"); + ffpmsg(" while trying to select rows with the following filter:"); + ffpmsg(rowfilter); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + /* write history records */ + ffphis(*fptr, + "CFITSIO used the following filtering expression to create this table:", + status); + ffphis(*fptr, name, status); + + } /* end of no binspec case */ + } /* end of table HDU case */ + } /* end of rowfilter exists case */ + + /* ------------------------------------------------------------------- */ + /* make an image histogram by binning columns, if specified in the URL */ + /* ------------------------------------------------------------------- */ + + if (*binspec) + { + if (*histfilename && !(*pixfilter) ) + strcpy(outfile, histfilename); /* the original outfile name */ + else + strcpy(outfile, "mem://_3"); /* create histogram in memory */ + /* if not already copied the file */ + + /* parse the binning specifier into individual parameters */ + ffbins(binspec, &imagetype, &haxis, colname, + minin, maxin, binsizein, + minname, maxname, binname, + &weight, wtcol, &recip, status); + + /* Create the histogram primary array and open it as the current fptr */ + /* This will close the table that was used to create the histogram. */ + ffhist2(fptr, outfile, imagetype, haxis, colname, minin, maxin, + binsizein, minname, maxname, binname, + weight, wtcol, recip, rowselect, status); + + if (rowselect) + free(rowselect); + + if (*status > 0) + { + ffpmsg("on-the-fly histogramming of input table failed (ffopen)"); + ffpmsg(" while trying to execute the following histogram specification:"); + ffpmsg(binspec); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + /* write history records */ + ffphis(*fptr, + "CFITSIO used the following expression to create this histogram:", + status); + ffphis(*fptr, name, status); + } + + if (*pixfilter) + { + if (*histfilename) + strcpy(outfile, histfilename); /* the original outfile name */ + else + strcpy(outfile, "mem://_4"); /* create in memory */ + /* if not already copied the file */ + + /* Ensure type of HDU is consistent with pixel filtering */ + fits_get_hdu_type(*fptr, &hdutyp, status); /* get type of HDU */ + if (hdutyp == IMAGE_HDU) { + + pixel_filter_helper(fptr, outfile, pixfilter, status); + + if (*status > 0) { + ffpmsg("pixel filtering of input image failed (ffopen)"); + ffpmsg(" while trying to execute the following:"); + ffpmsg(pixfilter); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + return(*status); + } + + /* write history records */ + ffphis(*fptr, + "CFITSIO used the following expression to create this image:", + status); + ffphis(*fptr, name, status); + } + else + { + ffpmsg("cannot use pixel filter on non-IMAGE HDU"); + ffpmsg(pixfilter); + ffclos(*fptr, status); + *fptr = 0; /* return null file pointer */ + *status = NOT_IMAGE; + return(*status); + } + } + + /* parse and save image compression specification, if given */ + if (*compspec) { + ffparsecompspec(*fptr, compspec, status); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffreopen(fitsfile *openfptr, /* I - FITS file pointer to open file */ + fitsfile **newfptr, /* O - pointer to new re opened file */ + int *status) /* IO - error status */ +/* + Reopen an existing FITS file with either readonly or read/write access. + The reopened file shares the same FITSfile structure but may point to a + different HDU within the file. +*/ +{ + if (*status > 0) + return(*status); + + /* check that the open file pointer is valid */ + if (!openfptr) + return(*status = NULL_INPUT_PTR); + else if ((openfptr->Fptr)->validcode != VALIDSTRUC) /* check magic value */ + return(*status = BAD_FILEPTR); + + /* allocate fitsfile structure and initialize = 0 */ + *newfptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + (*newfptr)->Fptr = openfptr->Fptr; /* both point to the same structure */ + (*newfptr)->HDUposition = 0; /* set initial position to primary array */ + (((*newfptr)->Fptr)->open_count)++; /* increment the file usage counter */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_store_Fptr(FITSfile *Fptr, /* O - FITS file pointer */ + int *status) /* IO - error status */ +/* + store the new Fptr address for future use by fits_already_open +*/ +{ + int ii; + + if (*status > 0) + return(*status); + + FFLOCK; + for (ii = 0; ii < NMAXFILES; ii++) { + if (FptrTable[ii] == 0) { + FptrTable[ii] = Fptr; + break; + } + } + FFUNLOCK; + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_clear_Fptr(FITSfile *Fptr, /* O - FITS file pointer */ + int *status) /* IO - error status */ +/* + clear the Fptr address from the Fptr Table +*/ +{ + int ii; + + FFLOCK; + for (ii = 0; ii < NMAXFILES; ii++) { + if (FptrTable[ii] == Fptr) { + FptrTable[ii] = 0; + break; + } + } + FFUNLOCK; + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_already_open(fitsfile **fptr, /* I/O - FITS file pointer */ + char *url, + char *urltype, + char *infile, + char *extspec, + char *rowfilter, + char *binspec, + char *colspec, + int mode, /* I - 0 = open readonly; 1 = read/write */ + int *isopen, /* O - 1 = file is already open */ + int *status) /* IO - error status */ +/* + Check if the file to be opened is already open. If so, then attach to it. +*/ + + /* the input strings must not exceed the standard lengths */ + /* of FLEN_FILENAME, MAX_PREFIX_LEN, etc. */ + + /* + this function was changed so that for files of access method FILE:// + the file paths are compared using standard URL syntax and absolute + paths (as opposed to relative paths). This eliminates some instances + where a file is already opened but it is not realized because it + was opened with another file path. For instance, if the CWD is + /a/b/c and I open /a/b/c/foo.fits then open ./foo.fits the previous + version of this function would not have reconized that the two files + were the same. This version does recognize that the two files are + the same. + */ +{ + FITSfile *oldFptr; + int ii; + char oldurltype[MAX_PREFIX_LEN], oldinfile[FLEN_FILENAME]; + char oldextspec[FLEN_FILENAME], oldoutfile[FLEN_FILENAME]; + char oldrowfilter[FLEN_FILENAME]; + char oldbinspec[FLEN_FILENAME], oldcolspec[FLEN_FILENAME]; + char cwd[FLEN_FILENAME]; + char tmpStr[FLEN_FILENAME]; + char tmpinfile[FLEN_FILENAME]; + + *isopen = 0; + +/* When opening a file with readonly access then we simply let + the operating system open the file again, instead of using the CFITSIO + trick of attaching to the previously opened file. This is required + if CFITSIO is running in a multi-threaded environment, because 2 different + threads cannot share the same FITSfile pointer. + + If the file is opened/reopened with write access, then the file MUST + only be physically opened once.. +*/ + if (mode == 0) + return(*status); + + if(fits_strcasecmp(urltype,"FILE://") == 0) + { + if (fits_path2url(infile,FLEN_FILENAME,tmpinfile,status)) + return (*status); + + if(tmpinfile[0] != '/') + { + fits_get_cwd(cwd,status); + strcat(cwd,"/"); + + if (strlen(cwd) + strlen(tmpinfile) > FLEN_FILENAME-1) { + ffpmsg("File name is too long. (fits_already_open)"); + return(*status = FILE_NOT_OPENED); + } + + strcat(cwd,tmpinfile); + fits_clean_url(cwd,tmpinfile,status); + } + } + else + strcpy(tmpinfile,infile); + + for (ii = 0; ii < NMAXFILES; ii++) /* check every buffer */ + { + if (FptrTable[ii] != 0) + { + oldFptr = FptrTable[ii]; + + fits_parse_input_url(oldFptr->filename, oldurltype, + oldinfile, oldoutfile, oldextspec, oldrowfilter, + oldbinspec, oldcolspec, status); + + if (*status > 0) + { + ffpmsg("could not parse the previously opened filename: (ffopen)"); + ffpmsg(oldFptr->filename); + return(*status); + } + + if(fits_strcasecmp(oldurltype,"FILE://") == 0) + { + if(fits_path2url(oldinfile,FLEN_FILENAME,tmpStr,status)) + return(*status); + + if(tmpStr[0] != '/') + { + fits_get_cwd(cwd,status); + strcat(cwd,"/"); + + + strcat(cwd,tmpStr); + fits_clean_url(cwd,tmpStr,status); + } + + strcpy(oldinfile,tmpStr); + } + + if (!strcmp(urltype, oldurltype) && !strcmp(tmpinfile, oldinfile) ) + { + /* identical type of file and root file name */ + + if ( (!rowfilter[0] && !oldrowfilter[0] && + !binspec[0] && !oldbinspec[0] && + !colspec[0] && !oldcolspec[0]) + + /* no filtering or binning specs for either file, so */ + /* this is a case where the same file is being reopened. */ + /* It doesn't matter if the extensions are different */ + + || /* or */ + + (!strcmp(rowfilter, oldrowfilter) && + !strcmp(binspec, oldbinspec) && + !strcmp(colspec, oldcolspec) && + !strcmp(extspec, oldextspec) ) ) + + /* filtering specs are given and are identical, and */ + /* the same extension is specified */ + + { + if (mode == READWRITE && oldFptr->writemode == READONLY) + { + /* + cannot assume that a file previously opened with READONLY + can now be written to (e.g., files on CDROM, or over the + the network, or STDIN), so return with an error. + */ + + ffpmsg( + "cannot reopen file READWRITE when previously opened READONLY"); + ffpmsg(url); + return(*status = FILE_NOT_OPENED); + } + + *fptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + if (!(*fptr)) + { + ffpmsg( + "failed to allocate structure for following file: (ffopen)"); + ffpmsg(url); + return(*status = MEMORY_ALLOCATION); + } + + (*fptr)->Fptr = oldFptr; /* point to the structure */ + (*fptr)->HDUposition = 0; /* set initial position */ + (((*fptr)->Fptr)->open_count)++; /* increment usage counter */ + + if (binspec[0]) /* if binning specified, don't move */ + extspec[0] = '\0'; + + /* all the filtering has already been applied, so ignore */ + rowfilter[0] = '\0'; + binspec[0] = '\0'; + colspec[0] = '\0'; + + *isopen = 1; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_is_this_a_copy(char *urltype) /* I - type of file */ +/* + specialized routine that returns 1 if the file is known to be a temporary + copy of the originally opened file. Otherwise it returns 0. +*/ +{ + int iscopy; + + if (!strncmp(urltype, "mem", 3) ) + iscopy = 1; /* file copy is in memory */ + else if (!strncmp(urltype, "compress", 8) ) + iscopy = 1; /* compressed diskfile that is uncompressed in memory */ + else if (!strncmp(urltype, "http", 4) ) + iscopy = 1; /* copied file using http protocol */ + else if (!strncmp(urltype, "ftp", 3) ) + iscopy = 1; /* copied file using ftp protocol */ + else if (!strncmp(urltype, "gsiftp", 6) ) + iscopy = 1; /* copied file using gsiftp protocol */ + else if (!strncpy(urltype, "stdin", 5) ) + iscopy = 1; /* piped stdin has been copied to memory */ + else + iscopy = 0; /* file is not known to be a copy */ + + return(iscopy); +} +/*--------------------------------------------------------------------------*/ +static int find_quote(char **string) + +/* + look for the closing single quote character in the input string +*/ +{ + char *tstr; + + tstr = *string; + + while (*tstr) { + if (*tstr == '\'') { /* found the closing quote */ + *string = tstr + 1; /* set pointer to next char */ + return(0); + } else { /* skip over any other character */ + tstr++; + } + } + return(1); /* opps, didn't find the closing character */ +} +/*--------------------------------------------------------------------------*/ +static int find_doublequote(char **string) + +/* + look for the closing double quote character in the input string +*/ +{ + char *tstr; + + tstr = *string; + + while (*tstr) { + if (*tstr == '"') { /* found the closing quote */ + *string = tstr + 1; /* set pointer to next char */ + return(0); + } else { /* skip over any other character */ + tstr++; + } + } + return(1); /* opps, didn't find the closing character */ +} + +/*--------------------------------------------------------------------------*/ +static int find_paren(char **string) + +/* + look for the closing parenthesis character in the input string +*/ +{ + char *tstr; + + tstr = *string; + + while (*tstr) { + + if (*tstr == ')') { /* found the closing parens */ + *string = tstr + 1; /* set pointer to next char */ + return(0); + } else if (*tstr == '(') { /* found another level of parens */ + tstr++; + if (find_paren(&tstr)) return(1); + } else if (*tstr == '[') { + tstr++; + if (find_bracket(&tstr)) return(1); + } else if (*tstr == '{') { + tstr++; + if (find_curlybracket(&tstr)) return(1); + } else if (*tstr == '"') { + tstr++; + if (find_doublequote(&tstr)) return(1); + } else if (*tstr == '\'') { + tstr++; + if (find_quote(&tstr)) return(1); + } else { + tstr++; + } + } + return(1); /* opps, didn't find the closing character */ +} +/*--------------------------------------------------------------------------*/ +static int find_bracket(char **string) + +/* + look for the closing bracket character in the input string +*/ +{ + char *tstr; + + tstr = *string; + + while (*tstr) { + if (*tstr == ']') { /* found the closing bracket */ + *string = tstr + 1; /* set pointer to next char */ + return(0); + } else if (*tstr == '(') { /* found another level of parens */ + tstr++; + if (find_paren(&tstr)) return(1); + } else if (*tstr == '[') { + tstr++; + if (find_bracket(&tstr)) return(1); + } else if (*tstr == '{') { + tstr++; + if (find_curlybracket(&tstr)) return(1); + } else if (*tstr == '"') { + tstr++; + if (find_doublequote(&tstr)) return(1); + } else if (*tstr == '\'') { + tstr++; + if (find_quote(&tstr)) return(1); + } else { + tstr++; + } + } + return(1); /* opps, didn't find the closing character */ +} +/*--------------------------------------------------------------------------*/ +static int find_curlybracket(char **string) + +/* + look for the closing curly bracket character in the input string +*/ +{ + char *tstr; + + tstr = *string; + + while (*tstr) { + if (*tstr == '}') { /* found the closing curly bracket */ + *string = tstr + 1; /* set pointer to next char */ + return(0); + } else if (*tstr == '(') { /* found another level of parens */ + tstr++; + if (find_paren(&tstr)) return(1); + } else if (*tstr == '[') { + tstr++; + if (find_bracket(&tstr)) return(1); + } else if (*tstr == '{') { + tstr++; + if (find_curlybracket(&tstr)) return(1); + } else if (*tstr == '"') { + tstr++; + if (find_doublequote(&tstr)) return(1); + } else if (*tstr == '\'') { + tstr++; + if (find_quote(&tstr)) return(1); + } else { + tstr++; + } + } + return(1); /* opps, didn't find the closing character */ +} +/*--------------------------------------------------------------------------*/ +int comma2semicolon(char *string) + +/* + replace commas with semicolons, unless the comma is within a quoted or bracketed expression +*/ +{ + char *tstr; + + tstr = string; + + while (*tstr) { + + if (*tstr == ',') { /* found a comma */ + *tstr = ';'; + tstr++; + } else if (*tstr == '(') { /* found another level of parens */ + tstr++; + if (find_paren(&tstr)) return(1); + } else if (*tstr == '[') { + tstr++; + if (find_bracket(&tstr)) return(1); + } else if (*tstr == '{') { + tstr++; + if (find_curlybracket(&tstr)) return(1); + } else if (*tstr == '"') { + tstr++; + if (find_doublequote(&tstr)) return(1); + } else if (*tstr == '\'') { + tstr++; + if (find_quote(&tstr)) return(1); + } else { + tstr++; + } + } + return(0); /* reached end of string */ +} +/*--------------------------------------------------------------------------*/ +int ffedit_columns( + fitsfile **fptr, /* IO - pointer to input table; on output it */ + /* points to the new selected rows table */ + char *outfile, /* I - name for output file */ + char *expr, /* I - column edit expression */ + int *status) +/* + modify columns in a table and/or header keywords in the HDU +*/ +{ + fitsfile *newptr; + int ii, hdunum, slen, colnum = -1, testnum, deletecol = 0, savecol = 0; + int numcols = 0, *colindex = 0, tstatus = 0; + char *tstbuff=0, *cptr, *cptr2, *cptr3, *clause = NULL, keyname[FLEN_KEYWORD]; + char colname[FLEN_VALUE], oldname[FLEN_VALUE], colformat[FLEN_VALUE]; + char *file_expr = NULL, testname[FLEN_VALUE], card[FLEN_CARD]; + + if (*outfile) + { + /* create new empty file in to hold the selected rows */ + if (ffinit(&newptr, outfile, status) > 0) + { + ffpmsg("failed to create file for copy (ffedit_columns)"); + return(*status); + } + + fits_get_hdu_num(*fptr, &hdunum); /* current HDU number in input file */ + + /* copy all HDUs to the output copy, if the 'only_one' flag is not set */ + if (!((*fptr)->Fptr)->only_one) { + for (ii = 1; 1; ii++) + { + if (fits_movabs_hdu(*fptr, ii, NULL, status) > 0) + break; + + fits_copy_hdu(*fptr, newptr, 0, status); + } + + if (*status == END_OF_FILE) + { + *status = 0; /* got the expected EOF error; reset = 0 */ + } + else if (*status > 0) + { + ffclos(newptr, status); + ffpmsg("failed to copy all HDUs from input file (ffedit_columns)"); + return(*status); + } + + + } else { + /* only copy the primary array and the designated table extension */ + fits_movabs_hdu(*fptr, 1, NULL, status); + fits_copy_hdu(*fptr, newptr, 0, status); + fits_movabs_hdu(*fptr, hdunum, NULL, status); + fits_copy_hdu(*fptr, newptr, 0, status); + if (*status > 0) + { + ffclos(newptr, status); + ffpmsg("failed to copy all HDUs from input file (ffedit_columns)"); + return(*status); + } + hdunum = 2; + } + + /* close the original file and return ptr to the new image */ + ffclos(*fptr, status); + + *fptr = newptr; /* reset the pointer to the new table */ + + /* move back to the selected table HDU */ + if (fits_movabs_hdu(*fptr, hdunum, NULL, status) > 0) + { + ffpmsg("failed to copy the input file (ffedit_columns)"); + return(*status); + } + } + + /* remove the "col " from the beginning of the column edit expression */ + cptr = expr + 4; + + while (*cptr == ' ') + cptr++; /* skip leading white space */ + + /* Check if need to import expression from a file */ + + if( *cptr=='@' ) { + if( ffimport_file( cptr+1, &file_expr, status ) ) return(*status); + cptr = file_expr; + while (*cptr == ' ') + cptr++; /* skip leading white space... again */ + } + + tstatus = 0; + ffgncl(*fptr, &numcols, &tstatus); /* get initial # of cols */ + + /* as of July 2012, the CFITSIO column filter syntax was modified */ + /* so that commas may be used to separate clauses, as well as semi-colons. */ + /* This was done because users cannot enter the semi-colon in the HEASARC's */ + /* Hera on-line data processing system for computer security reasons. */ + /* Therefore, we must convert those commas back to semi-colons here, but we */ + /* must not convert any columns that occur within parenthesies. */ + + if (comma2semicolon(cptr)) { + ffpmsg("parsing error in column filter expression"); + ffpmsg(cptr); + if( file_expr ) free( file_expr ); + *status = PARSE_SYNTAX_ERR; + return(*status); + } + + /* parse expression and get first clause, if more than 1 */ + while ((slen = fits_get_token2(&cptr, ";", &clause, NULL, status)) > 0 ) + { + if( *cptr==';' ) cptr++; + clause[slen] = '\0'; + + if (clause[0] == '!' || clause[0] == '-') + { + char *clause1 = clause+1; + /* ===================================== */ + /* Case I. delete this column or keyword */ + /* ===================================== */ + + /* Check that clause does not have leading '#' and + that column name exists */ + if (clause1[0] && clause1[0] != '#' && + ffgcno(*fptr, CASEINSEN, clause1, &colnum, status) <= 0) + { + /* a column with this name exists, so try to delete it */ + if (ffdcol(*fptr, colnum, status) > 0) + { + ffpmsg("failed to delete column in input file:"); + ffpmsg(clause); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if( clause ) free(clause); + return(*status); + } + deletecol = 1; /* set flag that at least one col was deleted */ + numcols--; + colnum = -1; + } + else + { + int delall = 0, clen = 0; + ffcmsg(); /* clear previous error message from ffgcno */ + /* try deleting a keyword with this name */ + *status = 0; + /* skip past leading '#' if any */ + if (clause1[0] == '#') clause1++; + clen = strlen(clause1); + + /* Repeat deletion of keyword if requested with trailing '+' */ + if (clen > 1 && clause1[clen-1] == '+') { + delall = 1; + clause1[clen-1] = 0; + } + /* Single or repeated deletions until done */ + do { + if (ffdkey(*fptr, clause1, status) > 0) + { + if (delall && *status == KEY_NO_EXIST && + (strchr(clause1,'*') || strchr(clause1,'?')) ) { + /* Found last wildcard item. Stop deleting */ + ffcmsg(); + *status = 0; + delall = 0; /* Force end of this loop */ + } else { + /* This was not a wildcard deletion, or it resulted in + another kind of error */ + ffpmsg("column or keyword to be deleted does not exist:"); + ffpmsg(clause1); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if( clause ) free(clause); + return(*status); + } + } + } while(delall); /* end do{} */ + } + } + else + { + /* ===================================================== */ + /* Case II: + this is either a column name, (case 1) + + or a new column name followed by double = ("==") followed + by the old name which is to be renamed. (case 2A) + + or a column or keyword name followed by a single "=" and a + calculation expression (case 2B) */ + /* ===================================================== */ + cptr2 = clause; + slen = fits_get_token2(&cptr2, "( =", &tstbuff, NULL, status); + + if (slen == 0 || *status) + { + ffpmsg("error: column or keyword name is blank (ffedit_columns):"); + ffpmsg(clause); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + if (*status==0) + *status=URL_PARSE_ERROR; + return(*status); + } + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("error: column or keyword name is too long (ffedit_columns):"); + ffpmsg(clause); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + free(tstbuff); + return(*status= URL_PARSE_ERROR); + } + strcpy(colname, tstbuff); + free(tstbuff); + tstbuff=0; + + /* If this is a keyword of the form + #KEYWORD# + then transform to the form + #KEYWORDn + where n is the previously used column number + */ + if (colname[0] == '#' && + strstr(colname+1, "#") == (colname + strlen(colname) - 1)) + { + if (colnum <= 0) + { + ffpmsg("The keyword name:"); + ffpmsg(colname); + ffpmsg("is invalid unless a column has been previously"); + ffpmsg("created or editted by a calculator command"); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status = URL_PARSE_ERROR); + } + colname[strlen(colname)-1] = '\0'; + /* Make keyword name and put it in oldname */ + ffkeyn(colname+1, colnum, oldname, status); + if (*status) return (*status); + /* Re-copy back into colname */ + strcpy(colname+1,oldname); + } + else if (strstr(colname, "#") == (colname + strlen(colname) - 1)) + { + /* colname is of the form "NAME#"; if + a) colnum is defined, and + b) a column with literal name "NAME#" does not exist, and + c) a keyword with name "NAMEn" (where n=colnum) exists, then + transfrom the colname string to "NAMEn", otherwise + do nothing. + */ + if (colnum > 0) { /* colnum must be defined */ + tstatus = 0; + ffgcno(*fptr, CASEINSEN, colname, &testnum, &tstatus); + if (tstatus != 0 && tstatus != COL_NOT_UNIQUE) + { + /* OK, column doesn't exist, now see if keyword exists */ + ffcmsg(); /* clear previous error message from ffgcno */ + strcpy(testname, colname); + testname[strlen(testname)-1] = '\0'; + /* Make keyword name and put it in oldname */ + ffkeyn(testname, colnum, oldname, status); + if (*status) { + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return (*status); + } + + tstatus = 0; + if (!fits_read_card(*fptr, oldname, card, &tstatus)) { + /* Keyword does exist; copy real name back into colname */ + strcpy(colname,oldname); + } + } + } + } + + /* if we encountered an opening parenthesis, then we need to */ + /* find the closing parenthesis, and concatinate the 2 strings */ + /* This supports expressions like: + [col #EXTNAME(Extension name)="GTI"] + */ + if (*cptr2 == '(') + { + if (fits_get_token2(&cptr2, ")", &tstbuff, NULL, status)==0) + { + strcat(colname,")"); + } + else + { + if ((strlen(tstbuff) + strlen(colname) + 1) > + FLEN_VALUE-1) + { + ffpmsg("error: column name is too long (ffedit_columns):"); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + free(tstbuff); + *status=URL_PARSE_ERROR; + return (*status); + } + strcat(colname, tstbuff); + strcat(colname, ")"); + free(tstbuff); + tstbuff=0; + } + cptr2++; + } + + while (*cptr2 == ' ') + cptr2++; /* skip white space */ + + if (*cptr2 != '=') + { + /* ------------------------------------ */ + /* case 1 - simply the name of a column */ + /* ------------------------------------ */ + + /* look for matching column */ + ffgcno(*fptr, CASEINSEN, colname, &testnum, status); + + while (*status == COL_NOT_UNIQUE) + { + /* the column name contained wild cards, and it */ + /* matches more than one column in the table. */ + + colnum = testnum; + + /* keep this column in the output file */ + savecol = 1; + + if (!colindex) + colindex = (int *) calloc(999, sizeof(int)); + + colindex[colnum - 1] = 1; /* flag this column number */ + + /* look for other matching column names */ + ffgcno(*fptr, CASEINSEN, colname, &testnum, status); + + if (*status == COL_NOT_FOUND) + *status = 999; /* temporary status flag value */ + } + + if (*status <= 0) + { + colnum = testnum; + + /* keep this column in the output file */ + savecol = 1; + + if (!colindex) + colindex = (int *) calloc(999, sizeof(int)); + + colindex[colnum - 1] = 1; /* flag this column number */ + } + else if (*status == 999) + { + /* this special flag value does not represent an error */ + *status = 0; + } + else + { + ffpmsg("Syntax error in columns specifier in input URL:"); + ffpmsg(cptr2); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status = URL_PARSE_ERROR); + } + } + else + { + /* ----------------------------------------------- */ + /* case 2 where the token ends with an equals sign */ + /* ----------------------------------------------- */ + + cptr2++; /* skip over the first '=' */ + + if (*cptr2 == '=') + { + /*................................................. */ + /* Case A: rename a column or keyword; syntax is + "new_name == old_name" */ + /*................................................. */ + + cptr2++; /* skip the 2nd '=' */ + while (*cptr2 == ' ') + cptr2++; /* skip white space */ + + if (fits_get_token2(&cptr2, " ", &tstbuff, NULL, status)==0) + { + oldname[0]=0; + } + else + { + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("error: column name syntax is too long (ffedit_columns):"); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + free(tstbuff); + *status=URL_PARSE_ERROR; + return (*status); + } + strcpy(oldname, tstbuff); + free(tstbuff); + tstbuff=0; + } + /* get column number of the existing column */ + if (ffgcno(*fptr, CASEINSEN, oldname, &colnum, status) <= 0) + { + /* modify the TTYPEn keyword value with the new name */ + ffkeyn("TTYPE", colnum, keyname, status); + + if (ffmkys(*fptr, keyname, colname, NULL, status) > 0) + { + ffpmsg("failed to rename column in input file"); + ffpmsg(" oldname ="); + ffpmsg(oldname); + ffpmsg(" newname ="); + ffpmsg(colname); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status); + } + /* keep this column in the output file */ + savecol = 1; + if (!colindex) + colindex = (int *) calloc(999, sizeof(int)); + + colindex[colnum - 1] = 1; /* flag this column number */ + } + else + { + /* try renaming a keyword */ + ffcmsg(); /* clear error message stack */ + *status = 0; + if (ffmnam(*fptr, oldname, colname, status) > 0) + { + ffpmsg("column or keyword to be renamed does not exist:"); + ffpmsg(clause); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status); + } + } + } + else + { + /*...................................................... */ + /* Case B: */ + /* this must be a general column/keyword calc expression */ + /* "name = expression" or "colname(TFORM) = expression" */ + /*...................................................... */ + + /* parse the name and TFORM values, if present */ + colformat[0] = '\0'; + cptr3 = colname; + + if (fits_get_token2(&cptr3, "(", &tstbuff, NULL, status)==0) + { + oldname[0]=0; + } + else + { + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("column expression is too long (ffedit_columns)"); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + free(tstbuff); + *status=URL_PARSE_ERROR; + return(*status); + } + strcpy(oldname, tstbuff); + free(tstbuff); + tstbuff=0; + } + if (cptr3[0] == '(' ) + { + cptr3++; /* skip the '(' */ + if (fits_get_token2(&cptr3, ")", &tstbuff, NULL, status)==0) + { + colformat[0]=0; + } + else + { + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("column expression is too long (ffedit_columns)"); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + free(tstbuff); + *status=URL_PARSE_ERROR; + return(*status); + } + strcpy(colformat, tstbuff); + free(tstbuff); + tstbuff=0; + } + } + + /* calculate values for the column or keyword */ + /* cptr2 = the expression to be calculated */ + /* oldname = name of the column or keyword */ + /* colformat = column format, or keyword comment string */ + if (fits_calculator(*fptr, cptr2, *fptr, oldname, colformat, + status) > 0) { + + ffpmsg("Unable to calculate expression"); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status); + } + + /* test if this is a column and not a keyword */ + tstatus = 0; + ffgcno(*fptr, CASEINSEN, oldname, &testnum, &tstatus); + if (tstatus == 0) + { + /* keep this column in the output file */ + colnum = testnum; + savecol = 1; + + if (!colindex) + colindex = (int *) calloc(999, sizeof(int)); + + colindex[colnum - 1] = 1; + if (colnum > numcols)numcols++; + } + else + { + ffcmsg(); /* clear the error message stack */ + } + } + } + } + if (clause) free(clause); /* free old clause before getting new one */ + clause = NULL; + } + + if (savecol && !deletecol) + { + /* need to delete all but the specified columns */ + for (ii = numcols; ii > 0; ii--) + { + if (!colindex[ii-1]) /* delete this column */ + { + if (ffdcol(*fptr, ii, status) > 0) + { + ffpmsg("failed to delete column in input file:"); + ffpmsg(clause); + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + return(*status); + } + } + } + } + + if( colindex ) free( colindex ); + if( file_expr ) free( file_expr ); + if (clause) free(clause); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_copy_cell2image( + fitsfile *fptr, /* I - point to input table */ + fitsfile *newptr, /* O - existing output file; new image HDU + will be appended to it */ + char *colname, /* I - column name / number containing the image*/ + long rownum, /* I - number of the row containing the image */ + int *status) /* IO - error status */ + +/* + Copy a table cell of a given row and column into an image extension. + The output file must already have been created. A new image + extension will be created in that file. + + This routine was written by Craig Markwardt, GSFC +*/ + +{ + unsigned char buffer[30000]; + int hdutype, colnum, typecode, bitpix, naxis, maxelem, tstatus; + LONGLONG naxes[9], nbytes, firstbyte, ntodo; + LONGLONG repeat, startpos, elemnum, rowlen, tnull; + long twidth, incre; + double scale, zero; + char tform[20]; + char card[FLEN_CARD]; + char templt[FLEN_CARD] = ""; + + /* Table-to-image keyword translation table */ + /* INPUT OUTPUT */ + /* 01234567 01234567 */ + char *patterns[][2] = {{"TSCALn", "BSCALE" }, /* Standard FITS keywords */ + {"TZEROn", "BZERO" }, + {"TUNITn", "BUNIT" }, + {"TNULLn", "BLANK" }, + {"TDMINn", "DATAMIN" }, + {"TDMAXn", "DATAMAX" }, + {"iCTYPn", "CTYPEi" }, /* Coordinate labels */ + {"iCTYna", "CTYPEia" }, + {"iCUNIn", "CUNITi" }, /* Coordinate units */ + {"iCUNna", "CUNITia" }, + {"iCRVLn", "CRVALi" }, /* WCS keywords */ + {"iCRVna", "CRVALia" }, + {"iCDLTn", "CDELTi" }, + {"iCDEna", "CDELTia" }, + {"iCRPXn", "CRPIXi" }, + {"iCRPna", "CRPIXia" }, + {"ijPCna", "PCi_ja" }, + {"ijCDna", "CDi_ja" }, + {"iVn_ma", "PVi_ma" }, + {"iSn_ma", "PSi_ma" }, + {"iCRDna", "CRDERia" }, + {"iCSYna", "CSYERia" }, + {"iCROTn", "CROTAi" }, + {"WCAXna", "WCSAXESa"}, + {"WCSNna", "WCSNAMEa"}, + + {"LONPna", "LONPOLEa"}, + {"LATPna", "LATPOLEa"}, + {"EQUIna", "EQUINOXa"}, + {"MJDOBn", "MJD-OBS" }, + {"MJDAn", "MJD-AVG" }, + {"RADEna", "RADESYSa"}, + {"iCNAna", "CNAMEia" }, + {"DAVGn", "DATE-AVG"}, + + /* Delete table keywords related to other columns */ + {"T????#a", "-" }, + {"TC??#a", "-" }, + {"TWCS#a", "-" }, + {"TDIM#", "-" }, + {"iCTYPm", "-" }, + {"iCUNIm", "-" }, + {"iCRVLm", "-" }, + {"iCDLTm", "-" }, + {"iCRPXm", "-" }, + {"iCTYma", "-" }, + {"iCUNma", "-" }, + {"iCRVma", "-" }, + {"iCDEma", "-" }, + {"iCRPma", "-" }, + {"ijPCma", "-" }, + {"ijCDma", "-" }, + {"iVm_ma", "-" }, + {"iSm_ma", "-" }, + {"iCRDma", "-" }, + {"iCSYma", "-" }, + {"iCROTm", "-" }, + {"WCAXma", "-" }, + {"WCSNma", "-" }, + + {"LONPma", "-" }, + {"LATPma", "-" }, + {"EQUIma", "-" }, + {"MJDOBm", "-" }, + {"MJDAm", "-" }, + {"RADEma", "-" }, + {"iCNAma", "-" }, + {"DAVGm", "-" }, + + {"EXTNAME", "-" }, /* Remove structural keywords*/ + {"EXTVER", "-" }, + {"EXTLEVEL","-" }, + {"CHECKSUM","-" }, + {"DATASUM", "-" }, + + {"*", "+" }}; /* copy all other keywords */ + int npat; + + if (*status > 0) + return(*status); + + /* get column number */ + if (ffgcno(fptr, CASEINSEN, colname, &colnum, status) > 0) + { + ffpmsg("column containing image in table cell does not exist:"); + ffpmsg(colname); + return(*status); + } + + /*---------------------------------------------------*/ + /* Check input and get parameters about the column: */ + /*---------------------------------------------------*/ + if ( ffgcprll(fptr, colnum, rownum, 1L, 1L, 0, &scale, &zero, + tform, &twidth, &typecode, &maxelem, &startpos, &elemnum, &incre, + &repeat, &rowlen, &hdutype, &tnull, (char *) buffer, status) > 0 ) + return(*status); + + /* get the actual column name, in case a column number was given */ + ffkeyn("", colnum, templt, &tstatus); + ffgcnn(fptr, CASEINSEN, templt, colname, &colnum, &tstatus); + + if (hdutype != BINARY_TBL) + { + ffpmsg("This extension is not a binary table."); + ffpmsg(" Cannot open the image in a binary table cell."); + return(*status = NOT_BTABLE); + } + + if (typecode < 0) + { + /* variable length array */ + typecode *= -1; + + /* variable length arrays are 1-dimensional by default */ + naxis = 1; + naxes[0] = repeat; + } + else + { + /* get the dimensions of the image */ + ffgtdmll(fptr, colnum, 9, &naxis, naxes, status); + } + + if (*status > 0) + { + ffpmsg("Error getting the dimensions of the image"); + return(*status); + } + + /* determine BITPIX value for the image */ + if (typecode == TBYTE) + { + bitpix = BYTE_IMG; + nbytes = repeat; + } + else if (typecode == TSHORT) + { + bitpix = SHORT_IMG; + nbytes = repeat * 2; + } + else if (typecode == TLONG) + { + bitpix = LONG_IMG; + nbytes = repeat * 4; + } + else if (typecode == TFLOAT) + { + bitpix = FLOAT_IMG; + nbytes = repeat * 4; + } + else if (typecode == TDOUBLE) + { + bitpix = DOUBLE_IMG; + nbytes = repeat * 8; + } + else if (typecode == TLONGLONG) + { + bitpix = LONGLONG_IMG; + nbytes = repeat * 8; + } + else if (typecode == TLOGICAL) + { + bitpix = BYTE_IMG; + nbytes = repeat; + } + else + { + ffpmsg("Error: the following image column has invalid datatype:"); + ffpmsg(colname); + ffpmsg(tform); + ffpmsg("Cannot open an image in a single row of this column."); + return(*status = BAD_TFORM); + } + + /* create new image in output file */ + if (ffcrimll(newptr, bitpix, naxis, naxes, status) > 0) + { + ffpmsg("failed to write required primary array keywords in the output file"); + return(*status); + } + + npat = sizeof(patterns)/sizeof(patterns[0][0])/2; + + /* skip over the first 8 keywords, starting just after TFIELDS */ + fits_translate_keywords(fptr, newptr, 9, patterns, npat, + colnum, 0, 0, status); + + /* add some HISTORY */ + snprintf(card,FLEN_CARD,"HISTORY This image was copied from row %ld of column '%s',", + rownum, colname); +/* disable this; leave it up to the caller to write history if needed. + ffprec(newptr, card, status); +*/ + /* the use of ffread routine, below, requires that any 'dirty' */ + /* buffers in memory be flushed back to the file first */ + + ffflsh(fptr, FALSE, status); + + /* finally, copy the data, one buffer size at a time */ + ffmbyt(fptr, startpos, TRUE, status); + firstbyte = 1; + + /* the upper limit on the number of bytes must match the declaration */ + /* read up to the first 30000 bytes in the normal way with ffgbyt */ + + ntodo = minvalue(30000, nbytes); + ffgbyt(fptr, ntodo, buffer, status); + ffptbb(newptr, 1, firstbyte, ntodo, buffer, status); + + nbytes -= ntodo; + firstbyte += ntodo; + + /* read any additional bytes with low-level ffread routine, for speed */ + while (nbytes && (*status <= 0) ) + { + ntodo = minvalue(30000, nbytes); + ffread((fptr)->Fptr, (long) ntodo, buffer, status); + ffptbb(newptr, 1, firstbyte, ntodo, buffer, status); + nbytes -= ntodo; + firstbyte += ntodo; + } + + /* Re-scan the header so that CFITSIO knows about all the new keywords */ + ffrdef(newptr,status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_copy_image2cell( + fitsfile *fptr, /* I - pointer to input image extension */ + fitsfile *newptr, /* I - pointer to output table */ + char *colname, /* I - name of column containing the image */ + long rownum, /* I - number of the row containing the image */ + int copykeyflag, /* I - controls which keywords to copy */ + int *status) /* IO - error status */ + +/* + Copy an image extension into a table cell at a given row and + column. The table must have already been created. If the "colname" + column exists, it will be used, otherwise a new column will be created + in the table. + + The "copykeyflag" parameter controls which keywords to copy from the + input image to the output table header (with any appropriate translation). + + copykeyflag = 0 -- no keywords will be copied + copykeyflag = 1 -- essentially all keywords will be copied + copykeyflag = 2 -- copy only the WCS related keywords + + This routine was written by Craig Markwardt, GSFC + +*/ +{ + tcolumn *colptr; + unsigned char buffer[30000]; + int ii, hdutype, colnum, typecode, bitpix, naxis, ncols, hdunum; + char tformchar, tform[20], card[FLEN_CARD]; + LONGLONG imgstart, naxes[9], nbytes, repeat, ntodo,firstbyte; + char filename[FLEN_FILENAME+20]; + + int npat; + + int naxis1; + LONGLONG naxes1[9] = {0,0,0,0,0,0,0,0,0}, repeat1, width1; + int typecode1; + unsigned char dummy = 0; + + LONGLONG headstart, datastart, dataend; + + /* Image-to-table keyword translation table */ + /* INPUT OUTPUT */ + /* 01234567 01234567 */ + char *patterns[][2] = {{"BSCALE", "TSCALn" }, /* Standard FITS keywords */ + {"BZERO", "TZEROn" }, + {"BUNIT", "TUNITn" }, + {"BLANK", "TNULLn" }, + {"DATAMIN", "TDMINn" }, + {"DATAMAX", "TDMAXn" }, + {"CTYPEi", "iCTYPn" }, /* Coordinate labels */ + {"CTYPEia", "iCTYna" }, + {"CUNITi", "iCUNIn" }, /* Coordinate units */ + {"CUNITia", "iCUNna" }, + {"CRVALi", "iCRVLn" }, /* WCS keywords */ + {"CRVALia", "iCRVna" }, + {"CDELTi", "iCDLTn" }, + {"CDELTia", "iCDEna" }, + {"CRPIXj", "jCRPXn" }, + {"CRPIXja", "jCRPna" }, + {"PCi_ja", "ijPCna" }, + {"CDi_ja", "ijCDna" }, + {"PVi_ma", "iVn_ma" }, + {"PSi_ma", "iSn_ma" }, + {"WCSAXESa","WCAXna" }, + {"WCSNAMEa","WCSNna" }, + {"CRDERia", "iCRDna" }, + {"CSYERia", "iCSYna" }, + {"CROTAi", "iCROTn" }, + + {"LONPOLEa","LONPna"}, + {"LATPOLEa","LATPna"}, + {"EQUINOXa","EQUIna"}, + {"MJD-OBS", "MJDOBn" }, + {"MJD-AVG", "MJDAn" }, + {"RADESYSa","RADEna"}, + {"CNAMEia", "iCNAna" }, + {"DATE-AVG","DAVGn"}, + + {"NAXISi", "-" }, /* Remove structural keywords*/ + {"PCOUNT", "-" }, + {"GCOUNT", "-" }, + {"EXTEND", "-" }, + {"EXTNAME", "-" }, + {"EXTVER", "-" }, + {"EXTLEVEL","-" }, + {"CHECKSUM","-" }, + {"DATASUM", "-" }, + {"*", "+" }}; /* copy all other keywords */ + + + if (*status > 0) + return(*status); + + if (fptr == 0 || newptr == 0) return (*status = NULL_INPUT_PTR); + + if (ffghdt(fptr, &hdutype, status) > 0) { + ffpmsg("could not get input HDU type"); + return (*status); + } + + if (hdutype != IMAGE_HDU) { + ffpmsg("The input extension is not an image."); + ffpmsg(" Cannot open the image."); + return(*status = NOT_IMAGE); + } + + if (ffghdt(newptr, &hdutype, status) > 0) { + ffpmsg("could not get output HDU type"); + return (*status); + } + + if (hdutype != BINARY_TBL) { + ffpmsg("The output extension is not a table."); + return(*status = NOT_BTABLE); + } + + + if (ffgiprll(fptr, 9, &bitpix, &naxis, naxes, status) > 0) { + ffpmsg("Could not read image parameters."); + return (*status); + } + + /* Determine total number of pixels in the image */ + repeat = 1; + for (ii = 0; ii < naxis; ii++) repeat *= naxes[ii]; + + /* Determine the TFORM value for the table cell */ + if (bitpix == BYTE_IMG) { + typecode = TBYTE; + tformchar = 'B'; + nbytes = repeat; + } else if (bitpix == SHORT_IMG) { + typecode = TSHORT; + tformchar = 'I'; + nbytes = repeat*2; + } else if (bitpix == LONG_IMG) { + typecode = TLONG; + tformchar = 'J'; + nbytes = repeat*4; + } else if (bitpix == FLOAT_IMG) { + typecode = TFLOAT; + tformchar = 'E'; + nbytes = repeat*4; + } else if (bitpix == DOUBLE_IMG) { + typecode = TDOUBLE; + tformchar = 'D'; + nbytes = repeat*8; + } else if (bitpix == LONGLONG_IMG) { + typecode = TLONGLONG; + tformchar = 'K'; + nbytes = repeat*8; + } else { + ffpmsg("Error: the image has an invalid datatype."); + return (*status = BAD_BITPIX); + } + + /* get column number */ + ffpmrk(); + ffgcno(newptr, CASEINSEN, colname, &colnum, status); + ffcmrk(); + + /* Column does not exist; create it */ + if (*status) { + + *status = 0; + snprintf(tform, 20, "%.0f%c", (double) repeat, tformchar); + ffgncl(newptr, &ncols, status); + colnum = ncols+1; + fficol(newptr, colnum, colname, tform, status); + ffptdmll(newptr, colnum, naxis, naxes, status); + + if (*status) { + ffpmsg("Could not insert new column into output table."); + return *status; + } + + } else { + + ffgtdmll(newptr, colnum, 9, &naxis1, naxes1, status); + if (*status > 0 || naxis != naxis1) { + ffpmsg("Input image dimensions and output table cell dimensions do not match."); + return (*status = BAD_DIMEN); + } + for (ii=0; ii 0) || (typecode1 != typecode) || (repeat1 != repeat)) { + ffpmsg("Input image data type does not match output table cell type."); + return (*status = BAD_TFORM); + } + } + + /* copy keywords from input image to output table, if required */ + + if (copykeyflag) { + + npat = sizeof(patterns)/sizeof(patterns[0][0])/2; + + if (copykeyflag == 2) { /* copy only the WCS-related keywords */ + patterns[npat-1][1] = "-"; + } + + /* The 3rd parameter value = 5 means skip the first 4 keywords in the image */ + fits_translate_keywords(fptr, newptr, 5, patterns, npat, + colnum, 0, 0, status); + } + + /* Here is all the code to compute offsets: + * * byte offset from start of row to column (dest table) + * * byte offset from start of file to image data (source image) + */ + + /* Force the writing of the row of the table by writing the last byte of + the array, which grows the table, and/or shifts following extensions */ + ffpcl(newptr, TBYTE, colnum, rownum, repeat, 1, &dummy, status); + + /* byte offset within the row to the start of the image column */ + colptr = (newptr->Fptr)->tableptr; /* point to first column */ + colptr += (colnum - 1); /* offset to correct column structure */ + firstbyte = colptr->tbcol + 1; + + /* get starting address of input image to be read */ + ffghadll(fptr, &headstart, &datastart, &dataend, status); + imgstart = datastart; + + snprintf(card, FLEN_CARD, "HISTORY Table column '%s' row %ld copied from image", + colname, rownum); +/* + Don't automatically write History keywords; leave this up to the caller. + ffprec(newptr, card, status); +*/ + + /* write HISTORY keyword with the file name (this is now disabled)*/ + + filename[0] = '\0'; hdunum = 0; + strcpy(filename, "HISTORY "); + ffflnm(fptr, filename+strlen(filename), status); + ffghdn(fptr, &hdunum); + snprintf(filename+strlen(filename),FLEN_FILENAME+20-strlen(filename),"[%d]", hdunum-1); +/* + ffprec(newptr, filename, status); +*/ + + /* the use of ffread routine, below, requires that any 'dirty' */ + /* buffers in memory be flushed back to the file first */ + + ffflsh(fptr, FALSE, status); + + /* move to the first byte of the input image */ + ffmbyt(fptr, imgstart, TRUE, status); + + ntodo = minvalue(30000L, nbytes); + ffgbyt(fptr, ntodo, buffer, status); /* read input image */ + ffptbb(newptr, rownum, firstbyte, ntodo, buffer, status); /* write to table */ + + nbytes -= ntodo; + firstbyte += ntodo; + + + /* read any additional bytes with low-level ffread routine, for speed */ + while (nbytes && (*status <= 0) ) + { + ntodo = minvalue(30000L, nbytes); + ffread(fptr->Fptr, (long) ntodo, buffer, status); + ffptbb(newptr, rownum, firstbyte, ntodo, buffer, status); + nbytes -= ntodo; + firstbyte += ntodo; + } + + /* Re-scan the header so that CFITSIO knows about all the new keywords */ + ffrdef(newptr,status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_select_image_section( + fitsfile **fptr, /* IO - pointer to input image; on output it */ + /* points to the new subimage */ + char *outfile, /* I - name for output file */ + char *expr, /* I - Image section expression */ + int *status) +{ + /* + copies an image section from the input file to a new output file. + Any HDUs preceding or following the image are also copied to the + output file. + */ + + fitsfile *newptr; + int ii, hdunum; + + /* create new empty file to hold the image section */ + if (ffinit(&newptr, outfile, status) > 0) + { + ffpmsg( + "failed to create output file for image section:"); + ffpmsg(outfile); + return(*status); + } + + fits_get_hdu_num(*fptr, &hdunum); /* current HDU number in input file */ + + /* copy all preceding extensions to the output file, if 'only_one' flag not set */ + if (!(((*fptr)->Fptr)->only_one)) { + for (ii = 1; ii < hdunum; ii++) + { + fits_movabs_hdu(*fptr, ii, NULL, status); + if (fits_copy_hdu(*fptr, newptr, 0, status) > 0) + { + ffclos(newptr, status); + return(*status); + } + } + + /* move back to the original HDU position */ + fits_movabs_hdu(*fptr, hdunum, NULL, status); + } + + if (fits_copy_image_section(*fptr, newptr, expr, status) > 0) + { + ffclos(newptr, status); + return(*status); + } + + /* copy any remaining HDUs to the output file, if 'only_one' flag not set */ + + if (!(((*fptr)->Fptr)->only_one)) { + for (ii = hdunum + 1; 1; ii++) + { + if (fits_movabs_hdu(*fptr, ii, NULL, status) > 0) + break; + + fits_copy_hdu(*fptr, newptr, 0, status); + } + + if (*status == END_OF_FILE) + *status = 0; /* got the expected EOF error; reset = 0 */ + else if (*status > 0) + { + ffclos(newptr, status); + return(*status); + } + } else { + ii = hdunum + 1; /* this value of ii is required below */ + } + + /* close the original file and return ptr to the new image */ + ffclos(*fptr, status); + + *fptr = newptr; /* reset the pointer to the new table */ + + /* move back to the image subsection */ + if (ii - 1 != hdunum) + fits_movabs_hdu(*fptr, hdunum, NULL, status); + else + { + /* may have to reset BSCALE and BZERO pixel scaling, */ + /* since the keywords were previously turned off */ + + if (ffrdef(*fptr, status) > 0) + { + ffclos(*fptr, status); + return(*status); + } + + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_copy_image_section( + fitsfile *fptr, /* I - pointer to input image */ + fitsfile *newptr, /* I - pointer to output image */ + char *expr, /* I - Image section expression */ + int *status) +{ + /* + copies an image section from the input file to a new output HDU + */ + + int bitpix, naxis, numkeys, nkey; + long naxes[] = {1,1,1,1,1,1,1,1,1}, smin, smax, sinc; + long fpixels[] = {1,1,1,1,1,1,1,1,1}; + long lpixels[] = {1,1,1,1,1,1,1,1,1}; + long incs[] = {1,1,1,1,1,1,1,1,1}; + char *cptr, keyname[FLEN_KEYWORD], card[FLEN_CARD]; + int ii, tstatus, anynull; + long minrow, maxrow, minslice, maxslice, mincube, maxcube; + long firstpix; + long ncubeiter, nsliceiter, nrowiter, kiter, jiter, iiter; + int klen, kk, jj; + long outnaxes[9], outsize, buffsize; + double *buffer, crpix, cdelt; + + if (*status > 0) + return(*status); + + /* get the size of the input image */ + fits_get_img_type(fptr, &bitpix, status); + fits_get_img_dim(fptr, &naxis, status); + if (fits_get_img_size(fptr, naxis, naxes, status) > 0) + return(*status); + + if (naxis < 1 || naxis > 4) + { + ffpmsg( + "Input image either had NAXIS = 0 (NULL image) or has > 4 dimensions"); + return(*status = BAD_NAXIS); + } + + /* create output image with same size and type as the input image */ + /* Will update the size later */ + fits_create_img(newptr, bitpix, naxis, naxes, status); + + /* copy all other non-structural keywords from the input to output file */ + fits_get_hdrspace(fptr, &numkeys, NULL, status); + + for (nkey = 4; nkey <= numkeys; nkey++) /* skip the first few keywords */ + { + fits_read_record(fptr, nkey, card, status); + + if (fits_get_keyclass(card) > TYP_CMPRS_KEY) + { + /* write the record to the output file */ + fits_write_record(newptr, card, status); + } + } + + if (*status > 0) + { + ffpmsg("error copying header from input image to output image"); + return(*status); + } + + /* parse the section specifier to get min, max, and inc for each axis */ + /* and the size of each output image axis */ + + cptr = expr; + for (ii=0; ii < naxis; ii++) + { + if (fits_get_section_range(&cptr, &smin, &smax, &sinc, status) > 0) + { + ffpmsg("error parsing the following image section specifier:"); + ffpmsg(expr); + return(*status); + } + + if (smax == 0) + smax = naxes[ii]; /* use whole axis by default */ + else if (smin == 0) + smin = naxes[ii]; /* use inverted whole axis */ + + if (smin > naxes[ii] || smax > naxes[ii]) + { + ffpmsg("image section exceeds dimensions of input image:"); + ffpmsg(expr); + return(*status = BAD_NAXIS); + } + + fpixels[ii] = smin; + lpixels[ii] = smax; + incs[ii] = sinc; + + if (smin <= smax) + outnaxes[ii] = (smax - smin + sinc) / sinc; + else + outnaxes[ii] = (smin - smax + sinc) / sinc; + + /* modify the NAXISn keyword */ + fits_make_keyn("NAXIS", ii + 1, keyname, status); + fits_modify_key_lng(newptr, keyname, outnaxes[ii], NULL, status); + + /* modify the WCS keywords if necessary */ + + if (fpixels[ii] != 1 || incs[ii] != 1) + { + for (kk=-1;kk<26; kk++) /* modify any alternate WCS keywords */ + { + /* read the CRPIXn keyword if it exists in the input file */ + fits_make_keyn("CRPIX", ii + 1, keyname, status); + + if (kk != -1) { + klen = strlen(keyname); + keyname[klen]='A' + kk; + keyname[klen + 1] = '\0'; + } + + tstatus = 0; + if (fits_read_key(fptr, TDOUBLE, keyname, + &crpix, NULL, &tstatus) == 0) + { + /* calculate the new CRPIXn value */ + if (fpixels[ii] <= lpixels[ii]) { + crpix = (crpix - (fpixels[ii])) / incs[ii] + 1.0; + /* crpix = (crpix - (fpixels[ii] - 1.0) - .5) / incs[ii] + 0.5; */ + } else { + crpix = (fpixels[ii] - crpix) / incs[ii] + 1.0; + /* crpix = (fpixels[ii] - (crpix - 1.0) - .5) / incs[ii] + 0.5; */ + } + + /* modify the value in the output file */ + fits_modify_key_dbl(newptr, keyname, crpix, 15, NULL, status); + + if (incs[ii] != 1 || fpixels[ii] > lpixels[ii]) + { + /* read the CDELTn keyword if it exists in the input file */ + fits_make_keyn("CDELT", ii + 1, keyname, status); + + if (kk != -1) { + klen = strlen(keyname); + keyname[klen]='A' + kk; + keyname[klen + 1] = '\0'; + } + + tstatus = 0; + if (fits_read_key(fptr, TDOUBLE, keyname, + &cdelt, NULL, &tstatus) == 0) + { + /* calculate the new CDELTn value */ + if (fpixels[ii] <= lpixels[ii]) + cdelt = cdelt * incs[ii]; + else + cdelt = cdelt * (-incs[ii]); + + /* modify the value in the output file */ + fits_modify_key_dbl(newptr, keyname, cdelt, 15, NULL, status); + } + + /* modify the CDi_j keywords if they exist in the input file */ + + fits_make_keyn("CD1_", ii + 1, keyname, status); + + if (kk != -1) { + klen = strlen(keyname); + keyname[klen]='A' + kk; + keyname[klen + 1] = '\0'; + } + + for (jj=0; jj < 9; jj++) /* look for up to 9 dimensions */ + { + keyname[2] = '1' + jj; + + tstatus = 0; + if (fits_read_key(fptr, TDOUBLE, keyname, + &cdelt, NULL, &tstatus) == 0) + { + /* calculate the new CDi_j value */ + if (fpixels[ii] <= lpixels[ii]) + cdelt = cdelt * incs[ii]; + else + cdelt = cdelt * (-incs[ii]); + + /* modify the value in the output file */ + fits_modify_key_dbl(newptr, keyname, cdelt, 15, NULL, status); + } + } + + } /* end of if (incs[ii]... loop */ + } /* end of fits_read_key loop */ + } /* end of for (kk loop */ + } + } /* end of main NAXIS loop */ + + if (ffrdef(newptr, status) > 0) /* force the header to be scanned */ + { + return(*status); + } + + /* turn off any scaling of the pixel values */ + fits_set_bscale(fptr, 1.0, 0.0, status); + fits_set_bscale(newptr, 1.0, 0.0, status); + + /* to reduce memory foot print, just read/write image 1 row at a time */ + + outsize = outnaxes[0]; + buffsize = (abs(bitpix) / 8) * outsize; + + buffer = (double *) malloc(buffsize); /* allocate memory for the image row */ + if (!buffer) + { + ffpmsg("fits_copy_image_section: no memory for image section"); + return(*status = MEMORY_ALLOCATION); + } + + /* read the image section then write it to the output file */ + + minrow = fpixels[1]; + maxrow = lpixels[1]; + if (minrow > maxrow) { + nrowiter = (minrow - maxrow + incs[1]) / incs[1]; + } else { + nrowiter = (maxrow - minrow + incs[1]) / incs[1]; + } + + minslice = fpixels[2]; + maxslice = lpixels[2]; + if (minslice > maxslice) { + nsliceiter = (minslice - maxslice + incs[2]) / incs[2]; + } else { + nsliceiter = (maxslice - minslice + incs[2]) / incs[2]; + } + + mincube = fpixels[3]; + maxcube = lpixels[3]; + if (mincube > maxcube) { + ncubeiter = (mincube - maxcube + incs[3]) / incs[3]; + } else { + ncubeiter = (maxcube - mincube + incs[3]) / incs[3]; + } + + firstpix = 1; + for (kiter = 0; kiter < ncubeiter; kiter++) + { + if (mincube > maxcube) { + fpixels[3] = mincube - (kiter * incs[3]); + } else { + fpixels[3] = mincube + (kiter * incs[3]); + } + + lpixels[3] = fpixels[3]; + + for (jiter = 0; jiter < nsliceiter; jiter++) + { + if (minslice > maxslice) { + fpixels[2] = minslice - (jiter * incs[2]); + } else { + fpixels[2] = minslice + (jiter * incs[2]); + } + + lpixels[2] = fpixels[2]; + + for (iiter = 0; iiter < nrowiter; iiter++) + { + if (minrow > maxrow) { + fpixels[1] = minrow - (iiter * incs[1]); + } else { + fpixels[1] = minrow + (iiter * incs[1]); + } + + lpixels[1] = fpixels[1]; + + if (bitpix == 8) + { + ffgsvb(fptr, 1, naxis, naxes, fpixels, lpixels, incs, 0, + (unsigned char *) buffer, &anynull, status); + + ffpprb(newptr, 1, firstpix, outsize, (unsigned char *) buffer, status); + } + else if (bitpix == 16) + { + ffgsvi(fptr, 1, naxis, naxes, fpixels, lpixels, incs, 0, + (short *) buffer, &anynull, status); + + ffppri(newptr, 1, firstpix, outsize, (short *) buffer, status); + } + else if (bitpix == 32) + { + ffgsvk(fptr, 1, naxis, naxes, fpixels, lpixels, incs, 0, + (int *) buffer, &anynull, status); + + ffpprk(newptr, 1, firstpix, outsize, (int *) buffer, status); + } + else if (bitpix == -32) + { + ffgsve(fptr, 1, naxis, naxes, fpixels, lpixels, incs, FLOATNULLVALUE, + (float *) buffer, &anynull, status); + + ffppne(newptr, 1, firstpix, outsize, (float *) buffer, FLOATNULLVALUE, status); + } + else if (bitpix == -64) + { + ffgsvd(fptr, 1, naxis, naxes, fpixels, lpixels, incs, DOUBLENULLVALUE, + buffer, &anynull, status); + + ffppnd(newptr, 1, firstpix, outsize, buffer, DOUBLENULLVALUE, + status); + } + else if (bitpix == 64) + { + ffgsvjj(fptr, 1, naxis, naxes, fpixels, lpixels, incs, 0, + (LONGLONG *) buffer, &anynull, status); + + ffpprjj(newptr, 1, firstpix, outsize, (LONGLONG *) buffer, status); + } + + firstpix += outsize; + } + } + } + + free(buffer); /* finished with the memory */ + + if (*status > 0) + { + ffpmsg("fits_copy_image_section: error copying image section"); + return(*status); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_get_section_range(char **ptr, + long *secmin, + long *secmax, + long *incre, + int *status) +/* + Parse the input image section specification string, returning + the min, max and increment values. + Typical string = "1:512:2" or "1:512" +*/ +{ + int slen, isanumber; + char token[FLEN_VALUE], *tstbuff=0; + + if (*status > 0) + return(*status); + + slen = fits_get_token2(ptr, " ,:", &tstbuff, &isanumber, status); /* get 1st token */ + if (slen==0) + { + /* support [:2,:2] type syntax, where the leading * is implied */ + strcpy(token,"*"); + } + else + { + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("Error: image section string too long (fits_get_section_range)"); + free(tstbuff); + *status = URL_PARSE_ERROR; + return(*status); + } + strcpy(token, tstbuff); + free(tstbuff); + tstbuff=0; + } + + if (*token == '*') /* wild card means to use the whole range */ + { + *secmin = 1; + *secmax = 0; + } + else if (*token == '-' && *(token+1) == '*' ) /* invert the whole range */ + { + *secmin = 0; + *secmax = 1; + } + else + { + if (slen == 0 || !isanumber || **ptr != ':') + return(*status = URL_PARSE_ERROR); + + /* the token contains the min value */ + *secmin = atol(token); + + (*ptr)++; /* skip the colon between the min and max values */ + slen = fits_get_token2(ptr, " ,:", &tstbuff, &isanumber, status); /* get token */ + if (slen == 0 || !isanumber) + { + if (tstbuff) + free(tstbuff); + return(*status = URL_PARSE_ERROR); + } + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("Error: image section string too long (fits_get_section_range)"); + free(tstbuff); + *status = URL_PARSE_ERROR; + return(*status); + } + strcpy(token, tstbuff); + free(tstbuff); + tstbuff=0; + + /* the token contains the max value */ + *secmax = atol(token); + } + + if (**ptr == ':') + { + (*ptr)++; /* skip the colon between the max and incre values */ + slen = fits_get_token2(ptr, " ,", &tstbuff, &isanumber, status); /* get token */ + if (slen == 0 || !isanumber) + { + if (tstbuff) + free(tstbuff); + return(*status = URL_PARSE_ERROR); + } + if (strlen(tstbuff) > FLEN_VALUE-1) + { + ffpmsg("Error: image section string too long (fits_get_section_range)"); + free(tstbuff); + *status = URL_PARSE_ERROR; + return(*status); + } + strcpy(token, tstbuff); + free(tstbuff); + tstbuff=0; + + + *incre = atol(token); + } + else + *incre = 1; /* default increment if none is supplied */ + + if (**ptr == ',') + (*ptr)++; + + while (**ptr == ' ') /* skip any trailing blanks */ + (*ptr)++; + + if (*secmin < 0 || *secmax < 0 || *incre < 1) + *status = URL_PARSE_ERROR; + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffselect_table( + fitsfile **fptr, /* IO - pointer to input table; on output it */ + /* points to the new selected rows table */ + char *outfile, /* I - name for output file */ + char *expr, /* I - Boolean expression */ + int *status) +{ + fitsfile *newptr; + int ii, hdunum; + + if (*outfile) + { + /* create new empty file in to hold the selected rows */ + if (ffinit(&newptr, outfile, status) > 0) + { + ffpmsg( + "failed to create file for selected rows from input table"); + ffpmsg(outfile); + return(*status); + } + + fits_get_hdu_num(*fptr, &hdunum); /* current HDU number in input file */ + + /* copy all preceding extensions to the output file, if the 'only_one' flag is not set */ + if (!((*fptr)->Fptr)->only_one) { + for (ii = 1; ii < hdunum; ii++) + { + fits_movabs_hdu(*fptr, ii, NULL, status); + if (fits_copy_hdu(*fptr, newptr, 0, status) > 0) + { + ffclos(newptr, status); + return(*status); + } + } + } else { + /* just copy the primary array */ + fits_movabs_hdu(*fptr, 1, NULL, status); + if (fits_copy_hdu(*fptr, newptr, 0, status) > 0) + { + ffclos(newptr, status); + return(*status); + } + } + + fits_movabs_hdu(*fptr, hdunum, NULL, status); + + /* copy all the header keywords from the input to output file */ + if (fits_copy_header(*fptr, newptr, status) > 0) + { + ffclos(newptr, status); + return(*status); + } + + /* set number of rows = 0 */ + fits_modify_key_lng(newptr, "NAXIS2", 0, NULL,status); + (newptr->Fptr)->numrows = 0; + (newptr->Fptr)->origrows = 0; + + if (ffrdef(newptr, status) > 0) /* force the header to be scanned */ + { + ffclos(newptr, status); + return(*status); + } + } + else + newptr = *fptr; /* will delete rows in place in the table */ + + /* copy rows which satisfy the selection expression to the output table */ + /* or delete the nonqualifying rows if *fptr = newptr. */ + if (fits_select_rows(*fptr, newptr, expr, status) > 0) + { + if (*outfile) + ffclos(newptr, status); + + return(*status); + } + + if (*outfile) + { + /* copy any remaining HDUs to the output copy */ + + if (!((*fptr)->Fptr)->only_one) { + for (ii = hdunum + 1; 1; ii++) + { + if (fits_movabs_hdu(*fptr, ii, NULL, status) > 0) + break; + + fits_copy_hdu(*fptr, newptr, 0, status); + } + + if (*status == END_OF_FILE) + *status = 0; /* got the expected EOF error; reset = 0 */ + else if (*status > 0) + { + ffclos(newptr, status); + return(*status); + } + } else { + hdunum = 2; + } + + /* close the original file and return ptr to the new image */ + ffclos(*fptr, status); + + *fptr = newptr; /* reset the pointer to the new table */ + + /* move back to the selected table HDU */ + fits_movabs_hdu(*fptr, hdunum, NULL, status); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffparsecompspec(fitsfile *fptr, /* I - FITS file pointer */ + char *compspec, /* I - image compression specification */ + int *status) /* IO - error status */ +/* + Parse the image compression specification that was give in square brackets + following the output FITS file name, as in these examples: + + myfile.fits[compress] - default Rice compression, row by row + myfile.fits[compress TYPE] - the first letter of TYPE defines the + compression algorithm: + R = Rice + G = GZIP + H = HCOMPRESS + HS = HCOMPRESS (with smoothing) + B - BZIP2 + P = PLIO + + myfile.fits[compress TYPE 100,100] - the numbers give the dimensions + of the compression tiles. Default + is NAXIS1, 1, 1, ... + + other optional parameters may be specified following a semi-colon + + myfile.fits[compress; q 8.0] q specifies the floating point + mufile.fits[compress TYPE; q -.0002] quantization level; + myfile.fits[compress TYPE 100,100; q 10, s 25] s specifies the HCOMPRESS + integer scaling parameter + +The compression parameters are saved in the fptr->Fptr structure for use +when writing FITS images. + +*/ +{ + char *ptr1; + + /* initialize with default values */ + int ii, compresstype = RICE_1, smooth = 0; + int quantize_method = SUBTRACTIVE_DITHER_1; + long tilesize[MAX_COMPRESS_DIM] = {0,0,0,0,0,0}; + float qlevel = -99., scale = 0.; + + ptr1 = compspec; + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + if (strncmp(ptr1, "compress", 8) && strncmp(ptr1, "COMPRESS", 8) ) + { + /* apparently this string does not specify compression parameters */ + return(*status = URL_PARSE_ERROR); + } + + ptr1 += 8; + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + /* ========================= */ + /* look for compression type */ + /* ========================= */ + + if (*ptr1 == 'r' || *ptr1 == 'R') + { + compresstype = RICE_1; + while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') + ptr1++; + } + else if (*ptr1 == 'g' || *ptr1 == 'G') + { + compresstype = GZIP_1; + while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') + ptr1++; + + } +/* + else if (*ptr1 == 'b' || *ptr1 == 'B') + { + compresstype = BZIP2_1; + while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') + ptr1++; + + } +*/ + else if (*ptr1 == 'p' || *ptr1 == 'P') + { + compresstype = PLIO_1; + while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') + ptr1++; + } + else if (*ptr1 == 'h' || *ptr1 == 'H') + { + compresstype = HCOMPRESS_1; + ptr1++; + if (*ptr1 == 's' || *ptr1 == 'S') + smooth = 1; /* apply smoothing when uncompressing HCOMPRESSed image */ + + while (*ptr1 != ' ' && *ptr1 != ';' && *ptr1 != '\0') + ptr1++; + } + + /* ======================== */ + /* look for tile dimensions */ + /* ======================== */ + + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + ii = 0; + while (isdigit( (int) *ptr1) && ii < 9) + { + tilesize[ii] = atol(ptr1); /* read the integer value */ + ii++; + + while (isdigit((int) *ptr1)) /* skip over the integer */ + ptr1++; + + if (*ptr1 == ',') + ptr1++; /* skip over the comma */ + + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + } + + /* ========================================================= */ + /* look for semi-colon, followed by other optional parameters */ + /* ========================================================= */ + + if (*ptr1 == ';') { + ptr1++; + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + while (*ptr1 != 0) { /* haven't reached end of string yet */ + + if (*ptr1 == 's' || *ptr1 == 'S') { + /* this should be the HCOMPRESS "scale" parameter; default = 1 */ + + ptr1++; + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + scale = (float) strtod(ptr1, &ptr1); + + while (*ptr1 == ' ' || *ptr1 == ',') /* skip over blanks or comma */ + ptr1++; + + } else if (*ptr1 == 'q' || *ptr1 == 'Q') { + /* this should be the floating point quantization parameter */ + + ptr1++; + if (*ptr1 == 'z' || *ptr1 == 'Z') { + /* use the subtractive_dither_2 option */ + quantize_method = SUBTRACTIVE_DITHER_2; + ptr1++; + } else if (*ptr1 == '0') { + /* do not dither */ + quantize_method = NO_DITHER; + ptr1++; + } + + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + qlevel = (float) strtod(ptr1, &ptr1); + + while (*ptr1 == ' ' || *ptr1 == ',') /* skip over blanks or comma */ + ptr1++; + + } else { + return(*status = URL_PARSE_ERROR); + } + } + } + + /* ================================= */ + /* finished parsing; save the values */ + /* ================================= */ + + fits_set_compression_type(fptr, compresstype, status); + fits_set_tile_dim(fptr, MAX_COMPRESS_DIM, tilesize, status); + + if (compresstype == HCOMPRESS_1) { + fits_set_hcomp_scale (fptr, scale, status); + fits_set_hcomp_smooth(fptr, smooth, status); + } + + if (qlevel != -99.) { + fits_set_quantize_level(fptr, qlevel, status); + fits_set_quantize_method(fptr, quantize_method, status); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdkinit(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - name of file to create */ + int *status) /* IO - error status */ +/* + Create and initialize a new FITS file on disk. This routine differs + from ffinit in that the input 'name' is literally taken as the name + of the disk file to be created, and it does not support CFITSIO's + extended filename syntax. +*/ +{ + *fptr = 0; /* initialize null file pointer, */ + /* regardless of the value of *status */ + if (*status > 0) + return(*status); + + *status = CREATE_DISK_FILE; + + ffinit(fptr, name,status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffinit(fitsfile **fptr, /* O - FITS file pointer */ + const char *name, /* I - name of file to create */ + int *status) /* IO - error status */ +/* + Create and initialize a new FITS file. +*/ +{ + int ii, driver, slen, clobber = 0; + char *url; + char urltype[MAX_PREFIX_LEN], outfile[FLEN_FILENAME]; + char tmplfile[FLEN_FILENAME], compspec[80]; + int handle, create_disk_file = 0; + + *fptr = 0; /* initialize null file pointer, */ + /* regardless of the value of *status */ + if (*status > 0) + return(*status); + + if (*status == CREATE_DISK_FILE) + { + create_disk_file = 1; + *status = 0; + } + + if (need_to_initialize) { /* this is called only once */ + *status = fits_init_cfitsio(); + } + + if (*status > 0) + return(*status); + + url = (char *) name; + while (*url == ' ') /* ignore leading spaces in the filename */ + url++; + + if (*url == '\0') + { + ffpmsg("Name of file to create is blank. (ffinit)"); + return(*status = FILE_NOT_CREATED); + } + + if (create_disk_file) + { + if (strlen(url) > FLEN_FILENAME - 1) + { + ffpmsg("Filename is too long. (ffinit)"); + return(*status = FILE_NOT_CREATED); + } + + strcpy(outfile, url); + strcpy(urltype, "file://"); + tmplfile[0] = '\0'; + compspec[0] = '\0'; + } + else + { + + /* check for clobber symbol, i.e, overwrite existing file */ + if (*url == '!') + { + clobber = TRUE; + url++; + } + else + clobber = FALSE; + + /* parse the output file specification */ + /* this routine checks that the strings will not overflow */ + ffourl(url, urltype, outfile, tmplfile, compspec, status); + + if (*status > 0) + { + ffpmsg("could not parse the output filename: (ffinit)"); + ffpmsg(url); + return(*status); + } + } + + /* find which driver corresponds to the urltype */ + *status = urltype2driver(urltype, &driver); + + if (*status) + { + ffpmsg("could not find driver for this file: (ffinit)"); + ffpmsg(url); + return(*status); + } + + /* delete pre-existing file, if asked to do so */ + if (clobber) + { + if (driverTable[driver].remove) + (*driverTable[driver].remove)(outfile); + } + + /* call appropriate driver to create the file */ + if (driverTable[driver].create) + { + + FFLOCK; /* lock this while searching for vacant handle */ + *status = (*driverTable[driver].create)(outfile, &handle); + FFUNLOCK; + + if (*status) + { + ffpmsg("failed to create new file (already exists?):"); + ffpmsg(url); + return(*status); + } + } + else + { + ffpmsg("cannot create a new file of this type: (ffinit)"); + ffpmsg(url); + return(*status = FILE_NOT_CREATED); + } + + /* allocate fitsfile structure and initialize = 0 */ + *fptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + if (!(*fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffopen)"); + ffpmsg(url); + return(*status = MEMORY_ALLOCATION); + } + + /* allocate FITSfile structure and initialize = 0 */ + (*fptr)->Fptr = (FITSfile *) calloc(1, sizeof(FITSfile)); + + if (!((*fptr)->Fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for following file: (ffopen)"); + ffpmsg(url); + free(*fptr); + *fptr = 0; + return(*status = MEMORY_ALLOCATION); + } + + slen = strlen(url) + 1; + slen = maxvalue(slen, 32); /* reserve at least 32 chars */ + ((*fptr)->Fptr)->filename = (char *) malloc(slen); /* mem for file name */ + + if ( !(((*fptr)->Fptr)->filename) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for filename: (ffinit)"); + ffpmsg(url); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = FILE_NOT_CREATED); + } + + /* mem for headstart array */ + ((*fptr)->Fptr)->headstart = (LONGLONG *) calloc(1001, sizeof(LONGLONG)); + + if ( !(((*fptr)->Fptr)->headstart) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for headstart array: (ffinit)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for file I/O buffers */ + ((*fptr)->Fptr)->iobuffer = (char *) calloc(NIOBUF, IOBUFLEN); + + if ( !(((*fptr)->Fptr)->iobuffer) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for iobuffer array: (ffinit)"); + ffpmsg(url); + free( ((*fptr)->Fptr)->headstart); /* free memory for headstart array */ + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* initialize the ageindex array (relative age of the I/O buffers) */ + /* and initialize the bufrecnum array as being empty */ + for (ii = 0; ii < NIOBUF; ii++) { + ((*fptr)->Fptr)->ageindex[ii] = ii; + ((*fptr)->Fptr)->bufrecnum[ii] = -1; + } + + /* store the parameters describing the file */ + ((*fptr)->Fptr)->MAXHDU = 1000; /* initial size of headstart */ + ((*fptr)->Fptr)->filehandle = handle; /* store the file pointer */ + ((*fptr)->Fptr)->driver = driver; /* driver number */ + strcpy(((*fptr)->Fptr)->filename, url); /* full input filename */ + ((*fptr)->Fptr)->filesize = 0; /* physical file size */ + ((*fptr)->Fptr)->logfilesize = 0; /* logical file size */ + ((*fptr)->Fptr)->writemode = 1; /* read-write mode */ + ((*fptr)->Fptr)->datastart = DATA_UNDEFINED; /* unknown start of data */ + ((*fptr)->Fptr)->curbuf = -1; /* undefined current IO buffer */ + ((*fptr)->Fptr)->open_count = 1; /* structure is currently used once */ + ((*fptr)->Fptr)->validcode = VALIDSTRUC; /* flag denoting valid structure */ + + ffldrc(*fptr, 0, IGNORE_EOF, status); /* initialize first record */ + + fits_store_Fptr( (*fptr)->Fptr, status); /* store Fptr address */ + + /* if template file was given, use it to define structure of new file */ + + if (tmplfile[0]) + ffoptplt(*fptr, tmplfile, status); + + /* parse and save image compression specification, if given */ + if (compspec[0]) + ffparsecompspec(*fptr, compspec, status); + + return(*status); /* successful return */ +} +/*--------------------------------------------------------------------------*/ +/* ffimem == fits_create_memfile */ + +int ffimem(fitsfile **fptr, /* O - FITS file pointer */ + void **buffptr, /* I - address of memory pointer */ + size_t *buffsize, /* I - size of buffer, in bytes */ + size_t deltasize, /* I - increment for future realloc's */ + void *(*mem_realloc)(void *p, size_t newsize), /* function */ + int *status) /* IO - error status */ + +/* + Create and initialize a new FITS file in memory +*/ +{ + int ii, driver, slen; + char urltype[MAX_PREFIX_LEN]; + int handle; + + if (*status > 0) + return(*status); + + *fptr = 0; /* initialize null file pointer */ + + if (need_to_initialize) { /* this is called only once */ + *status = fits_init_cfitsio(); + } + + if (*status > 0) + return(*status); + + strcpy(urltype, "memkeep://"); /* URL type for pre-existing memory file */ + + *status = urltype2driver(urltype, &driver); + + if (*status > 0) + { + ffpmsg("could not find driver for pre-existing memory file: (ffimem)"); + return(*status); + } + + /* call driver routine to "open" the memory file */ + FFLOCK; /* lock this while searching for vacant handle */ + *status = mem_openmem( buffptr, buffsize, deltasize, + mem_realloc, &handle); + FFUNLOCK; + + if (*status > 0) + { + ffpmsg("failed to open pre-existing memory file: (ffimem)"); + return(*status); + } + + /* allocate fitsfile structure and initialize = 0 */ + *fptr = (fitsfile *) calloc(1, sizeof(fitsfile)); + + if (!(*fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for memory file: (ffimem)"); + return(*status = MEMORY_ALLOCATION); + } + + /* allocate FITSfile structure and initialize = 0 */ + (*fptr)->Fptr = (FITSfile *) calloc(1, sizeof(FITSfile)); + + if (!((*fptr)->Fptr)) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate structure for memory file: (ffimem)"); + free(*fptr); + *fptr = 0; + return(*status = MEMORY_ALLOCATION); + } + + slen = 32; /* reserve at least 32 chars */ + ((*fptr)->Fptr)->filename = (char *) malloc(slen); /* mem for file name */ + + if ( !(((*fptr)->Fptr)->filename) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for filename: (ffimem)"); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for headstart array */ + ((*fptr)->Fptr)->headstart = (LONGLONG *) calloc(1001, sizeof(LONGLONG)); + + if ( !(((*fptr)->Fptr)->headstart) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for headstart array: (ffimem)"); + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* mem for file I/O buffers */ + ((*fptr)->Fptr)->iobuffer = (char *) calloc(NIOBUF, IOBUFLEN); + + if ( !(((*fptr)->Fptr)->iobuffer) ) + { + (*driverTable[driver].close)(handle); /* close the file */ + ffpmsg("failed to allocate memory for iobuffer array: (ffimem)"); + free( ((*fptr)->Fptr)->headstart); /* free memory for headstart array */ + free( ((*fptr)->Fptr)->filename); + free((*fptr)->Fptr); + free(*fptr); + *fptr = 0; /* return null file pointer */ + return(*status = MEMORY_ALLOCATION); + } + + /* initialize the ageindex array (relative age of the I/O buffers) */ + /* and initialize the bufrecnum array as being empty */ + for (ii = 0; ii < NIOBUF; ii++) { + ((*fptr)->Fptr)->ageindex[ii] = ii; + ((*fptr)->Fptr)->bufrecnum[ii] = -1; + } + + /* store the parameters describing the file */ + ((*fptr)->Fptr)->MAXHDU = 1000; /* initial size of headstart */ + ((*fptr)->Fptr)->filehandle = handle; /* file handle */ + ((*fptr)->Fptr)->driver = driver; /* driver number */ + strcpy(((*fptr)->Fptr)->filename, "memfile"); /* dummy filename */ + ((*fptr)->Fptr)->filesize = *buffsize; /* physical file size */ + ((*fptr)->Fptr)->logfilesize = *buffsize; /* logical file size */ + ((*fptr)->Fptr)->writemode = 1; /* read-write mode */ + ((*fptr)->Fptr)->datastart = DATA_UNDEFINED; /* unknown start of data */ + ((*fptr)->Fptr)->curbuf = -1; /* undefined current IO buffer */ + ((*fptr)->Fptr)->open_count = 1; /* structure is currently used once */ + ((*fptr)->Fptr)->validcode = VALIDSTRUC; /* flag denoting valid structure */ + + ffldrc(*fptr, 0, IGNORE_EOF, status); /* initialize first record */ + fits_store_Fptr( (*fptr)->Fptr, status); /* store Fptr address */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fits_init_cfitsio(void) +/* + initialize anything that is required before using the CFITSIO routines +*/ +{ + int status; + + union u_tag { + short ival; + char cval[2]; + } u; + + fitsio_init_lock(); + + FFLOCK; /* lockout other threads while executing this critical */ + /* section of code */ + + if (need_to_initialize == 0) { /* already initialized? */ + FFUNLOCK; + return(0); + } + + /* test for correct byteswapping. */ + + u.ival = 1; + if ((BYTESWAPPED && u.cval[0] != 1) || + (BYTESWAPPED == FALSE && u.cval[1] != 1) ) + { + printf ("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" Byteswapping is not being done correctly on this system.\n"); + printf(" Check the MACHINE and BYTESWAPPED definitions in fitsio2.h\n"); + printf(" Please report this problem to the CFITSIO developers.\n"); + printf( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + FFUNLOCK; + return(1); + } + + + /* test that LONGLONG is an 8 byte integer */ + + if (sizeof(LONGLONG) != 8) + { + printf ("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + printf(" CFITSIO did not find an 8-byte long integer data type.\n"); + printf(" sizeof(LONGLONG) = %d\n",(int)sizeof(LONGLONG)); + printf(" Please report this problem to the CFITSIO developers.\n"); + printf( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + FFUNLOCK; + return(1); + } + + /* register the standard I/O drivers that are always available */ + + /* 1--------------------disk file driver-----------------------*/ + status = fits_register_driver("file://", + file_init, + file_shutdown, + file_setoptions, + file_getoptions, + file_getversion, + file_checkfile, + file_open, + file_create, +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the file:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 2------------ output temporary memory file driver ----------------*/ + status = fits_register_driver("mem://", + mem_init, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + NULL, /* open function not allowed */ + mem_create, + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + + if (status) + { + ffpmsg("failed to register the mem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 3--------------input pre-existing memory file driver----------------*/ + status = fits_register_driver("memkeep://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + NULL, /* file open driver function is not used */ + NULL, /* create function not allowed */ + mem_truncate, + mem_close_keep, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + + if (status) + { + ffpmsg("failed to register the memkeep:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 4-------------------stdin stream driver----------------------*/ + /* the stdin stream is copied to memory then opened in memory */ + + status = fits_register_driver("stdin://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + stdin_checkfile, + stdin_open, + NULL, /* create function not allowed */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the stdin:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 5-------------------stdin file stream driver----------------------*/ + /* the stdin stream is copied to a disk file then the disk file is opened */ + + status = fits_register_driver("stdinfile://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + stdin_open, + NULL, /* create function not allowed */ +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the stdinfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + + /* 6-----------------------stdout stream driver------------------*/ + status = fits_register_driver("stdout://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + NULL, /* open function not required */ + mem_create, + mem_truncate, + stdout_close, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the stdout:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 7------------------iraf disk file to memory driver -----------*/ + status = fits_register_driver("irafmem://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + mem_iraf_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the irafmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 8------------------raw binary file to memory driver -----------*/ + status = fits_register_driver("rawfile://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + mem_rawfile_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the rawfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 9------------------compressed disk file to memory driver -----------*/ + status = fits_register_driver("compress://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + mem_compress_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the compress:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 10------------------compressed disk file to memory driver -----------*/ + /* Identical to compress://, except it allows READWRITE access */ + + status = fits_register_driver("compressmem://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + mem_compress_openrw, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the compressmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 11------------------compressed disk file to disk file driver -------*/ + status = fits_register_driver("compressfile://", + NULL, + file_shutdown, + file_setoptions, + file_getoptions, + file_getversion, + NULL, /* checkfile not needed */ + file_compress_open, + file_create, +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the compressfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 12---create file in memory, then compress it to disk file on close--*/ + status = fits_register_driver("compressoutfile://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + NULL, /* open function not allowed */ + mem_create_comp, + mem_truncate, + mem_close_comp, + file_remove, /* delete existing compressed disk file */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + + if (status) + { + ffpmsg( + "failed to register the compressoutfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* Register Optional drivers */ + +#ifdef HAVE_NET_SERVICES + + /* 13--------------------root driver-----------------------*/ + + status = fits_register_driver("root://", + root_init, + root_shutdown, + root_setoptions, + root_getoptions, + root_getversion, + NULL, /* checkfile not needed */ + root_open, + root_create, + NULL, /* No truncate possible */ + root_close, + NULL, /* No remove possible */ + root_size, /* no size possible */ + root_flush, + root_seek, /* Though will always succeed */ + root_read, + root_write); + + if (status) + { + ffpmsg("failed to register the root:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 14--------------------http driver-----------------------*/ + status = fits_register_driver("http://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + http_checkfile, + http_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the http:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 15--------------------http file driver-----------------------*/ + + status = fits_register_driver("httpfile://", + NULL, + file_shutdown, + file_setoptions, + file_getoptions, + file_getversion, + NULL, /* checkfile not needed */ + http_file_open, + file_create, +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the httpfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 16--------------------http memory driver-----------------------*/ + /* same as http:// driver, except memory file can be opened READWRITE */ + status = fits_register_driver("httpmem://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + http_checkfile, + http_file_open, /* this will simply call http_open */ + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the httpmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 17--------------------httpcompress file driver-----------------------*/ + + status = fits_register_driver("httpcompress://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + http_compress_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the httpcompress:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + + /* 18--------------------ftp driver-----------------------*/ + status = fits_register_driver("ftp://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + ftp_checkfile, + ftp_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the ftp:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 19--------------------ftp file driver-----------------------*/ + status = fits_register_driver("ftpfile://", + NULL, + file_shutdown, + file_setoptions, + file_getoptions, + file_getversion, + NULL, /* checkfile not needed */ + ftp_file_open, + file_create, +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the ftpfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 20--------------------ftp mem driver-----------------------*/ + /* same as ftp:// driver, except memory file can be opened READWRITE */ + status = fits_register_driver("ftpmem://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + ftp_checkfile, + ftp_file_open, /* this will simply call ftp_open */ + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the ftpmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 21--------------------ftp compressed file driver------------------*/ + status = fits_register_driver("ftpcompress://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + NULL, /* checkfile not needed */ + ftp_compress_open, + 0, /* create function not required */ + mem_truncate, + mem_close_free, + 0, /* remove function not required */ + mem_size, + 0, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the ftpcompress:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + /* === End of net drivers section === */ +#endif + +/* ==================== SHARED MEMORY DRIVER SECTION ======================= */ + +#ifdef HAVE_SHMEM_SERVICES + + /* 22--------------------shared memory driver-----------------------*/ + status = fits_register_driver("shmem://", + smem_init, + smem_shutdown, + smem_setoptions, + smem_getoptions, + smem_getversion, + NULL, /* checkfile not needed */ + smem_open, + smem_create, + NULL, /* truncate file not supported yet */ + smem_close, + smem_remove, + smem_size, + smem_flush, + smem_seek, + smem_read, + smem_write ); + + if (status) + { + ffpmsg("failed to register the shmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + +#endif +/* ==================== END OF SHARED MEMORY DRIVER SECTION ================ */ + + +#ifdef HAVE_GSIFTP + /* 23--------------------gsiftp driver-----------------------*/ + status = fits_register_driver("gsiftp://", + gsiftp_init, + gsiftp_shutdown, + gsiftp_setoptions, + gsiftp_getoptions, + gsiftp_getversion, + gsiftp_checkfile, + gsiftp_open, + gsiftp_create, +#ifdef HAVE_FTRUNCATE + gsiftp_truncate, +#else + NULL, +#endif + gsiftp_close, + NULL, /* remove function not yet implemented */ + gsiftp_size, + gsiftp_flush, + gsiftp_seek, + gsiftp_read, + gsiftp_write); + + if (status) + { + ffpmsg("failed to register the gsiftp:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + +#endif + + /* 24---------------stdin and stdout stream driver-------------------*/ + status = fits_register_driver("stream://", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + stream_open, + stream_create, + NULL, /* no stream truncate function */ + stream_close, + NULL, /* no stream remove */ + stream_size, + stream_flush, + stream_seek, + stream_read, + stream_write); + + if (status) + { + ffpmsg("failed to register the stream:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + +#ifdef HAVE_NET_SERVICES + + /* 25--------------------https driver-----------------------*/ + status = fits_register_driver("https://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + https_checkfile, + https_open, + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the https:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 26--------------------https file driver-----------------------*/ + + status = fits_register_driver("httpsfile://", + NULL, + file_shutdown, + file_setoptions, + file_getoptions, + file_getversion, + NULL, /* checkfile not needed */ + https_file_open, + file_create, +#ifdef HAVE_FTRUNCATE + file_truncate, +#else + NULL, /* no file truncate function */ +#endif + file_close, + file_remove, + file_size, + file_flush, + file_seek, + file_read, + file_write); + + if (status) + { + ffpmsg("failed to register the httpsfile:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + + /* 27--------------------https memory driver-----------------------*/ + /* same as https:// driver, except memory file can be opened READWRITE */ + status = fits_register_driver("httpsmem://", + NULL, + mem_shutdown, + mem_setoptions, + mem_getoptions, + mem_getversion, + https_checkfile, + https_file_open, /* this will simply call https_open */ + NULL, /* create function not required */ + mem_truncate, + mem_close_free, + NULL, /* remove function not required */ + mem_size, + NULL, /* flush function not required */ + mem_seek, + mem_read, + mem_write); + + if (status) + { + ffpmsg("failed to register the httpsmem:// driver (init_cfitsio)"); + FFUNLOCK; + return(status); + } + /* === End of https net drivers section === */ +#endif + + + /* reset flag. Any other threads will now not need to call this routine */ + need_to_initialize = 0; + + FFUNLOCK; + return(status); +} +/*--------------------------------------------------------------------------*/ +int fits_register_driver(char *prefix, + int (*init)(void), + int (*shutdown)(void), + int (*setoptions)(int option), + int (*getoptions)(int *options), + int (*getversion)(int *version), + int (*checkfile) (char *urltype, char *infile, char *outfile), + int (*open)(char *filename, int rwmode, int *driverhandle), + int (*create)(char *filename, int *driverhandle), + int (*truncate)(int driverhandle, LONGLONG filesize), + int (*close)(int driverhandle), + int (*fremove)(char *filename), + int (*size)(int driverhandle, LONGLONG *sizex), + int (*flush)(int driverhandle), + int (*seek)(int driverhandle, LONGLONG offset), + int (*read) (int driverhandle, void *buffer, long nbytes), + int (*write)(int driverhandle, void *buffer, long nbytes) ) +/* + register all the functions needed to support an I/O driver +*/ +{ + int status; + + if (no_of_drivers < 0 ) { + /* This is bad. looks like memory has been corrupted. */ + ffpmsg("Vital CFITSIO parameters held in memory have been corrupted!!"); + ffpmsg("Fatal condition detected in fits_register_driver."); + return(TOO_MANY_DRIVERS); + } + + if (no_of_drivers + 1 > MAX_DRIVERS) + return(TOO_MANY_DRIVERS); + + if (prefix == NULL) + return(BAD_URL_PREFIX); + + + if (init != NULL) + { + status = (*init)(); /* initialize the driver */ + if (status) + return(status); + } + + /* fill in data in table */ + strncpy(driverTable[no_of_drivers].prefix, prefix, MAX_PREFIX_LEN); + driverTable[no_of_drivers].prefix[MAX_PREFIX_LEN - 1] = 0; + driverTable[no_of_drivers].init = init; + driverTable[no_of_drivers].shutdown = shutdown; + driverTable[no_of_drivers].setoptions = setoptions; + driverTable[no_of_drivers].getoptions = getoptions; + driverTable[no_of_drivers].getversion = getversion; + driverTable[no_of_drivers].checkfile = checkfile; + driverTable[no_of_drivers].open = open; + driverTable[no_of_drivers].create = create; + driverTable[no_of_drivers].truncate = truncate; + driverTable[no_of_drivers].close = close; + driverTable[no_of_drivers].remove = fremove; + driverTable[no_of_drivers].size = size; + driverTable[no_of_drivers].flush = flush; + driverTable[no_of_drivers].seek = seek; + driverTable[no_of_drivers].read = read; + driverTable[no_of_drivers].write = write; + + no_of_drivers++; /* increment the number of drivers */ + return(0); + } +/*--------------------------------------------------------------------------*/ +/* fits_parse_input_url */ +int ffiurl(char *url, /* input filename */ + char *urltype, /* e.g., 'file://', 'http://', 'mem://' */ + char *infilex, /* root filename (may be complete path) */ + char *outfile, /* optional output file name */ + char *extspec, /* extension spec: +n or [extname, extver] */ + char *rowfilterx, /* boolean row filter expression */ + char *binspec, /* histogram binning specifier */ + char *colspec, /* column or keyword modifier expression */ + int *status) +/* + parse the input URL into its basic components. + This routine does not support the pixfilter or compspec components. +*/ +{ + return ffifile2(url, urltype, infilex, outfile, + extspec, rowfilterx, binspec, colspec, 0, 0, status); +} +/*--------------------------------------------------------------------------*/ +/* fits_parse_input_file */ +int ffifile(char *url, /* input filename */ + char *urltype, /* e.g., 'file://', 'http://', 'mem://' */ + char *infilex, /* root filename (may be complete path) */ + char *outfile, /* optional output file name */ + char *extspec, /* extension spec: +n or [extname, extver] */ + char *rowfilterx, /* boolean row filter expression */ + char *binspec, /* histogram binning specifier */ + char *colspec, /* column or keyword modifier expression */ + char *pixfilter, /* pixel filter expression */ + int *status) +/* + fits_parse_input_filename + parse the input URL into its basic components. + This routine does not support the compspec component. +*/ +{ + return ffifile2(url, urltype, infilex, outfile, + extspec, rowfilterx, binspec, colspec, pixfilter, 0, status); + +} +/*--------------------------------------------------------------------------*/ +int ffifile2(char *url, /* input filename */ + char *urltype, /* e.g., 'file://', 'http://', 'mem://' */ + char *infilex, /* root filename (may be complete path) */ + char *outfile, /* optional output file name */ + char *extspec, /* extension spec: +n or [extname, extver] */ + char *rowfilterx, /* boolean row filter expression */ + char *binspec, /* histogram binning specifier */ + char *colspec, /* column or keyword modifier expression */ + char *pixfilter, /* pixel filter expression */ + char *compspec, /* image compression specification */ + int *status) +/* + fits_parse_input_filename + parse the input URL into its basic components. + This routine is big and ugly and should be redesigned someday! +*/ +{ + int ii, jj, slen, infilelen, plus_ext = 0, collen; + char *ptr1, *ptr2, *ptr3, *ptr4, *tmptr; + int hasAt, hasDot, hasOper, followingOper, spaceTerm, rowFilter; + int colStart, binStart, pixStart, compStart; + + + /* must have temporary variable for these, in case inputs are NULL */ + char *infile; + char *rowfilter; + char *tmpstr; + + if (*status > 0) + return(*status); + + /* Initialize null strings */ + if (infilex) *infilex = '\0'; + if (urltype) *urltype = '\0'; + if (outfile) *outfile = '\0'; + if (extspec) *extspec = '\0'; + if (binspec) *binspec = '\0'; + if (colspec) *colspec = '\0'; + if (rowfilterx) *rowfilterx = '\0'; + if (pixfilter) *pixfilter = '\0'; + if (compspec) *compspec = '\0'; + slen = strlen(url); + + if (slen == 0) /* blank filename ?? */ + return(*status); + + /* allocate memory for 3 strings, each as long as the input url */ + infile = (char *) calloc(3, slen + 1); + if (!infile) + return(*status = MEMORY_ALLOCATION); + + rowfilter = &infile[slen + 1]; + tmpstr = &rowfilter[slen + 1]; + + ptr1 = url; + + /* -------------------------------------------------------- */ + /* get urltype (e.g., file://, ftp://, http://, etc.) */ + /* --------------------------------------------------------- */ + + if (*ptr1 == '-' && ( *(ptr1 +1) == 0 || *(ptr1 +1) == ' ' || + *(ptr1 +1) == '[' || *(ptr1 +1) == '(' ) ) + { + /* "-" means read file from stdin. Also support "- ", */ + /* "-[extname]" and '-(outfile.fits)" but exclude disk file */ + /* names that begin with a minus sign, e.g., "-55d33m.fits" */ + + if (urltype) + strcat(urltype, "stdin://"); + ptr1++; + } + else if (!fits_strncasecmp(ptr1, "stdin", 5)) + { + if (urltype) + strcat(urltype, "stdin://"); + ptr1 = ptr1 + 5; + } + else + { + ptr2 = strstr(ptr1, "://"); + ptr3 = strstr(ptr1, "(" ); + + if (ptr3 && (ptr3 < ptr2) ) + { + /* the urltype follows a '(' character, so it must apply */ + /* to the output file, and is not the urltype of the input file */ + ptr2 = 0; /* so reset pointer to zero */ + } + + if (ptr2) /* copy the explicit urltype string */ + { + if (ptr2-ptr1+3 >= MAX_PREFIX_LEN) + { + ffpmsg("Name of urltype is too long."); + return(*status = URL_PARSE_ERROR); + } + if (urltype) + strncat(urltype, ptr1, ptr2 - ptr1 + 3); + ptr1 = ptr2 + 3; + } + else if (!strncmp(ptr1, "ftp:", 4) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "ftp://"); + ptr1 += 4; + } + else if (!strncmp(ptr1, "gsiftp:", 7) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "gsiftp://"); + ptr1 += 7; + } + else if (!strncmp(ptr1, "http:", 5) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "http://"); + ptr1 += 5; + } + else if (!strncmp(ptr1, "mem:", 4) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "mem://"); + ptr1 += 4; + } + else if (!strncmp(ptr1, "shmem:", 6) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "shmem://"); + ptr1 += 6; + } + else if (!strncmp(ptr1, "file:", 5) ) + { /* the 2 //'s are optional */ + if (urltype) + strcat(urltype, "file://"); + ptr1 += 5; + } + else /* assume file driver */ + { + if (urltype) + strcat(urltype, "file://"); + } + } + + /* ---------------------------------------------------------- + If this is a http:// type file, then the cgi file name could + include the '[' character, which should not be interpreted + as part of CFITSIO's Extended File Name Syntax. Test for this + case by seeing if the last character is a ']' or ')'. If it + is not, then just treat the whole input string as the file name + and do not attempt to interprete the name using the extended + filename syntax. + ----------------------------------------------------------- */ + + if (urltype && !strncmp(urltype, "http://", 7) ) + { + /* test for opening parenthesis or bracket in the file name */ + if( strchr(ptr1, '(' ) || strchr(ptr1, '[' ) ) + { + slen = strlen(ptr1); + ptr3 = ptr1 + slen - 1; + while (*ptr3 == ' ') /* ignore trailing blanks */ + ptr3--; + + if (*ptr3 != ']' && *ptr3 != ')' ) + { + /* name doesn't end with a ']' or ')' so don't try */ + /* to parse this unusual string (may be cgi string) */ + if (infilex) { + + if (strlen(ptr1) > FLEN_FILENAME - 1) { + ffpmsg("Name of file is too long."); + return(*status = URL_PARSE_ERROR); + } + + strcpy(infilex, ptr1); + } + + free(infile); + return(*status); + } + } + } + + /* ---------------------------------------------------------- + Look for VMS style filenames like: + disk:[directory.subdirectory]filename.ext, or + [directory.subdirectory]filename.ext + + Check if the first character is a '[' and urltype != stdin + or if there is a ':[' string in the remaining url string. If + so, then need to move past this bracket character before + search for the opening bracket of a filter specification. + ----------------------------------------------------------- */ + + tmptr = ptr1; + if (*ptr1 == '[') + { + if (*url != '-') + tmptr = ptr1 + 1; /* this bracket encloses a VMS directory name */ + } + else + { + tmptr = strstr(ptr1, ":["); + if (tmptr) /* these 2 chars are part of the VMS disk and directory */ + tmptr += 2; + else + tmptr = ptr1; + } + + /* ------------------------ */ + /* get the input file name */ + /* ------------------------ */ + + ptr2 = strchr(tmptr, '('); /* search for opening parenthesis ( */ + ptr3 = strchr(tmptr, '['); /* search for opening bracket [ */ + + if (ptr2 == ptr3) /* simple case: no [ or ( in the file name */ + { + strcat(infile, ptr1); + } + else if (!ptr3 || /* no bracket, so () enclose output file name */ + (ptr2 && (ptr2 < ptr3)) ) /* () enclose output name before bracket */ + { + strncat(infile, ptr1, ptr2 - ptr1); + ptr2++; + + ptr1 = strchr(ptr2, ')' ); /* search for closing ) */ + if (!ptr1) + { + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ) */ + } + + if (outfile) { + + if (ptr1 - ptr2 > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strncat(outfile, ptr2, ptr1 - ptr2); + } + + /* the opening [ could have been part of output name, */ + /* e.g., file(out[compress])[3][#row > 5] */ + /* so search again for opening bracket following the closing ) */ + ptr3 = strchr(ptr1, '['); + + } + else /* bracket comes first, so there is no output name */ + { + strncat(infile, ptr1, ptr3 - ptr1); + } + + /* strip off any trailing blanks in the names */ + + slen = strlen(infile); + while ( (--slen) > 0 && infile[slen] == ' ') + infile[slen] = '\0'; + + if (outfile) + { + slen = strlen(outfile); + while ( (--slen) > 0 && outfile[slen] == ' ') + outfile[slen] = '\0'; + } + + /* --------------------------------------------- */ + /* check if this is an IRAF file (.imh extension */ + /* --------------------------------------------- */ + + ptr4 = strstr(infile, ".imh"); + + /* did the infile name end with ".imh" ? */ + if (ptr4 && (*(ptr4 + 4) == '\0')) + { + if (urltype) + strcpy(urltype, "irafmem://"); + } + + /* --------------------------------------------- */ + /* check if the 'filename+n' convention has been */ + /* used to specifiy which HDU number to open */ + /* --------------------------------------------- */ + + jj = strlen(infile); + + for (ii = jj - 1; ii >= 0; ii--) + { + if (infile[ii] == '+') /* search backwards for '+' sign */ + break; + } + + if (ii > 0 && (jj - ii) < 7) /* limit extension numbers to 5 digits */ + { + infilelen = ii; + ii++; + ptr1 = infile+ii; /* pointer to start of sequence */ + + for (; ii < jj; ii++) + { + if (!isdigit((int) infile[ii] ) ) /* are all the chars digits? */ + break; + } + + if (ii == jj) + { + /* yes, the '+n' convention was used. Copy */ + /* the digits to the output extspec string. */ + plus_ext = 1; + + if (extspec) { + if (jj - infilelen > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strncpy(extspec, ptr1, jj - infilelen); + } + + infile[infilelen] = '\0'; /* delete the extension number */ + } + } + + /* -------------------------------------------------------------------- */ + /* if '*' was given for the output name expand it to the root file name */ + /* -------------------------------------------------------------------- */ + + if (outfile && outfile[0] == '*') + { + /* scan input name backwards to the first '/' character */ + for (ii = jj - 1; ii >= 0; ii--) + { + if (infile[ii] == '/' || ii == 0) + { + if (strlen(&infile[ii + 1]) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcpy(outfile, &infile[ii + 1]); + break; + } + } + } + + /* ------------------------------------------ */ + /* copy strings from local copy to the output */ + /* ------------------------------------------ */ + if (infilex) { + if (strlen(infile) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcpy(infilex, infile); + } + /* ---------------------------------------------------------- */ + /* if no '[' character in the input string, then we are done. */ + /* ---------------------------------------------------------- */ + if (!ptr3) + { + free(infile); + return(*status); + } + + /* ------------------------------------------- */ + /* see if [ extension specification ] is given */ + /* ------------------------------------------- */ + + if (!plus_ext) /* extension no. not already specified? Then */ + /* first brackets must enclose extension name or # */ + /* or it encloses a image subsection specification */ + /* or a raw binary image specifier */ + /* or a image compression specifier */ + + /* Or, the extension specification may have been */ + /* omitted and we have to guess what the user intended */ + { + ptr1 = ptr3 + 1; /* pointer to first char after the [ */ + + ptr2 = strchr(ptr1, ']' ); /* search for closing ] */ + if (!ptr2) + { + ffpmsg("input file URL is missing closing bracket ']'"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + + /* ---------------------------------------------- */ + /* First, test if this is a rawfile specifier */ + /* which looks something like: '[ib512,512:2880]' */ + /* Test if first character is b,i,j,d,r,f, or u, */ + /* and optional second character is b or l, */ + /* followed by one or more digits, */ + /* finally followed by a ',', ':', or ']' */ + /* ---------------------------------------------- */ + + if (*ptr1 == 'b' || *ptr1 == 'B' || *ptr1 == 'i' || *ptr1 == 'I' || + *ptr1 == 'j' || *ptr1 == 'J' || *ptr1 == 'd' || *ptr1 == 'D' || + *ptr1 == 'r' || *ptr1 == 'R' || *ptr1 == 'f' || *ptr1 == 'F' || + *ptr1 == 'u' || *ptr1 == 'U') + { + /* next optional character may be a b or l (for Big or Little) */ + ptr1++; + if (*ptr1 == 'b' || *ptr1 == 'B' || *ptr1 == 'l' || *ptr1 == 'L') + ptr1++; + + if (isdigit((int) *ptr1)) /* must have at least 1 digit */ + { + while (isdigit((int) *ptr1)) + ptr1++; /* skip over digits */ + + if (*ptr1 == ',' || *ptr1 == ':' || *ptr1 == ']' ) + { + /* OK, this looks like a rawfile specifier */ + + if (urltype) + { + if (strstr(urltype, "stdin") ) + strcpy(urltype, "rawstdin://"); + else + strcpy(urltype, "rawfile://"); + } + + /* append the raw array specifier to infilex */ + if (infilex) + { + + if (strlen(infilex) + strlen(ptr3) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcat(infilex, ptr3); + ptr1 = strchr(infilex, ']'); /* find the closing ] char */ + if (ptr1) + *(ptr1 + 1) = '\0'; /* terminate string after the ] */ + } + + if (extspec) + strcpy(extspec, "0"); /* the 0 ext number is implicit */ + + tmptr = strchr(ptr2 + 1, '[' ); /* search for another [ char */ + + /* copy any remaining characters into rowfilterx */ + if (tmptr && rowfilterx) + { + + + if (strlen(rowfilterx) + strlen(tmptr + 1) > FLEN_FILENAME -1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcat(rowfilterx, tmptr + 1); + + tmptr = strchr(rowfilterx, ']' ); /* search for closing ] */ + if (tmptr) + *tmptr = '\0'; /* overwrite the ] with null terminator */ + } + + free(infile); /* finished parsing, so return */ + return(*status); + } + } + } /* end of rawfile specifier test */ + + /* -------------------------------------------------------- */ + /* Not a rawfile, so next, test if this is an image section */ + /* i.e., an integer followed by a ':' or a '*' or '-*' */ + /* -------------------------------------------------------- */ + + ptr1 = ptr3 + 1; /* reset pointer to first char after the [ */ + tmptr = ptr1; + + while (*tmptr == ' ') + tmptr++; /* skip leading blanks */ + + while (isdigit((int) *tmptr)) + tmptr++; /* skip over leading digits */ + + if (*tmptr == ':' || *tmptr == '*' || *tmptr == '-') + { + /* this is an image section specifier */ + strcat(rowfilter, ptr3); +/* + don't want to assume 0 extension any more; may imply an image extension. + if (extspec) + strcpy(extspec, "0"); +*/ + } + else + { + /* ----------------------------------------------------------------- + Not an image section or rawfile spec so may be an extension spec. + + Examples of valid extension specifiers: + [3] - 3rd extension; 0 = primary array + [events] - events extension + [events, 2] - events extension, with EXTVER = 2 + [events,2] - spaces are optional + [events, 3, b] - same as above, plus XTENSION = 'BINTABLE' + [PICS; colName(12)] - an image in row 12 of the colName column + in the PICS table extension + [PICS; colName(exposure > 1000)] - as above, but find image in + first row with with exposure column value > 1000. + [Rate Table] - extension name can contain spaces! + [Rate Table;colName(exposure>1000)] + + Examples of other types of specifiers (Not extension specifiers) + + [bin] !!! this is ambiguous, and can't be distinguished from + a valid extension specifier + [bini X=1:512:16] (also binb, binj, binr, and bind are allowed) + [binr (X,Y) = 5] + [bin @binfilter.txt] + + [col Time;rate] + [col PI=PHA * 1.1] + [col -Time; status] + + [X > 5] + [X>5] + [@filter.txt] + [StatusCol] !!! this is ambiguous, and can't be distinguished + from a valid extension specifier + [StatusCol==0] + [StatusCol || x>6] + [gtifilter()] + [regfilter("region.reg")] + + [compress Rice] + + There will always be some ambiguity between an extension name and + a boolean row filtering expression, (as in a couple of the above + examples). If there is any doubt, the expression should be treated + as an extension specification; The user can always add an explicit + expression specifier to override this interpretation. + + The following decision logic will be used: + + 1) locate the first token, terminated with a space, comma, + semi-colon, or closing bracket. + + 2) the token is not part of an extension specifier if any of + the following is true: + + - if the token begins with '@' and contains a '.' + - if the token contains an operator: = > < || && + - if the token begins with "gtifilter(" or "regfilter(" + - if the token is terminated by a space and is followed by + additional characters (not a ']') AND any of the following: + - the token is 'col' + - the token is 3 or 4 chars long and begins with 'bin' + - the second token begins with an operator: + ! = < > | & + - * / % + + + 3) otherwise, the string is assumed to be an extension specifier + + ----------------------------------------------------------------- */ + + tmptr = ptr1; + while(*tmptr == ' ') + tmptr++; + + hasAt = 0; + hasDot = 0; + hasOper = 0; + followingOper = 0; + spaceTerm = 0; + rowFilter = 0; + colStart = 0; + binStart = 0; + pixStart = 0; + compStart = 0; + + if (*tmptr == '@') /* test for leading @ symbol */ + hasAt = 1; + + if ( !fits_strncasecmp(tmptr, "col ", 4) ) + colStart = 1; + + if ( !fits_strncasecmp(tmptr, "bin", 3) ) + binStart = 1; + + if ( !fits_strncasecmp(tmptr, "pix", 3) ) + pixStart = 1; + + if ( !fits_strncasecmp(tmptr, "compress ", 9) || + !fits_strncasecmp(tmptr, "compress]", 9) ) + compStart = 1; + + if ( !fits_strncasecmp(tmptr, "gtifilter(", 10) || + !fits_strncasecmp(tmptr, "regfilter(", 10) ) + { + rowFilter = 1; + } + else + { + /* parse the first token of the expression */ + for (ii = 0; ii < ptr2 - ptr1 + 1; ii++, tmptr++) + { + if (*tmptr == '.') + hasDot = 1; + else if (*tmptr == '=' || *tmptr == '>' || *tmptr == '<' || + (*tmptr == '|' && *(tmptr+1) == '|') || + (*tmptr == '&' && *(tmptr+1) == '&') ) + hasOper = 1; + + else if (*tmptr == ',' || *tmptr == ';' || *tmptr == ']') + { + break; + } + else if (*tmptr == ' ') /* a space char? */ + { + while(*tmptr == ' ') /* skip spaces */ + tmptr++; + + if (*tmptr == ']') /* is this the end? */ + break; + + spaceTerm = 1; /* 1st token is terminated by space */ + + /* test if this is a column or binning specifier */ + if (colStart || (ii <= 4 && (binStart || pixStart)) ) + rowFilter = 1; + else + { + + /* check if next character is an operator */ + if (*tmptr == '=' || *tmptr == '>' || *tmptr == '<' || + *tmptr == '|' || *tmptr == '&' || *tmptr == '!' || + *tmptr == '+' || *tmptr == '-' || *tmptr == '*' || + *tmptr == '/' || *tmptr == '%') + followingOper = 1; + } + break; + } + } + } + + /* test if this is NOT an extension specifier */ + if ( rowFilter || (pixStart && spaceTerm) || + (hasAt && hasDot) || + hasOper || + compStart || + (spaceTerm && followingOper) ) + { + /* this is (probably) not an extension specifier */ + /* so copy all chars to filter spec string */ + strcat(rowfilter, ptr3); + } + else + { + /* this appears to be a legit extension specifier */ + /* copy the extension specification */ + if (extspec) { + if (ptr2 - ptr1 > FLEN_FILENAME - 1) { + free(infile); + return(*status = URL_PARSE_ERROR); + } + strncat(extspec, ptr1, ptr2 - ptr1); + } + + /* copy any remaining chars to filter spec string */ + strcat(rowfilter, ptr2 + 1); + } + } + } /* end of if (!plus_ext) */ + else + { + /* ------------------------------------------------------------------ */ + /* already have extension, so this must be a filter spec of some sort */ + /* ------------------------------------------------------------------ */ + + strcat(rowfilter, ptr3); + } + + /* strip off any trailing blanks from filter */ + slen = strlen(rowfilter); + while ( (--slen) >= 0 && rowfilter[slen] == ' ') + rowfilter[slen] = '\0'; + + if (!rowfilter[0]) + { + free(infile); + return(*status); /* nothing left to parse */ + } + + /* ------------------------------------------------ */ + /* does the filter contain a binning specification? */ + /* ------------------------------------------------ */ + + ptr1 = strstr(rowfilter, "[bin"); /* search for "[bin" */ + if (!ptr1) + ptr1 = strstr(rowfilter, "[BIN"); /* search for "[BIN" */ + if (!ptr1) + ptr1 = strstr(rowfilter, "[Bin"); /* search for "[Bin" */ + + if (ptr1) + { + ptr2 = ptr1 + 4; /* end of the '[bin' string */ + if (*ptr2 == 'b' || *ptr2 == 'i' || *ptr2 == 'j' || + *ptr2 == 'r' || *ptr2 == 'd') + ptr2++; /* skip the datatype code letter */ + + + if ( *ptr2 != ' ' && *ptr2 != ']') + ptr1 = NULL; /* bin string must be followed by space or ] */ + } + + if (ptr1) + { + /* found the binning string */ + if (binspec) + { + if (strlen(ptr1 +1) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcpy(binspec, ptr1 + 1); + ptr2 = strchr(binspec, ']'); + + if (ptr2) /* terminate the binning filter */ + { + *ptr2 = '\0'; + + if ( *(--ptr2) == ' ') /* delete trailing spaces */ + *ptr2 = '\0'; + } + else + { + ffpmsg("input file URL is missing closing bracket ']'"); + ffpmsg(rowfilter); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + /* delete the binning spec from the row filter string */ + ptr2 = strchr(ptr1, ']'); + strcpy(tmpstr, ptr2+1); /* copy any chars after the binspec */ + strcpy(ptr1, tmpstr); /* overwrite binspec */ + } + + /* --------------------------------------------------------- */ + /* does the filter contain a column selection specification? */ + /* --------------------------------------------------------- */ + + ptr1 = strstr(rowfilter, "[col "); + if (!ptr1) + { + ptr1 = strstr(rowfilter, "[COL "); + + if (!ptr1) + ptr1 = strstr(rowfilter, "[Col "); + } + + if (ptr1) + { /* find the end of the column specifier */ + ptr2 = ptr1 + 5; + while (*ptr2 != ']') + { + if (*ptr2 == '\0') + { + ffpmsg("input file URL is missing closing bracket ']'"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + + if (*ptr2 == '\'') /* start of a literal string */ + { + ptr2 = strchr(ptr2 + 1, '\''); /* find closing quote */ + if (!ptr2) + { + ffpmsg + ("literal string in input file URL is missing closing single quote"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + if (*ptr2 == '[') /* set of nested square brackets */ + { + ptr2 = strchr(ptr2 + 1, ']'); /* find closing bracket */ + if (!ptr2) + { + ffpmsg + ("nested brackets in input file URL is missing closing bracket"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + ptr2++; /* continue search for the closing bracket character */ + } + + collen = ptr2 - ptr1 - 1; + + if (colspec) /* copy the column specifier to output string */ + { + if (collen > FLEN_FILENAME - 1) { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strncpy(colspec, ptr1 + 1, collen); + colspec[collen] = '\0'; + + while (colspec[--collen] == ' ') + colspec[collen] = '\0'; /* strip trailing blanks */ + } + + /* delete the column selection spec from the row filter string */ + strcpy(tmpstr, ptr2 + 1); /* copy any chars after the colspec */ + strcpy(ptr1, tmpstr); /* overwrite binspec */ + } + + /* --------------------------------------------------------- */ + /* does the filter contain a pixel filter specification? */ + /* --------------------------------------------------------- */ + + ptr1 = strstr(rowfilter, "[pix"); + if (!ptr1) + { + ptr1 = strstr(rowfilter, "[PIX"); + + if (!ptr1) + ptr1 = strstr(rowfilter, "[Pix"); + } + + if (ptr1) + { + ptr2 = ptr1 + 4; /* end of the '[pix' string */ + if (*ptr2 == 'b' || *ptr2 == 'i' || *ptr2 == 'j' || *ptr2 == 'B' || + *ptr2 == 'I' || *ptr2 == 'J' || *ptr2 == 'r' || *ptr2 == 'd' || + *ptr2 == 'R' || *ptr2 == 'D') + ptr2++; /* skip the datatype code letter */ + + if (*ptr2 == '1') + ptr2++; /* skip the single HDU indicator */ + + if ( *ptr2 != ' ') + ptr1 = NULL; /* pix string must be followed by space */ + } + + if (ptr1) + { /* find the end of the pixel filter */ + while (*ptr2 != ']') + { + if (*ptr2 == '\0') + { + ffpmsg("input file URL is missing closing bracket ']'"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + + if (*ptr2 == '\'') /* start of a literal string */ + { + ptr2 = strchr(ptr2 + 1, '\''); /* find closing quote */ + if (!ptr2) + { + ffpmsg + ("literal string in input file URL is missing closing single quote"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + if (*ptr2 == '[') /* set of nested square brackets */ + { + ptr2 = strchr(ptr2 + 1, ']'); /* find closing bracket */ + if (!ptr2) + { + ffpmsg + ("nested brackets in input file URL is missing closing bracket"); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + ptr2++; /* continue search for the closing bracket character */ + } + + collen = ptr2 - ptr1 - 1; + + if (pixfilter) /* copy the column specifier to output string */ + { + if (collen > FLEN_FILENAME - 1) { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strncpy(pixfilter, ptr1 + 1, collen); + pixfilter[collen] = '\0'; + + while (pixfilter[--collen] == ' ') + pixfilter[collen] = '\0'; /* strip trailing blanks */ + } + + /* delete the pixel filter from the row filter string */ + strcpy(tmpstr, ptr2 + 1); /* copy any chars after the pixel filter */ + strcpy(ptr1, tmpstr); /* overwrite binspec */ + } + + /* ------------------------------------------------------------ */ + /* does the filter contain an image compression specification? */ + /* ------------------------------------------------------------ */ + + ptr1 = strstr(rowfilter, "[compress"); + + if (ptr1) + { + ptr2 = ptr1 + 9; /* end of the '[compress' string */ + + if ( *ptr2 != ' ' && *ptr2 != ']') + ptr1 = NULL; /* compress string must be followed by space or ] */ + } + + if (ptr1) + { + /* found the compress string */ + if (compspec) + { + if (strlen(ptr1 +1) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcpy(compspec, ptr1 + 1); + ptr2 = strchr(compspec, ']'); + + if (ptr2) /* terminate the binning filter */ + { + *ptr2 = '\0'; + + if ( *(--ptr2) == ' ') /* delete trailing spaces */ + *ptr2 = '\0'; + } + else + { + ffpmsg("input file URL is missing closing bracket ']'"); + ffpmsg(rowfilter); + free(infile); + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + } + + /* delete the compression spec from the row filter string */ + ptr2 = strchr(ptr1, ']'); + strcpy(tmpstr, ptr2+1); /* copy any chars after the binspec */ + strcpy(ptr1, tmpstr); /* overwrite binspec */ + } + + /* copy the remaining string to the rowfilter output... should only */ + /* contain a rowfilter expression of the form "[expr]" */ + + if (rowfilterx && rowfilter[0]) { + ptr2 = rowfilter + strlen(rowfilter) - 1; + if( rowfilter[0]=='[' && *ptr2==']' ) { + *ptr2 = '\0'; + + if (strlen(rowfilter + 1) > FLEN_FILENAME - 1) + { + free(infile); + return(*status = URL_PARSE_ERROR); + } + + strcpy(rowfilterx, rowfilter+1); + } else { + ffpmsg("input file URL lacks valid row filter expression"); + *status = URL_PARSE_ERROR; + } + } + + free(infile); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffexist(const char *infile, /* I - input filename or URL */ + int *exists, /* O - 2 = a compressed version of file exists */ + /* 1 = yes, disk file exists */ + /* 0 = no, disk file could not be found */ + /* -1 = infile is not a disk file (could */ + /* be a http, ftp, gsiftp, smem, or stdin file) */ + int *status) /* I/O status */ + +/* + test if the input file specifier is an existing file on disk + If the specified file can't be found, it then searches for a + compressed version of the file. +*/ +{ + FILE *diskfile; + char rootname[FLEN_FILENAME]; + char *ptr1; + + if (*status > 0) + return(*status); + + /* strip off any extname or filters from the name */ + ffrtnm( (char *)infile, rootname, status); + + ptr1 = strstr(rootname, "://"); + + if (ptr1 || *rootname == '-') { + if (!strncmp(rootname, "file", 4) ) { + ptr1 = ptr1 + 3; /* pointer to start of the disk file name */ + } else { + *exists = -1; /* this is not a disk file */ + return (*status); + } + } else { + ptr1 = rootname; + } + + /* see if the disk file exists */ + if (file_openfile(ptr1, 0, &diskfile)) { + + /* no, couldn't open file, so see if there is a compressed version */ + if (file_is_compressed(ptr1) ) { + *exists = 2; /* a compressed version of the file exists */ + } else { + *exists = 0; /* neither file nor compressed version exist */ + } + + } else { + + /* yes, file exists */ + *exists = 1; + fclose(diskfile); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffrtnm(char *url, + char *rootname, + int *status) +/* + parse the input URL, returning the root name (filetype://basename). +*/ + +{ + int ii, jj, slen, infilelen; + char *ptr1, *ptr2, *ptr3; + char urltype[MAX_PREFIX_LEN]; + char infile[FLEN_FILENAME]; + + if (*status > 0) + return(*status); + + ptr1 = url; + *rootname = '\0'; + *urltype = '\0'; + *infile = '\0'; + + /* get urltype (e.g., file://, ftp://, http://, etc.) */ + if (*ptr1 == '-') /* "-" means read file from stdin */ + { + strcat(urltype, "-"); + ptr1++; + } + else if (!strncmp(ptr1, "stdin", 5) || !strncmp(ptr1, "STDIN", 5)) + { + strcat(urltype, "-"); + ptr1 = ptr1 + 5; + } + else + { + ptr2 = strstr(ptr1, "://"); + ptr3 = strstr(ptr1, "(" ); + + if (ptr3 && (ptr3 < ptr2) ) + { + /* the urltype follows a '(' character, so it must apply */ + /* to the output file, and is not the urltype of the input file */ + ptr2 = 0; /* so reset pointer to zero */ + } + + + if (ptr2) /* copy the explicit urltype string */ + { + + if (ptr2 - ptr1 + 3 > MAX_PREFIX_LEN - 1) + { + return(*status = URL_PARSE_ERROR); + } + strncat(urltype, ptr1, ptr2 - ptr1 + 3); + ptr1 = ptr2 + 3; + } + else if (!strncmp(ptr1, "ftp:", 4) ) + { /* the 2 //'s are optional */ + strcat(urltype, "ftp://"); + ptr1 += 4; + } + else if (!strncmp(ptr1, "gsiftp:", 7) ) + { /* the 2 //'s are optional */ + strcat(urltype, "gsiftp://"); + ptr1 += 7; + } + else if (!strncmp(ptr1, "http:", 5) ) + { /* the 2 //'s are optional */ + strcat(urltype, "http://"); + ptr1 += 5; + } + else if (!strncmp(ptr1, "mem:", 4) ) + { /* the 2 //'s are optional */ + strcat(urltype, "mem://"); + ptr1 += 4; + } + else if (!strncmp(ptr1, "shmem:", 6) ) + { /* the 2 //'s are optional */ + strcat(urltype, "shmem://"); + ptr1 += 6; + } + else if (!strncmp(ptr1, "file:", 5) ) + { /* the 2 //'s are optional */ + ptr1 += 5; + } + + /* else assume file driver */ + } + + /* get the input file name */ + ptr2 = strchr(ptr1, '('); /* search for opening parenthesis ( */ + ptr3 = strchr(ptr1, '['); /* search for opening bracket [ */ + + if (ptr2 == ptr3) /* simple case: no [ or ( in the file name */ + { + + if (strlen(ptr1) > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strcat(infile, ptr1); + } + else if (!ptr3) /* no bracket, so () enclose output file name */ + { + + if (ptr2 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(infile, ptr1, ptr2 - ptr1); + ptr2++; + + ptr1 = strchr(ptr2, ')' ); /* search for closing ) */ + if (!ptr1) + return(*status = URL_PARSE_ERROR); /* error, no closing ) */ + + } + else if (ptr2 && (ptr2 < ptr3)) /* () enclose output name before bracket */ + { + + if (ptr2 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(infile, ptr1, ptr2 - ptr1); + ptr2++; + + ptr1 = strchr(ptr2, ')' ); /* search for closing ) */ + if (!ptr1) + return(*status = URL_PARSE_ERROR); /* error, no closing ) */ + } + else /* bracket comes first, so there is no output name */ + { + if (ptr3 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(infile, ptr1, ptr3 - ptr1); + } + + /* strip off any trailing blanks in the names */ + slen = strlen(infile); + for (ii = slen - 1; ii > 0; ii--) + { + if (infile[ii] == ' ') + infile[ii] = '\0'; + else + break; + } + + /* --------------------------------------------- */ + /* check if the 'filename+n' convention has been */ + /* used to specifiy which HDU number to open */ + /* --------------------------------------------- */ + + jj = strlen(infile); + + for (ii = jj - 1; ii >= 0; ii--) + { + if (infile[ii] == '+') /* search backwards for '+' sign */ + break; + } + + if (ii > 0 && (jj - ii) < 5) /* limit extension numbers to 4 digits */ + { + infilelen = ii; + ii++; + + + for (; ii < jj; ii++) + { + if (!isdigit((int) infile[ii] ) ) /* are all the chars digits? */ + break; + } + + if (ii == jj) + { + /* yes, the '+n' convention was used. */ + + infile[infilelen] = '\0'; /* delete the extension number */ + } + } + + if (strlen(urltype) + strlen(infile) > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strcat(rootname, urltype); /* construct the root name */ + strcat(rootname, infile); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffourl(char *url, /* I - full input URL */ + char *urltype, /* O - url type */ + char *outfile, /* O - base file name */ + char *tpltfile, /* O - template file name, if any */ + char *compspec, /* O - compression specification, if any */ + int *status) +/* + parse the output URL into its basic components. +*/ + +{ + char *ptr1, *ptr2, *ptr3; + + if (*status > 0) + return(*status); + + if (urltype) + *urltype = '\0'; + if (outfile) + *outfile = '\0'; + if (tpltfile) + *tpltfile = '\0'; + if (compspec) + *compspec = '\0'; + + ptr1 = url; + while (*ptr1 == ' ') /* ignore leading blanks */ + ptr1++; + + if ( ( (*ptr1 == '-') && ( *(ptr1 +1) == 0 || *(ptr1 +1) == ' ' ) ) + || !strcmp(ptr1, "stdout") + || !strcmp(ptr1, "STDOUT")) + + /* "-" means write to stdout; also support "- " */ + /* but exclude disk file names that begin with a minus sign */ + /* e.g., "-55d33m.fits" */ + { + if (urltype) + strcpy(urltype, "stdout://"); + } + else + { + /* not writing to stdout */ + /* get urltype (e.g., file://, ftp://, http://, etc.) */ + + ptr2 = strstr(ptr1, "://"); + if (ptr2) /* copy the explicit urltype string */ + { + if (urltype) { + if (ptr2 - ptr1 + 3 > MAX_PREFIX_LEN - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(urltype, ptr1, ptr2 - ptr1 + 3); + } + + ptr1 = ptr2 + 3; + } + else /* assume file driver */ + { + if (urltype) + strcat(urltype, "file://"); + } + + /* look for template file name, enclosed in parenthesis */ + ptr2 = strchr(ptr1, '('); + + /* look for image compression parameters, enclosed in sq. brackets */ + ptr3 = strchr(ptr1, '['); + + if (outfile) + { + if (ptr2) { /* template file was specified */ + if (ptr2 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(outfile, ptr1, ptr2 - ptr1); + } else if (ptr3) { /* compression was specified */ + if (ptr3 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + strncat(outfile, ptr1, ptr3 - ptr1); + + } else { /* no template file or compression */ + if (strlen(ptr1) > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + strcpy(outfile, ptr1); + } + } + + + if (ptr2) /* template file was specified */ + { + ptr2++; + + ptr1 = strchr(ptr2, ')' ); /* search for closing ) */ + + if (!ptr1) + { + return(*status = URL_PARSE_ERROR); /* error, no closing ) */ + } + + if (tpltfile) { + if (ptr1 - ptr2 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + strncat(tpltfile, ptr2, ptr1 - ptr2); + } + } + + if (ptr3) /* compression was specified */ + { + ptr3++; + + ptr1 = strchr(ptr3, ']' ); /* search for closing ] */ + + if (!ptr1) + { + return(*status = URL_PARSE_ERROR); /* error, no closing ] */ + } + + if (compspec) { + + if (ptr1 - ptr3 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(compspec, ptr3, ptr1 - ptr3); + } + } + + /* check if a .gz compressed output file is to be created */ + /* by seeing if the filename ends in '.gz' */ + if (urltype && outfile) + { + if (!strcmp(urltype, "file://") ) + { + ptr1 = strstr(outfile, ".gz"); + if (ptr1) + { /* make sure the ".gz" is at the end of the file name */ + ptr1 += 3; + if (*ptr1 == 0 || *ptr1 == ' ' ) + strcpy(urltype, "compressoutfile://"); + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffexts(char *extspec, + int *extnum, + char *extname, + int *extvers, + int *hdutype, + char *imagecolname, + char *rowexpress, + int *status) +{ +/* + Parse the input extension specification string, returning either the + extension number or the values of the EXTNAME, EXTVERS, and XTENSION + keywords in desired extension. Also return the name of the column containing + an image, and an expression to be used to determine which row to use, + if present. +*/ + char *ptr1, *ptr2; + int slen, nvals; + int notint = 1; /* initially assume specified extname is not an integer */ + char tmpname[FLEN_VALUE], *loc; + + *extnum = 0; + *extname = '\0'; + *extvers = 0; + *hdutype = ANY_HDU; + *imagecolname = '\0'; + *rowexpress = '\0'; + + if (*status > 0) + return(*status); + + ptr1 = extspec; /* pointer to first char */ + + while (*ptr1 == ' ') /* skip over any leading blanks */ + ptr1++; + + if (isdigit((int) *ptr1)) /* is the extension specification a number? */ + { + notint = 0; /* looks like extname may actually be the ext. number */ + errno = 0; /* reset this prior to calling strtol */ + *extnum = strtol(ptr1, &loc, 10); /* read the string as an integer */ + + while (*loc == ' ') /* skip over trailing blanks */ + loc++; + + /* check for read error, or junk following the integer */ + if ((*loc != '\0' && *loc != ';' ) || (errno == ERANGE) ) + { + *extnum = 0; + notint = 1; /* no, extname was not a simple integer after all */ + errno = 0; /* reset error condition flag if it was set */ + } + + if ( *extnum < 0 || *extnum > 99999) + { + *extnum = 0; /* this is not a reasonable extension number */ + ffpmsg("specified extension number is out of range:"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + } + + +/* This logic was too simple, and failed on extnames like '1000TEMP' + where it would try to move to the 1000th extension + + if (isdigit((int) *ptr1)) + { + sscanf(ptr1, "%d", extnum); + if (*extnum < 0 || *extnum > 9999) + { + *extnum = 0; + ffpmsg("specified extension number is out of range:"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + } +*/ + + if (notint) + { + /* not a number, so EXTNAME must be specified, followed by */ + /* optional EXTVERS and XTENSION values */ + + /* don't use space char as end indicator, because there */ + /* may be imbedded spaces in the EXTNAME value */ + slen = strcspn(ptr1, ",:;"); /* length of EXTNAME */ + + if (slen > FLEN_VALUE - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(extname, ptr1, slen); /* EXTNAME value */ + + /* now remove any trailing blanks */ + while (slen > 0 && *(extname + slen -1) == ' ') + { + *(extname + slen -1) = '\0'; + slen--; + } + + ptr1 += slen; + slen = strspn(ptr1, " ,:"); /* skip delimiter characters */ + ptr1 += slen; + + slen = strcspn(ptr1, " ,:;"); /* length of EXTVERS */ + if (slen) + { + nvals = sscanf(ptr1, "%d", extvers); /* EXTVERS value */ + if (nvals != 1) + { + ffpmsg("illegal EXTVER value in input URL:"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + + ptr1 += slen; + slen = strspn(ptr1, " ,:"); /* skip delimiter characters */ + ptr1 += slen; + + slen = strcspn(ptr1, ";"); /* length of HDUTYPE */ + if (slen) + { + if (*ptr1 == 'b' || *ptr1 == 'B') + *hdutype = BINARY_TBL; + else if (*ptr1 == 't' || *ptr1 == 'T' || + *ptr1 == 'a' || *ptr1 == 'A') + *hdutype = ASCII_TBL; + else if (*ptr1 == 'i' || *ptr1 == 'I') + *hdutype = IMAGE_HDU; + else + { + ffpmsg("unknown type of HDU in input URL:"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + } + } + else + { + strcpy(tmpname, extname); + ffupch(tmpname); + if (!strcmp(tmpname, "PRIMARY") || !strcmp(tmpname, "P") ) + *extname = '\0'; /* return extnum = 0 */ + } + } + + ptr1 = strchr(ptr1, ';'); + if (ptr1) + { + /* an image is to be opened; the image is contained in a single */ + /* cell of a binary table. A column name and an expression to */ + /* determine which row to use has been entered. */ + + ptr1++; /* skip over the ';' delimiter */ + while (*ptr1 == ' ') /* skip over any leading blanks */ + ptr1++; + + ptr2 = strchr(ptr1, '('); + if (!ptr2) + { + ffpmsg("illegal specification of image in table cell in input URL:"); + ffpmsg(" did not find a row expression enclosed in ( )"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + + if (ptr2 - ptr1 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(imagecolname, ptr1, ptr2 - ptr1); /* copy column name */ + + ptr2++; /* skip over the '(' delimiter */ + while (*ptr2 == ' ') /* skip over any leading blanks */ + ptr2++; + + + ptr1 = strchr(ptr2, ')'); + if (!ptr2) + { + ffpmsg("illegal specification of image in table cell in input URL:"); + ffpmsg(" missing closing ')' character in row expression"); + ffpmsg(extspec); + return(*status = URL_PARSE_ERROR); + } + + if (ptr1 - ptr2 > FLEN_FILENAME - 1) + { + return(*status = URL_PARSE_ERROR); + } + + strncat(rowexpress, ptr2, ptr1 - ptr2); /* row expression */ + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffextn(char *url, /* I - input filename/URL */ + int *extension_num, /* O - returned extension number */ + int *status) +{ +/* + Parse the input url string and return the number of the extension that + CFITSIO would automatically move to if CFITSIO were to open this input URL. + The extension numbers are one's based, so 1 = the primary array, 2 = the + first extension, etc. + + The extension number that gets returned is determined by the following + algorithm: + + 1. If the input URL includes a binning specification (e.g. + 'myfile.fits[3][bin X,Y]') then the returned extension number + will always = 1, since CFITSIO would create a temporary primary + image on the fly in this case. The same is true if an image + within a single cell of a binary table is opened. + + 2. Else if the input URL specifies an extension number (e.g., + 'myfile.fits[3]' or 'myfile.fits+3') then the specified extension + number (+ 1) is returned. + + 3. Else if the extension name is specified in brackets + (e.g., this 'myfile.fits[EVENTS]') then the file will be opened and searched + for the extension number. If the input URL is '-' (reading from the stdin + file stream) this is not possible and an error will be returned. + + 4. Else if the URL does not specify an extension (e.g. 'myfile.fits') then + a special extension number = -99 will be returned to signal that no + extension was specified. This feature is mainly for compatibility with + existing FTOOLS software. CFITSIO would open the primary array by default + (extension_num = 1) in this case. + +*/ + fitsfile *fptr; + char urltype[20]; + char infile[FLEN_FILENAME]; + char outfile[FLEN_FILENAME]; + char extspec[FLEN_FILENAME]; + char extname[FLEN_FILENAME]; + char rowfilter[FLEN_FILENAME]; + char binspec[FLEN_FILENAME]; + char colspec[FLEN_FILENAME]; + char imagecolname[FLEN_VALUE], rowexpress[FLEN_FILENAME]; + char *cptr; + int extnum, extvers, hdutype, tstatus = 0; + + if (*status > 0) + return(*status); + + /* parse the input URL into its basic components */ + fits_parse_input_url(url, urltype, infile, outfile, + extspec, rowfilter,binspec, colspec, status); + + if (*status > 0) + return(*status); + + if (*binspec) /* is there a binning specification? */ + { + *extension_num = 1; /* a temporary primary array image is created */ + return(*status); + } + + if (*extspec) /* is an extension specified? */ + { + ffexts(extspec, &extnum, + extname, &extvers, &hdutype, imagecolname, rowexpress, status); + + if (*status > 0) + return(*status); + + if (*imagecolname) /* is an image within a table cell being opened? */ + { + *extension_num = 1; /* a temporary primary array image is created */ + return(*status); + } + + if (*extname) + { + /* have to open the file to search for the extension name (curses!) */ + + if (!strcmp(urltype, "stdin://")) + /* opening stdin would destroying it! */ + return(*status = URL_PARSE_ERROR); + + /* First, strip off any filtering specification */ + infile[0] = '\0'; + strncat(infile, url, FLEN_FILENAME -1); + + cptr = strchr(infile, ']'); /* locate the closing bracket */ + if (!cptr) + { + return(*status = URL_PARSE_ERROR); + } + else + { + cptr++; + *cptr = '\0'; /* terminate URl after the extension spec */ + } + + if (ffopen(&fptr, infile, READONLY, status) > 0) /* open the file */ + { + ffclos(fptr, &tstatus); + return(*status); + } + + ffghdn(fptr, &extnum); /* where am I in the file? */ + *extension_num = extnum; + ffclos(fptr, status); + + return(*status); + } + else + { + *extension_num = extnum + 1; /* return the specified number (+ 1) */ + return(*status); + } + } + else + { + *extension_num = -99; /* no specific extension was specified */ + /* defaults to primary array */ + return(*status); + } +} +/*--------------------------------------------------------------------------*/ + +int ffurlt(fitsfile *fptr, char *urlType, int *status) +/* + return the prefix string associated with the driver in use by the + fitsfile pointer fptr +*/ + +{ + strcpy(urlType, driverTable[fptr->Fptr->driver].prefix); + return(*status); +} + +/*--------------------------------------------------------------------------*/ +int ffimport_file( char *filename, /* Text file to read */ + char **contents, /* Pointer to pointer to hold file */ + int *status ) /* CFITSIO error code */ +/* + Read and concatenate all the lines from the given text file. User + must free the pointer returned in contents. Pointer is guaranteed + to hold 2 characters more than the length of the text... allows the + calling routine to append (or prepend) a newline (or quotes?) without + reallocating memory. +*/ +{ + int allocLen, totalLen, llen, eoline = 1; + char *lines,line[256]; + FILE *aFile; + + if( *status > 0 ) return( *status ); + + totalLen = 0; + allocLen = 1024; + lines = (char *)malloc( allocLen * sizeof(char) ); + if( !lines ) { + ffpmsg("Couldn't allocate memory to hold ASCII file contents."); + return(*status = MEMORY_ALLOCATION ); + } + lines[0] = '\0'; + + if( (aFile = fopen( filename, "r" ))==NULL ) { + snprintf(line,256,"Could not open ASCII file %s.",filename); + ffpmsg(line); + free( lines ); + return(*status = FILE_NOT_OPENED); + } + + while( fgets(line,256,aFile)!=NULL ) { + llen = strlen(line); + if ( eoline && (llen > 1) && (line[0] == '/' && line[1] == '/')) + continue; /* skip comment lines begging with // */ + + eoline = 0; + + /* replace CR and newline chars at end of line with nulls */ + if ((llen > 0) && (line[llen-1]=='\n' || line[llen-1] == '\r')) { + line[--llen] = '\0'; + eoline = 1; /* found an end of line character */ + + if ((llen > 0) && (line[llen-1]=='\n' || line[llen-1] == '\r')) { + line[--llen] = '\0'; + } + } + + if( totalLen + llen + 3 >= allocLen ) { + allocLen += 256; + lines = (char *)realloc(lines, allocLen * sizeof(char) ); + if( ! lines ) { + ffpmsg("Couldn't allocate memory to hold ASCII file contents."); + *status = MEMORY_ALLOCATION; + break; + } + } + strcpy( lines+totalLen, line ); + totalLen += llen; + + if (eoline) { + strcpy( lines+totalLen, " "); /* add a space between lines */ + totalLen += 1; + } + } + fclose(aFile); + + *contents = lines; + return( *status ); +} + +/*--------------------------------------------------------------------------*/ +int fits_get_token(char **ptr, + char *delimiter, + char *token, + int *isanumber) /* O - is this token a number? */ +/* + parse off the next token, delimited by a character in 'delimiter', + from the input ptr string; increment *ptr to the end of the token. + Returns the length of the token, not including the delimiter char; +*/ +{ + char *loc, tval[73]; + int slen; + double dval; + + *token = '\0'; + + while (**ptr == ' ') /* skip over leading blanks */ + (*ptr)++; + + slen = strcspn(*ptr, delimiter); /* length of next token */ + if (slen) + { + strncat(token, *ptr, slen); /* copy token */ + + (*ptr) += slen; /* skip over the token */ + + if (isanumber) /* check if token is a number */ + { + *isanumber = 1; + + if (strchr(token, 'D')) { + strncpy(tval, token, 72); + tval[72] = '\0'; + + /* The C language does not support a 'D'; replace with 'E' */ + if ((loc = strchr(tval, 'D'))) *loc = 'E'; + + dval = strtod(tval, &loc); + } else { + dval = strtod(token, &loc); + } + + /* check for read error, or junk following the value */ + if (*loc != '\0' && *loc != ' ' ) *isanumber = 0; + if (errno == ERANGE) *isanumber = 0; + } + } + + return(slen); +} +/*--------------------------------------------------------------------------*/ +int fits_get_token2(char **ptr, + char *delimiter, + char **token, + int *isanumber, /* O - is this token a number? */ + int *status) + +/* + parse off the next token, delimited by a character in 'delimiter', + from the input ptr string; increment *ptr to the end of the token. + Returns the length of the token, not including the delimiter char; + + This routine allocates the *token string; the calling routine must free it +*/ +{ + char *loc, tval[73]; + int slen; + double dval; + + if (*status) + return(0); + + while (**ptr == ' ') /* skip over leading blanks */ + (*ptr)++; + + slen = strcspn(*ptr, delimiter); /* length of next token */ + if (slen) + { + *token = (char *) calloc(slen + 1, 1); + if (!(*token)) { + ffpmsg("Couldn't allocate memory to hold token string (fits_get_token2)."); + *status = MEMORY_ALLOCATION ; + return(0); + } + + strncat(*token, *ptr, slen); /* copy token */ + (*ptr) += slen; /* skip over the token */ + + if (isanumber) /* check if token is a number */ + { + *isanumber = 1; + + if (strchr(*token, 'D')) { + strncpy(tval, *token, 72); + tval[72] = '\0'; + + /* The C language does not support a 'D'; replace with 'E' */ + if ((loc = strchr(tval, 'D'))) *loc = 'E'; + + dval = strtod(tval, &loc); + } else { + dval = strtod(*token, &loc); + } + + /* check for read error, or junk following the value */ + if (*loc != '\0' && *loc != ' ' ) *isanumber = 0; + if (errno == ERANGE) *isanumber = 0; + } + } + + return(slen); +} +/*---------------------------------------------------------------------------*/ +char *fits_split_names( + char *list) /* I - input list of names */ +{ +/* + A sequence of calls to fits_split_names will split the input string + into name tokens. The string typically contains a list of file or + column names. The names must be delimited by a comma and/or spaces. + This routine ignores spaces and commas that occur within parentheses, + brackets, or curly brackets. It also strips any leading and trailing + blanks from the returned name. + + This routine is similar to the ANSI C 'strtok' function: + + The first call to fits_split_names has a non-null input string. + It finds the first name in the string and terminates it by + overwriting the next character of the string with a '\0' and returns + a pointer to the name. Each subsequent call, indicated by a NULL + value of the input string, returns the next name, searching from + just past the end of the previous name. It returns NULL when no + further names are found. + + The following line illustrates how a string would be split into 3 names: + myfile[1][bin (x,y)=4], file2.fits file3.fits + ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^ + 1st name 2nd name 3rd name + + +NOTE: This routine is not thread-safe. +This routine is simply provided as a utility routine for other external +software. It is not used by any CFITSIO routine. + +*/ + int depth = 0; + char *start; + static char *ptr; + + if (list) /* reset ptr if a string is given */ + ptr = list; + + while (*ptr == ' ')ptr++; /* skip leading white space */ + + if (*ptr == '\0')return(0); /* no remaining file names */ + + start = ptr; + + while (*ptr != '\0') { + if ((*ptr == '[') || (*ptr == '(') || (*ptr == '{')) depth ++; + else if ((*ptr == '}') || (*ptr == ')') || (*ptr == ']')) depth --; + else if ((depth == 0) && (*ptr == ',' || *ptr == ' ')) { + *ptr = '\0'; /* terminate the filename here */ + ptr++; /* save pointer to start of next filename */ + break; + } + ptr++; + } + + return(start); +} +/*--------------------------------------------------------------------------*/ +int urltype2driver(char *urltype, int *driver) +/* + compare input URL with list of known drivers, returning the + matching driver numberL. +*/ + +{ + int ii; + + /* find matching driver; search most recent drivers first */ + + for (ii=no_of_drivers - 1; ii >= 0; ii--) + { + if (0 == strcmp(driverTable[ii].prefix, urltype)) + { + *driver = ii; + return(0); + } + } + + return(NO_MATCHING_DRIVER); +} +/*--------------------------------------------------------------------------*/ +int ffclos(fitsfile *fptr, /* I - FITS file pointer */ + int *status) /* IO - error status */ +/* + close the FITS file by completing the current HDU, flushing it to disk, + then calling the system dependent routine to physically close the FITS file +*/ +{ + int tstatus = NO_CLOSE_ERROR, zerostatus = 0; + + if (!fptr) + return(*status = NULL_INPUT_PTR); + else if ((fptr->Fptr)->validcode != VALIDSTRUC) /* check for magic value */ + return(*status = BAD_FILEPTR); + + /* close and flush the current HDU */ + if (*status > 0) + ffchdu(fptr, &tstatus); /* turn off the error message from ffchdu */ + else + ffchdu(fptr, status); + + ((fptr->Fptr)->open_count)--; /* decrement usage counter */ + + if ((fptr->Fptr)->open_count == 0) /* if no other files use structure */ + { + ffflsh(fptr, TRUE, status); /* flush and disassociate IO buffers */ + + /* call driver function to actually close the file */ + if ((*driverTable[(fptr->Fptr)->driver].close)((fptr->Fptr)->filehandle)) + { + if (*status <= 0) + { + *status = FILE_NOT_CLOSED; /* report if no previous error */ + + ffpmsg("failed to close the following file: (ffclos)"); + ffpmsg((fptr->Fptr)->filename); + } + } + + fits_clear_Fptr( fptr->Fptr, status); /* clear Fptr address */ + free((fptr->Fptr)->iobuffer); /* free memory for I/O buffers */ + free((fptr->Fptr)->headstart); /* free memory for headstart array */ + free((fptr->Fptr)->filename); /* free memory for the filename */ + (fptr->Fptr)->filename = 0; + (fptr->Fptr)->validcode = 0; /* magic value to indicate invalid fptr */ + free(fptr->Fptr); /* free memory for the FITS file structure */ + free(fptr); /* free memory for the FITS file structure */ + } + else + { + /* + to minimize the fallout from any previous error (e.g., trying to + open a non-existent extension in a already opened file), + always call ffflsh with status = 0. + */ + /* just flush the buffers, don't disassociate them */ + if (*status > 0) + ffflsh(fptr, FALSE, &zerostatus); + else + ffflsh(fptr, FALSE, status); + + free(fptr); /* free memory for the FITS file structure */ + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdelt(fitsfile *fptr, /* I - FITS file pointer */ + int *status) /* IO - error status */ +/* + close and DELETE the FITS file. +*/ +{ + char *basename; + int slen, tstatus = NO_CLOSE_ERROR, zerostatus = 0; + + if (!fptr) + return(*status = NULL_INPUT_PTR); + else if ((fptr->Fptr)->validcode != VALIDSTRUC) /* check for magic value */ + return(*status = BAD_FILEPTR); + + if (*status > 0) + ffchdu(fptr, &tstatus); /* turn off the error message from ffchdu */ + else + ffchdu(fptr, status); + + ffflsh(fptr, TRUE, status); /* flush and disassociate IO buffers */ + + /* call driver function to actually close the file */ + if ( (*driverTable[(fptr->Fptr)->driver].close)((fptr->Fptr)->filehandle) ) + { + if (*status <= 0) + { + *status = FILE_NOT_CLOSED; /* report error if no previous error */ + + ffpmsg("failed to close the following file: (ffdelt)"); + ffpmsg((fptr->Fptr)->filename); + } + } + + /* call driver function to actually delete the file */ + if ( (driverTable[(fptr->Fptr)->driver].remove) ) + { + /* parse the input URL to get the base filename */ + slen = strlen((fptr->Fptr)->filename); + basename = (char *) malloc(slen +1); + if (!basename) + return(*status = MEMORY_ALLOCATION); + + fits_parse_input_url((fptr->Fptr)->filename, NULL, basename, NULL, NULL, NULL, NULL, + NULL, &zerostatus); + + if ((*driverTable[(fptr->Fptr)->driver].remove)(basename)) + { + ffpmsg("failed to delete the following file: (ffdelt)"); + ffpmsg((fptr->Fptr)->filename); + if (!(*status)) + *status = FILE_NOT_CLOSED; + } + free(basename); + } + + fits_clear_Fptr( fptr->Fptr, status); /* clear Fptr address */ + free((fptr->Fptr)->iobuffer); /* free memory for I/O buffers */ + free((fptr->Fptr)->headstart); /* free memory for headstart array */ + free((fptr->Fptr)->filename); /* free memory for the filename */ + (fptr->Fptr)->filename = 0; + (fptr->Fptr)->validcode = 0; /* magic value to indicate invalid fptr */ + free(fptr->Fptr); /* free memory for the FITS file structure */ + free(fptr); /* free memory for the FITS file structure */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fftrun( fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG filesize, /* I - size to truncate the file */ + int *status) /* O - error status */ +/* + low level routine to truncate a file to a new smaller size. +*/ +{ + if (driverTable[(fptr->Fptr)->driver].truncate) + { + ffflsh(fptr, FALSE, status); /* flush all the buffers first */ + (fptr->Fptr)->filesize = filesize; + (fptr->Fptr)->io_pos = filesize; + (fptr->Fptr)->logfilesize = filesize; + (fptr->Fptr)->bytepos = filesize; + ffbfeof(fptr, status); /* eliminate any buffers beyond current EOF */ + return (*status = + (*driverTable[(fptr->Fptr)->driver].truncate)((fptr->Fptr)->filehandle, + filesize) ); + } + else + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffflushx( FITSfile *fptr) /* I - FITS file pointer */ +/* + low level routine to flush internal file buffers to the file. +*/ +{ + if (driverTable[fptr->driver].flush) + return ( (*driverTable[fptr->driver].flush)(fptr->filehandle) ); + else + return(0); /* no flush function defined for this driver */ +} +/*--------------------------------------------------------------------------*/ +int ffseek( FITSfile *fptr, /* I - FITS file pointer */ + LONGLONG position) /* I - byte position to seek to */ +/* + low level routine to seek to a position in a file. +*/ +{ + return( (*driverTable[fptr->driver].seek)(fptr->filehandle, position) ); +} +/*--------------------------------------------------------------------------*/ +int ffwrite( FITSfile *fptr, /* I - FITS file pointer */ + long nbytes, /* I - number of bytes to write */ + void *buffer, /* I - buffer to write */ + int *status) /* O - error status */ +/* + low level routine to write bytes to a file. +*/ +{ + if ( (*driverTable[fptr->driver].write)(fptr->filehandle, buffer, nbytes) ) + { + ffpmsg("Error writing data buffer to file:"); + ffpmsg(fptr->filename); + + *status = WRITE_ERROR; + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffread( FITSfile *fptr, /* I - FITS file pointer */ + long nbytes, /* I - number of bytes to read */ + void *buffer, /* O - buffer to read into */ + int *status) /* O - error status */ +/* + low level routine to read bytes from a file. +*/ +{ + int readstatus; + + readstatus = (*driverTable[fptr->driver].read)(fptr->filehandle, + buffer, nbytes); + + if (readstatus == END_OF_FILE) + *status = END_OF_FILE; + else if (readstatus > 0) + { + ffpmsg("Error reading data buffer from file:"); + ffpmsg(fptr->filename); + + *status = READ_ERROR; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fftplt(fitsfile **fptr, /* O - FITS file pointer */ + const char *filename, /* I - name of file to create */ + const char *tempname, /* I - name of template file */ + int *status) /* IO - error status */ +/* + Create and initialize a new FITS file based on a template file. + Uses C fopen and fgets functions. +*/ +{ + *fptr = 0; /* initialize null file pointer, */ + /* regardless of the value of *status */ + if (*status > 0) + return(*status); + + if ( ffinit(fptr, filename, status) ) /* create empty file */ + return(*status); + + ffoptplt(*fptr, tempname, status); /* open and use template */ + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffoptplt(fitsfile *fptr, /* O - FITS file pointer */ + const char *tempname, /* I - name of template file */ + int *status) /* IO - error status */ +/* + open template file and use it to create new file +*/ +{ + fitsfile *tptr; + int tstatus = 0, nkeys, nadd, ii; + char card[FLEN_CARD]; + + if (*status > 0) + return(*status); + + if (tempname == NULL || *tempname == '\0') /* no template file? */ + return(*status); + + /* try opening template */ + ffopen(&tptr, (char *) tempname, READONLY, &tstatus); + + if (tstatus) /* not a FITS file, so treat it as an ASCII template */ + { + ffxmsg(2, card); /* clear the error message */ + fits_execute_template(fptr, (char *) tempname, status); + + ffmahd(fptr, 1, 0, status); /* move back to the primary array */ + return(*status); + } + else /* template is a valid FITS file */ + { + ffmahd(tptr, 1, NULL, status); /* make sure we are at the beginning */ + while (*status <= 0) + { + ffghsp(tptr, &nkeys, &nadd, status); /* get no. of keywords */ + + for (ii = 1; ii <= nkeys; ii++) /* copy keywords */ + { + ffgrec(tptr, ii, card, status); + + /* must reset the PCOUNT keyword to zero in the new output file */ + if (strncmp(card, "PCOUNT ",8) == 0) { /* the PCOUNT keyword? */ + if (strncmp(card+25, " 0", 5)) { /* non-zero value? */ + strncpy(card, "PCOUNT = 0", 30); + } + } + + ffprec(fptr, card, status); + } + + ffmrhd(tptr, 1, 0, status); /* move to next HDU until error */ + ffcrhd(fptr, status); /* create empty new HDU in output file */ + } + + if (*status == END_OF_FILE) + { + *status = 0; /* expected error condition */ + } + ffclos(tptr, status); /* close the template file */ + } + + ffmahd(fptr, 1, 0, status); /* move to the primary array */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +void ffrprt( FILE *stream, int status) +/* + Print out report of cfitsio error status and messages on the error stack. + Uses C FILE stream. +*/ +{ + char status_str[FLEN_STATUS], errmsg[FLEN_ERRMSG]; + + if (status) + { + + fits_get_errstatus(status, status_str); /* get the error description */ + fprintf(stream, "\nFITSIO status = %d: %s\n", status, status_str); + + while ( fits_read_errmsg(errmsg) ) /* get error stack messages */ + fprintf(stream, "%s\n", errmsg); + } + return; +} +/*--------------------------------------------------------------------------*/ +int pixel_filter_helper( + fitsfile **fptr, /* IO - pointer to input image; on output it */ + /* points to the new image */ + char *outfile, /* I - name for output file */ + char *expr, /* I - Image filter expression */ + int *status) +{ + PixelFilter filter = { 0 }; + char * DEFAULT_TAG = "X"; + int ii, hdunum; + int singleHDU = 0; + + filter.count = 1; + filter.ifptr = fptr; + filter.tag = &DEFAULT_TAG; + + /* create new empty file for result */ + if (ffinit(&filter.ofptr, outfile, status) > 0) + { + ffpmsg("failed to create output file for pixel filter:"); + ffpmsg(outfile); + return(*status); + } + + fits_get_hdu_num(*fptr, &hdunum); /* current HDU number in input file */ + + expr += 3; /* skip 'pix' */ + switch (expr[0]) { + case 'b': + case 'B': filter.bitpix = BYTE_IMG; break; + case 'i': + case 'I': filter.bitpix = SHORT_IMG; break; + case 'j': + case 'J': filter.bitpix = LONG_IMG; break; + case 'r': + case 'R': filter.bitpix = FLOAT_IMG; break; + case 'd': + case 'D': filter.bitpix = DOUBLE_IMG; break; + } + if (filter.bitpix) /* skip bitpix indicator */ + ++expr; + + if (*expr == '1') { + ++expr; + singleHDU = 1; + } + + if (((*fptr)->Fptr)->only_one) + singleHDU = 1; + + if (*expr != ' ') { + ffpmsg("pixel filtering expression not space separated:"); + ffpmsg(expr); + } + while (*expr == ' ') + ++expr; + + /* copy all preceding extensions to the output file */ + for (ii = 1; !singleHDU && ii < hdunum; ii++) + { + fits_movabs_hdu(*fptr, ii, NULL, status); + if (fits_copy_hdu(*fptr, filter.ofptr, 0, status) > 0) + { + ffclos(filter.ofptr, status); + return(*status); + } + } + + /* move back to the original HDU position */ + fits_movabs_hdu(*fptr, hdunum, NULL, status); + + filter.expression = expr; + if (fits_pixel_filter(&filter, status)) { + ffpmsg("failed to execute image filter:"); + ffpmsg(expr); + ffclos(filter.ofptr, status); + return(*status); + } + + + /* copy any remaining HDUs to the output file */ + + for (ii = hdunum + 1; !singleHDU; ii++) + { + if (fits_movabs_hdu(*fptr, ii, NULL, status) > 0) + break; + + fits_copy_hdu(*fptr, filter.ofptr, 0, status); + } + + if (*status == END_OF_FILE) + *status = 0; /* got the expected EOF error; reset = 0 */ + else if (*status > 0) + { + ffclos(filter.ofptr, status); + return(*status); + } + + /* close the original file and return ptr to the new image */ + ffclos(*fptr, status); + + *fptr = filter.ofptr; /* reset the pointer to the new table */ + + /* move back to the image subsection */ + if (ii - 1 != hdunum) + fits_movabs_hdu(*fptr, hdunum, NULL, status); + + return(*status); +} + +/*-------------------------------------------------------------------*/ +int ffihtps(void) +{ + /* Wrapper function for global initialization of curl library. + This is NOT THREAD-SAFE */ + int status=0; +#ifdef CFITSIO_HAVE_CURL + if (curl_global_init(CURL_GLOBAL_ALL)) + /* Do we want to define a new CFITSIO error code for this? */ + status = -1; +#endif + return status; +} + +/*-------------------------------------------------------------------*/ +int ffchtps(void) +{ + /* Wrapper function for global cleanup of curl library. + This is NOT THREAD-SAFE */ +#ifdef CFITSIO_HAVE_CURL + curl_global_cleanup(); +#endif + return 0; +} + +/*-------------------------------------------------------------------*/ +void ffvhtps(int flag) +{ + /* Turn libcurl's verbose output on (1) or off (0). + This is NOT THREAD-SAFE */ +#ifdef HAVE_NET_SERVICES + + https_set_verbose(flag); +#endif +} + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/drvrfile.c b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrfile.c new file mode 100644 index 0000000000000000000000000000000000000000..a9f02231102df21758879e03417762d251206d4a --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrfile.c @@ -0,0 +1,1004 @@ +/* This file, drvrfile.c contains driver routines for disk files. */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include "fitsio2.h" +#include "group.h" /* needed for fits_get_cwd in file_create */ + +#if defined(unix) || defined(__unix__) || defined(__unix) +#include /* needed in file_openfile */ + +#ifdef REPLACE_LINKS +#include +#include +#endif + +#endif + +#ifdef HAVE_FTRUNCATE +#if defined(unix) || defined(__unix__) || defined(__unix) || defined(HAVE_UNISTD_H) +#include /* needed for getcwd prototype on unix machines */ +#endif +#endif + +#define IO_SEEK 0 /* last file I/O operation was a seek */ +#define IO_READ 1 /* last file I/O operation was a read */ +#define IO_WRITE 2 /* last file I/O operation was a write */ + +static char file_outfile[FLEN_FILENAME]; + +typedef struct /* structure containing disk file structure */ +{ + FILE *fileptr; + LONGLONG currentpos; + int last_io_op; +} diskdriver; + +static diskdriver handleTable[NMAXFILES]; /* allocate diskfile handle tables */ + +/*--------------------------------------------------------------------------*/ +int file_init(void) +{ + int ii; + + for (ii = 0; ii < NMAXFILES; ii++) /* initialize all empty slots in table */ + { + handleTable[ii].fileptr = 0; + } + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_setoptions(int options) +{ + /* do something with the options argument, to stop compiler warning */ + options = 0; + return(options); +} +/*--------------------------------------------------------------------------*/ +int file_getoptions(int *options) +{ + *options = 0; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_getversion(int *version) +{ + *version = 10; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_shutdown(void) +{ + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_open(char *filename, int rwmode, int *handle) +{ + FILE *diskfile; + int copyhandle, ii, status; + char recbuf[2880]; + size_t nread; + + /* + if an output filename has been specified as part of the input + file, as in "inputfile.fits(outputfile.fit)" then we have to + create the output file, copy the input to it, then reopen the + the new copy. + */ + + if (*file_outfile) + { + /* open the original file, with readonly access */ + status = file_openfile(filename, READONLY, &diskfile); + if (status) { + file_outfile[0] = '\0'; + return(status); + } + + /* create the output file */ + status = file_create(file_outfile,handle); + if (status) + { + ffpmsg("Unable to create output file for copy of input file:"); + ffpmsg(file_outfile); + file_outfile[0] = '\0'; + return(status); + } + + /* copy the file from input to output */ + while(0 != (nread = fread(recbuf,1,2880, diskfile))) + { + status = file_write(*handle, recbuf, nread); + if (status) { + file_outfile[0] = '\0'; + return(status); + } + } + + /* close both files */ + fclose(diskfile); + copyhandle = *handle; + file_close(*handle); + *handle = copyhandle; /* reuse the old file handle */ + + /* reopen the new copy, with correct rwmode */ + status = file_openfile(file_outfile, rwmode, &diskfile); + file_outfile[0] = '\0'; + } + else + { + *handle = -1; + for (ii = 0; ii < NMAXFILES; ii++) /* find empty slot in table */ + { + if (handleTable[ii].fileptr == 0) + { + *handle = ii; + break; + } + } + + if (*handle == -1) + return(TOO_MANY_FILES); /* too many files opened */ + + /*open the file */ + status = file_openfile(filename, rwmode, &diskfile); + } + + handleTable[*handle].fileptr = diskfile; + handleTable[*handle].currentpos = 0; + handleTable[*handle].last_io_op = IO_SEEK; + + return(status); +} +/*--------------------------------------------------------------------------*/ +int file_openfile(char *filename, int rwmode, FILE **diskfile) +/* + lowest level routine to physically open a disk file +*/ +{ + char mode[4]; + +#if defined(unix) || defined(__unix__) || defined(__unix) + char tempname[1024], *cptr, user[80]; + struct passwd *pwd; + int ii = 0; + +#if defined(REPLACE_LINKS) + struct stat stbuf; + int success = 0; + size_t n; + FILE *f1, *f2; + char buf[BUFSIZ]; +#endif + +#endif + + if (rwmode == READWRITE) + { + strcpy(mode, "r+b"); /* open existing file with read-write */ + } + else + { + strcpy(mode, "rb"); /* open existing file readonly */ + } + +#if MACHINE == ALPHAVMS || MACHINE == VAXVMS + /* specify VMS record structure: fixed format, 2880 byte records */ + /* but force stream mode access to enable random I/O access */ + *diskfile = fopen(filename, mode, "rfm=fix", "mrs=2880", "ctx=stm"); + +#elif defined(unix) || defined(__unix__) || defined(__unix) + + /* support the ~user/file.fits or ~/file.fits filenames in UNIX */ + + if (*filename == '~') + { + if (filename[1] == '/') + { + cptr = getenv("HOME"); + if (cptr) + { + if (strlen(cptr) + strlen(filename+1) > 1023) + return(FILE_NOT_OPENED); + + strcpy(tempname, cptr); + strcat(tempname, filename+1); + } + else + { + if (strlen(filename) > 1023) + return(FILE_NOT_OPENED); + + strcpy(tempname, filename); + } + } + else + { + /* copy user name */ + cptr = filename+1; + while (*cptr && (*cptr != '/')) + { + user[ii] = *cptr; + cptr++; + ii++; + } + user[ii] = '\0'; + + /* get structure that includes name of user's home directory */ + pwd = getpwnam(user); + + /* copy user's home directory */ + if (strlen(pwd->pw_dir) + strlen(cptr) > 1023) + return(FILE_NOT_OPENED); + + strcpy(tempname, pwd->pw_dir); + strcat(tempname, cptr); + } + + *diskfile = fopen(tempname, mode); + } + else + { + /* don't need to expand the input file name */ + *diskfile = fopen(filename, mode); + +#if defined(REPLACE_LINKS) + + if (!(*diskfile) && (rwmode == READWRITE)) + { + /* failed to open file with READWRITE privilege. Test if */ + /* the file we are trying to open is a soft link to a file that */ + /* doesn't have write privilege. */ + + lstat(filename, &stbuf); + if ((stbuf.st_mode & S_IFMT) == S_IFLNK) /* is this a soft link? */ + { + if ((f1 = fopen(filename, "rb")) != 0) /* try opening READONLY */ + { + + if (strlen(filename) + 7 > 1023) + return(FILE_NOT_OPENED); + + strcpy(tempname, filename); + strcat(tempname, ".TmxFil"); + if ((f2 = fopen(tempname, "wb")) != 0) /* create temp file */ + { + success = 1; + while ((n = fread(buf, 1, BUFSIZ, f1)) > 0) + { + /* copy linked file to local temporary file */ + if (fwrite(buf, 1, n, f2) != n) + { + success = 0; + break; + } + } + fclose(f2); + } + fclose(f1); + + if (success) + { + /* delete link and rename temp file to previous link name */ + remove(filename); + rename(tempname, filename); + + /* try once again to open the file with write access */ + *diskfile = fopen(filename, mode); + } + else + remove(tempname); /* clean up the failed copy */ + } + } + } +#endif + + } + +#else + + /* other non-UNIX machines */ + *diskfile = fopen(filename, mode); + +#endif + + if (!(*diskfile)) /* couldn't open file */ + { + return(FILE_NOT_OPENED); + } + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_create(char *filename, int *handle) +{ + FILE *diskfile; + int ii; + char mode[4]; + + int status = 0, rootlen, rootlen2, slen; + char *cptr, *cpos; + char cwd[FLEN_FILENAME], absURL[FLEN_FILENAME]; + char rootstring[256], rootstring2[256]; + char username[FLEN_FILENAME], userroot[FLEN_FILENAME], userroot2[FLEN_FILENAME]; + + cptr = getenv("HERA_DATA_DIRECTORY"); + if (cptr) { + /* This environment variable is defined in the Hera data analysis environment. */ + /* It specifies the root directory path to the users data directories. */ + /* CFITSIO will verify that the path to the file that is to be created */ + /* is within this root directory + the user's home directory name. */ + +/* +printf("env = %s\n",cptr); +*/ + if (strlen(cptr) > 200) /* guard against possible string overflows */ + return(FILE_NOT_CREATED); + + /* environment variable has the form "path/one/;/path/two/" where the */ + /* second path is optional */ + + strcpy(rootstring, cptr); + cpos = strchr(rootstring, ';'); + if (cpos) { + *cpos = '\0'; + cpos++; + strcpy(rootstring2, cpos); + } else { + *rootstring2 = '\0'; + } +/* +printf("%s, %s\n", rootstring, rootstring2); +printf("CWD = %s\n", cwd); +printf("rootstring=%s, cwd=%s.\n", rootstring, cwd); +*/ + /* Get the current working directory */ + fits_get_cwd(cwd, &status); + slen = strlen(cwd); + if ((slen < FLEN_FILENAME) && cwd[slen-1] != '/') strcat(cwd,"/"); /* make sure the CWD ends with slash */ + + + /* check that CWD string matches the rootstring */ + rootlen = strlen(rootstring); + if (strncmp(rootstring, cwd, rootlen)) { + ffpmsg("invalid CWD: does not match root data directory"); + return(FILE_NOT_CREATED); + } else { + + /* get the user name from CWD (it follows the root string) */ + strncpy(username, cwd+rootlen, 50); /* limit length of user name */ + username[50]=0; + cpos=strchr(username, '/'); + if (!cpos) { + ffpmsg("invalid CWD: not equal to root data directory + username"); + return(FILE_NOT_CREATED); + } else { + *(cpos+1) = '\0'; /* truncate user name string */ + + /* construct full user root name */ + strcpy(userroot, rootstring); + strcat(userroot, username); + rootlen = strlen(userroot); + + /* construct alternate full user root name */ + strcpy(userroot2, rootstring2); + strcat(userroot2, username); + rootlen2 = strlen(userroot2); + + /* convert the input filename to absolute path relative to the CWD */ + fits_relurl2url(cwd, filename, absURL, &status); + +/* +printf("username = %s\n", username); +printf("userroot = %s\n", userroot); +printf("userroot2 = %s\n", userroot2); +printf("filename = %s\n", filename); +printf("ABS = %s\n", absURL); +*/ + /* check that CWD string matches the rootstring or alternate root string */ + + if ( strncmp(userroot, absURL, rootlen) && + strncmp(userroot2, absURL, rootlen2) ) { + ffpmsg("invalid filename: path not within user directory"); + return(FILE_NOT_CREATED); + } + } + } + /* if we got here, then the input filename appears to be valid */ + } + + *handle = -1; + for (ii = 0; ii < NMAXFILES; ii++) /* find empty slot in table */ + { + if (handleTable[ii].fileptr == 0) + { + *handle = ii; + break; + } + } + if (*handle == -1) + return(TOO_MANY_FILES); /* too many files opened */ + + strcpy(mode, "w+b"); /* create new file with read-write */ + + diskfile = fopen(filename, "r"); /* does file already exist? */ + + if (diskfile) + { + fclose(diskfile); /* close file and exit with error */ + return(FILE_NOT_CREATED); + } + +#if MACHINE == ALPHAVMS || MACHINE == VAXVMS + /* specify VMS record structure: fixed format, 2880 byte records */ + /* but force stream mode access to enable random I/O access */ + diskfile = fopen(filename, mode, "rfm=fix", "mrs=2880", "ctx=stm"); +#else + diskfile = fopen(filename, mode); +#endif + + if (!(diskfile)) /* couldn't create file */ + { + return(FILE_NOT_CREATED); + } + + handleTable[ii].fileptr = diskfile; + handleTable[ii].currentpos = 0; + handleTable[ii].last_io_op = IO_SEEK; + + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_truncate(int handle, LONGLONG filesize) +/* + truncate the diskfile to a new smaller size +*/ +{ + +#ifdef HAVE_FTRUNCATE + int fdesc; + + fdesc = fileno(handleTable[handle].fileptr); + ftruncate(fdesc, (OFF_T) filesize); + file_seek(handle, filesize); + + handleTable[handle].currentpos = filesize; + handleTable[handle].last_io_op = IO_SEEK; + +#endif + + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_size(int handle, LONGLONG *filesize) +/* + return the size of the file in bytes +*/ +{ + OFF_T position1,position2; + FILE *diskfile; + + diskfile = handleTable[handle].fileptr; + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + +/* call the VISUAL C++ version of the routines which support */ +/* Large Files (> 2GB) if they are supported (since VC 8.0) */ + + position1 = _ftelli64(diskfile); /* save current postion */ + if (position1 < 0) + return(SEEK_ERROR); + + if (_fseeki64(diskfile, 0, 2) != 0) /* seek to end of file */ + return(SEEK_ERROR); + + position2 = _ftelli64(diskfile); /* get file size */ + if (position2 < 0) + return(SEEK_ERROR); + + if (_fseeki64(diskfile, position1, 0) != 0) /* seek back to original pos */ + return(SEEK_ERROR); + +#elif _FILE_OFFSET_BITS - 0 == 64 + +/* call the newer ftello and fseeko routines , which support */ +/* Large Files (> 2GB) if they are supported. */ + + position1 = ftello(diskfile); /* save current postion */ + if (position1 < 0) + return(SEEK_ERROR); + + if (fseeko(diskfile, 0, 2) != 0) /* seek to end of file */ + return(SEEK_ERROR); + + position2 = ftello(diskfile); /* get file size */ + if (position2 < 0) + return(SEEK_ERROR); + + if (fseeko(diskfile, position1, 0) != 0) /* seek back to original pos */ + return(SEEK_ERROR); + +#else + + position1 = ftell(diskfile); /* save current postion */ + if (position1 < 0) + return(SEEK_ERROR); + + if (fseek(diskfile, 0, 2) != 0) /* seek to end of file */ + return(SEEK_ERROR); + + position2 = ftell(diskfile); /* get file size */ + if (position2 < 0) + return(SEEK_ERROR); + + if (fseek(diskfile, position1, 0) != 0) /* seek back to original pos */ + return(SEEK_ERROR); + +#endif + + *filesize = (LONGLONG) position2; + + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_close(int handle) +/* + close the file +*/ +{ + + if (fclose(handleTable[handle].fileptr) ) + return(FILE_NOT_CLOSED); + + handleTable[handle].fileptr = 0; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_remove(char *filename) +/* + delete the file from disk +*/ +{ + remove(filename); + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_flush(int handle) +/* + flush the file +*/ +{ + if (fflush(handleTable[handle].fileptr) ) + return(WRITE_ERROR); + + /* The flush operation is not supposed to move the internal */ + /* file pointer, but it does on some Windows-95 compilers and */ + /* perhaps others, so seek to original position to be sure. */ + /* This seek will do no harm on other systems. */ + +#if MACHINE == IBMPC + + if (file_seek(handle, handleTable[handle].currentpos)) + return(SEEK_ERROR); + +#endif + + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_seek(int handle, LONGLONG offset) +/* + seek to position relative to start of the file +*/ +{ + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) + + /* Microsoft visual studio C++ */ + /* _fseeki64 supported beginning with version 8.0 */ + + if (_fseeki64(handleTable[handle].fileptr, (OFF_T) offset, 0) != 0) + return(SEEK_ERROR); + +#elif _FILE_OFFSET_BITS - 0 == 64 + + if (fseeko(handleTable[handle].fileptr, (OFF_T) offset, 0) != 0) + return(SEEK_ERROR); + +#else + + if (fseek(handleTable[handle].fileptr, (OFF_T) offset, 0) != 0) + return(SEEK_ERROR); + +#endif + + handleTable[handle].currentpos = offset; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_read(int hdl, void *buffer, long nbytes) +/* + read bytes from the current position in the file +*/ +{ + long nread; + char *cptr; + + if (handleTable[hdl].last_io_op == IO_WRITE) + { + if (file_seek(hdl, handleTable[hdl].currentpos)) + return(SEEK_ERROR); + } + + nread = (long) fread(buffer, 1, nbytes, handleTable[hdl].fileptr); + + if (nread == 1) + { + cptr = (char *) buffer; + + /* some editors will add a single end-of-file character to a file */ + /* Ignore it if the character is a zero, 10, or 32 */ + if (*cptr == 0 || *cptr == 10 || *cptr == 32) + return(END_OF_FILE); + else + return(READ_ERROR); + } + else if (nread != nbytes) + { + return(READ_ERROR); + } + + handleTable[hdl].currentpos += nbytes; + handleTable[hdl].last_io_op = IO_READ; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_write(int hdl, void *buffer, long nbytes) +/* + write bytes at the current position in the file +*/ +{ + if (handleTable[hdl].last_io_op == IO_READ) + { + if (file_seek(hdl, handleTable[hdl].currentpos)) + return(SEEK_ERROR); + } + + if((long) fwrite(buffer, 1, nbytes, handleTable[hdl].fileptr) != nbytes) + return(WRITE_ERROR); + + handleTable[hdl].currentpos += nbytes; + handleTable[hdl].last_io_op = IO_WRITE; + return(0); +} +/*--------------------------------------------------------------------------*/ +int file_compress_open(char *filename, int rwmode, int *hdl) +/* + This routine opens the compressed diskfile by creating a new uncompressed + file then opening it. The input file name (the name of the compressed + file) gets replaced with the name of the uncompressed file, which is + initially stored in the global file_outfile string. file_outfile + then gets set to a null string. +*/ +{ + FILE *indiskfile, *outdiskfile; + int status; + char *cptr; + + /* open the compressed disk file */ + status = file_openfile(filename, READONLY, &indiskfile); + if (status) + { + ffpmsg("failed to open compressed disk file (file_compress_open)"); + ffpmsg(filename); + return(status); + } + + /* name of the output uncompressed file is stored in the */ + /* global variable called 'file_outfile'. */ + + cptr = file_outfile; + if (*cptr == '!') + { + /* clobber any existing file with the same name */ + cptr++; + remove(cptr); + } + else + { + outdiskfile = fopen(file_outfile, "r"); /* does file already exist? */ + + if (outdiskfile) + { + ffpmsg("uncompressed file already exists: (file_compress_open)"); + ffpmsg(file_outfile); + fclose(outdiskfile); /* close file and exit with error */ + file_outfile[0] = '\0'; + return(FILE_NOT_CREATED); + } + } + + outdiskfile = fopen(cptr, "w+b"); /* create new file */ + if (!outdiskfile) + { + ffpmsg("could not create uncompressed file: (file_compress_open)"); + ffpmsg(file_outfile); + file_outfile[0] = '\0'; + return(FILE_NOT_CREATED); + } + + /* uncompress file into another file */ + uncompress2file(filename, indiskfile, outdiskfile, &status); + fclose(indiskfile); + fclose(outdiskfile); + + if (status) + { + ffpmsg("error in file_compress_open: failed to uncompressed file:"); + ffpmsg(filename); + ffpmsg(" into new output file:"); + ffpmsg(file_outfile); + file_outfile[0] = '\0'; + return(status); + } + + strcpy(filename, cptr); /* switch the names */ + file_outfile[0] = '\0'; + + status = file_open(filename, rwmode, hdl); + + return(status); +} +/*--------------------------------------------------------------------------*/ +int file_is_compressed(char *filename) /* I - FITS file name */ +/* + Test if the disk file is compressed. Returns 1 if compressed, 0 if not. + This may modify the filename string by appending a compression suffex. +*/ +{ + FILE *diskfile; + unsigned char buffer[2]; + char tmpfilename[FLEN_FILENAME]; + + /* Open file. Try various suffix combinations */ + if (file_openfile(filename, 0, &diskfile)) + { + if (strlen(filename) > FLEN_FILENAME - 5) + return(0); + + strcpy(tmpfilename,filename); + strcat(filename,".gz"); + if (file_openfile(filename, 0, &diskfile)) + { +#if HAVE_BZIP2 + strcpy(filename,tmpfilename); + strcat(filename,".bz2"); + if (file_openfile(filename, 0, &diskfile)) + { +#endif + strcpy(filename, tmpfilename); + strcat(filename,".Z"); + if (file_openfile(filename, 0, &diskfile)) + { + strcpy(filename, tmpfilename); + strcat(filename,".z"); /* it's often lower case on CDROMs */ + if (file_openfile(filename, 0, &diskfile)) + { + strcpy(filename, tmpfilename); + strcat(filename,".zip"); + if (file_openfile(filename, 0, &diskfile)) + { + strcpy(filename, tmpfilename); + strcat(filename,"-z"); /* VMS suffix */ + if (file_openfile(filename, 0, &diskfile)) + { + strcpy(filename, tmpfilename); + strcat(filename,"-gz"); /* VMS suffix */ + if (file_openfile(filename, 0, &diskfile)) + { + strcpy(filename,tmpfilename); /* restore original name */ + return(0); /* file not found */ + } + } + } + } + } +#if HAVE_BZIP2 + } +#endif + } + } + + if (fread(buffer, 1, 2, diskfile) != 2) /* read 2 bytes */ + { + fclose(diskfile); /* error reading file so just return */ + return(0); + } + + fclose(diskfile); + + /* see if the 2 bytes have the magic values for a compressed file */ + if ( (memcmp(buffer, "\037\213", 2) == 0) || /* GZIP */ + (memcmp(buffer, "\120\113", 2) == 0) || /* PKZIP */ + (memcmp(buffer, "\037\036", 2) == 0) || /* PACK */ + (memcmp(buffer, "\037\235", 2) == 0) || /* LZW */ +#if HAVE_BZIP2 + (memcmp(buffer, "BZ", 2) == 0) || /* BZip2 */ +#endif + (memcmp(buffer, "\037\240", 2) == 0)) /* LZH */ + { + return(1); /* this is a compressed file */ + } + else + { + return(0); /* not a compressed file */ + } +} +/*--------------------------------------------------------------------------*/ +int file_checkfile (char *urltype, char *infile, char *outfile) +{ + /* special case: if file:// driver, check if the file is compressed */ + if ( file_is_compressed(infile) ) + { + /* if output file has been specified, save the name for future use: */ + /* This is the name of the uncompressed file to be created on disk. */ + if (strlen(outfile)) + { + if (!strncmp(outfile, "mem:", 4) ) + { + /* uncompress the file in memory, with READ and WRITE access */ + strcpy(urltype, "compressmem://"); /* use special driver */ + *file_outfile = '\0'; + } + else + { + strcpy(urltype, "compressfile://"); /* use special driver */ + + /* don't copy the "file://" prefix, if present. */ + if (!strncmp(outfile, "file://", 7) ) + strcpy(file_outfile,outfile+7); + else + strcpy(file_outfile,outfile); + } + } + else + { + /* uncompress the file in memory */ + strcpy(urltype, "compress://"); /* use special driver */ + *file_outfile = '\0'; /* no output file was specified */ + } + } + else /* an ordinary, uncompressed FITS file on disk */ + { + /* save the output file name for later use when opening the file. */ + /* In this case, the file to be opened will be opened READONLY, */ + /* and copied to this newly created output file. The original file */ + /* will be closed, and the copy will be opened by CFITSIO for */ + /* subsequent processing (possibly with READWRITE access). */ + if (strlen(outfile)) { + file_outfile[0] = '\0'; + strncat(file_outfile,outfile,FLEN_FILENAME-1); + } + } + + return 0; +} +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ + +/**** driver routines for stream//: device (stdin or stdout) ********/ + + +/*--------------------------------------------------------------------------*/ +int stream_open(char *filename, int rwmode, int *handle) +{ + /* + read from stdin + */ + if (filename) + rwmode = 1; /* dummy statement to suppress unused parameter compiler warning */ + + *handle = 1; /* 1 = stdin */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_create(char *filename, int *handle) +{ + /* + write to stdout + */ + + if (filename) /* dummy statement to suppress unused parameter compiler warning */ + *handle = 2; + else + *handle = 2; /* 2 = stdout */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_size(int handle, LONGLONG *filesize) +/* + return the size of the file in bytes +*/ +{ + handle = 0; /* suppress unused parameter compiler warning */ + + /* this operation is not supported in a stream; return large value */ + *filesize = LONG_MAX; + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_close(int handle) +/* + don't have to close stdin or stdout +*/ +{ + handle = 0; /* suppress unused parameter compiler warning */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_flush(int handle) +/* + flush the file +*/ +{ + if (handle == 2) + fflush(stdout); + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_seek(int handle, LONGLONG offset) + /* + seeking is not allowed in a stream + */ +{ + offset = handle; /* suppress unused parameter compiler warning */ + return(1); +} +/*--------------------------------------------------------------------------*/ +int stream_read(int hdl, void *buffer, long nbytes) +/* + reading from stdin stream +*/ + +{ + long nread; + + if (hdl != 1) + return(1); /* can only read from stdin */ + + nread = (long) fread(buffer, 1, nbytes, stdin); + + if (nread != nbytes) + { +/* return(READ_ERROR); */ + return(END_OF_FILE); + } + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stream_write(int hdl, void *buffer, long nbytes) +/* + write bytes at the current position in the file +*/ +{ + if (hdl != 2) + return(1); /* can only write to stdout */ + + if((long) fwrite(buffer, 1, nbytes, stdout) != nbytes) + return(WRITE_ERROR); + + return(0); +} + + + + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/drvrmem.c b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrmem.c new file mode 100644 index 0000000000000000000000000000000000000000..371e62066a916a36dd957aa5461d79fa9e04155f --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrmem.c @@ -0,0 +1,1301 @@ +/* This file, drvrmem.c, contains driver routines for memory files. */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include /* apparently needed to define size_t */ +#include "fitsio2.h" + +#if HAVE_BZIP2 +#include "bzlib.h" +#endif + +/* prototype for .Z file uncompression function in zuncompress.c */ +int zuncompress2mem(char *filename, + FILE *diskfile, + char **buffptr, + size_t *buffsize, + void *(*mem_realloc)(void *p, size_t newsize), + size_t *filesize, + int *status); + +#if HAVE_BZIP2 +/* prototype for .bz2 uncompression function (in this file) */ +void bzip2uncompress2mem(char *filename, FILE *diskfile, int hdl, + size_t* filesize, int* status); +#endif + + +#define RECBUFLEN 1000 + +static char stdin_outfile[FLEN_FILENAME]; + +typedef struct /* structure containing mem file structure */ +{ + char **memaddrptr; /* Pointer to memory address pointer; */ + /* This may or may not point to memaddr. */ + char *memaddr; /* Pointer to starting memory address; may */ + /* not always be used, so use *memaddrptr instead */ + size_t *memsizeptr; /* Pointer to the size of the memory allocation. */ + /* This may or may not point to memsize. */ + size_t memsize; /* Size of the memory allocation; this may not */ + /* always be used, so use *memsizeptr instead. */ + size_t deltasize; /* Suggested increment for reallocating memory */ + void *(*mem_realloc)(void *p, size_t newsize); /* realloc function */ + LONGLONG currentpos; /* current file position, relative to start */ + LONGLONG fitsfilesize; /* size of the FITS file (always <= *memsizeptr) */ + FILE *fileptr; /* pointer to compressed output disk file */ +} memdriver; + +static memdriver memTable[NMAXFILES]; /* allocate mem file handle tables */ + +/*--------------------------------------------------------------------------*/ +int mem_init(void) +{ + int ii; + + for (ii = 0; ii < NMAXFILES; ii++) /* initialize all empty slots in table */ + { + memTable[ii].memaddrptr = 0; + memTable[ii].memaddr = 0; + } + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_setoptions(int options) +{ + /* do something with the options argument, to stop compiler warning */ + options = 0; + return(options); +} +/*--------------------------------------------------------------------------*/ +int mem_getoptions(int *options) +{ + *options = 0; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_getversion(int *version) +{ + *version = 10; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_shutdown(void) +{ + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_create(char *filename, int *handle) +/* + Create a new empty memory file for subsequent writes. + The file name is ignored in this case. +*/ +{ + int status; + + /* initially allocate 1 FITS block = 2880 bytes */ + status = mem_createmem(2880L, handle); + + if (status) + { + ffpmsg("failed to create empty memory file (mem_create)"); + return(status); + } + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_create_comp(char *filename, int *handle) +/* + Create a new empty memory file for subsequent writes. + Also create an empty compressed .gz file. The memory file + will be compressed and written to the disk file when the file is closed. +*/ +{ + FILE *diskfile; + char mode[4]; + int status; + + /* first, create disk file for the compressed output */ + + + if ( !strcmp(filename, "-.gz") || !strcmp(filename, "stdout.gz") || + !strcmp(filename, "STDOUT.gz") ) + { + /* special case: create uncompressed FITS file in memory, then + compress it an write it out to 'stdout' when it is closed. */ + + diskfile = stdout; + } + else + { + /* normal case: create disk file for the compressed output */ + + strcpy(mode, "w+b"); /* create file with read-write */ + + diskfile = fopen(filename, "r"); /* does file already exist? */ + + if (diskfile) + { + fclose(diskfile); /* close file and exit with error */ + return(FILE_NOT_CREATED); + } + +#if MACHINE == ALPHAVMS || MACHINE == VAXVMS + /* specify VMS record structure: fixed format, 2880 byte records */ + /* but force stream mode access to enable random I/O access */ + diskfile = fopen(filename, mode, "rfm=fix", "mrs=2880", "ctx=stm"); +#else + diskfile = fopen(filename, mode); +#endif + + if (!(diskfile)) /* couldn't create file */ + { + return(FILE_NOT_CREATED); + } + } + + /* now create temporary memory file */ + + /* initially allocate 1 FITS block = 2880 bytes */ + status = mem_createmem(2880L, handle); + + if (status) + { + ffpmsg("failed to create empty memory file (mem_create_comp)"); + return(status); + } + + memTable[*handle].fileptr = diskfile; + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_openmem(void **buffptr, /* I - address of memory pointer */ + size_t *buffsize, /* I - size of buffer, in bytes */ + size_t deltasize, /* I - increment for future realloc's */ + void *(*memrealloc)(void *p, size_t newsize), /* function */ + int *handle) +/* + lowest level routine to open a pre-existing memory file. +*/ +{ + int ii; + + *handle = -1; + for (ii = 0; ii < NMAXFILES; ii++) /* find empty slot in handle table */ + { + if (memTable[ii].memaddrptr == 0) + { + *handle = ii; + break; + } + } + if (*handle == -1) + return(TOO_MANY_FILES); /* too many files opened */ + + memTable[ii].memaddrptr = (char **) buffptr; /* pointer to start addres */ + memTable[ii].memsizeptr = buffsize; /* allocated size of memory */ + memTable[ii].deltasize = deltasize; /* suggested realloc increment */ + memTable[ii].fitsfilesize = *buffsize; /* size of FITS file (upper limit) */ + memTable[ii].currentpos = 0; /* at beginning of the file */ + memTable[ii].mem_realloc = memrealloc; /* memory realloc function */ + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_createmem(size_t msize, int *handle) +/* + lowest level routine to allocate a memory file. +*/ +{ + int ii; + + *handle = -1; + for (ii = 0; ii < NMAXFILES; ii++) /* find empty slot in handle table */ + { + if (memTable[ii].memaddrptr == 0) + { + *handle = ii; + break; + } + } + if (*handle == -1) + return(TOO_MANY_FILES); /* too many files opened */ + + /* use the internally allocated memaddr and memsize variables */ + memTable[ii].memaddrptr = &memTable[ii].memaddr; + memTable[ii].memsizeptr = &memTable[ii].memsize; + + /* allocate initial block of memory for the file */ + if (msize > 0) + { + memTable[ii].memaddr = (char *) malloc(msize); + if ( !(memTable[ii].memaddr) ) + { + ffpmsg("malloc of initial memory failed (mem_createmem)"); + return(FILE_NOT_OPENED); + } + } + + /* set initial state of the file */ + memTable[ii].memsize = msize; + memTable[ii].deltasize = 2880; + memTable[ii].fitsfilesize = 0; + memTable[ii].currentpos = 0; + memTable[ii].mem_realloc = realloc; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_truncate(int handle, LONGLONG filesize) +/* + truncate the file to a new size +*/ +{ + char *ptr; + + /* call the memory reallocation function, if defined */ + if ( memTable[handle].mem_realloc ) + { /* explicit LONGLONG->size_t cast */ + ptr = (memTable[handle].mem_realloc)( + *(memTable[handle].memaddrptr), + (size_t) filesize); + if (!ptr) + { + ffpmsg("Failed to reallocate memory (mem_truncate)"); + return(MEMORY_ALLOCATION); + } + + /* if allocated more memory, initialize it to zero */ + if ( filesize > *(memTable[handle].memsizeptr) ) + { + memset(ptr + *(memTable[handle].memsizeptr), + 0, + ((size_t) filesize) - *(memTable[handle].memsizeptr) ); + } + + *(memTable[handle].memaddrptr) = ptr; + *(memTable[handle].memsizeptr) = (size_t) (filesize); + } + + memTable[handle].currentpos = filesize; + memTable[handle].fitsfilesize = filesize; + return(0); +} +/*--------------------------------------------------------------------------*/ +int stdin_checkfile(char *urltype, char *infile, char *outfile) +/* + do any special case checking when opening a file on the stdin stream +*/ +{ + if (strlen(outfile)) + { + stdin_outfile[0] = '\0'; + strncat(stdin_outfile,outfile,FLEN_FILENAME-1); /* an output file is specified */ + strcpy(urltype,"stdinfile://"); + } + else + *stdin_outfile = '\0'; /* no output file was specified */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stdin_open(char *filename, int rwmode, int *handle) +/* + open a FITS file from the stdin file stream by copying it into memory + The file name is ignored in this case. +*/ +{ + int status; + char cbuff; + + if (*stdin_outfile) + { + /* copy the stdin stream to the specified disk file then open the file */ + + /* Create the output file */ + status = file_create(stdin_outfile,handle); + + if (status) + { + ffpmsg("Unable to create output file to copy stdin (stdin_open):"); + ffpmsg(stdin_outfile); + return(status); + } + + /* copy the whole stdin stream to the file */ + status = stdin2file(*handle); + file_close(*handle); + + if (status) + { + ffpmsg("failed to copy stdin to file (stdin_open)"); + ffpmsg(stdin_outfile); + return(status); + } + + /* reopen file with proper rwmode attribute */ + status = file_open(stdin_outfile, rwmode, handle); + } + else + { + + /* get the first character, then put it back */ + cbuff = fgetc(stdin); + ungetc(cbuff, stdin); + + /* compressed files begin with 037 or 'P' */ + if (cbuff == 31 || cbuff == 75) + { + /* looks like the input stream is compressed */ + status = mem_compress_stdin_open(filename, rwmode, handle); + + } + else + { + /* copy the stdin stream into memory then open file in memory */ + + if (rwmode != READONLY) + { + ffpmsg("cannot open stdin with WRITE access"); + return(READONLY_FILE); + } + + status = mem_createmem(2880L, handle); + + if (status) + { + ffpmsg("failed to create empty memory file (stdin_open)"); + return(status); + } + + /* copy the whole stdin stream into memory */ + status = stdin2mem(*handle); + + if (status) + { + ffpmsg("failed to copy stdin into memory (stdin_open)"); + free(memTable[*handle].memaddr); + } + } + } + + return(status); +} +/*--------------------------------------------------------------------------*/ +int stdin2mem(int hd) /* handle number */ +/* + Copy the stdin stream into memory. Fill whatever amount of memory + has already been allocated, then realloc more memory if necessary. +*/ +{ + size_t nread, memsize, delta; + LONGLONG filesize; + char *memptr; + char simple[] = "SIMPLE"; + int c, ii, jj; + + memptr = *memTable[hd].memaddrptr; + memsize = *memTable[hd].memsizeptr; + delta = memTable[hd].deltasize; + + filesize = 0; + ii = 0; + + for(jj = 0; (c = fgetc(stdin)) != EOF && jj < 2000; jj++) + { + /* Skip over any garbage at the beginning of the stdin stream by */ + /* reading 1 char at a time, looking for 'S', 'I', 'M', 'P', 'L', 'E' */ + /* Give up if not found in the first 2000 characters */ + + if (c == simple[ii]) + { + ii++; + if (ii == 6) /* found the complete string? */ + { + memcpy(memptr, simple, 6); /* copy "SIMPLE" to buffer */ + filesize = 6; + break; + } + } + else + ii = 0; /* reset search to beginning of the string */ + } + + if (filesize == 0) + { + ffpmsg("Couldn't find the string 'SIMPLE' in the stdin stream."); + ffpmsg("This does not look like a FITS file."); + return(FILE_NOT_OPENED); + } + + /* fill up the remainder of the initial memory allocation */ + nread = fread(memptr + 6, 1, memsize - 6, stdin); + nread += 6; /* add in the 6 characters in 'SIMPLE' */ + + if (nread < memsize) /* reached the end? */ + { + memTable[hd].fitsfilesize = nread; + return(0); + } + + filesize = nread; + + while (1) + { + /* allocate memory for another FITS block */ + memptr = realloc(memptr, memsize + delta); + + if (!memptr) + { + ffpmsg("realloc failed while copying stdin (stdin2mem)"); + return(MEMORY_ALLOCATION); + } + memsize += delta; + + /* read another FITS block */ + nread = fread(memptr + filesize, 1, delta, stdin); + + filesize += nread; + + if (nread < delta) /* reached the end? */ + break; + } + + memTable[hd].fitsfilesize = filesize; + *memTable[hd].memaddrptr = memptr; + *memTable[hd].memsizeptr = memsize; + + return(0); +} +/*--------------------------------------------------------------------------*/ +int stdin2file(int handle) /* handle number */ +/* + Copy the stdin stream to a file. . +*/ +{ + size_t nread; + char simple[] = "SIMPLE"; + int c, ii, jj, status; + char recbuf[RECBUFLEN]; + + ii = 0; + for(jj = 0; (c = fgetc(stdin)) != EOF && jj < 2000; jj++) + { + /* Skip over any garbage at the beginning of the stdin stream by */ + /* reading 1 char at a time, looking for 'S', 'I', 'M', 'P', 'L', 'E' */ + /* Give up if not found in the first 2000 characters */ + + if (c == simple[ii]) + { + ii++; + if (ii == 6) /* found the complete string? */ + { + memcpy(recbuf, simple, 6); /* copy "SIMPLE" to buffer */ + break; + } + } + else + ii = 0; /* reset search to beginning of the string */ + } + + if (ii != 6) + { + ffpmsg("Couldn't find the string 'SIMPLE' in the stdin stream"); + return(FILE_NOT_OPENED); + } + + /* fill up the remainder of the buffer */ + nread = fread(recbuf + 6, 1, RECBUFLEN - 6, stdin); + nread += 6; /* add in the 6 characters in 'SIMPLE' */ + + status = file_write(handle, recbuf, nread); + if (status) + return(status); + + /* copy the rest of stdin stream */ + while(0 != (nread = fread(recbuf,1,RECBUFLEN, stdin))) + { + status = file_write(handle, recbuf, nread); + if (status) + return(status); + } + + return(status); +} +/*--------------------------------------------------------------------------*/ +int stdout_close(int handle) +/* + copy the memory file to stdout, then free the memory +*/ +{ + int status = 0; + + /* copy from memory to standard out. explicit LONGLONG->size_t cast */ + if(fwrite(memTable[handle].memaddr, 1, + ((size_t) memTable[handle].fitsfilesize), stdout) != + (size_t) memTable[handle].fitsfilesize ) + { + ffpmsg("failed to copy memory file to stdout (stdout_close)"); + status = WRITE_ERROR; + } + + free( memTable[handle].memaddr ); /* free the memory */ + memTable[handle].memaddrptr = 0; + memTable[handle].memaddr = 0; + return(status); +} +/*--------------------------------------------------------------------------*/ +int mem_compress_openrw(char *filename, int rwmode, int *hdl) +/* + This routine opens the compressed diskfile and creates an empty memory + buffer with an appropriate size, then calls mem_uncompress2mem. It allows + the memory 'file' to be opened with READWRITE access. +*/ +{ + return(mem_compress_open(filename, READONLY, hdl)); +} +/*--------------------------------------------------------------------------*/ +int mem_compress_open(char *filename, int rwmode, int *hdl) +/* + This routine opens the compressed diskfile and creates an empty memory + buffer with an appropriate size, then calls mem_uncompress2mem. +*/ +{ + FILE *diskfile; + int status, estimated = 1; + unsigned char buffer[4]; + size_t finalsize, filesize; + LONGLONG llsize = 0; + unsigned int modulosize; + char *ptr; + + if (rwmode != READONLY) + { + ffpmsg( + "cannot open compressed file with WRITE access (mem_compress_open)"); + ffpmsg(filename); + return(READONLY_FILE); + } + + /* open the compressed disk file */ + status = file_openfile(filename, READONLY, &diskfile); + if (status) + { + ffpmsg("failed to open compressed disk file (compress_open)"); + ffpmsg(filename); + return(status); + } + + if (fread(buffer, 1, 2, diskfile) != 2) /* read 2 bytes */ + { + fclose(diskfile); + return(READ_ERROR); + } + + if (memcmp(buffer, "\037\213", 2) == 0) /* GZIP */ + { + /* the uncompressed file size is give at the end */ + /* of the file in the ISIZE field (modulo 2^32) */ + + fseek(diskfile, 0, 2); /* move to end of file */ + filesize = ftell(diskfile); /* position = size of file */ + fseek(diskfile, -4L, 1); /* move back 4 bytes */ + fread(buffer, 1, 4L, diskfile); /* read 4 bytes */ + + /* have to worry about integer byte order */ + modulosize = buffer[0]; + modulosize |= buffer[1] << 8; + modulosize |= buffer[2] << 16; + modulosize |= buffer[3] << 24; + +/* + the field ISIZE in the gzipped file header only stores 4 bytes and contains + the uncompressed file size modulo 2^32. If the uncompressed file size + is less than the compressed file size (filesize), then one probably needs to + add 2^32 = 4294967296 to the uncompressed file size, assuming that the gzip + produces a compressed file that is smaller than the original file. + + But one must allow for the case of very small files, where the + gzipped file may actually be larger then the original uncompressed file. + Therefore, only perform the modulo 2^32 correction test if the compressed + file is greater than 10,000 bytes in size. (Note: this threhold would + fail only if the original file was greater than 2^32 bytes in size AND gzip + was able to compress it by more than a factor of 400,000 (!) which seems + highly unlikely.) + + Also, obviously, this 2^32 modulo correction cannot be performed if the + finalsize variable is only 32-bits long. Typically, the 'size_t' integer + type must be 8 bytes or larger in size to support data files that are + greater than 2 GB (2^31 bytes) in size. +*/ + finalsize = modulosize; + + if (sizeof(size_t) > 4 && filesize > 10000) { + llsize = (LONGLONG) finalsize; + /* use LONGLONG variable to suppress compiler warning */ + while (llsize < (LONGLONG) filesize) llsize += 4294967296; + + finalsize = (size_t) llsize; + } + + estimated = 0; /* file size is known, not estimated */ + } + else if (memcmp(buffer, "\120\113", 2) == 0) /* PKZIP */ + { + /* the uncompressed file size is give at byte 22 the file */ + + fseek(diskfile, 22L, 0); /* move to byte 22 */ + fread(buffer, 1, 4L, diskfile); /* read 4 bytes */ + + /* have to worry about integer byte order */ + modulosize = buffer[0]; + modulosize |= buffer[1] << 8; + modulosize |= buffer[2] << 16; + modulosize |= buffer[3] << 24; + finalsize = modulosize; + + estimated = 0; /* file size is known, not estimated */ + } + else if (memcmp(buffer, "\037\036", 2) == 0) /* PACK */ + finalsize = 0; /* for most methods we can't determine final size */ + else if (memcmp(buffer, "\037\235", 2) == 0) /* LZW */ + finalsize = 0; /* for most methods we can't determine final size */ + else if (memcmp(buffer, "\037\240", 2) == 0) /* LZH */ + finalsize = 0; /* for most methods we can't determine final size */ +#if HAVE_BZIP2 + else if (memcmp(buffer, "BZ", 2) == 0) /* BZip2 */ + finalsize = 0; /* for most methods we can't determine final size */ +#endif + else + { + /* not a compressed file; this should never happen */ + fclose(diskfile); + return(1); + } + + if (finalsize == 0) /* estimate uncompressed file size */ + { + fseek(diskfile, 0, 2); /* move to end of the compressed file */ + finalsize = ftell(diskfile); /* position = size of file */ + finalsize = finalsize * 3; /* assume factor of 3 compression */ + } + + fseek(diskfile, 0, 0); /* move back to beginning of file */ + + /* create a memory file big enough (hopefully) for the uncompressed file */ + status = mem_createmem(finalsize, hdl); + + if (status && estimated) + { + /* memory allocation failed, so try a smaller estimated size */ + finalsize = finalsize / 3; + status = mem_createmem(finalsize, hdl); + } + + if (status) + { + fclose(diskfile); + ffpmsg("failed to create empty memory file (compress_open)"); + return(status); + } + + /* uncompress file into memory */ + status = mem_uncompress2mem(filename, diskfile, *hdl); + + fclose(diskfile); + + if (status) + { + mem_close_free(*hdl); /* free up the memory */ + ffpmsg("failed to uncompress file into memory (compress_open)"); + return(status); + } + + /* if we allocated too much memory initially, then free it */ + if (*(memTable[*hdl].memsizeptr) > + (( (size_t) memTable[*hdl].fitsfilesize) + 256L) ) + { + ptr = realloc(*(memTable[*hdl].memaddrptr), + ((size_t) memTable[*hdl].fitsfilesize) ); + if (!ptr) + { + ffpmsg("Failed to reduce size of allocated memory (compress_open)"); + return(MEMORY_ALLOCATION); + } + + *(memTable[*hdl].memaddrptr) = ptr; + *(memTable[*hdl].memsizeptr) = (size_t) (memTable[*hdl].fitsfilesize); + } + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_compress_stdin_open(char *filename, int rwmode, int *hdl) +/* + This routine reads the compressed input stream and creates an empty memory + buffer, then calls mem_uncompress2mem. +*/ +{ + int status; + char *ptr; + + if (rwmode != READONLY) + { + ffpmsg( + "cannot open compressed input stream with WRITE access (mem_compress_stdin_open)"); + return(READONLY_FILE); + } + + /* create a memory file for the uncompressed file */ + status = mem_createmem(28800, hdl); + + if (status) + { + ffpmsg("failed to create empty memory file (compress_stdin_open)"); + return(status); + } + + /* uncompress file into memory */ + status = mem_uncompress2mem(filename, stdin, *hdl); + + if (status) + { + mem_close_free(*hdl); /* free up the memory */ + ffpmsg("failed to uncompress stdin into memory (compress_stdin_open)"); + return(status); + } + + /* if we allocated too much memory initially, then free it */ + if (*(memTable[*hdl].memsizeptr) > + (( (size_t) memTable[*hdl].fitsfilesize) + 256L) ) + { + ptr = realloc(*(memTable[*hdl].memaddrptr), + ((size_t) memTable[*hdl].fitsfilesize) ); + if (!ptr) + { + ffpmsg("Failed to reduce size of allocated memory (compress_stdin_open)"); + return(MEMORY_ALLOCATION); + } + + *(memTable[*hdl].memaddrptr) = ptr; + *(memTable[*hdl].memsizeptr) = (size_t) (memTable[*hdl].fitsfilesize); + } + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_iraf_open(char *filename, int rwmode, int *hdl) +/* + This routine creates an empty memory buffer, then calls iraf2mem to + open the IRAF disk file and convert it to a FITS file in memeory. +*/ +{ + int status; + size_t filesize = 0; + + /* create a memory file with size = 0 for the FITS converted IRAF file */ + status = mem_createmem(filesize, hdl); + if (status) + { + ffpmsg("failed to create empty memory file (mem_iraf_open)"); + return(status); + } + + /* convert the iraf file into a FITS file in memory */ + status = iraf2mem(filename, memTable[*hdl].memaddrptr, + memTable[*hdl].memsizeptr, &filesize, &status); + + if (status) + { + mem_close_free(*hdl); /* free up the memory */ + ffpmsg("failed to convert IRAF file into memory (mem_iraf_open)"); + return(status); + } + + memTable[*hdl].currentpos = 0; /* save starting position */ + memTable[*hdl].fitsfilesize=filesize; /* and initial file size */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_rawfile_open(char *filename, int rwmode, int *hdl) +/* + This routine creates an empty memory buffer, writes a minimal + image header, then copies the image data from the raw file into + memory. It will byteswap the pixel values if the raw array + is in little endian byte order. +*/ +{ + FILE *diskfile; + fitsfile *fptr; + short *sptr; + int status, endian, datatype, bytePerPix, naxis; + long dim[5] = {1,1,1,1,1}, ii, nvals, offset = 0; + size_t filesize = 0, datasize; + char rootfile[FLEN_FILENAME], *cptr = 0, *cptr2 = 0; + void *ptr; + + if (rwmode != READONLY) + { + ffpmsg( + "cannot open raw binary file with WRITE access (mem_rawfile_open)"); + ffpmsg(filename); + return(READONLY_FILE); + } + + cptr = strchr(filename, '['); /* search for opening bracket [ */ + + if (!cptr) + { + ffpmsg("binary file name missing '[' character (mem_rawfile_open)"); + ffpmsg(filename); + return(URL_PARSE_ERROR); + } + + *rootfile = '\0'; + strncat(rootfile, filename, cptr - filename); /* store the rootname */ + + cptr++; + + while (*cptr == ' ') + cptr++; /* skip leading blanks */ + + /* Get the Data Type of the Image */ + + if (*cptr == 'b' || *cptr == 'B') + { + datatype = BYTE_IMG; + bytePerPix = 1; + } + else if (*cptr == 'i' || *cptr == 'I') + { + datatype = SHORT_IMG; + bytePerPix = 2; + } + else if (*cptr == 'u' || *cptr == 'U') + { + datatype = USHORT_IMG; + bytePerPix = 2; + + } + else if (*cptr == 'j' || *cptr == 'J') + { + datatype = LONG_IMG; + bytePerPix = 4; + } + else if (*cptr == 'r' || *cptr == 'R' || *cptr == 'f' || *cptr == 'F') + { + datatype = FLOAT_IMG; + bytePerPix = 4; + } + else if (*cptr == 'd' || *cptr == 'D') + { + datatype = DOUBLE_IMG; + bytePerPix = 8; + } + else + { + ffpmsg("error in raw binary file datatype (mem_rawfile_open)"); + ffpmsg(filename); + return(URL_PARSE_ERROR); + } + + cptr++; + + /* get Endian: Big or Little; default is same as the local machine */ + + if (*cptr == 'b' || *cptr == 'B') + { + endian = 0; + cptr++; + } + else if (*cptr == 'l' || *cptr == 'L') + { + endian = 1; + cptr++; + } + else + endian = BYTESWAPPED; /* byteswapped machines are little endian */ + + /* read each dimension (up to 5) */ + + naxis = 1; + dim[0] = strtol(cptr, &cptr2, 10); + + if (cptr2 && *cptr2 == ',') + { + naxis = 2; + dim[1] = strtol(cptr2+1, &cptr, 10); + + if (cptr && *cptr == ',') + { + naxis = 3; + dim[2] = strtol(cptr+1, &cptr2, 10); + + if (cptr2 && *cptr2 == ',') + { + naxis = 4; + dim[3] = strtol(cptr2+1, &cptr, 10); + + if (cptr && *cptr == ',') + naxis = 5; + dim[4] = strtol(cptr+1, &cptr2, 10); + } + } + } + + cptr = maxvalue(cptr, cptr2); + + if (*cptr == ':') /* read starting offset value */ + offset = strtol(cptr+1, 0, 10); + + nvals = dim[0] * dim[1] * dim[2] * dim[3] * dim[4]; + datasize = nvals * bytePerPix; + filesize = nvals * bytePerPix + 2880; + filesize = ((filesize - 1) / 2880 + 1) * 2880; + + /* open the raw binary disk file */ + status = file_openfile(rootfile, READONLY, &diskfile); + if (status) + { + ffpmsg("failed to open raw binary file (mem_rawfile_open)"); + ffpmsg(rootfile); + return(status); + } + + /* create a memory file with corrct size for the FITS converted raw file */ + status = mem_createmem(filesize, hdl); + if (status) + { + ffpmsg("failed to create memory file (mem_rawfile_open)"); + fclose(diskfile); + return(status); + } + + /* open this piece of memory as a new FITS file */ + ffimem(&fptr, (void **) memTable[*hdl].memaddrptr, &filesize, 0, 0, &status); + + /* write the required header keywords */ + ffcrim(fptr, datatype, naxis, dim, &status); + + /* close the FITS file, but keep the memory allocated */ + ffclos(fptr, &status); + + if (status > 0) + { + ffpmsg("failed to write basic image header (mem_rawfile_open)"); + fclose(diskfile); + mem_close_free(*hdl); /* free up the memory */ + return(status); + } + + if (offset > 0) + fseek(diskfile, offset, 0); /* offset to start of the data */ + + /* read the raw data into memory */ + ptr = *memTable[*hdl].memaddrptr + 2880; + + if (fread((char *) ptr, 1, datasize, diskfile) != datasize) + status = READ_ERROR; + + fclose(diskfile); /* close the raw binary disk file */ + + if (status) + { + mem_close_free(*hdl); /* free up the memory */ + ffpmsg("failed to copy raw file data into memory (mem_rawfile_open)"); + return(status); + } + + if (datatype == USHORT_IMG) /* have to subtract 32768 from each unsigned */ + { /* value to conform to FITS convention. More */ + /* efficient way to do this is to just flip */ + /* the most significant bit. */ + + sptr = (short *) ptr; + + if (endian == BYTESWAPPED) /* working with native format */ + { + for (ii = 0; ii < nvals; ii++, sptr++) + { + *sptr = ( *sptr ) ^ 0x8000; + } + } + else /* pixels are byteswapped WRT the native format */ + { + for (ii = 0; ii < nvals; ii++, sptr++) + { + *sptr = ( *sptr ) ^ 0x80; + } + } + } + + if (endian) /* swap the bytes if array is in little endian byte order */ + { + if (datatype == SHORT_IMG || datatype == USHORT_IMG) + { + ffswap2( (short *) ptr, nvals); + } + else if (datatype == LONG_IMG || datatype == FLOAT_IMG) + { + ffswap4( (INT32BIT *) ptr, nvals); + } + + else if (datatype == DOUBLE_IMG) + { + ffswap8( (double *) ptr, nvals); + } + } + + memTable[*hdl].currentpos = 0; /* save starting position */ + memTable[*hdl].fitsfilesize=filesize; /* and initial file size */ + + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_uncompress2mem(char *filename, FILE *diskfile, int hdl) +{ +/* + lower level routine to uncompress a file into memory. The file + has already been opened and the memory buffer has been allocated. +*/ + + size_t finalsize; + int status; + /* uncompress file into memory */ + status = 0; + + if (strstr(filename, ".Z")) { + zuncompress2mem(filename, diskfile, + memTable[hdl].memaddrptr, /* pointer to memory address */ + memTable[hdl].memsizeptr, /* pointer to size of memory */ + realloc, /* reallocation function */ + &finalsize, &status); /* returned file size nd status*/ +#if HAVE_BZIP2 + } else if (strstr(filename, ".bz2")) { + bzip2uncompress2mem(filename, diskfile, hdl, &finalsize, &status); +#endif + } else { + uncompress2mem(filename, diskfile, + memTable[hdl].memaddrptr, /* pointer to memory address */ + memTable[hdl].memsizeptr, /* pointer to size of memory */ + realloc, /* reallocation function */ + &finalsize, &status); /* returned file size nd status*/ + } + + memTable[hdl].currentpos = 0; /* save starting position */ + memTable[hdl].fitsfilesize=finalsize; /* and initial file size */ + return status; +} +/*--------------------------------------------------------------------------*/ +int mem_size(int handle, LONGLONG *filesize) +/* + return the size of the file; only called when the file is first opened +*/ +{ + *filesize = memTable[handle].fitsfilesize; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_close_free(int handle) +/* + close the file and free the memory. +*/ +{ + free( *(memTable[handle].memaddrptr) ); + + memTable[handle].memaddrptr = 0; + memTable[handle].memaddr = 0; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_close_keep(int handle) +/* + close the memory file but do not free the memory. +*/ +{ + memTable[handle].memaddrptr = 0; + memTable[handle].memaddr = 0; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_close_comp(int handle) +/* + compress the memory file, writing it out to the fileptr (which might + be stdout) +*/ +{ + int status = 0; + size_t compsize; + + /* compress file in memory to a .gz disk file */ + + if(compress2file_from_mem(memTable[handle].memaddr, + (size_t) (memTable[handle].fitsfilesize), + memTable[handle].fileptr, + &compsize, &status ) ) + { + ffpmsg("failed to copy memory file to file (mem_close_comp)"); + status = WRITE_ERROR; + } + + free( memTable[handle].memaddr ); /* free the memory */ + memTable[handle].memaddrptr = 0; + memTable[handle].memaddr = 0; + + /* close the compressed disk file (except if it is 'stdout' */ + if (memTable[handle].fileptr != stdout) + fclose(memTable[handle].fileptr); + + return(status); +} +/*--------------------------------------------------------------------------*/ +int mem_seek(int handle, LONGLONG offset) +/* + seek to position relative to start of the file. +*/ +{ + if (offset > memTable[handle].fitsfilesize ) + return(END_OF_FILE); + + memTable[handle].currentpos = offset; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_read(int hdl, void *buffer, long nbytes) +/* + read bytes from the current position in the file +*/ +{ + if (memTable[hdl].currentpos + nbytes > memTable[hdl].fitsfilesize) + return(END_OF_FILE); + + memcpy(buffer, + *(memTable[hdl].memaddrptr) + memTable[hdl].currentpos, + nbytes); + + memTable[hdl].currentpos += nbytes; + return(0); +} +/*--------------------------------------------------------------------------*/ +int mem_write(int hdl, void *buffer, long nbytes) +/* + write bytes at the current position in the file +*/ +{ + size_t newsize; + char *ptr; + + if ((size_t) (memTable[hdl].currentpos + nbytes) > + *(memTable[hdl].memsizeptr) ) + { + + if (!(memTable[hdl].mem_realloc)) + { + ffpmsg("realloc function not defined (mem_write)"); + return(WRITE_ERROR); + } + + /* + Attempt to reallocate additional memory: + the memory buffer size is incremented by the larger of: + 1 FITS block (2880 bytes) or + the defined 'deltasize' parameter + */ + + newsize = maxvalue( (size_t) + (((memTable[hdl].currentpos + nbytes - 1) / 2880) + 1) * 2880, + *(memTable[hdl].memsizeptr) + memTable[hdl].deltasize); + + /* call the realloc function */ + ptr = (memTable[hdl].mem_realloc)( + *(memTable[hdl].memaddrptr), + newsize); + if (!ptr) + { + ffpmsg("Failed to reallocate memory (mem_write)"); + return(MEMORY_ALLOCATION); + } + + *(memTable[hdl].memaddrptr) = ptr; + *(memTable[hdl].memsizeptr) = newsize; + } + + /* now copy the bytes from the buffer into memory */ + memcpy( *(memTable[hdl].memaddrptr) + memTable[hdl].currentpos, + buffer, + nbytes); + + memTable[hdl].currentpos += nbytes; + memTable[hdl].fitsfilesize = + maxvalue(memTable[hdl].fitsfilesize, + memTable[hdl].currentpos); + return(0); +} + + +#if HAVE_BZIP2 +void bzip2uncompress2mem(char *filename, FILE *diskfile, int hdl, + size_t* filesize, int* status) { + BZFILE* b; + int bzerror; + char buf[8192]; + size_t total_read = 0; + char* errormsg = NULL; + + *filesize = 0; + *status = 0; + b = BZ2_bzReadOpen(&bzerror, diskfile, 0, 0, NULL, 0); + if (bzerror != BZ_OK) { + BZ2_bzReadClose(&bzerror, b); + if (bzerror == BZ_MEM_ERROR) + ffpmsg("failed to open a bzip2 file: out of memory\n"); + else if (bzerror == BZ_CONFIG_ERROR) + ffpmsg("failed to open a bzip2 file: miscompiled bzip2 library\n"); + else if (bzerror == BZ_IO_ERROR) + ffpmsg("failed to open a bzip2 file: I/O error"); + else + ffpmsg("failed to open a bzip2 file"); + *status = READ_ERROR; + return; + } + bzerror = BZ_OK; + while (bzerror == BZ_OK) { + int nread; + nread = BZ2_bzRead(&bzerror, b, buf, sizeof(buf)); + if (bzerror == BZ_OK || bzerror == BZ_STREAM_END) { + *status = mem_write(hdl, buf, nread); + if (*status) { + BZ2_bzReadClose(&bzerror, b); + if (*status == MEMORY_ALLOCATION) + ffpmsg("Failed to reallocate memory while uncompressing bzip2 file"); + return; + } + total_read += nread; + } else { + if (bzerror == BZ_IO_ERROR) + errormsg = "failed to read bzip2 file: I/O error"; + else if (bzerror == BZ_UNEXPECTED_EOF) + errormsg = "failed to read bzip2 file: unexpected end-of-file"; + else if (bzerror == BZ_DATA_ERROR) + errormsg = "failed to read bzip2 file: data integrity error"; + else if (bzerror == BZ_MEM_ERROR) + errormsg = "failed to read bzip2 file: insufficient memory"; + } + } + BZ2_bzReadClose(&bzerror, b); + if (bzerror != BZ_OK) { + if (errormsg) + ffpmsg(errormsg); + else + ffpmsg("failure closing bzip2 file after reading\n"); + *status = READ_ERROR; + return; + } + *filesize = total_read; +} +#endif diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/drvrsmem.c b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrsmem.c new file mode 100644 index 0000000000000000000000000000000000000000..59fc83f903b3007c8df233ba14e834b67bfe4c21 --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/drvrsmem.c @@ -0,0 +1,973 @@ +/* S H A R E D M E M O R Y D R I V E R + ======================================= + + by Jerzy.Borkowski@obs.unige.ch + +09-Mar-98 : initial version 1.0 released +23-Mar-98 : shared_malloc now accepts new handle as an argument +23-Mar-98 : shmem://0, shmem://1, etc changed to shmem://h0, etc due to bug + in url parser. +10-Apr-98 : code cleanup +13-May-99 : delayed initialization added, global table deleted on exit when + no shmem segments remain, and last process terminates +*/ + +#ifdef HAVE_SHMEM_SERVICES +#include "fitsio2.h" /* drvrsmem.h is included by it */ + +#include +#include +#include +#include +#include +#include +#include + +#if defined(unix) || defined(__unix__) || defined(__unix) || defined(HAVE_UNISTD_H) +#include +#endif + + +static int shared_kbase = 0; /* base for shared memory handles */ +static int shared_maxseg = 0; /* max number of shared memory blocks */ +static int shared_range = 0; /* max number of tried entries */ +static int shared_fd = SHARED_INVALID; /* handle of global access lock file */ +static int shared_gt_h = SHARED_INVALID; /* handle of global table segment */ +static SHARED_LTAB *shared_lt = NULL; /* local table pointer */ +static SHARED_GTAB *shared_gt = NULL; /* global table pointer */ +static int shared_create_mode = 0666; /* permission flags for created objects */ +static int shared_debug = 1; /* simple debugging tool, set to 0 to disable messages */ +static int shared_init_called = 0; /* flag whether shared_init() has been called, used for delayed init */ + + /* static support routines prototypes */ + +static int shared_clear_entry(int idx); /* unconditionally clear entry */ +static int shared_destroy_entry(int idx); /* unconditionally destroy sema & shseg and clear entry */ +static int shared_mux(int idx, int mode); /* obtain exclusive access to specified segment */ +static int shared_demux(int idx, int mode); /* free exclusive access to specified segment */ + +static int shared_process_count(int sem); /* valid only for time of invocation */ +static int shared_delta_process(int sem, int delta); /* change number of processes hanging on segment */ +static int shared_attach_process(int sem); +static int shared_detach_process(int sem); +static int shared_get_free_entry(int newhandle); /* get free entry in shared_key, or -1, entry is set rw locked */ +static int shared_get_hash(long size, int idx);/* return hash value for malloc */ +static long shared_adjust_size(long size); /* size must be >= 0 !!! */ +static int shared_check_locked_index(int idx); /* verify that given idx is valid */ +static int shared_map(int idx); /* map all tables for given idx, check for validity */ +static int shared_validate(int idx, int mode); /* use intrnally inside crit.sect !!! */ + + /* support routines - initialization */ + + +static int shared_clear_entry(int idx) /* unconditionally clear entry */ + { if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + shared_gt[idx].key = SHARED_INVALID; /* clear entries in global table */ + shared_gt[idx].handle = SHARED_INVALID; + shared_gt[idx].sem = SHARED_INVALID; + shared_gt[idx].semkey = SHARED_INVALID; + shared_gt[idx].nprocdebug = 0; + shared_gt[idx].size = 0; + shared_gt[idx].attr = 0; + + return(SHARED_OK); + } + +static int shared_destroy_entry(int idx) /* unconditionally destroy sema & shseg and clear entry */ + { int r, r2; + union semun filler; + + if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + r2 = r = SHARED_OK; + filler.val = 0; /* this is to make cc happy (warning otherwise) */ + if (SHARED_INVALID != shared_gt[idx].sem) r = semctl(shared_gt[idx].sem, 0, IPC_RMID, filler); /* destroy semaphore */ + if (SHARED_INVALID != shared_gt[idx].handle) r2 = shmctl(shared_gt[idx].handle, IPC_RMID, 0); /* destroy shared memory segment */ + if (SHARED_OK == r) r = r2; /* accumulate error code in r, free r2 */ + r2 = shared_clear_entry(idx); + return((SHARED_OK == r) ? r2 : r); + } + +void shared_cleanup(void) /* this must (should) be called during exit/abort */ + { int i, j, r, oktodelete, filelocked, segmentspresent; + flock_t flk; + struct shmid_ds ds; + + if (shared_debug) printf("shared_cleanup:"); + if (NULL != shared_lt) + { if (shared_debug) printf(" deleting segments:"); + for (i=0; i>\n"); + return; + } + + +int shared_init(int debug_msgs) /* initialize shared memory stuff, you have to call this routine once */ + { int i; + char buf[1000], *p; + mode_t oldumask; + + shared_init_called = 1; /* tell everybody no need to call us for the 2nd time */ + shared_debug = debug_msgs; /* set required debug mode */ + + if (shared_debug) printf("shared_init:"); + + shared_kbase = 0; /* adapt to current env. settings */ + if (NULL != (p = getenv(SHARED_ENV_KEYBASE))) shared_kbase = atoi(p); + if (0 == shared_kbase) shared_kbase = SHARED_KEYBASE; + if (shared_debug) printf(" keybase=%d", shared_kbase); + + shared_maxseg = 0; + if (NULL != (p = getenv(SHARED_ENV_MAXSEG))) shared_maxseg = atoi(p); + if (0 == shared_maxseg) shared_maxseg = SHARED_MAXSEG; + if (shared_debug) printf(" maxseg=%d", shared_maxseg); + + shared_range = 3 * shared_maxseg; + + if (SHARED_INVALID == shared_fd) /* create rw locking file (this file is never deleted) */ + { if (shared_debug) printf(" lockfileinit="); + snprintf(buf, 1000,"%s.%d.%d", SHARED_FDNAME, shared_kbase, shared_maxseg); + oldumask = umask(0); + + shared_fd = open(buf, O_TRUNC | O_EXCL | O_CREAT | O_RDWR, shared_create_mode); + umask(oldumask); + if (SHARED_INVALID == shared_fd) /* or just open rw locking file, in case it already exists */ + { shared_fd = open(buf, O_TRUNC | O_RDWR, shared_create_mode); + if (SHARED_INVALID == shared_fd) return(SHARED_NOFILE); + if (shared_debug) printf("slave"); + + } + else + { if (shared_debug) printf("master"); + } + } + + if (SHARED_INVALID == shared_gt_h) /* global table not attached, try to create it in shared memory */ + { if (shared_debug) printf(" globalsharedtableinit="); + shared_gt_h = shmget(shared_kbase, shared_maxseg * sizeof(SHARED_GTAB), IPC_CREAT | IPC_EXCL | shared_create_mode); /* try open as a master */ + if (SHARED_INVALID == shared_gt_h) /* if failed, try to open as a slave */ + { shared_gt_h = shmget(shared_kbase, shared_maxseg * sizeof(SHARED_GTAB), shared_create_mode); + if (SHARED_INVALID == shared_gt_h) return(SHARED_IPCERR); /* means deleted ID residing in system, shared mem unusable ... */ + shared_gt = (SHARED_GTAB *)shmat(shared_gt_h, 0, 0); /* attach segment */ + if (((SHARED_GTAB *)SHARED_INVALID) == shared_gt) return(SHARED_IPCERR); + if (shared_debug) printf("slave"); + } + else + { shared_gt = (SHARED_GTAB *)shmat(shared_gt_h, 0, 0); /* attach segment */ + if (((SHARED_GTAB *)SHARED_INVALID) == shared_gt) return(SHARED_IPCERR); + for (i=0; i>\n"); + return(SHARED_OK); + } + + +int shared_recover(int id) /* try to recover dormant segments after applic crash */ + { int i, r, r2; + + if (NULL == shared_gt) return(SHARED_NOTINIT); /* not initialized */ + if (NULL == shared_lt) return(SHARED_NOTINIT); /* not initialized */ + r = SHARED_OK; + for (i=0; i r2) || (0 == r2)) + { if (shared_debug) printf("Bogus handle=%d nproc=%d sema=%d:", i, shared_gt[i].nprocdebug, r2); + r = shared_destroy_entry(i); + if (shared_debug) + { printf("%s", r ? "error couldn't clear handle" : "handle cleared"); + } + } + shared_demux(i, SHARED_RDWRITE); + } + return(r); /* table full */ + } + + /* API routines - mutexes and locking */ + +static int shared_mux(int idx, int mode) /* obtain exclusive access to specified segment */ + { flock_t flk; + + int r; + + if (0 == shared_init_called) /* delayed initialization */ + { if (SHARED_OK != (r = shared_init(0))) return(r); + + } + if (SHARED_INVALID == shared_fd) return(SHARED_NOTINIT); + if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + flk.l_type = ((mode & SHARED_RDWRITE) ? F_WRLCK : F_RDLCK); + flk.l_whence = 0; + flk.l_start = idx; + flk.l_len = 1; + if (shared_debug) printf(" [mux (%d): ", idx); + if (-1 == fcntl(shared_fd, ((mode & SHARED_NOWAIT) ? F_SETLK : F_SETLKW), &flk)) + { switch (errno) + { case EAGAIN: ; + + case EACCES: if (shared_debug) printf("again]"); + return(SHARED_AGAIN); + default: if (shared_debug) printf("err]"); + return(SHARED_IPCERR); + } + } + if (shared_debug) printf("ok]"); + return(SHARED_OK); + } + + + +static int shared_demux(int idx, int mode) /* free exclusive access to specified segment */ + { flock_t flk; + + if (SHARED_INVALID == shared_fd) return(SHARED_NOTINIT); + if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + flk.l_type = F_UNLCK; + flk.l_whence = 0; + flk.l_start = idx; + flk.l_len = 1; + if (shared_debug) printf(" [demux (%d): ", idx); + if (-1 == fcntl(shared_fd, F_SETLKW, &flk)) + { switch (errno) + { case EAGAIN: ; + case EACCES: if (shared_debug) printf("again]"); + return(SHARED_AGAIN); + default: if (shared_debug) printf("err]"); + return(SHARED_IPCERR); + } + + } + if (shared_debug) printf("mode=%d ok]", mode); + return(SHARED_OK); + } + + + +static int shared_process_count(int sem) /* valid only for time of invocation */ + { union semun su; + + su.val = 0; /* to force compiler not to give warning messages */ + return(semctl(sem, 0, GETVAL, su)); /* su is unused here */ + } + + +static int shared_delta_process(int sem, int delta) /* change number of processes hanging on segment */ + { struct sembuf sb; + + if (SHARED_INVALID == sem) return(SHARED_BADARG); /* semaphore not attached */ + sb.sem_num = 0; + sb.sem_op = delta; + sb.sem_flg = SEM_UNDO; + return((-1 == semop(sem, &sb, 1)) ? SHARED_IPCERR : SHARED_OK); + } + + +static int shared_attach_process(int sem) + { if (shared_debug) printf(" [attach process]"); + return(shared_delta_process(sem, 1)); + } + + +static int shared_detach_process(int sem) + { if (shared_debug) printf(" [detach process]"); + return(shared_delta_process(sem, -1)); + } + + /* API routines - hashing and searching */ + + +static int shared_get_free_entry(int newhandle) /* get newhandle, or -1, entry is set rw locked */ + { + if (NULL == shared_gt) return(-1); /* not initialized */ + if (NULL == shared_lt) return(-1); /* not initialized */ + if (newhandle < 0) return(-1); + if (newhandle >= shared_maxseg) return(-1); + if (shared_lt[newhandle].tcnt) return(-1); /* somebody (we) is using it */ + if (shared_mux(newhandle, SHARED_NOWAIT | SHARED_RDWRITE)) return(-1); /* used by others */ + if (SHARED_INVALID == shared_gt[newhandle].key) return(newhandle); /* we have found free slot, lock it and return index */ + shared_demux(newhandle, SHARED_RDWRITE); + if (shared_debug) printf("[free_entry - ERROR - entry unusable]"); + return(-1); /* table full */ + } + + +static int shared_get_hash(long size, int idx) /* return hash value for malloc */ + { static int counter = 0; + int hash; + + hash = (counter + size * idx) % shared_range; + counter = (counter + 1) % shared_range; + return(hash); + } + + +static long shared_adjust_size(long size) /* size must be >= 0 !!! */ + { return(((size + sizeof(BLKHEAD) + SHARED_GRANUL - 1) / SHARED_GRANUL) * SHARED_GRANUL); } + + + /* API routines - core : malloc/realloc/free/attach/detach/lock/unlock */ + +int shared_malloc(long size, int mode, int newhandle) /* return idx or SHARED_INVALID */ + { int h, i, r, idx, key; + union semun filler; + BLKHEAD *bp; + + if (0 == shared_init_called) /* delayed initialization */ + { if (SHARED_OK != (r = shared_init(0))) return(r); + } + if (shared_debug) printf("malloc (size = %ld, mode = %d):", size, mode); + if (size < 0) return(SHARED_INVALID); + if (-1 == (idx = shared_get_free_entry(newhandle))) return(SHARED_INVALID); + if (shared_debug) printf(" idx=%d", idx); + for (i = 0; ; i++) + { if (i >= shared_range) /* table full, signal error & exit */ + { shared_demux(idx, SHARED_RDWRITE); + return(SHARED_INVALID); + } + key = shared_kbase + ((i + shared_get_hash(size, idx)) % shared_range); + if (shared_debug) printf(" key=%d", key); + h = shmget(key, shared_adjust_size(size), IPC_CREAT | IPC_EXCL | shared_create_mode); + if (shared_debug) printf(" handle=%d", h); + if (SHARED_INVALID == h) continue; /* segment already accupied */ + bp = (BLKHEAD *)shmat(h, 0, 0); /* try attach */ + if (shared_debug) printf(" p=%p", bp); + if (((BLKHEAD *)SHARED_INVALID) == bp) /* cannot attach, delete segment, try with another key */ + { shmctl(h, IPC_RMID, 0); + continue; + } /* now create semaphor counting number of processes attached */ + if (SHARED_INVALID == (shared_gt[idx].sem = semget(key, 1, IPC_CREAT | IPC_EXCL | shared_create_mode))) + { shmdt((void *)bp); /* cannot create segment, delete everything */ + shmctl(h, IPC_RMID, 0); + continue; /* try with another key */ + } + if (shared_debug) printf(" sem=%d", shared_gt[idx].sem); + if (shared_attach_process(shared_gt[idx].sem)) /* try attach process */ + { semctl(shared_gt[idx].sem, 0, IPC_RMID, filler); /* destroy semaphore */ + shmdt((char *)bp); /* detach shared mem segment */ + shmctl(h, IPC_RMID, 0); /* destroy shared mem segment */ + continue; /* try with another key */ + } + bp->s.tflag = BLOCK_SHARED; /* fill in data in segment's header (this is really not necessary) */ + bp->s.ID[0] = SHARED_ID_0; + bp->s.ID[1] = SHARED_ID_1; + bp->s.handle = idx; /* used in yorick */ + if (mode & SHARED_RESIZE) + { if (shmdt((char *)bp)) r = SHARED_IPCERR; /* if segment is resizable, then detach segment */ + shared_lt[idx].p = NULL; + } + else { shared_lt[idx].p = bp; } + shared_lt[idx].tcnt = 1; /* one thread using segment */ + shared_lt[idx].lkcnt = 0; /* no locks at the moment */ + shared_lt[idx].seekpos = 0L; /* r/w pointer positioned at beg of block */ + shared_gt[idx].handle = h; /* fill in data in global table */ + shared_gt[idx].size = size; + shared_gt[idx].attr = mode; + shared_gt[idx].semkey = key; + shared_gt[idx].key = key; + shared_gt[idx].nprocdebug = 0; + + break; + } + shared_demux(idx, SHARED_RDWRITE); /* hope this will not fail */ + return(idx); + } + + +int shared_attach(int idx) + { int r, r2; + + if (SHARED_OK != (r = shared_mux(idx, SHARED_RDWRITE | SHARED_WAIT))) return(r); + if (SHARED_OK != (r = shared_map(idx))) + { shared_demux(idx, SHARED_RDWRITE); + return(r); + } + if (shared_attach_process(shared_gt[idx].sem)) /* try attach process */ + { shmdt((char *)(shared_lt[idx].p)); /* cannot attach process, detach everything */ + shared_lt[idx].p = NULL; + shared_demux(idx, SHARED_RDWRITE); + return(SHARED_BADARG); + } + shared_lt[idx].tcnt++; /* one more thread is using segment */ + if (shared_gt[idx].attr & SHARED_RESIZE) /* if resizeable, detach and return special pointer */ + { if (shmdt((char *)(shared_lt[idx].p))) r = SHARED_IPCERR; /* if segment is resizable, then detach segment */ + shared_lt[idx].p = NULL; + } + shared_lt[idx].seekpos = 0L; /* r/w pointer positioned at beg of block */ + r2 = shared_demux(idx, SHARED_RDWRITE); + return(r ? r : r2); + } + + + +static int shared_check_locked_index(int idx) /* verify that given idx is valid */ + { int r; + + if (0 == shared_init_called) /* delayed initialization */ + { if (SHARED_OK != (r = shared_init(0))) return(r); + + } + if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + if (NULL == shared_lt[idx].p) return(SHARED_BADARG); /* NULL pointer, not attached ?? */ + if (0 == shared_lt[idx].lkcnt) return(SHARED_BADARG); /* not locked ?? */ + if ((SHARED_ID_0 != (shared_lt[idx].p)->s.ID[0]) || (SHARED_ID_1 != (shared_lt[idx].p)->s.ID[1]) || + (BLOCK_SHARED != (shared_lt[idx].p)->s.tflag)) /* invalid data in segment */ + return(SHARED_BADARG); + return(SHARED_OK); + } + + + +static int shared_map(int idx) /* map all tables for given idx, check for validity */ + { int h; /* have to obtain excl. access before calling shared_map */ + BLKHEAD *bp; + + if ((idx < 0) || (idx >= shared_maxseg)) return(SHARED_BADARG); + if (SHARED_INVALID == shared_gt[idx].key) return(SHARED_BADARG); + if (SHARED_INVALID == (h = shmget(shared_gt[idx].key, 1, shared_create_mode))) return(SHARED_BADARG); + if (((BLKHEAD *)SHARED_INVALID) == (bp = (BLKHEAD *)shmat(h, 0, 0))) return(SHARED_BADARG); + if ((SHARED_ID_0 != bp->s.ID[0]) || (SHARED_ID_1 != bp->s.ID[1]) || (BLOCK_SHARED != bp->s.tflag) || (h != shared_gt[idx].handle)) + { shmdt((char *)bp); /* invalid segment, detach everything */ + return(SHARED_BADARG); + + } + if (shared_gt[idx].sem != semget(shared_gt[idx].semkey, 1, shared_create_mode)) /* check if sema is still there */ + { shmdt((char *)bp); /* cannot attach semaphore, detach everything */ + return(SHARED_BADARG); + } + shared_lt[idx].p = bp; /* store pointer to shmem data */ + return(SHARED_OK); + } + + +static int shared_validate(int idx, int mode) /* use intrnally inside crit.sect !!! */ + { int r; + + if (SHARED_OK != (r = shared_mux(idx, mode))) return(r); /* idx checked by shared_mux */ + if (NULL == shared_lt[idx].p) + if (SHARED_OK != (r = shared_map(idx))) + { shared_demux(idx, mode); + return(r); + } + if ((SHARED_ID_0 != (shared_lt[idx].p)->s.ID[0]) || (SHARED_ID_1 != (shared_lt[idx].p)->s.ID[1]) || (BLOCK_SHARED != (shared_lt[idx].p)->s.tflag)) + { shared_demux(idx, mode); + return(r); + } + return(SHARED_OK); + } + + +SHARED_P shared_realloc(int idx, long newsize) /* realloc shared memory segment */ + { int h, key, i, r; + BLKHEAD *bp; + long transfersize; + + r = SHARED_OK; + if (newsize < 0) return(NULL); + if (shared_check_locked_index(idx)) return(NULL); + if (0 == (shared_gt[idx].attr & SHARED_RESIZE)) return(NULL); + if (-1 != shared_lt[idx].lkcnt) return(NULL); /* check for RW lock */ + if (shared_adjust_size(shared_gt[idx].size) == shared_adjust_size(newsize)) + { shared_gt[idx].size = newsize; + + return((SHARED_P)((shared_lt[idx].p) + 1)); + } + for (i = 0; ; i++) + { if (i >= shared_range) return(NULL); /* table full, signal error & exit */ + key = shared_kbase + ((i + shared_get_hash(newsize, idx)) % shared_range); + h = shmget(key, shared_adjust_size(newsize), IPC_CREAT | IPC_EXCL | shared_create_mode); + if (SHARED_INVALID == h) continue; /* segment already accupied */ + bp = (BLKHEAD *)shmat(h, 0, 0); /* try attach */ + if (((BLKHEAD *)SHARED_INVALID) == bp) /* cannot attach, delete segment, try with another key */ + { shmctl(h, IPC_RMID, 0); + continue; + } + *bp = *(shared_lt[idx].p); /* copy header, then data */ + transfersize = ((newsize < shared_gt[idx].size) ? newsize : shared_gt[idx].size); + if (transfersize > 0) + memcpy((void *)(bp + 1), (void *)((shared_lt[idx].p) + 1), transfersize); + if (shmdt((char *)(shared_lt[idx].p))) r = SHARED_IPCERR; /* try to detach old segment */ + if (shmctl(shared_gt[idx].handle, IPC_RMID, 0)) if (SHARED_OK == r) r = SHARED_IPCERR; /* destroy old shared memory segment */ + shared_gt[idx].size = newsize; /* signal new size */ + shared_gt[idx].handle = h; /* signal new handle */ + shared_gt[idx].key = key; /* signal new key */ + shared_lt[idx].p = bp; + break; + } + return((SHARED_P)(bp + 1)); + } + + +int shared_free(int idx) /* detach segment, if last process & !PERSIST, destroy segment */ + { int cnt, r, r2; + + if (SHARED_OK != (r = shared_validate(idx, SHARED_RDWRITE | SHARED_WAIT))) return(r); + if (SHARED_OK != (r = shared_detach_process(shared_gt[idx].sem))) /* update number of processes using segment */ + { shared_demux(idx, SHARED_RDWRITE); + return(r); + } + shared_lt[idx].tcnt--; /* update number of threads using segment */ + if (shared_lt[idx].tcnt > 0) return(shared_demux(idx, SHARED_RDWRITE)); /* if more threads are using segment we are done */ + if (shmdt((char *)(shared_lt[idx].p))) /* if, we are the last thread, try to detach segment */ + { shared_demux(idx, SHARED_RDWRITE); + return(SHARED_IPCERR); + } + shared_lt[idx].p = NULL; /* clear entry in local table */ + shared_lt[idx].seekpos = 0L; /* r/w pointer positioned at beg of block */ + if (-1 == (cnt = shared_process_count(shared_gt[idx].sem))) /* get number of processes hanging on segment */ + { shared_demux(idx, SHARED_RDWRITE); + return(SHARED_IPCERR); + } + if ((0 == cnt) && (0 == (shared_gt[idx].attr & SHARED_PERSIST))) r = shared_destroy_entry(idx); /* no procs on seg, destroy it */ + r2 = shared_demux(idx, SHARED_RDWRITE); + return(r ? r : r2); + } + + +SHARED_P shared_lock(int idx, int mode) /* lock given segment for exclusive access */ + { int r; + + if (shared_mux(idx, mode)) return(NULL); /* idx checked by shared_mux */ + if (0 != shared_lt[idx].lkcnt) /* are we already locked ?? */ + if (SHARED_OK != (r = shared_map(idx))) + { shared_demux(idx, mode); + return(NULL); + } + if (NULL == shared_lt[idx].p) /* stupid pointer ?? */ + if (SHARED_OK != (r = shared_map(idx))) + { shared_demux(idx, mode); + return(NULL); + } + if ((SHARED_ID_0 != (shared_lt[idx].p)->s.ID[0]) || (SHARED_ID_1 != (shared_lt[idx].p)->s.ID[1]) || (BLOCK_SHARED != (shared_lt[idx].p)->s.tflag)) + { shared_demux(idx, mode); + return(NULL); + } + if (mode & SHARED_RDWRITE) + { shared_lt[idx].lkcnt = -1; + + shared_gt[idx].nprocdebug++; + } + + else shared_lt[idx].lkcnt++; + shared_lt[idx].seekpos = 0L; /* r/w pointer positioned at beg of block */ + return((SHARED_P)((shared_lt[idx].p) + 1)); + } + + +int shared_unlock(int idx) /* unlock given segment, assumes seg is locked !! */ + { int r, r2, mode; + + if (SHARED_OK != (r = shared_check_locked_index(idx))) return(r); + if (shared_lt[idx].lkcnt > 0) + { shared_lt[idx].lkcnt--; /* unlock read lock */ + mode = SHARED_RDONLY; + } + else + { shared_lt[idx].lkcnt = 0; /* unlock write lock */ + shared_gt[idx].nprocdebug--; + mode = SHARED_RDWRITE; + } + if (0 == shared_lt[idx].lkcnt) if (shared_gt[idx].attr & SHARED_RESIZE) + { if (shmdt((char *)(shared_lt[idx].p))) r = SHARED_IPCERR; /* segment is resizable, then detach segment */ + shared_lt[idx].p = NULL; /* signal detachment in local table */ + } + r2 = shared_demux(idx, mode); /* unlock segment, rest is only parameter checking */ + return(r ? r : r2); + } + + /* API routines - support and info routines */ + + +int shared_attr(int idx) /* get the attributes of the shared memory segment */ + { int r; + + if (shared_check_locked_index(idx)) return(SHARED_INVALID); + r = shared_gt[idx].attr; + return(r); + } + + +int shared_set_attr(int idx, int newattr) /* get the attributes of the shared memory segment */ + { int r; + + if (shared_check_locked_index(idx)) return(SHARED_INVALID); + if (-1 != shared_lt[idx].lkcnt) return(SHARED_INVALID); /* ADDED - check for RW lock */ + r = shared_gt[idx].attr; + shared_gt[idx].attr = newattr; + return(r); + + } + + +int shared_set_debug(int mode) /* set/reset debug mode */ + { int r = shared_debug; + + shared_debug = mode; + return(r); + } + + +int shared_set_createmode(int mode) /* set/reset debug mode */ + { int r = shared_create_mode; + + shared_create_mode = mode; + return(r); + } + + + + +int shared_list(int id) + { int i, r; + + if (NULL == shared_gt) return(SHARED_NOTINIT); /* not initialized */ + if (NULL == shared_lt) return(SHARED_NOTINIT); /* not initialized */ + if (shared_debug) printf("shared_list:"); + r = SHARED_OK; + printf(" Idx Key Nproc Size Flags\n"); + printf("==============================================\n"); + for (i=0; i= SHARED_ERRBASE) + { printf(" cannot clear PERSIST attribute"); + } + if (shared_free(i)) + { printf(" delete failed\n"); + } + else + { printf(" deleted\n"); + } + } + if (shared_debug) printf(" done\n"); + return(r); /* table full */ + } + + +/************************* CFITSIO DRIVER FUNCTIONS ***************************/ + +int smem_init(void) + { return(0); + } + +int smem_shutdown(void) + + { if (shared_init_called) shared_cleanup(); + return(0); + } + +int smem_setoptions(int option) + { option = 0; + return(0); + } + + +int smem_getoptions(int *options) + { if (NULL == options) return(SHARED_NULPTR); + *options = 0; + return(0); + } + +int smem_getversion(int *version) + { if (NULL == version) return(SHARED_NULPTR); + *version = 10; + return(0); + } + + +int smem_open(char *filename, int rwmode, int *driverhandle) + { int h, nitems, r; + DAL_SHM_SEGHEAD *sp; + + + if (NULL == filename) return(SHARED_NULPTR); + if (NULL == driverhandle) return(SHARED_NULPTR); + nitems = sscanf(filename, "h%d", &h); + if (1 != nitems) return(SHARED_BADARG); + + if (SHARED_OK != (r = shared_attach(h))) return(r); + + if (NULL == (sp = (DAL_SHM_SEGHEAD *)shared_lock(h, + ((READWRITE == rwmode) ? SHARED_RDWRITE : SHARED_RDONLY)))) + { shared_free(h); + return(SHARED_BADARG); + } + + if ((h != sp->h) || (DAL_SHM_SEGHEAD_ID != sp->ID)) + { shared_unlock(h); + shared_free(h); + + return(SHARED_BADARG); + } + + *driverhandle = h; + return(0); + } + + +int smem_create(char *filename, int *driverhandle) + { DAL_SHM_SEGHEAD *sp; + int h, sz, nitems; + + if (NULL == filename) return(SHARED_NULPTR); /* currently ignored */ + if (NULL == driverhandle) return(SHARED_NULPTR); + nitems = sscanf(filename, "h%d", &h); + if (1 != nitems) return(SHARED_BADARG); + + if (SHARED_INVALID == (h = shared_malloc(sz = 2880 + sizeof(DAL_SHM_SEGHEAD), + SHARED_RESIZE | SHARED_PERSIST, h))) + return(SHARED_NOMEM); + + if (NULL == (sp = (DAL_SHM_SEGHEAD *)shared_lock(h, SHARED_RDWRITE))) + { shared_free(h); + return(SHARED_BADARG); + } + + sp->ID = DAL_SHM_SEGHEAD_ID; + sp->h = h; + sp->size = sz; + sp->nodeidx = -1; + + *driverhandle = h; + + return(0); + } + + +int smem_close(int driverhandle) + { int r; + + if (SHARED_OK != (r = shared_unlock(driverhandle))) return(r); + return(shared_free(driverhandle)); + } + +int smem_remove(char *filename) + { int nitems, h, r; + + if (NULL == filename) return(SHARED_NULPTR); + nitems = sscanf(filename, "h%d", &h); + if (1 != nitems) return(SHARED_BADARG); + + if (0 == shared_check_locked_index(h)) /* are we locked ? */ + + { if (-1 != shared_lt[h].lkcnt) /* are we locked RO ? */ + { if (SHARED_OK != (r = shared_unlock(h))) return(r); /* yes, so relock in RW */ + if (NULL == shared_lock(h, SHARED_RDWRITE)) return(SHARED_BADARG); + } + + } + else /* not locked */ + { if (SHARED_OK != (r = smem_open(filename, READWRITE, &h))) + return(r); /* so open in RW mode */ + } + + shared_set_attr(h, SHARED_RESIZE); /* delete PERSIST attribute */ + return(smem_close(h)); /* detach segment (this will delete it) */ + } + +int smem_size(int driverhandle, LONGLONG *size) + { + if (NULL == size) return(SHARED_NULPTR); + if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID); + *size = (LONGLONG) (shared_gt[driverhandle].size - sizeof(DAL_SHM_SEGHEAD)); + return(0); + } + +int smem_flush(int driverhandle) + { + if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID); + return(0); + } + +int smem_seek(int driverhandle, LONGLONG offset) + { + if (offset < 0) return(SHARED_BADARG); + if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID); + shared_lt[driverhandle].seekpos = offset; + return(0); + } + +int smem_read(int driverhandle, void *buffer, long nbytes) + { + if (NULL == buffer) return(SHARED_NULPTR); + if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID); + if (nbytes < 0) return(SHARED_BADARG); + if ((shared_lt[driverhandle].seekpos + nbytes) > shared_gt[driverhandle].size) + return(SHARED_BADARG); /* read beyond EOF */ + + memcpy(buffer, + ((char *)(((DAL_SHM_SEGHEAD *)(shared_lt[driverhandle].p + 1)) + 1)) + + shared_lt[driverhandle].seekpos, + nbytes); + + shared_lt[driverhandle].seekpos += nbytes; + return(0); + } + +int smem_write(int driverhandle, void *buffer, long nbytes) + { + if (NULL == buffer) return(SHARED_NULPTR); + if (shared_check_locked_index(driverhandle)) return(SHARED_INVALID); + if (-1 != shared_lt[driverhandle].lkcnt) return(SHARED_INVALID); /* are we locked RW ? */ + + if (nbytes < 0) return(SHARED_BADARG); + if ((unsigned long)(shared_lt[driverhandle].seekpos + nbytes) > (unsigned long)(shared_gt[driverhandle].size - sizeof(DAL_SHM_SEGHEAD))) + { /* need to realloc shmem */ + if (NULL == shared_realloc(driverhandle, shared_lt[driverhandle].seekpos + nbytes + sizeof(DAL_SHM_SEGHEAD))) + return(SHARED_NOMEM); + } + + memcpy(((char *)(((DAL_SHM_SEGHEAD *)(shared_lt[driverhandle].p + 1)) + 1)) + + shared_lt[driverhandle].seekpos, + buffer, + nbytes); + + shared_lt[driverhandle].seekpos += nbytes; + return(0); + } +#endif diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/editcol.c b/testbed/astropy__astropy/cextern/cfitsio/lib/editcol.c new file mode 100644 index 0000000000000000000000000000000000000000..30c579bb1d273f30cfe3a0cddfe99a67e169a13b --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/editcol.c @@ -0,0 +1,2705 @@ +/* This file, editcol.c, contains the set of FITSIO routines that */ +/* insert or delete rows or columns in a table or resize an image */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include +#include "fitsio2.h" +/*--------------------------------------------------------------------------*/ +int ffrsim(fitsfile *fptr, /* I - FITS file pointer */ + int bitpix, /* I - bits per pixel */ + int naxis, /* I - number of axes in the array */ + long *naxes, /* I - size of each axis */ + int *status) /* IO - error status */ +/* + resize an existing primary array or IMAGE extension. +*/ +{ + LONGLONG tnaxes[99]; + int ii; + + if (*status > 0) + return(*status); + + for (ii = 0; (ii < naxis) && (ii < 99); ii++) + tnaxes[ii] = naxes[ii]; + + ffrsimll(fptr, bitpix, naxis, tnaxes, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffrsimll(fitsfile *fptr, /* I - FITS file pointer */ + int bitpix, /* I - bits per pixel */ + int naxis, /* I - number of axes in the array */ + LONGLONG *naxes, /* I - size of each axis */ + int *status) /* IO - error status */ +/* + resize an existing primary array or IMAGE extension. +*/ +{ + int ii, simple, obitpix, onaxis, extend, nmodify; + long nblocks, longval; + long pcount, gcount, longbitpix; + LONGLONG onaxes[99], newsize, oldsize; + char comment[FLEN_COMMENT], keyname[FLEN_KEYWORD], message[FLEN_ERRMSG]; + + if (*status > 0) + return(*status); + + /* reset position to the correct HDU if necessary */ + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + /* get current image size parameters */ + if (ffghprll(fptr, 99, &simple, &obitpix, &onaxis, onaxes, &pcount, + &gcount, &extend, status) > 0) + return(*status); + + longbitpix = bitpix; + + /* test for the 2 special cases that represent unsigned integers */ + if (longbitpix == USHORT_IMG) + longbitpix = SHORT_IMG; + else if (longbitpix == ULONG_IMG) + longbitpix = LONG_IMG; + + /* test that the new values are legal */ + + if (longbitpix != BYTE_IMG && longbitpix != SHORT_IMG && + longbitpix != LONG_IMG && longbitpix != LONGLONG_IMG && + longbitpix != FLOAT_IMG && longbitpix != DOUBLE_IMG) + { + snprintf(message, FLEN_ERRMSG, + "Illegal value for BITPIX keyword: %d", bitpix); + ffpmsg(message); + return(*status = BAD_BITPIX); + } + + if (naxis < 0 || naxis > 999) + { + snprintf(message, FLEN_ERRMSG, + "Illegal value for NAXIS keyword: %d", naxis); + ffpmsg(message); + return(*status = BAD_NAXIS); + } + + if (naxis == 0) + newsize = 0; + else + newsize = 1; + + for (ii = 0; ii < naxis; ii++) + { + if (naxes[ii] < 0) + { + snprintf(message, FLEN_ERRMSG, + "Illegal value for NAXIS%d keyword: %.0f", ii + 1, (double) (naxes[ii])); + ffpmsg(message); + return(*status = BAD_NAXES); + } + + newsize *= naxes[ii]; /* compute new image size, in pixels */ + } + + /* compute size of old image, in bytes */ + + if (onaxis == 0) + oldsize = 0; + else + { + oldsize = 1; + for (ii = 0; ii < onaxis; ii++) + oldsize *= onaxes[ii]; + oldsize = (oldsize + pcount) * gcount * (abs(obitpix) / 8); + } + + oldsize = (oldsize + 2879) / 2880; /* old size, in blocks */ + + newsize = (newsize + pcount) * gcount * (abs(longbitpix) / 8); + newsize = (newsize + 2879) / 2880; /* new size, in blocks */ + + if (newsize > oldsize) /* have to insert new blocks for image */ + { + nblocks = (long) (newsize - oldsize); + if (ffiblk(fptr, nblocks, 1, status) > 0) + return(*status); + } + else if (oldsize > newsize) /* have to delete blocks from image */ + { + nblocks = (long) (oldsize - newsize); + if (ffdblk(fptr, nblocks, status) > 0) + return(*status); + } + + /* now update the header keywords */ + + strcpy(comment,"&"); /* special value to leave comments unchanged */ + + if (longbitpix != obitpix) + { /* update BITPIX value */ + ffmkyj(fptr, "BITPIX", longbitpix, comment, status); + } + + if (naxis != onaxis) + { /* update NAXIS value */ + longval = naxis; + ffmkyj(fptr, "NAXIS", longval, comment, status); + } + + /* modify the existing NAXISn keywords */ + nmodify = minvalue(naxis, onaxis); + for (ii = 0; ii < nmodify; ii++) + { + ffkeyn("NAXIS", ii+1, keyname, status); + ffmkyj(fptr, keyname, naxes[ii], comment, status); + } + + if (naxis > onaxis) /* insert additional NAXISn keywords */ + { + strcpy(comment,"length of data axis"); + for (ii = onaxis; ii < naxis; ii++) + { + ffkeyn("NAXIS", ii+1, keyname, status); + ffikyj(fptr, keyname, naxes[ii], comment, status); + } + } + else if (onaxis > naxis) /* delete old NAXISn keywords */ + { + for (ii = naxis; ii < onaxis; ii++) + { + ffkeyn("NAXIS", ii+1, keyname, status); + ffdkey(fptr, keyname, status); + } + } + + /* Update the BSCALE and BZERO keywords, if an unsigned integer image */ + if (bitpix == USHORT_IMG) + { + strcpy(comment, "offset data range to that of unsigned short"); + ffukyg(fptr, "BZERO", 32768., 0, comment, status); + strcpy(comment, "default scaling factor"); + ffukyg(fptr, "BSCALE", 1.0, 0, comment, status); + } + else if (bitpix == ULONG_IMG) + { + strcpy(comment, "offset data range to that of unsigned long"); + ffukyg(fptr, "BZERO", 2147483648., 0, comment, status); + strcpy(comment, "default scaling factor"); + ffukyg(fptr, "BSCALE", 1.0, 0, comment, status); + } + + /* re-read the header, to make sure structures are updated */ + ffrdef(fptr, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffirow(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG firstrow, /* I - insert space AFTER this row */ + /* 0 = insert space at beginning of table */ + LONGLONG nrows, /* I - number of rows to insert */ + int *status) /* IO - error status */ +/* + insert NROWS blank rows immediated after row firstrow (1 = first row). + Set firstrow = 0 to insert space at the beginning of the table. +*/ +{ + int tstatus; + LONGLONG naxis1, naxis2; + LONGLONG datasize, firstbyte, nshift, nbytes; + LONGLONG freespace; + long nblock; + + if (*status > 0) + return(*status); + + /* reset position to the correct HDU if necessary */ + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only add rows to TABLE or BINTABLE extension (ffirow)"); + return(*status = NOT_TABLE); + } + + if (nrows < 0 ) + return(*status = NEG_BYTES); + else if (nrows == 0) + return(*status); /* no op, so just return */ + + /* get the current size of the table */ + /* use internal structure since NAXIS2 keyword may not be up to date */ + naxis1 = (fptr->Fptr)->rowlength; + naxis2 = (fptr->Fptr)->numrows; + + if (firstrow > naxis2) + { + ffpmsg( + "Insert position greater than the number of rows in the table (ffirow)"); + return(*status = BAD_ROW_NUM); + } + else if (firstrow < 0) + { + ffpmsg("Insert position is less than 0 (ffirow)"); + return(*status = BAD_ROW_NUM); + } + + /* current data size */ + datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize; + nshift = naxis1 * nrows; /* no. of bytes to add to table */ + + if ( (freespace - nshift) < 0) /* not enough existing space? */ + { + nblock = (long) ((nshift - freespace + 2879) / 2880); /* number of blocks */ + ffiblk(fptr, nblock, 1, status); /* insert the blocks */ + } + + firstbyte = naxis1 * firstrow; /* relative insert position */ + nbytes = datasize - firstbyte; /* no. of bytes to shift down */ + firstbyte += ((fptr->Fptr)->datastart); /* absolute insert position */ + + ffshft(fptr, firstbyte, nbytes, nshift, status); /* shift rows and heap */ + + /* update the heap starting address */ + (fptr->Fptr)->heapstart += nshift; + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (fptr->Fptr)->heapstart, "&", &tstatus); + + /* update the NAXIS2 keyword */ + ffmkyj(fptr, "NAXIS2", naxis2 + nrows, "&", status); + ((fptr->Fptr)->numrows) += nrows; + ((fptr->Fptr)->origrows) += nrows; + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdrow(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG firstrow, /* I - first row to delete (1 = first) */ + LONGLONG nrows, /* I - number of rows to delete */ + int *status) /* IO - error status */ +/* + delete NROWS rows from table starting with firstrow (1 = first row of table). +*/ +{ + int tstatus; + LONGLONG naxis1, naxis2; + LONGLONG datasize, firstbyte, nbytes, nshift; + LONGLONG freespace; + long nblock; + char comm[FLEN_COMMENT]; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only delete rows in TABLE or BINTABLE extension (ffdrow)"); + return(*status = NOT_TABLE); + } + + if (nrows < 0 ) + return(*status = NEG_BYTES); + else if (nrows == 0) + return(*status); /* no op, so just return */ + + ffgkyjj(fptr, "NAXIS1", &naxis1, comm, status); /* get the current */ + + /* ffgkyj(fptr, "NAXIS2", &naxis2, comm, status);*/ /* size of the table */ + + /* the NAXIS2 keyword may not be up to date, so use the structure value */ + naxis2 = (fptr->Fptr)->numrows; + + if (firstrow > naxis2) + { + ffpmsg( + "Delete position greater than the number of rows in the table (ffdrow)"); + return(*status = BAD_ROW_NUM); + } + else if (firstrow < 1) + { + ffpmsg("Delete position is less than 1 (ffdrow)"); + return(*status = BAD_ROW_NUM); + } + else if (firstrow + nrows - 1 > naxis2) + { + ffpmsg("No. of rows to delete exceeds size of table (ffdrow)"); + return(*status = BAD_ROW_NUM); + } + + nshift = naxis1 * nrows; /* no. of bytes to delete from table */ + /* cur size of data */ + datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + + firstbyte = naxis1 * (firstrow + nrows - 1); /* relative del pos */ + nbytes = datasize - firstbyte; /* no. of bytes to shift up */ + firstbyte += ((fptr->Fptr)->datastart); /* absolute delete position */ + + ffshft(fptr, firstbyte, nbytes, nshift * (-1), status); /* shift data */ + + freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize; + nblock = (long) ((nshift + freespace) / 2880); /* number of blocks */ + + /* delete integral number blocks */ + if (nblock > 0) + ffdblk(fptr, nblock, status); + + /* update the heap starting address */ + (fptr->Fptr)->heapstart -= nshift; + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus); + + /* update the NAXIS2 keyword */ + ffmkyj(fptr, "NAXIS2", naxis2 - nrows, "&", status); + ((fptr->Fptr)->numrows) -= nrows; + ((fptr->Fptr)->origrows) -= nrows; + + /* Update the heap data, if any. This will remove any orphaned data */ + /* that was only pointed to by the rows that have been deleted */ + ffcmph(fptr, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdrrg(fitsfile *fptr, /* I - FITS file pointer to table */ + char *ranges, /* I - ranges of rows to delete (1 = first) */ + int *status) /* IO - error status */ +/* + delete the ranges of rows from the table (1 = first row of table). + +The 'ranges' parameter typically looks like: + '10-20, 30 - 40, 55' or '50-' +and gives a list of rows or row ranges separated by commas. +*/ +{ + char *cptr; + int nranges, nranges2, ii; + long *minrow, *maxrow, nrows, *rowarray, jj, kk; + LONGLONG naxis2; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only delete rows in TABLE or BINTABLE extension (ffdrrg)"); + return(*status = NOT_TABLE); + } + + /* the NAXIS2 keyword may not be up to date, so use the structure value */ + naxis2 = (fptr->Fptr)->numrows; + + /* find how many ranges were specified ( = no. of commas in string + 1) */ + cptr = ranges; + for (nranges = 1; (cptr = strchr(cptr, ',')); nranges++) + cptr++; + + minrow = calloc(nranges, sizeof(long)); + maxrow = calloc(nranges, sizeof(long)); + + if (!minrow || !maxrow) { + *status = MEMORY_ALLOCATION; + ffpmsg("failed to allocate memory for row ranges (ffdrrg)"); + if (maxrow) free(maxrow); + if (minrow) free(minrow); + return(*status); + } + + /* parse range list into array of range min and max values */ + ffrwrg(ranges, naxis2, nranges, &nranges2, minrow, maxrow, status); + if (*status > 0 || nranges2 == 0) { + free(maxrow); + free(minrow); + return(*status); + } + + /* determine total number or rows to delete */ + nrows = 0; + for (ii = 0; ii < nranges2; ii++) { + nrows = nrows + maxrow[ii] - minrow[ii] + 1; + } + + rowarray = calloc(nrows, sizeof(long)); + if (!rowarray) { + *status = MEMORY_ALLOCATION; + ffpmsg("failed to allocate memory for row array (ffdrrg)"); + return(*status); + } + + for (kk = 0, ii = 0; ii < nranges2; ii++) { + for (jj = minrow[ii]; jj <= maxrow[ii]; jj++) { + rowarray[kk] = jj; + kk++; + } + } + + /* delete the rows */ + ffdrws(fptr, rowarray, nrows, status); + + free(rowarray); + free(maxrow); + free(minrow); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdrws(fitsfile *fptr, /* I - FITS file pointer */ + long *rownum, /* I - list of rows to delete (1 = first) */ + long nrows, /* I - number of rows to delete */ + int *status) /* IO - error status */ +/* + delete the list of rows from the table (1 = first row of table). +*/ +{ + LONGLONG naxis1, naxis2, insertpos, nextrowpos; + long ii, nextrow; + char comm[FLEN_COMMENT]; + unsigned char *buffer; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + /* rescan header if data structure is undefined */ + if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only delete rows in TABLE or BINTABLE extension (ffdrws)"); + return(*status = NOT_TABLE); + } + + if (nrows < 0 ) + return(*status = NEG_BYTES); + else if (nrows == 0) + return(*status); /* no op, so just return */ + + ffgkyjj(fptr, "NAXIS1", &naxis1, comm, status); /* row width */ + ffgkyjj(fptr, "NAXIS2", &naxis2, comm, status); /* number of rows */ + + /* check that input row list is in ascending order */ + for (ii = 1; ii < nrows; ii++) + { + if (rownum[ii - 1] >= rownum[ii]) + { + ffpmsg("row numbers are not in increasing order (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + } + + if (rownum[0] < 1) + { + ffpmsg("first row to delete is less than 1 (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + else if (rownum[nrows - 1] > naxis2) + { + ffpmsg("last row to delete exceeds size of table (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + + buffer = (unsigned char *) malloc( (size_t) naxis1); /* buffer for one row */ + + if (!buffer) + { + ffpmsg("malloc failed (ffdrws)"); + return(*status = MEMORY_ALLOCATION); + } + + /* byte location to start of first row to delete, and the next row */ + insertpos = (fptr->Fptr)->datastart + ((rownum[0] - 1) * naxis1); + nextrowpos = insertpos + naxis1; + nextrow = rownum[0] + 1; + + /* work through the list of rows to delete */ + for (ii = 1; ii < nrows; nextrow++, nextrowpos += naxis1) + { + if (nextrow < rownum[ii]) + { /* keep this row, so copy it to the new position */ + + ffmbyt(fptr, nextrowpos, REPORT_EOF, status); + ffgbyt(fptr, naxis1, buffer, status); /* read the bytes */ + + ffmbyt(fptr, insertpos, IGNORE_EOF, status); + ffpbyt(fptr, naxis1, buffer, status); /* write the bytes */ + + if (*status > 0) + { + ffpmsg("error while copying good rows in table (ffdrws)"); + free(buffer); + return(*status); + } + insertpos += naxis1; + } + else + { /* skip over this row since it is in the list */ + ii++; + } + } + + /* finished with all the rows to delete; copy remaining rows */ + while(nextrow <= naxis2) + { + ffmbyt(fptr, nextrowpos, REPORT_EOF, status); + ffgbyt(fptr, naxis1, buffer, status); /* read the bytes */ + + ffmbyt(fptr, insertpos, IGNORE_EOF, status); + ffpbyt(fptr, naxis1, buffer, status); /* write the bytes */ + + if (*status > 0) + { + ffpmsg("failed to copy remaining rows in table (ffdrws)"); + free(buffer); + return(*status); + } + insertpos += naxis1; + nextrowpos += naxis1; + nextrow++; + } + free(buffer); + + /* now delete the empty rows at the end of the table */ + ffdrow(fptr, naxis2 - nrows + 1, nrows, status); + + /* Update the heap data, if any. This will remove any orphaned data */ + /* that was only pointed to by the rows that have been deleted */ + ffcmph(fptr, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdrwsll(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG *rownum, /* I - list of rows to delete (1 = first) */ + LONGLONG nrows, /* I - number of rows to delete */ + int *status) /* IO - error status */ +/* + delete the list of rows from the table (1 = first row of table). +*/ +{ + LONGLONG insertpos, nextrowpos; + LONGLONG naxis1, naxis2, ii, nextrow; + char comm[FLEN_COMMENT]; + unsigned char *buffer; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + /* rescan header if data structure is undefined */ + if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only delete rows in TABLE or BINTABLE extension (ffdrws)"); + return(*status = NOT_TABLE); + } + + if (nrows < 0 ) + return(*status = NEG_BYTES); + else if (nrows == 0) + return(*status); /* no op, so just return */ + + ffgkyjj(fptr, "NAXIS1", &naxis1, comm, status); /* row width */ + ffgkyjj(fptr, "NAXIS2", &naxis2, comm, status); /* number of rows */ + + /* check that input row list is in ascending order */ + for (ii = 1; ii < nrows; ii++) + { + if (rownum[ii - 1] >= rownum[ii]) + { + ffpmsg("row numbers are not in increasing order (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + } + + if (rownum[0] < 1) + { + ffpmsg("first row to delete is less than 1 (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + else if (rownum[nrows - 1] > naxis2) + { + ffpmsg("last row to delete exceeds size of table (ffdrws)"); + return(*status = BAD_ROW_NUM); + } + + buffer = (unsigned char *) malloc( (size_t) naxis1); /* buffer for one row */ + + if (!buffer) + { + ffpmsg("malloc failed (ffdrwsll)"); + return(*status = MEMORY_ALLOCATION); + } + + /* byte location to start of first row to delete, and the next row */ + insertpos = (fptr->Fptr)->datastart + ((rownum[0] - 1) * naxis1); + nextrowpos = insertpos + naxis1; + nextrow = rownum[0] + 1; + + /* work through the list of rows to delete */ + for (ii = 1; ii < nrows; nextrow++, nextrowpos += naxis1) + { + if (nextrow < rownum[ii]) + { /* keep this row, so copy it to the new position */ + + ffmbyt(fptr, nextrowpos, REPORT_EOF, status); + ffgbyt(fptr, naxis1, buffer, status); /* read the bytes */ + + ffmbyt(fptr, insertpos, IGNORE_EOF, status); + ffpbyt(fptr, naxis1, buffer, status); /* write the bytes */ + + if (*status > 0) + { + ffpmsg("error while copying good rows in table (ffdrws)"); + free(buffer); + return(*status); + } + insertpos += naxis1; + } + else + { /* skip over this row since it is in the list */ + ii++; + } + } + + /* finished with all the rows to delete; copy remaining rows */ + while(nextrow <= naxis2) + { + ffmbyt(fptr, nextrowpos, REPORT_EOF, status); + ffgbyt(fptr, naxis1, buffer, status); /* read the bytes */ + + ffmbyt(fptr, insertpos, IGNORE_EOF, status); + ffpbyt(fptr, naxis1, buffer, status); /* write the bytes */ + + if (*status > 0) + { + ffpmsg("failed to copy remaining rows in table (ffdrws)"); + free(buffer); + return(*status); + } + insertpos += naxis1; + nextrowpos += naxis1; + nextrow++; + } + free(buffer); + + /* now delete the empty rows at the end of the table */ + ffdrow(fptr, naxis2 - nrows + 1, nrows, status); + + /* Update the heap data, if any. This will remove any orphaned data */ + /* that was only pointed to by the rows that have been deleted */ + ffcmph(fptr, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffrwrg( + char *rowlist, /* I - list of rows and row ranges */ + LONGLONG maxrows, /* I - number of rows in the table */ + int maxranges, /* I - max number of ranges to be returned */ + int *numranges, /* O - number ranges returned */ + long *minrow, /* O - first row in each range */ + long *maxrow, /* O - last row in each range */ + int *status) /* IO - status value */ +{ +/* + parse the input list of row ranges, returning the number of ranges, + and the min and max row value in each range. + + The only characters allowed in the input rowlist are + decimal digits, minus sign, and comma (and non-significant spaces) + + Example: + + list = "10-20, 30-35,50" + + would return numranges = 3, minrow[] = {10, 30, 50}, maxrow[] = {20, 35, 50} + + error is returned if min value of range is > max value of range or if the + ranges are not monotonically increasing. +*/ + char *next; + long minval, maxval; + + if (*status > 0) + return(*status); + + if (maxrows <= 0 ) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Input maximum range value is <= 0 (fits_parse_ranges)"); + return(*status); + } + + next = rowlist; + *numranges = 0; + + while (*next == ' ')next++; /* skip spaces */ + + while (*next != '\0') { + + /* find min value of next range; *next must be '-' or a digit */ + if (*next == '-') { + minval = 1; /* implied minrow value = 1 */ + } else if ( isdigit((int) *next) ) { + minval = strtol(next, &next, 10); + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + + while (*next == ' ')next++; /* skip spaces */ + + /* find max value of next range; *next must be '-', or ',' */ + if (*next == '-') { + next++; + while (*next == ' ')next++; /* skip spaces */ + + if ( isdigit((int) *next) ) { + maxval = strtol(next, &next, 10); + } else if (*next == ',' || *next == '\0') { + maxval = (long) maxrows; /* implied max value */ + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + } else if (*next == ',' || *next == '\0') { + maxval = minval; /* only a single integer in this range */ + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + + if (*numranges + 1 > maxranges) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Overflowed maximum number of ranges (fits_parse_ranges)"); + return(*status); + } + + if (minval < 1 ) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list: row number < 1"); + ffpmsg(rowlist); + return(*status); + } + + if (maxval < minval) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list: min > max"); + ffpmsg(rowlist); + return(*status); + } + + if (*numranges > 0) { + if (minval <= maxrow[(*numranges) - 1]) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list. Range minimum is"); + ffpmsg(" less than or equal to previous range maximum"); + ffpmsg(rowlist); + return(*status); + } + } + + if (minval <= maxrows) { /* ignore range if greater than maxrows */ + if (maxval > maxrows) + maxval = (long) maxrows; + + minrow[*numranges] = minval; + maxrow[*numranges] = maxval; + + (*numranges)++; + } + + while (*next == ' ')next++; /* skip spaces */ + if (*next == ',') { + next++; + while (*next == ' ')next++; /* skip more spaces */ + } + } + + if (*numranges == 0) { /* a null string was entered */ + minrow[0] = 1; + maxrow[0] = (long) maxrows; + *numranges = 1; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffrwrgll( + char *rowlist, /* I - list of rows and row ranges */ + LONGLONG maxrows, /* I - number of rows in the list */ + int maxranges, /* I - max number of ranges to be returned */ + int *numranges, /* O - number ranges returned */ + LONGLONG *minrow, /* O - first row in each range */ + LONGLONG *maxrow, /* O - last row in each range */ + int *status) /* IO - status value */ +{ +/* + parse the input list of row ranges, returning the number of ranges, + and the min and max row value in each range. + + The only characters allowed in the input rowlist are + decimal digits, minus sign, and comma (and non-significant spaces) + + Example: + + list = "10-20, 30-35,50" + + would return numranges = 3, minrow[] = {10, 30, 50}, maxrow[] = {20, 35, 50} + + error is returned if min value of range is > max value of range or if the + ranges are not monotonically increasing. +*/ + char *next; + LONGLONG minval, maxval; + double dvalue; + + if (*status > 0) + return(*status); + + if (maxrows <= 0 ) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Input maximum range value is <= 0 (fits_parse_ranges)"); + return(*status); + } + + next = rowlist; + *numranges = 0; + + while (*next == ' ')next++; /* skip spaces */ + + while (*next != '\0') { + + /* find min value of next range; *next must be '-' or a digit */ + if (*next == '-') { + minval = 1; /* implied minrow value = 1 */ + } else if ( isdigit((int) *next) ) { + + /* read as a double, because the string to LONGLONG function */ + /* is platform dependent (strtoll, strtol, _atoI64) */ + + dvalue = strtod(next, &next); + minval = (LONGLONG) (dvalue + 0.1); + + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + + while (*next == ' ')next++; /* skip spaces */ + + /* find max value of next range; *next must be '-', or ',' */ + if (*next == '-') { + next++; + while (*next == ' ')next++; /* skip spaces */ + + if ( isdigit((int) *next) ) { + + /* read as a double, because the string to LONGLONG function */ + /* is platform dependent (strtoll, strtol, _atoI64) */ + + dvalue = strtod(next, &next); + maxval = (LONGLONG) (dvalue + 0.1); + + } else if (*next == ',' || *next == '\0') { + maxval = maxrows; /* implied max value */ + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + } else if (*next == ',' || *next == '\0') { + maxval = minval; /* only a single integer in this range */ + } else { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list:"); + ffpmsg(rowlist); + return(*status); + } + + if (*numranges + 1 > maxranges) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Overflowed maximum number of ranges (fits_parse_ranges)"); + return(*status); + } + + if (minval < 1 ) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list: row number < 1"); + ffpmsg(rowlist); + return(*status); + } + + if (maxval < minval) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list: min > max"); + ffpmsg(rowlist); + return(*status); + } + + if (*numranges > 0) { + if (minval <= maxrow[(*numranges) - 1]) { + *status = RANGE_PARSE_ERROR; + ffpmsg("Syntax error in this row range list. Range minimum is"); + ffpmsg(" less than or equal to previous range maximum"); + ffpmsg(rowlist); + return(*status); + } + } + + if (minval <= maxrows) { /* ignore range if greater than maxrows */ + if (maxval > maxrows) + maxval = maxrows; + + minrow[*numranges] = minval; + maxrow[*numranges] = maxval; + + (*numranges)++; + } + + while (*next == ' ')next++; /* skip spaces */ + if (*next == ',') { + next++; + while (*next == ' ')next++; /* skip more spaces */ + } + } + + if (*numranges == 0) { /* a null string was entered */ + minrow[0] = 1; + maxrow[0] = maxrows; + *numranges = 1; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fficol(fitsfile *fptr, /* I - FITS file pointer */ + int numcol, /* I - position for new col. (1 = 1st) */ + char *ttype, /* I - name of column (TTYPE keyword) */ + char *tform, /* I - format of column (TFORM keyword) */ + int *status) /* IO - error status */ +/* + Insert a new column into an existing table at position numcol. If + numcol is greater than the number of existing columns in the table + then the new column will be appended as the last column in the table. +*/ +{ + char *name, *format; + + name = ttype; + format = tform; + + fficls(fptr, numcol, 1, &name, &format, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fficls(fitsfile *fptr, /* I - FITS file pointer */ + int fstcol, /* I - position for first new col. (1 = 1st) */ + int ncols, /* I - number of columns to insert */ + char **ttype, /* I - array of column names(TTYPE keywords) */ + char **tform, /* I - array of formats of column (TFORM) */ + int *status) /* IO - error status */ +/* + Insert 1 or more new columns into an existing table at position numcol. If + fstcol is greater than the number of existing columns in the table + then the new column will be appended as the last column in the table. +*/ +{ + int colnum, datacode, decims, tfields, tstatus, ii; + LONGLONG datasize, firstbyte, nbytes, nadd, naxis1, naxis2, freespace; + LONGLONG tbcol, firstcol, delbyte; + long nblock, width, repeat; + char tfm[FLEN_VALUE], keyname[FLEN_KEYWORD], comm[FLEN_COMMENT], *cptr; + tcolumn *colptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg("Can only add columns to TABLE or BINTABLE extension (fficls)"); + return(*status = NOT_TABLE); + } + + /* is the column number valid? */ + tfields = (fptr->Fptr)->tfield; + if (fstcol < 1 ) + return(*status = BAD_COL_NUM); + else if (fstcol > tfields) + colnum = tfields + 1; /* append as last column */ + else + colnum = fstcol; + + /* parse the tform value and calc number of bytes to add to each row */ + delbyte = 0; + for (ii = 0; ii < ncols; ii++) + { + if (strlen(tform[ii]) > FLEN_VALUE-1) + { + ffpmsg("Column format string too long (fficls)"); + return (*status=BAD_TFORM); + } + strcpy(tfm, tform[ii]); + ffupch(tfm); /* make sure format is in upper case */ + + if ((fptr->Fptr)->hdutype == ASCII_TBL) + { + ffasfm(tfm, &datacode, &width, &decims, status); + delbyte += width + 1; /* add one space between the columns */ + } + else + { + ffbnfm(tfm, &datacode, &repeat, &width, status); + + if (datacode < 0) { /* variable length array column */ + if (strchr(tfm, 'Q')) + delbyte += 16; + else + delbyte += 8; + } else if (datacode == 1) /* bit column; round up */ + delbyte += (repeat + 7) / 8; /* to multiple of 8 bits */ + else if (datacode == 16) /* ASCII string column */ + delbyte += repeat; + else /* numerical data type */ + delbyte += (datacode / 10) * repeat; + } + } + + if (*status > 0) + return(*status); + + /* get the current size of the table */ + /* use internal structure since NAXIS2 keyword may not be up to date */ + naxis1 = (fptr->Fptr)->rowlength; + naxis2 = (fptr->Fptr)->numrows; + + /* current size of data */ + datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize; + nadd = delbyte * naxis2; /* no. of bytes to add to table */ + + if ( (freespace - nadd) < 0) /* not enough existing space? */ + { + nblock = (long) ((nadd - freespace + 2879) / 2880); /* number of blocks */ + if (ffiblk(fptr, nblock, 1, status) > 0) /* insert the blocks */ + return(*status); + } + + /* shift heap down (if it exists) */ + if ((fptr->Fptr)->heapsize > 0) + { + nbytes = (fptr->Fptr)->heapsize; /* no. of bytes to shift down */ + + /* absolute heap pos */ + firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart; + + if (ffshft(fptr, firstbyte, nbytes, nadd, status) > 0) /* move heap */ + return(*status); + } + + /* update the heap starting address */ + (fptr->Fptr)->heapstart += nadd; + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (fptr->Fptr)->heapstart, "&", &tstatus); + + /* calculate byte position in the row where to insert the new column */ + if (colnum > tfields) + firstcol = naxis1; + else + { + colptr = (fptr->Fptr)->tableptr; + colptr += (colnum - 1); + firstcol = colptr->tbcol; + } + + /* insert delbyte bytes in every row, at byte position firstcol */ + ffcins(fptr, naxis1, naxis2, delbyte, firstcol, status); + + if ((fptr->Fptr)->hdutype == ASCII_TBL) + { + /* adjust the TBCOL values of the existing columns */ + for(ii = 0; ii < tfields; ii++) + { + ffkeyn("TBCOL", ii + 1, keyname, status); + ffgkyjj(fptr, keyname, &tbcol, comm, status); + if (tbcol > firstcol) + { + tbcol += delbyte; + ffmkyj(fptr, keyname, tbcol, "&", status); + } + } + } + + /* update the mandatory keywords */ + ffmkyj(fptr, "TFIELDS", tfields + ncols, "&", status); + ffmkyj(fptr, "NAXIS1", naxis1 + delbyte, "&", status); + + /* increment the index value on any existing column keywords */ + if(colnum <= tfields) + ffkshf(fptr, colnum, tfields, ncols, status); + + /* add the required keywords for the new columns */ + for (ii = 0; ii < ncols; ii++, colnum++) + { + strcpy(comm, "label for field"); + ffkeyn("TTYPE", colnum, keyname, status); + ffpkys(fptr, keyname, ttype[ii], comm, status); + + strcpy(comm, "format of field"); + strcpy(tfm, tform[ii]); + ffupch(tfm); /* make sure format is in upper case */ + ffkeyn("TFORM", colnum, keyname, status); + + if (abs(datacode) == TSBYTE) + { + /* Replace the 'S' with an 'B' in the TFORMn code */ + cptr = tfm; + while (*cptr != 'S') + cptr++; + + *cptr = 'B'; + ffpkys(fptr, keyname, tfm, comm, status); + + /* write the TZEROn and TSCALn keywords */ + ffkeyn("TZERO", colnum, keyname, status); + strcpy(comm, "offset for signed bytes"); + + ffpkyg(fptr, keyname, -128., 0, comm, status); + + ffkeyn("TSCAL", colnum, keyname, status); + strcpy(comm, "data are not scaled"); + ffpkyg(fptr, keyname, 1., 0, comm, status); + } + else if (abs(datacode) == TUSHORT) + { + /* Replace the 'U' with an 'I' in the TFORMn code */ + cptr = tfm; + while (*cptr != 'U') + cptr++; + + *cptr = 'I'; + ffpkys(fptr, keyname, tfm, comm, status); + + /* write the TZEROn and TSCALn keywords */ + ffkeyn("TZERO", colnum, keyname, status); + strcpy(comm, "offset for unsigned integers"); + + ffpkyg(fptr, keyname, 32768., 0, comm, status); + + ffkeyn("TSCAL", colnum, keyname, status); + strcpy(comm, "data are not scaled"); + ffpkyg(fptr, keyname, 1., 0, comm, status); + } + else if (abs(datacode) == TULONG) + { + /* Replace the 'V' with an 'J' in the TFORMn code */ + cptr = tfm; + while (*cptr != 'V') + cptr++; + + *cptr = 'J'; + ffpkys(fptr, keyname, tfm, comm, status); + + /* write the TZEROn and TSCALn keywords */ + ffkeyn("TZERO", colnum, keyname, status); + strcpy(comm, "offset for unsigned integers"); + + ffpkyg(fptr, keyname, 2147483648., 0, comm, status); + + ffkeyn("TSCAL", colnum, keyname, status); + strcpy(comm, "data are not scaled"); + ffpkyg(fptr, keyname, 1., 0, comm, status); + } + else + { + ffpkys(fptr, keyname, tfm, comm, status); + } + + if ((fptr->Fptr)->hdutype == ASCII_TBL) /* write the TBCOL keyword */ + { + if (colnum == tfields + 1) + tbcol = firstcol + 2; /* allow space between preceding col */ + else + tbcol = firstcol + 1; + + strcpy(comm, "beginning column of field"); + ffkeyn("TBCOL", colnum, keyname, status); + ffpkyj(fptr, keyname, tbcol, comm, status); + + /* increment the column starting position for the next column */ + ffasfm(tfm, &datacode, &width, &decims, status); + firstcol += width + 1; /* add one space between the columns */ + } + } + ffrdef(fptr, status); /* initialize the new table structure */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffmvec(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - position of col to be modified */ + LONGLONG newveclen, /* I - new vector length of column (TFORM) */ + int *status) /* IO - error status */ +/* + Modify the vector length of a column in a binary table, larger or smaller. + E.g., change a column from TFORMn = '1E' to '20E'. +*/ +{ + int datacode, tfields, tstatus; + LONGLONG datasize, size, firstbyte, nbytes, nadd, ndelete; + LONGLONG naxis1, naxis2, firstcol, freespace; + LONGLONG width, delbyte, repeat; + long nblock; + char tfm[FLEN_VALUE], keyname[FLEN_KEYWORD], tcode[2]; + tcolumn *colptr; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype != BINARY_TBL) + { + ffpmsg( + "Can only change vector length of a column in BINTABLE extension (ffmvec)"); + return(*status = NOT_TABLE); + } + + /* is the column number valid? */ + tfields = (fptr->Fptr)->tfield; + if (colnum < 1 || colnum > tfields) + return(*status = BAD_COL_NUM); + + /* look up the current vector length and element width */ + + colptr = (fptr->Fptr)->tableptr; + colptr += (colnum - 1); + + datacode = colptr->tdatatype; /* datatype of the column */ + repeat = colptr->trepeat; /* field repeat count */ + width = colptr->twidth; /* width of a single element in chars */ + + if (datacode < 0) + { + ffpmsg( + "Can't modify vector length of variable length column (ffmvec)"); + return(*status = BAD_TFORM); + } + + if (repeat == newveclen) + return(*status); /* column already has the desired vector length */ + + if (datacode == TSTRING) + width = 1; /* width was equal to width of unit string */ + + naxis1 = (fptr->Fptr)->rowlength; /* current width of the table */ + naxis2 = (fptr->Fptr)->numrows; + + delbyte = (newveclen - repeat) * width; /* no. of bytes to insert */ + if (datacode == TBIT) /* BIT column is a special case */ + delbyte = ((newveclen + 7) / 8) - ((repeat + 7) / 8); + + if (delbyte > 0) /* insert space for more elements */ + { + /* current size of data */ + datasize = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + freespace = ( ( (datasize + 2879) / 2880) * 2880) - datasize; + + nadd = (LONGLONG)delbyte * naxis2; /* no. of bytes to add to table */ + + if ( (freespace - nadd) < 0) /* not enough existing space? */ + { + nblock = (long) ((nadd - freespace + 2879) / 2880); /* number of blocks */ + if (ffiblk(fptr, nblock, 1, status) > 0) /* insert the blocks */ + return(*status); + } + + /* shift heap down (if it exists) */ + if ((fptr->Fptr)->heapsize > 0) + { + nbytes = (fptr->Fptr)->heapsize; /* no. of bytes to shift down */ + + /* absolute heap pos */ + firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart; + + if (ffshft(fptr, firstbyte, nbytes, nadd, status) > 0) /* move heap */ + return(*status); + } + + /* update the heap starting address */ + (fptr->Fptr)->heapstart += nadd; + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (fptr->Fptr)->heapstart, "&", &tstatus); + + /* Must reset colptr before using it again. (fptr->Fptr)->tableptr + may have been reallocated down in ffbinit via the call to ffiblk above.*/ + colptr = (fptr->Fptr)->tableptr; + colptr += (colnum - 1); + + firstcol = colptr->tbcol + (repeat * width); /* insert position */ + + /* insert delbyte bytes in every row, at byte position firstcol */ + ffcins(fptr, naxis1, naxis2, delbyte, firstcol, status); + } + else if (delbyte < 0) + { + /* current size of table */ + size = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + freespace = ((size + 2879) / 2880) * 2880 - size - ((LONGLONG)delbyte * naxis2); + nblock = (long) (freespace / 2880); /* number of empty blocks to delete */ + firstcol = colptr->tbcol + (newveclen * width); /* delete position */ + + /* delete elements from the vector */ + ffcdel(fptr, naxis1, naxis2, -delbyte, firstcol, status); + + /* abs heap pos */ + firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart; + ndelete = (LONGLONG)delbyte * naxis2; /* size of shift (negative) */ + + /* shift heap up (if it exists) */ + if ((fptr->Fptr)->heapsize > 0) + { + nbytes = (fptr->Fptr)->heapsize; /* no. of bytes to shift up */ + if (ffshft(fptr, firstbyte, nbytes, ndelete, status) > 0) + return(*status); + } + + /* delete the empty blocks at the end of the HDU */ + if (nblock > 0) + ffdblk(fptr, nblock, status); + + /* update the heap starting address */ + (fptr->Fptr)->heapstart += ndelete; /* ndelete is negative */ + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (fptr->Fptr)->heapstart, "&", &tstatus); + } + + /* construct the new TFORM keyword for the column */ + if (datacode == TBIT) + strcpy(tcode,"X"); + else if (datacode == TBYTE) + strcpy(tcode,"B"); + else if (datacode == TLOGICAL) + strcpy(tcode,"L"); + else if (datacode == TSTRING) + strcpy(tcode,"A"); + else if (datacode == TSHORT) + strcpy(tcode,"I"); + else if (datacode == TLONG) + strcpy(tcode,"J"); + else if (datacode == TLONGLONG) + strcpy(tcode,"K"); + else if (datacode == TFLOAT) + strcpy(tcode,"E"); + else if (datacode == TDOUBLE) + strcpy(tcode,"D"); + else if (datacode == TCOMPLEX) + strcpy(tcode,"C"); + else if (datacode == TDBLCOMPLEX) + strcpy(tcode,"M"); + + /* write as a double value because the LONGLONG conversion */ + /* character in snprintf is platform dependent ( %lld, %ld, %I64d ) */ + + snprintf(tfm,FLEN_VALUE,"%.0f%s",(double) newveclen, tcode); + + ffkeyn("TFORM", colnum, keyname, status); /* Keyword name */ + ffmkys(fptr, keyname, tfm, "&", status); /* modify TFORM keyword */ + + ffmkyj(fptr, "NAXIS1", naxis1 + delbyte, "&", status); /* modify NAXIS1 */ + + ffrdef(fptr, status); /* reinitialize the new table structure */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffcpcl(fitsfile *infptr, /* I - FITS file pointer to input file */ + fitsfile *outfptr, /* I - FITS file pointer to output file */ + int incol, /* I - number of input column */ + int outcol, /* I - number for output column */ + int create_col, /* I - create new col if TRUE, else overwrite */ + int *status) /* IO - error status */ +/* + copy a column from infptr and insert it in the outfptr table. +*/ +{ + int tstatus, colnum, typecode, otypecode, anynull; + int inHduType, outHduType; + long tfields, repeat, orepeat, width, owidth, nrows, outrows; + long inloop, outloop, maxloop, ndone, ntodo, npixels; + long firstrow, firstelem, ii; + char keyname[FLEN_KEYWORD], ttype[FLEN_VALUE], tform[FLEN_VALUE]; + char ttype_comm[FLEN_COMMENT],tform_comm[FLEN_COMMENT]; + char *lvalues = 0, nullflag, **strarray = 0; + char nulstr[] = {'\5', '\0'}; /* unique null string value */ + double dnull = 0.l, *dvalues = 0; + float fnull = 0., *fvalues = 0; + + if (*status > 0) + return(*status); + + if (infptr->HDUposition != (infptr->Fptr)->curhdu) + { + ffmahd(infptr, (infptr->HDUposition) + 1, NULL, status); + } + else if ((infptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(infptr, status); /* rescan header */ + inHduType = (infptr->Fptr)->hdutype; + + if (outfptr->HDUposition != (outfptr->Fptr)->curhdu) + { + ffmahd(outfptr, (outfptr->HDUposition) + 1, NULL, status); + } + else if ((outfptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(outfptr, status); /* rescan header */ + outHduType = (outfptr->Fptr)->hdutype; + + if (*status > 0) + return(*status); + + if (inHduType == IMAGE_HDU || outHduType == IMAGE_HDU) + { + ffpmsg + ("Can not copy columns to or from IMAGE HDUs (ffcpcl)"); + return(*status = NOT_TABLE); + } + + if ( inHduType == BINARY_TBL && outHduType == ASCII_TBL) + { + ffpmsg + ("Copying from Binary table to ASCII table is not supported (ffcpcl)"); + return(*status = NOT_BTABLE); + } + + /* get the datatype and vector repeat length of the column */ + ffgtcl(infptr, incol, &typecode, &repeat, &width, status); + + if (typecode < 0) + { + ffpmsg("Variable-length columns are not supported (ffcpcl)"); + return(*status = BAD_TFORM); + } + + if (create_col) /* insert new column in output table? */ + { + tstatus = 0; + ffkeyn("TTYPE", incol, keyname, &tstatus); + ffgkys(infptr, keyname, ttype, ttype_comm, &tstatus); + ffkeyn("TFORM", incol, keyname, &tstatus); + + if (ffgkys(infptr, keyname, tform, tform_comm, &tstatus) ) + { + ffpmsg + ("Could not find TTYPE and TFORM keywords in input table (ffcpcl)"); + return(*status = NO_TFORM); + } + + if (inHduType == ASCII_TBL && outHduType == BINARY_TBL) + { + /* convert from ASCII table to BINARY table format string */ + if (typecode == TSTRING) + ffnkey(width, "A", tform, status); + + else if (typecode == TLONG) + strcpy(tform, "1J"); + + else if (typecode == TSHORT) + strcpy(tform, "1I"); + + else if (typecode == TFLOAT) + strcpy(tform,"1E"); + + else if (typecode == TDOUBLE) + strcpy(tform,"1D"); + } + + if (ffgkyj(outfptr, "TFIELDS", &tfields, 0, &tstatus)) + { + ffpmsg + ("Could not read TFIELDS keyword in output table (ffcpcl)"); + return(*status = NO_TFIELDS); + } + + colnum = minvalue((int) tfields + 1, outcol); /* output col. number */ + + /* create the empty column */ + if (fficol(outfptr, colnum, ttype, tform, status) > 0) + { + ffpmsg + ("Could not append new column to output file (ffcpcl)"); + return(*status); + } + + if ((infptr->Fptr == outfptr->Fptr) + && (infptr->HDUposition == outfptr->HDUposition) + && (colnum <= incol)) { + incol++; /* the input column has been shifted over */ + } + + /* copy the comment strings from the input file for TTYPE and TFORM */ + tstatus = 0; + ffkeyn("TTYPE", colnum, keyname, &tstatus); + ffmcom(outfptr, keyname, ttype_comm, &tstatus); + ffkeyn("TFORM", colnum, keyname, &tstatus); + ffmcom(outfptr, keyname, tform_comm, &tstatus); + + /* copy other column-related keywords if they exist */ + + ffcpky(infptr, outfptr, incol, colnum, "TUNIT", status); + ffcpky(infptr, outfptr, incol, colnum, "TSCAL", status); + ffcpky(infptr, outfptr, incol, colnum, "TZERO", status); + ffcpky(infptr, outfptr, incol, colnum, "TDISP", status); + ffcpky(infptr, outfptr, incol, colnum, "TLMIN", status); + ffcpky(infptr, outfptr, incol, colnum, "TLMAX", status); + ffcpky(infptr, outfptr, incol, colnum, "TDIM", status); + + /* WCS keywords */ + ffcpky(infptr, outfptr, incol, colnum, "TCTYP", status); + ffcpky(infptr, outfptr, incol, colnum, "TCUNI", status); + ffcpky(infptr, outfptr, incol, colnum, "TCRVL", status); + ffcpky(infptr, outfptr, incol, colnum, "TCRPX", status); + ffcpky(infptr, outfptr, incol, colnum, "TCDLT", status); + ffcpky(infptr, outfptr, incol, colnum, "TCROT", status); + + if (inHduType == ASCII_TBL && outHduType == BINARY_TBL) + { + /* binary tables only have TNULLn keyword for integer columns */ + if (typecode == TLONG || typecode == TSHORT) + { + /* check if null string is defined; replace with integer */ + ffkeyn("TNULL", incol, keyname, &tstatus); + if (ffgkys(infptr, keyname, ttype, 0, &tstatus) <= 0) + { + ffkeyn("TNULL", colnum, keyname, &tstatus); + if (typecode == TLONG) + ffpkyj(outfptr, keyname, -9999999L, "Null value", status); + else + ffpkyj(outfptr, keyname, -32768L, "Null value", status); + } + } + } + else + { + ffcpky(infptr, outfptr, incol, colnum, "TNULL", status); + } + + /* rescan header to recognize the new keywords */ + if (ffrdef(outfptr, status) ) + return(*status); + } + else + { + colnum = outcol; + /* get the datatype and vector repeat length of the output column */ + ffgtcl(outfptr, outcol, &otypecode, &orepeat, &owidth, status); + + if (orepeat != repeat) { + ffpmsg("Input and output vector columns must have same length (ffcpcl)"); + return(*status = BAD_TFORM); + } + } + + ffgkyj(infptr, "NAXIS2", &nrows, 0, status); /* no. of input rows */ + ffgkyj(outfptr, "NAXIS2", &outrows, 0, status); /* no. of output rows */ + nrows = minvalue(nrows, outrows); + + if (typecode == TBIT) + repeat = (repeat + 7) / 8; /* convert from bits to bytes */ + else if (typecode == TSTRING && inHduType == BINARY_TBL) + repeat = repeat / width; /* convert from chars to unit strings */ + + /* get optimum number of rows to copy at one time */ + ffgrsz(infptr, &inloop, status); + ffgrsz(outfptr, &outloop, status); + + /* adjust optimum number, since 2 tables are open at once */ + maxloop = minvalue(inloop, outloop); /* smallest of the 2 tables */ + maxloop = maxvalue(1, maxloop / 2); /* at least 1 row */ + maxloop = minvalue(maxloop, nrows); /* max = nrows to be copied */ + maxloop *= repeat; /* mult by no of elements in a row */ + + /* allocate memory for arrays */ + if (typecode == TLOGICAL) + { + lvalues = (char *) calloc(maxloop, sizeof(char) ); + if (!lvalues) + { + ffpmsg + ("malloc failed to get memory for logicals (ffcpcl)"); + return(*status = ARRAY_TOO_BIG); + } + } + else if (typecode == TSTRING) + { + /* allocate array of pointers */ + strarray = (char **) calloc(maxloop, sizeof(strarray)); + + /* allocate space for each string */ + for (ii = 0; ii < maxloop; ii++) + strarray[ii] = (char *) calloc(width+1, sizeof(char)); + } + else if (typecode == TCOMPLEX) + { + fvalues = (float *) calloc(maxloop * 2, sizeof(float) ); + if (!fvalues) + { + ffpmsg + ("malloc failed to get memory for complex (ffcpcl)"); + return(*status = ARRAY_TOO_BIG); + } + fnull = 0.; + } + else if (typecode == TDBLCOMPLEX) + { + dvalues = (double *) calloc(maxloop * 2, sizeof(double) ); + if (!dvalues) + { + ffpmsg + ("malloc failed to get memory for dbl complex (ffcpcl)"); + return(*status = ARRAY_TOO_BIG); + } + dnull = 0.; + } + else /* numerical datatype; read them all as doubles */ + { + dvalues = (double *) calloc(maxloop, sizeof(double) ); + if (!dvalues) + { + ffpmsg + ("malloc failed to get memory for doubles (ffcpcl)"); + return(*status = ARRAY_TOO_BIG); + } + dnull = -9.99991999E31; /* use an unlikely value for nulls */ + } + + npixels = nrows * repeat; /* total no. of pixels to copy */ + ntodo = minvalue(npixels, maxloop); /* no. to copy per iteration */ + ndone = 0; /* total no. of pixels that have been copied */ + + while (ntodo) /* iterate through the table */ + { + firstrow = ndone / repeat + 1; + firstelem = ndone - ((firstrow - 1) * repeat) + 1; + + /* read from input table */ + if (typecode == TLOGICAL) + ffgcl(infptr, incol, firstrow, firstelem, ntodo, + lvalues, status); + else if (typecode == TSTRING) + ffgcvs(infptr, incol, firstrow, firstelem, ntodo, + nulstr, strarray, &anynull, status); + + else if (typecode == TCOMPLEX) + ffgcvc(infptr, incol, firstrow, firstelem, ntodo, fnull, + fvalues, &anynull, status); + + else if (typecode == TDBLCOMPLEX) + ffgcvm(infptr, incol, firstrow, firstelem, ntodo, dnull, + dvalues, &anynull, status); + + else /* all numerical types */ + ffgcvd(infptr, incol, firstrow, firstelem, ntodo, dnull, + dvalues, &anynull, status); + + if (*status > 0) + { + ffpmsg("Error reading input copy of column (ffcpcl)"); + break; + } + + /* write to output table */ + if (typecode == TLOGICAL) + { + nullflag = 2; + + ffpcnl(outfptr, colnum, firstrow, firstelem, ntodo, + lvalues, nullflag, status); + + } + + else if (typecode == TSTRING) + { + if (anynull) + ffpcns(outfptr, colnum, firstrow, firstelem, ntodo, + strarray, nulstr, status); + else + ffpcls(outfptr, colnum, firstrow, firstelem, ntodo, + strarray, status); + } + + else if (typecode == TCOMPLEX) + { /* doesn't support writing nulls */ + ffpclc(outfptr, colnum, firstrow, firstelem, ntodo, + fvalues, status); + } + + else if (typecode == TDBLCOMPLEX) + { /* doesn't support writing nulls */ + ffpclm(outfptr, colnum, firstrow, firstelem, ntodo, + dvalues, status); + } + + else /* all other numerical types */ + { + if (anynull) + ffpcnd(outfptr, colnum, firstrow, firstelem, ntodo, + dvalues, dnull, status); + else + ffpcld(outfptr, colnum, firstrow, firstelem, ntodo, + dvalues, status); + } + + if (*status > 0) + { + ffpmsg("Error writing output copy of column (ffcpcl)"); + break; + } + + npixels -= ntodo; + ndone += ntodo; + ntodo = minvalue(npixels, maxloop); + } + + /* free the previously allocated memory */ + if (typecode == TLOGICAL) + { + free(lvalues); + } + else if (typecode == TSTRING) + { + for (ii = 0; ii < maxloop; ii++) + free(strarray[ii]); + + free(strarray); + } + else + { + free(dvalues); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffccls(fitsfile *infptr, /* I - FITS file pointer to input file */ + fitsfile *outfptr, /* I - FITS file pointer to output file */ + int incol, /* I - number of first input column */ + int outcol, /* I - number for first output column */ + int ncols, /* I - number of columns to copy from input to output */ + int create_col, /* I - create new col if TRUE, else overwrite */ + int *status) /* IO - error status */ +/* + copy multiple columns from infptr and insert them in the outfptr + table. Optimized for multiple-column case since it only expands the + output file once using fits_insert_cols() instead of calling + fits_insert_col() multiple times. +*/ +{ + int tstatus, colnum, typecode, otypecode, anynull; + int inHduType, outHduType; + long tfields, repeat, orepeat, width, owidth, nrows, outrows; + long inloop, outloop, maxloop, ndone, ntodo, npixels; + long firstrow, firstelem, ii; + char keyname[FLEN_KEYWORD], ttype[FLEN_VALUE], tform[FLEN_VALUE]; + char ttype_comm[FLEN_COMMENT],tform_comm[FLEN_COMMENT]; + char *lvalues = 0, nullflag, **strarray = 0; + char nulstr[] = {'\5', '\0'}; /* unique null string value */ + double dnull = 0.l, *dvalues = 0; + float fnull = 0., *fvalues = 0; + int typecodes[1000]; + char *ttypes[1000], *tforms[1000], keyarr[1001][FLEN_CARD]; + int ikey = 0; + int icol, incol1, outcol1; + + if (*status > 0) + return(*status); + + if (infptr->HDUposition != (infptr->Fptr)->curhdu) + { + ffmahd(infptr, (infptr->HDUposition) + 1, NULL, status); + } + else if ((infptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(infptr, status); /* rescan header */ + inHduType = (infptr->Fptr)->hdutype; + + if (outfptr->HDUposition != (outfptr->Fptr)->curhdu) + { + ffmahd(outfptr, (outfptr->HDUposition) + 1, NULL, status); + } + else if ((outfptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(outfptr, status); /* rescan header */ + outHduType = (outfptr->Fptr)->hdutype; + + if (*status > 0) + return(*status); + + if (inHduType == IMAGE_HDU || outHduType == IMAGE_HDU) + { + ffpmsg + ("Can not copy columns to or from IMAGE HDUs (ffccls)"); + return(*status = NOT_TABLE); + } + + if ( (inHduType == BINARY_TBL && outHduType == ASCII_TBL) || + (inHduType == ASCII_TBL && outHduType == BINARY_TBL) ) + { + ffpmsg + ("Copying between Binary and ASCII tables is not supported (ffccls)"); + return(*status = NOT_BTABLE); + } + + /* Do not allow copying multiple columns in the same HDU because the + permutations of possible overlapping copies is mind-bending */ + if ((infptr->Fptr == outfptr->Fptr) + && (infptr->HDUposition == outfptr->HDUposition)) + { + ffpmsg + ("Copying multiple columns in same HDU is not supported (ffccls)"); + return(*status = NOT_BTABLE); + } + + /* Retrieve the number of columns in output file */ + tstatus=0; + if (ffgkyj(outfptr, "TFIELDS", &tfields, 0, &tstatus)) + { + ffpmsg + ("Could not read TFIELDS keyword in output table (ffccls)"); + return(*status = NO_TFIELDS); + } + + colnum = minvalue((int) tfields + 1, outcol); /* output col. number */ + + /* Collect data about input column (type, repeat, etc) */ + for (incol1 = incol, outcol1 = colnum, icol = 0; + icol < ncols; + icol++, incol1++, outcol1++) + { + ffgtcl(infptr, incol1, &typecode, &repeat, &width, status); + + if (typecode < 0) + { + ffpmsg("Variable-length columns are not supported (ffccls)"); + return(*status = BAD_TFORM); + } + + typecodes[icol] = typecode; + + tstatus = 0; + ffkeyn("TTYPE", incol1, keyname, &tstatus); + ffgkys(infptr, keyname, ttype, ttype_comm, &tstatus); + + ffkeyn("TFORM", incol1, keyname, &tstatus); + + if (ffgkys(infptr, keyname, tform, tform_comm, &tstatus) ) + { + ffpmsg + ("Could not find TTYPE and TFORM keywords in input table (ffccls)"); + return(*status = NO_TFORM); + } + + /* If creating columns, we need to save these values */ + if ( create_col ) { + tforms[icol] = keyarr[ikey++]; + ttypes[icol] = keyarr[ikey++]; + + strcpy(tforms[icol], tform); + strcpy(ttypes[icol], ttype); + } else { + /* If not creating columns, then check the datatype and vector + repeat length of the output column */ + ffgtcl(outfptr, outcol1, &otypecode, &orepeat, &owidth, status); + + if (orepeat != repeat) { + ffpmsg("Input and output vector columns must have same length (ffccls)"); + return(*status = BAD_TFORM); + } + } + } + + /* Insert columns into output file and copy all meta-data + keywords, if requested */ + if (create_col) + { + /* create the empty columns */ + if (fficls(outfptr, colnum, ncols, ttypes, tforms, status) > 0) + { + ffpmsg + ("Could not append new columns to output file (ffccls)"); + return(*status); + } + + /* Copy meta-data strings from input column to output */ + for (incol1 = incol, outcol1 = colnum, icol = 0; + icol < ncols; + icol++, incol1++, outcol1++) + { + /* copy the comment strings from the input file for TTYPE and TFORM */ + ffkeyn("TTYPE", incol1, keyname, status); + ffgkys(infptr, keyname, ttype, ttype_comm, status); + ffkeyn("TTYPE", outcol1, keyname, status); + ffmcom(outfptr, keyname, ttype_comm, status); + + ffkeyn("TFORM", incol1, keyname, status); + ffgkys(infptr, keyname, tform, tform_comm, status); + ffkeyn("TFORM", outcol1, keyname, status); + ffmcom(outfptr, keyname, tform_comm, status); + + /* copy other column-related keywords if they exist */ + + ffcpky(infptr, outfptr, incol1, outcol1, "TUNIT", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TSCAL", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TZERO", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TDISP", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TLMIN", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TLMAX", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TDIM", status); + + /* WCS keywords */ + ffcpky(infptr, outfptr, incol1, outcol1, "TCTYP", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TCUNI", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TCRVL", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TCRPX", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TCDLT", status); + ffcpky(infptr, outfptr, incol1, outcol1, "TCROT", status); + + ffcpky(infptr, outfptr, incol1, outcol1, "TNULL", status); + + } + + /* rescan header to recognize the new keywords */ + if (ffrdef(outfptr, status) ) + return(*status); + } + + /* Copy columns using standard ffcpcl(); do this in a loop because + the I/O-intensive column expanding is done */ + for (incol1 = incol, outcol1 = colnum, icol = 0; + icol < ncols; + icol++, incol1++, outcol1++) + { + ffcpcl(infptr, outfptr, incol1, outcol1, 0, status); + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffcprw(fitsfile *infptr, /* I - FITS file pointer to input file */ + fitsfile *outfptr, /* I - FITS file pointer to output file */ + LONGLONG firstrow, /* I - number of first row to copy (1 based) */ + LONGLONG nrows, /* I - number of rows to copy */ + int *status) /* IO - error status */ +/* + copy consecutive set of rows from infptr and append it in the outfptr table. +*/ +{ + LONGLONG innaxis1, innaxis2, outnaxis1, outnaxis2, ii, jj; + unsigned char *buffer; + + if (*status > 0) + return(*status); + + if (infptr->HDUposition != (infptr->Fptr)->curhdu) + { + ffmahd(infptr, (infptr->HDUposition) + 1, NULL, status); + } + else if ((infptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(infptr, status); /* rescan header */ + + if (outfptr->HDUposition != (outfptr->Fptr)->curhdu) + { + ffmahd(outfptr, (outfptr->HDUposition) + 1, NULL, status); + } + else if ((outfptr->Fptr)->datastart == DATA_UNDEFINED) + ffrdef(outfptr, status); /* rescan header */ + + if (*status > 0) + return(*status); + + if ((infptr->Fptr)->hdutype == IMAGE_HDU || (outfptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg + ("Can not copy rows to or from IMAGE HDUs (ffcprw)"); + return(*status = NOT_TABLE); + } + + if ( ((infptr->Fptr)->hdutype == BINARY_TBL && (outfptr->Fptr)->hdutype == ASCII_TBL) || + ((infptr->Fptr)->hdutype == ASCII_TBL && (outfptr->Fptr)->hdutype == BINARY_TBL) ) + { + ffpmsg + ("Copying rows between Binary and ASCII tables is not supported (ffcprw)"); + return(*status = NOT_BTABLE); + } + + ffgkyjj(infptr, "NAXIS1", &innaxis1, 0, status); /* width of input rows */ + ffgkyjj(infptr, "NAXIS2", &innaxis2, 0, status); /* no. of input rows */ + ffgkyjj(outfptr, "NAXIS1", &outnaxis1, 0, status); /* width of output rows */ + ffgkyjj(outfptr, "NAXIS2", &outnaxis2, 0, status); /* no. of output rows */ + + if (*status > 0) + return(*status); + + if (outnaxis1 > innaxis1) { + ffpmsg + ("Input and output tables do not have same width (ffcprw)"); + return(*status = BAD_ROW_WIDTH); + } + + if (firstrow + nrows - 1 > innaxis2) { + ffpmsg + ("Not enough rows in input table to copy (ffcprw)"); + return(*status = BAD_ROW_NUM); + } + + /* allocate buffer to hold 1 row of data */ + buffer = malloc( (size_t) innaxis1); + if (!buffer) { + ffpmsg + ("Unable to allocate memory (ffcprw)"); + return(*status = MEMORY_ALLOCATION); + } + + /* copy the rows, 1 at a time */ + jj = outnaxis2 + 1; + for (ii = firstrow; ii < firstrow + nrows; ii++) { + fits_read_tblbytes (infptr, ii, 1, innaxis1, buffer, status); + fits_write_tblbytes(outfptr, jj, 1, innaxis1, buffer, status); + jj++; + } + + outnaxis2 += nrows; + fits_update_key(outfptr, TLONGLONG, "NAXIS2", &outnaxis2, 0, status); + + free(buffer); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffcpky(fitsfile *infptr, /* I - FITS file pointer to input file */ + fitsfile *outfptr, /* I - FITS file pointer to output file */ + int incol, /* I - input index number */ + int outcol, /* I - output index number */ + char *rootname, /* I - root name of the keyword to be copied */ + int *status) /* IO - error status */ +/* + copy an indexed keyword from infptr to outfptr. +*/ +{ + int tstatus = 0; + char keyname[FLEN_KEYWORD]; + char value[FLEN_VALUE], comment[FLEN_COMMENT], card[FLEN_CARD]; + + ffkeyn(rootname, incol, keyname, &tstatus); + if (ffgkey(infptr, keyname, value, comment, &tstatus) <= 0) + { + ffkeyn(rootname, outcol, keyname, &tstatus); + ffmkky(keyname, value, comment, card, status); + ffprec(outfptr, card, status); + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffdcol(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - column to delete (1 = 1st) */ + int *status) /* IO - error status */ +/* + Delete a column from a table. +*/ +{ + int ii, tstatus; + LONGLONG firstbyte, size, ndelete, nbytes, naxis1, naxis2, firstcol, delbyte, freespace; + LONGLONG tbcol; + long nblock, nspace; + char keyname[FLEN_KEYWORD], comm[FLEN_COMMENT]; + tcolumn *colptr, *nextcol; + + if (*status > 0) + return(*status); + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + { + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + } + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + if ((fptr->Fptr)->hdutype == IMAGE_HDU) + { + ffpmsg + ("Can only delete column from TABLE or BINTABLE extension (ffdcol)"); + return(*status = NOT_TABLE); + } + + if (colnum < 1 || colnum > (fptr->Fptr)->tfield ) + return(*status = BAD_COL_NUM); + + colptr = (fptr->Fptr)->tableptr; + colptr += (colnum - 1); + firstcol = colptr->tbcol; /* starting byte position of the column */ + + /* use column width to determine how many bytes to delete in each row */ + if ((fptr->Fptr)->hdutype == ASCII_TBL) + { + delbyte = colptr->twidth; /* width of ASCII column */ + + if (colnum < (fptr->Fptr)->tfield) /* check for space between next column */ + { + nextcol = colptr + 1; + nspace = (long) ((nextcol->tbcol) - (colptr->tbcol) - delbyte); + if (nspace > 0) + delbyte++; + } + else if (colnum > 1) /* check for space between last 2 columns */ + { + nextcol = colptr - 1; + nspace = (long) ((colptr->tbcol) - (nextcol->tbcol) - (nextcol->twidth)); + if (nspace > 0) + { + delbyte++; + firstcol--; /* delete the leading space */ + } + } + } + else /* a binary table */ + { + if (colnum < (fptr->Fptr)->tfield) + { + nextcol = colptr + 1; + delbyte = (nextcol->tbcol) - (colptr->tbcol); + } + else + { + delbyte = ((fptr->Fptr)->rowlength) - (colptr->tbcol); + } + } + + naxis1 = (fptr->Fptr)->rowlength; /* current width of the table */ + naxis2 = (fptr->Fptr)->numrows; + + /* current size of table */ + size = (fptr->Fptr)->heapstart + (fptr->Fptr)->heapsize; + freespace = ((LONGLONG)delbyte * naxis2) + ((size + 2879) / 2880) * 2880 - size; + nblock = (long) (freespace / 2880); /* number of empty blocks to delete */ + + ffcdel(fptr, naxis1, naxis2, delbyte, firstcol, status); /* delete col */ + + /* absolute heap position */ + firstbyte = (fptr->Fptr)->datastart + (fptr->Fptr)->heapstart; + ndelete = (LONGLONG)delbyte * naxis2; /* size of shift */ + + /* shift heap up (if it exists) */ + if ((fptr->Fptr)->heapsize > 0) + { + nbytes = (fptr->Fptr)->heapsize; /* no. of bytes to shift up */ + + if (ffshft(fptr, firstbyte, nbytes, -ndelete, status) > 0) /* mv heap */ + return(*status); + } + + /* delete the empty blocks at the end of the HDU */ + if (nblock > 0) + ffdblk(fptr, nblock, status); + + /* update the heap starting address */ + (fptr->Fptr)->heapstart -= ndelete; + + /* update the THEAP keyword if it exists */ + tstatus = 0; + ffmkyj(fptr, "THEAP", (long)(fptr->Fptr)->heapstart, "&", &tstatus); + + if ((fptr->Fptr)->hdutype == ASCII_TBL) + { + /* adjust the TBCOL values of the remaining columns */ + for (ii = 1; ii <= (fptr->Fptr)->tfield; ii++) + { + ffkeyn("TBCOL", ii, keyname, status); + ffgkyjj(fptr, keyname, &tbcol, comm, status); + if (tbcol > firstcol) + { + tbcol = tbcol - delbyte; + ffmkyj(fptr, keyname, tbcol, "&", status); + } + } + } + + /* update the mandatory keywords */ + ffmkyj(fptr, "TFIELDS", ((fptr->Fptr)->tfield) - 1, "&", status); + ffmkyj(fptr, "NAXIS1", naxis1 - delbyte, "&", status); + /* + delete the index keywords starting with 'T' associated with the + deleted column and subtract 1 from index of all higher keywords + */ + ffkshf(fptr, colnum, (fptr->Fptr)->tfield, -1, status); + + ffrdef(fptr, status); /* initialize the new table structure */ + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffcins(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG naxis1, /* I - width of the table, in bytes */ + LONGLONG naxis2, /* I - number of rows in the table */ + LONGLONG ninsert, /* I - number of bytes to insert in each row */ + LONGLONG bytepos, /* I - rel. position in row to insert bytes */ + int *status) /* IO - error status */ +/* + Insert 'ninsert' bytes into each row of the table at position 'bytepos'. +*/ +{ + unsigned char buffer[10000], cfill; + LONGLONG newlen, fbyte, nbytes, irow, nseg, ii; + + if (*status > 0) + return(*status); + + if (naxis2 == 0) + return(*status); /* just return if there are 0 rows in the table */ + + /* select appropriate fill value */ + if ((fptr->Fptr)->hdutype == ASCII_TBL) + cfill = 32; /* ASCII tables use blank fill */ + else + cfill = 0; /* primary array and binary tables use zero fill */ + + newlen = naxis1 + ninsert; + + if (newlen <= 10000) + { + /******************************************************************* + CASE #1: optimal case where whole new row fits in the work buffer + *******************************************************************/ + + for (ii = 0; ii < ninsert; ii++) + buffer[ii] = cfill; /* initialize buffer with fill value */ + + /* first move the trailing bytes (if any) in the last row */ + fbyte = bytepos + 1; + nbytes = naxis1 - bytepos; + ffgtbb(fptr, naxis2, fbyte, nbytes, &buffer[ninsert], status); + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + /* write the row (with leading fill bytes) in the new place */ + nbytes += ninsert; + ffptbb(fptr, naxis2, fbyte, nbytes, buffer, status); + (fptr->Fptr)->rowlength = naxis1; /* reset to orig. value */ + + /* now move the rest of the rows */ + for (irow = naxis2 - 1; irow > 0; irow--) + { + /* read the row to be shifted (work backwards thru the table) */ + ffgtbb(fptr, irow, fbyte, naxis1, &buffer[ninsert], status); + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + /* write the row (with the leading fill bytes) in the new place */ + ffptbb(fptr, irow, fbyte, newlen, buffer, status); + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + } + } + else + { + /***************************************************************** + CASE #2: whole row doesn't fit in work buffer; move row in pieces + ****************************************************************** + first copy the data, then go back and write fill into the new column + start by copying the trailing bytes (if any) in the last row. */ + + nbytes = naxis1 - bytepos; + nseg = (nbytes + 9999) / 10000; + fbyte = (nseg - 1) * 10000 + bytepos + 1; + nbytes = naxis1 - fbyte + 1; + + for (ii = 0; ii < nseg; ii++) + { + ffgtbb(fptr, naxis2, fbyte, nbytes, buffer, status); + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + ffptbb(fptr, naxis2, fbyte + ninsert, nbytes, buffer, status); + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + + fbyte -= 10000; + nbytes = 10000; + } + + /* now move the rest of the rows */ + nseg = (naxis1 + 9999) / 10000; + for (irow = naxis2 - 1; irow > 0; irow--) + { + fbyte = (nseg - 1) * 10000 + bytepos + 1; + nbytes = naxis1 - (nseg - 1) * 10000; + for (ii = 0; ii < nseg; ii++) + { + /* read the row to be shifted (work backwards thru the table) */ + ffgtbb(fptr, irow, fbyte, nbytes, buffer, status); + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + /* write the row in the new place */ + ffptbb(fptr, irow, fbyte + ninsert, nbytes, buffer, status); + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + + fbyte -= 10000; + nbytes = 10000; + } + } + + /* now write the fill values into the new column */ + nbytes = minvalue(ninsert, 10000); + memset(buffer, cfill, (size_t) nbytes); /* initialize with fill value */ + + nseg = (ninsert + 9999) / 10000; + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + for (irow = 1; irow <= naxis2; irow++) + { + fbyte = bytepos + 1; + nbytes = ninsert - ((nseg - 1) * 10000); + for (ii = 0; ii < nseg; ii++) + { + ffptbb(fptr, irow, fbyte, nbytes, buffer, status); + fbyte += nbytes; + nbytes = 10000; + } + } + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffcdel(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG naxis1, /* I - width of the table, in bytes */ + LONGLONG naxis2, /* I - number of rows in the table */ + LONGLONG ndelete, /* I - number of bytes to delete in each row */ + LONGLONG bytepos, /* I - rel. position in row to delete bytes */ + int *status) /* IO - error status */ +/* + delete 'ndelete' bytes from each row of the table at position 'bytepos'. */ +{ + unsigned char buffer[10000]; + LONGLONG i1, i2, ii, irow, nseg; + LONGLONG newlen, remain, nbytes; + + if (*status > 0) + return(*status); + + if (naxis2 == 0) + return(*status); /* just return if there are 0 rows in the table */ + + newlen = naxis1 - ndelete; + + if (newlen <= 10000) + { + /******************************************************************* + CASE #1: optimal case where whole new row fits in the work buffer + *******************************************************************/ + i1 = bytepos + 1; + i2 = i1 + ndelete; + for (irow = 1; irow < naxis2; irow++) + { + ffgtbb(fptr, irow, i2, newlen, buffer, status); /* read row */ + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + ffptbb(fptr, irow, i1, newlen, buffer, status); /* write row */ + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + } + + /* now do the last row */ + remain = naxis1 - (bytepos + ndelete); + + if (remain > 0) + { + ffgtbb(fptr, naxis2, i2, remain, buffer, status); /* read row */ + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + ffptbb(fptr, naxis2, i1, remain, buffer, status); /* write row */ + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + } + } + else + { + /***************************************************************** + CASE #2: whole row doesn't fit in work buffer; move row in pieces + ******************************************************************/ + + nseg = (newlen + 9999) / 10000; + for (irow = 1; irow < naxis2; irow++) + { + i1 = bytepos + 1; + i2 = i1 + ndelete; + + nbytes = newlen - (nseg - 1) * 10000; + for (ii = 0; ii < nseg; ii++) + { + ffgtbb(fptr, irow, i2, nbytes, buffer, status); /* read bytes */ + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + ffptbb(fptr, irow, i1, nbytes, buffer, status); /* rewrite bytes */ + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + + i1 += nbytes; + i2 += nbytes; + nbytes = 10000; + } + } + + /* now do the last row */ + remain = naxis1 - (bytepos + ndelete); + + if (remain > 0) + { + nseg = (remain + 9999) / 10000; + i1 = bytepos + 1; + i2 = i1 + ndelete; + nbytes = remain - (nseg - 1) * 10000; + for (ii = 0; ii < nseg; ii++) + { + ffgtbb(fptr, naxis2, i2, nbytes, buffer, status); + (fptr->Fptr)->rowlength = newlen; /* new row length */ + + ffptbb(fptr, naxis2, i1, nbytes, buffer, status); /* write row */ + (fptr->Fptr)->rowlength = naxis1; /* reset to orig value */ + + i1 += nbytes; + i2 += nbytes; + nbytes = 10000; + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffkshf(fitsfile *fptr, /* I - FITS file pointer */ + int colmin, /* I - starting col. to be incremented; 1 = 1st */ + int colmax, /* I - last column to be incremented */ + int incre, /* I - shift index number by this amount */ + int *status) /* IO - error status */ +/* + shift the index value on any existing column keywords + This routine will modify the name of any keyword that begins with 'T' + and has an index number in the range COLMIN - COLMAX, inclusive. + + if incre is positive, then the index values will be incremented. + if incre is negative, then the kewords with index = COLMIN + will be deleted and the index of higher numbered keywords will + be decremented. +*/ +{ + int nkeys, nmore, nrec, tstatus, i1; + long ivalue; + char rec[FLEN_CARD], q[FLEN_KEYWORD], newkey[FLEN_KEYWORD]; + + ffghsp(fptr, &nkeys, &nmore, status); /* get number of keywords */ + + /* go thru header starting with the 9th keyword looking for 'TxxxxNNN' */ + + for (nrec = 9; nrec <= nkeys; nrec++) + { + ffgrec(fptr, nrec, rec, status); + + if (rec[0] == 'T') + { + i1 = 0; + strncpy(q, &rec[1], 4); + if (!strncmp(q, "BCOL", 4) || !strncmp(q, "FORM", 4) || + !strncmp(q, "TYPE", 4) || !strncmp(q, "SCAL", 4) || + !strncmp(q, "UNIT", 4) || !strncmp(q, "NULL", 4) || + !strncmp(q, "ZERO", 4) || !strncmp(q, "DISP", 4) || + !strncmp(q, "LMIN", 4) || !strncmp(q, "LMAX", 4) || + !strncmp(q, "DMIN", 4) || !strncmp(q, "DMAX", 4) || + !strncmp(q, "CTYP", 4) || !strncmp(q, "CRPX", 4) || + !strncmp(q, "CRVL", 4) || !strncmp(q, "CDLT", 4) || + !strncmp(q, "CROT", 4) || !strncmp(q, "CUNI", 4) ) + i1 = 5; + else if (!strncmp(rec, "TDIM", 4) ) + i1 = 4; + + if (i1) + { + /* try reading the index number suffix */ + q[0] = '\0'; + strncat(q, &rec[i1], 8 - i1); + + tstatus = 0; + ffc2ii(q, &ivalue, &tstatus); + + if (tstatus == 0 && ivalue >= colmin && ivalue <= colmax) + { + if (incre <= 0 && ivalue == colmin) + { + ffdrec(fptr, nrec, status); /* delete keyword */ + nkeys = nkeys - 1; + nrec = nrec - 1; + } + else + { + ivalue = ivalue + incre; + q[0] = '\0'; + strncat(q, rec, i1); + + ffkeyn(q, ivalue, newkey, status); + strncpy(rec, " ", 8); /* erase old keyword name */ + i1 = strlen(newkey); + strncpy(rec, newkey, i1); /* overwrite new keyword name */ + ffmrec(fptr, nrec, rec, status); /* modify the record */ + } + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffshft(fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG firstbyte, /* I - position of first byte in block to shift */ + LONGLONG nbytes, /* I - size of block of bytes to shift */ + LONGLONG nshift, /* I - size of shift in bytes (+ or -) */ + int *status) /* IO - error status */ +/* + Shift block of bytes by nshift bytes (positive or negative). + A positive nshift value moves the block down further in the file, while a + negative value shifts the block towards the beginning of the file. +*/ +{ +#define shftbuffsize 100000 + long ntomov; + LONGLONG ptr, ntodo; + char buffer[shftbuffsize]; + + if (*status > 0) + return(*status); + + ntodo = nbytes; /* total number of bytes to shift */ + + if (nshift > 0) + /* start at the end of the block and work backwards */ + ptr = firstbyte + nbytes; + else + /* start at the beginning of the block working forwards */ + ptr = firstbyte; + + while (ntodo) + { + /* number of bytes to move at one time */ + ntomov = (long) (minvalue(ntodo, shftbuffsize)); + + if (nshift > 0) /* if moving block down ... */ + ptr -= ntomov; + + /* move to position and read the bytes to be moved */ + + ffmbyt(fptr, ptr, REPORT_EOF, status); + ffgbyt(fptr, ntomov, buffer, status); + + /* move by shift amount and write the bytes */ + ffmbyt(fptr, ptr + nshift, IGNORE_EOF, status); + if (ffpbyt(fptr, ntomov, buffer, status) > 0) + { + ffpmsg("Error while shifting block (ffshft)"); + return(*status); + } + + ntodo -= ntomov; + if (nshift < 0) /* if moving block up ... */ + ptr += ntomov; + } + + /* now overwrite the old data with fill */ + if ((fptr->Fptr)->hdutype == ASCII_TBL) + memset(buffer, 32, shftbuffsize); /* fill ASCII tables with spaces */ + else + memset(buffer, 0, shftbuffsize); /* fill other HDUs with zeros */ + + + if (nshift < 0) + { + ntodo = -nshift; + /* point to the end of the shifted block */ + ptr = firstbyte + nbytes + nshift; + } + else + { + ntodo = nshift; + /* point to original beginning of the block */ + ptr = firstbyte; + } + + ffmbyt(fptr, ptr, REPORT_EOF, status); + + while (ntodo) + { + ntomov = (long) (minvalue(ntodo, shftbuffsize)); + ffpbyt(fptr, ntomov, buffer, status); + ntodo -= ntomov; + } + return(*status); +} diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/eval_defs.h b/testbed/astropy__astropy/cextern/cfitsio/lib/eval_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..09c066b1da506e739410d8f91e635733b693bf9f --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/eval_defs.h @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#if defined(__sgi) || defined(__hpux) +#include +#endif +#ifdef sparc +#include +#endif +#include "fitsio2.h" + +#define MAXDIMS 5 +#define MAXSUBS 10 +#define MAXVARNAME 80 +#define CONST_OP -1000 +#define pERROR -1 +#define MAX_STRLEN 256 +#define MAX_STRLEN_S "255" + +#ifndef FFBISON +#include "eval_tab.h" +#endif + + +typedef struct { + char name[MAXVARNAME+1]; + int type; + long nelem; + int naxis; + long naxes[MAXDIMS]; + char *undef; + void *data; + } DataInfo; + +typedef struct { + long nelem; + int naxis; + long naxes[MAXDIMS]; + char *undef; + union { + double dbl; + long lng; + char log; + char str[MAX_STRLEN]; + double *dblptr; + long *lngptr; + char *logptr; + char **strptr; + void *ptr; + } data; + } lval; + +typedef struct Node { + int operation; + void (*DoOp)(struct Node *this); + int nSubNodes; + int SubNodes[MAXSUBS]; + int type; + lval value; + } Node; + +typedef struct { + fitsfile *def_fptr; + int (*getData)( char *dataName, void *dataValue ); + int (*loadData)( int varNum, long fRow, long nRows, + void *data, char *undef ); + + int compressed; + int timeCol; + int parCol; + int valCol; + + char *expr; + int index; + int is_eobuf; + + Node *Nodes; + int nNodes; + int nNodesAlloc; + int resultNode; + + long firstRow; + long nRows; + + int nCols; + iteratorCol *colData; + DataInfo *varData; + PixelFilter *pixFilter; + + long firstDataRow; + long nDataRows; + long totalRows; + + int datatype; + int hdutype; + + int status; + } ParseData; + +typedef enum { + rnd_fct = 1001, + sum_fct, + nelem_fct, + sin_fct, + cos_fct, + tan_fct, + asin_fct, + acos_fct, + atan_fct, + sinh_fct, + cosh_fct, + tanh_fct, + exp_fct, + log_fct, + log10_fct, + sqrt_fct, + abs_fct, + atan2_fct, + ceil_fct, + floor_fct, + round_fct, + min1_fct, + min2_fct, + max1_fct, + max2_fct, + near_fct, + circle_fct, + box_fct, + elps_fct, + isnull_fct, + defnull_fct, + gtifilt_fct, + regfilt_fct, + ifthenelse_fct, + row_fct, + null_fct, + median_fct, + average_fct, + stddev_fct, + nonnull_fct, + angsep_fct, + gasrnd_fct, + poirnd_fct, + strmid_fct, + strpos_fct + } funcOp; + +extern ParseData gParse; + +#ifdef __cplusplus +extern "C" { +#endif + + int ffparse(void); + int fflex(void); + void ffrestart(FILE*); + + void Evaluate_Parser( long firstRow, long nRows ); + +#ifdef __cplusplus + } +#endif diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/eval_tab.h b/testbed/astropy__astropy/cextern/cfitsio/lib/eval_tab.h new file mode 100644 index 0000000000000000000000000000000000000000..bd8cdaccc454d2f3dc63c7a70765d5fe3001dd79 --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/eval_tab.h @@ -0,0 +1,138 @@ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef FFTOKENTYPE +# define FFTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum fftokentype { + BOOLEAN = 258, + LONG = 259, + DOUBLE = 260, + STRING = 261, + BITSTR = 262, + FUNCTION = 263, + BFUNCTION = 264, + IFUNCTION = 265, + GTIFILTER = 266, + REGFILTER = 267, + COLUMN = 268, + BCOLUMN = 269, + SCOLUMN = 270, + BITCOL = 271, + ROWREF = 272, + NULLREF = 273, + SNULLREF = 274, + OR = 275, + AND = 276, + NE = 277, + EQ = 278, + GTE = 279, + LTE = 280, + LT = 281, + GT = 282, + POWER = 283, + NOT = 284, + FLTCAST = 285, + INTCAST = 286, + UMINUS = 287, + DIFF = 288, + ACCUM = 289 + }; +#endif +/* Tokens. */ +#define BOOLEAN 258 +#define LONG 259 +#define DOUBLE 260 +#define STRING 261 +#define BITSTR 262 +#define FUNCTION 263 +#define BFUNCTION 264 +#define IFUNCTION 265 +#define GTIFILTER 266 +#define REGFILTER 267 +#define COLUMN 268 +#define BCOLUMN 269 +#define SCOLUMN 270 +#define BITCOL 271 +#define ROWREF 272 +#define NULLREF 273 +#define SNULLREF 274 +#define OR 275 +#define AND 276 +#define NE 277 +#define EQ 278 +#define GTE 279 +#define LTE 280 +#define LT 281 +#define GT 282 +#define POWER 283 +#define NOT 284 +#define FLTCAST 285 +#define INTCAST 286 +#define UMINUS 287 +#define DIFF 288 +#define ACCUM 289 + + + + +#if ! defined FFSTYPE && ! defined FFSTYPE_IS_DECLARED +typedef union FFSTYPE +{ + +/* Line 1676 of yacc.c */ +#line 192 "eval.y" + + int Node; /* Index of Node */ + double dbl; /* real value */ + long lng; /* integer value */ + char log; /* logical value */ + char str[MAX_STRLEN]; /* string value */ + + + +/* Line 1676 of yacc.c */ +#line 130 "y.tab.h" +} FFSTYPE; +# define FFSTYPE_IS_TRIVIAL 1 +# define ffstype FFSTYPE /* obsolescent; will be withdrawn */ +# define FFSTYPE_IS_DECLARED 1 +#endif + +extern FFSTYPE fflval; + + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/fits_hcompress.c b/testbed/astropy__astropy/cextern/cfitsio/lib/fits_hcompress.c new file mode 100644 index 0000000000000000000000000000000000000000..fb9d6e58f97ad3301aa9f573d44f78b928894e7b --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/fits_hcompress.c @@ -0,0 +1,1859 @@ +/* ######################################################################### +These routines to apply the H-compress compression algorithm to a 2-D Fits +image were written by R. White at the STScI and were obtained from the STScI at +http://www.stsci.edu/software/hcompress.html + +This source file is a concatination of the following sources files in the +original distribution + htrans.c + digitize.c + encode.c + qwrite.c + doencode.c + bit_output.c + qtree_encode.c + +The following modifications have been made to the original code: + + - commented out redundant "include" statements + - added the noutchar global variable + - changed all the 'extern' declarations to 'static', since all the routines are in + the same source file + - changed the first parameter in encode (and in lower level routines from a file stream + to a char array + - modifid the encode routine to return the size of the compressed array of bytes + - changed calls to printf and perror to call the CFITSIO ffpmsg routine + - modified the mywrite routine, and lower level byte writing routines, to copy + the output bytes to a char array, instead of writing them to a file stream + - replace "exit" statements with "return" statements + - changed the function declarations to the more modern ANSI C style + + ############################################################################ */ + +#include +#include +#include +#include +#include "fitsio2.h" + +static long noutchar; +static long noutmax; + +static int htrans(int a[],int nx,int ny); +static void digitize(int a[], int nx, int ny, int scale); +static int encode(char *outfile, long *nlen, int a[], int nx, int ny, int scale); +static void shuffle(int a[], int n, int n2, int tmp[]); + +static int htrans64(LONGLONG a[],int nx,int ny); +static void digitize64(LONGLONG a[], int nx, int ny, int scale); +static int encode64(char *outfile, long *nlen, LONGLONG a[], int nx, int ny, int scale); +static void shuffle64(LONGLONG a[], int n, int n2, LONGLONG tmp[]); + +static void writeint(char *outfile, int a); +static void writelonglong(char *outfile, LONGLONG a); +static int doencode(char *outfile, int a[], int nx, int ny, unsigned char nbitplanes[3]); +static int doencode64(char *outfile, LONGLONG a[], int nx, int ny, unsigned char nbitplanes[3]); +static int qwrite(char *file, char buffer[], int n); + +static int qtree_encode(char *outfile, int a[], int n, int nqx, int nqy, int nbitplanes); +static int qtree_encode64(char *outfile, LONGLONG a[], int n, int nqx, int nqy, int nbitplanes); +static void start_outputing_bits(void); +static void done_outputing_bits(char *outfile); +static void output_nbits(char *outfile, int bits, int n); + +static void qtree_onebit(int a[], int n, int nx, int ny, unsigned char b[], int bit); +static void qtree_onebit64(LONGLONG a[], int n, int nx, int ny, unsigned char b[], int bit); +static void qtree_reduce(unsigned char a[], int n, int nx, int ny, unsigned char b[]); +static int bufcopy(unsigned char a[], int n, unsigned char buffer[], int *b, int bmax); +static void write_bdirect(char *outfile, int a[], int n,int nqx, int nqy, unsigned char scratch[], int bit); +static void write_bdirect64(char *outfile, LONGLONG a[], int n,int nqx, int nqy, unsigned char scratch[], int bit); + +/* #define output_nybble(outfile,c) output_nbits(outfile,c,4) */ +static void output_nybble(char *outfile, int bits); +static void output_nnybble(char *outfile, int n, unsigned char array[]); + +#define output_huffman(outfile,c) output_nbits(outfile,code[c],ncode[c]) + +/* ---------------------------------------------------------------------- */ +int fits_hcompress(int *a, int ny, int nx, int scale, char *output, + long *nbytes, int *status) +{ + /* + compress the input image using the H-compress algorithm + + a - input image array + nx - size of X axis of image + ny - size of Y axis of image + scale - quantization scale factor. Larger values results in more (lossy) compression + scale = 0 does lossless compression + output - pre-allocated array to hold the output compressed stream of bytes + nbyts - input value = size of the output buffer; + returned value = size of the compressed byte stream, in bytes + + NOTE: the nx and ny dimensions as defined within this code are reversed from + the usual FITS notation. ny is the fastest varying dimension, which is + usually considered the X axis in the FITS image display + + */ + + int stat; + + if (*status > 0) return(*status); + + /* H-transform */ + stat = htrans(a, nx, ny); + if (stat) { + *status = stat; + return(*status); + } + + /* digitize */ + digitize(a, nx, ny, scale); + + /* encode and write to output array */ + + FFLOCK; + noutmax = *nbytes; /* input value is the allocated size of the array */ + *nbytes = 0; /* reset */ + + stat = encode(output, nbytes, a, nx, ny, scale); + FFUNLOCK; + + *status = stat; + return(*status); +} +/* ---------------------------------------------------------------------- */ +int fits_hcompress64(LONGLONG *a, int ny, int nx, int scale, char *output, + long *nbytes, int *status) +{ + /* + compress the input image using the H-compress algorithm + + a - input image array + nx - size of X axis of image + ny - size of Y axis of image + scale - quantization scale factor. Larger values results in more (lossy) compression + scale = 0 does lossless compression + output - pre-allocated array to hold the output compressed stream of bytes + nbyts - size of the compressed byte stream, in bytes + + NOTE: the nx and ny dimensions as defined within this code are reversed from + the usual FITS notation. ny is the fastest varying dimension, which is + usually considered the X axis in the FITS image display + + */ + + int stat; + + if (*status > 0) return(*status); + + /* H-transform */ + stat = htrans64(a, nx, ny); + if (stat) { + *status = stat; + return(*status); + } + + /* digitize */ + digitize64(a, nx, ny, scale); + + /* encode and write to output array */ + + FFLOCK; + noutmax = *nbytes; /* input value is the allocated size of the array */ + *nbytes = 0; /* reset */ + + stat = encode64(output, nbytes, a, nx, ny, scale); + FFUNLOCK; + + *status = stat; + return(*status); +} + + +/* Copyright (c) 1993 Association of Universities for Research + * in Astronomy. All rights reserved. Produced under National + * Aeronautics and Space Administration Contract No. NAS5-26555. + */ +/* htrans.c H-transform of NX x NY integer image + * + * Programmer: R. White Date: 11 May 1992 + */ + +/* ######################################################################### */ +static int htrans(int a[],int nx,int ny) +{ +int nmax, log2n, h0, hx, hy, hc, nxtop, nytop, i, j, k; +int oddx, oddy; +int shift, mask, mask2, prnd, prnd2, nrnd2; +int s10, s00; +int *tmp; + + /* + * log2n is log2 of max(nx,ny) rounded up to next power of 2 + */ + nmax = (nx>ny) ? nx : ny; + log2n = (int) (log((float) nmax)/log(2.0)+0.5); + if ( nmax > (1<> shift; + hx = (a[s10+1] + a[s10] - a[s00+1] - a[s00]) >> shift; + hy = (a[s10+1] - a[s10] + a[s00+1] - a[s00]) >> shift; + hc = (a[s10+1] - a[s10] - a[s00+1] + a[s00]) >> shift; + + /* + * Throw away the 2 bottom bits of h0, bottom bit of hx,hy. + * To get rounding to be same for positive and negative + * numbers, nrnd2 = prnd2 - 1. + */ + a[s10+1] = hc; + a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; + a[s00+1] = ( (hy>=0) ? (hy+prnd) : hy ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 2; + s10 += 2; + } + if (oddy) { + /* + * do last element in row if row length is odd + * s00+1, s10+1 are off edge + */ + h0 = (a[s10] + a[s00]) << (1-shift); + hx = (a[s10] - a[s00]) << (1-shift); + a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 1; + s10 += 1; + } + } + if (oddx) { + /* + * do last row if column length is odd + * s10, s10+1 are off edge + */ + s00 = i*ny; + for (j = 0; j=0) ? (hy+prnd) : hy ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 2; + } + if (oddy) { + /* + * do corner element if both row and column lengths are odd + * s00+1, s10, s10+1 are off edge + */ + h0 = a[s00] << (2-shift); + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + } + } + /* + * now shuffle in each dimension to group coefficients by order + */ + for (i = 0; i>1; + nytop = (nytop+1)>>1; + /* + * divisor doubles after first reduction + */ + shift = 1; + /* + * masks, rounding values double after each iteration + */ + mask = mask2; + prnd = prnd2; + mask2 = mask2 << 1; + prnd2 = prnd2 << 1; + nrnd2 = prnd2 - 1; + } + free(tmp); + return(0); +} +/* ######################################################################### */ + +static int htrans64(LONGLONG a[],int nx,int ny) +{ +int nmax, log2n, nxtop, nytop, i, j, k; +int oddx, oddy; +int shift; +int s10, s00; +LONGLONG h0, hx, hy, hc, prnd, prnd2, nrnd2, mask, mask2; +LONGLONG *tmp; + + /* + * log2n is log2 of max(nx,ny) rounded up to next power of 2 + */ + nmax = (nx>ny) ? nx : ny; + log2n = (int) (log((float) nmax)/log(2.0)+0.5); + if ( nmax > (1<> shift; + hx = (a[s10+1] + a[s10] - a[s00+1] - a[s00]) >> shift; + hy = (a[s10+1] - a[s10] + a[s00+1] - a[s00]) >> shift; + hc = (a[s10+1] - a[s10] - a[s00+1] + a[s00]) >> shift; + + /* + * Throw away the 2 bottom bits of h0, bottom bit of hx,hy. + * To get rounding to be same for positive and negative + * numbers, nrnd2 = prnd2 - 1. + */ + a[s10+1] = hc; + a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; + a[s00+1] = ( (hy>=0) ? (hy+prnd) : hy ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 2; + s10 += 2; + } + if (oddy) { + /* + * do last element in row if row length is odd + * s00+1, s10+1 are off edge + */ + h0 = (a[s10] + a[s00]) << (1-shift); + hx = (a[s10] - a[s00]) << (1-shift); + a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 1; + s10 += 1; + } + } + if (oddx) { + /* + * do last row if column length is odd + * s10, s10+1 are off edge + */ + s00 = i*ny; + for (j = 0; j=0) ? (hy+prnd) : hy ) & mask ; + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + s00 += 2; + } + if (oddy) { + /* + * do corner element if both row and column lengths are odd + * s00+1, s10, s10+1 are off edge + */ + h0 = a[s00] << (2-shift); + a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; + } + } + /* + * now shuffle in each dimension to group coefficients by order + */ + for (i = 0; i>1; + nytop = (nytop+1)>>1; + /* + * divisor doubles after first reduction + */ + shift = 1; + /* + * masks, rounding values double after each iteration + */ + mask = mask2; + prnd = prnd2; + mask2 = mask2 << 1; + prnd2 = prnd2 << 1; + nrnd2 = prnd2 - 1; + } + free(tmp); + return(0); +} + +/* ######################################################################### */ +static void +shuffle(int a[], int n, int n2, int tmp[]) +{ + +/* +int a[]; array to shuffle +int n; number of elements to shuffle +int n2; second dimension +int tmp[]; scratch storage +*/ + +int i; +int *p1, *p2, *pt; + + /* + * copy odd elements to tmp + */ + pt = tmp; + p1 = &a[n2]; + for (i=1; i < n; i += 2) { + *pt = *p1; + pt += 1; + p1 += (n2+n2); + } + /* + * compress even elements into first half of A + */ + p1 = &a[n2]; + p2 = &a[n2+n2]; + for (i=2; i0) ? (*p+d) : (*p-d))/scale; +} + +/* ######################################################################### */ +static void +digitize64(LONGLONG a[], int nx, int ny, int scale) +{ +LONGLONG d, *p, scale64; + + /* + * round to multiple of scale + */ + if (scale <= 1) return; + d=(scale+1)/2-1; + scale64 = scale; /* use a 64-bit int for efficiency in the big loop */ + + for (p=a; p <= &a[nx*ny-1]; p++) *p = ((*p>0) ? (*p+d) : (*p-d))/scale64; +} +/* ######################################################################### */ +/* ######################################################################### */ +/* Copyright (c) 1993 Association of Universities for Research + * in Astronomy. All rights reserved. Produced under National + * Aeronautics and Space Administration Contract No. NAS5-26555. + */ +/* encode.c encode H-transform and write to outfile + * + * Programmer: R. White Date: 2 February 1994 + */ + +static char code_magic[2] = { (char)0xDD, (char)0x99 }; + + +/* ######################################################################### */ +static int encode(char *outfile, long *nlength, int a[], int nx, int ny, int scale) +{ + +/* FILE *outfile; - change outfile to a char array */ +/* + long * nlength returned length (in bytes) of the encoded array) + int a[]; input H-transform array (nx,ny) + int nx,ny; size of H-transform array + int scale; scale factor for digitization +*/ +int nel, nx2, ny2, i, j, k, q, vmax[3], nsign, bits_to_go; +unsigned char nbitplanes[3]; +unsigned char *signbits; +int stat; + + noutchar = 0; /* initialize the number of compressed bytes that have been written */ + nel = nx*ny; + /* + * write magic value + */ + qwrite(outfile, code_magic, sizeof(code_magic)); + writeint(outfile, nx); /* size of image */ + writeint(outfile, ny); + writeint(outfile, scale); /* scale factor for digitization */ + /* + * write first value of A (sum of all pixels -- the only value + * which does not compress well) + */ + writelonglong(outfile, (LONGLONG) a[0]); + + a[0] = 0; + /* + * allocate array for sign bits and save values, 8 per byte + (initialize to all zeros) + */ + signbits = (unsigned char *) calloc(1, (nel+7)/8); + if (signbits == (unsigned char *) NULL) { + ffpmsg("encode: insufficient memory"); + return(DATA_COMPRESSION_ERR); + } + nsign = 0; + bits_to_go = 8; +/* signbits[0] = 0; */ + for (i=0; i 0) { + /* + * positive element, put zero at end of buffer + */ + signbits[nsign] <<= 1; + bits_to_go -= 1; + } else if (a[i] < 0) { + /* + * negative element, shift in a one + */ + signbits[nsign] <<= 1; + signbits[nsign] |= 1; + bits_to_go -= 1; + /* + * replace a by absolute value + */ + a[i] = -a[i]; + } + if (bits_to_go == 0) { + /* + * filled up this byte, go to the next one + */ + bits_to_go = 8; + nsign += 1; +/* signbits[nsign] = 0; */ + } + } + if (bits_to_go != 8) { + /* + * some bits in last element + * move bits in last byte to bottom and increment nsign + */ + signbits[nsign] <<= bits_to_go; + nsign += 1; + } + /* + * calculate number of bit planes for 3 quadrants + * + * quadrant 0=bottom left, 1=bottom right or top left, 2=top right, + */ + for (q=0; q<3; q++) { + vmax[q] = 0; + } + /* + * get maximum absolute value in each quadrant + */ + nx2 = (nx+1)/2; + ny2 = (ny+1)/2; + j=0; /* column counter */ + k=0; /* row counter */ + for (i=0; i=ny2) + (k>=nx2); + if (vmax[q] < a[i]) vmax[q] = a[i]; + if (++j >= ny) { + j = 0; + k += 1; + } + } + /* + * now calculate number of bits for each quadrant + */ + + /* this is a more efficient way to do this, */ + + + for (q = 0; q < 3; q++) { + for (nbitplanes[q] = 0; vmax[q]>0; vmax[q] = vmax[q]>>1, nbitplanes[q]++) ; + } + + +/* + for (q = 0; q < 3; q++) { + nbitplanes[q] = (int) (log((float) (vmax[q]+1))/log(2.0)+0.5); + if ( (vmax[q]+1) > (1< 0) { + + if ( 0 == qwrite(outfile, (char *) signbits, nsign)) { + free(signbits); + *nlength = noutchar; + ffpmsg("encode: output buffer too small"); + return(DATA_COMPRESSION_ERR); + } + } + + free(signbits); + *nlength = noutchar; + + if (noutchar >= noutmax) { + ffpmsg("encode: output buffer too small"); + return(DATA_COMPRESSION_ERR); + } + + return(stat); +} +/* ######################################################################### */ +static int encode64(char *outfile, long *nlength, LONGLONG a[], int nx, int ny, int scale) +{ + +/* FILE *outfile; - change outfile to a char array */ +/* + long * nlength returned length (in bytes) of the encoded array) + LONGLONG a[]; input H-transform array (nx,ny) + int nx,ny; size of H-transform array + int scale; scale factor for digitization +*/ +int nel, nx2, ny2, i, j, k, q, nsign, bits_to_go; +LONGLONG vmax[3]; +unsigned char nbitplanes[3]; +unsigned char *signbits; +int stat; + + noutchar = 0; /* initialize the number of compressed bytes that have been written */ + nel = nx*ny; + /* + * write magic value + */ + qwrite(outfile, code_magic, sizeof(code_magic)); + writeint(outfile, nx); /* size of image */ + writeint(outfile, ny); + writeint(outfile, scale); /* scale factor for digitization */ + /* + * write first value of A (sum of all pixels -- the only value + * which does not compress well) + */ + writelonglong(outfile, a[0]); + + a[0] = 0; + /* + * allocate array for sign bits and save values, 8 per byte + */ + signbits = (unsigned char *) calloc(1, (nel+7)/8); + if (signbits == (unsigned char *) NULL) { + ffpmsg("encode64: insufficient memory"); + return(DATA_COMPRESSION_ERR); + } + nsign = 0; + bits_to_go = 8; +/* signbits[0] = 0; */ + for (i=0; i 0) { + /* + * positive element, put zero at end of buffer + */ + signbits[nsign] <<= 1; + bits_to_go -= 1; + } else if (a[i] < 0) { + /* + * negative element, shift in a one + */ + signbits[nsign] <<= 1; + signbits[nsign] |= 1; + bits_to_go -= 1; + /* + * replace a by absolute value + */ + a[i] = -a[i]; + } + if (bits_to_go == 0) { + /* + * filled up this byte, go to the next one + */ + bits_to_go = 8; + nsign += 1; +/* signbits[nsign] = 0; */ + } + } + if (bits_to_go != 8) { + /* + * some bits in last element + * move bits in last byte to bottom and increment nsign + */ + signbits[nsign] <<= bits_to_go; + nsign += 1; + } + /* + * calculate number of bit planes for 3 quadrants + * + * quadrant 0=bottom left, 1=bottom right or top left, 2=top right, + */ + for (q=0; q<3; q++) { + vmax[q] = 0; + } + /* + * get maximum absolute value in each quadrant + */ + nx2 = (nx+1)/2; + ny2 = (ny+1)/2; + j=0; /* column counter */ + k=0; /* row counter */ + for (i=0; i=ny2) + (k>=nx2); + if (vmax[q] < a[i]) vmax[q] = a[i]; + if (++j >= ny) { + j = 0; + k += 1; + } + } + /* + * now calculate number of bits for each quadrant + */ + + /* this is a more efficient way to do this, */ + + + for (q = 0; q < 3; q++) { + for (nbitplanes[q] = 0; vmax[q]>0; vmax[q] = vmax[q]>>1, nbitplanes[q]++) ; + } + + +/* + for (q = 0; q < 3; q++) { + nbitplanes[q] = log((float) (vmax[q]+1))/log(2.0)+0.5; + if ( (vmax[q]+1) > (((LONGLONG) 1)< 0) { + + if ( 0 == qwrite(outfile, (char *) signbits, nsign)) { + free(signbits); + *nlength = noutchar; + ffpmsg("encode: output buffer too small"); + return(DATA_COMPRESSION_ERR); + } + } + + free(signbits); + *nlength = noutchar; + + if (noutchar >= noutmax) { + ffpmsg("encode64: output buffer too small"); + return(DATA_COMPRESSION_ERR); + } + + return(stat); +} +/* ######################################################################### */ +/* ######################################################################### */ +/* Copyright (c) 1993 Association of Universities for Research + * in Astronomy. All rights reserved. Produced under National + * Aeronautics and Space Administration Contract No. NAS5-26555. + */ +/* qwrite.c Write binary data + * + * Programmer: R. White Date: 11 March 1991 + */ + +/* ######################################################################### */ +static void +writeint(char *outfile, int a) +{ +int i; +unsigned char b[4]; + + /* Write integer A one byte at a time to outfile. + * + * This is portable from Vax to Sun since it eliminates the + * need for byte-swapping. + */ + for (i=3; i>=0; i--) { + b[i] = a & 0x000000ff; + a >>= 8; + } + for (i=0; i<4; i++) qwrite(outfile, (char *) &b[i],1); +} + +/* ######################################################################### */ +static void +writelonglong(char *outfile, LONGLONG a) +{ +int i; +unsigned char b[8]; + + /* Write integer A one byte at a time to outfile. + * + * This is portable from Vax to Sun since it eliminates the + * need for byte-swapping. + */ + for (i=7; i>=0; i--) { + b[i] = (unsigned char) (a & 0x000000ff); + a >>= 8; + } + for (i=0; i<8; i++) qwrite(outfile, (char *) &b[i],1); +} +/* ######################################################################### */ +static int +qwrite(char *file, char buffer[], int n){ + /* + * write n bytes from buffer into file + * returns number of bytes read (=n) if successful, <=0 if not + */ + + if (noutchar + n > noutmax) return(0); /* buffer overflow */ + + memcpy(&file[noutchar], buffer, n); + noutchar += n; + + return(n); +} +/* ######################################################################### */ +/* ######################################################################### */ +/* Copyright (c) 1993 Association of Universities for Research + * in Astronomy. All rights reserved. Produced under National + * Aeronautics and Space Administration Contract No. NAS5-26555. + */ +/* doencode.c Encode 2-D array and write stream of characters on outfile + * + * This version assumes that A is positive. + * + * Programmer: R. White Date: 7 May 1991 + */ + +/* ######################################################################### */ +static int +doencode(char *outfile, int a[], int nx, int ny, unsigned char nbitplanes[3]) +{ +/* char *outfile; output data stream +int a[]; Array of values to encode +int nx,ny; Array dimensions [nx][ny] +unsigned char nbitplanes[3]; Number of bit planes in quadrants +*/ + +int nx2, ny2, stat; + + nx2 = (nx+1)/2; + ny2 = (ny+1)/2; + /* + * Initialize bit output + */ + start_outputing_bits(); + /* + * write out the bit planes for each quadrant + */ + stat = qtree_encode(outfile, &a[0], ny, nx2, ny2, nbitplanes[0]); + + if (!stat) + stat = qtree_encode(outfile, &a[ny2], ny, nx2, ny/2, nbitplanes[1]); + + if (!stat) + stat = qtree_encode(outfile, &a[ny*nx2], ny, nx/2, ny2, nbitplanes[1]); + + if (!stat) + stat = qtree_encode(outfile, &a[ny*nx2+ny2], ny, nx/2, ny/2, nbitplanes[2]); + /* + * Add zero as an EOF symbol + */ + output_nybble(outfile, 0); + done_outputing_bits(outfile); + + return(stat); +} +/* ######################################################################### */ +static int +doencode64(char *outfile, LONGLONG a[], int nx, int ny, unsigned char nbitplanes[3]) +{ +/* char *outfile; output data stream +LONGLONG a[]; Array of values to encode +int nx,ny; Array dimensions [nx][ny] +unsigned char nbitplanes[3]; Number of bit planes in quadrants +*/ + +int nx2, ny2, stat; + + nx2 = (nx+1)/2; + ny2 = (ny+1)/2; + /* + * Initialize bit output + */ + start_outputing_bits(); + /* + * write out the bit planes for each quadrant + */ + stat = qtree_encode64(outfile, &a[0], ny, nx2, ny2, nbitplanes[0]); + + if (!stat) + stat = qtree_encode64(outfile, &a[ny2], ny, nx2, ny/2, nbitplanes[1]); + + if (!stat) + stat = qtree_encode64(outfile, &a[ny*nx2], ny, nx/2, ny2, nbitplanes[1]); + + if (!stat) + stat = qtree_encode64(outfile, &a[ny*nx2+ny2], ny, nx/2, ny/2, nbitplanes[2]); + /* + * Add zero as an EOF symbol + */ + output_nybble(outfile, 0); + done_outputing_bits(outfile); + + return(stat); +} +/* ######################################################################### */ +/* ######################################################################### */ +/* Copyright (c) 1993 Association of Universities for Research + * in Astronomy. All rights reserved. Produced under National + * Aeronautics and Space Administration Contract No. NAS5-26555. + */ +/* BIT OUTPUT ROUTINES */ + + +static LONGLONG bitcount; + +/* THE BIT BUFFER */ + +static int buffer2; /* Bits buffered for output */ +static int bits_to_go2; /* Number of bits free in buffer */ + + +/* ######################################################################### */ +/* INITIALIZE FOR BIT OUTPUT */ + +static void +start_outputing_bits(void) +{ + buffer2 = 0; /* Buffer is empty to start */ + bits_to_go2 = 8; /* with */ + bitcount = 0; +} + +/* ######################################################################### */ +/* OUTPUT N BITS (N must be <= 8) */ + +static void +output_nbits(char *outfile, int bits, int n) +{ + /* AND mask for the right-most n bits */ + static int mask[9] = {0, 1, 3, 7, 15, 31, 63, 127, 255}; + /* + * insert bits at end of buffer + */ + buffer2 <<= n; +/* buffer2 |= ( bits & ((1<>(-bits_to_go2)) & 0xff); + + if (noutchar < noutmax) noutchar++; + + bits_to_go2 += 8; + } + bitcount += n; +} +/* ######################################################################### */ +/* OUTPUT a 4 bit nybble */ +static void +output_nybble(char *outfile, int bits) +{ + /* + * insert 4 bits at end of buffer + */ + buffer2 = (buffer2<<4) | ( bits & 15 ); + bits_to_go2 -= 4; + if (bits_to_go2 <= 0) { + /* + * buffer2 full, put out top 8 bits + */ + + outfile[noutchar] = ((buffer2>>(-bits_to_go2)) & 0xff); + + if (noutchar < noutmax) noutchar++; + + bits_to_go2 += 8; + } + bitcount += 4; +} +/* ############################################################################ */ +/* OUTPUT array of 4 BITS */ + +static void output_nnybble(char *outfile, int n, unsigned char array[]) +{ + /* pack the 4 lower bits in each element of the array into the outfile array */ + +int ii, jj, kk = 0, shift; + + if (n == 1) { + output_nybble(outfile, (int) array[0]); + return; + } +/* forcing byte alignment doesn;t help, and even makes it go slightly slower +if (bits_to_go2 != 8) + output_nbits(outfile, kk, bits_to_go2); +*/ + if (bits_to_go2 <= 4) + { + /* just room for 1 nybble; write it out separately */ + output_nybble(outfile, array[0]); + kk++; /* index to next array element */ + + if (n == 2) /* only 1 more nybble to write out */ + { + output_nybble(outfile, (int) array[1]); + return; + } + } + + + /* bits_to_go2 is now in the range 5 - 8 */ + shift = 8 - bits_to_go2; + + /* now write out pairs of nybbles; this does not affect value of bits_to_go2 */ + jj = (n - kk) / 2; + + if (bits_to_go2 == 8) { + /* special case if nybbles are aligned on byte boundary */ + /* this actually seems to make very little differnece in speed */ + buffer2 = 0; + for (ii = 0; ii < jj; ii++) + { + outfile[noutchar] = ((array[kk] & 15)<<4) | (array[kk+1] & 15); + kk += 2; + noutchar++; + } + } else { + for (ii = 0; ii < jj; ii++) + { + buffer2 = (buffer2<<8) | ((array[kk] & 15)<<4) | (array[kk+1] & 15); + kk += 2; + + /* + buffer2 full, put out top 8 bits + */ + + outfile[noutchar] = ((buffer2>>shift) & 0xff); + noutchar++; + } + } + + bitcount += (8 * (ii - 1)); + + /* write out last odd nybble, if present */ + if (kk != n) output_nybble(outfile, (int) array[n - 1]); + + return; +} + + +/* ######################################################################### */ +/* FLUSH OUT THE LAST BITS */ + +static void +done_outputing_bits(char *outfile) +{ + if(bits_to_go2 < 8) { +/* putc(buffer2<nqy) ? nqx : nqy; + log2n = (int) (log((float) nqmax)/log(2.0)+0.5); + if (nqmax > (1<= 0; bit--) { + /* + * initial bit buffer + */ + b = 0; + bitbuffer = 0; + bits_to_go3 = 0; + /* + * on first pass copy A to scratch array + */ + qtree_onebit(a,n,nqx,nqy,scratch,bit); + nx = (nqx+1)>>1; + ny = (nqy+1)>>1; + /* + * copy non-zero values to output buffer, which will be written + * in reverse order + */ + if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) { + /* + * quadtree is expanding data, + * change warning code and just fill buffer with bit-map + */ + write_bdirect(outfile,a,n,nqx,nqy,scratch,bit); + goto bitplane_done; + } + /* + * do log2n reductions + */ + for (k = 1; k>1; + ny = (ny+1)>>1; + if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) { + write_bdirect(outfile,a,n,nqx,nqy,scratch,bit); + goto bitplane_done; + } + } + /* + * OK, we've got the code in buffer + * Write quadtree warning code, then write buffer in reverse order + */ + output_nybble(outfile,0xF); + if (b==0) { + if (bits_to_go3>0) { + /* + * put out the last few bits + */ + output_nbits(outfile, bitbuffer & ((1<0) { + /* + * put out the last few bits + */ + output_nbits(outfile, bitbuffer & ((1<=0; i--) { + output_nbits(outfile,buffer[i],8); + } + } + bitplane_done: ; + } + free(buffer); + free(scratch); + return(0); +} +/* ######################################################################### */ +static int +qtree_encode64(char *outfile, LONGLONG a[], int n, int nqx, int nqy, int nbitplanes) +{ + +/* +LONGLONG a[]; +int n; physical dimension of row in a +int nqx; length of row +int nqy; length of column (<=n) +int nbitplanes; number of bit planes to output +*/ + +int log2n, i, k, bit, b, nqmax, nqx2, nqy2, nx, ny; +int bmax; /* this potentially needs to be made a 64-bit int to support large arrays */ +unsigned char *scratch, *buffer; + + /* + * log2n is log2 of max(nqx,nqy) rounded up to next power of 2 + */ + nqmax = (nqx>nqy) ? nqx : nqy; + log2n = (int) (log((float) nqmax)/log(2.0)+0.5); + if (nqmax > (1<= 0; bit--) { + /* + * initial bit buffer + */ + b = 0; + bitbuffer = 0; + bits_to_go3 = 0; + /* + * on first pass copy A to scratch array + */ + qtree_onebit64(a,n,nqx,nqy,scratch,bit); + nx = (nqx+1)>>1; + ny = (nqy+1)>>1; + /* + * copy non-zero values to output buffer, which will be written + * in reverse order + */ + if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) { + /* + * quadtree is expanding data, + * change warning code and just fill buffer with bit-map + */ + write_bdirect64(outfile,a,n,nqx,nqy,scratch,bit); + goto bitplane_done; + } + /* + * do log2n reductions + */ + for (k = 1; k>1; + ny = (ny+1)>>1; + if (bufcopy(scratch,nx*ny,buffer,&b,bmax)) { + write_bdirect64(outfile,a,n,nqx,nqy,scratch,bit); + goto bitplane_done; + } + } + /* + * OK, we've got the code in buffer + * Write quadtree warning code, then write buffer in reverse order + */ + output_nybble(outfile,0xF); + if (b==0) { + if (bits_to_go3>0) { + /* + * put out the last few bits + */ + output_nbits(outfile, bitbuffer & ((1<0) { + /* + * put out the last few bits + */ + output_nbits(outfile, bitbuffer & ((1<=0; i--) { + output_nbits(outfile,buffer[i],8); + } + } + bitplane_done: ; + } + free(buffer); + free(scratch); + return(0); +} + +/* ######################################################################### */ +/* + * copy non-zero codes from array to buffer + */ +static int +bufcopy(unsigned char a[], int n, unsigned char buffer[], int *b, int bmax) +{ +int i; + + for (i = 0; i < n; i++) { + if (a[i] != 0) { + /* + * add Huffman code for a[i] to buffer + */ + bitbuffer |= code[a[i]] << bits_to_go3; + bits_to_go3 += ncode[a[i]]; + if (bits_to_go3 >= 8) { + buffer[*b] = bitbuffer & 0xFF; + *b += 1; + /* + * return warning code if we fill buffer + */ + if (*b >= bmax) return(1); + bitbuffer >>= 8; + bits_to_go3 -= 8; + } + } + } + return(0); +} + +/* ######################################################################### */ +/* + * Do first quadtree reduction step on bit BIT of array A. + * Results put into B. + * + */ +static void +qtree_onebit(int a[], int n, int nx, int ny, unsigned char b[], int bit) +{ +int i, j, k; +int b0, b1, b2, b3; +int s10, s00; + + /* + * use selected bit to get amount to shift + */ + b0 = 1<> bit; + + k += 1; + s00 += 2; + s10 += 2; + } + if (j < ny) { + /* + * row size is odd, do last element in row + * s00+1,s10+1 are off edge + */ + b[k] = ( ((a[s10 ]<<1) & b1) + | ((a[s00 ]<<3) & b3) ) >> bit; + k += 1; + } + } + if (i < nx) { + /* + * column size is odd, do last row + * s10,s10+1 are off edge + */ + s00 = n*i; + for (j = 0; j> bit; + k += 1; + s00 += 2; + } + if (j < ny) { + /* + * both row and column size are odd, do corner element + * s00+1, s10, s10+1 are off edge + */ + b[k] = ( ((a[s00 ]<<3) & b3) ) >> bit; + k += 1; + } + } +} +/* ######################################################################### */ +/* + * Do first quadtree reduction step on bit BIT of array A. + * Results put into B. + * + */ +static void +qtree_onebit64(LONGLONG a[], int n, int nx, int ny, unsigned char b[], int bit) +{ +int i, j, k; +LONGLONG b0, b1, b2, b3; +int s10, s00; + + /* + * use selected bit to get amount to shift + */ + b0 = ((LONGLONG) 1)<> bit); + k += 1; + s00 += 2; + s10 += 2; + } + if (j < ny) { + /* + * row size is odd, do last element in row + * s00+1,s10+1 are off edge + */ + b[k] = (unsigned char) (( ((a[s10 ]<<1) & b1) + | ((a[s00 ]<<3) & b3) ) >> bit); + k += 1; + } + } + if (i < nx) { + /* + * column size is odd, do last row + * s10,s10+1 are off edge + */ + s00 = n*i; + for (j = 0; j> bit); + k += 1; + s00 += 2; + } + if (j < ny) { + /* + * both row and column size are odd, do corner element + * s00+1, s10, s10+1 are off edge + */ + b[k] = (unsigned char) (( ((a[s00 ]<<3) & b3) ) >> bit); + k += 1; + } + } +} + +/* ######################################################################### */ +/* + * do one quadtree reduction step on array a + * results put into b (which may be the same as a) + */ +static void +qtree_reduce(unsigned char a[], int n, int nx, int ny, unsigned char b[]) +{ +int i, j, k; +int s10, s00; + + k = 0; /* k is index of b[i/2,j/2] */ + for (i = 0; i + +/* the following was provided by Michael Greason (GSFC) to fix a */ +/* C/Fortran compatibility problem on an SGI Altix system running */ +/* SGI ProPack 4 [this is a Novell SuSE Enterprise 9 derivative] */ +/* and using the Intel C++ and Fortran compilers (version 9.1) */ +#if defined(__INTEL_COMPILER) && defined(__itanium__) +# define mipsFortran 1 +# define _MIPS_SZLONG 64 +#endif + +#if defined(linux) || defined(__APPLE__) || defined(__sgi) +# include /* apparently needed on debian linux systems */ +#endif /* to define off_t */ + +#include /* apparently needed to define size_t with gcc 2.8.1 */ +#include /* needed for LLONG_MAX and INT64_MAX definitions */ + +/* Define the datatype for variables which store file offset values. */ +/* The newer 'off_t' datatype should be used for this purpose, but some */ +/* older compilers do not recognize this type, in which case we use 'long' */ +/* instead. Note that _OFF_T is defined (or not) in stdio.h depending */ +/* on whether _LARGEFILE_SOURCE is defined in sys/feature_tests.h */ +/* (at least on Solaris platforms using cc) */ + +/* Debian systems require: "(defined(linux) && defined(__off_t_defined))" */ +/* the mingw-w64 compiler requires: "(defined(__MINGW32__) && defined(_OFF_T_DEFINED))" */ +#if defined(_OFF_T) \ + || (defined(linux) && defined(__off_t_defined)) \ + || (defined(__MINGW32__) && defined(_OFF_T_DEFINED)) \ + || defined(_MIPS_SZLONG) || defined(__APPLE__) || defined(_AIX) +# define OFF_T off_t +#elif defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER>= 1400)) +# define OFF_T long long +#else +# define OFF_T long +#endif + +/* this block determines if the the string function name is + strtol or strtoll, and whether to use %ld or %lld in printf statements */ + +/* + The following 2 cases for that Athon64 were removed on 4 Jan 2006; + they appear to be incorrect now that LONGLONG is always typedef'ed + to 'long long' + || defined(__ia64__) \ + || defined(__x86_64__) \ +*/ +#if (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \ + || defined(__sparcv9) || (defined(__sparc__) && defined(__arch64__)) \ + || defined(__powerpc64__) || defined(__64BIT__) \ + || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) \ + || defined( _MSC_VER)|| defined(__BORLANDC__) + +# define USE_LL_SUFFIX 0 +#else +# define USE_LL_SUFFIX 1 +#endif + +/* + Determine what 8-byte integer data type is available. + 'long long' is now supported by most compilers, but + older MS Visual C++ compilers before V7.0 use '__int64' instead. +*/ + +#ifndef LONGLONG_TYPE /* this may have been previously defined */ +#if defined(_MSC_VER) /* Microsoft Visual C++ */ + +#if (_MSC_VER < 1300) /* versions earlier than V7.0 do not have 'long long' */ + typedef __int64 LONGLONG; + typedef unsigned __int64 ULONGLONG; + +#else /* newer versions do support 'long long' */ + typedef long long LONGLONG; + typedef unsigned long long ULONGLONG; + +#endif + +#elif defined( __BORLANDC__) /* for the Borland 5.5 compiler, in particular */ + typedef __int64 LONGLONG; + typedef unsigned __int64 ULONGLONG; +#else + typedef long long LONGLONG; + typedef unsigned long long ULONGLONG; +#endif + +#define LONGLONG_TYPE +#endif + +#ifndef LONGLONG_MAX + +#ifdef LLONG_MAX +/* Linux and Solaris definition */ +#define LONGLONG_MAX LLONG_MAX +#define LONGLONG_MIN LLONG_MIN + +#elif defined(LONG_LONG_MAX) +#define LONGLONG_MAX LONG_LONG_MAX +#define LONGLONG_MIN LONG_LONG_MIN + +#elif defined(__LONG_LONG_MAX__) +/* Mac OS X & CYGWIN defintion */ +#define LONGLONG_MAX __LONG_LONG_MAX__ +#define LONGLONG_MIN (-LONGLONG_MAX -1LL) + +#elif defined(INT64_MAX) +/* windows definition */ +#define LONGLONG_MAX INT64_MAX +#define LONGLONG_MIN INT64_MIN + +#elif defined(_I64_MAX) +/* windows definition */ +#define LONGLONG_MAX _I64_MAX +#define LONGLONG_MIN _I64_MIN + +#elif (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \ + || defined(__sparcv9) \ + || defined(__ia64__) \ + || defined(__x86_64__) \ + || defined(_SX) \ + || defined(__powerpc64__) || defined(__64BIT__) \ + || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) +/* sizeof(long) = 64 */ +#define LONGLONG_MAX 9223372036854775807L /* max 64-bit integer */ +#define LONGLONG_MIN (-LONGLONG_MAX -1L) /* min 64-bit integer */ + +#else +/* define a default value, even if it is never used */ +#define LONGLONG_MAX 9223372036854775807LL /* max 64-bit integer */ +#define LONGLONG_MIN (-LONGLONG_MAX -1LL) /* min 64-bit integer */ + +#endif +#endif /* end of ndef LONGLONG_MAX section */ + + +/* ================================================================= */ + + +/* The following exclusion if __CINT__ is defined is needed for ROOT */ +#ifndef __CINT__ +#include "longnam.h" +#endif + +#define NIOBUF 40 /* number of IO buffers to create (default = 40) */ + /* !! Significantly increasing NIOBUF may degrade performance !! */ + +#define IOBUFLEN 2880 /* size in bytes of each IO buffer (DONT CHANGE!) */ + +/* global variables */ + +#define FLEN_FILENAME 1025 /* max length of a filename */ +#define FLEN_KEYWORD 75 /* max length of a keyword (HIERARCH convention) */ +#define FLEN_CARD 81 /* length of a FITS header card */ +#define FLEN_VALUE 71 /* max length of a keyword value string */ +#define FLEN_COMMENT 73 /* max length of a keyword comment string */ +#define FLEN_ERRMSG 81 /* max length of a FITSIO error message */ +#define FLEN_STATUS 31 /* max length of a FITSIO status text string */ + +#define TBIT 1 /* codes for FITS table data types */ +#define TBYTE 11 +#define TSBYTE 12 +#define TLOGICAL 14 +#define TSTRING 16 +#define TUSHORT 20 +#define TSHORT 21 +#define TUINT 30 +#define TINT 31 +#define TULONG 40 +#define TLONG 41 +#define TINT32BIT 41 /* used when returning datatype of a column */ +#define TFLOAT 42 +#define TULONGLONG 80 +#define TLONGLONG 81 +#define TDOUBLE 82 +#define TCOMPLEX 83 +#define TDBLCOMPLEX 163 + +#define TYP_STRUC_KEY 10 +#define TYP_CMPRS_KEY 20 +#define TYP_SCAL_KEY 30 +#define TYP_NULL_KEY 40 +#define TYP_DIM_KEY 50 +#define TYP_RANG_KEY 60 +#define TYP_UNIT_KEY 70 +#define TYP_DISP_KEY 80 +#define TYP_HDUID_KEY 90 +#define TYP_CKSUM_KEY 100 +#define TYP_WCS_KEY 110 +#define TYP_REFSYS_KEY 120 +#define TYP_COMM_KEY 130 +#define TYP_CONT_KEY 140 +#define TYP_USER_KEY 150 + + +#define INT32BIT int /* 32-bit integer datatype. Currently this */ + /* datatype is an 'int' on all useful platforms */ + /* however, it is possible that that are cases */ + /* where 'int' is a 2-byte integer, in which case */ + /* INT32BIT would need to be defined as 'long'. */ + +#define BYTE_IMG 8 /* BITPIX code values for FITS image types */ +#define SHORT_IMG 16 +#define LONG_IMG 32 +#define LONGLONG_IMG 64 +#define FLOAT_IMG -32 +#define DOUBLE_IMG -64 + /* The following 2 codes are not true FITS */ + /* datatypes; these codes are only used internally */ + /* within cfitsio to make it easier for users */ + /* to deal with unsigned integers. */ +#define SBYTE_IMG 10 +#define USHORT_IMG 20 +#define ULONG_IMG 40 +#define ULONGLONG_IMG 80 + +#define IMAGE_HDU 0 /* Primary Array or IMAGE HDU */ +#define ASCII_TBL 1 /* ASCII table HDU */ +#define BINARY_TBL 2 /* Binary table HDU */ +#define ANY_HDU -1 /* matches any HDU type */ + +#define READONLY 0 /* options when opening a file */ +#define READWRITE 1 + +/* adopt a hopefully obscure number to use as a null value flag */ +/* could be problems if the FITS files contain data with these values */ +#define FLOATNULLVALUE -9.11912E-36F +#define DOUBLENULLVALUE -9.1191291391491E-36 + +/* compression algorithm codes */ +#define NO_DITHER -1 +#define SUBTRACTIVE_DITHER_1 1 +#define SUBTRACTIVE_DITHER_2 2 +#define MAX_COMPRESS_DIM 6 +#define RICE_1 11 +#define GZIP_1 21 +#define GZIP_2 22 +#define PLIO_1 31 +#define HCOMPRESS_1 41 +#define BZIP2_1 51 /* not publicly supported; only for test purposes */ +#define NOCOMPRESS -1 + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#define CASESEN 1 /* do case-sensitive string match */ +#define CASEINSEN 0 /* do case-insensitive string match */ + +#define GT_ID_ALL_URI 0 /* hierarchical grouping parameters */ +#define GT_ID_REF 1 +#define GT_ID_POS 2 +#define GT_ID_ALL 3 +#define GT_ID_REF_URI 11 +#define GT_ID_POS_URI 12 + +#define OPT_RM_GPT 0 +#define OPT_RM_ENTRY 1 +#define OPT_RM_MBR 2 +#define OPT_RM_ALL 3 + +#define OPT_GCP_GPT 0 +#define OPT_GCP_MBR 1 +#define OPT_GCP_ALL 2 + +#define OPT_MCP_ADD 0 +#define OPT_MCP_NADD 1 +#define OPT_MCP_REPL 2 +#define OPT_MCP_MOV 3 + +#define OPT_MRG_COPY 0 +#define OPT_MRG_MOV 1 + +#define OPT_CMT_MBR 1 +#define OPT_CMT_MBR_DEL 11 + +typedef struct /* structure used to store table column information */ +{ + char ttype[70]; /* column name = FITS TTYPEn keyword; */ + LONGLONG tbcol; /* offset in row to first byte of each column */ + int tdatatype; /* datatype code of each column */ + LONGLONG trepeat; /* repeat count of column; number of elements */ + double tscale; /* FITS TSCALn linear scaling factor */ + double tzero; /* FITS TZEROn linear scaling zero point */ + LONGLONG tnull; /* FITS null value for int image or binary table cols */ + char strnull[20]; /* FITS null value string for ASCII table columns */ + char tform[10]; /* FITS tform keyword value */ + long twidth; /* width of each ASCII table column */ +}tcolumn; + +#define VALIDSTRUC 555 /* magic value used to identify if structure is valid */ + +typedef struct /* structure used to store basic FITS file information */ +{ + int filehandle; /* handle returned by the file open function */ + int driver; /* defines which set of I/O drivers should be used */ + int open_count; /* number of opened 'fitsfiles' using this structure */ + char *filename; /* file name */ + int validcode; /* magic value used to verify that structure is valid */ + int only_one; /* flag meaning only copy the specified extension */ + LONGLONG filesize; /* current size of the physical disk file in bytes */ + LONGLONG logfilesize; /* logical size of file, including unflushed buffers */ + int lasthdu; /* is this the last HDU in the file? 0 = no, else yes */ + LONGLONG bytepos; /* current logical I/O pointer position in file */ + LONGLONG io_pos; /* current I/O pointer position in the physical file */ + int curbuf; /* number of I/O buffer currently in use */ + int curhdu; /* current HDU number; 0 = primary array */ + int hdutype; /* 0 = primary array, 1 = ASCII table, 2 = binary table */ + int writemode; /* 0 = readonly, 1 = readwrite */ + int maxhdu; /* highest numbered HDU known to exist in the file */ + int MAXHDU; /* dynamically allocated dimension of headstart array */ + LONGLONG *headstart; /* byte offset in file to start of each HDU */ + LONGLONG headend; /* byte offest in file to end of the current HDU header */ + LONGLONG ENDpos; /* byte offest to where the END keyword was last written */ + LONGLONG nextkey; /* byte offset in file to beginning of next keyword */ + LONGLONG datastart; /* byte offset in file to start of the current data unit */ + int imgdim; /* dimension of image; cached for fast access */ + LONGLONG imgnaxis[99]; /* length of each axis; cached for fast access */ + int tfield; /* number of fields in the table (primary array has 2 */ + int startcol; /* used by ffgcnn to record starting column number */ + LONGLONG origrows; /* original number of rows (value of NAXIS2 keyword) */ + LONGLONG numrows; /* number of rows in the table (dynamically updated) */ + LONGLONG rowlength; /* length of a table row or image size (bytes) */ + tcolumn *tableptr; /* pointer to the table structure */ + LONGLONG heapstart; /* heap start byte relative to start of data unit */ + LONGLONG heapsize; /* size of the heap, in bytes */ + + /* the following elements are related to compressed images */ + + /* these record the 'requested' options to be used when the image is compressed */ + int request_compress_type; /* requested image compression algorithm */ + long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */ + float request_quantize_level; /* requested quantize level */ + int request_quantize_method ; /* requested quantizing method */ + int request_dither_seed; /* starting offset into the array of random dithering */ + int request_lossy_int_compress; /* lossy compress integer image as if float image? */ + int request_huge_hdu; /* use '1Q' rather then '1P' variable length arrays */ + float request_hcomp_scale; /* requested HCOMPRESS scale factor */ + int request_hcomp_smooth; /* requested HCOMPRESS smooth parameter */ + + /* these record the actual options that were used when the image was compressed */ + int compress_type; /* type of compression algorithm */ + long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */ + float quantize_level; /* floating point quantization level */ + int quantize_method; /* floating point pixel quantization algorithm */ + int dither_seed; /* starting offset into the array of random dithering */ + + /* other compression parameters */ + int compressimg; /* 1 if HDU contains a compressed image, else 0 */ + char zcmptype[12]; /* compression type string */ + int zbitpix; /* FITS data type of image (BITPIX) */ + int zndim; /* dimension of image */ + long znaxis[MAX_COMPRESS_DIM]; /* length of each axis */ + long maxtilelen; /* max number of pixels in each image tile */ + long maxelem; /* maximum byte length of tile compressed arrays */ + + int cn_compressed; /* column number for COMPRESSED_DATA column */ + int cn_uncompressed; /* column number for UNCOMPRESSED_DATA column */ + int cn_gzip_data; /* column number for GZIP2 lossless compressed data */ + int cn_zscale; /* column number for ZSCALE column */ + int cn_zzero; /* column number for ZZERO column */ + int cn_zblank; /* column number for the ZBLANK column */ + + double zscale; /* scaling value, if same for all tiles */ + double zzero; /* zero pt, if same for all tiles */ + double cn_bscale; /* value of the BSCALE keyword in header */ + double cn_bzero; /* value of the BZERO keyword (may be reset) */ + double cn_actual_bzero; /* actual value of the BZERO keyword */ + int zblank; /* value for null pixels, if not a column */ + + int rice_blocksize; /* first compression parameter: Rice pixels/block */ + int rice_bytepix; /* 2nd compression parameter: Rice bytes/pixel */ + float hcomp_scale; /* 1st hcompress compression parameter */ + int hcomp_smooth; /* 2nd hcompress compression parameter */ + + int *tilerow; /* row number of the array of uncompressed tiledata */ + long *tiledatasize; /* length of the array of tile data in bytes */ + int *tiletype; /* datatype of the array of tile (TINT, TSHORT, etc) */ + void **tiledata; /* array of uncompressed tile of data, for row *tilerow */ + void **tilenullarray; /* array of optional array of null value flags */ + int *tileanynull; /* anynulls in the array of tile? */ + + char *iobuffer; /* pointer to FITS file I/O buffers */ + long bufrecnum[NIOBUF]; /* file record number of each of the buffers */ + int dirty[NIOBUF]; /* has the corresponding buffer been modified? */ + int ageindex[NIOBUF]; /* relative age of each buffer */ +} FITSfile; + +typedef struct /* structure used to store basic HDU information */ +{ + int HDUposition; /* HDU position in file; 0 = first HDU */ + FITSfile *Fptr; /* pointer to FITS file structure */ +}fitsfile; + +typedef struct /* structure for the iterator function column information */ +{ + /* elements required as input to fits_iterate_data: */ + + fitsfile *fptr; /* pointer to the HDU containing the column */ + int colnum; /* column number in the table (use name if < 1) */ + char colname[70]; /* name (= TTYPEn value) of the column (optional) */ + int datatype; /* output datatype (converted if necessary */ + int iotype; /* = InputCol, InputOutputCol, or OutputCol */ + + /* output elements that may be useful for the work function: */ + + void *array; /* pointer to the array (and the null value) */ + long repeat; /* binary table vector repeat value */ + long tlmin; /* legal minimum data value */ + long tlmax; /* legal maximum data value */ + char tunit[70]; /* physical unit string */ + char tdisp[70]; /* suggested display format */ + +} iteratorCol; + +#define InputCol 0 /* flag for input only iterator column */ +#define InputOutputCol 1 /* flag for input and output iterator column */ +#define OutputCol 2 /* flag for output only iterator column */ + +/*============================================================================= +* +* The following wtbarr typedef is used in the fits_read_wcstab() routine, +* which is intended for use with the WCSLIB library written by Mark +* Calabretta, http://www.atnf.csiro.au/~mcalabre/index.html +* +* In order to maintain WCSLIB and CFITSIO as independent libraries it +* was not permissible for any CFITSIO library code to include WCSLIB +* header files, or vice versa. However, the CFITSIO function +* fits_read_wcstab() accepts an array of structs defined by wcs.h within +* WCSLIB. The problem then was to define this struct within fitsio.h +* without including wcs.h, especially noting that wcs.h will often (but +* not always) be included together with fitsio.h in an applications +* program that uses fits_read_wcstab(). +* +* Of the various possibilities, the solution adopted was for WCSLIB to +* define "struct wtbarr" while fitsio.h defines "typedef wtbarr", a +* untagged struct with identical members. This allows both wcs.h and +* fitsio.h to define a wtbarr data type without conflict by virtue of +* the fact that structure tags and typedef names share different +* namespaces in C. Therefore, declarations within WCSLIB look like +* +* struct wtbarr *w; +* +* while within CFITSIO they are simply +* +* wtbarr *w; +* +* but as suggested by the commonality of the names, these are really the +* same aggregate data type. However, in passing a (struct wtbarr *) to +* fits_read_wcstab() a cast to (wtbarr *) is formally required. +*===========================================================================*/ + +#ifndef WCSLIB_GETWCSTAB +#define WCSLIB_GETWCSTAB + +typedef struct { + int i; /* Image axis number. */ + int m; /* Array axis number for index vectors. */ + int kind; /* Array type, 'c' (coord) or 'i' (index). */ + char extnam[72]; /* EXTNAME of binary table extension. */ + int extver; /* EXTVER of binary table extension. */ + int extlev; /* EXTLEV of binary table extension. */ + char ttype[72]; /* TTYPEn of column containing the array. */ + long row; /* Table row number. */ + int ndim; /* Expected array dimensionality. */ + int *dimlen; /* Where to write the array axis lengths. */ + double **arrayp; /* Where to write the address of the array */ + /* allocated to store the array. */ +} wtbarr; + +/* The following exclusion if __CINT__ is defined is needed for ROOT */ +#ifndef __CINT__ +/* the following 3 lines are needed to support C++ compilers */ +#ifdef __cplusplus +extern "C" { +#endif +#endif + +int CFITS_API fits_read_wcstab(fitsfile *fptr, int nwtb, wtbarr *wtb, int *status); + +/* The following exclusion if __CINT__ is defined is needed for ROOT */ +#ifndef __CINT__ +#ifdef __cplusplus +} +#endif +#endif + +#endif /* WCSLIB_GETWCSTAB */ + +/* error status codes */ + +#define CREATE_DISK_FILE -106 /* create disk file, without extended filename syntax */ +#define OPEN_DISK_FILE -105 /* open disk file, without extended filename syntax */ +#define SKIP_TABLE -104 /* move to 1st image when opening file */ +#define SKIP_IMAGE -103 /* move to 1st table when opening file */ +#define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */ +#define USE_MEM_BUFF -101 /* use memory buffer when opening file */ +#define OVERFLOW_ERR -11 /* overflow during datatype conversion */ +#define PREPEND_PRIMARY -9 /* used in ffiimg to insert new primary array */ +#define SAME_FILE 101 /* input and output files are the same */ +#define TOO_MANY_FILES 103 /* tried to open too many FITS files */ +#define FILE_NOT_OPENED 104 /* could not open the named file */ +#define FILE_NOT_CREATED 105 /* could not create the named file */ +#define WRITE_ERROR 106 /* error writing to FITS file */ +#define END_OF_FILE 107 /* tried to move past end of file */ +#define READ_ERROR 108 /* error reading from FITS file */ +#define FILE_NOT_CLOSED 110 /* could not close the file */ +#define ARRAY_TOO_BIG 111 /* array dimensions exceed internal limit */ +#define READONLY_FILE 112 /* Cannot write to readonly file */ +#define MEMORY_ALLOCATION 113 /* Could not allocate memory */ +#define BAD_FILEPTR 114 /* invalid fitsfile pointer */ +#define NULL_INPUT_PTR 115 /* NULL input pointer to routine */ +#define SEEK_ERROR 116 /* error seeking position in file */ + +#define BAD_URL_PREFIX 121 /* invalid URL prefix on file name */ +#define TOO_MANY_DRIVERS 122 /* tried to register too many IO drivers */ +#define DRIVER_INIT_FAILED 123 /* driver initialization failed */ +#define NO_MATCHING_DRIVER 124 /* matching driver is not registered */ +#define URL_PARSE_ERROR 125 /* failed to parse input file URL */ +#define RANGE_PARSE_ERROR 126 /* failed to parse input file URL */ + +#define SHARED_ERRBASE (150) +#define SHARED_BADARG (SHARED_ERRBASE + 1) +#define SHARED_NULPTR (SHARED_ERRBASE + 2) +#define SHARED_TABFULL (SHARED_ERRBASE + 3) +#define SHARED_NOTINIT (SHARED_ERRBASE + 4) +#define SHARED_IPCERR (SHARED_ERRBASE + 5) +#define SHARED_NOMEM (SHARED_ERRBASE + 6) +#define SHARED_AGAIN (SHARED_ERRBASE + 7) +#define SHARED_NOFILE (SHARED_ERRBASE + 8) +#define SHARED_NORESIZE (SHARED_ERRBASE + 9) + +#define HEADER_NOT_EMPTY 201 /* header already contains keywords */ +#define KEY_NO_EXIST 202 /* keyword not found in header */ +#define KEY_OUT_BOUNDS 203 /* keyword record number is out of bounds */ +#define VALUE_UNDEFINED 204 /* keyword value field is blank */ +#define NO_QUOTE 205 /* string is missing the closing quote */ +#define BAD_INDEX_KEY 206 /* illegal indexed keyword name */ +#define BAD_KEYCHAR 207 /* illegal character in keyword name or card */ +#define BAD_ORDER 208 /* required keywords out of order */ +#define NOT_POS_INT 209 /* keyword value is not a positive integer */ +#define NO_END 210 /* couldn't find END keyword */ +#define BAD_BITPIX 211 /* illegal BITPIX keyword value*/ +#define BAD_NAXIS 212 /* illegal NAXIS keyword value */ +#define BAD_NAXES 213 /* illegal NAXISn keyword value */ +#define BAD_PCOUNT 214 /* illegal PCOUNT keyword value */ +#define BAD_GCOUNT 215 /* illegal GCOUNT keyword value */ +#define BAD_TFIELDS 216 /* illegal TFIELDS keyword value */ +#define NEG_WIDTH 217 /* negative table row size */ +#define NEG_ROWS 218 /* negative number of rows in table */ +#define COL_NOT_FOUND 219 /* column with this name not found in table */ +#define BAD_SIMPLE 220 /* illegal value of SIMPLE keyword */ +#define NO_SIMPLE 221 /* Primary array doesn't start with SIMPLE */ +#define NO_BITPIX 222 /* Second keyword not BITPIX */ +#define NO_NAXIS 223 /* Third keyword not NAXIS */ +#define NO_NAXES 224 /* Couldn't find all the NAXISn keywords */ +#define NO_XTENSION 225 /* HDU doesn't start with XTENSION keyword */ +#define NOT_ATABLE 226 /* the CHDU is not an ASCII table extension */ +#define NOT_BTABLE 227 /* the CHDU is not a binary table extension */ +#define NO_PCOUNT 228 /* couldn't find PCOUNT keyword */ +#define NO_GCOUNT 229 /* couldn't find GCOUNT keyword */ +#define NO_TFIELDS 230 /* couldn't find TFIELDS keyword */ +#define NO_TBCOL 231 /* couldn't find TBCOLn keyword */ +#define NO_TFORM 232 /* couldn't find TFORMn keyword */ +#define NOT_IMAGE 233 /* the CHDU is not an IMAGE extension */ +#define BAD_TBCOL 234 /* TBCOLn keyword value < 0 or > rowlength */ +#define NOT_TABLE 235 /* the CHDU is not a table */ +#define COL_TOO_WIDE 236 /* column is too wide to fit in table */ +#define COL_NOT_UNIQUE 237 /* more than 1 column name matches template */ +#define BAD_ROW_WIDTH 241 /* sum of column widths not = NAXIS1 */ +#define UNKNOWN_EXT 251 /* unrecognizable FITS extension type */ +#define UNKNOWN_REC 252 /* unrecognizable FITS record */ +#define END_JUNK 253 /* END keyword is not blank */ +#define BAD_HEADER_FILL 254 /* Header fill area not blank */ +#define BAD_DATA_FILL 255 /* Data fill area not blank or zero */ +#define BAD_TFORM 261 /* illegal TFORM format code */ +#define BAD_TFORM_DTYPE 262 /* unrecognizable TFORM datatype code */ +#define BAD_TDIM 263 /* illegal TDIMn keyword value */ +#define BAD_HEAP_PTR 264 /* invalid BINTABLE heap address */ + +#define BAD_HDU_NUM 301 /* HDU number < 1 or > MAXHDU */ +#define BAD_COL_NUM 302 /* column number < 1 or > tfields */ +#define NEG_FILE_POS 304 /* tried to move before beginning of file */ +#define NEG_BYTES 306 /* tried to read or write negative bytes */ +#define BAD_ROW_NUM 307 /* illegal starting row number in table */ +#define BAD_ELEM_NUM 308 /* illegal starting element number in vector */ +#define NOT_ASCII_COL 309 /* this is not an ASCII string column */ +#define NOT_LOGICAL_COL 310 /* this is not a logical datatype column */ +#define BAD_ATABLE_FORMAT 311 /* ASCII table column has wrong format */ +#define BAD_BTABLE_FORMAT 312 /* Binary table column has wrong format */ +#define NO_NULL 314 /* null value has not been defined */ +#define NOT_VARI_LEN 317 /* this is not a variable length column */ +#define BAD_DIMEN 320 /* illegal number of dimensions in array */ +#define BAD_PIX_NUM 321 /* first pixel number greater than last pixel */ +#define ZERO_SCALE 322 /* illegal BSCALE or TSCALn keyword = 0 */ +#define NEG_AXIS 323 /* illegal axis length < 1 */ + +#define NOT_GROUP_TABLE 340 +#define HDU_ALREADY_MEMBER 341 +#define MEMBER_NOT_FOUND 342 +#define GROUP_NOT_FOUND 343 +#define BAD_GROUP_ID 344 +#define TOO_MANY_HDUS_TRACKED 345 +#define HDU_ALREADY_TRACKED 346 +#define BAD_OPTION 347 +#define IDENTICAL_POINTERS 348 +#define BAD_GROUP_ATTACH 349 +#define BAD_GROUP_DETACH 350 + +#define BAD_I2C 401 /* bad int to formatted string conversion */ +#define BAD_F2C 402 /* bad float to formatted string conversion */ +#define BAD_INTKEY 403 /* can't interprete keyword value as integer */ +#define BAD_LOGICALKEY 404 /* can't interprete keyword value as logical */ +#define BAD_FLOATKEY 405 /* can't interprete keyword value as float */ +#define BAD_DOUBLEKEY 406 /* can't interprete keyword value as double */ +#define BAD_C2I 407 /* bad formatted string to int conversion */ +#define BAD_C2F 408 /* bad formatted string to float conversion */ +#define BAD_C2D 409 /* bad formatted string to double conversion */ +#define BAD_DATATYPE 410 /* bad keyword datatype code */ +#define BAD_DECIM 411 /* bad number of decimal places specified */ +#define NUM_OVERFLOW 412 /* overflow during datatype conversion */ + +# define DATA_COMPRESSION_ERR 413 /* error in imcompress routines */ +# define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */ +# define NO_COMPRESSED_TILE 415 /* compressed tile doesn't exist */ + +#define BAD_DATE 420 /* error in date or time conversion */ + +#define PARSE_SYNTAX_ERR 431 /* syntax error in parser expression */ +#define PARSE_BAD_TYPE 432 /* expression did not evaluate to desired type */ +#define PARSE_LRG_VECTOR 433 /* vector result too large to return in array */ +#define PARSE_NO_OUTPUT 434 /* data parser failed not sent an out column */ +#define PARSE_BAD_COL 435 /* bad data encounter while parsing column */ +#define PARSE_BAD_OUTPUT 436 /* Output file not of proper type */ + +#define ANGLE_TOO_BIG 501 /* celestial angle too large for projection */ +#define BAD_WCS_VAL 502 /* bad celestial coordinate or pixel value */ +#define WCS_ERROR 503 /* error in celestial coordinate calculation */ +#define BAD_WCS_PROJ 504 /* unsupported type of celestial projection */ +#define NO_WCS_KEY 505 /* celestial coordinate keywords not found */ +#define APPROX_WCS_KEY 506 /* approximate WCS keywords were calculated */ + +#define NO_CLOSE_ERROR 999 /* special value used internally to switch off */ + /* the error message from ffclos and ffchdu */ + +/*------- following error codes are used in the grparser.c file -----------*/ +#define NGP_ERRBASE (360) /* base chosen so not to interfere with CFITSIO */ +#define NGP_OK (0) +#define NGP_NO_MEMORY (NGP_ERRBASE + 0) /* malloc failed */ +#define NGP_READ_ERR (NGP_ERRBASE + 1) /* read error from file */ +#define NGP_NUL_PTR (NGP_ERRBASE + 2) /* null pointer passed as argument */ +#define NGP_EMPTY_CURLINE (NGP_ERRBASE + 3) /* line read seems to be empty */ +#define NGP_UNREAD_QUEUE_FULL (NGP_ERRBASE + 4) /* cannot unread more then 1 line (or single line twice) */ +#define NGP_INC_NESTING (NGP_ERRBASE + 5) /* too deep include file nesting (inf. loop ?) */ +#define NGP_ERR_FOPEN (NGP_ERRBASE + 6) /* fopen() failed, cannot open file */ +#define NGP_EOF (NGP_ERRBASE + 7) /* end of file encountered */ +#define NGP_BAD_ARG (NGP_ERRBASE + 8) /* bad arguments passed */ +#define NGP_TOKEN_NOT_EXPECT (NGP_ERRBASE + 9) /* token not expected here */ + +/* The following exclusion if __CINT__ is defined is needed for ROOT */ +#ifndef __CINT__ +/* the following 3 lines are needed to support C++ compilers */ +#ifdef __cplusplus +extern "C" { +#endif +#endif + +int CFITS2Unit( fitsfile *fptr ); +CFITS_API fitsfile* CUnit2FITS(int unit); + +/*---------------- FITS file URL parsing routines -------------*/ +int CFITS_API fits_get_token (char **ptr, char *delimiter, char *token, int *isanumber); +int CFITS_API fits_get_token2(char **ptr, char *delimiter, char **token, int *isanumber, int *status); +char CFITS_API *fits_split_names(char *list); +int CFITS_API ffiurl( char *url, char *urltype, char *infile, + char *outfile, char *extspec, char *rowfilter, + char *binspec, char *colspec, int *status); +int CFITS_API ffifile (char *url, char *urltype, char *infile, + char *outfile, char *extspec, char *rowfilter, + char *binspec, char *colspec, char *pixfilter, int *status); +int CFITS_API ffifile2 (char *url, char *urltype, char *infile, + char *outfile, char *extspec, char *rowfilter, + char *binspec, char *colspec, char *pixfilter, char *compspec, int *status); +int CFITS_API ffrtnm(char *url, char *rootname, int *status); +int CFITS_API ffexist(const char *infile, int *exists, int *status); +int CFITS_API ffexts(char *extspec, int *extnum, char *extname, int *extvers, + int *hdutype, char *colname, char *rowexpress, int *status); +int CFITS_API ffextn(char *url, int *extension_num, int *status); +int CFITS_API ffurlt(fitsfile *fptr, char *urlType, int *status); +int CFITS_API ffbins(char *binspec, int *imagetype, int *haxis, + char colname[4][FLEN_VALUE], double *minin, + double *maxin, double *binsizein, + char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], double *weight, char *wtname, + int *recip, int *status); +int CFITS_API ffbinr(char **binspec, char *colname, double *minin, + double *maxin, double *binsizein, char *minname, + char *maxname, char *binname, int *status); +int CFITS_API fits_copy_cell2image(fitsfile *fptr, fitsfile *newptr, char *colname, + long rownum, int *status); +int CFITS_API fits_copy_image2cell(fitsfile *fptr, fitsfile *newptr, char *colname, + long rownum, int copykeyflag, int *status); +int CFITS_API fits_copy_pixlist2image(fitsfile *infptr, fitsfile *outfptr, int firstkey, /* I - first HDU record number to start with */ + int naxis, int *colnum, int *status); +int CFITS_API ffimport_file( char *filename, char **contents, int *status ); +int CFITS_API ffrwrg( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges, + long *minrow, long *maxrow, int *status); +int CFITS_API ffrwrgll( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges, + LONGLONG *minrow, LONGLONG *maxrow, int *status); +/*---------------- FITS file I/O routines -------------*/ +int CFITS_API fits_init_cfitsio(void); +int CFITS_API ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr, + size_t *buffsize, size_t deltasize, + void *(*mem_realloc)(void *p, size_t newsize), + int *status); +int CFITS_API ffopen(fitsfile **fptr, const char *filename, int iomode, int *status); +int CFITS_API ffopentest(int soname, fitsfile **fptr, const char *filename, int iomode, int *status); + +int CFITS_API ffdopn(fitsfile **fptr, const char *filename, int iomode, int *status); +int CFITS_API ffeopn(fitsfile **fptr, const char *filename, int iomode, + char *extlist, int *hdutype, int *status); +int CFITS_API fftopn(fitsfile **fptr, const char *filename, int iomode, int *status); +int CFITS_API ffiopn(fitsfile **fptr, const char *filename, int iomode, int *status); +int CFITS_API ffdkopn(fitsfile **fptr, const char *filename, int iomode, int *status); +int CFITS_API ffreopen(fitsfile *openfptr, fitsfile **newfptr, int *status); +int CFITS_API ffinit( fitsfile **fptr, const char *filename, int *status); +int CFITS_API ffdkinit(fitsfile **fptr, const char *filename, int *status); +int CFITS_API ffimem(fitsfile **fptr, void **buffptr, + size_t *buffsize, size_t deltasize, + void *(*mem_realloc)(void *p, size_t newsize), + int *status); +int CFITS_API fftplt(fitsfile **fptr, const char *filename, const char *tempname, + int *status); +int CFITS_API ffflus(fitsfile *fptr, int *status); +int CFITS_API ffflsh(fitsfile *fptr, int clearbuf, int *status); +int CFITS_API ffclos(fitsfile *fptr, int *status); +int CFITS_API ffdelt(fitsfile *fptr, int *status); +int CFITS_API ffflnm(fitsfile *fptr, char *filename, int *status); +int CFITS_API ffflmd(fitsfile *fptr, int *filemode, int *status); +int CFITS_API fits_delete_iraf_file(const char *filename, int *status); + +/*---------------- utility routines -------------*/ + +float CFITS_API ffvers(float *version); +void CFITS_API ffupch(char *string); +void CFITS_API ffgerr(int status, char *errtext); +void CFITS_API ffpmsg(const char *err_message); +void CFITS_API ffpmrk(void); +int CFITS_API ffgmsg(char *err_message); +void CFITS_API ffcmsg(void); +void CFITS_API ffcmrk(void); +void CFITS_API ffrprt(FILE *stream, int status); +void CFITS_API ffcmps(char *templt, char *colname, int casesen, int *match, + int *exact); +int CFITS_API fftkey(const char *keyword, int *status); +int CFITS_API fftrec(char *card, int *status); +int CFITS_API ffnchk(fitsfile *fptr, int *status); +int CFITS_API ffkeyn(const char *keyroot, int value, char *keyname, int *status); +int CFITS_API ffnkey(int value, const char *keyroot, char *keyname, int *status); +int CFITS_API ffgkcl(char *card); +int CFITS_API ffdtyp(const char *cval, char *dtype, int *status); +int CFITS_API ffinttyp(char *cval, int *datatype, int *negative, int *status); +int CFITS_API ffpsvc(char *card, char *value, char *comm, int *status); +int CFITS_API ffgknm(char *card, char *name, int *length, int *status); +int CFITS_API ffgthd(char *tmplt, char *card, int *hdtype, int *status); +int CFITS_API ffmkky(const char *keyname, char *keyval, const char *comm, char *card, int *status); +int CFITS_API fits_translate_keyword(char *inrec, char *outrec, char *patterns[][2], + int npat, int n_value, int n_offset, int n_range, int *pat_num, + int *i, int *j, int *m, int *n, int *status); +int CFITS_API fits_translate_keywords(fitsfile *infptr, fitsfile *outfptr, + int firstkey, char *patterns[][2], + int npat, int n_value, int n_offset, int n_range, int *status); +int CFITS_API ffasfm(char *tform, int *datacode, long *width, int *decim, int *status); +int CFITS_API ffbnfm(char *tform, int *datacode, long *repeat, long *width, int *status); +int CFITS_API ffbnfmll(char *tform, int *datacode, LONGLONG *repeat, long *width, int *status); +int CFITS_API ffgabc(int tfields, char **tform, int space, long *rowlen, long *tbcol, + int *status); +int CFITS_API fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre, + int *status); +/* ffmbyt should not normally be used in application programs, but it is + defined here as a publicly available routine because there are a few + rare cases where it is needed +*/ +int CFITS_API ffmbyt(fitsfile *fptr, LONGLONG bytpos, int ignore_err, int *status); +/*----------------- write single keywords --------------*/ +int CFITS_API ffpky(fitsfile *fptr, int datatype, const char *keyname, void *value, + const char *comm, int *status); +int CFITS_API ffprec(fitsfile *fptr, const char *card, int *status); +int CFITS_API ffpcom(fitsfile *fptr, const char *comm, int *status); +int CFITS_API ffpunt(fitsfile *fptr, const char *keyname, const char *unit, int *status); +int CFITS_API ffphis(fitsfile *fptr, const char *history, int *status); +int CFITS_API ffpdat(fitsfile *fptr, int *status); +int CFITS_API ffverifydate(int year, int month, int day, int *status); +int CFITS_API ffgstm(char *timestr, int *timeref, int *status); +int CFITS_API ffgsdt(int *day, int *month, int *year, int *status); +int CFITS_API ffdt2s(int year, int month, int day, char *datestr, int *status); +int CFITS_API fftm2s(int year, int month, int day, int hour, int minute, double second, + int decimals, char *datestr, int *status); +int CFITS_API ffs2dt(char *datestr, int *year, int *month, int *day, int *status); +int CFITS_API ffs2tm(char *datestr, int *year, int *month, int *day, int *hour, + int *minute, double *second, int *status); +int CFITS_API ffpkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status); +int CFITS_API ffpkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffpkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffplsw(fitsfile *fptr, int *status); +int CFITS_API ffpkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status); +int CFITS_API ffpkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status); +int CFITS_API ffpkyuj(fitsfile *fptr, const char *keyname, ULONGLONG value, const char *comm, int *status); +int CFITS_API ffpkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffpkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffpkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffpkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffpkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffpkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); +int CFITS_API ffpkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffpkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); +int CFITS_API ffpkyt(fitsfile *fptr, const char *keyname, long intval, double frac, const char *comm, + int *status); +int CFITS_API ffptdm( fitsfile *fptr, int colnum, int naxis, long naxes[], int *status); +int CFITS_API ffptdmll( fitsfile *fptr, int colnum, int naxis, LONGLONG naxes[], int *status); + +/*----------------- write array of keywords --------------*/ +int CFITS_API ffpkns(fitsfile *fptr, const char *keyroot, int nstart, int nkey, char *value[], + char *comm[], int *status); +int CFITS_API ffpknl(fitsfile *fptr, const char *keyroot, int nstart, int nkey, int *value, + char *comm[], int *status); +int CFITS_API ffpknj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, long *value, + char *comm[], int *status); +int CFITS_API ffpknjj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, LONGLONG *value, + char *comm[], int *status); +int CFITS_API ffpknf(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value, + int decim, char *comm[], int *status); +int CFITS_API ffpkne(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value, + int decim, char *comm[], int *status); +int CFITS_API ffpkng(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value, + int decim, char *comm[], int *status); +int CFITS_API ffpknd(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value, + int decim, char *comm[], int *status); +int CFITS_API ffcpky(fitsfile *infptr,fitsfile *outfptr,int incol,int outcol, + char *rootname, int *status); + +/*----------------- write required header keywords --------------*/ +int CFITS_API ffphps( fitsfile *fptr, int bitpix, int naxis, long naxes[], int *status); +int CFITS_API ffphpsll( fitsfile *fptr, int bitpix, int naxis, LONGLONG naxes[], int *status); +int CFITS_API ffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[], + LONGLONG pcount, LONGLONG gcount, int extend, int *status); +int CFITS_API ffphprll( fitsfile *fptr, int simple, int bitpix, int naxis, LONGLONG naxes[], + LONGLONG pcount, LONGLONG gcount, int extend, int *status); +int CFITS_API ffphtb(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype, + long *tbcol, char **tform, char **tunit, const char *extname, int *status); +int CFITS_API ffphbn(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, + char **tform, char **tunit, const char *extname, LONGLONG pcount, int *status); +int CFITS_API ffphext( fitsfile *fptr, const char *xtension, int bitpix, int naxis, long naxes[], + LONGLONG pcount, LONGLONG gcount, int *status); +/*----------------- write template keywords --------------*/ +int CFITS_API ffpktp(fitsfile *fptr, const char *filename, int *status); + +/*------------------ get header information --------------*/ +int CFITS_API ffghsp(fitsfile *fptr, int *nexist, int *nmore, int *status); +int CFITS_API ffghps(fitsfile *fptr, int *nexist, int *position, int *status); + +/*------------------ move position in header -------------*/ +int CFITS_API ffmaky(fitsfile *fptr, int nrec, int *status); +int CFITS_API ffmrky(fitsfile *fptr, int nrec, int *status); + +/*------------------ read single keywords -----------------*/ +int CFITS_API ffgnxk(fitsfile *fptr, char **inclist, int ninc, char **exclist, + int nexc, char *card, int *status); +int CFITS_API ffgrec(fitsfile *fptr, int nrec, char *card, int *status); +int CFITS_API ffgcrd(fitsfile *fptr, const char *keyname, char *card, int *status); +int CFITS_API ffgstr(fitsfile *fptr, const char *string, char *card, int *status); +int CFITS_API ffgunt(fitsfile *fptr, const char *keyname, char *unit, int *status); +int CFITS_API ffgkyn(fitsfile *fptr, int nkey, char *keyname, char *keyval, char *comm, + int *status); +int CFITS_API ffgkey(fitsfile *fptr, const char *keyname, char *keyval, char *comm, + int *status); + +int CFITS_API ffgky( fitsfile *fptr, int datatype, const char *keyname, void *value, + char *comm, int *status); +int CFITS_API ffgkys(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status); +int CFITS_API ffgksl(fitsfile *fptr, const char *keyname, int *length, int *status); +int CFITS_API ffgkls(fitsfile *fptr, const char *keyname, char **value, char *comm, int *status); +int CFITS_API ffgsky(fitsfile *fptr, const char *keyname, int firstchar, int maxchar, + char *value, int *valuelen, char *comm, int *status); +int CFITS_API fffree(void *value, int *status); +int CFITS_API fffkls(char *value, int *status); +int CFITS_API ffgkyl(fitsfile *fptr, const char *keyname, int *value, char *comm, int *status); +int CFITS_API ffgkyj(fitsfile *fptr, const char *keyname, long *value, char *comm, int *status); +int CFITS_API ffgkyjj(fitsfile *fptr, const char *keyname, LONGLONG *value, char *comm, int *status); +int CFITS_API ffgkyujj(fitsfile *fptr, const char *keyname, ULONGLONG *value, char *comm, int *status); +int CFITS_API ffgkye(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status); +int CFITS_API ffgkyd(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status); +int CFITS_API ffgkyc(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status); +int CFITS_API ffgkym(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status); +int CFITS_API ffgkyt(fitsfile *fptr, const char *keyname, long *ivalue, double *dvalue, + char *comm, int *status); +int CFITS_API ffgtdm(fitsfile *fptr, int colnum, int maxdim, int *naxis, long naxes[], + int *status); +int CFITS_API ffgtdmll(fitsfile *fptr, int colnum, int maxdim, int *naxis, LONGLONG naxes[], + int *status); +int CFITS_API ffdtdm(fitsfile *fptr, char *tdimstr, int colnum, int maxdim, + int *naxis, long naxes[], int *status); +int CFITS_API ffdtdmll(fitsfile *fptr, char *tdimstr, int colnum, int maxdim, + int *naxis, LONGLONG naxes[], int *status); + +/*------------------ read array of keywords -----------------*/ +int CFITS_API ffgkns(fitsfile *fptr, const char *keyname, int nstart, int nmax, char *value[], + int *nfound, int *status); +int CFITS_API ffgknl(fitsfile *fptr, const char *keyname, int nstart, int nmax, int *value, + int *nfound, int *status); +int CFITS_API ffgknj(fitsfile *fptr, const char *keyname, int nstart, int nmax, long *value, + int *nfound, int *status); +int CFITS_API ffgknjj(fitsfile *fptr, const char *keyname, int nstart, int nmax, LONGLONG *value, + int *nfound, int *status); +int CFITS_API ffgkne(fitsfile *fptr, const char *keyname, int nstart, int nmax, float *value, + int *nfound, int *status); +int CFITS_API ffgknd(fitsfile *fptr, const char *keyname, int nstart, int nmax, double *value, + int *nfound, int *status); +int CFITS_API ffh2st(fitsfile *fptr, char **header, int *status); +int CFITS_API ffhdr2str( fitsfile *fptr, int exclude_comm, char **exclist, + int nexc, char **header, int *nkeys, int *status); +int CFITS_API ffcnvthdr2str( fitsfile *fptr, int exclude_comm, char **exclist, + int nexc, char **header, int *nkeys, int *status); + +/*----------------- read required header keywords --------------*/ +int CFITS_API ffghpr(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, + long naxes[], long *pcount, long *gcount, int *extend, int *status); + +int CFITS_API ffghprll(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, + LONGLONG naxes[], long *pcount, long *gcount, int *extend, int *status); + +int CFITS_API ffghtb(fitsfile *fptr,int maxfield, long *naxis1, long *naxis2, + int *tfields, char **ttype, long *tbcol, char **tform, char **tunit, + char *extname, int *status); + +int CFITS_API ffghtbll(fitsfile *fptr,int maxfield, LONGLONG *naxis1, LONGLONG *naxis2, + int *tfields, char **ttype, LONGLONG *tbcol, char **tform, char **tunit, + char *extname, int *status); + + +int CFITS_API ffghbn(fitsfile *fptr, int maxfield, long *naxis2, int *tfields, + char **ttype, char **tform, char **tunit, char *extname, + long *pcount, int *status); + +int CFITS_API ffghbnll(fitsfile *fptr, int maxfield, LONGLONG *naxis2, int *tfields, + char **ttype, char **tform, char **tunit, char *extname, + LONGLONG *pcount, int *status); + +/*--------------------- update keywords ---------------*/ +int CFITS_API ffuky(fitsfile *fptr, int datatype, const char *keyname, void *value, + const char *comm, int *status); +int CFITS_API ffucrd(fitsfile *fptr, const char *keyname, const char *card, int *status); +int CFITS_API ffukyu(fitsfile *fptr, const char *keyname, const char *comm, int *status); +int CFITS_API ffukys(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status); +int CFITS_API ffukls(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status); +int CFITS_API ffukyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status); +int CFITS_API ffukyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status); +int CFITS_API ffukyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffukye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffukyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffukyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffukyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffukym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); +int CFITS_API ffukfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffukfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); + +/*--------------------- modify keywords ---------------*/ +int CFITS_API ffmrec(fitsfile *fptr, int nkey, const char *card, int *status); +int CFITS_API ffmcrd(fitsfile *fptr, const char *keyname, const char *card, int *status); +int CFITS_API ffmnam(fitsfile *fptr, const char *oldname, const char *newname, int *status); +int CFITS_API ffmcom(fitsfile *fptr, const char *keyname, const char *comm, int *status); +int CFITS_API ffmkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status); +int CFITS_API ffmkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffmkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffmkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status); +int CFITS_API ffmkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status); +int CFITS_API ffmkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffmkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffmkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffmkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffmkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffmkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); +int CFITS_API ffmkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffmkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); + +/*--------------------- insert keywords ---------------*/ +int CFITS_API ffirec(fitsfile *fptr, int nkey, const char *card, int *status); +int CFITS_API ffikey(fitsfile *fptr, const char *card, int *status); +int CFITS_API ffikyu(fitsfile *fptr, const char *keyname, const char *comm, int *status); +int CFITS_API ffikys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffikls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status); +int CFITS_API ffikyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status); +int CFITS_API ffikyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status); +int CFITS_API ffikyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffikye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm, + int *status); +int CFITS_API ffikyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffikyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm, + int *status); +int CFITS_API ffikyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffikym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); +int CFITS_API ffikfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm, + int *status); +int CFITS_API ffikfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm, + int *status); + +/*--------------------- delete keywords ---------------*/ +int CFITS_API ffdkey(fitsfile *fptr, const char *keyname, int *status); +int CFITS_API ffdstr(fitsfile *fptr, const char *string, int *status); +int CFITS_API ffdrec(fitsfile *fptr, int keypos, int *status); + +/*--------------------- get HDU information -------------*/ +int CFITS_API ffghdn(fitsfile *fptr, int *chdunum); +int CFITS_API ffghdt(fitsfile *fptr, int *exttype, int *status); +int CFITS_API ffghad(fitsfile *fptr, long *headstart, long *datastart, long *dataend, + int *status); +int CFITS_API ffghadll(fitsfile *fptr, LONGLONG *headstart, LONGLONG *datastart, + LONGLONG *dataend, int *status); +int CFITS_API ffghof(fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend, + int *status); +int CFITS_API ffgipr(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis, + long *naxes, int *status); +int CFITS_API ffgiprll(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis, + LONGLONG *naxes, int *status); +int CFITS_API ffgidt(fitsfile *fptr, int *imgtype, int *status); +int CFITS_API ffgiet(fitsfile *fptr, int *imgtype, int *status); +int CFITS_API ffgidm(fitsfile *fptr, int *naxis, int *status); +int CFITS_API ffgisz(fitsfile *fptr, int nlen, long *naxes, int *status); +int CFITS_API ffgiszll(fitsfile *fptr, int nlen, LONGLONG *naxes, int *status); + +/*--------------------- HDU operations -------------*/ +int CFITS_API ffmahd(fitsfile *fptr, int hdunum, int *exttype, int *status); +int CFITS_API ffmrhd(fitsfile *fptr, int hdumov, int *exttype, int *status); +int CFITS_API ffmnhd(fitsfile *fptr, int exttype, char *hduname, int hduvers, + int *status); +int CFITS_API ffthdu(fitsfile *fptr, int *nhdu, int *status); +int CFITS_API ffcrhd(fitsfile *fptr, int *status); +int CFITS_API ffcrim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); +int CFITS_API ffcrimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); +int CFITS_API ffcrtb(fitsfile *fptr, int tbltype, LONGLONG naxis2, int tfields, char **ttype, + char **tform, char **tunit, const char *extname, int *status); +int CFITS_API ffiimg(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); +int CFITS_API ffiimgll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); +int CFITS_API ffitab(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype, + long *tbcol, char **tform, char **tunit, const char *extname, int *status); +int CFITS_API ffibin(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, char **tform, + char **tunit, const char *extname, LONGLONG pcount, int *status); +int CFITS_API ffrsim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status); +int CFITS_API ffrsimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status); +int CFITS_API ffdhdu(fitsfile *fptr, int *hdutype, int *status); +int CFITS_API ffcopy(fitsfile *infptr, fitsfile *outfptr, int morekeys, int *status); +int CFITS_API ffcpfl(fitsfile *infptr, fitsfile *outfptr, int prev, int cur, int follow, + int *status); +int CFITS_API ffcphd(fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API ffcpdt(fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API ffchfl(fitsfile *fptr, int *status); +int CFITS_API ffcdfl(fitsfile *fptr, int *status); +int CFITS_API ffwrhdu(fitsfile *fptr, FILE *outstream, int *status); + +int CFITS_API ffrdef(fitsfile *fptr, int *status); +int CFITS_API ffrhdu(fitsfile *fptr, int *hdutype, int *status); +int CFITS_API ffhdef(fitsfile *fptr, int morekeys, int *status); +int CFITS_API ffpthp(fitsfile *fptr, long theap, int *status); + +int CFITS_API ffcsum(fitsfile *fptr, long nrec, unsigned long *sum, int *status); +void CFITS_API ffesum(unsigned long sum, int complm, char *ascii); +unsigned long CFITS_API ffdsum(char *ascii, int complm, unsigned long *sum); +int CFITS_API ffpcks(fitsfile *fptr, int *status); +int CFITS_API ffupck(fitsfile *fptr, int *status); +int CFITS_API ffvcks(fitsfile *fptr, int *datastatus, int *hdustatus, int *status); +int CFITS_API ffgcks(fitsfile *fptr, unsigned long *datasum, unsigned long *hdusum, + int *status); + +/*--------------------- define scaling or null values -------------*/ +int CFITS_API ffpscl(fitsfile *fptr, double scale, double zeroval, int *status); +int CFITS_API ffpnul(fitsfile *fptr, LONGLONG nulvalue, int *status); +int CFITS_API fftscl(fitsfile *fptr, int colnum, double scale, double zeroval, int *status); +int CFITS_API fftnul(fitsfile *fptr, int colnum, LONGLONG nulvalue, int *status); +int CFITS_API ffsnul(fitsfile *fptr, int colnum, char *nulstring, int *status); + +/*--------------------- get column information -------------*/ +int CFITS_API ffgcno(fitsfile *fptr, int casesen, char *templt, int *colnum, + int *status); +int CFITS_API ffgcnn(fitsfile *fptr, int casesen, char *templt, char *colname, + int *colnum, int *status); + +int CFITS_API ffgtcl(fitsfile *fptr, int colnum, int *typecode, long *repeat, + long *width, int *status); +int CFITS_API ffgtclll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, + LONGLONG *width, int *status); +int CFITS_API ffeqty(fitsfile *fptr, int colnum, int *typecode, long *repeat, + long *width, int *status); +int CFITS_API ffeqtyll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat, + LONGLONG *width, int *status); +int CFITS_API ffgncl(fitsfile *fptr, int *ncols, int *status); +int CFITS_API ffgnrw(fitsfile *fptr, long *nrows, int *status); +int CFITS_API ffgnrwll(fitsfile *fptr, LONGLONG *nrows, int *status); +int CFITS_API ffgacl(fitsfile *fptr, int colnum, char *ttype, long *tbcol, + char *tunit, char *tform, double *tscal, double *tzero, + char *tnull, char *tdisp, int *status); +int CFITS_API ffgbcl(fitsfile *fptr, int colnum, char *ttype, char *tunit, + char *dtype, long *repeat, double *tscal, double *tzero, + long *tnull, char *tdisp, int *status); +int CFITS_API ffgbclll(fitsfile *fptr, int colnum, char *ttype, char *tunit, + char *dtype, LONGLONG *repeat, double *tscal, double *tzero, + LONGLONG *tnull, char *tdisp, int *status); +int CFITS_API ffgrsz(fitsfile *fptr, long *nrows, int *status); +int CFITS_API ffgcdw(fitsfile *fptr, int colnum, int *width, int *status); + +/*--------------------- read primary array or image elements -------------*/ +int CFITS_API ffgpxv(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, + void *nulval, void *array, int *anynul, int *status); +int CFITS_API ffgpxvll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, + void *nulval, void *array, int *anynul, int *status); +int CFITS_API ffgpxf(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, + void *array, char *nullarray, int *anynul, int *status); +int CFITS_API ffgpxfll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, + void *array, char *nullarray, int *anynul, int *status); +int CFITS_API ffgsv(fitsfile *fptr, int datatype, long *blc, long *trc, long *inc, + void *nulval, void *array, int *anynul, int *status); + +int CFITS_API ffgpv(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, + void *nulval, void *array, int *anynul, int *status); +int CFITS_API ffgpf(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, + void *array, char *nullarray, int *anynul, int *status); +int CFITS_API ffgpvb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, unsigned + char nulval, unsigned char *array, int *anynul, int *status); +int CFITS_API ffgpvsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, signed + char nulval, signed char *array, int *anynul, int *status); +int CFITS_API ffgpvui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned short nulval, unsigned short *array, int *anynul, + int *status); +int CFITS_API ffgpvi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + short nulval, short *array, int *anynul, int *status); +int CFITS_API ffgpvuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned long nulval, unsigned long *array, int *anynul, + int *status); +int CFITS_API ffgpvj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + long nulval, long *array, int *anynul, int *status); +int CFITS_API ffgpvujj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + ULONGLONG nulval, ULONGLONG *array, int *anynul, int *status); +int CFITS_API ffgpvjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + LONGLONG nulval, LONGLONG *array, int *anynul, int *status); +int CFITS_API ffgpvuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned int nulval, unsigned int *array, int *anynul, int *status); +int CFITS_API ffgpvk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + int nulval, int *array, int *anynul, int *status); +int CFITS_API ffgpve(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + float nulval, float *array, int *anynul, int *status); +int CFITS_API ffgpvd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + double nulval, double *array, int *anynul, int *status); + +int CFITS_API ffgpfb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned char *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + signed char *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned short *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + short *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned long *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + long *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfujj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + ULONGLONG *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + LONGLONG *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned int *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + int *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfe(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + float *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgpfd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + double *array, char *nularray, int *anynul, int *status); + +int CFITS_API ffg2db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, unsigned char *array, + int *anynul, int *status); +int CFITS_API ffg2dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, signed char *array, + int *anynul, int *status); +int CFITS_API ffg2dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, unsigned short *array, + int *anynul, int *status); +int CFITS_API ffg2di(fitsfile *fptr, long group, short nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, short *array, + int *anynul, int *status); +int CFITS_API ffg2duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, unsigned long *array, + int *anynul, int *status); +int CFITS_API ffg2dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, long *array, + int *anynul, int *status); +int CFITS_API ffg2dujj(fitsfile *fptr, long group, ULONGLONG nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, ULONGLONG *array, + int *anynul, int *status); +int CFITS_API ffg2djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, LONGLONG *array, + int *anynul, int *status); +int CFITS_API ffg2duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, unsigned int *array, + int *anynul, int *status); +int CFITS_API ffg2dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, int *array, + int *anynul, int *status); +int CFITS_API ffg2de(fitsfile *fptr, long group, float nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, float *array, + int *anynul, int *status); +int CFITS_API ffg2dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols, + LONGLONG naxis1, LONGLONG naxis2, double *array, + int *anynul, int *status); + +int CFITS_API ffg3db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + unsigned char *array, int *anynul, int *status); +int CFITS_API ffg3dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + signed char *array, int *anynul, int *status); +int CFITS_API ffg3dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + unsigned short *array, int *anynul, int *status); +int CFITS_API ffg3di(fitsfile *fptr, long group, short nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + short *array, int *anynul, int *status); +int CFITS_API ffg3duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + unsigned long *array, int *anynul, int *status); +int CFITS_API ffg3dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + long *array, int *anynul, int *status); +int CFITS_API ffg3dujj(fitsfile *fptr, long group, ULONGLONG nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + ULONGLONG *array, int *anynul, int *status); +int CFITS_API ffg3djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + LONGLONG *array, int *anynul, int *status); +int CFITS_API ffg3duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + unsigned int *array, int *anynul, int *status); +int CFITS_API ffg3dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + int *array, int *anynul, int *status); +int CFITS_API ffg3de(fitsfile *fptr, long group, float nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + float *array, int *anynul, int *status); +int CFITS_API ffg3dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols, + LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3, + double *array, int *anynul, int *status); + +int CFITS_API ffgsvb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned char nulval, unsigned char *array, + int *anynul, int *status); +int CFITS_API ffgsvsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, signed char nulval, signed char *array, + int *anynul, int *status); +int CFITS_API ffgsvui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned short nulval, unsigned short *array, + int *anynul, int *status); +int CFITS_API ffgsvi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, short nulval, short *array, int *anynul, int *status); +int CFITS_API ffgsvuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned long nulval, unsigned long *array, + int *anynul, int *status); +int CFITS_API ffgsvj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, long nulval, long *array, int *anynul, int *status); +int CFITS_API ffgsvujj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, ULONGLONG nulval, ULONGLONG *array, int *anynul, + int *status); +int CFITS_API ffgsvjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, LONGLONG nulval, LONGLONG *array, int *anynul, + int *status); +int CFITS_API ffgsvuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned int nulval, unsigned int *array, + int *anynul, int *status); +int CFITS_API ffgsvk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, int nulval, int *array, int *anynul, int *status); +int CFITS_API ffgsve(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, float nulval, float *array, int *anynul, int *status); +int CFITS_API ffgsvd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, double nulval, double *array, int *anynul, + int *status); + +int CFITS_API ffgsfb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned char *array, char *flagval, + int *anynul, int *status); +int CFITS_API ffgsfsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, signed char *array, char *flagval, + int *anynul, int *status); +int CFITS_API ffgsfui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned short *array, char *flagval, int *anynul, + int *status); +int CFITS_API ffgsfi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, short *array, char *flagval, int *anynul, int *status); +int CFITS_API ffgsfuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned long *array, char *flagval, int *anynul, + int *status); +int CFITS_API ffgsfj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, long *array, char *flagval, int *anynul, int *status); +int CFITS_API ffgsfujj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, ULONGLONG *array, char *flagval, int *anynul, + int *status); +int CFITS_API ffgsfjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, LONGLONG *array, char *flagval, int *anynul, + int *status); +int CFITS_API ffgsfuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, unsigned int *array, char *flagval, int *anynul, + int *status); +int CFITS_API ffgsfk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, int *array, char *flagval, int *anynul, int *status); +int CFITS_API ffgsfe(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, float *array, char *flagval, int *anynul, int *status); +int CFITS_API ffgsfd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc, + long *trc, long *inc, double *array, char *flagval, int *anynul, + int *status); + +int CFITS_API ffggpb(fitsfile *fptr, long group, long firstelem, long nelem, + unsigned char *array, int *status); +int CFITS_API ffggpsb(fitsfile *fptr, long group, long firstelem, long nelem, + signed char *array, int *status); +int CFITS_API ffggpui(fitsfile *fptr, long group, long firstelem, long nelem, + unsigned short *array, int *status); +int CFITS_API ffggpi(fitsfile *fptr, long group, long firstelem, long nelem, + short *array, int *status); +int CFITS_API ffggpuj(fitsfile *fptr, long group, long firstelem, long nelem, + unsigned long *array, int *status); +int CFITS_API ffggpj(fitsfile *fptr, long group, long firstelem, long nelem, + long *array, int *status); +int CFITS_API ffggpujj(fitsfile *fptr, long group, long firstelem, long nelem, + ULONGLONG *array, int *status); +int CFITS_API ffggpjj(fitsfile *fptr, long group, long firstelem, long nelem, + LONGLONG *array, int *status); +int CFITS_API ffggpuk(fitsfile *fptr, long group, long firstelem, long nelem, + unsigned int *array, int *status); +int CFITS_API ffggpk(fitsfile *fptr, long group, long firstelem, long nelem, + int *array, int *status); +int CFITS_API ffggpe(fitsfile *fptr, long group, long firstelem, long nelem, + float *array, int *status); +int CFITS_API ffggpd(fitsfile *fptr, long group, long firstelem, long nelem, + double *array, int *status); + +/*--------------------- read column elements -------------*/ +int CFITS_API ffgcv( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, + LONGLONG firstelem, LONGLONG nelem, void *nulval, void *array, int *anynul, + int *status); +int CFITS_API ffgcf( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, + LONGLONG firstelem, LONGLONG nelem, void *array, char *nullarray, + int *anynul, int *status); +int CFITS_API ffgcvs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char *nulval, char **array, int *anynul, int *status); +int CFITS_API ffgcl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char *array, int *status); +int CFITS_API ffgcvl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char nulval, char *array, int *anynul, int *status); +int CFITS_API ffgcvb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned char nulval, unsigned char *array, + int *anynul, int *status); +int CFITS_API ffgcvsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, signed char nulval, signed char *array, + int *anynul, int *status); +int CFITS_API ffgcvui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned short nulval, unsigned short *array, + int *anynul, int *status); +int CFITS_API ffgcvi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, short nulval, short *array, int *anynul, int *status); +int CFITS_API ffgcvuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned long nulval, unsigned long *array, int *anynul, + int *status); +int CFITS_API ffgcvj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long nulval, long *array, int *anynul, int *status); +int CFITS_API ffgcvujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG nulval, ULONGLONG *array, int *anynul, + int *status); +int CFITS_API ffgcvjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, LONGLONG nulval, LONGLONG *array, int *anynul, + int *status); +int CFITS_API ffgcvuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned int nulval, unsigned int *array, int *anynul, + int *status); +int CFITS_API ffgcvk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int nulval, int *array, int *anynul, int *status); +int CFITS_API ffgcve(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float nulval, float *array, int *anynul, int *status); +int CFITS_API ffgcvd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double nulval, double *array, int *anynul, int *status); +int CFITS_API ffgcvc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float nulval, float *array, int *anynul, int *status); +int CFITS_API ffgcvm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double nulval, double *array, int *anynul, int *status); + +int CFITS_API ffgcx(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstbit, + LONGLONG nbits, char *larray, int *status); +int CFITS_API ffgcxui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, + long firstbit, int nbits, unsigned short *array, int *status); +int CFITS_API ffgcxuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, + long firstbit, int nbits, unsigned int *array, int *status); + +int CFITS_API ffgcfs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char **array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfl(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned char *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, signed char *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned short *array, char *nularray, int *anynul, + int *status); +int CFITS_API ffgcfi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, short *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned long *array, char *nularray, int *anynul, + int *status); +int CFITS_API ffgcfj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, LONGLONG *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned int *array, char *nularray, int *anynul, + int *status); +int CFITS_API ffgcfk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfe(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float *array, char *nularray, int *anynul, int *status); +int CFITS_API ffgcfm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double *array, char *nularray, int *anynul, int *status); + +int CFITS_API ffgdes(fitsfile *fptr, int colnum, LONGLONG rownum, long *length, + long *heapaddr, int *status); +int CFITS_API ffgdesll(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG *length, + LONGLONG *heapaddr, int *status); +int CFITS_API ffgdess(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, long *length, + long *heapaddr, int *status); +int CFITS_API ffgdessll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, LONGLONG *length, + LONGLONG *heapaddr, int *status); +int CFITS_API ffpdes(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG length, + LONGLONG heapaddr, int *status); +int CFITS_API fftheap(fitsfile *fptr, LONGLONG *heapsize, LONGLONG *unused, LONGLONG *overlap, + int *valid, int *status); +int CFITS_API ffcmph(fitsfile *fptr, int *status); + +int CFITS_API ffgtbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars, + unsigned char *values, int *status); + +int CFITS_API ffgextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status); +int CFITS_API ffpextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status); + +/*------------ write primary array or image elements -------------*/ +int CFITS_API ffppx(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, + void *array, int *status); +int CFITS_API ffppxll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, + void *array, int *status); +int CFITS_API ffppxn(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem, + void *array, void *nulval, int *status); +int CFITS_API ffppxnll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem, + void *array, void *nulval, int *status); +int CFITS_API ffppr(fitsfile *fptr, int datatype, LONGLONG firstelem, + LONGLONG nelem, void *array, int *status); +int CFITS_API ffpprb(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, unsigned char *array, int *status); +int CFITS_API ffpprsb(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, signed char *array, int *status); +int CFITS_API ffpprui(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, unsigned short *array, int *status); +int CFITS_API ffppri(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, short *array, int *status); +int CFITS_API ffppruj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, unsigned long *array, int *status); +int CFITS_API ffpprj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, long *array, int *status); +int CFITS_API ffppruk(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, unsigned int *array, int *status); +int CFITS_API ffpprk(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, int *array, int *status); +int CFITS_API ffppre(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, float *array, int *status); +int CFITS_API ffpprd(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, double *array, int *status); +int CFITS_API ffpprjj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, LONGLONG *array, int *status); +int CFITS_API ffpprujj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG *array, int *status); + +int CFITS_API ffppru(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + int *status); +int CFITS_API ffpprn(fitsfile *fptr, LONGLONG firstelem, LONGLONG nelem, int *status); + +int CFITS_API ffppn(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem, + void *array, void *nulval, int *status); +int CFITS_API ffppnb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned char *array, unsigned char nulval, int *status); +int CFITS_API ffppnsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + signed char *array, signed char nulval, int *status); +int CFITS_API ffppnui(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, unsigned short *array, unsigned short nulval, + int *status); +int CFITS_API ffppni(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, short *array, short nulval, int *status); +int CFITS_API ffppnj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, long *array, long nulval, int *status); +int CFITS_API ffppnuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned long *array, unsigned long nulval, int *status); +int CFITS_API ffppnuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, + unsigned int *array, unsigned int nulval, int *status); +int CFITS_API ffppnk(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, int *array, int nulval, int *status); +int CFITS_API ffppne(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, float *array, float nulval, int *status); +int CFITS_API ffppnd(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, double *array, double nulval, int *status); +int CFITS_API ffppnjj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, LONGLONG *array, LONGLONG nulval, int *status); +int CFITS_API ffppnujj(fitsfile *fptr, long group, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG *array, ULONGLONG nulval, int *status); + +int CFITS_API ffp2db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, unsigned char *array, int *status); +int CFITS_API ffp2dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, signed char *array, int *status); +int CFITS_API ffp2dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, unsigned short *array, int *status); +int CFITS_API ffp2di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, short *array, int *status); +int CFITS_API ffp2duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, unsigned long *array, int *status); +int CFITS_API ffp2dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, long *array, int *status); +int CFITS_API ffp2duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, unsigned int *array, int *status); +int CFITS_API ffp2dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, int *array, int *status); +int CFITS_API ffp2de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, float *array, int *status); +int CFITS_API ffp2dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, double *array, int *status); +int CFITS_API ffp2djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG *array, int *status); +int CFITS_API ffp2dujj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1, + LONGLONG naxis2, ULONGLONG *array, int *status); + +int CFITS_API ffp3db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, unsigned char *array, int *status); +int CFITS_API ffp3dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, signed char *array, int *status); +int CFITS_API ffp3dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, unsigned short *array, int *status); +int CFITS_API ffp3di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, short *array, int *status); +int CFITS_API ffp3duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, unsigned long *array, int *status); +int CFITS_API ffp3dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, long *array, int *status); +int CFITS_API ffp3duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, unsigned int *array, int *status); +int CFITS_API ffp3dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, int *array, int *status); +int CFITS_API ffp3de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, float *array, int *status); +int CFITS_API ffp3dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, double *array, int *status); +int CFITS_API ffp3djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, LONGLONG *array, int *status); +int CFITS_API ffp3dujj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1, + LONGLONG naxis2, LONGLONG naxis3, ULONGLONG *array, int *status); + +int CFITS_API ffpss(fitsfile *fptr, int datatype, + long *fpixel, long *lpixel, void *array, int *status); +int CFITS_API ffpssb(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, unsigned char *array, int *status); +int CFITS_API ffpsssb(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, signed char *array, int *status); +int CFITS_API ffpssui(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, unsigned short *array, int *status); +int CFITS_API ffpssi(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, short *array, int *status); +int CFITS_API ffpssuj(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, unsigned long *array, int *status); +int CFITS_API ffpssj(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, long *array, int *status); +int CFITS_API ffpssuk(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, unsigned int *array, int *status); +int CFITS_API ffpssk(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, int *array, int *status); +int CFITS_API ffpsse(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, float *array, int *status); +int CFITS_API ffpssd(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, double *array, int *status); +int CFITS_API ffpssjj(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, LONGLONG *array, int *status); +int CFITS_API ffpssujj(fitsfile *fptr, long group, long naxis, long *naxes, + long *fpixel, long *lpixel, ULONGLONG *array, int *status); + +int CFITS_API ffpgpb(fitsfile *fptr, long group, long firstelem, + long nelem, unsigned char *array, int *status); +int CFITS_API ffpgpsb(fitsfile *fptr, long group, long firstelem, + long nelem, signed char *array, int *status); +int CFITS_API ffpgpui(fitsfile *fptr, long group, long firstelem, + long nelem, unsigned short *array, int *status); +int CFITS_API ffpgpi(fitsfile *fptr, long group, long firstelem, + long nelem, short *array, int *status); +int CFITS_API ffpgpuj(fitsfile *fptr, long group, long firstelem, + long nelem, unsigned long *array, int *status); +int CFITS_API ffpgpj(fitsfile *fptr, long group, long firstelem, + long nelem, long *array, int *status); +int CFITS_API ffpgpuk(fitsfile *fptr, long group, long firstelem, + long nelem, unsigned int *array, int *status); +int CFITS_API ffpgpk(fitsfile *fptr, long group, long firstelem, + long nelem, int *array, int *status); +int CFITS_API ffpgpe(fitsfile *fptr, long group, long firstelem, + long nelem, float *array, int *status); +int CFITS_API ffpgpd(fitsfile *fptr, long group, long firstelem, + long nelem, double *array, int *status); +int CFITS_API ffpgpjj(fitsfile *fptr, long group, long firstelem, + long nelem, LONGLONG *array, int *status); +int CFITS_API ffpgpujj(fitsfile *fptr, long group, long firstelem, + long nelem, ULONGLONG *array, int *status); + +/*--------------------- iterator functions -------------*/ +int CFITS_API fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr, char *colname, + int datatype, int iotype); +int CFITS_API fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr, int colnum, + int datatype, int iotype); +int CFITS_API fits_iter_set_file(iteratorCol *col, fitsfile *fptr); +int CFITS_API fits_iter_set_colname(iteratorCol *col, char *colname); +int CFITS_API fits_iter_set_colnum(iteratorCol *col, int colnum); +int CFITS_API fits_iter_set_datatype(iteratorCol *col, int datatype); +int CFITS_API fits_iter_set_iotype(iteratorCol *col, int iotype); + +CFITS_API fitsfile * fits_iter_get_file(iteratorCol *col); +char CFITS_API * fits_iter_get_colname(iteratorCol *col); +int CFITS_API fits_iter_get_colnum(iteratorCol *col); +int CFITS_API fits_iter_get_datatype(iteratorCol *col); +int CFITS_API fits_iter_get_iotype(iteratorCol *col); +void CFITS_API *fits_iter_get_array(iteratorCol *col); +long CFITS_API fits_iter_get_tlmin(iteratorCol *col); +long CFITS_API fits_iter_get_tlmax(iteratorCol *col); +long CFITS_API fits_iter_get_repeat(iteratorCol *col); +char CFITS_API *fits_iter_get_tunit(iteratorCol *col); +char CFITS_API *fits_iter_get_tdisp(iteratorCol *col); + +int CFITS_API ffiter(int ncols, iteratorCol *data, long offset, long nPerLoop, + int (*workFn)( long totaln, long offset, long firstn, + long nvalues, int narrays, iteratorCol *data, void *userPointer), + void *userPointer, int *status); + +/*--------------------- write column elements -------------*/ +int CFITS_API ffpcl(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, + LONGLONG firstelem, LONGLONG nelem, void *array, int *status); +int CFITS_API ffpcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char **array, int *status); +int CFITS_API ffpcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char *array, int *status); +int CFITS_API ffpclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned char *array, int *status); +int CFITS_API ffpclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, signed char *array, int *status); +int CFITS_API ffpclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned short *array, int *status); +int CFITS_API ffpcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, short *array, int *status); +int CFITS_API ffpcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned long *array, int *status); +int CFITS_API ffpclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long *array, int *status); +int CFITS_API ffpcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned int *array, int *status); +int CFITS_API ffpclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int *array, int *status); +int CFITS_API ffpcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float *array, int *status); +int CFITS_API ffpcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double *array, int *status); +int CFITS_API ffpclc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float *array, int *status); +int CFITS_API ffpclm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double *array, int *status); +int CFITS_API ffpclu(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int *status); +int CFITS_API ffprwu(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); +int CFITS_API ffpcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, LONGLONG *array, int *status); +int CFITS_API ffpclujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG *array, int *status); +int CFITS_API ffpclx(fitsfile *fptr, int colnum, LONGLONG frow, long fbit, long nbit, + char *larray, int *status); + +int CFITS_API ffpcn(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, void *array, void *nulval, int *status); +int CFITS_API ffpcns( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char **array, char *nulvalue, int *status); +int CFITS_API ffpcnl( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, char *array, char nulvalue, int *status); +int CFITS_API ffpcnb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned char *array, unsigned char nulvalue, + int *status); +int CFITS_API ffpcnsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, signed char *array, signed char nulvalue, + int *status); +int CFITS_API ffpcnui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned short *array, unsigned short nulvalue, + int *status); +int CFITS_API ffpcni(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, short *array, short nulvalue, int *status); +int CFITS_API ffpcnuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned long *array, unsigned long nulvalue, + int *status); +int CFITS_API ffpcnj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long *array, long nulvalue, int *status); +int CFITS_API ffpcnuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, unsigned int *array, unsigned int nulvalue, + int *status); +int CFITS_API ffpcnk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int *array, int nulvalue, int *status); +int CFITS_API ffpcne(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, float *array, float nulvalue, int *status); +int CFITS_API ffpcnd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, double *array, double nulvalue, int *status); +int CFITS_API ffpcnjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, LONGLONG *array, LONGLONG nulvalue, int *status); +int CFITS_API ffpcnujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, ULONGLONG *array, ULONGLONG nulvalue, int *status); +int CFITS_API ffptbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars, + unsigned char *values, int *status); + +int CFITS_API ffirow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); +int CFITS_API ffdrow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status); +int CFITS_API ffdrrg(fitsfile *fptr, char *ranges, int *status); +int CFITS_API ffdrws(fitsfile *fptr, long *rownum, long nrows, int *status); +int CFITS_API ffdrwsll(fitsfile *fptr, LONGLONG *rownum, LONGLONG nrows, int *status); +int CFITS_API fficol(fitsfile *fptr, int numcol, char *ttype, char *tform, int *status); +int CFITS_API fficls(fitsfile *fptr, int firstcol, int ncols, char **ttype, + char **tform, int *status); +int CFITS_API ffmvec(fitsfile *fptr, int colnum, LONGLONG newveclen, int *status); +int CFITS_API ffdcol(fitsfile *fptr, int numcol, int *status); +int CFITS_API ffcpcl(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol, + int create_col, int *status); +int CFITS_API ffccls(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol, + int ncols, int create_col, int *status); +int CFITS_API ffcprw(fitsfile *infptr, fitsfile *outfptr, LONGLONG firstrow, + LONGLONG nrows, int *status); + +/*--------------------- WCS Utilities ------------------*/ +int CFITS_API ffgics(fitsfile *fptr, double *xrval, double *yrval, double *xrpix, + double *yrpix, double *xinc, double *yinc, double *rot, + char *type, int *status); +int CFITS_API ffgicsa(fitsfile *fptr, char version, double *xrval, double *yrval, double *xrpix, + double *yrpix, double *xinc, double *yinc, double *rot, + char *type, int *status); +int CFITS_API ffgtcs(fitsfile *fptr, int xcol, int ycol, double *xrval, + double *yrval, double *xrpix, double *yrpix, double *xinc, + double *yinc, double *rot, char *type, int *status); +int CFITS_API ffwldp(double xpix, double ypix, double xref, double yref, + double xrefpix, double yrefpix, double xinc, double yinc, + double rot, char *type, double *xpos, double *ypos, int *status); +int CFITS_API ffxypx(double xpos, double ypos, double xref, double yref, + double xrefpix, double yrefpix, double xinc, double yinc, + double rot, char *type, double *xpix, double *ypix, int *status); + +/* WCS support routines (provide interface to Doug Mink's WCS library */ +int CFITS_API ffgiwcs(fitsfile *fptr, char **header, int *status); +int CFITS_API ffgtwcs(fitsfile *fptr, int xcol, int ycol, char **header, int *status); + +/*--------------------- lexical parsing routines ------------------*/ +int CFITS_API fftexp( fitsfile *fptr, char *expr, int maxdim, + int *datatype, long *nelem, int *naxis, + long *naxes, int *status ); + +int CFITS_API fffrow( fitsfile *infptr, char *expr, + long firstrow, long nrows, + long *n_good_rows, char *row_status, int *status); + +int CFITS_API ffffrw( fitsfile *fptr, char *expr, long *rownum, int *status); + +int CFITS_API fffrwc( fitsfile *fptr, char *expr, char *timeCol, + char *parCol, char *valCol, long ntimes, + double *times, char *time_status, int *status ); + +int CFITS_API ffsrow( fitsfile *infptr, fitsfile *outfptr, char *expr, + int *status); + +int CFITS_API ffcrow( fitsfile *fptr, int datatype, char *expr, + long firstrow, long nelements, void *nulval, + void *array, int *anynul, int *status ); + +int CFITS_API ffcalc_rng( fitsfile *infptr, char *expr, fitsfile *outfptr, + char *parName, char *parInfo, int nRngs, + long *start, long *end, int *status ); + +int CFITS_API ffcalc( fitsfile *infptr, char *expr, fitsfile *outfptr, + char *parName, char *parInfo, int *status ); + + /* ffhist is not really intended as a user-callable routine */ + /* but it may be useful for some specialized applications */ + /* ffhist2 is a newer version which is strongly recommended instead of ffhist */ + +int CFITS_API ffhist(fitsfile **fptr, char *outfile, int imagetype, int naxis, + char colname[4][FLEN_VALUE], + double *minin, double *maxin, double *binsizein, + char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], + double weightin, char wtcol[FLEN_VALUE], + int recip, char *rowselect, int *status); +int CFITS_API ffhist2(fitsfile **fptr, char *outfile, int imagetype, int naxis, + char colname[4][FLEN_VALUE], + double *minin, double *maxin, double *binsizein, + char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], + double weightin, char wtcol[FLEN_VALUE], + int recip, char *rowselect, int *status); +CFITS_API fitsfile *ffhist3(fitsfile *fptr, + char *outfile, int imagetype, int naxis, + char colname[4][FLEN_VALUE], + double *minin, + double *maxin, + double *binsizein, + char minname[4][FLEN_VALUE], + char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], + double weightin, + char wtcol[FLEN_VALUE], + int recip, + char *selectrow, + int *status); +int CFITS_API fits_select_image_section(fitsfile **fptr, char *outfile, + char *imagesection, int *status); +int CFITS_API fits_copy_image_section(fitsfile *infptr, fitsfile *outfile, + char *imagesection, int *status); + +int CFITS_API fits_calc_binning(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE], + double *minin, double *maxin, double *binsizein, + char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], int *colnum, long *haxes, + float *amin, float *amax, float *binsize, int *status); +int CFITS_API fits_calc_binningd(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE], + double *minin, double *maxin, double *binsizein, + char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE], + char binname[4][FLEN_VALUE], int *colnum, long *haxes, + double *amin, double *amax, double *binsize, int *status); + +int CFITS_API fits_write_keys_histo(fitsfile *fptr, fitsfile *histptr, + int naxis, int *colnum, int *status); +int CFITS_API fits_rebin_wcs( fitsfile *fptr, int naxis, float *amin, float *binsize, + int *status); +int CFITS_API fits_rebin_wcsd( fitsfile *fptr, int naxis, double *amin, double *binsize, + int *status); +int CFITS_API fits_make_hist(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis, + long *naxes, int *colnum, float *amin, float *amax, float *binsize, + float weight, int wtcolnum, int recip, char *selectrow, int *status); +int CFITS_API fits_make_histd(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis, + long *naxes, int *colnum, double *amin, double *amax, double *binsize, + double weight, int wtcolnum, int recip, char *selectrow, int *status); + +typedef struct +{ + /* input(s) */ + int count; + char ** path; + char ** tag; + fitsfile ** ifptr; + + char * expression; + + /* output control */ + int bitpix; + long blank; + fitsfile * ofptr; + char keyword[FLEN_KEYWORD]; + char comment[FLEN_COMMENT]; +} PixelFilter; + + +int CFITS_API fits_pixel_filter (PixelFilter * filter, int * status); + + +/*--------------------- grouping routines ------------------*/ + +int CFITS_API ffgtcr(fitsfile *fptr, char *grpname, int grouptype, int *status); +int CFITS_API ffgtis(fitsfile *fptr, char *grpname, int grouptype, int *status); +int CFITS_API ffgtch(fitsfile *gfptr, int grouptype, int *status); +int CFITS_API ffgtrm(fitsfile *gfptr, int rmopt, int *status); +int CFITS_API ffgtcp(fitsfile *infptr, fitsfile *outfptr, int cpopt, int *status); +int CFITS_API ffgtmg(fitsfile *infptr, fitsfile *outfptr, int mgopt, int *status); +int CFITS_API ffgtcm(fitsfile *gfptr, int cmopt, int *status); +int CFITS_API ffgtvf(fitsfile *gfptr, long *firstfailed, int *status); +int CFITS_API ffgtop(fitsfile *mfptr,int group,fitsfile **gfptr,int *status); +int CFITS_API ffgtam(fitsfile *gfptr, fitsfile *mfptr, int hdupos, int *status); +int CFITS_API ffgtnm(fitsfile *gfptr, long *nmembers, int *status); +int CFITS_API ffgmng(fitsfile *mfptr, long *nmembers, int *status); +int CFITS_API ffgmop(fitsfile *gfptr, long member, fitsfile **mfptr, int *status); +int CFITS_API ffgmcp(fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt, + int *status); +int CFITS_API ffgmtf(fitsfile *infptr, fitsfile *outfptr, long member, int tfopt, + int *status); +int CFITS_API ffgmrm(fitsfile *fptr, long member, int rmopt, int *status); + +/*--------------------- group template parser routines ------------------*/ + +int CFITS_API fits_execute_template(fitsfile *ff, char *ngp_template, int *status); + +int CFITS_API fits_img_stats_short(short *array,long nx, long ny, int nullcheck, + short nullvalue,long *ngoodpix, short *minvalue, short *maxvalue, double *mean, + double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status); +int CFITS_API fits_img_stats_int(int *array,long nx, long ny, int nullcheck, + int nullvalue,long *ngoodpix, int *minvalue, int *maxvalue, double *mean, + double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status); +int CFITS_API fits_img_stats_float(float *array, long nx, long ny, int nullcheck, + float nullvalue,long *ngoodpix, float *minvalue, float *maxvalue, double *mean, + double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status); + +/*--------------------- image compression routines ------------------*/ + +int CFITS_API fits_set_compression_type(fitsfile *fptr, int ctype, int *status); +int CFITS_API fits_set_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status); +int CFITS_API fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status); +int CFITS_API fits_set_quantize_level(fitsfile *fptr, float qlevel, int *status); +int CFITS_API fits_set_hcomp_scale(fitsfile *fptr, float scale, int *status); +int CFITS_API fits_set_hcomp_smooth(fitsfile *fptr, int smooth, int *status); +int CFITS_API fits_set_quantize_method(fitsfile *fptr, int method, int *status); +int CFITS_API fits_set_quantize_dither(fitsfile *fptr, int dither, int *status); +int CFITS_API fits_set_dither_seed(fitsfile *fptr, int seed, int *status); +int CFITS_API fits_set_dither_offset(fitsfile *fptr, int offset, int *status); +int CFITS_API fits_set_lossy_int(fitsfile *fptr, int lossy_int, int *status); +int CFITS_API fits_set_huge_hdu(fitsfile *fptr, int huge, int *status); +int CFITS_API fits_set_compression_pref(fitsfile *infptr, fitsfile *outfptr, int *status); + +int CFITS_API fits_get_compression_type(fitsfile *fptr, int *ctype, int *status); +int CFITS_API fits_get_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status); +int CFITS_API fits_get_quantize_level(fitsfile *fptr, float *qlevel, int *status); +int CFITS_API fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status); +int CFITS_API fits_get_hcomp_scale(fitsfile *fptr, float *scale, int *status); +int CFITS_API fits_get_hcomp_smooth(fitsfile *fptr, int *smooth, int *status); +int CFITS_API fits_get_dither_seed(fitsfile *fptr, int *seed, int *status); + +int CFITS_API fits_img_compress(fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API fits_compress_img(fitsfile *infptr, fitsfile *outfptr, int compress_type, + long *tilesize, int parm1, int parm2, int *status); +int CFITS_API fits_is_compressed_image(fitsfile *fptr, int *status); +int CFITS_API fits_is_reentrant(void); +int CFITS_API fits_decompress_img (fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API fits_img_decompress_header(fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API fits_img_decompress (fitsfile *infptr, fitsfile *outfptr, int *status); + +/* H-compress routines */ +int CFITS_API fits_hcompress(int *a, int nx, int ny, int scale, char *output, + long *nbytes, int *status); +int CFITS_API fits_hcompress64(LONGLONG *a, int nx, int ny, int scale, char *output, + long *nbytes, int *status); +int CFITS_API fits_hdecompress(unsigned char *input, int smooth, int *a, int *nx, + int *ny, int *scale, int *status); +int CFITS_API fits_hdecompress64(unsigned char *input, int smooth, LONGLONG *a, int *nx, + int *ny, int *scale, int *status); + +int CFITS_API fits_compress_table (fitsfile *infptr, fitsfile *outfptr, int *status); +int CFITS_API fits_uncompress_table(fitsfile *infptr, fitsfile *outfptr, int *status); + +/* curl library wrapper routines (for https access) */ +int CFITS_API fits_init_https(void); +int CFITS_API fits_cleanup_https(void); +void CFITS_API fits_verbose_https(int flag); + +/* The following exclusion if __CINT__ is defined is needed for ROOT */ +#ifndef __CINT__ +#ifdef __cplusplus +} +#endif +#endif + +#endif + diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/fitsio2.h b/testbed/astropy__astropy/cextern/cfitsio/lib/fitsio2.h new file mode 100644 index 0000000000000000000000000000000000000000..3adacc0389fa85f3405c682fe9c95ad81594c1ea --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/fitsio2.h @@ -0,0 +1,1273 @@ +#ifndef _FITSIO2_H +#define _FITSIO2_H + +#include "fitsio.h" + +/* + Threading support using POSIX threads programming interface + (supplied by Bruce O'Neel) + + All threaded programs MUST have the + + -D_REENTRANT + + on the compile line and must link with -lpthread. This means that + when one builds cfitsio for threads you must have -D_REENTRANT on the + gcc or cc command line. +*/ + +#ifdef _REENTRANT +#include +/* #include not needed any more */ +extern pthread_mutex_t Fitsio_Lock; +extern int Fitsio_Pthread_Status; + +#define FFLOCK1(lockname) (Fitsio_Pthread_Status = pthread_mutex_lock(&lockname)) +#define FFUNLOCK1(lockname) (Fitsio_Pthread_Status = pthread_mutex_unlock(&lockname)) +#define FFLOCK FFLOCK1(Fitsio_Lock) +#define FFUNLOCK FFUNLOCK1(Fitsio_Lock) +#define ffstrtok(str, tok, save) strtok_r(str, tok, save) + +#else +#define FFLOCK +#define FFUNLOCK +#define ffstrtok(str, tok, save) strtok(str, tok) +#endif + +/* + If REPLACE_LINKS is defined, then whenever CFITSIO fails to open + a file with write access because it is a soft link to a file that + only has read access, then CFITSIO will attempt to replace + the link with a local copy of the file, with write access. This + feature was originally added to support the ftools in the Hera + environment, where many of the user's data file are soft links. +*/ +#if defined(BUILD_HERA) +#define REPLACE_LINKS 1 +#endif + +#define USE_LARGE_VALUE -99 /* flag used when writing images */ + +#define DBUFFSIZE 28800 /* size of data buffer in bytes */ + +#define NMAXFILES 10000 /* maximum number of FITS files that can be opened */ + /* CFITSIO will allocate (NMAXFILES * 80) bytes of memory */ + /* plus each file that is opened will use NIOBUF * 2880 bytes of memeory */ + /* where NIOBUF is defined in fitio.h and has a default value of 40 */ + +#define MINDIRECT 8640 /* minimum size for direct reads and writes */ + /* MINDIRECT must have a value >= 8640 */ + +/* it is useful to identify certain specific types of machines */ +#define NATIVE 0 /* machine that uses non-byteswapped IEEE formats */ +#define OTHERTYPE 1 /* any other type of machine */ +#define VAXVMS 3 /* uses an odd floating point format */ +#define ALPHAVMS 4 /* uses an odd floating point format */ +#define IBMPC 5 /* used in drvrfile.c to work around a bug on PCs */ +#define CRAY 6 /* requires a special NaN test algorithm */ + +#define GFLOAT 1 /* used for VMS */ +#define IEEEFLOAT 2 /* used for VMS */ + +/* ======================================================================= */ +/* The following logic is used to determine the type machine, */ +/* whether the bytes are swapped, and the number of bits in a long value */ +/* ======================================================================= */ + +/* The following platforms have sizeof(long) == 8 */ +/* This block of code should match a similar block in fitsio.h */ +/* and the block of code at the beginning of f77_wrap.h */ + +#if defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) ) + /* old Dec Alpha platforms running OSF */ +#define BYTESWAPPED TRUE +#define LONGSIZE 64 + +#elif defined(__sparcv9) || (defined(__sparc__) && defined(__arch64__)) + /* SUN Solaris7 in 64-bit mode */ +#define BYTESWAPPED FALSE +#define MACHINE NATIVE +#define LONGSIZE 64 + + /* IBM System z mainframe support */ +#elif defined(__s390x__) +#define BYTESWAPPED FALSE +#define LONGSIZE 64 + +#elif defined(__s390__) +#define BYTESWAPPED FALSE +#define LONGSIZE 32 + +#elif defined(__ia64__) || defined(__x86_64__) || defined(__AARCH64EL__) + /* Intel itanium 64-bit PC, or AMD opteron 64-bit PC */ +#define BYTESWAPPED TRUE +#define LONGSIZE 64 + +#elif defined(_SX) /* Nec SuperUx */ + +#define BYTESWAPPED FALSE +#define MACHINE NATIVE +#define LONGSIZE 64 + +#elif defined(__powerpc64__) || defined(__64BIT__) || defined(__AARCH64EB__) /* IBM 64-bit AIX powerpc*/ + /* could also test for __ppc64__ or __PPC64 */ + +# if defined(__LITTLE_ENDIAN__) +# define BYTESWAPPED TRUE +# else +# define BYTESWAPPED FALSE +# define MACHINE NATIVE +# endif +# define LONGSIZE 64 + +#elif defined(_MIPS_SZLONG) + +# if defined(MIPSEL) +# define BYTESWAPPED TRUE +# else +# define BYTESWAPPED FALSE +# define MACHINE NATIVE +# endif + +# if _MIPS_SZLONG == 32 +# define LONGSIZE 32 +# elif _MIPS_SZLONG == 64 +# define LONGSIZE 64 +# else +# error "can't handle long size given by _MIPS_SZLONG" +# endif + +/* ============================================================== */ +/* the following are all 32-bit byteswapped platforms */ + +#elif defined(vax) && defined(VMS) + +#define MACHINE VAXVMS +#define BYTESWAPPED TRUE + +#elif defined(__alpha) && defined(__VMS) + +#if (__D_FLOAT == TRUE) + +/* this float option is the same as for VAX/VMS machines. */ +#define MACHINE VAXVMS +#define BYTESWAPPED TRUE + +#elif (__G_FLOAT == TRUE) + +/* G_FLOAT is the default for ALPHA VMS systems */ +#define MACHINE ALPHAVMS +#define BYTESWAPPED TRUE +#define FLOATTYPE GFLOAT + +#elif (__IEEE_FLOAT == TRUE) + +#define MACHINE ALPHAVMS +#define BYTESWAPPED TRUE +#define FLOATTYPE IEEEFLOAT + +#endif /* end of alpha VMS case */ + +#elif defined(ultrix) && defined(unix) + /* old Dec ultrix machines */ +#define BYTESWAPPED TRUE + +#elif defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) \ + || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__TURBOC__) \ + || defined(_NI_mswin_) || defined(__EMX__) + +/* generic 32-bit IBM PC */ +#define MACHINE IBMPC +#define BYTESWAPPED TRUE + +#elif defined(__arm__) + +/* This assumes all ARM are little endian. In the future, it might be */ +/* necessary to use "if defined(__ARMEL__)" to distinguish little from big. */ +/* (__ARMEL__ would be defined on little-endian, but not on big-endian). */ + +#define BYTESWAPPED TRUE + +#elif defined(__tile__) + +/* 64-core 8x8-architecture Tile64 platform */ + +#define BYTESWAPPED TRUE + +#elif defined(__sh__) + +/* SuperH CPU can be used in both little and big endian modes */ + +#if defined(__LITTLE_ENDIAN__) +#define BYTESWAPPED TRUE +#else +#define BYTESWAPPED FALSE +#endif + +#else + +/* assume all other machine uses the same IEEE formats as used in FITS files */ +/* e.g., Macs fall into this category */ + +#define MACHINE NATIVE +#define BYTESWAPPED FALSE + +#endif + +#ifndef MACHINE +#define MACHINE OTHERTYPE +#endif + +/* assume longs are 4 bytes long, unless previously set otherwise */ +#ifndef LONGSIZE +#define LONGSIZE 32 +#endif + +/* end of block that determine long size and byte swapping */ +/* ==================================================================== */ + +#define IGNORE_EOF 1 +#define REPORT_EOF 0 +#define DATA_UNDEFINED -1 +#define NULL_UNDEFINED 1234554321 +#define ASCII_NULL_UNDEFINED 1 /* indicate no defined null value */ + +#define maxvalue(A,B) ((A) > (B) ? (A) : (B)) +#define minvalue(A,B) ((A) < (B) ? (A) : (B)) + +/* faster string comparison macros */ +#define FSTRCMP(a,b) ((a)[0]<(b)[0]? -1:(a)[0]>(b)[0]?1:strcmp((a),(b))) +#define FSTRNCMP(a,b,n) ((a)[0]<(b)[0]?-1:(a)[0]>(b)[0]?1:strncmp((a),(b),(n))) + +#if defined(__VMS) || defined(VMS) + +#define FNANMASK 0xFFFF /* mask all bits */ +#define DNANMASK 0xFFFF /* mask all bits */ + +#else + +#define FNANMASK 0x7F80 /* mask bits 1 - 8; all set on NaNs */ + /* all 0 on underflow or 0. */ + +#define DNANMASK 0x7FF0 /* mask bits 1 - 11; all set on NaNs */ + /* all 0 on underflow or 0. */ + +#endif + +#if MACHINE == CRAY + /* + Cray machines: the large negative integer corresponds + to the 3 most sig digits set to 1. If these + 3 bits are set in a floating point number (64 bits), then it represents + a reserved value (i.e., a NaN) + */ +#define fnan(L) ( (L) >= 0xE000000000000000 ? 1 : 0) ) + +#else + /* these functions work for both big and little endian machines */ + /* that use the IEEE floating point format for internal numbers */ + + /* These functions tests whether the float value is a reserved IEEE */ + /* value such as a Not-a-Number (NaN), or underflow, overflow, or */ + /* infinity. The functions returns 1 if the value is a NaN, overflow */ + /* or infinity; it returns 2 if the value is an denormalized underflow */ + /* value; otherwise it returns 0. fnan tests floats, dnan tests doubles */ + +#define fnan(L) \ + ( (L & FNANMASK) == FNANMASK ? 1 : (L & FNANMASK) == 0 ? 2 : 0) + +#define dnan(L) \ + ( (L & DNANMASK) == DNANMASK ? 1 : (L & DNANMASK) == 0 ? 2 : 0) + +#endif + +#define DSCHAR_MAX 127.49 /* max double value that fits in an signed char */ +#define DSCHAR_MIN -128.49 /* min double value that fits in an signed char */ +#define DUCHAR_MAX 255.49 /* max double value that fits in an unsigned char */ +#define DUCHAR_MIN -0.49 /* min double value that fits in an unsigned char */ +#define DUSHRT_MAX 65535.49 /* max double value that fits in a unsigned short*/ +#define DUSHRT_MIN -0.49 /* min double value that fits in an unsigned short */ +#define DSHRT_MAX 32767.49 /* max double value that fits in a short */ +#define DSHRT_MIN -32768.49 /* min double value that fits in a short */ + +#if LONGSIZE == 32 +# define DLONG_MAX 2147483647.49 /* max double value that fits in a long */ +# define DLONG_MIN -2147483648.49 /* min double value that fits in a long */ +# define DULONG_MAX 4294967295.49 /* max double that fits in a unsigned long */ +#else +# define DLONG_MAX 9.2233720368547752E18 /* max double value long */ +# define DLONG_MIN -9.2233720368547752E18 /* min double value long */ +# define DULONG_MAX 1.84467440737095504E19 /* max double value ulong */ +#endif + +#define DULONG_MIN -0.49 /* min double value that fits in an unsigned long */ +#define DULONGLONG_MAX 18446744073709551615. /* max unsigned longlong */ +#define DULONGLONG_MIN -0.49 +#define DLONGLONG_MAX 9.2233720368547755807E18 /* max double value longlong */ +#define DLONGLONG_MIN -9.2233720368547755808E18 /* min double value longlong */ +#define DUINT_MAX 4294967295.49 /* max dbl that fits in a unsigned 4-byte int */ +#define DUINT_MIN -0.49 /* min dbl that fits in an unsigned 4-byte int */ +#define DINT_MAX 2147483647.49 /* max double value that fits in a 4-byte int */ +#define DINT_MIN -2147483648.49 /* min double value that fits in a 4-byte int */ + +#ifndef UINT64_MAX +#define UINT64_MAX 18446744073709551615U /* max unsigned 64-bit integer */ +#endif +#ifndef UINT32_MAX +#define UINT32_MAX 4294967295U /* max unsigned 32-bit integer */ +#endif +#ifndef INT32_MAX +#define INT32_MAX 2147483647 /* max 32-bit integer */ +#endif +#ifndef INT32_MIN +#define INT32_MIN (-INT32_MAX -1) /* min 32-bit integer */ +#endif + + +#define COMPRESS_NULL_VALUE -2147483647 +#define N_RANDOM 10000 /* DO NOT CHANGE THIS; used when quantizing real numbers */ + +int ffgnky(fitsfile *fptr, char *card, int *status); +void ffcfmt(char *tform, char *cform); +void ffcdsp(char *tform, char *cform); +void ffswap2(short *values, long nvalues); +void ffswap4(INT32BIT *values, long nvalues); +void ffswap8(double *values, long nvalues); +int ffi2c(LONGLONG ival, char *cval, int *status); +int ffu2c(ULONGLONG ival, char *cval, int *status); +int ffl2c(int lval, char *cval, int *status); +int ffs2c(const char *instr, char *outstr, int *status); +int ffr2f(float fval, int decim, char *cval, int *status); +int ffr2e(float fval, int decim, char *cval, int *status); +int ffd2f(double dval, int decim, char *cval, int *status); +int ffd2e(double dval, int decim, char *cval, int *status); +int ffc2ii(const char *cval, long *ival, int *status); +int ffc2jj(const char *cval, LONGLONG *ival, int *status); +int ffc2ujj(const char *cval, ULONGLONG *ival, int *status); +int ffc2ll(const char *cval, int *lval, int *status); +int ffc2rr(const char *cval, float *fval, int *status); +int ffc2dd(const char *cval, double *dval, int *status); +int ffc2x(const char *cval, char *dtype, long *ival, int *lval, char *sval, + double *dval, int *status); +int ffc2xx(const char *cval, char *dtype, LONGLONG *ival, int *lval, char *sval, + double *dval, int *status); +int ffc2uxx(const char *cval, char *dtype, ULONGLONG *ival, int *lval, char *sval, + double *dval, int *status); +int ffc2s(const char *instr, char *outstr, int *status); +int ffc2i(const char *cval, long *ival, int *status); +int ffc2j(const char *cval, LONGLONG *ival, int *status); +int ffc2uj(const char *cval, ULONGLONG *ival, int *status); +int ffc2r(const char *cval, float *fval, int *status); +int ffc2d(const char *cval, double *dval, int *status); +int ffc2l(const char *cval, int *lval, int *status); +void ffxmsg(int action, char *err_message); +int ffgcnt(fitsfile *fptr, char *value, char *comm, int *status); +int ffgtkn(fitsfile *fptr, int numkey, char *keyname, long *value, int *status); +int ffgtknjj(fitsfile *fptr, int numkey, char *keyname, LONGLONG *value, int *status); +int fftkyn(fitsfile *fptr, int numkey, char *keyname, char *value, int *status); +int ffgphd(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis, + LONGLONG naxes[], long *pcount, long *gcount, int *extend, double *bscale, + double *bzero, LONGLONG *blank, int *nspace, int *status); +int ffgttb(fitsfile *fptr, LONGLONG *rowlen, LONGLONG *nrows, LONGLONG *pcount, + long *tfield, int *status); + +int ffmkey(fitsfile *fptr, const char *card, int *status); + +/* ffmbyt has been moved to fitsio.h */ +int ffgbyt(fitsfile *fptr, LONGLONG nbytes, void *buffer, int *status); +int ffpbyt(fitsfile *fptr, LONGLONG nbytes, void *buffer, int *status); +int ffgbytoff(fitsfile *fptr, long gsize, long ngroups, long offset, + void *buffer, int *status); +int ffpbytoff(fitsfile *fptr, long gsize, long ngroups, long offset, + void *buffer, int *status); +int ffldrc(fitsfile *fptr, long record, int err_mode, int *status); +int ffwhbf(fitsfile *fptr, int *nbuff); +int ffbfeof(fitsfile *fptr, int *status); +int ffbfwt(FITSfile *Fptr, int nbuff, int *status); +int ffpxsz(int datatype); + +int ffourl(char *url, char *urltype, char *outfile, char *tmplfile, + char *compspec, int *status); +int ffparsecompspec(fitsfile *fptr, char *compspec, int *status); +int ffoptplt(fitsfile *fptr, const char *tempname, int *status); +int fits_is_this_a_copy(char *urltype); +int fits_store_Fptr(FITSfile *Fptr, int *status); +int fits_clear_Fptr(FITSfile *Fptr, int *status); +int fits_already_open(fitsfile **fptr, char *url, + char *urltype, char *infile, char *extspec, char *rowfilter, + char *binspec, char *colspec, int mode,int *isopen, int *status); +int ffedit_columns(fitsfile **fptr, char *outfile, char *expr, int *status); +int fits_get_col_minmax(fitsfile *fptr, int colnum, double *datamin, + double *datamax, int *status); +int ffwritehisto(long totaln, long offset, long firstn, long nvalues, + int narrays, iteratorCol *imagepars, void *userPointer); +int ffcalchist(long totalrows, long offset, long firstrow, long nrows, + int ncols, iteratorCol *colpars, void *userPointer); +int ffpinit(fitsfile *fptr, int *status); +int ffainit(fitsfile *fptr, int *status); +int ffbinit(fitsfile *fptr, int *status); +int ffchdu(fitsfile *fptr, int *status); +int ffwend(fitsfile *fptr, int *status); +int ffpdfl(fitsfile *fptr, int *status); +int ffuptf(fitsfile *fptr, int *status); + +int ffdblk(fitsfile *fptr, long nblocks, int *status); +int ffgext(fitsfile *fptr, int moveto, int *exttype, int *status); +int ffgtbc(fitsfile *fptr, LONGLONG *totalwidth, int *status); +int ffgtbp(fitsfile *fptr, char *name, char *value, int *status); +int ffiblk(fitsfile *fptr, long nblock, int headdata, int *status); +int ffshft(fitsfile *fptr, LONGLONG firstbyte, LONGLONG nbytes, LONGLONG nshift, + int *status); + + int ffgcprll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int writemode, double *scale, double *zero, char *tform, + long *twidth, int *tcode, int *maxelem, LONGLONG *startpos, + LONGLONG *elemnum, long *incre, LONGLONG *repeat, LONGLONG *rowlen, + int *hdutype, LONGLONG *tnull, char *snull, int *status); + +int ffflushx(FITSfile *fptr); +int ffseek(FITSfile *fptr, LONGLONG position); +int ffread(FITSfile *fptr, long nbytes, void *buffer, + int *status); +int ffwrite(FITSfile *fptr, long nbytes, void *buffer, + int *status); +int fftrun(fitsfile *fptr, LONGLONG filesize, int *status); + +int ffpcluc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int *status); + +int ffgcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int nultyp, char nulval, char *array, char *nularray, + int *anynul, int *status); +int ffgcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int nultyp, char *nulval, + char **array, char *nularray, int *anynul, int *status); +int ffgcls2(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, int nultyp, char *nulval, + char **array, char *nularray, int *anynul, int *status); +int ffgclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, unsigned char nulval, + unsigned char *array, char *nularray, int *anynul, int *status); +int ffgclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, signed char nulval, + signed char *array, char *nularray, int *anynul, int *status); +int ffgclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, unsigned short nulval, + unsigned short *array, char *nularray, int *anynul, int *status); +int ffgcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, short nulval, + short *array, char *nularray, int *anynul, int *status); +int ffgcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, unsigned long nulval, + unsigned long *array, char *nularray, int *anynul, int *status); +int ffgclujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, ULONGLONG nulval, + ULONGLONG *array, char *nularray, int *anynul, int *status); +int ffgcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, LONGLONG nulval, + LONGLONG *array, char *nularray, int *anynul, int *status); +int ffgclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, long nulval, long *array, + char *nularray, int *anynul, int *status); +int ffgcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, unsigned int nulval, + unsigned int *array, char *nularray, int *anynul, int *status); +int ffgclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, int nulval, int *array, + char *nularray, int *anynul, int *status); +int ffgcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, float nulval, float *array, + char *nularray, int *anynul, int *status); +int ffgcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem, + LONGLONG nelem, long elemincre, int nultyp, double nulval, + double *array, char *nularray, int *anynul, int *status); + +int ffpi1b(fitsfile *fptr, long nelem, long incre, unsigned char *buffer, + int *status); +int ffpi2b(fitsfile *fptr, long nelem, long incre, short *buffer, int *status); +int ffpi4b(fitsfile *fptr, long nelem, long incre, INT32BIT *buffer, + int *status); +int ffpi8b(fitsfile *fptr, long nelem, long incre, long *buffer, int *status); +int ffpr4b(fitsfile *fptr, long nelem, long incre, float *buffer, int *status); +int ffpr8b(fitsfile *fptr, long nelem, long incre, double *buffer, int *status); + +int ffgi1b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, + unsigned char *buffer, int *status); +int ffgi2b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, short *buffer, + int *status); +int ffgi4b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, INT32BIT *buffer, + int *status); +int ffgi8b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, long *buffer, + int *status); +int ffgr4b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, float *buffer, + int *status); +int ffgr8b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, double *buffer, + int *status); + +int ffcins(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, LONGLONG nbytes, + LONGLONG bytepos, int *status); +int ffcdel(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, LONGLONG nbytes, + LONGLONG bytepos, int *status); +int ffkshf(fitsfile *fptr, int firstcol, int tfields, int nshift, int *status); + +int fffi1i1(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, unsigned char nullval, char + *nullarray, int *anynull, unsigned char *output, int *status); +int fffi2i1(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, unsigned char nullval, char *nullarray, + int *anynull, unsigned char *output, int *status); +int fffi4i1(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, unsigned char nullval, char *nullarray, + int *anynull, unsigned char *output, int *status); +int fffi8i1(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, unsigned char nullval, char *nullarray, + int *anynull, unsigned char *output, int *status); +int fffr4i1(float *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char nullval, char *nullarray, + int *anynull, unsigned char *output, int *status); +int fffr8i1(double *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char nullval, char *nullarray, + int *anynull, unsigned char *output, int *status); +int fffstri1(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + unsigned char nullval, char *nullarray, int *anynull, + unsigned char *output, int *status); + +int fffi1s1(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, signed char nullval, char + *nullarray, int *anynull, signed char *output, int *status); +int fffi2s1(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, signed char nullval, char *nullarray, + int *anynull, signed char *output, int *status); +int fffi4s1(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, signed char nullval, char *nullarray, + int *anynull, signed char *output, int *status); +int fffi8s1(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, signed char nullval, char *nullarray, + int *anynull, signed char *output, int *status); +int fffr4s1(float *input, long ntodo, double scale, double zero, + int nullcheck, signed char nullval, char *nullarray, + int *anynull, signed char *output, int *status); +int fffr8s1(double *input, long ntodo, double scale, double zero, + int nullcheck, signed char nullval, char *nullarray, + int *anynull, signed char *output, int *status); +int fffstrs1(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + signed char nullval, char *nullarray, int *anynull, + signed char *output, int *status); + +int fffi1u2(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, unsigned short nullval, + char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffi2u2(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, unsigned short nullval, char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffi4u2(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, unsigned short nullval, char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffi8u2(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, unsigned short nullval, char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffr4u2(float *input, long ntodo, double scale, double zero, + int nullcheck, unsigned short nullval, char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffr8u2(double *input, long ntodo, double scale, double zero, + int nullcheck, unsigned short nullval, char *nullarray, + int *anynull, unsigned short *output, int *status); +int fffstru2(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + unsigned short nullval, char *nullarray, int *anynull, + unsigned short *output, int *status); + +int fffi1i2(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffi2i2(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffi4i2(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffi8i2(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffr4i2(float *input, long ntodo, double scale, double zero, + int nullcheck, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffr8i2(double *input, long ntodo, double scale, double zero, + int nullcheck, short nullval, char *nullarray, + int *anynull, short *output, int *status); +int fffstri2(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + short nullval, char *nullarray, int *anynull, short *output, + int *status); + +int fffi1u4(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, unsigned long nullval, + char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffi2u4(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, unsigned long nullval, char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffi4u4(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, unsigned long nullval, char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffi8u4(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, unsigned long nullval, char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffr4u4(float *input, long ntodo, double scale, double zero, + int nullcheck, unsigned long nullval, char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffr8u4(double *input, long ntodo, double scale, double zero, + int nullcheck, unsigned long nullval, char *nullarray, + int *anynull, unsigned long *output, int *status); +int fffstru4(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + unsigned long nullval, char *nullarray, int *anynull, + unsigned long *output, int *status); + +int fffi1i4(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffi2i4(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffi4i4(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffi8i4(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffr4i4(float *input, long ntodo, double scale, double zero, + int nullcheck, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffr8i4(double *input, long ntodo, double scale, double zero, + int nullcheck, long nullval, char *nullarray, + int *anynull, long *output, int *status); +int fffstri4(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + long nullval, char *nullarray, int *anynull, long *output, + int *status); + +int fffi1int(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffi2int(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffi4int(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffi8int(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffr4int(float *input, long ntodo, double scale, double zero, + int nullcheck, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffr8int(double *input, long ntodo, double scale, double zero, + int nullcheck, int nullval, char *nullarray, + int *anynull, int *output, int *status); +int fffstrint(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + int nullval, char *nullarray, int *anynull, int *output, + int *status); + +int fffi1uint(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, unsigned int nullval, + char *nullarray, int *anynull, unsigned int *output, int *status); +int fffi2uint(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, unsigned int nullval, char *nullarray, + int *anynull, unsigned int *output, int *status); +int fffi4uint(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, unsigned int nullval, char *nullarray, + int *anynull, unsigned int *output, int *status); +int fffi8uint(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, unsigned int nullval, char *nullarray, + int *anynull, unsigned int *output, int *status); +int fffr4uint(float *input, long ntodo, double scale, double zero, + int nullcheck, unsigned int nullval, char *nullarray, + int *anynull, unsigned int *output, int *status); +int fffr8uint(double *input, long ntodo, double scale, double zero, + int nullcheck, unsigned int nullval, char *nullarray, + int *anynull, unsigned int *output, int *status); +int fffstruint(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + unsigned int nullval, char *nullarray, int *anynull, + unsigned int *output, int *status); + +int fffi1i8(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, LONGLONG nullval, + char *nullarray, int *anynull, LONGLONG *output, int *status); +int fffi2i8(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, LONGLONG nullval, char *nullarray, + int *anynull, LONGLONG *output, int *status); +int fffi4i8(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, LONGLONG nullval, char *nullarray, + int *anynull, LONGLONG *output, int *status); +int fffi8i8(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, LONGLONG nullval, char *nullarray, + int *anynull, LONGLONG *output, int *status); +int fffr4i8(float *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG nullval, char *nullarray, + int *anynull, LONGLONG *output, int *status); +int fffr8i8(double *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG nullval, char *nullarray, + int *anynull, LONGLONG *output, int *status); +int fffstri8(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + LONGLONG nullval, char *nullarray, int *anynull, LONGLONG *output, + int *status); + +int fffi1u8(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, ULONGLONG nullval, + char *nullarray, int *anynull, ULONGLONG *output, int *status); +int fffi2u8(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, ULONGLONG nullval, char *nullarray, + int *anynull, ULONGLONG *output, int *status); +int fffi4u8(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, ULONGLONG nullval, char *nullarray, + int *anynull, ULONGLONG *output, int *status); +int fffi8u8(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, ULONGLONG nullval, char *nullarray, + int *anynull, ULONGLONG *output, int *status); +int fffr4u8(float *input, long ntodo, double scale, double zero, + int nullcheck, ULONGLONG nullval, char *nullarray, + int *anynull, ULONGLONG *output, int *status); +int fffr8u8(double *input, long ntodo, double scale, double zero, + int nullcheck, ULONGLONG nullval, char *nullarray, + int *anynull, ULONGLONG *output, int *status); +int fffstru8(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + ULONGLONG nullval, char *nullarray, int *anynull, ULONGLONG *output, + int *status); + + +int fffi1r4(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffi2r4(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffi4r4(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffi8r4(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffr4r4(float *input, long ntodo, double scale, double zero, + int nullcheck, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffr8r4(double *input, long ntodo, double scale, double zero, + int nullcheck, float nullval, char *nullarray, + int *anynull, float *output, int *status); +int fffstrr4(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + float nullval, char *nullarray, int *anynull, float *output, + int *status); + +int fffi1r8(unsigned char *input, long ntodo, double scale, double zero, + int nullcheck, unsigned char tnull, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffi2r8(short *input, long ntodo, double scale, double zero, + int nullcheck, short tnull, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffi4r8(INT32BIT *input, long ntodo, double scale, double zero, + int nullcheck, INT32BIT tnull, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffi8r8(LONGLONG *input, long ntodo, double scale, double zero, + int nullcheck, LONGLONG tnull, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffr4r8(float *input, long ntodo, double scale, double zero, + int nullcheck, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffr8r8(double *input, long ntodo, double scale, double zero, + int nullcheck, double nullval, char *nullarray, + int *anynull, double *output, int *status); +int fffstrr8(char *input, long ntodo, double scale, double zero, + long twidth, double power, int nullcheck, char *snull, + double nullval, char *nullarray, int *anynull, double *output, + int *status); + +int ffi1fi1(unsigned char *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffs1fi1(signed char *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffu2fi1(unsigned short *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffi2fi1(short *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffu4fi1(unsigned long *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffi4fi1(long *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffu8fi1(ULONGLONG *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffi8fi1(LONGLONG *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffuintfi1(unsigned int *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffintfi1(int *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffr4fi1(float *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); +int ffr8fi1(double *array, long ntodo, double scale, double zero, + unsigned char *buffer, int *status); + +int ffi1fi2(unsigned char *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffs1fi2(signed char *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffu2fi2(unsigned short *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffi2fi2(short *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffu4fi2(unsigned long *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffi4fi2(long *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffu8fi2(ULONGLONG *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffi8fi2(LONGLONG *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffuintfi2(unsigned int *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffintfi2(int *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffr4fi2(float *array, long ntodo, double scale, double zero, + short *buffer, int *status); +int ffr8fi2(double *array, long ntodo, double scale, double zero, + short *buffer, int *status); + +int ffi1fi4(unsigned char *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffs1fi4(signed char *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffu2fi4(unsigned short *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffi2fi4(short *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffu4fi4(unsigned long *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffu8fi4(ULONGLONG *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffi4fi4(long *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffi8fi4(LONGLONG *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffuintfi4(unsigned int *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffintfi4(int *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffr4fi4(float *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); +int ffr8fi4(double *array, long ntodo, double scale, double zero, + INT32BIT *buffer, int *status); + +int ffi4fi8(long *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffi8fi8(LONGLONG *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffi2fi8(short *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffi1fi8(unsigned char *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffs1fi8(signed char *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffr4fi8(float *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffr8fi8(double *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffintfi8(int *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffu2fi8(unsigned short *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffu4fi8(unsigned long *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffu8fi8(ULONGLONG *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); +int ffuintfi8(unsigned int *array, long ntodo, double scale, double zero, + LONGLONG *buffer, int *status); + +int ffi1fr4(unsigned char *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffs1fr4(signed char *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffu2fr4(unsigned short *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffi2fr4(short *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffu4fr4(unsigned long *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffi4fr4(long *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffu8fr4(ULONGLONG *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffi8fr4(LONGLONG *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffuintfr4(unsigned int *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffintfr4(int *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffr4fr4(float *array, long ntodo, double scale, double zero, + float *buffer, int *status); +int ffr8fr4(double *array, long ntodo, double scale, double zero, + float *buffer, int *status); + +int ffi1fr8(unsigned char *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffs1fr8(signed char *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffu2fr8(unsigned short *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffi2fr8(short *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffu4fr8(unsigned long *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffi4fr8(long *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffu8fr8(ULONGLONG *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffi8fr8(LONGLONG *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffuintfr8(unsigned int *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffintfr8(int *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffr4fr8(float *array, long ntodo, double scale, double zero, + double *buffer, int *status); +int ffr8fr8(double *array, long ntodo, double scale, double zero, + double *buffer, int *status); + +int ffi1fstr(unsigned char *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffs1fstr(signed char *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffu2fstr(unsigned short *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffi2fstr(short *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffu4fstr(unsigned long *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffi4fstr(long *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffu8fstr(ULONGLONG *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffi8fstr(LONGLONG *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffintfstr(int *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffuintfstr(unsigned int *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffr4fstr(float *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); +int ffr8fstr(double *input, long ntodo, double scale, double zero, + char *cform, long twidth, char *output, int *status); + +/* the following 4 routines are VMS macros used on VAX or Alpha VMS */ +void ieevpd(double *inarray, double *outarray, long *nvals); +void ieevud(double *inarray, double *outarray, long *nvals); +void ieevpr(float *inarray, float *outarray, long *nvals); +void ieevur(float *inarray, float *outarray, long *nvals); + +/* routines related to the lexical parser */ +int ffselect_table(fitsfile **fptr, char *outfile, char *expr, int *status); +int ffiprs( fitsfile *fptr, int compressed, char *expr, int maxdim, + int *datatype, long *nelem, int *naxis, long *naxes, + int *status ); +void ffcprs( void ); +int ffcvtn( int inputType, void *input, char *undef, long ntodo, + int outputType, void *nulval, void *output, + int *anynull, int *status ); +int parse_data( long totalrows, long offset, long firstrow, + long nrows, int nCols, iteratorCol *colData, + void *userPtr ); +int uncompress_hkdata( fitsfile *fptr, long ntimes, + double *times, int *status ); +int ffffrw_work( long totalrows, long offset, long firstrow, + long nrows, int nCols, iteratorCol *colData, + void *userPtr ); + +int fits_translate_pixkeyword(char *inrec, char *outrec,char *patterns[][2], + int npat, int naxis, int *colnum, int *pat_num, int *i, + int *j, int *n, int *m, int *l, int *status); + +/* image compression routines */ +int fits_write_compressed_img(fitsfile *fptr, + int datatype, long *fpixel, long *lpixel, + int nullcheck, void *array, void *nulval, + int *status); +int fits_write_compressed_pixels(fitsfile *fptr, + int datatype, LONGLONG fpixel, LONGLONG npixels, + int nullcheck, void *array, void *nulval, + int *status); +int fits_write_compressed_img_plane(fitsfile *fptr, int datatype, + int bytesperpixel, long nplane, long *firstcoord, long *lastcoord, + long *naxes, int nullcheck, + void *array, void *nullval, long *nread, int *status); + +int imcomp_init_table(fitsfile *outfptr, + int bitpix, int naxis,long *naxes, int writebitpix, int *status); +int imcomp_calc_max_elem (int comptype, int nx, int zbitpix, int blocksize); +int imcomp_copy_imheader(fitsfile *infptr, fitsfile *outfptr, + int *status); +int imcomp_copy_img2comp(fitsfile *infptr, fitsfile *outfptr, int *status); +int imcomp_copy_comp2img(fitsfile *infptr, fitsfile *outfptr, + int norec, int *status); +int imcomp_copy_prime2img(fitsfile *infptr, fitsfile *outfptr, int *status); +int imcomp_compress_image (fitsfile *infptr, fitsfile *outfptr, + int *status); +int imcomp_compress_tile (fitsfile *outfptr, long row, + int datatype, void *tiledata, long tilelen, long nx, long ny, + int nullcheck, void *nullval, int *status); +int imcomp_nullscale(int *idata, long tilelen, int nullflagval, int nullval, + double scale, double zero, int * status); +int imcomp_nullvalues(int *idata, long tilelen, int nullflagval, int nullval, + int * status); +int imcomp_scalevalues(int *idata, long tilelen, double scale, double zero, + int * status); +int imcomp_nullscalefloats(float *fdata, long tilelen, int *idata, + double scale, double zero, int nullcheck, float nullflagval, int nullval, + int *status); +int imcomp_nullfloats(float *fdata, long tilelen, int *idata, int nullcheck, + float nullflagval, int nullval, int *status); +int imcomp_nullscaledoubles(double *fdata, long tilelen, int *idata, + double scale, double zero, int nullcheck, double nullflagval, int nullval, + int *status); +int imcomp_nulldoubles(double *fdata, long tilelen, int *idata, int nullcheck, + double nullflagval, int nullval, int *status); + + +/* image decompression routines */ +int fits_read_compressed_img(fitsfile *fptr, + int datatype, LONGLONG *fpixel,LONGLONG *lpixel,long *inc, + int nullcheck, void *nulval, void *array, char *nullarray, + int *anynul, int *status); +int fits_read_compressed_pixels(fitsfile *fptr, + int datatype, LONGLONG fpixel, LONGLONG npixels, + int nullcheck, void *nulval, void *array, char *nullarray, + int *anynul, int *status); +int fits_read_compressed_img_plane(fitsfile *fptr, int datatype, + int bytesperpixel, long nplane, LONGLONG *firstcoord, LONGLONG *lastcoord, + long *inc, long *naxes, int nullcheck, void *nullval, + void *array, char *nullarray, int *anynul, long *nread, int *status); + +int imcomp_get_compressed_image_par(fitsfile *infptr, int *status); +int imcomp_decompress_tile (fitsfile *infptr, + int nrow, int tilesize, int datatype, int nullcheck, + void *nulval, void *buffer, char *bnullarray, int *anynul, + int *status); +int imcomp_copy_overlap (char *tile, int pixlen, int ndim, + long *tfpixel, long *tlpixel, char *bnullarray, char *image, + long *fpixel, long *lpixel, long *inc, int nullcheck, char *nullarray, + int *status); +int imcomp_test_overlap (int ndim, long *tfpixel, long *tlpixel, + long *fpixel, long *lpixel, long *inc, int *status); +int imcomp_merge_overlap (char *tile, int pixlen, int ndim, + long *tfpixel, long *tlpixel, char *bnullarray, char *image, + long *fpixel, long *lpixel, int nullcheck, int *status); +int imcomp_decompress_img(fitsfile *infptr, fitsfile *outfptr, int datatype, + int *status); +int fits_quantize_float (long row, float fdata[], long nx, long ny, int nullcheck, + float in_null_value, float quantize_level, + int dither_method, int idata[], double *bscale, double *bzero, + int *iminval, int *imaxval); +int fits_quantize_double (long row, double fdata[], long nx, long ny, int nullcheck, + double in_null_value, float quantize_level, + int dither_method, int idata[], double *bscale, double *bzero, + int *iminval, int *imaxval); +int fits_rcomp(int a[], int nx, unsigned char *c, int clen,int nblock); +int fits_rcomp_short(short a[], int nx, unsigned char *c, int clen,int nblock); +int fits_rcomp_byte(signed char a[], int nx, unsigned char *c, int clen,int nblock); +int fits_rdecomp (unsigned char *c, int clen, unsigned int array[], int nx, + int nblock); +int fits_rdecomp_short (unsigned char *c, int clen, unsigned short array[], int nx, + int nblock); +int fits_rdecomp_byte (unsigned char *c, int clen, unsigned char array[], int nx, + int nblock); +int pl_p2li (int *pxsrc, int xs, short *lldst, int npix); +int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix); +int fits_init_randoms(void); +int fits_unset_compression_param( fitsfile *fptr, int *status); +int fits_unset_compression_request( fitsfile *fptr, int *status); +int fitsio_init_lock(void); + +/* general driver routines */ + +int urltype2driver(char *urltype, int *driver); + +int fits_register_driver( char *prefix, + int (*init)(void), + int (*fitsshutdown)(void), + int (*setoptions)(int option), + int (*getoptions)(int *options), + int (*getversion)(int *version), + int (*checkfile) (char *urltype, char *infile, char *outfile), + int (*fitsopen)(char *filename, int rwmode, int *driverhandle), + int (*fitscreate)(char *filename, int *driverhandle), + int (*fitstruncate)(int driverhandle, LONGLONG filesize), + int (*fitsclose)(int driverhandle), + int (*fremove)(char *filename), + int (*size)(int driverhandle, LONGLONG *sizex), + int (*flush)(int driverhandle), + int (*seek)(int driverhandle, LONGLONG offset), + int (*fitsread) (int driverhandle, void *buffer, long nbytes), + int (*fitswrite)(int driverhandle, void *buffer, long nbytes)); + +/* file driver I/O routines */ + +int file_init(void); +int file_setoptions(int options); +int file_getoptions(int *options); +int file_getversion(int *version); +int file_shutdown(void); +int file_checkfile(char *urltype, char *infile, char *outfile); +int file_open(char *filename, int rwmode, int *driverhandle); +int file_compress_open(char *filename, int rwmode, int *hdl); +int file_openfile(char *filename, int rwmode, FILE **diskfile); +int file_create(char *filename, int *driverhandle); +int file_truncate(int driverhandle, LONGLONG filesize); +int file_size(int driverhandle, LONGLONG *filesize); +int file_close(int driverhandle); +int file_remove(char *filename); +int file_flush(int driverhandle); +int file_seek(int driverhandle, LONGLONG offset); +int file_read (int driverhandle, void *buffer, long nbytes); +int file_write(int driverhandle, void *buffer, long nbytes); +int file_is_compressed(char *filename); + +/* stream driver I/O routines */ + +int stream_open(char *filename, int rwmode, int *driverhandle); +int stream_create(char *filename, int *driverhandle); +int stream_size(int driverhandle, LONGLONG *filesize); +int stream_close(int driverhandle); +int stream_flush(int driverhandle); +int stream_seek(int driverhandle, LONGLONG offset); +int stream_read (int driverhandle, void *buffer, long nbytes); +int stream_write(int driverhandle, void *buffer, long nbytes); + +/* memory driver I/O routines */ + +int mem_init(void); +int mem_setoptions(int options); +int mem_getoptions(int *options); +int mem_getversion(int *version); +int mem_shutdown(void); +int mem_create(char *filename, int *handle); +int mem_create_comp(char *filename, int *handle); +int mem_openmem(void **buffptr, size_t *buffsize, size_t deltasize, + void *(*memrealloc)(void *p, size_t newsize), int *handle); +int mem_createmem(size_t memsize, int *handle); +int stdin_checkfile(char *urltype, char *infile, char *outfile); +int stdin_open(char *filename, int rwmode, int *handle); +int stdin2mem(int hd); +int stdin2file(int hd); +int stdout_close(int handle); +int mem_compress_openrw(char *filename, int rwmode, int *hdl); +int mem_compress_open(char *filename, int rwmode, int *hdl); +int mem_compress_stdin_open(char *filename, int rwmode, int *hdl); +int mem_iraf_open(char *filename, int rwmode, int *hdl); +int mem_rawfile_open(char *filename, int rwmode, int *hdl); +int mem_size(int handle, LONGLONG *filesize); +int mem_truncate(int handle, LONGLONG filesize); +int mem_close_free(int handle); +int mem_close_keep(int handle); +int mem_close_comp(int handle); +int mem_seek(int handle, LONGLONG offset); +int mem_read(int hdl, void *buffer, long nbytes); +int mem_write(int hdl, void *buffer, long nbytes); +int mem_uncompress2mem(char *filename, FILE *diskfile, int hdl); + +int iraf2mem(char *filename, char **buffptr, size_t *buffsize, + size_t *filesize, int *status); + +/* root driver I/O routines */ + +int root_init(void); +int root_setoptions(int options); +int root_getoptions(int *options); +int root_getversion(int *version); +int root_shutdown(void); +int root_open(char *filename, int rwmode, int *driverhandle); +int root_create(char *filename, int *driverhandle); +int root_close(int driverhandle); +int root_flush(int driverhandle); +int root_seek(int driverhandle, LONGLONG offset); +int root_read (int driverhandle, void *buffer, long nbytes); +int root_write(int driverhandle, void *buffer, long nbytes); +int root_size(int handle, LONGLONG *filesize); + +/* http driver I/O routines */ + +int http_checkfile(char *urltype, char *infile, char *outfile); +int http_open(char *filename, int rwmode, int *driverhandle); +int http_file_open(char *filename, int rwmode, int *driverhandle); +int http_compress_open(char *filename, int rwmode, int *driverhandle); + +/* https driver I/O routines */ +int https_checkfile(char* urltype, char *infile, char *outfile); +int https_open(char *filename, int rwmode, int *driverhandle); +int https_file_open(char *filename, int rwmode, int *driverhandle); +void https_set_verbose(int flag); + +/* ftp driver I/O routines */ + +int ftp_checkfile(char *urltype, char *infile, char *outfile); +int ftp_open(char *filename, int rwmode, int *driverhandle); +int ftp_file_open(char *filename, int rwmode, int *driverhandle); +int ftp_compress_open(char *filename, int rwmode, int *driverhandle); + +int uncompress2mem(char *filename, FILE *diskfile, + char **buffptr, size_t *buffsize, + void *(*mem_realloc)(void *p, size_t newsize), + size_t *filesize, int *status); + +int uncompress2mem_from_mem( + char *inmemptr, + size_t inmemsize, + char **buffptr, + size_t *buffsize, + void *(*mem_realloc)(void *p, size_t newsize), + size_t *filesize, + int *status); + +int uncompress2file(char *filename, + FILE *indiskfile, + FILE *outdiskfile, + int *status); + +int compress2mem_from_mem( + char *inmemptr, + size_t inmemsize, + char **buffptr, + size_t *buffsize, + void *(*mem_realloc)(void *p, size_t newsize), + size_t *filesize, + int *status); + +int compress2file_from_mem( + char *inmemptr, + size_t inmemsize, + FILE *outdiskfile, + size_t *filesize, /* O - size of file, in bytes */ + int *status); + + +#ifdef HAVE_GSIFTP +/* prototypes for gsiftp driver I/O routines */ +#include "drvrgsiftp.h" +#endif + +#ifdef HAVE_SHMEM_SERVICES +/* prototypes for shared memory driver I/O routines */ +#include "drvrsmem.h" +#endif + +/* A hack for nonunix machines, which lack strcasecmp and strncasecmp */ +/* these functions are in fitscore.c */ +int fits_strcasecmp (const char *s1, const char *s2 ); +int fits_strncasecmp(const char *s1, const char *s2, size_t n); + +/* end of the entire "ifndef _FITSIO2_H" block */ +#endif diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/getcolb.c b/testbed/astropy__astropy/cextern/cfitsio/lib/getcolb.c new file mode 100644 index 0000000000000000000000000000000000000000..9dd38e8639afad34f5ae8aa5f25b40bfab4d11a2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/getcolb.c @@ -0,0 +1,2060 @@ +/* This file, getcolb.c, contains routines that read data elements from */ +/* a FITS image or table, with unsigned char (unsigned byte) data type. */ + +/* The FITSIO software was written by William Pence at the High Energy */ +/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ +/* Goddard Space Flight Center. */ + +#include +#include +#include +#include +#include "fitsio2.h" + +/*--------------------------------------------------------------------------*/ +int ffgpvb( fitsfile *fptr, /* I - FITS file pointer */ + long group, /* I - group to read (1 = 1st group) */ + LONGLONG firstelem, /* I - first vector element to read (1 = 1st) */ + LONGLONG nelem, /* I - number of values to read */ + unsigned char nulval, /* I - value for undefined pixels */ + unsigned char *array, /* O - array of values that are returned */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an array of values from the primary array. Data conversion + and scaling will be performed if necessary (e.g, if the datatype of + the FITS array is not the same as the array being read). + Undefined elements will be set equal to NULVAL, unless NULVAL=0 + in which case no checking for undefined values will be performed. + ANYNUL is returned with a value of .true. if any pixels are undefined. +*/ +{ + long row; + char cdummy; + int nullcheck = 1; + unsigned char nullvalue; + + if (fits_is_compressed_image(fptr, status)) + { + /* this is a compressed image in a binary table */ + nullvalue = nulval; /* set local variable */ + + fits_read_compressed_pixels(fptr, TBYTE, firstelem, nelem, + nullcheck, &nullvalue, array, NULL, anynul, status); + return(*status); + } + /* + the primary array is represented as a binary table: + each group of the primary array is a row in the table, + where the first column contains the group parameters + and the second column contains the image itself. + */ + + row=maxvalue(1,group); + + ffgclb(fptr, 2, row, firstelem, nelem, 1, 1, nulval, + array, &cdummy, anynul, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgpfb( fitsfile *fptr, /* I - FITS file pointer */ + long group, /* I - group to read (1 = 1st group) */ + LONGLONG firstelem, /* I - first vector element to read (1 = 1st) */ + LONGLONG nelem, /* I - number of values to read */ + unsigned char *array, /* O - array of values that are returned */ + char *nularray, /* O - array of null pixel flags */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an array of values from the primary array. Data conversion + and scaling will be performed if necessary (e.g, if the datatype of + the FITS array is not the same as the array being read). + Any undefined pixels in the returned array will be set = 0 and the + corresponding nularray value will be set = 1. + ANYNUL is returned with a value of .true. if any pixels are undefined. +*/ +{ + long row; + int nullcheck = 2; + + if (fits_is_compressed_image(fptr, status)) + { + /* this is a compressed image in a binary table */ + + fits_read_compressed_pixels(fptr, TBYTE, firstelem, nelem, + nullcheck, NULL, array, nularray, anynul, status); + return(*status); + } + + /* + the primary array is represented as a binary table: + each group of the primary array is a row in the table, + where the first column contains the group parameters + and the second column contains the image itself. + */ + + row=maxvalue(1,group); + + ffgclb(fptr, 2, row, firstelem, nelem, 1, 2, 0, + array, nularray, anynul, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffg2db(fitsfile *fptr, /* I - FITS file pointer */ + long group, /* I - group to read (1 = 1st group) */ + unsigned char nulval, /* set undefined pixels equal to this */ + LONGLONG ncols, /* I - number of pixels in each row of array */ + LONGLONG naxis1, /* I - FITS image NAXIS1 value */ + LONGLONG naxis2, /* I - FITS image NAXIS2 value */ + unsigned char *array, /* O - array to be filled and returned */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an entire 2-D array of values to the primary array. Data conversion + and scaling will be performed if necessary (e.g, if the datatype of the + FITS array is not the same as the array being read). Any null + values in the array will be set equal to the value of nulval, unless + nulval = 0 in which case no null checking will be performed. +*/ +{ + /* call the 3D reading routine, with the 3rd dimension = 1 */ + + ffg3db(fptr, group, nulval, ncols, naxis2, naxis1, naxis2, 1, array, + anynul, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffg3db(fitsfile *fptr, /* I - FITS file pointer */ + long group, /* I - group to read (1 = 1st group) */ + unsigned char nulval, /* set undefined pixels equal to this */ + LONGLONG ncols, /* I - number of pixels in each row of array */ + LONGLONG nrows, /* I - number of rows in each plane of array */ + LONGLONG naxis1, /* I - FITS image NAXIS1 value */ + LONGLONG naxis2, /* I - FITS image NAXIS2 value */ + LONGLONG naxis3, /* I - FITS image NAXIS3 value */ + unsigned char *array, /* O - array to be filled and returned */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an entire 3-D array of values to the primary array. Data conversion + and scaling will be performed if necessary (e.g, if the datatype of the + FITS array is not the same as the array being read). Any null + values in the array will be set equal to the value of nulval, unless + nulval = 0 in which case no null checking will be performed. +*/ +{ + long tablerow, ii, jj; + LONGLONG narray, nfits; + char cdummy; + int nullcheck = 1; + long inc[] = {1,1,1}; + LONGLONG fpixel[] = {1,1,1}; + LONGLONG lpixel[3]; + unsigned char nullvalue; + + if (fits_is_compressed_image(fptr, status)) + { + /* this is a compressed image in a binary table */ + + lpixel[0] = ncols; + lpixel[1] = nrows; + lpixel[2] = naxis3; + nullvalue = nulval; /* set local variable */ + + fits_read_compressed_img(fptr, TBYTE, fpixel, lpixel, inc, + nullcheck, &nullvalue, array, NULL, anynul, status); + return(*status); + } + + /* + the primary array is represented as a binary table: + each group of the primary array is a row in the table, + where the first column contains the group parameters + and the second column contains the image itself. + */ + tablerow=maxvalue(1,group); + + if (ncols == naxis1 && nrows == naxis2) /* arrays have same size? */ + { + /* all the image pixels are contiguous, so read all at once */ + ffgclb(fptr, 2, tablerow, 1, naxis1 * naxis2 * naxis3, 1, 1, nulval, + array, &cdummy, anynul, status); + return(*status); + } + + if (ncols < naxis1 || nrows < naxis2) + return(*status = BAD_DIMEN); + + nfits = 1; /* next pixel in FITS image to read */ + narray = 0; /* next pixel in output array to be filled */ + + /* loop over naxis3 planes in the data cube */ + for (jj = 0; jj < naxis3; jj++) + { + /* loop over the naxis2 rows in the FITS image, */ + /* reading naxis1 pixels to each row */ + + for (ii = 0; ii < naxis2; ii++) + { + if (ffgclb(fptr, 2, tablerow, nfits, naxis1, 1, 1, nulval, + &array[narray], &cdummy, anynul, status) > 0) + return(*status); + + nfits += naxis1; + narray += ncols; + } + narray += (nrows - naxis2) * ncols; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgsvb(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - number of the column to read (1 = 1st) */ + int naxis, /* I - number of dimensions in the FITS array */ + long *naxes, /* I - size of each dimension */ + long *blc, /* I - 'bottom left corner' of the subsection */ + long *trc, /* I - 'top right corner' of the subsection */ + long *inc, /* I - increment to be applied in each dimension */ + unsigned char nulval, /* I - value to set undefined pixels */ + unsigned char *array, /* O - array to be filled and returned */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read a subsection of data values from an image or a table column. + This routine is set up to handle a maximum of nine dimensions. +*/ +{ + long ii, i0, i1, i2, i3, i4, i5, i6, i7, i8, row, rstr, rstp, rinc; + long str[9], stp[9], incr[9], dir[9]; + long nelem, nultyp, ninc, numcol; + LONGLONG felem, dsize[10], blcll[9], trcll[9]; + int hdutype, anyf; + char ldummy, msg[FLEN_ERRMSG]; + int nullcheck = 1; + unsigned char nullvalue; + + if (naxis < 1 || naxis > 9) + { + snprintf(msg, FLEN_ERRMSG,"NAXIS = %d in call to ffgsvb is out of range", naxis); + ffpmsg(msg); + return(*status = BAD_DIMEN); + } + + if (fits_is_compressed_image(fptr, status)) + { + /* this is a compressed image in a binary table */ + + for (ii=0; ii < naxis; ii++) { + blcll[ii] = blc[ii]; + trcll[ii] = trc[ii]; + } + + nullvalue = nulval; /* set local variable */ + + fits_read_compressed_img(fptr, TBYTE, blcll, trcll, inc, + nullcheck, &nullvalue, array, NULL, anynul, status); + return(*status); + } + +/* + if this is a primary array, then the input COLNUM parameter should + be interpreted as the row number, and we will alway read the image + data from column 2 (any group parameters are in column 1). +*/ + if (ffghdt(fptr, &hdutype, status) > 0) + return(*status); + + if (hdutype == IMAGE_HDU) + { + /* this is a primary array, or image extension */ + if (colnum == 0) + { + rstr = 1; + rstp = 1; + } + else + { + rstr = colnum; + rstp = colnum; + } + rinc = 1; + numcol = 2; + } + else + { + /* this is a table, so the row info is in the (naxis+1) elements */ + rstr = blc[naxis]; + rstp = trc[naxis]; + rinc = inc[naxis]; + numcol = colnum; + } + + nultyp = 1; + if (anynul) + *anynul = FALSE; + + i0 = 0; + for (ii = 0; ii < 9; ii++) + { + str[ii] = 1; + stp[ii] = 1; + incr[ii] = 1; + dsize[ii] = 1; + dir[ii] = 1; + } + + for (ii = 0; ii < naxis; ii++) + { + if (trc[ii] < blc[ii]) + { + if (hdutype == IMAGE_HDU) + { + dir[ii] = -1; + } + else + { + snprintf(msg, FLEN_ERRMSG,"ffgsvb: illegal range specified for axis %ld", ii + 1); + ffpmsg(msg); + return(*status = BAD_PIX_NUM); + } + } + + str[ii] = blc[ii]; + stp[ii] = trc[ii]; + incr[ii] = inc[ii]; + dsize[ii + 1] = dsize[ii] * naxes[ii]; + dsize[ii] = dsize[ii] * dir[ii]; + } + dsize[naxis] = dsize[naxis] * dir[naxis]; + + if (naxis == 1 && naxes[0] == 1) + { + /* This is not a vector column, so read all the rows at once */ + nelem = (rstp - rstr) / rinc + 1; + ninc = rinc; + rstp = rstr; + } + else + { + /* have to read each row individually, in all dimensions */ + nelem = (stp[0]*dir[0] - str[0]*dir[0]) / inc[0] + 1; + ninc = incr[0] * dir[0]; + } + + for (row = rstr; row <= rstp; row += rinc) + { + for (i8 = str[8]*dir[8]; i8 <= stp[8]*dir[8]; i8 += incr[8]) + { + for (i7 = str[7]*dir[7]; i7 <= stp[7]*dir[7]; i7 += incr[7]) + { + for (i6 = str[6]*dir[6]; i6 <= stp[6]*dir[6]; i6 += incr[6]) + { + for (i5 = str[5]*dir[5]; i5 <= stp[5]*dir[5]; i5 += incr[5]) + { + for (i4 = str[4]*dir[4]; i4 <= stp[4]*dir[4]; i4 += incr[4]) + { + for (i3 = str[3]*dir[3]; i3 <= stp[3]*dir[3]; i3 += incr[3]) + { + for (i2 = str[2]*dir[2]; i2 <= stp[2]*dir[2]; i2 += incr[2]) + { + for (i1 = str[1]*dir[1]; i1 <= stp[1]*dir[1]; i1 += incr[1]) + { + + felem=str[0] + (i1 - dir[1]) * dsize[1] + (i2 - dir[2]) * dsize[2] + + (i3 - dir[3]) * dsize[3] + (i4 - dir[4]) * dsize[4] + + (i5 - dir[5]) * dsize[5] + (i6 - dir[6]) * dsize[6] + + (i7 - dir[7]) * dsize[7] + (i8 - dir[8]) * dsize[8]; + + if ( ffgclb(fptr, numcol, row, felem, nelem, ninc, nultyp, + nulval, &array[i0], &ldummy, &anyf, status) > 0) + return(*status); + + if (anyf && anynul) + *anynul = TRUE; + + i0 += nelem; + } + } + } + } + } + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgsfb(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - number of the column to read (1 = 1st) */ + int naxis, /* I - number of dimensions in the FITS array */ + long *naxes, /* I - size of each dimension */ + long *blc, /* I - 'bottom left corner' of the subsection */ + long *trc, /* I - 'top right corner' of the subsection */ + long *inc, /* I - increment to be applied in each dimension */ + unsigned char *array, /* O - array to be filled and returned */ + char *flagval, /* O - set to 1 if corresponding value is null */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read a subsection of data values from an image or a table column. + This routine is set up to handle a maximum of nine dimensions. +*/ +{ + long ii,i0, i1,i2,i3,i4,i5,i6,i7,i8,row,rstr,rstp,rinc; + long str[9],stp[9],incr[9],dsize[10]; + LONGLONG blcll[9], trcll[9]; + long felem, nelem, nultyp, ninc, numcol; + int hdutype, anyf; + unsigned char nulval = 0; + char msg[FLEN_ERRMSG]; + int nullcheck = 2; + + if (naxis < 1 || naxis > 9) + { + snprintf(msg, FLEN_ERRMSG,"NAXIS = %d in call to ffgsvb is out of range", naxis); + ffpmsg(msg); + return(*status = BAD_DIMEN); + } + + if (fits_is_compressed_image(fptr, status)) + { + /* this is a compressed image in a binary table */ + + for (ii=0; ii < naxis; ii++) { + blcll[ii] = blc[ii]; + trcll[ii] = trc[ii]; + } + + fits_read_compressed_img(fptr, TBYTE, blcll, trcll, inc, + nullcheck, NULL, array, flagval, anynul, status); + return(*status); + } + +/* + if this is a primary array, then the input COLNUM parameter should + be interpreted as the row number, and we will alway read the image + data from column 2 (any group parameters are in column 1). +*/ + if (ffghdt(fptr, &hdutype, status) > 0) + return(*status); + + if (hdutype == IMAGE_HDU) + { + /* this is a primary array, or image extension */ + if (colnum == 0) + { + rstr = 1; + rstp = 1; + } + else + { + rstr = colnum; + rstp = colnum; + } + rinc = 1; + numcol = 2; + } + else + { + /* this is a table, so the row info is in the (naxis+1) elements */ + rstr = blc[naxis]; + rstp = trc[naxis]; + rinc = inc[naxis]; + numcol = colnum; + } + + nultyp = 2; + if (anynul) + *anynul = FALSE; + + i0 = 0; + for (ii = 0; ii < 9; ii++) + { + str[ii] = 1; + stp[ii] = 1; + incr[ii] = 1; + dsize[ii] = 1; + } + + for (ii = 0; ii < naxis; ii++) + { + if (trc[ii] < blc[ii]) + { + snprintf(msg, FLEN_ERRMSG,"ffgsvb: illegal range specified for axis %ld", ii + 1); + ffpmsg(msg); + return(*status = BAD_PIX_NUM); + } + + str[ii] = blc[ii]; + stp[ii] = trc[ii]; + incr[ii] = inc[ii]; + dsize[ii + 1] = dsize[ii] * naxes[ii]; + } + + if (naxis == 1 && naxes[0] == 1) + { + /* This is not a vector column, so read all the rows at once */ + nelem = (rstp - rstr) / rinc + 1; + ninc = rinc; + rstp = rstr; + } + else + { + /* have to read each row individually, in all dimensions */ + nelem = (stp[0] - str[0]) / inc[0] + 1; + ninc = incr[0]; + } + + for (row = rstr; row <= rstp; row += rinc) + { + for (i8 = str[8]; i8 <= stp[8]; i8 += incr[8]) + { + for (i7 = str[7]; i7 <= stp[7]; i7 += incr[7]) + { + for (i6 = str[6]; i6 <= stp[6]; i6 += incr[6]) + { + for (i5 = str[5]; i5 <= stp[5]; i5 += incr[5]) + { + for (i4 = str[4]; i4 <= stp[4]; i4 += incr[4]) + { + for (i3 = str[3]; i3 <= stp[3]; i3 += incr[3]) + { + for (i2 = str[2]; i2 <= stp[2]; i2 += incr[2]) + { + for (i1 = str[1]; i1 <= stp[1]; i1 += incr[1]) + { + felem=str[0] + (i1 - 1) * dsize[1] + (i2 - 1) * dsize[2] + + (i3 - 1) * dsize[3] + (i4 - 1) * dsize[4] + + (i5 - 1) * dsize[5] + (i6 - 1) * dsize[6] + + (i7 - 1) * dsize[7] + (i8 - 1) * dsize[8]; + + if ( ffgclb(fptr, numcol, row, felem, nelem, ninc, nultyp, + nulval, &array[i0], &flagval[i0], &anyf, status) > 0) + return(*status); + + if (anyf && anynul) + *anynul = TRUE; + + i0 += nelem; + } + } + } + } + } + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffggpb( fitsfile *fptr, /* I - FITS file pointer */ + long group, /* I - group to read (1 = 1st group) */ + long firstelem, /* I - first vector element to read (1 = 1st) */ + long nelem, /* I - number of values to read */ + unsigned char *array, /* O - array of values that are returned */ + int *status) /* IO - error status */ +/* + Read an array of group parameters from the primary array. Data conversion + and scaling will be performed if necessary (e.g, if the datatype of + the FITS array is not the same as the array being read). +*/ +{ + long row; + int idummy; + char cdummy; + /* + the primary array is represented as a binary table: + each group of the primary array is a row in the table, + where the first column contains the group parameters + and the second column contains the image itself. + */ + + row=maxvalue(1,group); + + ffgclb(fptr, 1, row, firstelem, nelem, 1, 1, 0, + array, &cdummy, &idummy, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgcvb(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - number of column to read (1 = 1st col) */ + LONGLONG firstrow, /* I - first row to read (1 = 1st row) */ + LONGLONG firstelem, /* I - first vector element to read (1 = 1st) */ + LONGLONG nelem, /* I - number of values to read */ + unsigned char nulval, /* I - value for null pixels */ + unsigned char *array, /* O - array of values that are read */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an array of values from a column in the current FITS HDU. Automatic + datatype conversion will be performed if the datatype of the column does not + match the datatype of the array parameter. The output values will be scaled + by the FITS TSCALn and TZEROn values if these values have been defined. + Any undefined pixels will be set equal to the value of 'nulval' unless + nulval = 0 in which case no checks for undefined pixels will be made. +*/ +{ + char cdummy; + + ffgclb(fptr, colnum, firstrow, firstelem, nelem, 1, 1, nulval, + array, &cdummy, anynul, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgcfb(fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - number of column to read (1 = 1st col) */ + LONGLONG firstrow, /* I - first row to read (1 = 1st row) */ + LONGLONG firstelem, /* I - first vector element to read (1 = 1st) */ + LONGLONG nelem, /* I - number of values to read */ + unsigned char *array, /* O - array of values that are read */ + char *nularray, /* O - array of flags: 1 if null pixel; else 0 */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an array of values from a column in the current FITS HDU. Automatic + datatype conversion will be performed if the datatype of the column does not + match the datatype of the array parameter. The output values will be scaled + by the FITS TSCALn and TZEROn values if these values have been defined. + Nularray will be set = 1 if the corresponding array pixel is undefined, + otherwise nularray will = 0. +*/ +{ + unsigned char dummy = 0; + + ffgclb(fptr, colnum, firstrow, firstelem, nelem, 1, 2, dummy, + array, nularray, anynul, status); + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgclb( fitsfile *fptr, /* I - FITS file pointer */ + int colnum, /* I - number of column to read (1 = 1st col) */ + LONGLONG firstrow, /* I - first row to read (1 = 1st row) */ + LONGLONG firstelem, /* I - first vector element to read (1 = 1st) */ + LONGLONG nelem, /* I - number of values to read */ + long elemincre, /* I - pixel increment; e.g., 2 = every other */ + int nultyp, /* I - null value handling code: */ + /* 1: set undefined pixels = nulval */ + /* 2: set nularray=1 for undefined pixels */ + unsigned char nulval, /* I - value for null pixels if nultyp = 1 */ + unsigned char *array, /* O - array of values that are read */ + char *nularray, /* O - array of flags = 1 if nultyp = 2 */ + int *anynul, /* O - set to 1 if any values are null; else 0 */ + int *status) /* IO - error status */ +/* + Read an array of values from a column in the current FITS HDU. + The column number may refer to a real column in an ASCII or binary table, + or it may refer be a virtual column in a 1 or more grouped FITS primary + array or image extension. FITSIO treats a primary array as a binary table + with 2 vector columns: the first column contains the group parameters (often + with length = 0) and the second column contains the array of image pixels. + Each row of the table represents a group in the case of multigroup FITS + images. + + The output array of values will be converted from the datatype of the column + and will be scaled by the FITS TSCALn and TZEROn values if necessary. +*/ +{ + double scale, zero, power = 1., dtemp; + int tcode, maxelem2, hdutype, xcode, decimals; + long twidth, incre, ntodo; + long ii, xwidth; + int convert, nulcheck, readcheck = 0; + LONGLONG repeat, startpos, elemnum, readptr, tnull; + LONGLONG rowlen, rownum, remain, next, rowincre, maxelem; + char tform[20]; + char message[FLEN_ERRMSG]; + char snull[20]; /* the FITS null value if reading from ASCII table */ + + double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */ + void *buffer; + + union u_tag { + char charval; + unsigned char ucharval; + } u; + + if (*status > 0 || nelem == 0) /* inherit input status value if > 0 */ + return(*status); + + buffer = cbuff; + + if (anynul) + *anynul = 0; + + if (nultyp == 2) + memset(nularray, 0, (size_t) nelem); /* initialize nullarray */ + + /*---------------------------------------------------*/ + /* Check input and get parameters about the column: */ + /*---------------------------------------------------*/ + if (elemincre < 0) + readcheck = -1; /* don't do range checking in this case */ + + ffgcprll( fptr, colnum, firstrow, firstelem, nelem, readcheck, &scale, &zero, + tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre, + &repeat, &rowlen, &hdutype, &tnull, snull, status); + maxelem = maxelem2; + + /* special case */ + if (tcode == TLOGICAL && elemincre == 1) + { + u.ucharval = nulval; + ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp, + u.charval, (char *) array, nularray, anynul, status); + + return(*status); + } + + if (strchr(tform,'A') != NULL) + { + if (*status == BAD_ELEM_NUM) + { + /* ignore this error message */ + *status = 0; + ffcmsg(); /* clear error stack */ + } + + /* interpret a 'A' ASCII column as a 'B' byte column ('8A' == '8B') */ + /* This is an undocumented 'feature' in CFITSIO */ + + /* we have to reset some of the values returned by ffgcpr */ + + tcode = TBYTE; + incre = 1; /* each element is 1 byte wide */ + repeat = twidth; /* total no. of chars in the col */ + twidth = 1; /* width of each element */ + scale = 1.0; /* no scaling */ + zero = 0.0; + tnull = NULL_UNDEFINED; /* don't test for nulls */ + maxelem = DBUFFSIZE; + } + + if (*status > 0) + return(*status); + + incre *= elemincre; /* multiply incre to just get every nth pixel */ + + if (tcode == TSTRING && hdutype == ASCII_TBL) /* setup for ASCII tables */ + { + /* get the number of implied decimal places if no explicit decmal point */ + ffasfm(tform, &xcode, &xwidth, &decimals, status); + for(ii = 0; ii < decimals; ii++) + power *= 10.; + } + /*------------------------------------------------------------------*/ + /* Decide whether to check for null values in the input FITS file: */ + /*------------------------------------------------------------------*/ + nulcheck = nultyp; /* by default, check for null values in the FITS file */ + + if (nultyp == 1 && nulval == 0) + nulcheck = 0; /* calling routine does not want to check for nulls */ + + else if (tcode%10 == 1 && /* if reading an integer column, and */ + tnull == NULL_UNDEFINED) /* if a null value is not defined, */ + nulcheck = 0; /* then do not check for null values. */ + + else if (tcode == TSHORT && (tnull > SHRT_MAX || tnull < SHRT_MIN) ) + nulcheck = 0; /* Impossible null value */ + + else if (tcode == TBYTE && (tnull > 255 || tnull < 0) ) + nulcheck = 0; /* Impossible null value */ + + else if (tcode == TSTRING && snull[0] == ASCII_NULL_UNDEFINED) + nulcheck = 0; + + /*----------------------------------------------------------------------*/ + /* If FITS column and output data array have same datatype, then we do */ + /* not need to use a temporary buffer to store intermediate datatype. */ + /*----------------------------------------------------------------------*/ + convert = 1; + if (tcode == TBYTE) /* Special Case: */ + { /* no type convertion required, so read */ + /* data directly into output buffer. */ + + if (nelem < (LONGLONG)INT32_MAX) { + maxelem = nelem; + } else { + maxelem = INT32_MAX; + } + + if (nulcheck == 0 && scale == 1. && zero == 0.) + convert = 0; /* no need to scale data or find nulls */ + } + + /*---------------------------------------------------------------------*/ + /* Now read the pixels from the FITS column. If the column does not */ + /* have the same datatype as the output array, then we have to read */ + /* the raw values into a temporary buffer (of limited size). In */ + /* the case of a vector colum read only 1 vector of values at a time */ + /* then skip to the next row if more values need to be read. */ + /* After reading the raw values, then call the fffXXYY routine to (1) */ + /* test for undefined values, (2) convert the datatype if necessary, */ + /* and (3) scale the values by the FITS TSCALn and TZEROn linear */ + /* scaling parameters. */ + /*---------------------------------------------------------------------*/ + remain = nelem; /* remaining number of values to read */ + next = 0; /* next element in array to be read */ + rownum = 0; /* row number, relative to firstrow */ + + while (remain) + { + /* limit the number of pixels to read at one time to the number that + will fit in the buffer or to the number of pixels that remain in + the current vector, which ever is smaller. + */ + ntodo = (long) minvalue(remain, maxelem); + if (elemincre >= 0) + { + ntodo = (long) minvalue(ntodo, ((repeat - elemnum - 1)/elemincre +1)); + } + else + { + ntodo = (long) minvalue(ntodo, (elemnum/(-elemincre) +1)); + } + + readptr = startpos + ((LONGLONG)rownum * rowlen) + (elemnum * (incre / elemincre)); + + switch (tcode) + { + case (TBYTE): + ffgi1b(fptr, readptr, ntodo, incre, &array[next], status); + if (convert) + fffi1i1(&array[next], ntodo, scale, zero, nulcheck, + (unsigned char) tnull, nulval, &nularray[next], anynul, + &array[next], status); + break; + case (TSHORT): + ffgi2b(fptr, readptr, ntodo, incre, (short *) buffer, status); + fffi2i1((short *) buffer, ntodo, scale, zero, nulcheck, + (short) tnull, nulval, &nularray[next], anynul, + &array[next], status); + break; + case (TLONG): + ffgi4b(fptr, readptr, ntodo, incre, (INT32BIT *) buffer, + status); + fffi4i1((INT32BIT *) buffer, ntodo, scale, zero, nulcheck, + (INT32BIT) tnull, nulval, &nularray[next], anynul, + &array[next], status); + break; + case (TLONGLONG): + ffgi8b(fptr, readptr, ntodo, incre, (long *) buffer, status); + fffi8i1( (LONGLONG *) buffer, ntodo, scale, zero, + nulcheck, tnull, nulval, &nularray[next], + anynul, &array[next], status); + break; + case (TFLOAT): + ffgr4b(fptr, readptr, ntodo, incre, (float *) buffer, status); + fffr4i1((float *) buffer, ntodo, scale, zero, nulcheck, + nulval, &nularray[next], anynul, + &array[next], status); + break; + case (TDOUBLE): + ffgr8b(fptr, readptr, ntodo, incre, (double *) buffer, status); + fffr8i1((double *) buffer, ntodo, scale, zero, nulcheck, + nulval, &nularray[next], anynul, + &array[next], status); + break; + case (TSTRING): + ffmbyt(fptr, readptr, REPORT_EOF, status); + + if (incre == twidth) /* contiguous bytes */ + ffgbyt(fptr, ntodo * twidth, buffer, status); + else + ffgbytoff(fptr, twidth, ntodo, incre - twidth, buffer, + status); + + /* interpret the string as an ASCII formated number */ + fffstri1((char *) buffer, ntodo, scale, zero, twidth, power, + nulcheck, snull, nulval, &nularray[next], anynul, + &array[next], status); + break; + + default: /* error trap for invalid column format */ + snprintf(message, FLEN_ERRMSG, + "Cannot read bytes from column %d which has format %s", + colnum, tform); + ffpmsg(message); + if (hdutype == ASCII_TBL) + return(*status = BAD_ATABLE_FORMAT); + else + return(*status = BAD_BTABLE_FORMAT); + + } /* End of switch block */ + + /*-------------------------*/ + /* Check for fatal error */ + /*-------------------------*/ + if (*status > 0) /* test for error during previous read operation */ + { + dtemp = (double) next; + if (hdutype > 0) + snprintf(message,FLEN_ERRMSG, + "Error reading elements %.0f thru %.0f from column %d (ffgclb).", + dtemp+1., dtemp+ntodo, colnum); + else + snprintf(message,FLEN_ERRMSG, + "Error reading elements %.0f thru %.0f from image (ffgclb).", + dtemp+1., dtemp+ntodo); + + ffpmsg(message); + return(*status); + } + + /*--------------------------------------------*/ + /* increment the counters for the next loop */ + /*--------------------------------------------*/ + remain -= ntodo; + if (remain) + { + next += ntodo; + elemnum = elemnum + (ntodo * elemincre); + + if (elemnum >= repeat) /* completed a row; start on later row */ + { + rowincre = elemnum / repeat; + rownum += rowincre; + elemnum = elemnum - (rowincre * repeat); + } + else if (elemnum < 0) /* completed a row; start on a previous row */ + { + rowincre = (-elemnum - 1) / repeat + 1; + rownum -= rowincre; + elemnum = (rowincre * repeat) + elemnum; + } + } + } /* End of main while Loop */ + + + /*--------------------------------*/ + /* check for numerical overflow */ + /*--------------------------------*/ + if (*status == OVERFLOW_ERR) + { + ffpmsg( + "Numerical overflow during type conversion while reading FITS data."); + *status = NUM_OVERFLOW; + } + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int ffgextn( fitsfile *fptr, /* I - FITS file pointer */ + LONGLONG offset, /* I - byte offset from start of extension data */ + LONGLONG nelem, /* I - number of elements to read */ + void *buffer, /* I - stream of bytes to read */ + int *status) /* IO - error status */ +/* + Read a stream of bytes from the current FITS HDU. This primative routine is mainly + for reading non-standard "conforming" extensions and should not be used + for standard IMAGE, TABLE or BINTABLE extensions. +*/ +{ + if (*status > 0) /* inherit input status value if > 0 */ + return(*status); + + /* reset position to the correct HDU if necessary */ + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); + + /* rescan header if data structure is undefined */ + else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) + if ( ffrdef(fptr, status) > 0) + return(*status); + + /* move to write position */ + ffmbyt(fptr, (fptr->Fptr)->datastart+ offset, IGNORE_EOF, status); + + /* read the buffer */ + ffgbyt(fptr, nelem, buffer, status); + + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffi1i1(unsigned char *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + unsigned char tnull, /* I - value of FITS TNULLn keyword if any */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to tnull. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { /* this routine is normally not called in this case */ + memmove(output, input, ntodo ); + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + output[ii] = input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffi2i1(short *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + short tnull, /* I - value of FITS TNULLn keyword if any */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to tnull. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + + else + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffi4i1(INT32BIT *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + INT32BIT tnull, /* I - value of FITS TNULLn keyword if any */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to tnull. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffi8i1(LONGLONG *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + LONGLONG tnull, /* I - value of FITS TNULLn keyword if any */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to tnull. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + ULONGLONG ulltemp; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 9223372036854775808.) + { + /* The column we read contains unsigned long long values. */ + /* Instead of adding 9223372036854775808, it is more efficient */ + /* and more precise to just flip the sign bit with the XOR operator */ + + for (ii = 0; ii < ntodo; ii++) { + + ulltemp = (ULONGLONG) (((LONGLONG) input[ii]) ^ 0x8000000000000000); + + if (ulltemp > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) ulltemp; + } + } + else if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + if (scale == 1. && zero == 9223372036854775808.) + { + /* The column we read contains unsigned long long values. */ + /* Instead of adding 9223372036854775808, it is more efficient */ + /* and more precise to just flip the sign bit with the XOR operator */ + + for (ii = 0; ii < ntodo; ii++) { + + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + ulltemp = (ULONGLONG) (((LONGLONG) input[ii]) ^ 0x8000000000000000); + + if (ulltemp > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + { + output[ii] = (unsigned char) ulltemp; + } + } + } + } + else if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + if (input[ii] < 0) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > UCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] == tnull) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffr4i1(float *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to NaN. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + short *sptr, iret; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + sptr = (short *) input; + +#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS + sptr++; /* point to MSBs */ +#endif + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++, sptr += 2) + { + /* use redundant boolean logic in following statement */ + /* to suppress irritating Borland compiler warning message */ + if (0 != (iret = fnan(*sptr) ) ) /* test for NaN or underflow */ + { + if (iret == 1) /* is it a NaN? */ + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else /* it's an underflow */ + output[ii] = 0; + } + else + { + if (input[ii] < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++, sptr += 2) + { + if (0 != (iret = fnan(*sptr) ) ) /* test for NaN or underflow */ + { + if (iret == 1) /* is it a NaN? */ + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else /* it's an underflow */ + { + if (zero < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (zero > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) zero; + } + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffr8i1(double *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + unsigned char nullval,/* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output,/* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. + Check for null values and do datatype conversion and scaling if required. + The nullcheck code value determines how any null values in the input array + are treated. A null value is an input pixel that is equal to NaN. If + nullcheck = 0, then no checking for nulls is performed and any null values + will be transformed just like any other pixel. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + long ii; + double dvalue; + short *sptr, iret; + + if (nullcheck == 0) /* no null checking required */ + { + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++) + { + if (input[ii] < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++) + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + else /* must check for null values */ + { + sptr = (short *) input; + +#if BYTESWAPPED && MACHINE != VAXVMS && MACHINE != ALPHAVMS + sptr += 3; /* point to MSBs */ +#endif + if (scale == 1. && zero == 0.) /* no scaling */ + { + for (ii = 0; ii < ntodo; ii++, sptr += 4) + { + if (0 != (iret = dnan(*sptr)) ) /* test for NaN or underflow */ + { + if (iret == 1) /* is it a NaN? */ + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else /* it's an underflow */ + output[ii] = 0; + } + else + { + if (input[ii] < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (input[ii] > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) input[ii]; + } + } + } + else /* must scale the data */ + { + for (ii = 0; ii < ntodo; ii++, sptr += 4) + { + if (0 != (iret = dnan(*sptr)) ) /* test for NaN or underflow */ + { + if (iret == 1) /* is it a NaN? */ + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + else /* it's an underflow */ + { + if (zero < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (zero > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) zero; + } + } + else + { + dvalue = input[ii] * scale + zero; + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + } + } + } + return(*status); +} +/*--------------------------------------------------------------------------*/ +int fffstri1(char *input, /* I - array of values to be converted */ + long ntodo, /* I - number of elements in the array */ + double scale, /* I - FITS TSCALn or BSCALE value */ + double zero, /* I - FITS TZEROn or BZERO value */ + long twidth, /* I - width of each substring of chars */ + double implipower, /* I - power of 10 of implied decimal */ + int nullcheck, /* I - null checking code; 0 = don't check */ + /* 1:set null pixels = nullval */ + /* 2: if null pixel, set nullarray = 1 */ + char *snull, /* I - value of FITS null string, if any */ + unsigned char nullval, /* I - set null pixels, if nullcheck = 1 */ + char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ + int *anynull, /* O - set to 1 if any pixels are null */ + unsigned char *output, /* O - array of converted pixels */ + int *status) /* IO - error status */ +/* + Copy input to output following reading of the input from a FITS file. Check + for null values and do scaling if required. The nullcheck code value + determines how any null values in the input array are treated. A null + value is an input pixel that is equal to snull. If nullcheck= 0, then + no special checking for nulls is performed. If nullcheck = 1, then the + output pixel will be set = nullval if the corresponding input pixel is null. + If nullcheck = 2, then if the pixel is null then the corresponding value of + nullarray will be set to 1; the value of nullarray for non-null pixels + will = 0. The anynull parameter will be set = 1 if any of the returned + pixels are null, otherwise anynull will be returned with a value = 0; +*/ +{ + int nullen; + long ii; + double dvalue; + char *cstring, message[FLEN_ERRMSG]; + char *cptr, *tpos; + char tempstore, chrzero = '0'; + double val, power; + int exponent, sign, esign, decpt; + + nullen = strlen(snull); + cptr = input; /* pointer to start of input string */ + for (ii = 0; ii < ntodo; ii++) + { + cstring = cptr; + /* temporarily insert a null terminator at end of the string */ + tpos = cptr + twidth; + tempstore = *tpos; + *tpos = 0; + + /* check if null value is defined, and if the */ + /* column string is identical to the null string */ + if (snull[0] != ASCII_NULL_UNDEFINED && + !strncmp(snull, cptr, nullen) ) + { + if (nullcheck) + { + *anynull = 1; + if (nullcheck == 1) + output[ii] = nullval; + else + nullarray[ii] = 1; + } + cptr += twidth; + } + else + { + /* value is not the null value, so decode it */ + /* remove any embedded blank characters from the string */ + + decpt = 0; + sign = 1; + val = 0.; + power = 1.; + exponent = 0; + esign = 1; + + while (*cptr == ' ') /* skip leading blanks */ + cptr++; + + if (*cptr == '-' || *cptr == '+') /* check for leading sign */ + { + if (*cptr == '-') + sign = -1; + + cptr++; + + while (*cptr == ' ') /* skip blanks between sign and value */ + cptr++; + } + + while (*cptr >= '0' && *cptr <= '9') + { + val = val * 10. + *cptr - chrzero; /* accumulate the value */ + cptr++; + + while (*cptr == ' ') /* skip embedded blanks in the value */ + cptr++; + } + + if (*cptr == '.' || *cptr == ',') /* check for decimal point */ + { + decpt = 1; + cptr++; + while (*cptr == ' ') /* skip any blanks */ + cptr++; + + while (*cptr >= '0' && *cptr <= '9') + { + val = val * 10. + *cptr - chrzero; /* accumulate the value */ + power = power * 10.; + cptr++; + + while (*cptr == ' ') /* skip embedded blanks in the value */ + cptr++; + } + } + + if (*cptr == 'E' || *cptr == 'D') /* check for exponent */ + { + cptr++; + while (*cptr == ' ') /* skip blanks */ + cptr++; + + if (*cptr == '-' || *cptr == '+') /* check for exponent sign */ + { + if (*cptr == '-') + esign = -1; + + cptr++; + + while (*cptr == ' ') /* skip blanks between sign and exp */ + cptr++; + } + + while (*cptr >= '0' && *cptr <= '9') + { + exponent = exponent * 10 + *cptr - chrzero; /* accumulate exp */ + cptr++; + + while (*cptr == ' ') /* skip embedded blanks */ + cptr++; + } + } + + if (*cptr != 0) /* should end up at the null terminator */ + { + snprintf(message, FLEN_ERRMSG,"Cannot read number from ASCII table"); + ffpmsg(message); + snprintf(message, FLEN_ERRMSG,"Column field = %s.", cstring); + ffpmsg(message); + /* restore the char that was overwritten by the null */ + *tpos = tempstore; + return(*status = BAD_C2D); + } + + if (!decpt) /* if no explicit decimal, use implied */ + power = implipower; + + dvalue = (sign * val / power) * pow(10., (double) (esign * exponent)); + + dvalue = dvalue * scale + zero; /* apply the scaling */ + + if (dvalue < DUCHAR_MIN) + { + *status = OVERFLOW_ERR; + output[ii] = 0; + } + else if (dvalue > DUCHAR_MAX) + { + *status = OVERFLOW_ERR; + output[ii] = UCHAR_MAX; + } + else + output[ii] = (unsigned char) dvalue; + } + /* restore the char that was overwritten by the null */ + *tpos = tempstore; + } + return(*status); +} diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/iraffits.c b/testbed/astropy__astropy/cextern/cfitsio/lib/iraffits.c new file mode 100644 index 0000000000000000000000000000000000000000..187ac65d9cf542be1e40f130c16bc89746d1317f --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/iraffits.c @@ -0,0 +1,2101 @@ +/*------------------------------------------------------------------------*/ +/* */ +/* These routines have been modified by William Pence for use by CFITSIO */ +/* The original files were provided by Doug Mink */ +/*------------------------------------------------------------------------*/ + +/* File imhfile.c + * August 6, 1998 + * By Doug Mink, based on Mike VanHilst's readiraf.c + + * Module: imhfile.c (IRAF .imh image file reading and writing) + * Purpose: Read and write IRAF image files (and translate headers) + * Subroutine: irafrhead (filename, lfhead, fitsheader, lihead) + * Read IRAF image header + * Subroutine: irafrimage (fitsheader) + * Read IRAF image pixels (call after irafrhead) + * Subroutine: same_path (pixname, hdrname) + * Put filename and header path together + * Subroutine: iraf2fits (hdrname, irafheader, nbiraf, nbfits) + * Convert IRAF image header to FITS image header + * Subroutine: irafgeti4 (irafheader, offset) + * Get 4-byte integer from arbitrary part of IRAF header + * Subroutine: irafgetc2 (irafheader, offset) + * Get character string from arbitrary part of IRAF v.1 header + * Subroutine: irafgetc (irafheader, offset) + * Get character string from arbitrary part of IRAF header + * Subroutine: iraf2str (irafstring, nchar) + * Convert 2-byte/char IRAF string to 1-byte/char string + * Subroutine: irafswap (bitpix,string,nbytes) + * Swap bytes in string in place, with FITS bits/pixel code + * Subroutine: irafswap2 (string,nbytes) + * Swap bytes in string in place + * Subroutine irafswap4 (string,nbytes) + * Reverse bytes of Integer*4 or Real*4 vector in place + * Subroutine irafswap8 (string,nbytes) + * Reverse bytes of Real*8 vector in place + + + * Copyright: 2000 Smithsonian Astrophysical Observatory + * You may do anything you like with this file except remove + * this copyright. The Smithsonian Astrophysical Observatory + * makes no representations about the suitability of this + * software for any purpose. It is provided "as is" without + * express or implied warranty. + */ + +#include "fitsio2.h" +#include /* define stderr, FD, and NULL */ +#include +#include /* stddef.h is apparently needed to define size_t */ +#include + +#define FILE_NOT_OPENED 104 + +/* Parameters from iraf/lib/imhdr.h for IRAF version 1 images */ +#define SZ_IMPIXFILE 79 /* name of pixel storage file */ +#define SZ_IMHDRFILE 79 /* length of header storage file */ +#define SZ_IMTITLE 79 /* image title string */ +#define LEN_IMHDR 2052 /* length of std header */ + +/* Parameters from iraf/lib/imhdr.h for IRAF version 2 images */ +#define SZ_IM2PIXFILE 255 /* name of pixel storage file */ +#define SZ_IM2HDRFILE 255 /* name of header storage file */ +#define SZ_IM2TITLE 383 /* image title string */ +#define LEN_IM2HDR 2046 /* length of std header */ + +/* Offsets into header in bytes for parameters in IRAF version 1 images */ +#define IM_HDRLEN 12 /* Length of header in 4-byte ints */ +#define IM_PIXTYPE 16 /* Datatype of the pixels */ +#define IM_NDIM 20 /* Number of dimensions */ +#define IM_LEN 24 /* Length (as stored) */ +#define IM_PHYSLEN 52 /* Physical length (as stored) */ +#define IM_PIXOFF 88 /* Offset of the pixels */ +#define IM_CTIME 108 /* Time of image creation */ +#define IM_MTIME 112 /* Time of last modification */ +#define IM_LIMTIME 116 /* Time of min,max computation */ +#define IM_MAX 120 /* Maximum pixel value */ +#define IM_MIN 124 /* Maximum pixel value */ +#define IM_PIXFILE 412 /* Name of pixel storage file */ +#define IM_HDRFILE 572 /* Name of header storage file */ +#define IM_TITLE 732 /* Image name string */ + +/* Offsets into header in bytes for parameters in IRAF version 2 images */ +#define IM2_HDRLEN 6 /* Length of header in 4-byte ints */ +#define IM2_PIXTYPE 10 /* Datatype of the pixels */ +#define IM2_SWAPPED 14 /* Pixels are byte swapped */ +#define IM2_NDIM 18 /* Number of dimensions */ +#define IM2_LEN 22 /* Length (as stored) */ +#define IM2_PHYSLEN 50 /* Physical length (as stored) */ +#define IM2_PIXOFF 86 /* Offset of the pixels */ +#define IM2_CTIME 106 /* Time of image creation */ +#define IM2_MTIME 110 /* Time of last modification */ +#define IM2_LIMTIME 114 /* Time of min,max computation */ +#define IM2_MAX 118 /* Maximum pixel value */ +#define IM2_MIN 122 /* Maximum pixel value */ +#define IM2_PIXFILE 126 /* Name of pixel storage file */ +#define IM2_HDRFILE 382 /* Name of header storage file */ +#define IM2_TITLE 638 /* Image name string */ + +/* Codes from iraf/unix/hlib/iraf.h */ +#define TY_CHAR 2 +#define TY_SHORT 3 +#define TY_INT 4 +#define TY_LONG 5 +#define TY_REAL 6 +#define TY_DOUBLE 7 +#define TY_COMPLEX 8 +#define TY_POINTER 9 +#define TY_STRUCT 10 +#define TY_USHORT 11 +#define TY_UBYTE 12 + +#define LEN_PIXHDR 1024 +#define MAXINT 2147483647 /* Biggest number that can fit in long */ + +static int isirafswapped(char *irafheader, int offset); +static int irafgeti4(char *irafheader, int offset); +static char *irafgetc2(char *irafheader, int offset, int nc); +static char *irafgetc(char *irafheader, int offset, int nc); +static char *iraf2str(char *irafstring, int nchar); +static char *irafrdhead(const char *filename, int *lihead); +static int irafrdimage (char **buffptr, size_t *buffsize, + size_t *filesize, int *status); +static int iraftofits (char *hdrname, char *irafheader, int nbiraf, + char **buffptr, size_t *nbfits, size_t *fitssize, int *status); +static char *same_path(char *pixname, const char *hdrname); + +static int swaphead=0; /* =1 to swap data bytes of IRAF header values */ +static int swapdata=0; /* =1 to swap bytes in IRAF data pixels */ + +static void irafswap(int bitpix, char *string, int nbytes); +static void irafswap2(char *string, int nbytes); +static void irafswap4(char *string, int nbytes); +static void irafswap8(char *string, int nbytes); +static int pix_version (char *irafheader); +static int irafncmp (char *irafheader, char *teststring, int nc); +static int machswap(void); +static int head_version (char *irafheader); +static int hgeti4(char* hstring, char* keyword, int* val); +static int hgets(char* hstring, char* keyword, int lstr, char* string); +static char* hgetc(char* hstring, char* keyword); +static char* ksearch(char* hstring, char* keyword); +static char *blsearch (char* hstring, char* keyword); +static char *strsrch (char* s1, char* s2); +static char *strnsrch ( char* s1,char* s2,int ls1); +static void hputi4(char* hstring,char* keyword, int ival); +static void hputs(char* hstring,char* keyword,char* cval); +static void hputcom(char* hstring,char* keyword,char* comment); +static void hputl(char* hstring,char* keyword,int lval); +static void hputc(char* hstring,char* keyword,char* cval); +static int getirafpixname (const char *hdrname, char *irafheader, char *pixfilename, int *status); +int iraf2mem(char *filename, char **buffptr, size_t *buffsize, + size_t *filesize, int *status); + +void ffpmsg(const char *err_message); + +/* CFITS_API is defined below for use on Windows systems. */ +/* It is used to identify the public functions which should be exported. */ +/* This has no effect on non-windows platforms where "WIN32" is not defined */ + +/* this is only needed to export the "fits_delete_iraf_file" symbol, which */ +/* is called in fpackutil.c (and perhaps in other applications programs) */ + +#if defined (WIN32) + #if defined(cfitsio_EXPORTS) + #define CFITS_API __declspec(dllexport) + #else + #define CFITS_API //__declspec(dllimport) + #endif /* CFITS_API */ +#else /* defined (WIN32) */ + #define CFITS_API +#endif + +int CFITS_API fits_delete_iraf_file(const char *filename, int *status); + + +/*--------------------------------------------------------------------------*/ +int fits_delete_iraf_file(const char *filename, /* name of input file */ + int *status) /* IO - error status */ + +/* + Delete the iraf .imh header file and the associated .pix data file +*/ +{ + char *irafheader; + int lenirafhead; + + char pixfilename[SZ_IM2PIXFILE+1]; + + /* read IRAF header into dynamically created char array (free it later!) */ + irafheader = irafrdhead(filename, &lenirafhead); + + if (!irafheader) + { + return(*status = FILE_NOT_OPENED); + } + + getirafpixname (filename, irafheader, pixfilename, status); + + /* don't need the IRAF header any more */ + free(irafheader); + + if (*status > 0) + return(*status); + + remove(filename); + remove(pixfilename); + + return(*status); +} + +/*--------------------------------------------------------------------------*/ +int iraf2mem(char *filename, /* name of input file */ + char **buffptr, /* O - memory pointer (initially NULL) */ + size_t *buffsize, /* O - size of mem buffer, in bytes */ + size_t *filesize, /* O - size of FITS file, in bytes */ + int *status) /* IO - error status */ + +/* + Driver routine that reads an IRAF image into memory, also converting + it into FITS format. +*/ +{ + char *irafheader; + int lenirafhead; + + *buffptr = NULL; + *buffsize = 0; + *filesize = 0; + + /* read IRAF header into dynamically created char array (free it later!) */ + irafheader = irafrdhead(filename, &lenirafhead); + + if (!irafheader) + { + return(*status = FILE_NOT_OPENED); + } + + /* convert IRAF header to FITS header in memory */ + iraftofits(filename, irafheader, lenirafhead, buffptr, buffsize, filesize, + status); + + /* don't need the IRAF header any more */ + free(irafheader); + + if (*status > 0) + return(*status); + + *filesize = (((*filesize - 1) / 2880 ) + 1 ) * 2880; /* multiple of 2880 */ + + /* append the image data onto the FITS header */ + irafrdimage(buffptr, buffsize, filesize, status); + + return(*status); +} + +/*--------------------------------------------------------------------------*/ +/* Subroutine: irafrdhead (was irafrhead in D. Mink's original code) + * Purpose: Open and read the iraf .imh file. + * Returns: NULL if failure, else pointer to IRAF .imh image header + * Notes: The imhdr format is defined in iraf/lib/imhdr.h, some of + * which defines or mimicked, above. + */ + +static char *irafrdhead ( + const char *filename, /* Name of IRAF header file */ + int *lihead) /* Length of IRAF image header in bytes (returned) */ +{ + FILE *fd; + int nbr; + char *irafheader; + char errmsg[FLEN_ERRMSG]; + long nbhead; + int nihead; + + *lihead = 0; + + /* open the image header file */ + fd = fopen (filename, "rb"); + if (fd == NULL) { + ffpmsg("unable to open IRAF header file:"); + ffpmsg(filename); + return (NULL); + } + + /* Find size of image header file */ + if (fseek(fd, 0, 2) != 0) /* move to end of the file */ + { + ffpmsg("IRAFRHEAD: cannot seek in file:"); + ffpmsg(filename); + return(NULL); + } + + nbhead = ftell(fd); /* position = size of file */ + if (nbhead < 0) + { + ffpmsg("IRAFRHEAD: cannot get pos. in file:"); + ffpmsg(filename); + return(NULL); + } + + if (fseek(fd, 0, 0) != 0) /* move back to beginning */ + { + ffpmsg("IRAFRHEAD: cannot seek to beginning of file:"); + ffpmsg(filename); + return(NULL); + } + + /* allocate initial sized buffer */ + nihead = nbhead + 5000; + irafheader = (char *) calloc (1, nihead); + if (irafheader == NULL) { + snprintf(errmsg, FLEN_ERRMSG,"IRAFRHEAD Cannot allocate %d-byte header", + nihead); + ffpmsg(errmsg); + ffpmsg(filename); + return (NULL); + } + *lihead = nihead; + + /* Read IRAF header */ + nbr = fread (irafheader, 1, nbhead, fd); + fclose (fd); + + /* Reject if header less than minimum length */ + if (nbr < LEN_PIXHDR) { + snprintf(errmsg, FLEN_ERRMSG,"IRAFRHEAD header file: %d / %d bytes read.", + nbr,LEN_PIXHDR); + ffpmsg(errmsg); + ffpmsg(filename); + free (irafheader); + return (NULL); + } + + return (irafheader); +} +/*--------------------------------------------------------------------------*/ +static int irafrdimage ( + char **buffptr, /* FITS image header (filled) */ + size_t *buffsize, /* allocated size of the buffer */ + size_t *filesize, /* actual size of the FITS file */ + int *status) +{ + FILE *fd; + char *bang; + int nax = 1, naxis1 = 1, naxis2 = 1, naxis3 = 1, naxis4 = 1, npaxis1 = 1, npaxis2; + int bitpix, bytepix, i; + char *fitsheader, *image; + int nbr, nbimage, nbaxis, nbl, nbdiff; + char *pixheader; + char *linebuff; + int imhver, lpixhead = 0; + char pixname[SZ_IM2PIXFILE+1]; + char errmsg[FLEN_ERRMSG]; + size_t newfilesize; + + fitsheader = *buffptr; /* pointer to start of header */ + + /* Convert pixel file name to character string */ + hgets (fitsheader, "PIXFILE", SZ_IM2PIXFILE, pixname); + hgeti4 (fitsheader, "PIXOFF", &lpixhead); + + /* Open pixel file, ignoring machine name if present */ + if ((bang = strchr (pixname, '!')) != NULL ) + fd = fopen (bang + 1, "rb"); + else + fd = fopen (pixname, "rb"); + + /* Print error message and exit if pixel file is not found */ + if (!fd) { + ffpmsg("IRAFRIMAGE: Cannot open IRAF pixel file:"); + ffpmsg(pixname); + return (*status = FILE_NOT_OPENED); + } + + /* Read pixel header */ + pixheader = (char *) calloc (lpixhead, 1); + if (pixheader == NULL) { + ffpmsg("IRAFRIMAGE: Cannot alloc memory for pixel header"); + ffpmsg(pixname); + fclose (fd); + return (*status = FILE_NOT_OPENED); + } + nbr = fread (pixheader, 1, lpixhead, fd); + + /* Check size of pixel header */ + if (nbr < lpixhead) { + snprintf(errmsg, FLEN_ERRMSG,"IRAF pixel file: %d / %d bytes read.", + nbr,LEN_PIXHDR); + ffpmsg(errmsg); + free (pixheader); + fclose (fd); + return (*status = FILE_NOT_OPENED); + } + + /* check pixel header magic word */ + imhver = pix_version (pixheader); + if (imhver < 1) { + ffpmsg("File not valid IRAF pixel file:"); + ffpmsg(pixname); + free (pixheader); + fclose (fd); + return (*status = FILE_NOT_OPENED); + } + free (pixheader); + + /* Find number of bytes to read */ + hgeti4 (fitsheader,"NAXIS",&nax); + hgeti4 (fitsheader,"NAXIS1",&naxis1); + hgeti4 (fitsheader,"NPAXIS1",&npaxis1); + if (nax > 1) { + hgeti4 (fitsheader,"NAXIS2",&naxis2); + hgeti4 (fitsheader,"NPAXIS2",&npaxis2); + } + if (nax > 2) + hgeti4 (fitsheader,"NAXIS3",&naxis3); + if (nax > 3) + hgeti4 (fitsheader,"NAXIS4",&naxis4); + + hgeti4 (fitsheader,"BITPIX",&bitpix); + if (bitpix < 0) + bytepix = -bitpix / 8; + else + bytepix = bitpix / 8; + + nbimage = naxis1 * naxis2 * naxis3 * naxis4 * bytepix; + + newfilesize = *filesize + nbimage; /* header + data */ + newfilesize = (((newfilesize - 1) / 2880 ) + 1 ) * 2880; + + if (newfilesize > *buffsize) /* need to allocate more memory? */ + { + fitsheader = (char *) realloc (*buffptr, newfilesize); + if (fitsheader == NULL) { + snprintf(errmsg, FLEN_ERRMSG,"IRAFRIMAGE Cannot allocate %d-byte image buffer", + (int) (*filesize)); + ffpmsg(errmsg); + ffpmsg(pixname); + fclose (fd); + return (*status = FILE_NOT_OPENED); + } + } + + *buffptr = fitsheader; + *buffsize = newfilesize; + + image = fitsheader + *filesize; + *filesize = newfilesize; + + /* Read IRAF image all at once if physical and image dimensions are the same */ + if (npaxis1 == naxis1) + nbr = fread (image, 1, nbimage, fd); + + /* Read IRAF image one line at a time if physical and image dimensions differ */ + else { + nbdiff = (npaxis1 - naxis1) * bytepix; + nbaxis = naxis1 * bytepix; + linebuff = image; + nbr = 0; + if (naxis2 == 1 && naxis3 > 1) + naxis2 = naxis3; + for (i = 0; i < naxis2; i++) { + nbl = fread (linebuff, 1, nbaxis, fd); + nbr = nbr + nbl; + fseek (fd, nbdiff, 1); + linebuff = linebuff + nbaxis; + } + } + fclose (fd); + + /* Check size of image */ + if (nbr < nbimage) { + snprintf(errmsg, FLEN_ERRMSG,"IRAF pixel file: %d / %d bytes read.", + nbr,nbimage); + ffpmsg(errmsg); + ffpmsg(pixname); + return (*status = FILE_NOT_OPENED); + } + + /* Byte-reverse image, if necessary */ + if (swapdata) + irafswap (bitpix, image, nbimage); + + return (*status); +} +/*--------------------------------------------------------------------------*/ +/* Return IRAF image format version number from magic word in IRAF header*/ + +static int head_version ( + char *irafheader) /* IRAF image header from file */ + +{ + + /* Check header file magic word */ + if (irafncmp (irafheader, "imhdr", 5) != 0 ) { + if (strncmp (irafheader, "imhv2", 5) != 0) + return (0); + else + return (2); + } + else + return (1); +} + +/*--------------------------------------------------------------------------*/ +/* Return IRAF image format version number from magic word in IRAF pixel file */ + +static int pix_version ( + char *irafheader) /* IRAF image header from file */ +{ + + /* Check pixel file header magic word */ + if (irafncmp (irafheader, "impix", 5) != 0) { + if (strncmp (irafheader, "impv2", 5) != 0) + return (0); + else + return (2); + } + else + return (1); +} + +/*--------------------------------------------------------------------------*/ +/* Verify that file is valid IRAF imhdr or impix by checking first 5 chars + * Returns: 0 on success, 1 on failure */ + +static int irafncmp ( + +char *irafheader, /* IRAF image header from file */ +char *teststring, /* C character string to compare */ +int nc) /* Number of characters to compate */ + +{ + char *line; + + if ((line = iraf2str (irafheader, nc)) == NULL) + return (1); + if (strncmp (line, teststring, nc) == 0) { + free (line); + return (0); + } + else { + free (line); + return (1); + } +} +/*--------------------------------------------------------------------------*/ + +/* Convert IRAF image header to FITS image header, returning FITS header */ + +static int iraftofits ( + char *hdrname, /* IRAF header file name (may be path) */ + char *irafheader, /* IRAF image header */ + int nbiraf, /* Number of bytes in IRAF header */ + char **buffptr, /* pointer to the FITS header */ + size_t *nbfits, /* allocated size of the FITS header buffer */ + size_t *fitssize, /* Number of bytes in FITS header (returned) */ + /* = number of bytes to the end of the END keyword */ + int *status) +{ + char *objname; /* object name from FITS file */ + int lstr, i, j, k, ib, nax, nbits; + char *pixname, *newpixname, *bang, *chead; + char *fitsheader; + int nblock, nlines; + char *fhead, *fhead1, *fp, endline[81]; + char irafchar; + char fitsline[81]; + int pixtype; + int imhver, n, imu, pixoff, impixoff; +/* int immax, immin, imtime; */ + int imndim, imlen, imphyslen, impixtype; + char errmsg[FLEN_ERRMSG]; + + /* Set up last line of FITS header */ + (void)strncpy (endline,"END", 3); + for (i = 3; i < 80; i++) + endline[i] = ' '; + endline[80] = 0; + + /* Check header magic word */ + imhver = head_version (irafheader); + if (imhver < 1) { + ffpmsg("File not valid IRAF image header"); + ffpmsg(hdrname); + return(*status = FILE_NOT_OPENED); + } + if (imhver == 2) { + nlines = 24 + ((nbiraf - LEN_IM2HDR) / 81); + imndim = IM2_NDIM; + imlen = IM2_LEN; + imphyslen = IM2_PHYSLEN; + impixtype = IM2_PIXTYPE; + impixoff = IM2_PIXOFF; +/* imtime = IM2_MTIME; */ +/* immax = IM2_MAX; */ +/* immin = IM2_MIN; */ + } + else { + nlines = 24 + ((nbiraf - LEN_IMHDR) / 162); + imndim = IM_NDIM; + imlen = IM_LEN; + imphyslen = IM_PHYSLEN; + impixtype = IM_PIXTYPE; + impixoff = IM_PIXOFF; +/* imtime = IM_MTIME; */ +/* immax = IM_MAX; */ +/* immin = IM_MIN; */ + } + + /* Initialize FITS header */ + nblock = (nlines * 80) / 2880; + *nbfits = (nblock + 5) * 2880 + 4; + fitsheader = (char *) calloc (*nbfits, 1); + if (fitsheader == NULL) { + snprintf(errmsg, FLEN_ERRMSG,"IRAF2FITS Cannot allocate %d-byte FITS header", + (int) (*nbfits)); + ffpmsg(hdrname); + return (*status = FILE_NOT_OPENED); + } + + fhead = fitsheader; + *buffptr = fitsheader; + (void)strncpy (fitsheader, endline, 80); + hputl (fitsheader, "SIMPLE", 1); + fhead = fhead + 80; + + /* check if the IRAF file is in big endian (sun) format (= 0) or not. */ + /* This is done by checking the 4 byte integer in the header that */ + /* represents the iraf pixel type. This 4-byte word is guaranteed to */ + /* have the least sig byte != 0 and the most sig byte = 0, so if the */ + /* first byte of the word != 0, then the file in little endian format */ + /* like on an Alpha machine. */ + + swaphead = isirafswapped(irafheader, impixtype); + if (imhver == 1) + swapdata = swaphead; /* vers 1 data has same swapness as header */ + else + swapdata = irafgeti4 (irafheader, IM2_SWAPPED); + + /* Set pixel size in FITS header */ + pixtype = irafgeti4 (irafheader, impixtype); + switch (pixtype) { + case TY_CHAR: + nbits = 8; + break; + case TY_UBYTE: + nbits = 8; + break; + case TY_SHORT: + nbits = 16; + break; + case TY_USHORT: + nbits = -16; + break; + case TY_INT: + case TY_LONG: + nbits = 32; + break; + case TY_REAL: + nbits = -32; + break; + case TY_DOUBLE: + nbits = -64; + break; + default: + snprintf(errmsg,FLEN_ERRMSG,"Unsupported IRAF data type: %d", pixtype); + ffpmsg(errmsg); + ffpmsg(hdrname); + return (*status = FILE_NOT_OPENED); + } + hputi4 (fitsheader,"BITPIX",nbits); + hputcom (fitsheader,"BITPIX", "IRAF .imh pixel type"); + fhead = fhead + 80; + + /* Set image dimensions in FITS header */ + nax = irafgeti4 (irafheader, imndim); + hputi4 (fitsheader,"NAXIS",nax); + hputcom (fitsheader,"NAXIS", "IRAF .imh naxis"); + fhead = fhead + 80; + + n = irafgeti4 (irafheader, imlen); + hputi4 (fitsheader, "NAXIS1", n); + hputcom (fitsheader,"NAXIS1", "IRAF .imh image naxis[1]"); + fhead = fhead + 80; + + if (nax > 1) { + n = irafgeti4 (irafheader, imlen+4); + hputi4 (fitsheader, "NAXIS2", n); + hputcom (fitsheader,"NAXIS2", "IRAF .imh image naxis[2]"); + fhead = fhead + 80; + } + if (nax > 2) { + n = irafgeti4 (irafheader, imlen+8); + hputi4 (fitsheader, "NAXIS3", n); + hputcom (fitsheader,"NAXIS3", "IRAF .imh image naxis[3]"); + fhead = fhead + 80; + } + if (nax > 3) { + n = irafgeti4 (irafheader, imlen+12); + hputi4 (fitsheader, "NAXIS4", n); + hputcom (fitsheader,"NAXIS4", "IRAF .imh image naxis[4]"); + fhead = fhead + 80; + } + + /* Set object name in FITS header */ + if (imhver == 2) + objname = irafgetc (irafheader, IM2_TITLE, SZ_IM2TITLE); + else + objname = irafgetc2 (irafheader, IM_TITLE, SZ_IMTITLE); + if ((lstr = strlen (objname)) < 8) { + for (i = lstr; i < 8; i++) + objname[i] = ' '; + objname[8] = 0; + } + hputs (fitsheader,"OBJECT",objname); + hputcom (fitsheader,"OBJECT", "IRAF .imh title"); + free (objname); + fhead = fhead + 80; + + /* Save physical axis lengths so image file can be read */ + n = irafgeti4 (irafheader, imphyslen); + hputi4 (fitsheader, "NPAXIS1", n); + hputcom (fitsheader,"NPAXIS1", "IRAF .imh physical naxis[1]"); + fhead = fhead + 80; + if (nax > 1) { + n = irafgeti4 (irafheader, imphyslen+4); + hputi4 (fitsheader, "NPAXIS2", n); + hputcom (fitsheader,"NPAXIS2", "IRAF .imh physical naxis[2]"); + fhead = fhead + 80; + } + if (nax > 2) { + n = irafgeti4 (irafheader, imphyslen+8); + hputi4 (fitsheader, "NPAXIS3", n); + hputcom (fitsheader,"NPAXIS3", "IRAF .imh physical naxis[3]"); + fhead = fhead + 80; + } + if (nax > 3) { + n = irafgeti4 (irafheader, imphyslen+12); + hputi4 (fitsheader, "NPAXIS4", n); + hputcom (fitsheader,"NPAXIS4", "IRAF .imh physical naxis[4]"); + fhead = fhead + 80; + } + + /* Save image header filename in header */ + hputs (fitsheader,"IMHFILE",hdrname); + hputcom (fitsheader,"IMHFILE", "IRAF header file name"); + fhead = fhead + 80; + + /* Save image pixel file pathname in header */ + if (imhver == 2) + pixname = irafgetc (irafheader, IM2_PIXFILE, SZ_IM2PIXFILE); + else + pixname = irafgetc2 (irafheader, IM_PIXFILE, SZ_IMPIXFILE); + if (strncmp(pixname, "HDR", 3) == 0 ) { + newpixname = same_path (pixname, hdrname); + if (newpixname) { + free (pixname); + pixname = newpixname; + } + } + if (strchr (pixname, '/') == NULL && strchr (pixname, '$') == NULL) { + newpixname = same_path (pixname, hdrname); + if (newpixname) { + free (pixname); + pixname = newpixname; + } + } + + if ((bang = strchr (pixname, '!')) != NULL ) + hputs (fitsheader,"PIXFILE",bang+1); + else + hputs (fitsheader,"PIXFILE",pixname); + free (pixname); + hputcom (fitsheader,"PIXFILE", "IRAF .pix pixel file"); + fhead = fhead + 80; + + /* Save image offset from star of pixel file */ + pixoff = irafgeti4 (irafheader, impixoff); + pixoff = (pixoff - 1) * 2; + hputi4 (fitsheader, "PIXOFF", pixoff); + hputcom (fitsheader,"PIXOFF", "IRAF .pix pixel offset (Do not change!)"); + fhead = fhead + 80; + + /* Save IRAF file format version in header */ + hputi4 (fitsheader,"IMHVER",imhver); + hputcom (fitsheader,"IMHVER", "IRAF .imh format version (1 or 2)"); + fhead = fhead + 80; + + /* Save flag as to whether to swap IRAF data for this file and machine */ + if (swapdata) + hputl (fitsheader, "PIXSWAP", 1); + else + hputl (fitsheader, "PIXSWAP", 0); + hputcom (fitsheader,"PIXSWAP", "IRAF pixels, FITS byte orders differ if T"); + fhead = fhead + 80; + + /* Add user portion of IRAF header to FITS header */ + fitsline[80] = 0; + if (imhver == 2) { + imu = LEN_IM2HDR; + chead = irafheader; + j = 0; + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + for (i = imu; i < nbiraf; i++) { + irafchar = chead[i]; + if (irafchar == 0) + break; + else if (irafchar == 10) { + (void)strncpy (fhead, fitsline, 80); + /* fprintf (stderr,"%80s\n",fitsline); */ + if (strncmp (fitsline, "OBJECT ", 7) != 0) { + fhead = fhead + 80; + } + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + j = 0; + } + else { + if (j > 80) { + if (strncmp (fitsline, "OBJECT ", 7) != 0) { + (void)strncpy (fhead, fitsline, 80); + /* fprintf (stderr,"%80s\n",fitsline); */ + j = 9; + fhead = fhead + 80; + } + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + } + if (irafchar > 32 && irafchar < 127) + fitsline[j] = irafchar; + j++; + } + } + } + else { + imu = LEN_IMHDR; + chead = irafheader; + if (swaphead == 1) + ib = 0; + else + ib = 1; + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + j = 0; + for (i = imu; i < nbiraf; i=i+2) { + irafchar = chead[i+ib]; + if (irafchar == 0) + break; + else if (irafchar == 10) { + if (strncmp (fitsline, "OBJECT ", 7) != 0) { + (void)strncpy (fhead, fitsline, 80); + fhead = fhead + 80; + } + /* fprintf (stderr,"%80s\n",fitsline); */ + j = 0; + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + } + else { + if (j > 80) { + if (strncmp (fitsline, "OBJECT ", 7) != 0) { + (void)strncpy (fhead, fitsline, 80); + j = 9; + fhead = fhead + 80; + } + /* fprintf (stderr,"%80s\n",fitsline); */ + for (k = 0; k < 80; k++) + fitsline[k] = ' '; + } + if (irafchar > 32 && irafchar < 127) + fitsline[j] = irafchar; + j++; + } + } + } + + /* Add END to last line */ + (void)strncpy (fhead, endline, 80); + + /* Find end of last 2880-byte block of header */ + fhead = ksearch (fitsheader, "END") + 80; + nblock = *nbfits / 2880; + fhead1 = fitsheader + (nblock * 2880); + *fitssize = fhead - fitsheader; /* no. of bytes to end of END keyword */ + + /* Pad rest of header with spaces */ + strncpy (endline," ",3); + for (fp = fhead; fp < fhead1; fp = fp + 80) { + (void)strncpy (fp, endline,80); + } + + return (*status); +} +/*--------------------------------------------------------------------------*/ + +/* get the IRAF pixel file name */ + +static int getirafpixname ( + const char *hdrname, /* IRAF header file name (may be path) */ + char *irafheader, /* IRAF image header */ + char *pixfilename, /* IRAF pixel file name */ + int *status) +{ + int imhver; + char *pixname, *newpixname, *bang; + + /* Check header magic word */ + imhver = head_version (irafheader); + if (imhver < 1) { + ffpmsg("File not valid IRAF image header"); + ffpmsg(hdrname); + return(*status = FILE_NOT_OPENED); + } + + /* get image pixel file pathname in header */ + if (imhver == 2) + pixname = irafgetc (irafheader, IM2_PIXFILE, SZ_IM2PIXFILE); + else + pixname = irafgetc2 (irafheader, IM_PIXFILE, SZ_IMPIXFILE); + + if (strncmp(pixname, "HDR", 3) == 0 ) { + newpixname = same_path (pixname, hdrname); + if (newpixname) { + free (pixname); + pixname = newpixname; + } + } + + if (strchr (pixname, '/') == NULL && strchr (pixname, '$') == NULL) { + newpixname = same_path (pixname, hdrname); + if (newpixname) { + free (pixname); + pixname = newpixname; + } + } + + if ((bang = strchr (pixname, '!')) != NULL ) + strcpy(pixfilename,bang+1); + else + strcpy(pixfilename,pixname); + + free (pixname); + + return (*status); +} + +/*--------------------------------------------------------------------------*/ +/* Put filename and header path together */ + +static char *same_path ( + +char *pixname, /* IRAF pixel file pathname */ +const char *hdrname) /* IRAF image header file pathname */ + +{ + int len; + char *newpixname; + +/* WDP - 10/16/2007 - increased allocation to avoid possible overflow */ +/* newpixname = (char *) calloc (SZ_IM2PIXFILE, sizeof (char)); */ + + newpixname = (char *) calloc (2*SZ_IM2PIXFILE+1, sizeof (char)); + if (newpixname == NULL) { + ffpmsg("iraffits same_path: Cannot alloc memory for newpixname"); + return (NULL); + } + + /* Pixel file is in same directory as header */ + if (strncmp(pixname, "HDR$", 4) == 0 ) { + (void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE); + + /* find the end of the pathname */ + len = strlen (newpixname); +#ifndef VMS + while( (len > 0) && (newpixname[len-1] != '/') ) +#else + while( (len > 0) && (newpixname[len-1] != ']') && (newpixname[len-1] != ':') ) +#endif + len--; + + /* add name */ + newpixname[len] = '\0'; + (void)strncat (newpixname, &pixname[4], SZ_IM2PIXFILE); + } + + /* Bare pixel file with no path is assumed to be same as HDR$filename */ + else if (strchr (pixname, '/') == NULL && strchr (pixname, '$') == NULL) { + (void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE); + + /* find the end of the pathname */ + len = strlen (newpixname); +#ifndef VMS + while( (len > 0) && (newpixname[len-1] != '/') ) +#else + while( (len > 0) && (newpixname[len-1] != ']') && (newpixname[len-1] != ':') ) +#endif + len--; + + /* add name */ + newpixname[len] = '\0'; + (void)strncat (newpixname, pixname, SZ_IM2PIXFILE); + } + + /* Pixel file has same name as header file, but with .pix extension */ + else if (strncmp (pixname, "HDR", 3) == 0) { + + /* load entire header name string into name buffer */ + (void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE); + len = strlen (newpixname); + newpixname[len-3] = 'p'; + newpixname[len-2] = 'i'; + newpixname[len-1] = 'x'; + } + + return (newpixname); +} + +/*--------------------------------------------------------------------------*/ +static int isirafswapped ( + +char *irafheader, /* IRAF image header */ +int offset) /* Number of bytes to skip before number */ + + /* check if the IRAF file is in big endian (sun) format (= 0) or not */ + /* This is done by checking the 4 byte integer in the header that */ + /* represents the iraf pixel type. This 4-byte word is guaranteed to */ + /* have the least sig byte != 0 and the most sig byte = 0, so if the */ + /* first byte of the word != 0, then the file in little endian format */ + /* like on an Alpha machine. */ + +{ + int swapped; + + if (irafheader[offset] != 0) + swapped = 1; + else + swapped = 0; + + return (swapped); +} +/*--------------------------------------------------------------------------*/ +static int irafgeti4 ( + +char *irafheader, /* IRAF image header */ +int offset) /* Number of bytes to skip before number */ + +{ + char *ctemp, *cheader; + int temp; + + cheader = irafheader; + ctemp = (char *) &temp; + + if (machswap() != swaphead) { + ctemp[3] = cheader[offset]; + ctemp[2] = cheader[offset+1]; + ctemp[1] = cheader[offset+2]; + ctemp[0] = cheader[offset+3]; + } + else { + ctemp[0] = cheader[offset]; + ctemp[1] = cheader[offset+1]; + ctemp[2] = cheader[offset+2]; + ctemp[3] = cheader[offset+3]; + } + return (temp); +} + +/*--------------------------------------------------------------------------*/ +/* IRAFGETC2 -- Get character string from arbitrary part of v.1 IRAF header */ + +static char *irafgetc2 ( + +char *irafheader, /* IRAF image header */ +int offset, /* Number of bytes to skip before string */ +int nc) /* Maximum number of characters in string */ + +{ + char *irafstring, *string; + + irafstring = irafgetc (irafheader, offset, 2*(nc+1)); + string = iraf2str (irafstring, nc); + free (irafstring); + + return (string); +} + +/*--------------------------------------------------------------------------*/ +/* IRAFGETC -- Get character string from arbitrary part of IRAF header */ + +static char *irafgetc ( + +char *irafheader, /* IRAF image header */ +int offset, /* Number of bytes to skip before string */ +int nc) /* Maximum number of characters in string */ + +{ + char *ctemp, *cheader; + int i; + + cheader = irafheader; + ctemp = (char *) calloc (nc+1, 1); + if (ctemp == NULL) { + ffpmsg("IRAFGETC Cannot allocate memory for string variable"); + return (NULL); + } + for (i = 0; i < nc; i++) { + ctemp[i] = cheader[offset+i]; + if (ctemp[i] > 0 && ctemp[i] < 32) + ctemp[i] = ' '; + } + + return (ctemp); +} + +/*--------------------------------------------------------------------------*/ +/* Convert IRAF 2-byte/char string to 1-byte/char string */ + +static char *iraf2str ( + +char *irafstring, /* IRAF 2-byte/character string */ +int nchar) /* Number of characters in string */ +{ + char *string; + int i, j; + + string = (char *) calloc (nchar+1, 1); + if (string == NULL) { + ffpmsg("IRAF2STR Cannot allocate memory for string variable"); + return (NULL); + } + + /* the chars are in bytes 1, 3, 5, ... if bigendian format (SUN) */ + /* else in bytes 0, 2, 4, ... if little endian format (Alpha) */ + + if (irafstring[0] != 0) + j = 0; + else + j = 1; + + /* Convert appropriate byte of input to output character */ + for (i = 0; i < nchar; i++) { + string[i] = irafstring[j]; + j = j + 2; + } + + return (string); +} + +/*--------------------------------------------------------------------------*/ +/* IRAFSWAP -- Reverse bytes of any type of vector in place */ + +static void irafswap ( + +int bitpix, /* Number of bits per pixel */ + /* 16 = short, -16 = unsigned short, 32 = int */ + /* -32 = float, -64 = double */ +char *string, /* Address of starting point of bytes to swap */ +int nbytes) /* Number of bytes to swap */ + +{ + switch (bitpix) { + + case 16: + if (nbytes < 2) return; + irafswap2 (string,nbytes); + break; + + case 32: + if (nbytes < 4) return; + irafswap4 (string,nbytes); + break; + + case -16: + if (nbytes < 2) return; + irafswap2 (string,nbytes); + break; + + case -32: + if (nbytes < 4) return; + irafswap4 (string,nbytes); + break; + + case -64: + if (nbytes < 8) return; + irafswap8 (string,nbytes); + break; + + } + return; +} + +/*--------------------------------------------------------------------------*/ +/* IRAFSWAP2 -- Swap bytes in string in place */ + +static void irafswap2 ( + +char *string, /* Address of starting point of bytes to swap */ +int nbytes) /* Number of bytes to swap */ + +{ + char *sbyte, temp, *slast; + + slast = string + nbytes; + sbyte = string; + while (sbyte < slast) { + temp = sbyte[0]; + sbyte[0] = sbyte[1]; + sbyte[1] = temp; + sbyte= sbyte + 2; + } + return; +} + +/*--------------------------------------------------------------------------*/ +/* IRAFSWAP4 -- Reverse bytes of Integer*4 or Real*4 vector in place */ + +static void irafswap4 ( + +char *string, /* Address of Integer*4 or Real*4 vector */ +int nbytes) /* Number of bytes to reverse */ + +{ + char *sbyte, *slast; + char temp0, temp1, temp2, temp3; + + slast = string + nbytes; + sbyte = string; + while (sbyte < slast) { + temp3 = sbyte[0]; + temp2 = sbyte[1]; + temp1 = sbyte[2]; + temp0 = sbyte[3]; + sbyte[0] = temp0; + sbyte[1] = temp1; + sbyte[2] = temp2; + sbyte[3] = temp3; + sbyte = sbyte + 4; + } + + return; +} + +/*--------------------------------------------------------------------------*/ +/* IRAFSWAP8 -- Reverse bytes of Real*8 vector in place */ + +static void irafswap8 ( + +char *string, /* Address of Real*8 vector */ +int nbytes) /* Number of bytes to reverse */ + +{ + char *sbyte, *slast; + char temp[8]; + + slast = string + nbytes; + sbyte = string; + while (sbyte < slast) { + temp[7] = sbyte[0]; + temp[6] = sbyte[1]; + temp[5] = sbyte[2]; + temp[4] = sbyte[3]; + temp[3] = sbyte[4]; + temp[2] = sbyte[5]; + temp[1] = sbyte[6]; + temp[0] = sbyte[7]; + sbyte[0] = temp[0]; + sbyte[1] = temp[1]; + sbyte[2] = temp[2]; + sbyte[3] = temp[3]; + sbyte[4] = temp[4]; + sbyte[5] = temp[5]; + sbyte[6] = temp[6]; + sbyte[7] = temp[7]; + sbyte = sbyte + 8; + } + return; +} + +/*--------------------------------------------------------------------------*/ +static int +machswap (void) + +{ + char *ctest; + int itest; + + itest = 1; + ctest = (char *)&itest; + if (*ctest) + return (1); + else + return (0); +} + +/*--------------------------------------------------------------------------*/ +/* the following routines were originally in hget.c */ +/*--------------------------------------------------------------------------*/ + + +static int lhead0 = 0; + +/*--------------------------------------------------------------------------*/ + +/* Extract long value for variable from FITS header string */ + +static int +hgeti4 (hstring,keyword,ival) + +char *hstring; /* character string containing FITS header information + in the format = {/ } */ +char *keyword; /* character string containing the name of the keyword + the value of which is returned. hget searches for a + line beginning with this string. if "[n]" is present, + the n'th token in the value is returned. + (the first 8 characters must be unique) */ +int *ival; +{ +char *value; +double dval; +int minint; +char val[30]; + +/* Get value and comment from header string */ + value = hgetc (hstring,keyword); + +/* Translate value from ASCII to binary */ + if (value != NULL) { + minint = -MAXINT - 1; + if (strlen(value) > 29) + return(0); + strcpy (val, value); + dval = atof (val); + if (dval+0.001 > MAXINT) + *ival = MAXINT; + else if (dval >= 0) + *ival = (int) (dval + 0.001); + else if (dval-0.001 < minint) + *ival = minint; + else + *ival = (int) (dval - 0.001); + return (1); + } + else { + return (0); + } +} + +/*-------------------------------------------------------------------*/ +/* Extract string value for variable from FITS header string */ + +static int +hgets (hstring, keyword, lstr, str) + +char *hstring; /* character string containing FITS header information + in the format = {/ } */ +char *keyword; /* character string containing the name of the keyword + the value of which is returned. hget searches for a + line beginning with this string. if "[n]" is present, + the n'th token in the value is returned. + (the first 8 characters must be unique) */ +int lstr; /* Size of str in characters */ +char *str; /* String (returned) */ +{ + char *value; + int lval; + +/* Get value and comment from header string */ + value = hgetc (hstring,keyword); + + if (value != NULL) { + lval = strlen (value); + if (lval < lstr) + strcpy (str, value); + else if (lstr > 1) { + strncpy (str, value, lstr-1); + str[lstr-1]=0; + } + else { + str[0] = value[0]; + } + return (1); + } + else + return (0); +} + +/*-------------------------------------------------------------------*/ +/* Extract character value for variable from FITS header string */ + +static char * +hgetc (hstring,keyword0) + +char *hstring; /* character string containing FITS header information + in the format = {/ } */ +char *keyword0; /* character string containing the name of the keyword + the value of which is returned. hget searches for a + line beginning with this string. if "[n]" is present, + the n'th token in the value is returned. + (the first 8 characters must be unique) */ +{ + static char cval[80]; + char *value; + char cwhite[2]; + char squot[2], dquot[2], lbracket[2], rbracket[2], slash[2], comma[2]; + char keyword[81]; /* large for ESO hierarchical keywords */ + char line[100]; + char *vpos, *cpar = NULL; + char *q1, *q2 = NULL, *v1, *v2, *c1, *brack1, *brack2; + char *saveptr; + int ipar, i; + + squot[0] = 39; + squot[1] = 0; + dquot[0] = 34; + dquot[1] = 0; + lbracket[0] = 91; + lbracket[1] = 0; + comma[0] = 44; + comma[1] = 0; + rbracket[0] = 93; + rbracket[1] = 0; + slash[0] = 47; + slash[1] = 0; + +/* Find length of variable name */ + strncpy (keyword,keyword0, sizeof(keyword)-1); + keyword[80]=0; + brack1 = strsrch (keyword,lbracket); + if (brack1 == NULL) + brack1 = strsrch (keyword,comma); + if (brack1 != NULL) { + *brack1 = '\0'; + brack1++; + } + +/* Search header string for variable name */ + vpos = ksearch (hstring,keyword); + +/* Exit if not found */ + if (vpos == NULL) { + return (NULL); + } + +/* Initialize line to nulls */ + for (i = 0; i < 100; i++) + line[i] = 0; + +/* In standard FITS, data lasts until 80th character */ + +/* Extract entry for this variable from the header */ + strncpy (line,vpos,80); + +/* check for quoted value */ + q1 = strsrch (line,squot); + c1 = strsrch (line,slash); + if (q1 != NULL) { + if (c1 != NULL && q1 < c1) + q2 = strsrch (q1+1,squot); + else if (c1 == NULL) + q2 = strsrch (q1+1,squot); + else + q1 = NULL; + } + else { + q1 = strsrch (line,dquot); + if (q1 != NULL) { + if (c1 != NULL && q1 < c1) + q2 = strsrch (q1+1,dquot); + else if (c1 == NULL) + q2 = strsrch (q1+1,dquot); + else + q1 = NULL; + } + else { + q1 = NULL; + q2 = line + 10; + } + } + +/* Extract value and remove excess spaces */ + if (q1 != NULL) { + v1 = q1 + 1; + v2 = q2; + c1 = strsrch (q2,"/"); + } + else { + v1 = strsrch (line,"=") + 1; + c1 = strsrch (line,"/"); + if (c1 != NULL) + v2 = c1; + else + v2 = line + 79; + } + +/* Ignore leading spaces */ + while (*v1 == ' ' && v1 < v2) { + v1++; + } + +/* Drop trailing spaces */ + *v2 = '\0'; + v2--; + while (*v2 == ' ' && v2 > v1) { + *v2 = '\0'; + v2--; + } + + if (!strcmp (v1, "-0")) + v1++; + strcpy (cval,v1); + value = cval; + +/* If keyword has brackets, extract appropriate token from value */ + if (brack1 != NULL) { + brack2 = strsrch (brack1,rbracket); + if (brack2 != NULL) + *brack2 = '\0'; + ipar = atoi (brack1); + if (ipar > 0) { + cwhite[0] = ' '; + cwhite[1] = '\0'; + for (i = 1; i <= ipar; i++) { + cpar = ffstrtok (v1,cwhite,&saveptr); + v1 = NULL; + } + if (cpar != NULL) { + strcpy (cval,cpar); + } + else + value = NULL; + } + } + + return (value); +} + + +/*-------------------------------------------------------------------*/ +/* Find beginning of fillable blank line before FITS header keyword line */ + +static char * +blsearch (hstring,keyword) + +/* Find entry for keyword keyword in FITS header string hstring. + (the keyword may have a maximum of eight letters) + NULL is returned if the keyword is not found */ + +char *hstring; /* character string containing fits-style header + information in the format = {/ } + the default is that each entry is 80 characters long; + however, lines may be of arbitrary length terminated by + nulls, carriage returns or linefeeds, if packed is true. */ +char *keyword; /* character string containing the name of the variable + to be returned. ksearch searches for a line beginning + with this string. The string may be a character + literal or a character variable terminated by a null + or '$'. it is truncated to 8 characters. */ +{ + char *loc, *headnext, *headlast, *pval, *lc, *line; + char *bval; + int icol, nextchar, lkey, nleft, lhstr; + + pval = 0; + + /* Search header string for variable name */ + if (lhead0) + lhstr = lhead0; + else { + lhstr = 0; + while (lhstr < 57600 && hstring[lhstr] != 0) + lhstr++; + } + headlast = hstring + lhstr; + headnext = hstring; + pval = NULL; + while (headnext < headlast) { + nleft = headlast - headnext; + loc = strnsrch (headnext, keyword, nleft); + + /* Exit if keyword is not found */ + if (loc == NULL) { + break; + } + + icol = (loc - hstring) % 80; + lkey = strlen (keyword); + nextchar = (int) *(loc + lkey); + + /* If this is not in the first 8 characters of a line, keep searching */ + if (icol > 7) + headnext = loc + 1; + + /* If parameter name in header is longer, keep searching */ + else if (nextchar != 61 && nextchar > 32 && nextchar < 127) + headnext = loc + 1; + + /* If preceeding characters in line are not blanks, keep searching */ + else { + line = loc - icol; + for (lc = line; lc < loc; lc++) { + if (*lc != ' ') + headnext = loc + 1; + } + + /* Return pointer to start of line if match */ + if (loc >= headnext) { + pval = line; + break; + } + } + } + + /* Return NULL if keyword is found at start of FITS header string */ + if (pval == NULL) + return (pval); + + /* Return NULL if found the first keyword in the header */ + if (pval == hstring) + return (NULL); + + /* Find last nonblank line before requested keyword */ + bval = pval - 80; + while (!strncmp (bval," ",8)) + bval = bval - 80; + bval = bval + 80; + + /* Return pointer to calling program if blank lines found */ + if (bval < pval) + return (bval); + else + return (NULL); +} + + +/*-------------------------------------------------------------------*/ +/* Find FITS header line containing specified keyword */ + +static char *ksearch (hstring,keyword) + +/* Find entry for keyword keyword in FITS header string hstring. + (the keyword may have a maximum of eight letters) + NULL is returned if the keyword is not found */ + +char *hstring; /* character string containing fits-style header + information in the format = {/ } + the default is that each entry is 80 characters long; + however, lines may be of arbitrary length terminated by + nulls, carriage returns or linefeeds, if packed is true. */ +char *keyword; /* character string containing the name of the variable + to be returned. ksearch searches for a line beginning + with this string. The string may be a character + literal or a character variable terminated by a null + or '$'. it is truncated to 8 characters. */ +{ + char *loc, *headnext, *headlast, *pval, *lc, *line; + int icol, nextchar, lkey, nleft, lhstr; + + pval = 0; + +/* Search header string for variable name */ + if (lhead0) + lhstr = lhead0; + else { + lhstr = 0; + while (lhstr < 57600 && hstring[lhstr] != 0) + lhstr++; + } + headlast = hstring + lhstr; + headnext = hstring; + pval = NULL; + while (headnext < headlast) { + nleft = headlast - headnext; + loc = strnsrch (headnext, keyword, nleft); + + /* Exit if keyword is not found */ + if (loc == NULL) { + break; + } + + icol = (loc - hstring) % 80; + lkey = strlen (keyword); + nextchar = (int) *(loc + lkey); + + /* If this is not in the first 8 characters of a line, keep searching */ + if (icol > 7) + headnext = loc + 1; + + /* If parameter name in header is longer, keep searching */ + else if (nextchar != 61 && nextchar > 32 && nextchar < 127) + headnext = loc + 1; + + /* If preceeding characters in line are not blanks, keep searching */ + else { + line = loc - icol; + for (lc = line; lc < loc; lc++) { + if (*lc != ' ') + headnext = loc + 1; + } + + /* Return pointer to start of line if match */ + if (loc >= headnext) { + pval = line; + break; + } + } + } + +/* Return pointer to calling program */ + return (pval); + +} + +/*-------------------------------------------------------------------*/ +/* Find string s2 within null-terminated string s1 */ + +static char * +strsrch (s1, s2) + +char *s1; /* String to search */ +char *s2; /* String to look for */ + +{ + int ls1; + ls1 = strlen (s1); + return (strnsrch (s1, s2, ls1)); +} + +/*-------------------------------------------------------------------*/ +/* Find string s2 within string s1 */ + +static char * +strnsrch (s1, s2, ls1) + +char *s1; /* String to search */ +char *s2; /* String to look for */ +int ls1; /* Length of string being searched */ + +{ + char *s,*s1e; + char cfirst,clast; + int i,ls2; + + /* Return null string if either pointer is NULL */ + if (s1 == NULL || s2 == NULL) + return (NULL); + + /* A zero-length pattern is found in any string */ + ls2 = strlen (s2); + if (ls2 ==0) + return (s1); + + /* Only a zero-length string can be found in a zero-length string */ + if (ls1 ==0) + return (NULL); + + cfirst = s2[0]; + clast = s2[ls2-1]; + s1e = s1 + ls1 - ls2 + 1; + s = s1; + while (s < s1e) { + + /* Search for first character in pattern string */ + if (*s == cfirst) { + + /* If single character search, return */ + if (ls2 == 1) + return (s); + + /* Search for last character in pattern string if first found */ + if (s[ls2-1] == clast) { + + /* If two-character search, return */ + if (ls2 == 2) + return (s); + + /* If 3 or more characters, check for rest of search string */ + i = 1; + while (i < ls2 && s[i] == s2[i]) + i++; + + /* If entire string matches, return */ + if (i >= ls2) + return (s); + } + } + s++; + } + return (NULL); +} + +/*-------------------------------------------------------------------*/ +/* the following routines were originally in hget.c */ +/*-------------------------------------------------------------------*/ +/* HPUTI4 - Set int keyword = ival in FITS header string */ + +static void +hputi4 (hstring,keyword,ival) + + char *hstring; /* character string containing FITS-style header + information in the format + = {/ } + each entry is padded with spaces to 80 characters */ + + char *keyword; /* character string containing the name of the variable + to be returned. hput searches for a line beginning + with this string, and if there isn't one, creates one. + The first 8 characters of keyword must be unique. */ + int ival; /* int number */ +{ + char value[30]; + + /* Translate value from binary to ASCII */ + snprintf (value,30,"%d",ival); + + /* Put value into header string */ + hputc (hstring,keyword,value); + + /* Return to calling program */ + return; +} + +/*-------------------------------------------------------------------*/ + +/* HPUTL - Set keyword = F if lval=0, else T, in FITS header string */ + +static void +hputl (hstring, keyword,lval) + +char *hstring; /* FITS header */ +char *keyword; /* Keyword name */ +int lval; /* logical variable (0=false, else true) */ +{ + char value[8]; + + /* Translate value from binary to ASCII */ + if (lval) + strcpy (value, "T"); + else + strcpy (value, "F"); + + /* Put value into header string */ + hputc (hstring,keyword,value); + + /* Return to calling program */ + return; +} + +/*-------------------------------------------------------------------*/ + +/* HPUTS - Set character string keyword = 'cval' in FITS header string */ + +static void +hputs (hstring,keyword,cval) + +char *hstring; /* FITS header */ +char *keyword; /* Keyword name */ +char *cval; /* character string containing the value for variable + keyword. trailing and leading blanks are removed. */ +{ + char squot = 39; + char value[70]; + int lcval; + + /* find length of variable string */ + + lcval = strlen (cval); + if (lcval > 67) + lcval = 67; + + /* Put quotes around string */ + value[0] = squot; + strncpy (&value[1],cval,lcval); + value[lcval+1] = squot; + value[lcval+2] = 0; + + /* Put value into header string */ + hputc (hstring,keyword,value); + + /* Return to calling program */ + return; +} + +/*---------------------------------------------------------------------*/ +/* HPUTC - Set character string keyword = value in FITS header string */ + +static void +hputc (hstring,keyword,value) + +char *hstring; +char *keyword; +char *value; /* character string containing the value for variable + keyword. trailing and leading blanks are removed. */ +{ + char squot = 39; + char line[100]; + char newcom[50]; + char blank[80]; + char *v, *vp, *v1, *v2, *q1, *q2, *c1, *ve; + int lkeyword, lcom, lval, lc, i; + + for (i = 0; i < 80; i++) + blank[i] = ' '; + + /* find length of keyword and value */ + lkeyword = strlen (keyword); + lval = strlen (value); + + /* If COMMENT or HISTORY, always add it just before the END */ + if (lkeyword == 7 && (strncmp (keyword,"COMMENT",7) == 0 || + strncmp (keyword,"HISTORY",7) == 0)) { + + /* Find end of header */ + v1 = ksearch (hstring,"END"); + v2 = v1 + 80; + + /* Move END down one line */ + strncpy (v2, v1, 80); + + /* Insert keyword */ + strncpy (v1,keyword,7); + + /* Pad with spaces */ + for (vp = v1+lkeyword; vp < v2; vp++) + *vp = ' '; + + /* Insert comment */ + strncpy (v1+9,value,lval); + return; + } + + /* Otherwise search for keyword */ + else + v1 = ksearch (hstring,keyword); + + /* If parameter is not found, find a place to put it */ + if (v1 == NULL) { + + /* First look for blank lines before END */ + v1 = blsearch (hstring, "END"); + + /* Otherwise, create a space for it at the end of the header */ + if (v1 == NULL) { + ve = ksearch (hstring,"END"); + v1 = ve; + v2 = v1 + 80; + strncpy (v2, ve, 80); + } + else + v2 = v1 + 80; + lcom = 0; + newcom[0] = 0; + } + + /* Otherwise, extract the entry for this keyword from the header */ + else { + strncpy (line, v1, 80); + line[80] = 0; + v2 = v1 + 80; + + /* check for quoted value */ + q1 = strchr (line, squot); + if (q1 != NULL) + q2 = strchr (q1+1,squot); + else + q2 = line; + + /* extract comment and remove trailing spaces */ + + c1 = strchr (q2,'/'); + if (c1 != NULL) { + lcom = 80 - (c1 - line); + strncpy (newcom, c1+1, lcom); + vp = newcom + lcom - 1; + while (vp-- > newcom && *vp == ' ') + *vp = 0; + lcom = strlen (newcom); + } + else { + newcom[0] = 0; + lcom = 0; + } + } + + /* Fill new entry with spaces */ + for (vp = v1; vp < v2; vp++) + *vp = ' '; + + /* Copy keyword to new entry */ + strncpy (v1, keyword, lkeyword); + + /* Add parameter value in the appropriate place */ + vp = v1 + 8; + *vp = '='; + vp = v1 + 9; + *vp = ' '; + vp = vp + 1; + if (*value == squot) { + strncpy (vp, value, lval); + if (lval+12 > 31) + lc = lval + 12; + else + lc = 30; + } + else { + vp = v1 + 30 - lval; + strncpy (vp, value, lval); + lc = 30; + } + + /* Add comment in the appropriate place */ + if (lcom > 0) { + if (lc+2+lcom > 80) + lcom = 78 - lc; + vp = v1 + lc + 2; /* Jul 16 1997: was vp = v1 + lc * 2 */ + *vp = '/'; + vp = vp + 1; + strncpy (vp, newcom, lcom); + for (v = vp + lcom; v < v2; v++) + *v = ' '; + } + + return; +} + +/*-------------------------------------------------------------------*/ +/* HPUTCOM - Set comment for keyword or on line in FITS header string */ + +static void +hputcom (hstring,keyword,comment) + + char *hstring; + char *keyword; + char *comment; +{ + char squot; + char line[100]; + int lkeyword, lcom; + char *vp, *v1, *v2, *c0 = NULL, *c1, *q1, *q2; + + squot = 39; + +/* Find length of variable name */ + lkeyword = strlen (keyword); + +/* If COMMENT or HISTORY, always add it just before the END */ + if (lkeyword == 7 && (strncmp (keyword,"COMMENT",7) == 0 || + strncmp (keyword,"HISTORY",7) == 0)) { + + /* Find end of header */ + v1 = ksearch (hstring,"END"); + v2 = v1 + 80; + strncpy (v2, v1, 80); + + /* blank out new line and insert keyword */ + for (vp = v1; vp < v2; vp++) + *vp = ' '; + strncpy (v1, keyword, lkeyword); + } + +/* search header string for variable name */ + else { + v1 = ksearch (hstring,keyword); + v2 = v1 + 80; + + /* if parameter is not found, return without doing anything */ + if (v1 == NULL) { + return; + } + + /* otherwise, extract entry for this variable from the header */ + strncpy (line, v1, 80); + + /* check for quoted value */ + q1 = strchr (line,squot); + if (q1 != NULL) + q2 = strchr (q1+1,squot); + else + q2 = NULL; + + if (q2 == NULL || q2-line < 31) + c0 = v1 + 31; + else + c0 = v1 + (q2-line) + 2; /* allan: 1997-09-30, was c0=q2+2 */ + + strncpy (c0, "/ ",2); + } + +/* create new entry */ + lcom = strlen (comment); + + if (lcom > 0) { + c1 = c0 + 2; + if (c1+lcom > v2) + lcom = v2 - c1; + strncpy (c1, comment, lcom); + } + +} diff --git a/testbed/astropy__astropy/cextern/cfitsio/lib/pliocomp.c b/testbed/astropy__astropy/cextern/cfitsio/lib/pliocomp.c new file mode 100644 index 0000000000000000000000000000000000000000..47a636918cd09a8aa43d99d2b1a924b182e8714e --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/lib/pliocomp.c @@ -0,0 +1,331 @@ +/* stdlib is needed for the abs function */ +#include +/* + The following prototype code was provided by Doug Tody, NRAO, for + performing conversion between pixel arrays and line lists. The + compression technique is used in IRAF. +*/ +int pl_p2li (int *pxsrc, int xs, short *lldst, int npix); +int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix); + + +/* + * PL_P2L -- Convert a pixel array to a line list. The length of the list is + * returned as the function value. + * + * Translated from the SPP version using xc -f, f2c. 8Sep99 DCT. + */ + +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif + +int pl_p2li (int *pxsrc, int xs, short *lldst, int npix) +/* int *pxsrc; input pixel array */ +/* int xs; starting index in pxsrc (?) */ +/* short *lldst; encoded line list */ +/* int npix; number of pixels to convert */ +{ + /* System generated locals */ + int ret_val, i__1, i__2, i__3; + + /* Local variables */ + int zero, v, x1, hi, ip, dv, xe, np, op, iz, nv = 0, pv, nz; + + /* Parameter adjustments */ + --lldst; + --pxsrc; + + /* Function Body */ + if (! (npix <= 0)) { + goto L110; + } + ret_val = 0; + goto L100; +L110: + lldst[3] = -100; + lldst[2] = 7; + lldst[1] = 0; + lldst[6] = 0; + lldst[7] = 0; + xe = xs + npix - 1; + op = 8; + zero = 0; +/* Computing MAX */ + i__1 = zero, i__2 = pxsrc[xs]; + pv = max(i__1,i__2); + x1 = xs; + iz = xs; + hi = 1; + i__1 = xe; + for (ip = xs; ip <= i__1; ++ip) { + if (! (ip < xe)) { + goto L130; + } +/* Computing MAX */ + i__2 = zero, i__3 = pxsrc[ip + 1]; + nv = max(i__2,i__3); + if (! (nv == pv)) { + goto L140; + } + goto L120; +L140: + if (! (pv == 0)) { + goto L150; + } + pv = nv; + x1 = ip + 1; + goto L120; +L150: + goto L131; +L130: + if (! (pv == 0)) { + goto L160; + } + x1 = xe + 1; +L160: +L131: + np = ip - x1 + 1; + nz = x1 - iz; + if (! (pv > 0)) { + goto L170; + } + dv = pv - hi; + if (! (dv != 0)) { + goto L180; + } + hi = pv; + if (! (abs(dv) > 4095)) { + goto L190; + } + lldst[op] = (short) ((pv & 4095) + 4096); + ++op; + lldst[op] = (short) (pv / 4096); + ++op; + goto L191; +L190: + if (! (dv < 0)) { + goto L200; + } + lldst[op] = (short) (-dv + 12288); + goto L201; +L200: + lldst[op] = (short) (dv + 8192); +L201: + ++op; + if (! (np == 1 && nz == 0)) { + goto L210; + } + v = lldst[op - 1]; + lldst[op - 1] = (short) (v | 16384); + goto L91; +L210: +L191: +L180: +L170: + if (! (nz > 0)) { + goto L220; + } +L230: + if (! (nz > 0)) { + goto L232; + } + lldst[op] = (short) min(4095,nz); + ++op; +/* L231: */ + nz += -4095; + goto L230; +L232: + if (! (np == 1 && pv > 0)) { + goto L240; + } + lldst[op - 1] = (short) (lldst[op - 1] + 20481); + goto L91; +L240: +L220: +L250: + if (! (np > 0)) { + goto L252; + } + lldst[op] = (short) (min(4095,np) + 16384); + ++op; +/* L251: */ + np += -4095; + goto L250; +L252: +L91: + x1 = ip + 1; + iz = x1; + pv = nv; +L120: + ; + } +/* L121: */ + lldst[4] = (short) ((op - 1) % 32768); + lldst[5] = (short) ((op - 1) / 32768); + ret_val = op - 1; + goto L100; +L100: + return ret_val; +} /* plp2li_ */ + +/* + * PL_L2PI -- Translate a PLIO line list into an integer pixel array. + * The number of pixels output (always npix) is returned as the function + * value. + * + * Translated from the SPP version using xc -f, f2c. 8Sep99 DCT. + */ + +int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix) +/* short *ll_src; encoded line list */ +/* int xs; starting index in ll_src */ +/* int *px_dst; output pixel array */ +/* int npix; number of pixels to convert */ +{ + /* System generated locals */ + int ret_val, i__1, i__2; + + /* Local variables */ + int data, sw0001, otop, i__, lllen, i1, i2, x1, x2, ip, xe, np, + op, pv, opcode, llfirt; + int skipwd; + + /* Parameter adjustments */ + --px_dst; + --ll_src; + + /* Function Body */ + if (! (ll_src[3] > 0)) { + goto L110; + } + lllen = ll_src[3]; + llfirt = 4; + goto L111; +L110: + lllen = (ll_src[5] << 15) + ll_src[4]; + llfirt = ll_src[2] + 1; +L111: + if (! (npix <= 0 || lllen <= 0)) { + goto L120; + } + ret_val = 0; + goto L100; +L120: + xe = xs + npix - 1; + skipwd = 0; + op = 1; + x1 = 1; + pv = 1; + i__1 = lllen; + for (ip = llfirt; ip <= i__1; ++ip) { + if (! skipwd) { + goto L140; + } + skipwd = 0; + goto L130; +L140: + opcode = ll_src[ip] / 4096; + data = ll_src[ip] & 4095; + sw0001 = opcode; + goto L150; +L160: + x2 = x1 + data - 1; + i1 = max(x1,xs); + i2 = min(x2,xe); + np = i2 - i1 + 1; + if (! (np > 0)) { + goto L170; + } + otop = op + np - 1; + if (! (opcode == 4)) { + goto L180; + } + i__2 = otop; + for (i__ = op; i__ <= i__2; ++i__) { + px_dst[i__] = pv; +/* L190: */ + } +/* L191: */ + goto L181; +L180: + i__2 = otop; + for (i__ = op; i__ <= i__2; ++i__) { + px_dst[i__] = 0; +/* L200: */ + } +/* L201: */ + if (! (opcode == 5 && i2 == x2)) { + goto L210; + } + px_dst[otop] = pv; +L210: +L181: + op = otop + 1; +L170: + x1 = x2 + 1; + goto L151; +L220: + pv = (ll_src[ip + 1] << 12) + data; + skipwd = 1; + goto L151; +L230: + pv += data; + goto L151; +L240: + pv -= data; + goto L151; +L250: + pv += data; + goto L91; +L260: + pv -= data; +L91: + if (! (x1 >= xs && x1 <= xe)) { + goto L270; + } + px_dst[op] = pv; + ++op; +L270: + ++x1; + goto L151; +L150: + ++sw0001; + if (sw0001 < 1 || sw0001 > 8) { + goto L151; + } + switch ((int)sw0001) { + case 1: goto L160; + case 2: goto L220; + case 3: goto L230; + case 4: goto L240; + case 5: goto L160; + case 6: goto L160; + case 7: goto L250; + case 8: goto L260; + } +L151: + if (! (x1 > xe)) { + goto L280; + } + goto L131; +L280: +L130: + ; + } +L131: + i__1 = npix; + for (i__ = op; i__ <= i__1; ++i__) { + px_dst[i__] = 0; +/* L290: */ + } +/* L291: */ + ret_val = npix; + goto L100; +L100: + return ret_val; +} /* pll2pi_ */ + diff --git a/testbed/astropy__astropy/cextern/cfitsio/zlib/zuncompress.c b/testbed/astropy__astropy/cextern/cfitsio/zlib/zuncompress.c new file mode 100644 index 0000000000000000000000000000000000000000..c73ee6deb0474b60f94f55cf2e9599b46db32b74 --- /dev/null +++ b/testbed/astropy__astropy/cextern/cfitsio/zlib/zuncompress.c @@ -0,0 +1,603 @@ +/* gzcompress.h -- definitions for the .Z decompression routine used in CFITSIO */ + +#include +#include +#include +#include + +#define get_char() get_byte() + +/* gzip.h -- common declarations for all gzip modules */ + +#define OF(args) args +typedef void *voidp; + +#define memzero(s, n) memset ((voidp)(s), 0, (n)) + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +/* private version of MIN function */ +#define MINZIP(a,b) ((a) <= (b) ? (a) : (b)) + +/* Return codes from gzip */ +#define OK 0 +#define ERROR 1 +#define COMPRESSED 1 +#define DEFLATED 8 +#define INBUFSIZ 0x8000 /* input buffer size */ +#define INBUF_EXTRA 64 /* required by unlzw() */ +#define OUTBUFSIZ 16384 /* output buffer size */ +#define OUTBUF_EXTRA 2048 /* required by unlzw() */ +#define DIST_BUFSIZE 0x8000 /* buffer for distances, see trees.c */ +#define WSIZE 0x8000 /* window size--must be a power of two, and */ +#define DECLARE(type, array, size) type array[size] +#define tab_suffix window +#define tab_prefix prev /* hash link (see deflate.c) */ +#define head (prev+WSIZE) /* hash head (see deflate.c) */ +#define LZW_MAGIC "\037\235" /* Magic header for lzw files, 1F 9D */ +#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)) + +/* Diagnostic functions */ +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) + +/* lzw.h -- define the lzw functions. */ + +#ifndef BITS +# define BITS 16 +#endif +#define INIT_BITS 9 /* Initial number of bits per code */ +#define BIT_MASK 0x1f /* Mask for 'number of compression bits' */ +#define BLOCK_MODE 0x80 +#define LZW_RESERVED 0x60 /* reserved bits */ +#define CLEAR 256 /* flush the dictionary */ +#define FIRST (CLEAR+1) /* first free entry */ + +/* prototypes */ + +#define local static +void ffpmsg(const char *err_message); + +local int fill_inbuf OF((int eof_ok)); +local void write_buf OF((voidp buf, unsigned cnt)); +local void error OF((char *m)); +local int unlzw OF((FILE *in, FILE *out)); + +typedef int file_t; /* Do not use stdio */ + +int (*work) OF((FILE *infile, FILE *outfile)) = unlzw; /* function to call */ + +local void error OF((char *m)); + + /* global buffers */ + +static DECLARE(uch, inbuf, INBUFSIZ +INBUF_EXTRA); +static DECLARE(uch, outbuf, OUTBUFSIZ+OUTBUF_EXTRA); +static DECLARE(ush, d_buf, DIST_BUFSIZE); +static DECLARE(uch, window, 2L*WSIZE); + +#ifndef MAXSEG_64K + static DECLARE(ush, tab_prefix, 1L< 0) + return(*status); + + /* save input parameters into global variables */ + ifname[0] = '\0'; + strncat(ifname, filename, 127); + ifd = indiskfile; + memptr = (void **) buffptr; + memsize = buffsize; + realloc_fn = mem_realloc; + + /* clear input and output buffers */ + + insize = inptr = 0; + bytes_in = bytes_out = 0L; + + magic[0] = (char)get_byte(); + magic[1] = (char)get_byte(); + + if (memcmp(magic, LZW_MAGIC, 2) != 0) { + error("ERROR: input .Z file is in unrecognized compression format.\n"); + return(-1); + } + + work = unlzw; + method = COMPRESSED; + last_member = 1; + + /* do the uncompression */ + if ((*work)(ifd, ofd) != OK) { + method = -1; /* force cleanup */ + *status = 414; /* report some sort of decompression error */ + } + + if (filesize) *filesize = bytes_out; + + return(*status); +} +/*=========================================================================*/ +/*=========================================================================*/ +/* this marks the begining of the original file 'unlzw.c' */ +/*=========================================================================*/ +/*=========================================================================*/ + +/* unlzw.c -- decompress files in LZW format. + * The code in this file is directly derived from the public domain 'compress' + * written by Spencer Thomas, Joe Orost, James Woods, Jim McKie, Steve Davies, + * Ken Turkowski, Dave Mack and Peter Jannesen. + */ + +typedef unsigned char char_type; +typedef long code_int; +typedef unsigned long count_int; +typedef unsigned short count_short; +typedef unsigned long cmp_code_int; + +#define MAXCODE(n) (1L << (n)) + +#ifndef REGISTERS +# define REGISTERS 2 +#endif +#define REG1 +#define REG2 +#define REG3 +#define REG4 +#define REG5 +#define REG6 +#define REG7 +#define REG8 +#define REG9 +#define REG10 +#define REG11 +#define REG12 +#define REG13 +#define REG14 +#define REG15 +#define REG16 +#if REGISTERS >= 1 +# undef REG1 +# define REG1 register +#endif +#if REGISTERS >= 2 +# undef REG2 +# define REG2 register +#endif +#if REGISTERS >= 3 +# undef REG3 +# define REG3 register +#endif +#if REGISTERS >= 4 +# undef REG4 +# define REG4 register +#endif +#if REGISTERS >= 5 +# undef REG5 +# define REG5 register +#endif +#if REGISTERS >= 6 +# undef REG6 +# define REG6 register +#endif +#if REGISTERS >= 7 +# undef REG7 +# define REG7 register +#endif +#if REGISTERS >= 8 +# undef REG8 +# define REG8 register +#endif +#if REGISTERS >= 9 +# undef REG9 +# define REG9 register +#endif +#if REGISTERS >= 10 +# undef REG10 +# define REG10 register +#endif +#if REGISTERS >= 11 +# undef REG11 +# define REG11 register +#endif +#if REGISTERS >= 12 +# undef REG12 +# define REG12 register +#endif +#if REGISTERS >= 13 +# undef REG13 +# define REG13 register +#endif +#if REGISTERS >= 14 +# undef REG14 +# define REG14 register +#endif +#if REGISTERS >= 15 +# undef REG15 +# define REG15 register +#endif +#if REGISTERS >= 16 +# undef REG16 +# define REG16 register +#endif + +#ifndef BYTEORDER +# define BYTEORDER 0000 +#endif + +#ifndef NOALLIGN +# define NOALLIGN 0 +#endif + + +union bytes { + long word; + struct { +#if BYTEORDER == 4321 + char_type b1; + char_type b2; + char_type b3; + char_type b4; +#else +#if BYTEORDER == 1234 + char_type b4; + char_type b3; + char_type b2; + char_type b1; +#else +# undef BYTEORDER + int dummy; +#endif +#endif + } bytes; +}; + +#if BYTEORDER == 4321 && NOALLIGN == 1 +# define input(b,o,c,n,m){ \ + (c) = (*(long *)(&(b)[(o)>>3])>>((o)&0x7))&(m); \ + (o) += (n); \ + } +#else +# define input(b,o,c,n,m){ \ + REG1 char_type *p = &(b)[(o)>>3]; \ + (c) = ((((long)(p[0]))|((long)(p[1])<<8)| \ + ((long)(p[2])<<16))>>((o)&0x7))&(m); \ + (o) += (n); \ + } +#endif + +#ifndef MAXSEG_64K + /* DECLARE(ush, tab_prefix, (1<>1] +# define clear_tab_prefixof() \ + memzero(tab_prefix0, 128), \ + memzero(tab_prefix1, 128); +#endif +#define de_stack ((char_type *)(&d_buf[DIST_BUFSIZE-1])) +#define tab_suffixof(i) tab_suffix[i] + +int block_mode = BLOCK_MODE; /* block compress mode -C compatible with 2.0 */ + +/* ============================================================================ + * Decompress in to out. This routine adapts to the codes in the + * file building the "string" table on-the-fly; requiring no table to + * be stored in the compressed file. + * IN assertions: the buffer inbuf contains already the beginning of + * the compressed data, from offsets iptr to insize-1 included. + * The magic header has already been checked and skipped. + * bytes_in and bytes_out have been initialized. + */ +local int unlzw(FILE *in, FILE *out) + /* input and output file descriptors */ +{ + REG2 char_type *stackp; + REG3 code_int code; + REG4 int finchar; + REG5 code_int oldcode; + REG6 code_int incode; + REG7 long inbits; + REG8 long posbits; + REG9 int outpos; +/* REG10 int insize; (global) */ + REG11 unsigned bitmask; + REG12 code_int free_ent; + REG13 code_int maxcode; + REG14 code_int maxmaxcode; + REG15 int n_bits; + REG16 int rsize; + + ofd = out; + +#ifdef MAXSEG_64K + tab_prefix[0] = tab_prefix0; + tab_prefix[1] = tab_prefix1; +#endif + maxbits = get_byte(); + block_mode = maxbits & BLOCK_MODE; + if ((maxbits & LZW_RESERVED) != 0) { + error( "warning, unknown flags in unlzw decompression"); + } + maxbits &= BIT_MASK; + maxmaxcode = MAXCODE(maxbits); + + if (maxbits > BITS) { + error("compressed with too many bits; cannot handle file"); + exit_code = ERROR; + return ERROR; + } + rsize = insize; + maxcode = MAXCODE(n_bits = INIT_BITS)-1; + bitmask = (1<= 0 ; --code) { + tab_suffixof(code) = (char_type)code; + } + do { + REG1 int i; + int e; + int o; + + resetbuf: + e = insize-(o = (posbits>>3)); + + for (i = 0 ; i < e ; ++i) { + inbuf[i] = inbuf[i+o]; + } + insize = e; + posbits = 0; + + if (insize < INBUF_EXTRA) { +/* modified to use fread instead of read - WDP 10/22/97 */ +/* if ((rsize = read(in, (char*)inbuf+insize, INBUFSIZ)) == EOF) { */ + + if ((rsize = fread((char*)inbuf+insize, 1, INBUFSIZ, in)) == EOF) { + error("unexpected end of file"); + exit_code = ERROR; + return ERROR; + } + insize += rsize; + bytes_in += (ulg)rsize; + } + inbits = ((rsize != 0) ? ((long)insize - insize%n_bits)<<3 : + ((long)insize<<3)-(n_bits-1)); + + while (inbits > posbits) { + if (free_ent > maxcode) { + posbits = ((posbits-1) + + ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3))); + ++n_bits; + if (n_bits == maxbits) { + maxcode = maxmaxcode; + } else { + maxcode = MAXCODE(n_bits)-1; + } + bitmask = (1<= 256) { + error("corrupt input."); + exit_code = ERROR; + return ERROR; + } + + outbuf[outpos++] = (char_type)(finchar = (int)(oldcode=code)); + continue; + } + if (code == CLEAR && block_mode) { + clear_tab_prefixof(); + free_ent = FIRST - 1; + posbits = ((posbits-1) + + ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3))); + maxcode = MAXCODE(n_bits = INIT_BITS)-1; + bitmask = (1<= free_ent) { /* Special case for KwKwK string. */ + if (code > free_ent) { + if (outpos > 0) { + write_buf((char*)outbuf, outpos); + bytes_out += (ulg)outpos; + } + error("corrupt input."); + exit_code = ERROR; + return ERROR; + + } + *--stackp = (char_type)finchar; + code = oldcode; + } + + while ((cmp_code_int)code >= (cmp_code_int)256) { + /* Generate output characters in reverse order */ + *--stackp = tab_suffixof(code); + code = tab_prefixof(code); + } + *--stackp = (char_type)(finchar = tab_suffixof(code)); + + /* And put them out in forward order */ + { + /* REG1 int i; already defined above (WDP) */ + + if (outpos+(i = (de_stack-stackp)) >= OUTBUFSIZ) { + do { + if (i > OUTBUFSIZ-outpos) i = OUTBUFSIZ-outpos; + + if (i > 0) { + memcpy(outbuf+outpos, stackp, i); + outpos += i; + } + if (outpos >= OUTBUFSIZ) { + write_buf((char*)outbuf, outpos); + bytes_out += (ulg)outpos; + outpos = 0; + } + stackp+= i; + } while ((i = (de_stack-stackp)) > 0); + } else { + memcpy(outbuf+outpos, stackp, i); + outpos += i; + } + } + + if ((code = free_ent) < maxmaxcode) { /* Generate the new entry. */ + + tab_prefixof(code) = (unsigned short)oldcode; + tab_suffixof(code) = (char_type)finchar; + free_ent = code+1; + } + oldcode = incode; /* Remember previous code. */ + } + } while (rsize != 0); + + if (outpos > 0) { + write_buf((char*)outbuf, outpos); + bytes_out += (ulg)outpos; + } + return OK; +} +/* ========================================================================*/ +/* this marks the start of the code from 'util.c' */ + +local int fill_inbuf(int eof_ok) + /* set if EOF acceptable as a result */ +{ + int len; + + /* Read as much as possible from file */ + insize = 0; + do { + len = fread((char*)inbuf+insize, 1, INBUFSIZ-insize, ifd); + if (len == 0 || len == EOF) break; + insize += len; + } while (insize < INBUFSIZ); + + if (insize == 0) { + if (eof_ok) return EOF; + error("unexpected end of file"); + exit_code = ERROR; + return ERROR; + } + + bytes_in += (ulg)insize; + inptr = 1; + return inbuf[0]; +} +/* =========================================================================== */ +local void write_buf(voidp buf, unsigned cnt) +/* copy buffer into memory; allocate more memory if required*/ +{ + if (!realloc_fn) + { + /* append buffer to file */ + /* added 'unsigned' to get rid of compiler warning (WDP 1/1/99) */ + if ((unsigned long) fwrite(buf, 1, cnt, ofd) != cnt) + { + error + ("failed to write buffer to uncompressed output file (write_buf)"); + exit_code = ERROR; + return; + } + } + else + { + /* get more memory if current buffer is too small */ + if (bytes_out + cnt > *memsize) + { + *memptr = realloc_fn(*memptr, bytes_out + cnt); + *memsize = bytes_out + cnt; /* new memory buffer size */ + + if (!(*memptr)) + { + error("malloc failed while uncompressing (write_buf)"); + exit_code = ERROR; + return; + } + } + /* copy into memory buffer */ + memcpy((char *) *memptr + bytes_out, (char *) buf, cnt); + } +} +/* ======================================================================== */ +local void error(char *m) +/* Error handler */ +{ + ffpmsg(ifname); + ffpmsg(m); +} diff --git a/testbed/astropy__astropy/cextern/erfa/README.rst b/testbed/astropy__astropy/cextern/erfa/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..de6fd9a14ecf194a8636b3225fb293ef678a32f4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/README.rst @@ -0,0 +1,105 @@ +This is the source code repository for ERFA (Essential Routines for +Fundamental Astronomy). ERFA is a C library containing key algorithms for +astronomy, and is based on the `SOFA library `_ published by the International +Astronomical Union (IAU). + +ERFA is intended to replicate the functionality of SOFA (aside from possible +bugfixes in ERFA that have not yet been included in SOFA), but is licensed +under a three-clause BSD license to enable its compatibility with a wide +range of open source licenses. Permission for this release has been +obtained from the SOFA board, and is avilable in the ``LICENSE`` file included +in this source distribution. + +Differences from SOFA +--------------------- + +This version of ERFA (v1.3.0) is based on SOFA version "20160503_a", with the +differences outlined below. + +ERFA branding +^^^^^^^^^^^^^ + +All references to "SOFA" in the source code have been changed to ERFA, and +functions have the prefix ``era`` instead of ``iau``. + +C macro prefixes +^^^^^^^^^^^^^^^^ + +All C macros used in ERFA are the same as their SOFA equivalents, but with an +``ERFA_`` prefix to prevent namespace collisions. + +Bugfixes +^^^^^^^^ + +ERFA includes smaller changes that may or may not eventually make it into SOFA, +addressing localized bugs or similar smaller issues: + +* ERFA 1.4.0 and SOFA "20170420" + + + ERFA 1.4.0 adds the ``eraVersion`` and ``eraSofaVersion`` functions to + determine the installed version of ERFA (and the SOFA version it is derived + from). + + + ERFA 1.4.0 includes some bug fixes contributed to ERFA after 1.3.0 but + before 1.4.0. These were incorporated (with modification) into + SOFA "20170420" (without attribution) and hence these are not differences + between ERFA and SOFA. (See https://github.com/liberfa/erfa/issues/40 and + https://github.com/liberfa/erfa/issues/41) + +* ERFA 1.3.0 and SOFA "20160503_a" + + + There are no differences between ERFA 1.3.0 and SOFA "20160503_a". + +* ERFA 1.2.0 and SOFA "20150209_a" + + + Typos have been corrected in the documentation of atco13 and atio13 (see https://github.com/liberfa/erfa/issues/29). + +Note that issues identified in ERFA should generally also be reported upstream to SOFA at sofa@ukho.gov.uk. + +Building and installing ERFA +---------------------------- + +To build and install a released version of ERFA in your OS's standard +location, simply do:: + + ./configure + make + make install + +If you want to run the tests to make sure ERFA built correctly, before +installing do:: + + make check + + +For developers +^^^^^^^^^^^^^^ + +If you are using a developer version from github, you will need to first do +``./bootstrap.sh`` before the above commands. This requires ``autoconf`` and +``libtool``. + +If you wish to build against the ERFA static library without installing, you +will find it in ``$ERFAROOT/src/.libs/liberfa.a`` after running ``make``. + +Creating a single-file version of the source code +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Alternatively, if you wish to bundle the ERFA source code with a separate +package, you can use the ``source_flattener.py`` script from the +`erfa-fetch repository`_ to combine +the ERFA source code into just two files: a ``erfa.c`` source file, and an +``erfa.h`` include file. You should run this script like this:: + + cd /path/to/erfa-source-code + python /path/to/erfa-fetch/source_flattener.py src -n erfa + +If possible, however, it is recommended that you provide an option to use any +copy of the ERFA library that is already installed on the system. + +Travis build status +------------------- +.. image:: https://travis-ci.org/liberfa/erfa.png + :target: https://travis-ci.org/liberfa/erfa + +.. _erfa-fetch repository: https://github.com/liberfa/erfa-fetch diff --git a/testbed/astropy__astropy/cextern/erfa/a2af.c b/testbed/astropy__astropy/cextern/erfa/a2af.c new file mode 100644 index 0000000000000000000000000000000000000000..47b5524a0d92edc90f40f41e7e85bdf2abc15338 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/a2af.c @@ -0,0 +1,129 @@ +#include "erfa.h" + +void eraA2af(int ndp, double angle, char *sign, int idmsf[4]) +/* +** - - - - - - - - +** e r a A 2 a f +** - - - - - - - - +** +** Decompose radians into degrees, arcminutes, arcseconds, fraction. +** +** Given: +** ndp int resolution (Note 1) +** angle double angle in radians +** +** Returned: +** sign char '+' or '-' +** idmsf int[4] degrees, arcminutes, arcseconds, fraction +** +** Called: +** eraD2tf decompose days to hms +** +** Notes: +** +** 1) The argument ndp is interpreted as follows: +** +** ndp resolution +** : ...0000 00 00 +** -7 1000 00 00 +** -6 100 00 00 +** -5 10 00 00 +** -4 1 00 00 +** -3 0 10 00 +** -2 0 01 00 +** -1 0 00 10 +** 0 0 00 01 +** 1 0 00 00.1 +** 2 0 00 00.01 +** 3 0 00 00.001 +** : 0 00 00.000... +** +** 2) The largest positive useful value for ndp is determined by the +** size of angle, the format of doubles on the target platform, and +** the risk of overflowing idmsf[3]. On a typical platform, for +** angle up to 2pi, the available floating-point precision might +** correspond to ndp=12. However, the practical limit is typically +** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is +** only 16 bits. +** +** 3) The absolute value of angle may exceed 2pi. In cases where it +** does not, it is up to the caller to test for and handle the +** case where angle is very nearly 2pi and rounds up to 360 degrees, +** by testing for idmsf[0]=360 and setting idmsf[0-3] to zero. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Hours to degrees * radians to turns */ + const double F = 15.0 / ERFA_D2PI; + + +/* Scale then use days to h,m,s function. */ + eraD2tf(ndp, angle*F, sign, idmsf); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/a2tf.c b/testbed/astropy__astropy/cextern/erfa/a2tf.c new file mode 100644 index 0000000000000000000000000000000000000000..19670ad948b8a8517e37d7fd79830c5aa6aed0e3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/a2tf.c @@ -0,0 +1,125 @@ +#include "erfa.h" + +void eraA2tf(int ndp, double angle, char *sign, int ihmsf[4]) +/* +** - - - - - - - - +** e r a A 2 t f +** - - - - - - - - +** +** Decompose radians into hours, minutes, seconds, fraction. +** +** Given: +** ndp int resolution (Note 1) +** angle double angle in radians +** +** Returned: +** sign char '+' or '-' +** ihmsf int[4] hours, minutes, seconds, fraction +** +** Called: +** eraD2tf decompose days to hms +** +** Notes: +** +** 1) The argument ndp is interpreted as follows: +** +** ndp resolution +** : ...0000 00 00 +** -7 1000 00 00 +** -6 100 00 00 +** -5 10 00 00 +** -4 1 00 00 +** -3 0 10 00 +** -2 0 01 00 +** -1 0 00 10 +** 0 0 00 01 +** 1 0 00 00.1 +** 2 0 00 00.01 +** 3 0 00 00.001 +** : 0 00 00.000... +** +** 2) The largest positive useful value for ndp is determined by the +** size of angle, the format of doubles on the target platform, and +** the risk of overflowing ihmsf[3]. On a typical platform, for +** angle up to 2pi, the available floating-point precision might +** correspond to ndp=12. However, the practical limit is typically +** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is +** only 16 bits. +** +** 3) The absolute value of angle may exceed 2pi. In cases where it +** does not, it is up to the caller to test for and handle the +** case where angle is very nearly 2pi and rounds up to 24 hours, +** by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Scale then use days to h,m,s function. */ + eraD2tf(ndp, angle/ERFA_D2PI, sign, ihmsf); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ab.c b/testbed/astropy__astropy/cextern/erfa/ab.c new file mode 100644 index 0000000000000000000000000000000000000000..c9b12c23edaf4763b331944e46041f3783ee2303 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ab.c @@ -0,0 +1,137 @@ +#include "erfa.h" + +void eraAb(double pnat[3], double v[3], double s, double bm1, + double ppr[3]) +/* +** - - - - - - +** e r a A b +** - - - - - - +** +** Apply aberration to transform natural direction into proper +** direction. +** +** Given: +** pnat double[3] natural direction to the source (unit vector) +** v double[3] observer barycentric velocity in units of c +** s double distance between the Sun and the observer (au) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** +** Returned: +** ppr double[3] proper direction to source (unit vector) +** +** Notes: +** +** 1) The algorithm is based on Expr. (7.40) in the Explanatory +** Supplement (Urban & Seidelmann 2013), but with the following +** changes: +** +** o Rigorous rather than approximate normalization is applied. +** +** o The gravitational potential term from Expr. (7) in +** Klioner (2003) is added, taking into account only the Sun's +** contribution. This has a maximum effect of about +** 0.4 microarcsecond. +** +** 2) In almost all cases, the maximum accuracy will be limited by the +** supplied velocity. For example, if the ERFA eraEpv00 function is +** used, errors of up to 5 microarcseconds could occur. +** +** References: +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013). +** +** Klioner, Sergei A., "A practical relativistic model for micro- +** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). +** +** Called: +** eraPdp scalar product of two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double pdv, w1, w2, r2, w, p[3], r; + + + pdv = eraPdp(pnat, v); + w1 = 1.0 + pdv/(1.0 + bm1); + w2 = ERFA_SRS/s; + r2 = 0.0; + for (i = 0; i < 3; i++) { + w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]); + p[i] = w; + r2 = r2 + w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + ppr[i] = p[i]/r; + } + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/af2a.c b/testbed/astropy__astropy/cextern/erfa/af2a.c new file mode 100644 index 0000000000000000000000000000000000000000..22d3902e2dd7cf65bc51534a9ebcea3dbd256056 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/af2a.c @@ -0,0 +1,116 @@ +#include "erfa.h" +#include + +int eraAf2a(char s, int ideg, int iamin, double asec, double *rad) +/* +** - - - - - - - - +** e r a A f 2 a +** - - - - - - - - +** +** Convert degrees, arcminutes, arcseconds to radians. +** +** Given: +** s char sign: '-' = negative, otherwise positive +** ideg int degrees +** iamin int arcminutes +** asec double arcseconds +** +** Returned: +** rad double angle in radians +** +** Returned (function value): +** int status: 0 = OK +** 1 = ideg outside range 0-359 +** 2 = iamin outside range 0-59 +** 3 = asec outside range 0-59.999... +** +** Notes: +** +** 1) The result is computed even if any of the range checks fail. +** +** 2) Negative ideg, iamin and/or asec produce a warning status, but +** the absolute value is used in the conversion. +** +** 3) If there are multiple errors, the status value reflects only the +** first, the smallest taking precedence. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Compute the interval. */ + *rad = ( s == '-' ? -1.0 : 1.0 ) * + ( 60.0 * ( 60.0 * ( (double) abs(ideg) ) + + ( (double) abs(iamin) ) ) + + fabs(asec) ) * ERFA_DAS2R; + +/* Validate arguments and return status. */ + if ( ideg < 0 || ideg > 359 ) return 1; + if ( iamin < 0 || iamin > 59 ) return 2; + if ( asec < 0.0 || asec >= 60.0 ) return 3; + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/anp.c b/testbed/astropy__astropy/cextern/erfa/anp.c new file mode 100644 index 0000000000000000000000000000000000000000..4b4663779b116aca46bc5c22ab4ef37183f58949 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/anp.c @@ -0,0 +1,91 @@ +#include "erfa.h" + +double eraAnp(double a) +/* +** - - - - - - - +** e r a A n p +** - - - - - - - +** +** Normalize angle into the range 0 <= a < 2pi. +** +** Given: +** a double angle (radians) +** +** Returned (function value): +** double angle in range 0-2pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double w; + + + w = fmod(a, ERFA_D2PI); + if (w < 0) w += ERFA_D2PI; + + return w; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/anpm.c b/testbed/astropy__astropy/cextern/erfa/anpm.c new file mode 100644 index 0000000000000000000000000000000000000000..e092c3950307e1194340d210dbb86db3b6e87d33 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/anpm.c @@ -0,0 +1,91 @@ +#include "erfa.h" + +double eraAnpm(double a) +/* +** - - - - - - - - +** e r a A n p m +** - - - - - - - - +** +** Normalize angle into the range -pi <= a < +pi. +** +** Given: +** a double angle (radians) +** +** Returned (function value): +** double angle in range +/-pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double w; + + + w = fmod(a, ERFA_D2PI); + if (fabs(w) >= ERFA_DPI) w -= ERFA_DSIGN(ERFA_D2PI, a); + + return w; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apcg.c b/testbed/astropy__astropy/cextern/erfa/apcg.c new file mode 100644 index 0000000000000000000000000000000000000000..59b18168d6a88a6832f6c36b0ce8d749773f119c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apcg.c @@ -0,0 +1,181 @@ +#include "erfa.h" + +void eraApcg(double date1, double date2, + double ebpv[2][3], double ehp[3], + eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p c g +** - - - - - - - - +** +** For a geocentric observer, prepare star-independent astrometry +** parameters for transformations between ICRS and GCRS coordinates. +** The Earth ephemeris is supplied by the caller. +** +** The parameters produced by this function are required in the +** parallax, light deflection and aberration parts of the astrometric +** transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** ebpv double[2][3] Earth barycentric pos/vel (au, au/day) +** ehp double[3] Earth heliocentric position (au) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 4) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraApcs astrometry parameters, ICRS-GCRS, space observer +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Geocentric observer */ + double pv[2][3] = { { 0.0, 0.0, 0.0 }, + { 0.0, 0.0, 0.0 } }; + + +/* Compute the star-independent astrometry parameters. */ + eraApcs(date1, date2, pv, ebpv, ehp, astrom); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apcg13.c b/testbed/astropy__astropy/cextern/erfa/apcg13.c new file mode 100644 index 0000000000000000000000000000000000000000..ea0d481d9486f2de3852b0e563ec0f2a7eb64ca4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apcg13.c @@ -0,0 +1,184 @@ +#include "erfa.h" + +void eraApcg13(double date1, double date2, eraASTROM *astrom) +/* +** - - - - - - - - - - +** e r a A p c g 1 3 +** - - - - - - - - - - +** +** For a geocentric observer, prepare star-independent astrometry +** parameters for transformations between ICRS and GCRS coordinates. +** The caller supplies the date, and ERFA models are used to predict +** the Earth ephemeris. +** +** The parameters produced by this function are required in the +** parallax, light deflection and aberration parts of the astrometric +** transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) In cases where the caller wishes to supply his own Earth +** ephemeris, the function eraApcg can be used instead of the present +** function. +** +** 4) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 5) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraEpv00 Earth position and velocity +** eraApcg astrometry parameters, ICRS-GCRS, geocenter +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ehpv[2][3], ebpv[2][3]; + + +/* Earth barycentric & heliocentric position/velocity (au, au/d). */ + (void) eraEpv00(date1, date2, ehpv, ebpv); + +/* Compute the star-independent astrometry parameters. */ + eraApcg(date1, date2, ebpv, ehpv[0], astrom); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apci.c b/testbed/astropy__astropy/cextern/erfa/apci.c new file mode 100644 index 0000000000000000000000000000000000000000..ddc5438d50c4580ba6d45723322203ab77d8b191 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apci.c @@ -0,0 +1,190 @@ +#include "erfa.h" + +void eraApci(double date1, double date2, + double ebpv[2][3], double ehp[3], + double x, double y, double s, + eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p c i +** - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between ICRS and geocentric CIRS +** coordinates. The Earth ephemeris and CIP/CIO are supplied by the +** caller. +** +** The parameters produced by this function are required in the +** parallax, light deflection, aberration, and bias-precession-nutation +** parts of the astrometric transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** ebpv double[2][3] Earth barycentric position/velocity (au, au/day) +** ehp double[3] Earth heliocentric position (au) +** x,y double CIP X,Y (components of unit vector) +** s double the CIO locator s (radians) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) In cases where the caller does not wish to provide the Earth +** ephemeris and CIP/CIO, the function eraApci13 can be used instead +** of the present function. This computes the required quantities +** using other ERFA functions. +** +** 4) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 5) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraApcg astrometry parameters, ICRS-GCRS, geocenter +** eraC2ixys celestial-to-intermediate matrix, given X,Y and s +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Star-independent astrometry parameters for geocenter. */ + eraApcg(date1, date2, ebpv, ehp, astrom); + +/* CIO based BPN matrix. */ + eraC2ixys(x, y, s, astrom->bpn); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apci13.c b/testbed/astropy__astropy/cextern/erfa/apci13.c new file mode 100644 index 0000000000000000000000000000000000000000..ca33729c0c45ed82ad671d03a2137a33110be34f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apci13.c @@ -0,0 +1,202 @@ +#include "erfa.h" + +void eraApci13(double date1, double date2, + eraASTROM *astrom, double *eo) +/* +** - - - - - - - - - - +** e r a A p c i 1 3 +** - - - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between ICRS and geocentric CIRS +** coordinates. The caller supplies the date, and ERFA models are used +** to predict the Earth ephemeris and CIP/CIO. +** +** The parameters produced by this function are required in the +** parallax, light deflection, aberration, and bias-precession-nutation +** parts of the astrometric transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** eo double* equation of the origins (ERA-GST) +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) In cases where the caller wishes to supply his own Earth +** ephemeris and CIP/CIO, the function eraApci can be used instead +** of the present function. +** +** 4) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 5) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraEpv00 Earth position and velocity +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** eraApci astrometry parameters, ICRS-CIRS +** eraEors equation of the origins, given NPB matrix and s +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ehpv[2][3], ebpv[2][3], r[3][3], x, y, s; + + +/* Earth barycentric & heliocentric position/velocity (au, au/d). */ + (void) eraEpv00(date1, date2, ehpv, ebpv); + +/* Form the equinox based BPN matrix, IAU 2006/2000A. */ + eraPnm06a(date1, date2, r); + +/* Extract CIP X,Y. */ + eraBpn2xy(r, &x, &y); + +/* Obtain CIO locator s. */ + s = eraS06(date1, date2, x, y); + +/* Compute the star-independent astrometry parameters. */ + eraApci(date1, date2, ebpv, ehpv[0], x, y, s, astrom); + +/* Equation of the origins. */ + *eo = eraEors(r, s); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apco.c b/testbed/astropy__astropy/cextern/erfa/apco.c new file mode 100644 index 0000000000000000000000000000000000000000..54917ac1de963a4f7b027477638d3c07f5468561 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apco.c @@ -0,0 +1,264 @@ +#include "erfa.h" + +void eraApco(double date1, double date2, + double ebpv[2][3], double ehp[3], + double x, double y, double s, double theta, + double elong, double phi, double hm, + double xp, double yp, double sp, + double refa, double refb, + eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p c o +** - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between ICRS and observed +** coordinates. The caller supplies the Earth ephemeris, the Earth +** rotation information and the refraction constants as well as the +** site coordinates. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** ebpv double[2][3] Earth barycentric PV (au, au/day, Note 2) +** ehp double[3] Earth heliocentric P (au, Note 2) +** x,y double CIP X,Y (components of unit vector) +** s double the CIO locator s (radians) +** theta double Earth rotation angle (radians) +** elong double longitude (radians, east +ve, Note 3) +** phi double latitude (geodetic, radians, Note 3) +** hm double height above ellipsoid (m, geodetic, Note 3) +** xp,yp double polar motion coordinates (radians, Note 4) +** sp double the TIO locator s' (radians, Note 4) +** refa double refraction constant A (radians, Note 5) +** refb double refraction constant B (radians, Note 5) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) The vectors eb, eh, and all the astrom vectors, are with respect +** to BCRS axes. +** +** 3) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN +** CONVENTION: the longitude required by the present function is +** right-handed, i.e. east-positive, in accordance with geographical +** convention. +** +** 4) xp and yp are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions), measured along the +** meridians 0 and 90 deg west respectively. sp is the TIO locator +** s', in radians, which positions the Terrestrial Intermediate +** Origin on the equator. For many applications, xp, yp and +** (especially) sp can be set to zero. +** +** Internally, the polar motion is stored in a form rotated onto the +** local meridian. +** +** 5) The refraction constants refa and refb are for use in a +** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed +** (i.e. refracted) zenith distance and dZ is the amount of +** refraction. +** +** 6) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** 7) In cases where the caller does not wish to provide the Earth +** Ephemeris, the Earth rotation information and refraction +** constants, the function eraApco13 can be used instead of the +** present function. This starts from UTC and weather readings etc. +** and computes suitable values using other ERFA functions. +** +** 8) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 9) The context structure astrom produced by this function is used by +** eraAtioq, eraAtoiq, eraAtciq* and eraAticq*. +** +** Called: +** eraAper astrometry parameters: update ERA +** eraC2ixys celestial-to-intermediate matrix, given X,Y and s +** eraPvtob position/velocity of terrestrial station +** eraTrxpv product of transpose of r-matrix and pv-vector +** eraApcs astrometry parameters, ICRS-GCRS, space observer +** eraCr copy r-matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double sl, cl, r[3][3], pvc[2][3], pv[2][3]; + + +/* Longitude with adjustment for TIO locator s'. */ + astrom->along = elong + sp; + +/* Polar motion, rotated onto the local meridian. */ + sl = sin(astrom->along); + cl = cos(astrom->along); + astrom->xpl = xp*cl - yp*sl; + astrom->ypl = xp*sl + yp*cl; + +/* Functions of latitude. */ + astrom->sphi = sin(phi); + astrom->cphi = cos(phi); + +/* Refraction constants. */ + astrom->refa = refa; + astrom->refb = refb; + +/* Local Earth rotation angle. */ + eraAper(theta, astrom); + +/* Disable the (redundant) diurnal aberration step. */ + astrom->diurab = 0.0; + +/* CIO based BPN matrix. */ + eraC2ixys(x, y, s, r); + +/* Observer's geocentric position and velocity (m, m/s, CIRS). */ + eraPvtob(elong, phi, hm, xp, yp, sp, theta, pvc); + +/* Rotate into GCRS. */ + eraTrxpv(r, pvc, pv); + +/* ICRS <-> GCRS parameters. */ + eraApcs(date1, date2, pv, ebpv, ehp, astrom); + +/* Store the CIO based BPN matrix. */ + eraCr(r, astrom->bpn ); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apco13.c b/testbed/astropy__astropy/cextern/erfa/apco13.c new file mode 100644 index 0000000000000000000000000000000000000000..f77191a68805bbf1c742e507e56214513fea7d8c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apco13.c @@ -0,0 +1,287 @@ +#include "erfa.h" + +int eraApco13(double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + eraASTROM *astrom, double *eo) +/* +** - - - - - - - - - - +** e r a A p c o 1 3 +** - - - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between ICRS and observed +** coordinates. The caller supplies UTC, site coordinates, ambient air +** conditions and observing wavelength, and ERFA models are used to +** obtain the Earth ephemeris, CIP/CIO and refraction constants. +** +** The parameters produced by this function are required in the +** parallax, light deflection, aberration, and bias-precession-nutation +** parts of the ICRS/CIRS transformations. +** +** Given: +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 1,2) +** dut1 double UT1-UTC (seconds, Note 3) +** elong double longitude (radians, east +ve, Note 4) +** phi double latitude (geodetic, radians, Note 4) +** hm double height above ellipsoid (m, geodetic, Notes 4,6) +** xp,yp double polar motion coordinates (radians, Note 5) +** phpa double pressure at the observer (hPa = mB, Note 6) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 7) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** eo double* equation of the origins (ERA-GST) +** +** Returned (function value): +** int status: +1 = dubious year (Note 2) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 2) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the +** future to be trusted. See eraDat for further details. +** +** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 4) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 5) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many +** applications, xp and yp can be set to zero. +** +** Internally, the polar motion is stored in a form rotated onto +** the local meridian. +** +** 6) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), is +** available, an adequate estimate of hm can be obtained from the +** expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to +** the pressure and that an accurate phpa value is important for +** precise work. +** +** 7) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 8) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** 9) In cases where the caller wishes to supply his own Earth +** ephemeris, Earth rotation information and refraction constants, +** the function eraApco can be used instead of the present function. +** +** 10) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 11) The context structure astrom produced by this function is used +** by eraAtioq, eraAtoiq, eraAtciq* and eraAticq*. +** +** Called: +** eraUtctai UTC to TAI +** eraTaitt TAI to TT +** eraUtcut1 UTC to UT1 +** eraEpv00 Earth position and velocity +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** eraEra00 Earth rotation angle, IAU 2000 +** eraSp00 the TIO locator s', IERS 2000 +** eraRefco refraction constants for given ambient conditions +** eraApco astrometry parameters, ICRS-observed +** eraEors equation of the origins, given NPB matrix and s +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + double tai1, tai2, tt1, tt2, ut11, ut12, ehpv[2][3], ebpv[2][3], + r[3][3], x, y, s, theta, sp, refa, refb; + + +/* UTC to other time scales. */ + j = eraUtctai(utc1, utc2, &tai1, &tai2); + if ( j < 0 ) return -1; + j = eraTaitt(tai1, tai2, &tt1, &tt2); + j = eraUtcut1(utc1, utc2, dut1, &ut11, &ut12); + if ( j < 0 ) return -1; + +/* Earth barycentric & heliocentric position/velocity (au, au/d). */ + (void) eraEpv00(tt1, tt2, ehpv, ebpv); + +/* Form the equinox based BPN matrix, IAU 2006/2000A. */ + eraPnm06a(tt1, tt2, r); + +/* Extract CIP X,Y. */ + eraBpn2xy(r, &x, &y); + +/* Obtain CIO locator s. */ + s = eraS06(tt1, tt2, x, y); + +/* Earth rotation angle. */ + theta = eraEra00(ut11, ut12); + +/* TIO locator s'. */ + sp = eraSp00(tt1, tt2); + +/* Refraction constants A and B. */ + eraRefco(phpa, tc, rh, wl, &refa, &refb); + +/* Compute the star-independent astrometry parameters. */ + eraApco(tt1, tt2, ebpv, ehpv[0], x, y, s, theta, + elong, phi, hm, xp, yp, sp, refa, refb, astrom); + +/* Equation of the origins. */ + *eo = eraEors(r, s); + +/* Return any warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apcs.c b/testbed/astropy__astropy/cextern/erfa/apcs.c new file mode 100644 index 0000000000000000000000000000000000000000..2e155d249a106f331a11dc039f92edf72bf1646f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apcs.c @@ -0,0 +1,233 @@ +#include "erfa.h" + +void eraApcs(double date1, double date2, double pv[2][3], + double ebpv[2][3], double ehp[3], + eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p c s +** - - - - - - - - +** +** For an observer whose geocentric position and velocity are known, +** prepare star-independent astrometry parameters for transformations +** between ICRS and GCRS. The Earth ephemeris is supplied by the +** caller. +** +** The parameters produced by this function are required in the space +** motion, parallax, light deflection and aberration parts of the +** astrometric transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** pv double[2][3] observer's geocentric pos/vel (m, m/s) +** ebpv double[2][3] Earth barycentric PV (au, au/day) +** ehp double[3] Earth heliocentric P (au) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) Providing separate arguments for (i) the observer's geocentric +** position and velocity and (ii) the Earth ephemeris is done for +** convenience in the geocentric, terrestrial and Earth orbit cases. +** For deep space applications it maybe more convenient to specify +** zero geocentric position and velocity and to supply the +** observer's position and velocity information directly instead of +** with respect to the Earth. However, note the different units: +** m and m/s for the geocentric vectors, au and au/day for the +** heliocentric and barycentric vectors. +** +** 4) In cases where the caller does not wish to provide the Earth +** ephemeris, the function eraApcs13 can be used instead of the +** present function. This computes the Earth ephemeris using the +** ERFA function eraEpv00. +** +** 5) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 6) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraCp copy p-vector +** eraPm modulus of p-vector +** eraPn decompose p-vector into modulus and direction +** eraIr initialize r-matrix to identity +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* au/d to m/s */ + const double AUDMS = ERFA_DAU/ERFA_DAYSEC; + +/* Light time for 1 au (day) */ + const double CR = ERFA_AULT/ERFA_DAYSEC; + + int i; + double dp, dv, pb[3], vb[3], ph[3], v2, w; + + +/* Time since reference epoch, years (for proper motion calculation). */ + astrom->pmt = ( (date1 - ERFA_DJ00) + date2 ) / ERFA_DJY; + +/* Adjust Earth ephemeris to observer. */ + for (i = 0; i < 3; i++) { + dp = pv[0][i] / ERFA_DAU; + dv = pv[1][i] / AUDMS; + pb[i] = ebpv[0][i] + dp; + vb[i] = ebpv[1][i] + dv; + ph[i] = ehp[i] + dp; + } + +/* Barycentric position of observer (au). */ + eraCp(pb, astrom->eb); + +/* Heliocentric direction and distance (unit vector and au). */ + eraPn(ph, &astrom->em, astrom->eh); + +/* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */ + v2 = 0.0; + for (i = 0; i < 3; i++) { + w = vb[i] * CR; + astrom->v[i] = w; + v2 += w*w; + } + astrom->bm1 = sqrt(1.0 - v2); + +/* Reset the NPB matrix. */ + eraIr(astrom->bpn); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apcs13.c b/testbed/astropy__astropy/cextern/erfa/apcs13.c new file mode 100644 index 0000000000000000000000000000000000000000..c19d5d682d255aae6d0f1dcba202f7339616859e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apcs13.c @@ -0,0 +1,191 @@ +#include "erfa.h" + +void eraApcs13(double date1, double date2, double pv[2][3], + eraASTROM *astrom) +/* +** - - - - - - - - - - +** e r a A p c s 1 3 +** - - - - - - - - - - +** +** For an observer whose geocentric position and velocity are known, +** prepare star-independent astrometry parameters for transformations +** between ICRS and GCRS. The Earth ephemeris is from ERFA models. +** +** The parameters produced by this function are required in the space +** motion, parallax, light deflection and aberration parts of the +** astrometric transformation chain. +** +** Given: +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** pv double[2][3] observer's geocentric pos/vel (Note 3) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double unchanged +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) All the vectors are with respect to BCRS axes. +** +** 3) The observer's position and velocity pv are geocentric but with +** respect to BCRS axes, and in units of m and m/s. No assumptions +** are made about proximity to the Earth, and the function can be +** used for deep space applications as well as Earth orbit and +** terrestrial. +** +** 4) In cases where the caller wishes to supply his own Earth +** ephemeris, the function eraApcs can be used instead of the present +** function. +** +** 5) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 6) The context structure astrom produced by this function is used by +** eraAtciq* and eraAticq*. +** +** Called: +** eraEpv00 Earth position and velocity +** eraApcs astrometry parameters, ICRS-GCRS, space observer +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ehpv[2][3], ebpv[2][3]; + + +/* Earth barycentric & heliocentric position/velocity (au, au/d). */ + (void) eraEpv00(date1, date2, ehpv, ebpv); + +/* Compute the star-independent astrometry parameters. */ + eraApcs(date1, date2, pv, ebpv, ehpv[0], astrom); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/aper.c b/testbed/astropy__astropy/cextern/erfa/aper.c new file mode 100644 index 0000000000000000000000000000000000000000..dc077791cb723879bf47a791a07372cfd496e054 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/aper.c @@ -0,0 +1,162 @@ +#include "erfa.h" + +void eraAper(double theta, eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p e r +** - - - - - - - - +** +** In the star-independent astrometry parameters, update only the +** Earth rotation angle, supplied by the caller explicitly. +** +** Given: +** theta double Earth rotation angle (radians, Note 2) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double not used +** eb double[3] not used +** eh double[3] not used +** em double not used +** v double[3] not used +** bm1 double not used +** bpn double[3][3] not used +** along double longitude + s' (radians) +** xpl double not used +** ypl double not used +** sphi double not used +** cphi double not used +** diurab double not used +** eral double not used +** refa double not used +** refb double not used +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double unchanged +** eb double[3] unchanged +** eh double[3] unchanged +** em double unchanged +** v double[3] unchanged +** bm1 double unchanged +** bpn double[3][3] unchanged +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double "local" Earth rotation angle (radians) +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) This function exists to enable sidereal-tracking applications to +** avoid wasteful recomputation of the bulk of the astrometry +** parameters: only the Earth rotation is updated. +** +** 2) For targets expressed as equinox based positions, such as +** classical geocentric apparent (RA,Dec), the supplied theta can be +** Greenwich apparent sidereal time rather than Earth rotation +** angle. +** +** 3) The function eraAper13 can be used instead of the present +** function, and starts from UT1 rather than ERA itself. +** +** 4) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + astrom->eral = theta + astrom->along; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/aper13.c b/testbed/astropy__astropy/cextern/erfa/aper13.c new file mode 100644 index 0000000000000000000000000000000000000000..454d6ff064d6bb75e39b0081069a80e87856d1db --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/aper13.c @@ -0,0 +1,181 @@ +#include "erfa.h" + +void eraAper13(double ut11, double ut12, eraASTROM *astrom) +/* +** - - - - - - - - - - +** e r a A p e r 1 3 +** - - - - - - - - - - +** +** In the star-independent astrometry parameters, update only the +** Earth rotation angle. The caller provides UT1, (n.b. not UTC). +** +** Given: +** ut11 double UT1 as a 2-part... +** ut12 double ...Julian Date (Note 1) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double not used +** eb double[3] not used +** eh double[3] not used +** em double not used +** v double[3] not used +** bm1 double not used +** bpn double[3][3] not used +** along double longitude + s' (radians) +** xpl double not used +** ypl double not used +** sphi double not used +** cphi double not used +** diurab double not used +** eral double not used +** refa double not used +** refb double not used +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double unchanged +** eb double[3] unchanged +** eh double[3] unchanged +** em double unchanged +** v double[3] unchanged +** bm1 double unchanged +** bpn double[3][3] unchanged +** along double unchanged +** xpl double unchanged +** ypl double unchanged +** sphi double unchanged +** cphi double unchanged +** diurab double unchanged +** eral double "local" Earth rotation angle (radians) +** refa double unchanged +** refb double unchanged +** +** Notes: +** +** 1) The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date, +** apportioned in any convenient way between the arguments ut11 and +** ut12. For example, JD(UT1)=2450123.7 could be expressed in any +** of these ways, among others: +** +** ut11 ut12 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. The date & time method is +** best matched to the algorithm used: maximum precision is +** delivered when the ut11 argument is for 0hrs UT1 on the day in +** question and the ut12 argument lies in the range 0 to 1, or vice +** versa. +** +** 2) If the caller wishes to provide the Earth rotation angle itself, +** the function eraAper can be used instead. One use of this +** technique is to substitute Greenwich apparent sidereal time and +** thereby to support equinox based transformations directly. +** +** 3) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** Called: +** eraAper astrometry parameters: update ERA +** eraEra00 Earth rotation angle, IAU 2000 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraAper(eraEra00(ut11,ut12), astrom); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apio.c b/testbed/astropy__astropy/cextern/erfa/apio.c new file mode 100644 index 0000000000000000000000000000000000000000..cec85370dd336c92c45ef17bc66ff07ec2b51d8d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apio.c @@ -0,0 +1,213 @@ +#include "erfa.h" + +void eraApio(double sp, double theta, + double elong, double phi, double hm, double xp, double yp, + double refa, double refb, + eraASTROM *astrom) +/* +** - - - - - - - - +** e r a A p i o +** - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between CIRS and observed +** coordinates. The caller supplies the Earth orientation information +** and the refraction constants as well as the site coordinates. +** +** Given: +** sp double the TIO locator s' (radians, Note 1) +** theta double Earth rotation angle (radians) +** elong double longitude (radians, east +ve, Note 2) +** phi double geodetic latitude (radians, Note 2) +** hm double height above ellipsoid (m, geodetic Note 2) +** xp,yp double polar motion coordinates (radians, Note 3) +** refa double refraction constant A (radians, Note 4) +** refb double refraction constant B (radians, Note 4) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double unchanged +** eb double[3] unchanged +** eh double[3] unchanged +** em double unchanged +** v double[3] unchanged +** bm1 double unchanged +** bpn double[3][3] unchanged +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Notes: +** +** 1) sp, the TIO locator s', is a tiny quantity needed only by the +** most precise applications. It can either be set to zero or +** predicted using the ERFA function eraSp00. +** +** 2) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 3) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many applications, +** xp and yp can be set to zero. +** +** Internally, the polar motion is stored in a form rotated onto the +** local meridian. +** +** 4) The refraction constants refa and refb are for use in a +** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed +** (i.e. refracted) zenith distance and dZ is the amount of +** refraction. +** +** 5) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** 6) In cases where the caller does not wish to provide the Earth +** rotation information and refraction constants, the function +** eraApio13 can be used instead of the present function. This +** starts from UTC and weather readings etc. and computes suitable +** values using other ERFA functions. +** +** 7) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 8) The context structure astrom produced by this function is used by +** eraAtioq and eraAtoiq. +** +** Called: +** eraPvtob position/velocity of terrestrial station +** eraAper astrometry parameters: update ERA +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double sl, cl, pv[2][3]; + + +/* Longitude with adjustment for TIO locator s'. */ + astrom->along = elong + sp; + +/* Polar motion, rotated onto the local meridian. */ + sl = sin(astrom->along); + cl = cos(astrom->along); + astrom->xpl = xp*cl - yp*sl; + astrom->ypl = xp*sl + yp*cl; + +/* Functions of latitude. */ + astrom->sphi = sin(phi); + astrom->cphi = cos(phi); + +/* Observer's geocentric position and velocity (m, m/s, CIRS). */ + eraPvtob(elong, phi, hm, xp, yp, sp, theta, pv); + +/* Magnitude of diurnal aberration vector. */ + astrom->diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / ERFA_CMPS; + +/* Refraction constants. */ + astrom->refa = refa; + astrom->refb = refb; + +/* Local Earth rotation angle. */ + eraAper(theta, astrom); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/apio13.c b/testbed/astropy__astropy/cextern/erfa/apio13.c new file mode 100644 index 0000000000000000000000000000000000000000..f29bd5364fd160ec4df0ee576be19c66b33e739e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/apio13.c @@ -0,0 +1,259 @@ +#include "erfa.h" + +int eraApio13(double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + eraASTROM *astrom) +/* +** - - - - - - - - - - +** e r a A p i o 1 3 +** - - - - - - - - - - +** +** For a terrestrial observer, prepare star-independent astrometry +** parameters for transformations between CIRS and observed +** coordinates. The caller supplies UTC, site coordinates, ambient air +** conditions and observing wavelength. +** +** Given: +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 1,2) +** dut1 double UT1-UTC (seconds) +** elong double longitude (radians, east +ve, Note 3) +** phi double geodetic latitude (radians, Note 3) +** hm double height above ellipsoid (m, geodetic Notes 4,6) +** xp,yp double polar motion coordinates (radians, Note 5) +** phpa double pressure at the observer (hPa = mB, Note 6) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 7) +** +** Returned: +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double unchanged +** eb double[3] unchanged +** eh double[3] unchanged +** em double unchanged +** v double[3] unchanged +** bm1 double unchanged +** bpn double[3][3] unchanged +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned (function value): +** int status: +1 = dubious year (Note 2) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 2) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 4) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 5) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many applications, +** xp and yp can be set to zero. +** +** Internally, the polar motion is stored in a form rotated onto +** the local meridian. +** +** 6) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), is +** available, an adequate estimate of hm can be obtained from the +** expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to the +** pressure and that an accurate phpa value is important for +** precise work. +** +** 7) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 8) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** 9) In cases where the caller wishes to supply his own Earth +** rotation information and refraction constants, the function +** eraApc can be used instead of the present function. +** +** 10) This is one of several functions that inserts into the astrom +** structure star-independent parameters needed for the chain of +** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed. +** +** The various functions support different classes of observer and +** portions of the transformation chain: +** +** functions observer transformation +** +** eraApcg eraApcg13 geocentric ICRS <-> GCRS +** eraApci eraApci13 terrestrial ICRS <-> CIRS +** eraApco eraApco13 terrestrial ICRS <-> observed +** eraApcs eraApcs13 space ICRS <-> GCRS +** eraAper eraAper13 terrestrial update Earth rotation +** eraApio eraApio13 terrestrial CIRS <-> observed +** +** Those with names ending in "13" use contemporary ERFA models to +** compute the various ephemerides. The others accept ephemerides +** supplied by the caller. +** +** The transformation from ICRS to GCRS covers space motion, +** parallax, light deflection, and aberration. From GCRS to CIRS +** comprises frame bias and precession-nutation. From CIRS to +** observed takes account of Earth rotation, polar motion, diurnal +** aberration and parallax (unless subsumed into the ICRS <-> GCRS +** transformation), and atmospheric refraction. +** +** 11) The context structure astrom produced by this function is used +** by eraAtioq and eraAtoiq. +** +** Called: +** eraUtctai UTC to TAI +** eraTaitt TAI to TT +** eraUtcut1 UTC to UT1 +** eraSp00 the TIO locator s', IERS 2000 +** eraEra00 Earth rotation angle, IAU 2000 +** eraRefco refraction constants for given ambient conditions +** eraApio astrometry parameters, CIRS-observed +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + double tai1, tai2, tt1, tt2, ut11, ut12, sp, theta, refa, refb; + + +/* UTC to other time scales. */ + j = eraUtctai(utc1, utc2, &tai1, &tai2); + if ( j < 0 ) return -1; + j = eraTaitt(tai1, tai2, &tt1, &tt2); + j = eraUtcut1(utc1, utc2, dut1, &ut11, &ut12); + if ( j < 0 ) return -1; + +/* TIO locator s'. */ + sp = eraSp00(tt1, tt2); + +/* Earth rotation angle. */ + theta = eraEra00(ut11, ut12); + +/* Refraction constants A and B. */ + eraRefco(phpa, tc, rh, wl, &refa, &refb); + +/* CIRS <-> observed astrometry parameters. */ + eraApio(sp, theta, elong, phi, hm, xp, yp, refa, refb, astrom); + +/* Return any warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atci13.c b/testbed/astropy__astropy/cextern/erfa/atci13.c new file mode 100644 index 0000000000000000000000000000000000000000..7eebe16631c02cc2d57bdc63730561f62b79b28c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atci13.c @@ -0,0 +1,159 @@ +#include "erfa.h" + +void eraAtci13(double rc, double dc, + double pr, double pd, double px, double rv, + double date1, double date2, + double *ri, double *di, double *eo) +/* +** - - - - - - - - - - +** e r a A t c i 1 3 +** - - - - - - - - - - +** +** Transform ICRS star data, epoch J2000.0, to CIRS. +** +** Given: +** rc double ICRS right ascension at J2000.0 (radians, Note 1) +** dc double ICRS declination at J2000.0 (radians, Note 1) +** pr double RA proper motion (radians/year; Note 2) +** pd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, +ve if receding) +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 3) +** +** Returned: +** ri,di double* CIRS geocentric RA,Dec (radians) +** eo double* equation of the origins (ERA-GST, Note 5) +** +** Notes: +** +** 1) Star data for an epoch other than J2000.0 (for example from the +** Hipparcos catalog, which has an epoch of J1991.25) will require a +** preliminary call to eraPmsafe before use. +** +** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** 3) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 4) The available accuracy is better than 1 milliarcsecond, limited +** mainly by the precession-nutation model that is used, namely +** IAU 2000A/2006. Very close to solar system bodies, additional +** errors of up to several milliarcseconds can occur because of +** unmodeled light deflection; however, the Sun's contribution is +** taken into account, to first order. The accuracy limitations of +** the ERFA function eraEpv00 (used to compute Earth position and +** velocity) can contribute aberration errors of up to +** 5 microarcseconds. Light deflection at the Sun's limb is +** uncertain at the 0.4 mas level. +** +** 5) Should the transformation to (equinox based) apparent place be +** required rather than (CIO based) intermediate place, subtract the +** equation of the origins from the returned right ascension: +** RA = RI - EO. (The eraAnp function can then be applied, as +** required, to keep the result in the conventional 0-2pi range.) +** +** Called: +** eraApci13 astrometry parameters, ICRS-CIRS, 2013 +** eraAtciq quick ICRS to CIRS +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Star-independent astrometry parameters */ + eraASTROM astrom; + + +/* The transformation parameters. */ + eraApci13(date1, date2, &astrom, eo); + +/* ICRS (epoch J2000.0) to CIRS. */ + eraAtciq(rc, dc, pr, pd, px, rv, &astrom, ri, di); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atciq.c b/testbed/astropy__astropy/cextern/erfa/atciq.c new file mode 100644 index 0000000000000000000000000000000000000000..2c4b31fc3de894f6da0f7af481c6b3bd76796be0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atciq.c @@ -0,0 +1,154 @@ +#include "erfa.h" + +void eraAtciq(double rc, double dc, + double pr, double pd, double px, double rv, + eraASTROM *astrom, double *ri, double *di) +/* +** - - - - - - - - - +** e r a A t c i q +** - - - - - - - - - +** +** Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed +** star-independent astrometry parameters. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are to be transformed for one date. The +** star-independent parameters can be obtained by calling one of the +** functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. +** +** If the parallax and proper motions are zero the eraAtciqz function +** can be used instead. +** +** Given: +** rc,dc double ICRS RA,Dec at J2000.0 (radians) +** pr double RA proper motion (radians/year; Note 3) +** pd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, +ve if receding) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned: +** ri,di double CIRS RA,Dec (radians) +** +** Notes: +** +** 1) All the vectors are with respect to BCRS axes. +** +** 2) Star data for an epoch other than J2000.0 (for example from the +** Hipparcos catalog, which has an epoch of J1991.25) will require a +** preliminary call to eraPmsafe before use. +** +** 3) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** Called: +** eraPmpx proper motion and parallax +** eraLdsun light deflection by the Sun +** eraAb stellar aberration +** eraRxp product of r-matrix and pv-vector +** eraC2s p-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double pco[3], pnat[3], ppr[3], pi[3], w; + + +/* Proper motion and parallax, giving BCRS coordinate direction. */ + eraPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco); + +/* Light deflection by the Sun, giving BCRS natural direction. */ + eraLdsun(pco, astrom->eh, astrom->em, pnat); + +/* Aberration, giving GCRS proper direction. */ + eraAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr); + +/* Bias-precession-nutation, giving CIRS proper direction. */ + eraRxp(astrom->bpn, ppr, pi); + +/* CIRS RA,Dec. */ + eraC2s(pi, &w, di); + *ri = eraAnp(w); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atciqn.c b/testbed/astropy__astropy/cextern/erfa/atciqn.c new file mode 100644 index 0000000000000000000000000000000000000000..305dfa660f8d455d93743fec8b2bc31b8a771afe --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atciqn.c @@ -0,0 +1,191 @@ +#include "erfa.h" + +void eraAtciqn(double rc, double dc, double pr, double pd, + double px, double rv, eraASTROM *astrom, + int n, eraLDBODY b[], double *ri, double *di) +/* +** - - - - - - - - - - +** e r a A t c i q n +** - - - - - - - - - - +** +** Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed +** star-independent astrometry parameters plus a list of light- +** deflecting bodies. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are to be transformed for one date. The +** star-independent parameters can be obtained by calling one of the +** functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. +** +** +** If the only light-deflecting body to be taken into account is the +** Sun, the eraAtciq function can be used instead. If in addition the +** parallax and proper motions are zero, the eraAtciqz function can be +** used. +** +** Given: +** rc,dc double ICRS RA,Dec at J2000.0 (radians) +** pr double RA proper motion (radians/year; Note 3) +** pd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, +ve if receding) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** n int number of bodies (Note 3) +** b eraLDBODY[n] data for each of the n bodies (Notes 3,4): +** bm double mass of the body (solar masses, Note 5) +** dl double deflection limiter (Note 6) +** pv [2][3] barycentric PV of the body (au, au/day) +** +** Returned: +** ri,di double CIRS RA,Dec (radians) +** +** Notes: +** +** 1) Star data for an epoch other than J2000.0 (for example from the +** Hipparcos catalog, which has an epoch of J1991.25) will require a +** preliminary call to eraPmsafe before use. +** +** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** 3) The struct b contains n entries, one for each body to be +** considered. If n = 0, no gravitational light deflection will be +** applied, not even for the Sun. +** +** 4) The struct b should include an entry for the Sun as well as for +** any planet or other body to be taken into account. The entries +** should be in the order in which the light passes the body. +** +** 5) In the entry in the b struct for body i, the mass parameter +** b[i].bm can, as required, be adjusted in order to allow for such +** effects as quadrupole field. +** +** 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is +** the angular separation (in radians) between star and body at +** which limiting is applied. As phi shrinks below the chosen +** threshold, the deflection is artificially reduced, reaching zero +** for phi = 0. Example values suitable for a terrestrial +** observer, together with masses, are as follows: +** +** body i b[i].bm b[i].dl +** +** Sun 1.0 6e-6 +** Jupiter 0.00095435 3e-9 +** Saturn 0.00028574 3e-10 +** +** 7) For efficiency, validation of the contents of the b array is +** omitted. The supplied masses must be greater than zero, the +** position and velocity vectors must be right, and the deflection +** limiter greater than zero. +** +** Called: +** eraPmpx proper motion and parallax +** eraLdn light deflection by n bodies +** eraAb stellar aberration +** eraRxp product of r-matrix and pv-vector +** eraC2s p-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double pco[3], pnat[3], ppr[3], pi[3], w; + + +/* Proper motion and parallax, giving BCRS coordinate direction. */ + eraPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco); + +/* Light deflection, giving BCRS natural direction. */ + eraLdn(n, b, astrom->eb, pco, pnat); + +/* Aberration, giving GCRS proper direction. */ + eraAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr); + +/* Bias-precession-nutation, giving CIRS proper direction. */ + eraRxp(astrom->bpn, ppr, pi); + +/* CIRS RA,Dec. */ + eraC2s(pi, &w, di); + *ri = eraAnp(w); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atciqz.c b/testbed/astropy__astropy/cextern/erfa/atciqz.c new file mode 100644 index 0000000000000000000000000000000000000000..938192f44e18054cfd06bfa179eadcb90155e6b8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atciqz.c @@ -0,0 +1,153 @@ +#include "erfa.h" + +void eraAtciqz(double rc, double dc, eraASTROM *astrom, + double *ri, double *di) +/* +** - - - - - - - - - - +** e r a A t c i q z +** - - - - - - - - - - +** +** Quick ICRS to CIRS transformation, given precomputed star- +** independent astrometry parameters, and assuming zero parallax and +** proper motion. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are to be transformed for one date. The +** star-independent parameters can be obtained by calling one of the +** functions eraApci[13], eraApcg[13], eraApco[13] or eraApcs[13]. +** +** The corresponding function for the case of non-zero parallax and +** proper motion is eraAtciq. +** +** Given: +** rc,dc double ICRS astrometric RA,Dec (radians) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned: +** ri,di double CIRS RA,Dec (radians) +** +** Note: +** +** All the vectors are with respect to BCRS axes. +** +** References: +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013). +** +** Klioner, Sergei A., "A practical relativistic model for micro- +** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraLdsun light deflection due to Sun +** eraAb stellar aberration +** eraRxp product of r-matrix and p-vector +** eraC2s p-vector to spherical +** eraAnp normalize angle into range +/- pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double pco[3], pnat[3], ppr[3], pi[3], w; + + +/* BCRS coordinate direction (unit vector). */ + eraS2c(rc, dc, pco); + +/* Light deflection by the Sun, giving BCRS natural direction. */ + eraLdsun(pco, astrom->eh, astrom->em, pnat); + +/* Aberration, giving GCRS proper direction. */ + eraAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr); + +/* Bias-precession-nutation, giving CIRS proper direction. */ + eraRxp(astrom->bpn, ppr, pi); + +/* CIRS RA,Dec. */ + eraC2s(pi, &w, di); + *ri = eraAnp(w); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atco13.c b/testbed/astropy__astropy/cextern/erfa/atco13.c new file mode 100644 index 0000000000000000000000000000000000000000..2ec65bde2682479ed9a56ec509406eba6358b31e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atco13.c @@ -0,0 +1,243 @@ +#include "erfa.h" + +int eraAtco13(double rc, double dc, + double pr, double pd, double px, double rv, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *aob, double *zob, double *hob, + double *dob, double *rob, double *eo) +/* +** - - - - - - - - - - +** e r a A t c o 1 3 +** - - - - - - - - - - +** +** ICRS RA,Dec to observed place. The caller supplies UTC, site +** coordinates, ambient air conditions and observing wavelength. +** +** ERFA models are used for the Earth ephemeris, bias-precession- +** nutation, Earth orientation and refraction. +** +** Given: +** rc,dc double ICRS right ascension at J2000.0 (radians, Note 1) +** pr double RA proper motion (radians/year; Note 2) +** pd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, +ve if receding) +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 3-4) +** dut1 double UT1-UTC (seconds, Note 5) +** elong double longitude (radians, east +ve, Note 6) +** phi double latitude (geodetic, radians, Note 6) +** hm double height above ellipsoid (m, geodetic, Notes 6,8) +** xp,yp double polar motion coordinates (radians, Note 7) +** phpa double pressure at the observer (hPa = mB, Note 8) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 9) +** +** Returned: +** aob double* observed azimuth (radians: N=0,E=90) +** zob double* observed zenith distance (radians) +** hob double* observed hour angle (radians) +** dob double* observed declination (radians) +** rob double* observed right ascension (CIO-based, radians) +** eo double* equation of the origins (ERA-GST) +** +** Returned (function value): +** int status: +1 = dubious year (Note 4) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) Star data for an epoch other than J2000.0 (for example from the +** Hipparcos catalog, which has an epoch of J1991.25) will require +** a preliminary call to eraPmsafe before use. +** +** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 4) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the +** future to be trusted. See eraDat for further details. +** +** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 6) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 7) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many +** applications, xp and yp can be set to zero. +** +** 8) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), +** is available, an adequate estimate of hm can be obtained from +** the expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to +** the pressure and that an accurate phpa value is important for +** precise work. +** +** 9) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 10) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted observed +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better +** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** Without refraction, the complementary functions eraAtco13 and +** eraAtoc13 are self-consistent to better than 1 microarcsecond +** all over the celestial sphere. With refraction included, +** consistency falls off at high zenith distances, but is still +** better than 0.05 arcsec at 85 degrees. +** +** 11) "Observed" Az,ZD means the position that would be seen by a +** perfect geodetically aligned theodolite. (Zenith distance is +** used rather than altitude in order to reflect the fact that no +** allowance is made for depression of the horizon.) This is +** related to the observed HA,Dec via the standard rotation, using +** the geodetic latitude (corrected for polar motion), while the +** observed HA and RA are related simply through the Earth rotation +** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus +** means the position that would be seen by a perfect equatorial +** with its polar axis aligned to the Earth's axis of rotation. +** +** 12) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** Called: +** eraApco13 astrometry parameters, ICRS-observed, 2013 +** eraAtciq quick ICRS to CIRS +** eraAtioq quick CIRS to observed +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + eraASTROM astrom; + double ri, di; + + +/* Star-independent astrometry parameters. */ + j = eraApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp, + phpa, tc, rh, wl, &astrom, eo); + +/* Abort if bad UTC. */ + if ( j < 0 ) return j; + +/* Transform ICRS to CIRS. */ + eraAtciq(rc, dc, pr, pd, px, rv, &astrom, &ri, &di); + +/* Transform CIRS to observed. */ + eraAtioq(ri, di, &astrom, aob, zob, hob, dob, rob); + +/* Return OK/warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atic13.c b/testbed/astropy__astropy/cextern/erfa/atic13.c new file mode 100644 index 0000000000000000000000000000000000000000..18eb67f40b423ac756e8d03b5e1a9075f70d03ad --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atic13.c @@ -0,0 +1,152 @@ +#include "erfa.h" + +void eraAtic13(double ri, double di, double date1, double date2, + double *rc, double *dc, double *eo) +/* +** - - - - - - - - - - +** e r a A t i c 1 3 +** - - - - - - - - - - +** +** Transform star RA,Dec from geocentric CIRS to ICRS astrometric. +** +** Given: +** ri,di double CIRS geocentric RA,Dec (radians) +** date1 double TDB as a 2-part... +** date2 double ...Julian Date (Note 1) +** +** Returned: +** rc,dc double ICRS astrometric RA,Dec (radians) +** eo double equation of the origins (ERA-GST, Note 4) +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. For most +** applications of this function the choice will not be at all +** critical. +** +** TT can be used instead of TDB without any significant impact on +** accuracy. +** +** 2) Iterative techniques are used for the aberration and light +** deflection corrections so that the functions eraAtic13 (or +** eraAticq) and eraAtci13 (or eraAtciq) are accurate inverses; +** even at the edge of the Sun's disk the discrepancy is only about +** 1 nanoarcsecond. +** +** 3) The available accuracy is better than 1 milliarcsecond, limited +** mainly by the precession-nutation model that is used, namely +** IAU 2000A/2006. Very close to solar system bodies, additional +** errors of up to several milliarcseconds can occur because of +** unmodeled light deflection; however, the Sun's contribution is +** taken into account, to first order. The accuracy limitations of +** the ERFA function eraEpv00 (used to compute Earth position and +** velocity) can contribute aberration errors of up to +** 5 microarcseconds. Light deflection at the Sun's limb is +** uncertain at the 0.4 mas level. +** +** 4) Should the transformation to (equinox based) J2000.0 mean place +** be required rather than (CIO based) ICRS coordinates, subtract the +** equation of the origins from the returned right ascension: +** RA = RI - EO. (The eraAnp function can then be applied, as +** required, to keep the result in the conventional 0-2pi range.) +** +** Called: +** eraApci13 astrometry parameters, ICRS-CIRS, 2013 +** eraAticq quick CIRS to ICRS astrometric +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Star-independent astrometry parameters */ + eraASTROM astrom; + + +/* Star-independent astrometry parameters. */ + eraApci13(date1, date2, &astrom, eo); + +/* CIRS to ICRS astrometric. */ + eraAticq(ri, di, &astrom, rc, dc); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/aticq.c b/testbed/astropy__astropy/cextern/erfa/aticq.c new file mode 100644 index 0000000000000000000000000000000000000000..f7f68f96b579d4da75554dc2e0b31a949709a31a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/aticq.c @@ -0,0 +1,199 @@ +#include "erfa.h" + +void eraAticq(double ri, double di, eraASTROM *astrom, + double *rc, double *dc) +/* +** - - - - - - - - - +** e r a A t i c q +** - - - - - - - - - +** +** Quick CIRS RA,Dec to ICRS astrometric place, given the star- +** independent astrometry parameters. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are all to be transformed for one date. +** The star-independent astrometry parameters can be obtained by +** calling one of the functions eraApci[13], eraApcg[13], eraApco[13] +** or eraApcs[13]. +** +** Given: +** ri,di double CIRS RA,Dec (radians) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned: +** rc,dc double ICRS astrometric RA,Dec (radians) +** +** Notes: +** +** 1) Only the Sun is taken into account in the light deflection +** correction. +** +** 2) Iterative techniques are used for the aberration and light +** deflection corrections so that the functions eraAtic13 (or +** eraAticq) and eraAtci13 (or eraAtciq) are accurate inverses; +** even at the edge of the Sun's disk the discrepancy is only about +** 1 nanoarcsecond. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraTrxp product of transpose of r-matrix and p-vector +** eraZp zero p-vector +** eraAb stellar aberration +** eraLdsun light deflection by the Sun +** eraC2s p-vector to spherical +** eraAnp normalize angle into range +/- pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j, i; + double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r, + after[3]; + + +/* CIRS RA,Dec to Cartesian. */ + eraS2c(ri, di, pi); + +/* Bias-precession-nutation, giving GCRS proper direction. */ + eraTrxp(astrom->bpn, pi, ppr); + +/* Aberration, giving GCRS natural direction. */ + eraZp(d); + for (j = 0; j < 2; j++) { + r2 = 0.0; + for (i = 0; i < 3; i++) { + w = ppr[i] - d[i]; + before[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + before[i] /= r; + } + eraAb(before, astrom->v, astrom->em, astrom->bm1, after); + r2 = 0.0; + for (i = 0; i < 3; i++) { + d[i] = after[i] - before[i]; + w = ppr[i] - d[i]; + pnat[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + pnat[i] /= r; + } + } + +/* Light deflection by the Sun, giving BCRS coordinate direction. */ + eraZp(d); + for (j = 0; j < 5; j++) { + r2 = 0.0; + for (i = 0; i < 3; i++) { + w = pnat[i] - d[i]; + before[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + before[i] /= r; + } + eraLdsun(before, astrom->eh, astrom->em, after); + r2 = 0.0; + for (i = 0; i < 3; i++) { + d[i] = after[i] - before[i]; + w = pnat[i] - d[i]; + pco[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + pco[i] /= r; + } + } + +/* ICRS astrometric RA,Dec. */ + eraC2s(pco, &w, dc); + *rc = eraAnp(w); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/aticqn.c b/testbed/astropy__astropy/cextern/erfa/aticqn.c new file mode 100644 index 0000000000000000000000000000000000000000..f49c64ed478410614cba58802ba20c9d2396aff2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/aticqn.c @@ -0,0 +1,237 @@ +#include "erfa.h" + +void eraAticqn(double ri, double di, eraASTROM *astrom, + int n, eraLDBODY b[], double *rc, double *dc) +/* +** - - - - - - - - - +** e r a A t i c q n +** - - - - - - - - - +** +** Quick CIRS to ICRS astrometric place transformation, given the star- +** independent astrometry parameters plus a list of light-deflecting +** bodies. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are all to be transformed for one date. +** The star-independent astrometry parameters can be obtained by +** calling one of the functions eraApci[13], eraApcg[13], eraApco[13] +** or eraApcs[13]. +* +* If the only light-deflecting body to be taken into account is the +* Sun, the eraAticq function can be used instead. +** +** Given: +** ri,di double CIRS RA,Dec (radians) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** n int number of bodies (Note 3) +** b eraLDBODY[n] data for each of the n bodies (Notes 3,4): +** bm double mass of the body (solar masses, Note 5) +** dl double deflection limiter (Note 6) +** pv [2][3] barycentric PV of the body (au, au/day) +** +** Returned: +** rc,dc double ICRS astrometric RA,Dec (radians) +** +** Notes: +** +** 1) Iterative techniques are used for the aberration and light +** deflection corrections so that the functions eraAticqn and +** eraAtciqn are accurate inverses; even at the edge of the Sun's +** disk the discrepancy is only about 1 nanoarcsecond. +** +** 2) If the only light-deflecting body to be taken into account is the +** Sun, the eraAticq function can be used instead. +** +** 3) The struct b contains n entries, one for each body to be +** considered. If n = 0, no gravitational light deflection will be +** applied, not even for the Sun. +** +** 4) The struct b should include an entry for the Sun as well as for +** any planet or other body to be taken into account. The entries +** should be in the order in which the light passes the body. +** +** 5) In the entry in the b struct for body i, the mass parameter +** b[i].bm can, as required, be adjusted in order to allow for such +** effects as quadrupole field. +** +** 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is +** the angular separation (in radians) between star and body at +** which limiting is applied. As phi shrinks below the chosen +** threshold, the deflection is artificially reduced, reaching zero +** for phi = 0. Example values suitable for a terrestrial +** observer, together with masses, are as follows: +** +** body i b[i].bm b[i].dl +** +** Sun 1.0 6e-6 +** Jupiter 0.00095435 3e-9 +** Saturn 0.00028574 3e-10 +** +** 7) For efficiency, validation of the contents of the b array is +** omitted. The supplied masses must be greater than zero, the +** position and velocity vectors must be right, and the deflection +** limiter greater than zero. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraTrxp product of transpose of r-matrix and p-vector +** eraZp zero p-vector +** eraAb stellar aberration +** eraLdn light deflection by n bodies +** eraC2s p-vector to spherical +** eraAnp normalize angle into range +/- pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j, i; + double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r, + after[3]; + + +/* CIRS RA,Dec to Cartesian. */ + eraS2c(ri, di, pi); + +/* Bias-precession-nutation, giving GCRS proper direction. */ + eraTrxp(astrom->bpn, pi, ppr); + +/* Aberration, giving GCRS natural direction. */ + eraZp(d); + for (j = 0; j < 2; j++) { + r2 = 0.0; + for (i = 0; i < 3; i++) { + w = ppr[i] - d[i]; + before[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + before[i] /= r; + } + eraAb(before, astrom->v, astrom->em, astrom->bm1, after); + r2 = 0.0; + for (i = 0; i < 3; i++) { + d[i] = after[i] - before[i]; + w = ppr[i] - d[i]; + pnat[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + pnat[i] /= r; + } + } + +/* Light deflection, giving BCRS coordinate direction. */ + eraZp(d); + for (j = 0; j < 5; j++) { + r2 = 0.0; + for (i = 0; i < 3; i++) { + w = pnat[i] - d[i]; + before[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + before[i] /= r; + } + eraLdn(n, b, astrom->eb, before, after); + r2 = 0.0; + for (i = 0; i < 3; i++) { + d[i] = after[i] - before[i]; + w = pnat[i] - d[i]; + pco[i] = w; + r2 += w*w; + } + r = sqrt(r2); + for (i = 0; i < 3; i++) { + pco[i] /= r; + } + } + +/* ICRS astrometric RA,Dec. */ + eraC2s(pco, &w, dc); + *rc = eraAnp(w); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atio13.c b/testbed/astropy__astropy/cextern/erfa/atio13.c new file mode 100644 index 0000000000000000000000000000000000000000..fcc93b56456325c8800ca3d703b9107b9644348a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atio13.c @@ -0,0 +1,222 @@ +#include "erfa.h" + +int eraAtio13(double ri, double di, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *aob, double *zob, double *hob, + double *dob, double *rob) +/* +** - - - - - - - - - - +** e r a A t i o 1 3 +** - - - - - - - - - - +** +** CIRS RA,Dec to observed place. The caller supplies UTC, site +** coordinates, ambient air conditions and observing wavelength. +** +** Given: +** ri double CIRS right ascension (CIO-based, radians) +** di double CIRS declination (radians) +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 1,2) +** dut1 double UT1-UTC (seconds, Note 3) +** elong double longitude (radians, east +ve, Note 4) +** phi double geodetic latitude (radians, Note 4) +** hm double height above ellipsoid (m, geodetic Notes 4,6) +** xp,yp double polar motion coordinates (radians, Note 5) +** phpa double pressure at the observer (hPa = mB, Note 6) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 7) +** +** Returned: +** aob double* observed azimuth (radians: N=0,E=90) +** zob double* observed zenith distance (radians) +** hob double* observed hour angle (radians) +** dob double* observed declination (radians) +** rob double* observed right ascension (CIO-based, radians) +** +** Returned (function value): +** int status: +1 = dubious year (Note 2) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 2) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the +** future to be trusted. See eraDat for further details. +** +** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 4) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 5) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many +** applications, xp and yp can be set to zero. +** +** 6) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), is +** available, an adequate estimate of hm can be obtained from the +** expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to +** the pressure and that an accurate phpa value is important for +** precise work. +** +** 7) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 8) "Observed" Az,ZD means the position that would be seen by a +** perfect geodetically aligned theodolite. (Zenith distance is +** used rather than altitude in order to reflect the fact that no +** allowance is made for depression of the horizon.) This is +** related to the observed HA,Dec via the standard rotation, using +** the geodetic latitude (corrected for polar motion), while the +** observed HA and RA are related simply through the Earth rotation +** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus +** means the position that would be seen by a perfect equatorial +** with its polar axis aligned to the Earth's axis of rotation. +** +** 9) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted astrometric +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better +** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** 10) The complementary functions eraAtio13 and eraAtoi13 are self- +** consistent to better than 1 microarcsecond all over the +** celestial sphere. +** +** 11) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** Called: +** eraApio13 astrometry parameters, CIRS-observed, 2013 +** eraAtioq quick CIRS to observed +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + eraASTROM astrom; + + +/* Star-independent astrometry parameters for CIRS->observed. */ + j = eraApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, + phpa, tc, rh, wl, &astrom); + +/* Abort if bad UTC. */ + if ( j < 0 ) return j; + +/* Transform CIRS to observed. */ + eraAtioq(ri, di, &astrom, aob, zob, hob, dob, rob); + +/* Return OK/warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atioq.c b/testbed/astropy__astropy/cextern/erfa/atioq.c new file mode 100644 index 0000000000000000000000000000000000000000..7ceee13ab99e6c0723a94ab6a3973178cdc06a4f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atioq.c @@ -0,0 +1,243 @@ +#include "erfa.h" + +void eraAtioq(double ri, double di, eraASTROM *astrom, + double *aob, double *zob, + double *hob, double *dob, double *rob) +/* +** - - - - - - - - - +** e r a A t i o q +** - - - - - - - - - +** +** Quick CIRS to observed place transformation. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are all to be transformed for one date. +** The star-independent astrometry parameters can be obtained by +** calling eraApio[13] or eraApco[13]. +** +** Given: +** ri double CIRS right ascension +** di double CIRS declination +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned: +** aob double* observed azimuth (radians: N=0,E=90) +** zob double* observed zenith distance (radians) +** hob double* observed hour angle (radians) +** dob double* observed declination (radians) +** rob double* observed right ascension (CIO-based, radians) +** +** Notes: +** +** 1) This function returns zenith distance rather than altitude in +** order to reflect the fact that no allowance is made for +** depression of the horizon. +** +** 2) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted observed +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better +** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** Without refraction, the complementary functions eraAtioq and +** eraAtoiq are self-consistent to better than 1 microarcsecond all +** over the celestial sphere. With refraction included, consistency +** falls off at high zenith distances, but is still better than +** 0.05 arcsec at 85 degrees. +** +** 3) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** 4) The CIRS RA,Dec is obtained from a star catalog mean place by +** allowing for space motion, parallax, the Sun's gravitational lens +** effect, annual aberration and precession-nutation. For star +** positions in the ICRS, these effects can be applied by means of +** the eraAtci13 (etc.) functions. Starting from classical "mean +** place" systems, additional transformations will be needed first. +** +** 5) "Observed" Az,El means the position that would be seen by a +** perfect geodetically aligned theodolite. This is obtained from +** the CIRS RA,Dec by allowing for Earth orientation and diurnal +** aberration, rotating from equator to horizon coordinates, and +** then adjusting for refraction. The HA,Dec is obtained by +** rotating back into equatorial coordinates, and is the position +** that would be seen by a perfect equatorial with its polar axis +** aligned to the Earth's axis of rotation. Finally, the RA is +** obtained by subtracting the HA from the local ERA. +** +** 6) The star-independent CIRS-to-observed-place parameters in ASTROM +** may be computed with eraApio[13] or eraApco[13]. If nothing has +** changed significantly except the time, eraAper[13] may be used to +** perform the requisite adjustment to the astrom structure. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraC2s p-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Minimum cos(alt) and sin(alt) for refraction purposes */ + const double CELMIN = 1e-6; + const double SELMIN = 0.05; + + double v[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt, + xaet, yaet, zaet, azobs, r, tz, w, del, cosdel, + xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs; + + +/* CIRS RA,Dec to Cartesian -HA,Dec. */ + eraS2c(ri-astrom->eral, di, v); + x = v[0]; + y = v[1]; + z = v[2]; + +/* Polar motion. */ + xhd = x + astrom->xpl*z; + yhd = y - astrom->ypl*z; + zhd = z - astrom->xpl*x + astrom->ypl*y; + +/* Diurnal aberration. */ + f = ( 1.0 - astrom->diurab*yhd ); + xhdt = f * xhd; + yhdt = f * ( yhd + astrom->diurab ); + zhdt = f * zhd; + +/* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */ + xaet = astrom->sphi*xhdt - astrom->cphi*zhdt; + yaet = yhdt; + zaet = astrom->cphi*xhdt + astrom->sphi*zhdt; + +/* Azimuth (N=0,E=90). */ + azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0; + +/* ---------- */ +/* Refraction */ +/* ---------- */ + +/* Cosine and sine of altitude, with precautions. */ + r = sqrt(xaet*xaet + yaet*yaet); + r = r > CELMIN ? r : CELMIN; + z = zaet > SELMIN ? zaet : SELMIN; + +/* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */ + tz = r/z; + w = astrom->refb*tz*tz; + del = ( astrom->refa + w ) * tz / + ( 1.0 + ( astrom->refa + 3.0*w ) / ( z*z ) ); + +/* Apply the change, giving observed vector. */ + cosdel = 1.0 - del*del/2.0; + f = cosdel - del*z/r; + xaeo = xaet*f; + yaeo = yaet*f; + zaeo = cosdel*zaet + del*r; + +/* Observed ZD. */ + zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo); + +/* Az/El vector to HA,Dec vector (both right-handed). */ + v[0] = astrom->sphi*xaeo + astrom->cphi*zaeo; + v[1] = yaeo; + v[2] = - astrom->cphi*xaeo + astrom->sphi*zaeo; + +/* To spherical -HA,Dec. */ + eraC2s ( v, &hmobs, &dcobs ); + +/* Right ascension (with respect to CIO). */ + raobs = astrom->eral + hmobs; + +/* Return the results. */ + *aob = eraAnp(azobs); + *zob = zdobs; + *hob = -hmobs; + *dob = dcobs; + *rob = eraAnp(raobs); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atoc13.c b/testbed/astropy__astropy/cextern/erfa/atoc13.c new file mode 100644 index 0000000000000000000000000000000000000000..58eb3fed3faa4719cd1cc45a5354ae02b31fa1fd --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atoc13.c @@ -0,0 +1,233 @@ +#include "erfa.h" + +int eraAtoc13(const char *type, double ob1, double ob2, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *rc, double *dc) +/* +** - - - - - - - - - - +** e r a A t o c 1 3 +** - - - - - - - - - - +** +** Observed place at a groundbased site to to ICRS astrometric RA,Dec. +** The caller supplies UTC, site coordinates, ambient air conditions +** and observing wavelength. +** +** Given: +** type char[] type of coordinates - "R", "H" or "A" (Notes 1,2) +** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) +** ob2 double observed ZD or Dec (radians) +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 3,4) +** dut1 double UT1-UTC (seconds, Note 5) +** elong double longitude (radians, east +ve, Note 6) +** phi double geodetic latitude (radians, Note 6) +** hm double height above ellipsoid (m, geodetic Notes 6,8) +** xp,yp double polar motion coordinates (radians, Note 7) +** phpa double pressure at the observer (hPa = mB, Note 8) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 9) +** +** Returned: +** rc,dc double ICRS astrometric RA,Dec (radians) +** +** Returned (function value): +** int status: +1 = dubious year (Note 4) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) "Observed" Az,ZD means the position that would be seen by a +** perfect geodetically aligned theodolite. (Zenith distance is +** used rather than altitude in order to reflect the fact that no +** allowance is made for depression of the horizon.) This is +** related to the observed HA,Dec via the standard rotation, using +** the geodetic latitude (corrected for polar motion), while the +** observed HA and RA are related simply through the Earth rotation +** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus +** means the position that would be seen by a perfect equatorial +** with its polar axis aligned to the Earth's axis of rotation. +** +** 2) Only the first character of the type argument is significant. +** "R" or "r" indicates that ob1 and ob2 are the observed right +** ascension and declination; "H" or "h" indicates that they are +** hour angle (west +ve) and declination; anything else ("A" or +** "a" is recommended) indicates that ob1 and ob2 are azimuth +** (north zero, east 90 deg) and zenith distance. +** +** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 4) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the +** future to be trusted. See eraDat for further details. +** +** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 6) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 7) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many +** applications, xp and yp can be set to zero. +** +** 8) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), is +** available, an adequate estimate of hm can be obtained from the +** expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to +** the pressure and that an accurate phpa value is important for +** precise work. +** +** 9) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 10) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted astrometric +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better +** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** Without refraction, the complementary functions eraAtco13 and +** eraAtoc13 are self-consistent to better than 1 microarcsecond +** all over the celestial sphere. With refraction included, +** consistency falls off at high zenith distances, but is still +** better than 0.05 arcsec at 85 degrees. +** +** 11) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** Called: +** eraApco13 astrometry parameters, ICRS-observed +** eraAtoiq quick observed to CIRS +** eraAticq quick CIRS to ICRS +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + eraASTROM astrom; + double eo, ri, di; + + +/* Star-independent astrometry parameters. */ + j = eraApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp, + phpa, tc, rh, wl, &astrom, &eo); + +/* Abort if bad UTC. */ + if ( j < 0 ) return j; + +/* Transform observed to CIRS. */ + eraAtoiq(type, ob1, ob2, &astrom, &ri, &di); + +/* Transform CIRS to ICRS. */ + eraAticq(ri, di, &astrom, rc, dc); + +/* Return OK/warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atoi13.c b/testbed/astropy__astropy/cextern/erfa/atoi13.c new file mode 100644 index 0000000000000000000000000000000000000000..5c0e75191bc7b9079df32e391ab2bfbc8657ff65 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atoi13.c @@ -0,0 +1,228 @@ +#include "erfa.h" + +int eraAtoi13(const char *type, double ob1, double ob2, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *ri, double *di) +/* +** - - - - - - - - - - +** e r a A t o i 1 3 +** - - - - - - - - - - +** +** Observed place to CIRS. The caller supplies UTC, site coordinates, +** ambient air conditions and observing wavelength. +** +** Given: +** type char[] type of coordinates - "R", "H" or "A" (Notes 1,2) +** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) +** ob2 double observed ZD or Dec (radians) +** utc1 double UTC as a 2-part... +** utc2 double ...quasi Julian Date (Notes 3,4) +** dut1 double UT1-UTC (seconds, Note 5) +** elong double longitude (radians, east +ve, Note 6) +** phi double geodetic latitude (radians, Note 6) +** hm double height above the ellipsoid (meters, Notes 6,8) +** xp,yp double polar motion coordinates (radians, Note 7) +** phpa double pressure at the observer (hPa = mB, Note 8) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers, Note 9) +** +** Returned: +** ri double* CIRS right ascension (CIO-based, radians) +** di double* CIRS declination (radians) +** +** Returned (function value): +** int status: +1 = dubious year (Note 2) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) "Observed" Az,ZD means the position that would be seen by a +** perfect geodetically aligned theodolite. (Zenith distance is +** used rather than altitude in order to reflect the fact that no +** allowance is made for depression of the horizon.) This is +** related to the observed HA,Dec via the standard rotation, using +** the geodetic latitude (corrected for polar motion), while the +** observed HA and RA are related simply through the Earth rotation +** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus +** means the position that would be seen by a perfect equatorial +** with its polar axis aligned to the Earth's axis of rotation. +** +** 2) Only the first character of the type argument is significant. +** "R" or "r" indicates that ob1 and ob2 are the observed right +** ascension and declination; "H" or "h" indicates that they are +** hour angle (west +ve) and declination; anything else ("A" or +** "a" is recommended) indicates that ob1 and ob2 are azimuth +** (north zero, east 90 deg) and zenith distance. +** +** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** However, JD cannot unambiguously represent UTC during a leap +** second unless special measures are taken. The convention in the +** present function is that the JD day represents UTC days whether +** the length is 86399, 86400 or 86401 SI seconds. +** +** Applications should use the function eraDtf2d to convert from +** calendar date and time of day into 2-part quasi Julian Date, as +** it implements the leap-second-ambiguity convention just +** described. +** +** 4) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the +** future to be trusted. See eraDat for further details. +** +** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly +** one second at the end of each positive UTC leap second, +** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This +** practice is under review, and in the future UT1-UTC may grow +** essentially without limit. +** +** 6) The geographical coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the +** longitude required by the present function is east-positive +** (i.e. right-handed), in accordance with geographical convention. +** +** 7) The polar motion xp,yp can be obtained from IERS bulletins. The +** values are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions 2003), measured along the +** meridians 0 and 90 deg west respectively. For many +** applications, xp and yp can be set to zero. +** +** 8) If hm, the height above the ellipsoid of the observing station +** in meters, is not known but phpa, the pressure in hPa (=mB), is +** available, an adequate estimate of hm can be obtained from the +** expression +** +** hm = -29.3 * tsl * log ( phpa / 1013.25 ); +** +** where tsl is the approximate sea-level air temperature in K +** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section +** 52). Similarly, if the pressure phpa is not known, it can be +** estimated from the height of the observing station, hm, as +** follows: +** +** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) ); +** +** Note, however, that the refraction is nearly proportional to +** the pressure and that an accurate phpa value is important for +** precise work. +** +** 9) The argument wl specifies the observing wavelength in +** micrometers. The transition from optical to radio is assumed to +** occur at 100 micrometers (about 3000 GHz). +** +** 10) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted astrometric +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better +** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** Without refraction, the complementary functions eraAtio13 and +** eraAtoi13 are self-consistent to better than 1 microarcsecond +** all over the celestial sphere. With refraction included, +** consistency falls off at high zenith distances, but is still +** better than 0.05 arcsec at 85 degrees. +** +** 12) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** Called: +** eraApio13 astrometry parameters, CIRS-observed, 2013 +** eraAtoiq quick observed to CIRS +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + eraASTROM astrom; + + +/* Star-independent astrometry parameters for CIRS->observed. */ + j = eraApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, + phpa, tc, rh, wl, &astrom); + +/* Abort if bad UTC. */ + if ( j < 0 ) return j; + +/* Transform observed to CIRS. */ + eraAtoiq(type, ob1, ob2, &astrom, ri, di); + +/* Return OK/warning status. */ + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/atoiq.c b/testbed/astropy__astropy/cextern/erfa/atoiq.c new file mode 100644 index 0000000000000000000000000000000000000000..a164bcfe3a5b5085817f88b945823a34ad7a85b6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/atoiq.c @@ -0,0 +1,260 @@ +#include "erfa.h" + +void eraAtoiq(const char *type, + double ob1, double ob2, eraASTROM *astrom, + double *ri, double *di) +/* +** - - - - - - - - - +** e r a A t o i q +** - - - - - - - - - +** +** Quick observed place to CIRS, given the star-independent astrometry +** parameters. +** +** Use of this function is appropriate when efficiency is important and +** where many star positions are all to be transformed for one date. +** The star-independent astrometry parameters can be obtained by +** calling eraApio[13] or eraApco[13]. +** +** Given: +** type char[] type of coordinates: "R", "H" or "A" (Note 1) +** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90) +** ob2 double observed ZD or Dec (radians) +** astrom eraASTROM* star-independent astrometry parameters: +** pmt double PM time interval (SSB, Julian years) +** eb double[3] SSB to observer (vector, au) +** eh double[3] Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** v double[3] barycentric observer velocity (vector, c) +** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor +** bpn double[3][3] bias-precession-nutation matrix +** along double longitude + s' (radians) +** xpl double polar motion xp wrt local meridian (radians) +** ypl double polar motion yp wrt local meridian (radians) +** sphi double sine of geodetic latitude +** cphi double cosine of geodetic latitude +** diurab double magnitude of diurnal aberration vector +** eral double "local" Earth rotation angle (radians) +** refa double refraction constant A (radians) +** refb double refraction constant B (radians) +** +** Returned: +** ri double* CIRS right ascension (CIO-based, radians) +** di double* CIRS declination (radians) +** +** Notes: +** +** 1) "Observed" Az,El means the position that would be seen by a +** perfect geodetically aligned theodolite. This is related to +** the observed HA,Dec via the standard rotation, using the geodetic +** latitude (corrected for polar motion), while the observed HA and +** RA are related simply through the Earth rotation angle and the +** site longitude. "Observed" RA,Dec or HA,Dec thus means the +** position that would be seen by a perfect equatorial with its +** polar axis aligned to the Earth's axis of rotation. By removing +** from the observed place the effects of atmospheric refraction and +** diurnal aberration, the CIRS RA,Dec is obtained. +** +** 2) Only the first character of the type argument is significant. +** "R" or "r" indicates that ob1 and ob2 are the observed right +** ascension and declination; "H" or "h" indicates that they are +** hour angle (west +ve) and declination; anything else ("A" or +** "a" is recommended) indicates that ob1 and ob2 are azimuth (north +** zero, east 90 deg) and zenith distance. (Zenith distance is used +** rather than altitude in order to reflect the fact that no +** allowance is made for depression of the horizon.) +** +** 3) The accuracy of the result is limited by the corrections for +** refraction, which use a simple A*tan(z) + B*tan^3(z) model. +** Providing the meteorological parameters are known accurately and +** there are no gross local effects, the predicted observed +** coordinates should be within 0.05 arcsec (optical) or 1 arcsec +** (radio) for a zenith distance of less than 70 degrees, better +** than 30 arcsec (optical or radio) at 85 degrees and better than +** 20 arcmin (optical) or 30 arcmin (radio) at the horizon. +** +** Without refraction, the complementary functions eraAtioq and +** eraAtoiq are self-consistent to better than 1 microarcsecond all +** over the celestial sphere. With refraction included, consistency +** falls off at high zenith distances, but is still better than +** 0.05 arcsec at 85 degrees. +** +** 4) It is advisable to take great care with units, as even unlikely +** values of the input parameters are accepted and processed in +** accordance with the models used. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraC2s p-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int c; + double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[3], + xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref, + zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda, + f, xhd, yhd, zhd, xpl, ypl, w, hma; + + +/* Coordinate type. */ + c = (int) type[0]; + +/* Coordinates. */ + c1 = ob1; + c2 = ob2; + +/* Sin, cos of latitude. */ + sphi = astrom->sphi; + cphi = astrom->cphi; + +/* Standardize coordinate type. */ + if ( c == 'r' || c == 'R' ) { + c = 'R'; + } else if ( c == 'h' || c == 'H' ) { + c = 'H'; + } else { + c = 'A'; + } + +/* If Az,ZD, convert to Cartesian (S=0,E=90). */ + if ( c == 'A' ) { + ce = sin(c2); + xaeo = - cos(c1) * ce; + yaeo = sin(c1) * ce; + zaeo = cos(c2); + + } else { + + /* If RA,Dec, convert to HA,Dec. */ + if ( c == 'R' ) c1 = astrom->eral - c1; + + /* To Cartesian -HA,Dec. */ + eraS2c ( -c1, c2, v ); + xmhdo = v[0]; + ymhdo = v[1]; + zmhdo = v[2]; + + /* To Cartesian Az,El (S=0,E=90). */ + xaeo = sphi*xmhdo - cphi*zmhdo; + yaeo = ymhdo; + zaeo = cphi*xmhdo + sphi*zmhdo; + } + +/* Azimuth (S=0,E=90). */ + az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0; + +/* Sine of observed ZD, and observed ZD. */ + sz = sqrt ( xaeo*xaeo + yaeo*yaeo ); + zdo = atan2 ( sz, zaeo ); + +/* +** Refraction +** ---------- +*/ + +/* Fast algorithm using two constant model. */ + refa = astrom->refa; + refb = astrom->refb; + tz = sz / zaeo; + dref = ( refa + refb*tz*tz ) * tz; + zdt = zdo + dref; + +/* To Cartesian Az,ZD. */ + ce = sin(zdt); + xaet = cos(az) * ce; + yaet = sin(az) * ce; + zaet = cos(zdt); + +/* Cartesian Az,ZD to Cartesian -HA,Dec. */ + xmhda = sphi*xaet + cphi*zaet; + ymhda = yaet; + zmhda = - cphi*xaet + sphi*zaet; + +/* Diurnal aberration. */ + f = ( 1.0 + astrom->diurab*ymhda ); + xhd = f * xmhda; + yhd = f * ( ymhda - astrom->diurab ); + zhd = f * zmhda; + +/* Polar motion. */ + xpl = astrom->xpl; + ypl = astrom->ypl; + w = xpl*xhd - ypl*yhd + zhd; + v[0] = xhd - xpl*w; + v[1] = yhd + ypl*w; + v[2] = w - ( xpl*xpl + ypl*ypl ) * zhd; + +/* To spherical -HA,Dec. */ + eraC2s(v, &hma, di); + +/* Right ascension. */ + *ri = eraAnp(astrom->eral + hma); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/bi00.c b/testbed/astropy__astropy/cextern/erfa/bi00.c new file mode 100644 index 0000000000000000000000000000000000000000..5b569d21a1a290d3803da4117e8db658a5df0399 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/bi00.c @@ -0,0 +1,125 @@ +#include "erfa.h" + +void eraBi00(double *dpsibi, double *depsbi, double *dra) +/* +** - - - - - - - - +** e r a B i 0 0 +** - - - - - - - - +** +** Frame bias components of IAU 2000 precession-nutation models (part +** of MHB2000 with additions). +** +** Returned: +** dpsibi,depsbi double longitude and obliquity corrections +** dra double the ICRS RA of the J2000.0 mean equinox +** +** Notes: +** +** 1) The frame bias corrections in longitude and obliquity (radians) +** are required in order to correct for the offset between the GCRS +** pole and the mean J2000.0 pole. They define, with respect to the +** GCRS frame, a J2000.0 mean pole that is consistent with the rest +** of the IAU 2000A precession-nutation model. +** +** 2) In addition to the displacement of the pole, the complete +** description of the frame bias requires also an offset in right +** ascension. This is not part of the IAU 2000A model, and is from +** Chapront et al. (2002). It is returned in radians. +** +** 3) This is a supplemented implementation of one aspect of the IAU +** 2000A nutation model, formally adopted by the IAU General +** Assembly in 2000, namely MHB2000 (Mathews et al. 2002). +** +** References: +** +** Chapront, J., Chapront-Touze, M. & Francou, G., Astron. +** Astrophys., 387, 700, 2002. +** +** Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation +** and precession New nutation series for nonrigid Earth and +** insights into the Earth's interior", J.Geophys.Res., 107, B4, +** 2002. The MHB2000 code itself was obtained on 9th September 2002 +** from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* The frame bias corrections in longitude and obliquity */ + const double DPBIAS = -0.041775 * ERFA_DAS2R, + DEBIAS = -0.0068192 * ERFA_DAS2R; + +/* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */ + const double DRA0 = -0.0146 * ERFA_DAS2R; + + +/* Return the results (which are fixed). */ + *dpsibi = DPBIAS; + *depsbi = DEBIAS; + *dra = DRA0; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/bp00.c b/testbed/astropy__astropy/cextern/erfa/bp00.c new file mode 100644 index 0000000000000000000000000000000000000000..ca405307eb06a984282bcf52b4ecc5d0a3ce913e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/bp00.c @@ -0,0 +1,181 @@ +#include "erfa.h" + +void eraBp00(double date1, double date2, + double rb[3][3], double rp[3][3], double rbp[3][3]) +/* +** - - - - - - - - +** e r a B p 0 0 +** - - - - - - - - +** +** Frame bias and precession, IAU 2000. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rb double[3][3] frame bias matrix (Note 2) +** rp double[3][3] precession matrix (Note 3) +** rbp double[3][3] bias-precession matrix (Note 4) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by +** applying frame bias. +** +** 3) The matrix rp transforms vectors from J2000.0 mean equator and +** equinox to mean equator and equinox of date by applying +** precession. +** +** 4) The matrix rbp transforms vectors from GCRS to mean equator and +** equinox of date by applying frame bias then precession. It is +** the product rp x rb. +** +** 5) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the order given. +** +** Called: +** eraBi00 frame bias components, IAU 2000 +** eraPr00 IAU 2000 precession adjustments +** eraIr initialize r-matrix to identity +** eraRx rotate around X-axis +** eraRy rotate around Y-axis +** eraRz rotate around Z-axis +** eraCr copy r-matrix +** eraRxr product of two r-matrices +** +** Reference: +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* J2000.0 obliquity (Lieske et al. 1977) */ + const double EPS0 = 84381.448 * ERFA_DAS2R; + + double t, dpsibi, depsbi, dra0, psia77, oma77, chia, + dpsipr, depspr, psia, oma, rbw[3][3]; + + +/* Interval between fundamental epoch J2000.0 and current date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Frame bias. */ + eraBi00(&dpsibi, &depsbi, &dra0); + +/* Precession angles (Lieske et al. 1977) */ + psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * ERFA_DAS2R; + oma77 = EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * ERFA_DAS2R; + chia = ( 10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * ERFA_DAS2R; + +/* Apply IAU 2000 precession corrections. */ + eraPr00(date1, date2, &dpsipr, &depspr); + psia = psia77 + dpsipr; + oma = oma77 + depspr; + +/* Frame bias matrix: GCRS to J2000.0. */ + eraIr(rbw); + eraRz(dra0, rbw); + eraRy(dpsibi*sin(EPS0), rbw); + eraRx(-depsbi, rbw); + eraCr(rbw, rb); + +/* Precession matrix: J2000.0 to mean of date. */ + eraIr(rp); + eraRx(EPS0, rp); + eraRz(-psia, rp); + eraRx(-oma, rp); + eraRz(chia, rp); + +/* Bias-precession matrix: GCRS to mean of date. */ + eraRxr(rp, rbw, rbp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/bp06.c b/testbed/astropy__astropy/cextern/erfa/bp06.c new file mode 100644 index 0000000000000000000000000000000000000000..5e00654ba104a84c54e347a9c9b989f902da44e5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/bp06.c @@ -0,0 +1,152 @@ +#include "erfa.h" + +void eraBp06(double date1, double date2, + double rb[3][3], double rp[3][3], double rbp[3][3]) +/* +** - - - - - - - - +** e r a B p 0 6 +** - - - - - - - - +** +** Frame bias and precession, IAU 2006. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rb double[3][3] frame bias matrix (Note 2) +** rp double[3][3] precession matrix (Note 3) +** rbp double[3][3] bias-precession matrix (Note 4) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by +** applying frame bias. +** +** 3) The matrix rp transforms vectors from mean J2000.0 to mean of +** date by applying precession. +** +** 4) The matrix rbp transforms vectors from GCRS to mean of date by +** applying frame bias then precession. It is the product rp x rb. +** +** 5) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the order given. +** +** Called: +** eraPfw06 bias-precession F-W angles, IAU 2006 +** eraFw2m F-W angles to r-matrix +** eraPmat06 PB matrix, IAU 2006 +** eraTr transpose r-matrix +** eraRxr product of two r-matrices +** eraCr copy r-matrix +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gamb, phib, psib, epsa, rbpw[3][3], rbt[3][3]; + + +/* B matrix. */ + eraPfw06(ERFA_DJM0, ERFA_DJM00, &gamb, &phib, &psib, &epsa); + eraFw2m(gamb, phib, psib, epsa, rb); + +/* PxB matrix (temporary). */ + eraPmat06(date1, date2, rbpw); + +/* P matrix. */ + eraTr(rb, rbt); + eraRxr(rbpw, rbt, rp); + +/* PxB matrix. */ + eraCr(rbpw, rbp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/bpn2xy.c b/testbed/astropy__astropy/cextern/erfa/bpn2xy.c new file mode 100644 index 0000000000000000000000000000000000000000..8e61532dedd90e641f00210b0e03713fe9199775 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/bpn2xy.c @@ -0,0 +1,109 @@ +#include "erfa.h" + +void eraBpn2xy(double rbpn[3][3], double *x, double *y) +/* +** - - - - - - - - - - +** e r a B p n 2 x y +** - - - - - - - - - - +** +** Extract from the bias-precession-nutation matrix the X,Y coordinates +** of the Celestial Intermediate Pole. +** +** Given: +** rbpn double[3][3] celestial-to-true matrix (Note 1) +** +** Returned: +** x,y double Celestial Intermediate Pole (Note 2) +** +** Notes: +** +** 1) The matrix rbpn transforms vectors from GCRS to true equator (and +** CIO or equinox) of date, and therefore the Celestial Intermediate +** Pole unit vector is the bottom row of the matrix. +** +** 2) The arguments x,y are components of the Celestial Intermediate +** Pole unit vector in the Geocentric Celestial Reference System. +** +** Reference: +** +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 +** (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Extract the X,Y coordinates. */ + *x = rbpn[2][0]; + *y = rbpn[2][1]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2i00a.c b/testbed/astropy__astropy/cextern/erfa/c2i00a.c new file mode 100644 index 0000000000000000000000000000000000000000..cad305bd6ea07b59c798c1451386da893be2977c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2i00a.c @@ -0,0 +1,148 @@ +#include "erfa.h" + +void eraC2i00a(double date1, double date2, double rc2i[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 i 0 0 a +** - - - - - - - - - - +** +** Form the celestial-to-intermediate matrix for a given date using the +** IAU 2000A precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** 3) A faster, but slightly less accurate result (about 1 mas), can be +** obtained by using instead the eraC2i00b function. +** +** Called: +** eraPnm00a classical NPB matrix, IAU 2000A +** eraC2ibpn celestial-to-intermediate matrix, given NPB matrix +** +** References: +** +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 +** (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3]; + + +/* Obtain the celestial-to-true matrix (IAU 2000A). */ + eraPnm00a(date1, date2, rbpn); + +/* Form the celestial-to-intermediate matrix. */ + eraC2ibpn(date1, date2, rbpn, rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2i00b.c b/testbed/astropy__astropy/cextern/erfa/c2i00b.c new file mode 100644 index 0000000000000000000000000000000000000000..affd25e27e769eaf06da104289296d057bcb7cc5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2i00b.c @@ -0,0 +1,148 @@ +#include "erfa.h" + +void eraC2i00b(double date1, double date2, double rc2i[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 i 0 0 b +** - - - - - - - - - - +** +** Form the celestial-to-intermediate matrix for a given date using the +** IAU 2000B precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** 3) The present function is faster, but slightly less accurate (about +** 1 mas), than the eraC2i00a function. +** +** Called: +** eraPnm00b classical NPB matrix, IAU 2000B +** eraC2ibpn celestial-to-intermediate matrix, given NPB matrix +** +** References: +** +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 +** (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3]; + + +/* Obtain the celestial-to-true matrix (IAU 2000B). */ + eraPnm00b(date1, date2, rbpn); + +/* Form the celestial-to-intermediate matrix. */ + eraC2ibpn(date1, date2, rbpn, rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2i06a.c b/testbed/astropy__astropy/cextern/erfa/c2i06a.c new file mode 100644 index 0000000000000000000000000000000000000000..6aaf1cfc676ced1e7ce78d3e0ba1fad6f42cb0d9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2i06a.c @@ -0,0 +1,145 @@ +#include "erfa.h" + +void eraC2i06a(double date1, double date2, double rc2i[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 i 0 6 a +** - - - - - - - - - - +** +** Form the celestial-to-intermediate matrix for a given date using the +** IAU 2006 precession and IAU 2000A nutation models. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = RC2T * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** Called: +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** eraC2ixys celestial-to-intermediate matrix, given X,Y and s +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3], x, y, s; + + +/* Obtain the celestial-to-true matrix (IAU 2006/2000A). */ + eraPnm06a(date1, date2, rbpn); + +/* Extract the X,Y coordinates. */ + eraBpn2xy(rbpn, &x, &y); + +/* Obtain the CIO locator. */ + s = eraS06(date1, date2, x, y); + +/* Form the celestial-to-intermediate matrix. */ + eraC2ixys(x, y, s, rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2ibpn.c b/testbed/astropy__astropy/cextern/erfa/c2ibpn.c new file mode 100644 index 0000000000000000000000000000000000000000..e7197b99d590b799572e7aeadfb1e5ea92222dcc --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2ibpn.c @@ -0,0 +1,151 @@ +#include "erfa.h" + +void eraC2ibpn(double date1, double date2, double rbpn[3][3], + double rc2i[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 i b p n +** - - - - - - - - - - +** +** Form the celestial-to-intermediate matrix for a given date given +** the bias-precession-nutation matrix. IAU 2000. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** rbpn double[3][3] celestial-to-true matrix (Note 2) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 3) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix rbpn transforms vectors from GCRS to true equator (and +** CIO or equinox) of date. Only the CIP (bottom row) is used. +** +** 3) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = RC2T * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** 4) Although its name does not include "00", This function is in fact +** specific to the IAU 2000 models. +** +** Called: +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraC2ixy celestial-to-intermediate matrix, given X,Y +** +** References: +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y; + + +/* Extract the X,Y coordinates. */ + eraBpn2xy(rbpn, &x, &y); + +/* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */ + eraC2ixy(date1, date2, x, y, rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2ixy.c b/testbed/astropy__astropy/cextern/erfa/c2ixy.c new file mode 100644 index 0000000000000000000000000000000000000000..eb0b8aef9ef2165f1d7eb66907514c95bce0c56f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2ixy.c @@ -0,0 +1,140 @@ +#include "erfa.h" + +void eraC2ixy(double date1, double date2, double x, double y, + double rc2i[3][3]) +/* +** - - - - - - - - - +** e r a C 2 i x y +** - - - - - - - - - +** +** Form the celestial to intermediate-frame-of-date matrix for a given +** date when the CIP X,Y coordinates are known. IAU 2000. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** x,y double Celestial Intermediate Pole (Note 2) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 3) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The Celestial Intermediate Pole coordinates are the x,y components +** of the unit vector in the Geocentric Celestial Reference System. +** +** 3) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = RC2T * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** 4) Although its name does not include "00", This function is in fact +** specific to the IAU 2000 models. +** +** Called: +** eraC2ixys celestial-to-intermediate matrix, given X,Y and s +** eraS00 the CIO locator s, given X,Y, IAU 2000A +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ + +{ +/* Compute s and then the matrix. */ + eraC2ixys(x, y, eraS00(date1, date2, x, y), rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2ixys.c b/testbed/astropy__astropy/cextern/erfa/c2ixys.c new file mode 100644 index 0000000000000000000000000000000000000000..c8ed05ee3dbf8e001359356645c958967802fd20 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2ixys.c @@ -0,0 +1,132 @@ +#include "erfa.h" + +void eraC2ixys(double x, double y, double s, double rc2i[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 i x y s +** - - - - - - - - - - +** +** Form the celestial to intermediate-frame-of-date matrix given the CIP +** X,Y and the CIO locator s. +** +** Given: +** x,y double Celestial Intermediate Pole (Note 1) +** s double the CIO locator s (Note 2) +** +** Returned: +** rc2i double[3][3] celestial-to-intermediate matrix (Note 3) +** +** Notes: +** +** 1) The Celestial Intermediate Pole coordinates are the x,y +** components of the unit vector in the Geocentric Celestial +** Reference System. +** +** 2) The CIO locator s (in radians) positions the Celestial +** Intermediate Origin on the equator of the CIP. +** +** 3) The matrix rc2i is the first stage in the transformation from +** celestial to terrestrial coordinates: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = RC2T * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** Called: +** eraIr initialize r-matrix to identity +** eraRz rotate around Z-axis +** eraRy rotate around Y-axis +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r2, e, d; + + +/* Obtain the spherical angles E and d. */ + r2 = x*x + y*y; + e = (r2 > 0.0) ? atan2(y, x) : 0.0; + d = atan(sqrt(r2 / (1.0 - r2))); + +/* Form the matrix. */ + eraIr(rc2i); + eraRz(e, rc2i); + eraRy(d, rc2i); + eraRz(-(e+s), rc2i); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2s.c b/testbed/astropy__astropy/cextern/erfa/c2s.c new file mode 100644 index 0000000000000000000000000000000000000000..8242527e1864ce72f532172453970b1c6876bbaa --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2s.c @@ -0,0 +1,105 @@ +#include "erfa.h" + +void eraC2s(double p[3], double *theta, double *phi) +/* +** - - - - - - - +** e r a C 2 s +** - - - - - - - +** +** P-vector to spherical coordinates. +** +** Given: +** p double[3] p-vector +** +** Returned: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** +** Notes: +** +** 1) The vector p can have any magnitude; only its direction is used. +** +** 2) If p is null, zero theta and phi are returned. +** +** 3) At either pole, zero theta is returned. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y, z, d2; + + + x = p[0]; + y = p[1]; + z = p[2]; + d2 = x*x + y*y; + + *theta = (d2 == 0.0) ? 0.0 : atan2(y, x); + *phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2)); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2t00a.c b/testbed/astropy__astropy/cextern/erfa/c2t00a.c new file mode 100644 index 0000000000000000000000000000000000000000..385cf4ed7c9af7fda1bf0b4fa5313352873b66b6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2t00a.c @@ -0,0 +1,163 @@ +#include "erfa.h" + +void eraC2t00a(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 t 0 0 a +** - - - - - - - - - - +** +** Form the celestial to terrestrial matrix given the date, the UT1 and +** the polar motion, using the IAU 2000A nutation model. +** +** Given: +** tta,ttb double TT as a 2-part Julian Date (Note 1) +** uta,utb double UT1 as a 2-part Julian Date (Note 1) +** xp,yp double coordinates of the pole (radians, Note 2) +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) +** +** Notes: +** +** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, +** apportioned in any convenient way between the arguments uta and +** utb. For example, JD(UT1)=2450123.7 could be expressed in any of +** these ways, among others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. In the case of uta,utb, the +** date & time method is best matched to the Earth rotation angle +** algorithm used: maximum precision is delivered when the uta +** argument is for 0hrs UT1 on the day in question and the utb +** argument lies in the range 0 to 1, or vice versa. +** +** 2) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 3) The matrix rc2t transforms from celestial to terrestrial +** coordinates: +** +** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), RC2I is the +** celestial-to-intermediate matrix, ERA is the Earth rotation +** angle and RPOM is the polar motion matrix. +** +** 4) A faster, but slightly less accurate result (about 1 mas), can +** be obtained by using instead the eraC2t00b function. +** +** Called: +** eraC2i00a celestial-to-intermediate matrix, IAU 2000A +** eraEra00 Earth rotation angle, IAU 2000 +** eraSp00 the TIO locator s', IERS 2000 +** eraPom00 polar motion matrix +** eraC2tcio form CIO-based celestial-to-terrestrial matrix +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rc2i[3][3], era, sp, rpom[3][3]; + + +/* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */ + eraC2i00a(tta, ttb, rc2i ); + +/* Predict the Earth rotation angle for this UT1. */ + era = eraEra00(uta, utb); + +/* Estimate s'. */ + sp = eraSp00(tta, ttb); + +/* Form the polar motion matrix. */ + eraPom00(xp, yp, sp, rpom); + +/* Combine to form the celestial-to-terrestrial matrix. */ + eraC2tcio(rc2i, era, rpom, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2t00b.c b/testbed/astropy__astropy/cextern/erfa/c2t00b.c new file mode 100644 index 0000000000000000000000000000000000000000..e46f516f59f93eb699938f4906e252654071025a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2t00b.c @@ -0,0 +1,159 @@ +#include "erfa.h" + +void eraC2t00b(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 t 0 0 b +** - - - - - - - - - - +** +** Form the celestial to terrestrial matrix given the date, the UT1 and +** the polar motion, using the IAU 2000B nutation model. +** +** Given: +** tta,ttb double TT as a 2-part Julian Date (Note 1) +** uta,utb double UT1 as a 2-part Julian Date (Note 1) +** xp,yp double coordinates of the pole (radians, Note 2) +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) +** +** Notes: +** +** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, +** apportioned in any convenient way between the arguments uta and +** utb. For example, JD(UT1)=2450123.7 could be expressed in any of +** these ways, among others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. In the case of uta,utb, the +** date & time method is best matched to the Earth rotation angle +** algorithm used: maximum precision is delivered when the uta +** argument is for 0hrs UT1 on the day in question and the utb +** argument lies in the range 0 to 1, or vice versa. +** +** 2) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 3) The matrix rc2t transforms from celestial to terrestrial +** coordinates: +** +** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), RC2I is the +** celestial-to-intermediate matrix, ERA is the Earth rotation +** angle and RPOM is the polar motion matrix. +** +** 4) The present function is faster, but slightly less accurate (about +** 1 mas), than the eraC2t00a function. +** +** Called: +** eraC2i00b celestial-to-intermediate matrix, IAU 2000B +** eraEra00 Earth rotation angle, IAU 2000 +** eraPom00 polar motion matrix +** eraC2tcio form CIO-based celestial-to-terrestrial matrix +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rc2i[3][3], era, rpom[3][3]; + + +/* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */ + eraC2i00b(tta, ttb, rc2i); + +/* Predict the Earth rotation angle for this UT1. */ + era = eraEra00(uta, utb); + +/* Form the polar motion matrix (neglecting s'). */ + eraPom00(xp, yp, 0.0, rpom); + +/* Combine to form the celestial-to-terrestrial matrix. */ + eraC2tcio(rc2i, era, rpom, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2t06a.c b/testbed/astropy__astropy/cextern/erfa/c2t06a.c new file mode 100644 index 0000000000000000000000000000000000000000..738209666ae5a9b379025595d2124f20305f8efb --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2t06a.c @@ -0,0 +1,161 @@ +#include "erfa.h" + +void eraC2t06a(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 t 0 6 a +** - - - - - - - - - - +** +** Form the celestial to terrestrial matrix given the date, the UT1 and +** the polar motion, using the IAU 2006 precession and IAU 2000A +** nutation models. +** +** Given: +** tta,ttb double TT as a 2-part Julian Date (Note 1) +** uta,utb double UT1 as a 2-part Julian Date (Note 1) +** xp,yp double coordinates of the pole (radians, Note 2) +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3) +** +** Notes: +** +** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, +** apportioned in any convenient way between the arguments uta and +** utb. For example, JD(UT1)=2450123.7 could be expressed in any of +** these ways, among others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. In the case of uta,utb, the +** date & time method is best matched to the Earth rotation angle +** algorithm used: maximum precision is delivered when the uta +** argument is for 0hrs UT1 on the day in question and the utb +** argument lies in the range 0 to 1, or vice versa. +** +** 2) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 3) The matrix rc2t transforms from celestial to terrestrial +** coordinates: +** +** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), RC2I is the +** celestial-to-intermediate matrix, ERA is the Earth rotation +** angle and RPOM is the polar motion matrix. +** +** Called: +** eraC2i06a celestial-to-intermediate matrix, IAU 2006/2000A +** eraEra00 Earth rotation angle, IAU 2000 +** eraSp00 the TIO locator s', IERS 2000 +** eraPom00 polar motion matrix +** eraC2tcio form CIO-based celestial-to-terrestrial matrix +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rc2i[3][3], era, sp, rpom[3][3]; + + +/* Form the celestial-to-intermediate matrix for this TT. */ + eraC2i06a(tta, ttb, rc2i); + +/* Predict the Earth rotation angle for this UT1. */ + era = eraEra00(uta, utb); + +/* Estimate s'. */ + sp = eraSp00(tta, ttb); + +/* Form the polar motion matrix. */ + eraPom00(xp, yp, sp, rpom); + +/* Combine to form the celestial-to-terrestrial matrix. */ + eraC2tcio(rc2i, era, rpom, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2tcio.c b/testbed/astropy__astropy/cextern/erfa/c2tcio.c new file mode 100644 index 0000000000000000000000000000000000000000..8294148ed0e12fca637b31c497c8425a0dc24f75 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2tcio.c @@ -0,0 +1,131 @@ +#include "erfa.h" + +void eraC2tcio(double rc2i[3][3], double era, double rpom[3][3], + double rc2t[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 t c i o +** - - - - - - - - - - +** +** Assemble the celestial to terrestrial matrix from CIO-based +** components (the celestial-to-intermediate matrix, the Earth Rotation +** Angle and the polar motion matrix). +** +** Given: +** rc2i double[3][3] celestial-to-intermediate matrix +** era double Earth rotation angle (radians) +** rpom double[3][3] polar-motion matrix +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix +** +** Notes: +** +** 1) This function constructs the rotation matrix that transforms +** vectors in the celestial system into vectors in the terrestrial +** system. It does so starting from precomputed components, namely +** the matrix which rotates from celestial coordinates to the +** intermediate frame, the Earth rotation angle and the polar motion +** matrix. One use of the present function is when generating a +** series of celestial-to-terrestrial matrices where only the Earth +** Rotation Angle changes, avoiding the considerable overhead of +** recomputing the precession-nutation more often than necessary to +** achieve given accuracy objectives. +** +** 2) The relationship between the arguments is as follows: +** +** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003). +** +** Called: +** eraCr copy r-matrix +** eraRz rotate around Z-axis +** eraRxr product of two r-matrices +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r[3][3]; + + +/* Construct the matrix. */ + eraCr(rc2i, r); + eraRz(era, r); + eraRxr(rpom, r, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2teqx.c b/testbed/astropy__astropy/cextern/erfa/c2teqx.c new file mode 100644 index 0000000000000000000000000000000000000000..63d9000c8bd406f83889943ab77ed82bc0777650 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2teqx.c @@ -0,0 +1,131 @@ +#include "erfa.h" + +void eraC2teqx(double rbpn[3][3], double gst, double rpom[3][3], + double rc2t[3][3]) +/* +** - - - - - - - - - - +** e r a C 2 t e q x +** - - - - - - - - - - +** +** Assemble the celestial to terrestrial matrix from equinox-based +** components (the celestial-to-true matrix, the Greenwich Apparent +** Sidereal Time and the polar motion matrix). +** +** Given: +** rbpn double[3][3] celestial-to-true matrix +** gst double Greenwich (apparent) Sidereal Time (radians) +** rpom double[3][3] polar-motion matrix +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 2) +** +** Notes: +** +** 1) This function constructs the rotation matrix that transforms +** vectors in the celestial system into vectors in the terrestrial +** system. It does so starting from precomputed components, namely +** the matrix which rotates from celestial coordinates to the +** true equator and equinox of date, the Greenwich Apparent Sidereal +** Time and the polar motion matrix. One use of the present function +** is when generating a series of celestial-to-terrestrial matrices +** where only the Sidereal Time changes, avoiding the considerable +** overhead of recomputing the precession-nutation more often than +** necessary to achieve given accuracy objectives. +** +** 2) The relationship between the arguments is as follows: +** +** [TRS] = rpom * R_3(gst) * rbpn * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003). +** +** Called: +** eraCr copy r-matrix +** eraRz rotate around Z-axis +** eraRxr product of two r-matrices +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r[3][3]; + + +/* Construct the matrix. */ + eraCr(rbpn, r); + eraRz(gst, r); + eraRxr(rpom, r, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2tpe.c b/testbed/astropy__astropy/cextern/erfa/c2tpe.c new file mode 100644 index 0000000000000000000000000000000000000000..16e247551809aba8cb63f8a0abfdeda3164da16c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2tpe.c @@ -0,0 +1,176 @@ +#include "erfa.h" + +void eraC2tpe(double tta, double ttb, double uta, double utb, + double dpsi, double deps, double xp, double yp, + double rc2t[3][3]) +/* +** - - - - - - - - - +** e r a C 2 t p e +** - - - - - - - - - +** +** Form the celestial to terrestrial matrix given the date, the UT1, +** the nutation and the polar motion. IAU 2000. +** +** Given: +** tta,ttb double TT as a 2-part Julian Date (Note 1) +** uta,utb double UT1 as a 2-part Julian Date (Note 1) +** dpsi,deps double nutation (Note 2) +** xp,yp double coordinates of the pole (radians, Note 3) +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 4) +** +** Notes: +** +** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, +** apportioned in any convenient way between the arguments uta and +** utb. For example, JD(UT1)=2450123.7 could be expressed in any of +** these ways, among others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. In the case of uta,utb, the +** date & time method is best matched to the Earth rotation angle +** algorithm used: maximum precision is delivered when the uta +** argument is for 0hrs UT1 on the day in question and the utb +** argument lies in the range 0 to 1, or vice versa. +** +** 2) The caller is responsible for providing the nutation components; +** they are in longitude and obliquity, in radians and are with +** respect to the equinox and ecliptic of date. For high-accuracy +** applications, free core nutation should be included as well as +** any other relevant corrections to the position of the CIP. +** +** 3) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 4) The matrix rc2t transforms from celestial to terrestrial +** coordinates: +** +** [TRS] = RPOM * R_3(GST) * RBPN * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), RBPN is the +** bias-precession-nutation matrix, GST is the Greenwich (apparent) +** Sidereal Time and RPOM is the polar motion matrix. +** +** 5) Although its name does not include "00", This function is in fact +** specific to the IAU 2000 models. +** +** Called: +** eraPn00 bias/precession/nutation results, IAU 2000 +** eraGmst00 Greenwich mean sidereal time, IAU 2000 +** eraSp00 the TIO locator s', IERS 2000 +** eraEe00 equation of the equinoxes, IAU 2000 +** eraPom00 polar motion matrix +** eraC2teqx form equinox-based celestial-to-terrestrial matrix +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3], + rbpn[3][3], gmst, ee, sp, rpom[3][3]; + + +/* Form the celestial-to-true matrix for this TT. */ + eraPn00(tta, ttb, dpsi, deps, &epsa, rb, rp, rbp, rn, rbpn); + +/* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */ + gmst = eraGmst00(uta, utb, tta, ttb); + +/* Predict the equation of the equinoxes given TT and nutation. */ + ee = eraEe00(tta, ttb, epsa, dpsi); + +/* Estimate s'. */ + sp = eraSp00(tta, ttb); + +/* Form the polar motion matrix. */ + eraPom00(xp, yp, sp, rpom); + +/* Combine to form the celestial-to-terrestrial matrix. */ + eraC2teqx(rbpn, gmst + ee, rpom, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/c2txy.c b/testbed/astropy__astropy/cextern/erfa/c2txy.c new file mode 100644 index 0000000000000000000000000000000000000000..ee73f6204884aa96a7f241d968005a32307d0591 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/c2txy.c @@ -0,0 +1,168 @@ +#include "erfa.h" + +void eraC2txy(double tta, double ttb, double uta, double utb, + double x, double y, double xp, double yp, + double rc2t[3][3]) +/* +** - - - - - - - - - +** e r a C 2 t x y +** - - - - - - - - - +** +** Form the celestial to terrestrial matrix given the date, the UT1, +** the CIP coordinates and the polar motion. IAU 2000. +** +** Given: +** tta,ttb double TT as a 2-part Julian Date (Note 1) +** uta,utb double UT1 as a 2-part Julian Date (Note 1) +** x,y double Celestial Intermediate Pole (Note 2) +** xp,yp double coordinates of the pole (radians, Note 3) +** +** Returned: +** rc2t double[3][3] celestial-to-terrestrial matrix (Note 4) +** +** Notes: +** +** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates, +** apportioned in any convenient way between the arguments uta and +** utb. For example, JD(UT1)=2450123.7 could be expressed in any o +** these ways, among others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. In the case of uta,utb, the +** date & time method is best matched to the Earth rotation angle +** algorithm used: maximum precision is delivered when the uta +** argument is for 0hrs UT1 on the day in question and the utb +** argument lies in the range 0 to 1, or vice versa. +** +** 2) The Celestial Intermediate Pole coordinates are the x,y +** components of the unit vector in the Geocentric Celestial +** Reference System. +** +** 3) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 4) The matrix rc2t transforms from celestial to terrestrial +** coordinates: +** +** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS] +** +** = rc2t * [CRS] +** +** where [CRS] is a vector in the Geocentric Celestial Reference +** System and [TRS] is a vector in the International Terrestrial +** Reference System (see IERS Conventions 2003), ERA is the Earth +** Rotation Angle and RPOM is the polar motion matrix. +** +** 5) Although its name does not include "00", This function is in fact +** specific to the IAU 2000 models. +** +** Called: +** eraC2ixy celestial-to-intermediate matrix, given X,Y +** eraEra00 Earth rotation angle, IAU 2000 +** eraSp00 the TIO locator s', IERS 2000 +** eraPom00 polar motion matrix +** eraC2tcio form CIO-based celestial-to-terrestrial matrix +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rc2i[3][3], era, sp, rpom[3][3]; + + +/* Form the celestial-to-intermediate matrix for this TT. */ + eraC2ixy(tta, ttb, x, y, rc2i); + +/* Predict the Earth rotation angle for this UT1. */ + era = eraEra00(uta, utb); + +/* Estimate s'. */ + sp = eraSp00(tta, ttb); + +/* Form the polar motion matrix. */ + eraPom00(xp, yp, sp, rpom); + +/* Combine to form the celestial-to-terrestrial matrix. */ + eraC2tcio(rc2i, era, rpom, rc2t); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/cal2jd.c b/testbed/astropy__astropy/cextern/erfa/cal2jd.c new file mode 100644 index 0000000000000000000000000000000000000000..7454739a08f603d98def73124b247e4c9d6a8585 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/cal2jd.c @@ -0,0 +1,148 @@ +#include "erfa.h" + +int eraCal2jd(int iy, int im, int id, double *djm0, double *djm) +/* +** - - - - - - - - - - +** e r a C a l 2 j d +** - - - - - - - - - - +** +** Gregorian Calendar to Julian Date. +** +** Given: +** iy,im,id int year, month, day in Gregorian calendar (Note 1) +** +** Returned: +** djm0 double MJD zero-point: always 2400000.5 +** djm double Modified Julian Date for 0 hrs +** +** Returned (function value): +** int status: +** 0 = OK +** -1 = bad year (Note 3: JD not computed) +** -2 = bad month (JD not computed) +** -3 = bad day (JD computed) +** +** Notes: +** +** 1) The algorithm used is valid from -4800 March 1, but this +** implementation rejects dates before -4799 January 1. +** +** 2) The Julian Date is returned in two pieces, in the usual ERFA +** manner, which is designed to preserve time resolution. The +** Julian Date is available as a single number by adding djm0 and +** djm. +** +** 3) In early eras the conversion is from the "Proleptic Gregorian +** Calendar"; no account is taken of the date(s) of adoption of +** the Gregorian Calendar, nor is the AD/BC numbering convention +** observed. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 12.92 (p604). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j, ly, my; + long iypmy; + +/* Earliest year allowed (4800BC) */ + const int IYMIN = -4799; + +/* Month lengths in days */ + static const int mtab[] + = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + + +/* Preset status. */ + j = 0; + +/* Validate year and month. */ + if (iy < IYMIN) return -1; + if (im < 1 || im > 12) return -2; + +/* If February in a leap year, 1, otherwise 0. */ + ly = ((im == 2) && !(iy%4) && (iy%100 || !(iy%400))); + +/* Validate day, taking into account leap years. */ + if ( (id < 1) || (id > (mtab[im-1] + ly))) j = -3; + +/* Return result. */ + my = (im - 14) / 12; + iypmy = (long) (iy + my); + *djm0 = ERFA_DJM0; + *djm = (double)((1461L * (iypmy + 4800L)) / 4L + + (367L * (long) (im - 2 - 12 * my)) / 12L + - (3L * ((iypmy + 4900L) / 100L)) / 4L + + (long) id - 2432076L); + +/* Return status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/cp.c b/testbed/astropy__astropy/cextern/erfa/cp.c new file mode 100644 index 0000000000000000000000000000000000000000..7c12453ecb3a861005ab9ee589e7cff5f7049eef --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/cp.c @@ -0,0 +1,89 @@ +#include "erfa.h" + +void eraCp(double p[3], double c[3]) +/* +** - - - - - - +** e r a C p +** - - - - - - +** +** Copy a p-vector. +** +** Given: +** p double[3] p-vector to be copied +** +** Returned: +** c double[3] copy +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + c[0] = p[0]; + c[1] = p[1]; + c[2] = p[2]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/cpv.c b/testbed/astropy__astropy/cextern/erfa/cpv.c new file mode 100644 index 0000000000000000000000000000000000000000..861526142c6d050a9b5e6fb60d2a4d12d48452d5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/cpv.c @@ -0,0 +1,91 @@ +#include "erfa.h" + +void eraCpv(double pv[2][3], double c[2][3]) +/* +** - - - - - - - +** e r a C p v +** - - - - - - - +** +** Copy a position/velocity vector. +** +** Given: +** pv double[2][3] position/velocity vector to be copied +** +** Returned: +** c double[2][3] copy +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(pv[0], c[0]); + eraCp(pv[1], c[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/cr.c b/testbed/astropy__astropy/cextern/erfa/cr.c new file mode 100644 index 0000000000000000000000000000000000000000..e39e5ee300513bfb2d5488ffb6c8caf2010ac673 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/cr.c @@ -0,0 +1,92 @@ +#include "erfa.h" + +void eraCr(double r[3][3], double c[3][3]) +/* +** - - - - - - +** e r a C r +** - - - - - - +** +** Copy an r-matrix. +** +** Given: +** r double[3][3] r-matrix to be copied +** +** Returned: +** c double[3][3] copy +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(r[0], c[0]); + eraCp(r[1], c[1]); + eraCp(r[2], c[2]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/d2dtf.c b/testbed/astropy__astropy/cextern/erfa/d2dtf.c new file mode 100644 index 0000000000000000000000000000000000000000..406084938e0322cf431f64172909b318d1860203 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/d2dtf.c @@ -0,0 +1,245 @@ +#include "erfa.h" +#include + +int eraD2dtf(const char *scale, int ndp, double d1, double d2, + int *iy, int *im, int *id, int ihmsf[4]) +/* +** - - - - - - - - - +** e r a D 2 d t f +** - - - - - - - - - +** +** Format for output a 2-part Julian Date (or in the case of UTC a +** quasi-JD form that includes special provision for leap seconds). +** +** Given: +** scale char[] time scale ID (Note 1) +** ndp int resolution (Note 2) +** d1,d2 double time as a 2-part Julian Date (Notes 3,4) +** +** Returned: +** iy,im,id int year, month, day in Gregorian calendar (Note 5) +** ihmsf int[4] hours, minutes, seconds, fraction (Note 1) +** +** Returned (function value): +** int status: +1 = dubious year (Note 5) +** 0 = OK +** -1 = unacceptable date (Note 6) +** +** Notes: +** +** 1) scale identifies the time scale. Only the value "UTC" (in upper +** case) is significant, and enables handling of leap seconds (see +** Note 4). +** +** 2) ndp is the number of decimal places in the seconds field, and can +** have negative as well as positive values, such as: +** +** ndp resolution +** -4 1 00 00 +** -3 0 10 00 +** -2 0 01 00 +** -1 0 00 10 +** 0 0 00 01 +** 1 0 00 00.1 +** 2 0 00 00.01 +** 3 0 00 00.001 +** +** The limits are platform dependent, but a safe range is -5 to +9. +** +** 3) d1+d2 is Julian Date, apportioned in any convenient way between +** the two arguments, for example where d1 is the Julian Day Number +** and d2 is the fraction of a day. In the case of UTC, where the +** use of JD is problematical, special conventions apply: see the +** next note. +** +** 4) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The ERFA internal convention is that +** the quasi-JD day represents UTC days whether the length is 86399, +** 86400 or 86401 SI seconds. In the 1960-1972 era there were +** smaller jumps (in either direction) each time the linear UTC(TAI) +** expression was changed, and these "mini-leaps" are also included +** in the ERFA convention. +** +** 5) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** 6) For calendar conventions and limitations, see eraCal2jd. +** +** Called: +** eraJd2cal JD to Gregorian calendar +** eraD2tf decompose days to hms +** eraDat delta(AT) = TAI-UTC +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int leap; + char s; + int iy1, im1, id1, js, iy2, im2, id2, ihmsf1[4], i; + double a1, b1, fd, dat0, dat12, w, dat24, dleap; + + +/* The two-part JD. */ + a1 = d1; + b1 = d2; + +/* Provisional calendar date. */ + js = eraJd2cal(a1, b1, &iy1, &im1, &id1, &fd); + if ( js ) return -1; + +/* Is this a leap second day? */ + leap = 0; + if ( ! strcmp(scale,"UTC") ) { + + /* TAI-UTC at 0h today. */ + js = eraDat(iy1, im1, id1, 0.0, &dat0); + if ( js < 0 ) return -1; + + /* TAI-UTC at 12h today (to detect drift). */ + js = eraDat(iy1, im1, id1, 0.5, &dat12); + if ( js < 0 ) return -1; + + /* TAI-UTC at 0h tomorrow (to detect jumps). */ + js = eraJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w); + if ( js ) return -1; + js = eraDat(iy2, im2, id2, 0.0, &dat24); + if ( js < 0 ) return -1; + + /* Any sudden change in TAI-UTC (seconds). */ + dleap = dat24 - (2.0*dat12 - dat0); + + /* If leap second day, scale the fraction of a day into SI. */ + leap = (dleap != 0.0); + if (leap) fd += fd * dleap/ERFA_DAYSEC; + } + +/* Provisional time of day. */ + eraD2tf ( ndp, fd, &s, ihmsf1 ); + +/* Has the (rounded) time gone past 24h? */ + if ( ihmsf1[0] > 23 ) { + + /* Yes. We probably need tomorrow's calendar date. */ + js = eraJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w); + if ( js ) return -1; + + /* Is today a leap second day? */ + if ( ! leap ) { + + /* No. Use 0h tomorrow. */ + iy1 = iy2; + im1 = im2; + id1 = id2; + ihmsf1[0] = 0; + ihmsf1[1] = 0; + ihmsf1[2] = 0; + + } else { + + /* Yes. Are we past the leap second itself? */ + if ( ihmsf1[2] > 0 ) { + + /* Yes. Use tomorrow but allow for the leap second. */ + iy1 = iy2; + im1 = im2; + id1 = id2; + ihmsf1[0] = 0; + ihmsf1[1] = 0; + ihmsf1[2] = 0; + + } else { + + /* No. Use 23 59 60... today. */ + ihmsf1[0] = 23; + ihmsf1[1] = 59; + ihmsf1[2] = 60; + } + + /* If rounding to 10s or coarser always go up to new day. */ + if ( ndp < 0 && ihmsf1[2] == 60 ) { + iy1 = iy2; + im1 = im2; + id1 = id2; + ihmsf1[0] = 0; + ihmsf1[1] = 0; + ihmsf1[2] = 0; + } + } + } + +/* Results. */ + *iy = iy1; + *im = im1; + *id = id1; + for ( i = 0; i < 4; i++ ) { + ihmsf[i] = ihmsf1[i]; + } + +/* Status. */ + return js; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/d2tf.c b/testbed/astropy__astropy/cextern/erfa/d2tf.c new file mode 100644 index 0000000000000000000000000000000000000000..f9c2af130cc92e6d5c51f51abacb8b1eac128ab6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/d2tf.c @@ -0,0 +1,169 @@ +#include "erfa.h" + +void eraD2tf(int ndp, double days, char *sign, int ihmsf[4]) +/* +** - - - - - - - - +** e r a D 2 t f +** - - - - - - - - +** +** Decompose days to hours, minutes, seconds, fraction. +** +** Given: +** ndp int resolution (Note 1) +** days double interval in days +** +** Returned: +** sign char '+' or '-' +** ihmsf int[4] hours, minutes, seconds, fraction +** +** Notes: +** +** 1) The argument ndp is interpreted as follows: +** +** ndp resolution +** : ...0000 00 00 +** -7 1000 00 00 +** -6 100 00 00 +** -5 10 00 00 +** -4 1 00 00 +** -3 0 10 00 +** -2 0 01 00 +** -1 0 00 10 +** 0 0 00 01 +** 1 0 00 00.1 +** 2 0 00 00.01 +** 3 0 00 00.001 +** : 0 00 00.000... +** +** 2) The largest positive useful value for ndp is determined by the +** size of days, the format of double on the target platform, and +** the risk of overflowing ihmsf[3]. On a typical platform, for +** days up to 1.0, the available floating-point precision might +** correspond to ndp=12. However, the practical limit is typically +** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is +** only 16 bits. +** +** 3) The absolute value of days may exceed 1.0. In cases where it +** does not, it is up to the caller to test for and handle the +** case where days is very nearly 1.0 and rounds up to 24 hours, +** by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int nrs, n; + double rs, rm, rh, a, w, ah, am, as, af; + + +/* Handle sign. */ + *sign = (char) ( ( days >= 0.0 ) ? '+' : '-' ); + +/* Interval in seconds. */ + a = ERFA_DAYSEC * fabs(days); + +/* Pre-round if resolution coarser than 1s (then pretend ndp=1). */ + if (ndp < 0) { + nrs = 1; + for (n = 1; n <= -ndp; n++) { + nrs *= (n == 2 || n == 4) ? 6 : 10; + } + rs = (double) nrs; + w = a / rs; + a = rs * ERFA_DNINT(w); + } + +/* Express the unit of each field in resolution units. */ + nrs = 1; + for (n = 1; n <= ndp; n++) { + nrs *= 10; + } + rs = (double) nrs; + rm = rs * 60.0; + rh = rm * 60.0; + +/* Round the interval and express in resolution units. */ + a = ERFA_DNINT(rs * a); + +/* Break into fields. */ + ah = a / rh; + ah = ERFA_DINT(ah); + a -= ah * rh; + am = a / rm; + am = ERFA_DINT(am); + a -= am * rm; + as = a / rs; + as = ERFA_DINT(as); + af = a - as * rs; + +/* Return results. */ + ihmsf[0] = (int) ah; + ihmsf[1] = (int) am; + ihmsf[2] = (int) as; + ihmsf[3] = (int) af; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/dat.c b/testbed/astropy__astropy/cextern/erfa/dat.c new file mode 100644 index 0000000000000000000000000000000000000000..a39c4b25151f59340bae7a710566041bccfd7aa0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/dat.c @@ -0,0 +1,306 @@ +#include "erfa.h" + +int eraDat(int iy, int im, int id, double fd, double *deltat ) +/* +** - - - - - - - +** e r a D a t +** - - - - - - - +** +** For a given UTC date, calculate delta(AT) = TAI-UTC. +** +** :------------------------------------------: +** : : +** : IMPORTANT : +** : : +** : A new version of this function must be : +** : produced whenever a new leap second is : +** : announced. There are four items to : +** : change on each such occasion: : +** : : +** : 1) A new line must be added to the set : +** : of statements that initialize the : +** : array "changes". : +** : : +** : 2) The constant IYV must be set to the : +** : current year. : +** : : +** : 3) The "Latest leap second" comment : +** : below must be set to the new leap : +** : second date. : +** : : +** : 4) The "This revision" comment, later, : +** : must be set to the current date. : +** : : +** : Change (2) must also be carried out : +** : whenever the function is re-issued, : +** : even if no leap seconds have been : +** : added. : +** : : +** : Latest leap second: 2016 December 31 : +** : : +** :__________________________________________: +** +** Given: +** iy int UTC: year (Notes 1 and 2) +** im int month (Note 2) +** id int day (Notes 2 and 3) +** fd double fraction of day (Note 4) +** +** Returned: +** deltat double TAI minus UTC, seconds +** +** Returned (function value): +** int status (Note 5): +** 1 = dubious year (Note 1) +** 0 = OK +** -1 = bad year +** -2 = bad month +** -3 = bad day (Note 3) +** -4 = bad fraction (Note 4) +** -5 = internal error (Note 5) +** +** Notes: +** +** 1) UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper +** to call the function with an earlier date. If this is attempted, +** zero is returned together with a warning status. +** +** Because leap seconds cannot, in principle, be predicted in +** advance, a reliable check for dates beyond the valid range is +** impossible. To guard against gross errors, a year five or more +** after the release year of the present function (see the constant +** IYV) is considered dubious. In this case a warning status is +** returned but the result is computed in the normal way. +** +** For both too-early and too-late years, the warning status is +1. +** This is distinct from the error status -1, which signifies a year +** so early that JD could not be computed. +** +** 2) If the specified date is for a day which ends with a leap second, +** the TAI-UTC value returned is for the period leading up to the +** leap second. If the date is for a day which begins as a leap +** second ends, the TAI-UTC returned is for the period following the +** leap second. +** +** 3) The day number must be in the normal calendar range, for example +** 1 through 30 for April. The "almanac" convention of allowing +** such dates as January 0 and December 32 is not supported in this +** function, in order to avoid confusion near leap seconds. +** +** 4) The fraction of day is used only for dates before the +** introduction of leap seconds, the first of which occurred at the +** end of 1971. It is tested for validity (0 to 1 is the valid +** range) even if not used; if invalid, zero is used and status -4 +** is returned. For many applications, setting fd to zero is +** acceptable; the resulting error is always less than 3 ms (and +** occurs only pre-1972). +** +** 5) The status value returned in the case where there are multiple +** errors refers to the first error detected. For example, if the +** month and day are 13 and 32 respectively, status -2 (bad month) +** will be returned. The "internal error" status refers to a +** case that is impossible but causes some compilers to issue a +** warning. +** +** 6) In cases where a valid result is not available, zero is returned. +** +** References: +** +** 1) For dates from 1961 January 1 onwards, the expressions from the +** file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used. +** +** 2) The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of +** the 1992 Explanatory Supplement. +** +** Called: +** eraCal2jd Gregorian calendar to JD +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Release year for this version of eraDat */ + enum { IYV = 2016}; + +/* Reference dates (MJD) and drift rates (s/day), pre leap seconds */ + static const double drift[][2] = { + { 37300.0, 0.0012960 }, + { 37300.0, 0.0012960 }, + { 37300.0, 0.0012960 }, + { 37665.0, 0.0011232 }, + { 37665.0, 0.0011232 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 38761.0, 0.0012960 }, + { 39126.0, 0.0025920 }, + { 39126.0, 0.0025920 } + }; + +/* Number of Delta(AT) expressions before leap seconds were introduced */ + enum { NERA1 = (int) (sizeof drift / sizeof (double) / 2) }; + +/* Dates and Delta(AT)s */ + static const struct { + int iyear, month; + double delat; + } changes[] = { + { 1960, 1, 1.4178180 }, + { 1961, 1, 1.4228180 }, + { 1961, 8, 1.3728180 }, + { 1962, 1, 1.8458580 }, + { 1963, 11, 1.9458580 }, + { 1964, 1, 3.2401300 }, + { 1964, 4, 3.3401300 }, + { 1964, 9, 3.4401300 }, + { 1965, 1, 3.5401300 }, + { 1965, 3, 3.6401300 }, + { 1965, 7, 3.7401300 }, + { 1965, 9, 3.8401300 }, + { 1966, 1, 4.3131700 }, + { 1968, 2, 4.2131700 }, + { 1972, 1, 10.0 }, + { 1972, 7, 11.0 }, + { 1973, 1, 12.0 }, + { 1974, 1, 13.0 }, + { 1975, 1, 14.0 }, + { 1976, 1, 15.0 }, + { 1977, 1, 16.0 }, + { 1978, 1, 17.0 }, + { 1979, 1, 18.0 }, + { 1980, 1, 19.0 }, + { 1981, 7, 20.0 }, + { 1982, 7, 21.0 }, + { 1983, 7, 22.0 }, + { 1985, 7, 23.0 }, + { 1988, 1, 24.0 }, + { 1990, 1, 25.0 }, + { 1991, 1, 26.0 }, + { 1992, 7, 27.0 }, + { 1993, 7, 28.0 }, + { 1994, 7, 29.0 }, + { 1996, 1, 30.0 }, + { 1997, 7, 31.0 }, + { 1999, 1, 32.0 }, + { 2006, 1, 33.0 }, + { 2009, 1, 34.0 }, + { 2012, 7, 35.0 }, + { 2015, 7, 36.0 }, + { 2017, 1, 37.0 } + }; + +/* Number of Delta(AT) changes */ + enum { NDAT = (int) (sizeof changes / sizeof changes[0]) }; + +/* Miscellaneous local variables */ + int j, i, m; + double da, djm0, djm; + + +/* Initialize the result to zero. */ + *deltat = da = 0.0; + +/* If invalid fraction of a day, set error status and give up. */ + if (fd < 0.0 || fd > 1.0) return -4; + +/* Convert the date into an MJD. */ + j = eraCal2jd(iy, im, id, &djm0, &djm); + +/* If invalid year, month, or day, give up. */ + if (j < 0) return j; + +/* If pre-UTC year, set warning status and give up. */ + if (iy < changes[0].iyear) return 1; + +/* If suspiciously late year, set warning status but proceed. */ + if (iy > IYV + 5) j = 1; + +/* Combine year and month to form a date-ordered integer... */ + m = 12*iy + im; + +/* ...and use it to find the preceding table entry. */ + for (i = NDAT-1; i >=0; i--) { + if (m >= (12 * changes[i].iyear + changes[i].month)) break; + } + +/* Prevent underflow warnings. */ + if (i < 0) return -5; + +/* Get the Delta(AT). */ + da = changes[i].delat; + +/* If pre-1972, adjust for drift. */ + if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1]; + +/* Return the Delta(AT) value. */ + *deltat = da; + +/* Return the status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/dtdb.c b/testbed/astropy__astropy/cextern/erfa/dtdb.c new file mode 100644 index 0000000000000000000000000000000000000000..ead08a6fb2aba74fc28f4e9097be9c54f2f38d47 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/dtdb.c @@ -0,0 +1,1222 @@ +#include "erfa.h" + +double eraDtdb(double date1, double date2, + double ut, double elong, double u, double v) +/* +** - - - - - - - - +** e r a D t d b +** - - - - - - - - +** +** An approximation to TDB-TT, the difference between barycentric +** dynamical time and terrestrial time, for an observer on the Earth. +** +** The different time scales - proper, coordinate and realized - are +** related to each other: +** +** TAI <- physically realized +** : +** offset <- observed (nominally +32.184s) +** : +** TT <- terrestrial time +** : +** rate adjustment (L_G) <- definition of TT +** : +** TCG <- time scale for GCRS +** : +** "periodic" terms <- eraDtdb is an implementation +** : +** rate adjustment (L_C) <- function of solar-system ephemeris +** : +** TCB <- time scale for BCRS +** : +** rate adjustment (-L_B) <- definition of TDB +** : +** TDB <- TCB scaled to track TT +** : +** "periodic" terms <- -eraDtdb is an approximation +** : +** TT <- terrestrial time +** +** Adopted values for the various constants can be found in the IERS +** Conventions (McCarthy & Petit 2003). +** +** Given: +** date1,date2 double date, TDB (Notes 1-3) +** ut double universal time (UT1, fraction of one day) +** elong double longitude (east positive, radians) +** u double distance from Earth spin axis (km) +** v double distance north of equatorial plane (km) +** +** Returned (function value): +** double TDB-TT (seconds) +** +** Notes: +** +** 1) The date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** Although the date is, formally, barycentric dynamical time (TDB), +** the terrestrial dynamical time (TT) can be used with no practical +** effect on the accuracy of the prediction. +** +** 2) TT can be regarded as a coordinate time that is realized as an +** offset of 32.184s from International Atomic Time, TAI. TT is a +** specific linear transformation of geocentric coordinate time TCG, +** which is the time scale for the Geocentric Celestial Reference +** System, GCRS. +** +** 3) TDB is a coordinate time, and is a specific linear transformation +** of barycentric coordinate time TCB, which is the time scale for +** the Barycentric Celestial Reference System, BCRS. +** +** 4) The difference TCG-TCB depends on the masses and positions of the +** bodies of the solar system and the velocity of the Earth. It is +** dominated by a rate difference, the residual being of a periodic +** character. The latter, which is modeled by the present function, +** comprises a main (annual) sinusoidal term of amplitude +** approximately 0.00166 seconds, plus planetary terms up to about +** 20 microseconds, and lunar and diurnal terms up to 2 microseconds. +** These effects come from the changing transverse Doppler effect +** and gravitational red-shift as the observer (on the Earth's +** surface) experiences variations in speed (with respect to the +** BCRS) and gravitational potential. +** +** 5) TDB can be regarded as the same as TCB but with a rate adjustment +** to keep it close to TT, which is convenient for many applications. +** The history of successive attempts to define TDB is set out in +** Resolution 3 adopted by the IAU General Assembly in 2006, which +** defines a fixed TDB(TCB) transformation that is consistent with +** contemporary solar-system ephemerides. Future ephemerides will +** imply slightly changed transformations between TCG and TCB, which +** could introduce a linear drift between TDB and TT; however, any +** such drift is unlikely to exceed 1 nanosecond per century. +** +** 6) The geocentric TDB-TT model used in the present function is that of +** Fairhead & Bretagnon (1990), in its full form. It was originally +** supplied by Fairhead (private communications with P.T.Wallace, +** 1990) as a Fortran subroutine. The present C function contains an +** adaptation of the Fairhead code. The numerical results are +** essentially unaffected by the changes, the differences with +** respect to the Fairhead & Bretagnon original being at the 1e-20 s +** level. +** +** The topocentric part of the model is from Moyer (1981) and +** Murray (1983), with fundamental arguments adapted from +** Simon et al. 1994. It is an approximation to the expression +** ( v / c ) . ( r / c ), where v is the barycentric velocity of +** the Earth, r is the geocentric position of the observer and +** c is the speed of light. +** +** By supplying zeroes for u and v, the topocentric part of the +** model can be nullified, and the function will return the Fairhead +** & Bretagnon result alone. +** +** 7) During the interval 1950-2050, the absolute accuracy is better +** than +/- 3 nanoseconds relative to time ephemerides obtained by +** direct numerical integrations based on the JPL DE405 solar system +** ephemeris. +** +** 8) It must be stressed that the present function is merely a model, +** and that numerical integration of solar-system ephemerides is the +** definitive method for predicting the relationship between TCG and +** TCB and hence between TT and TDB. +** +** References: +** +** Fairhead, L., & Bretagnon, P., Astron.Astrophys., 229, 240-247 +** (1990). +** +** IAU 2006 Resolution 3. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Moyer, T.D., Cel.Mech., 23, 33 (1981). +** +** Murray, C.A., Vectorial Astrometry, Adam Hilger (1983). +** +** Seidelmann, P.K. et al., Explanatory Supplement to the +** Astronomical Almanac, Chapter 2, University Science Books (1992). +** +** Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G. & Laskar, J., Astron.Astrophys., 282, 663-683 (1994). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4, + wf, wj; + int j; + +/* +** ===================== +** Fairhead et al. model +** ===================== +** +** 787 sets of three coefficients. +** +** Each set is +** amplitude (microseconds) +** frequency (radians per Julian millennium since J2000.0) +** phase (radians) +** +** Sets 1-474 are the T**0 terms +** " 475-679 " " T**1 +** " 680-764 " " T**2 +** " 765-784 " " T**3 +** " 785-787 " " T**4 +*/ + + static const double fairhd[787][3] = { + /* 1, 10 */ + { 1656.674564e-6, 6283.075849991, 6.240054195 }, + { 22.417471e-6, 5753.384884897, 4.296977442 }, + { 13.839792e-6, 12566.151699983, 6.196904410 }, + { 4.770086e-6, 529.690965095, 0.444401603 }, + { 4.676740e-6, 6069.776754553, 4.021195093 }, + { 2.256707e-6, 213.299095438, 5.543113262 }, + { 1.694205e-6, -3.523118349, 5.025132748 }, + { 1.554905e-6, 77713.771467920, 5.198467090 }, + { 1.276839e-6, 7860.419392439, 5.988822341 }, + { 1.193379e-6, 5223.693919802, 3.649823730 }, + /* 11, 20 */ + { 1.115322e-6, 3930.209696220, 1.422745069 }, + { 0.794185e-6, 11506.769769794, 2.322313077 }, + { 0.447061e-6, 26.298319800, 3.615796498 }, + { 0.435206e-6, -398.149003408, 4.349338347 }, + { 0.600309e-6, 1577.343542448, 2.678271909 }, + { 0.496817e-6, 6208.294251424, 5.696701824 }, + { 0.486306e-6, 5884.926846583, 0.520007179 }, + { 0.432392e-6, 74.781598567, 2.435898309 }, + { 0.468597e-6, 6244.942814354, 5.866398759 }, + { 0.375510e-6, 5507.553238667, 4.103476804 }, + /* 21, 30 */ + { 0.243085e-6, -775.522611324, 3.651837925 }, + { 0.173435e-6, 18849.227549974, 6.153743485 }, + { 0.230685e-6, 5856.477659115, 4.773852582 }, + { 0.203747e-6, 12036.460734888, 4.333987818 }, + { 0.143935e-6, -796.298006816, 5.957517795 }, + { 0.159080e-6, 10977.078804699, 1.890075226 }, + { 0.119979e-6, 38.133035638, 4.551585768 }, + { 0.118971e-6, 5486.777843175, 1.914547226 }, + { 0.116120e-6, 1059.381930189, 0.873504123 }, + { 0.137927e-6, 11790.629088659, 1.135934669 }, + /* 31, 40 */ + { 0.098358e-6, 2544.314419883, 0.092793886 }, + { 0.101868e-6, -5573.142801634, 5.984503847 }, + { 0.080164e-6, 206.185548437, 2.095377709 }, + { 0.079645e-6, 4694.002954708, 2.949233637 }, + { 0.062617e-6, 20.775395492, 2.654394814 }, + { 0.075019e-6, 2942.463423292, 4.980931759 }, + { 0.064397e-6, 5746.271337896, 1.280308748 }, + { 0.063814e-6, 5760.498431898, 4.167901731 }, + { 0.048042e-6, 2146.165416475, 1.495846011 }, + { 0.048373e-6, 155.420399434, 2.251573730 }, + /* 41, 50 */ + { 0.058844e-6, 426.598190876, 4.839650148 }, + { 0.046551e-6, -0.980321068, 0.921573539 }, + { 0.054139e-6, 17260.154654690, 3.411091093 }, + { 0.042411e-6, 6275.962302991, 2.869567043 }, + { 0.040184e-6, -7.113547001, 3.565975565 }, + { 0.036564e-6, 5088.628839767, 3.324679049 }, + { 0.040759e-6, 12352.852604545, 3.981496998 }, + { 0.036507e-6, 801.820931124, 6.248866009 }, + { 0.036955e-6, 3154.687084896, 5.071801441 }, + { 0.042732e-6, 632.783739313, 5.720622217 }, + /* 51, 60 */ + { 0.042560e-6, 161000.685737473, 1.270837679 }, + { 0.040480e-6, 15720.838784878, 2.546610123 }, + { 0.028244e-6, -6286.598968340, 5.069663519 }, + { 0.033477e-6, 6062.663207553, 4.144987272 }, + { 0.034867e-6, 522.577418094, 5.210064075 }, + { 0.032438e-6, 6076.890301554, 0.749317412 }, + { 0.030215e-6, 7084.896781115, 3.389610345 }, + { 0.029247e-6, -71430.695617928, 4.183178762 }, + { 0.033529e-6, 9437.762934887, 2.404714239 }, + { 0.032423e-6, 8827.390269875, 5.541473556 }, + /* 61, 70 */ + { 0.027567e-6, 6279.552731642, 5.040846034 }, + { 0.029862e-6, 12139.553509107, 1.770181024 }, + { 0.022509e-6, 10447.387839604, 1.460726241 }, + { 0.020937e-6, 8429.241266467, 0.652303414 }, + { 0.020322e-6, 419.484643875, 3.735430632 }, + { 0.024816e-6, -1194.447010225, 1.087136918 }, + { 0.025196e-6, 1748.016413067, 2.901883301 }, + { 0.021691e-6, 14143.495242431, 5.952658009 }, + { 0.017673e-6, 6812.766815086, 3.186129845 }, + { 0.022567e-6, 6133.512652857, 3.307984806 }, + /* 71, 80 */ + { 0.016155e-6, 10213.285546211, 1.331103168 }, + { 0.014751e-6, 1349.867409659, 4.308933301 }, + { 0.015949e-6, -220.412642439, 4.005298270 }, + { 0.015974e-6, -2352.866153772, 6.145309371 }, + { 0.014223e-6, 17789.845619785, 2.104551349 }, + { 0.017806e-6, 73.297125859, 3.475975097 }, + { 0.013671e-6, -536.804512095, 5.971672571 }, + { 0.011942e-6, 8031.092263058, 2.053414715 }, + { 0.014318e-6, 16730.463689596, 3.016058075 }, + { 0.012462e-6, 103.092774219, 1.737438797 }, + /* 81, 90 */ + { 0.010962e-6, 3.590428652, 2.196567739 }, + { 0.015078e-6, 19651.048481098, 3.969480770 }, + { 0.010396e-6, 951.718406251, 5.717799605 }, + { 0.011707e-6, -4705.732307544, 2.654125618 }, + { 0.010453e-6, 5863.591206116, 1.913704550 }, + { 0.012420e-6, 4690.479836359, 4.734090399 }, + { 0.011847e-6, 5643.178563677, 5.489005403 }, + { 0.008610e-6, 3340.612426700, 3.661698944 }, + { 0.011622e-6, 5120.601145584, 4.863931876 }, + { 0.010825e-6, 553.569402842, 0.842715011 }, + /* 91, 100 */ + { 0.008666e-6, -135.065080035, 3.293406547 }, + { 0.009963e-6, 149.563197135, 4.870690598 }, + { 0.009858e-6, 6309.374169791, 1.061816410 }, + { 0.007959e-6, 316.391869657, 2.465042647 }, + { 0.010099e-6, 283.859318865, 1.942176992 }, + { 0.007147e-6, -242.728603974, 3.661486981 }, + { 0.007505e-6, 5230.807466803, 4.920937029 }, + { 0.008323e-6, 11769.853693166, 1.229392026 }, + { 0.007490e-6, -6256.777530192, 3.658444681 }, + { 0.009370e-6, 149854.400134205, 0.673880395 }, + /* 101, 110 */ + { 0.007117e-6, 38.027672636, 5.294249518 }, + { 0.007857e-6, 12168.002696575, 0.525733528 }, + { 0.007019e-6, 6206.809778716, 0.837688810 }, + { 0.006056e-6, 955.599741609, 4.194535082 }, + { 0.008107e-6, 13367.972631107, 3.793235253 }, + { 0.006731e-6, 5650.292110678, 5.639906583 }, + { 0.007332e-6, 36.648562930, 0.114858677 }, + { 0.006366e-6, 4164.311989613, 2.262081818 }, + { 0.006858e-6, 5216.580372801, 0.642063318 }, + { 0.006919e-6, 6681.224853400, 6.018501522 }, + /* 111, 120 */ + { 0.006826e-6, 7632.943259650, 3.458654112 }, + { 0.005308e-6, -1592.596013633, 2.500382359 }, + { 0.005096e-6, 11371.704689758, 2.547107806 }, + { 0.004841e-6, 5333.900241022, 0.437078094 }, + { 0.005582e-6, 5966.683980335, 2.246174308 }, + { 0.006304e-6, 11926.254413669, 2.512929171 }, + { 0.006603e-6, 23581.258177318, 5.393136889 }, + { 0.005123e-6, -1.484472708, 2.999641028 }, + { 0.004648e-6, 1589.072895284, 1.275847090 }, + { 0.005119e-6, 6438.496249426, 1.486539246 }, + /* 121, 130 */ + { 0.004521e-6, 4292.330832950, 6.140635794 }, + { 0.005680e-6, 23013.539539587, 4.557814849 }, + { 0.005488e-6, -3.455808046, 0.090675389 }, + { 0.004193e-6, 7234.794256242, 4.869091389 }, + { 0.003742e-6, 7238.675591600, 4.691976180 }, + { 0.004148e-6, -110.206321219, 3.016173439 }, + { 0.004553e-6, 11499.656222793, 5.554998314 }, + { 0.004892e-6, 5436.993015240, 1.475415597 }, + { 0.004044e-6, 4732.030627343, 1.398784824 }, + { 0.004164e-6, 12491.370101415, 5.650931916 }, + /* 131, 140 */ + { 0.004349e-6, 11513.883316794, 2.181745369 }, + { 0.003919e-6, 12528.018664345, 5.823319737 }, + { 0.003129e-6, 6836.645252834, 0.003844094 }, + { 0.004080e-6, -7058.598461315, 3.690360123 }, + { 0.003270e-6, 76.266071276, 1.517189902 }, + { 0.002954e-6, 6283.143160294, 4.447203799 }, + { 0.002872e-6, 28.449187468, 1.158692983 }, + { 0.002881e-6, 735.876513532, 0.349250250 }, + { 0.003279e-6, 5849.364112115, 4.893384368 }, + { 0.003625e-6, 6209.778724132, 1.473760578 }, + /* 141, 150 */ + { 0.003074e-6, 949.175608970, 5.185878737 }, + { 0.002775e-6, 9917.696874510, 1.030026325 }, + { 0.002646e-6, 10973.555686350, 3.918259169 }, + { 0.002575e-6, 25132.303399966, 6.109659023 }, + { 0.003500e-6, 263.083923373, 1.892100742 }, + { 0.002740e-6, 18319.536584880, 4.320519510 }, + { 0.002464e-6, 202.253395174, 4.698203059 }, + { 0.002409e-6, 2.542797281, 5.325009315 }, + { 0.003354e-6, -90955.551694697, 1.942656623 }, + { 0.002296e-6, 6496.374945429, 5.061810696 }, + /* 151, 160 */ + { 0.003002e-6, 6172.869528772, 2.797822767 }, + { 0.003202e-6, 27511.467873537, 0.531673101 }, + { 0.002954e-6, -6283.008539689, 4.533471191 }, + { 0.002353e-6, 639.897286314, 3.734548088 }, + { 0.002401e-6, 16200.772724501, 2.605547070 }, + { 0.003053e-6, 233141.314403759, 3.029030662 }, + { 0.003024e-6, 83286.914269554, 2.355556099 }, + { 0.002863e-6, 17298.182327326, 5.240963796 }, + { 0.002103e-6, -7079.373856808, 5.756641637 }, + { 0.002303e-6, 83996.847317911, 2.013686814 }, + /* 161, 170 */ + { 0.002303e-6, 18073.704938650, 1.089100410 }, + { 0.002381e-6, 63.735898303, 0.759188178 }, + { 0.002493e-6, 6386.168624210, 0.645026535 }, + { 0.002366e-6, 3.932153263, 6.215885448 }, + { 0.002169e-6, 11015.106477335, 4.845297676 }, + { 0.002397e-6, 6243.458341645, 3.809290043 }, + { 0.002183e-6, 1162.474704408, 6.179611691 }, + { 0.002353e-6, 6246.427287062, 4.781719760 }, + { 0.002199e-6, -245.831646229, 5.956152284 }, + { 0.001729e-6, 3894.181829542, 1.264976635 }, + /* 171, 180 */ + { 0.001896e-6, -3128.388765096, 4.914231596 }, + { 0.002085e-6, 35.164090221, 1.405158503 }, + { 0.002024e-6, 14712.317116458, 2.752035928 }, + { 0.001737e-6, 6290.189396992, 5.280820144 }, + { 0.002229e-6, 491.557929457, 1.571007057 }, + { 0.001602e-6, 14314.168113050, 4.203664806 }, + { 0.002186e-6, 454.909366527, 1.402101526 }, + { 0.001897e-6, 22483.848574493, 4.167932508 }, + { 0.001825e-6, -3738.761430108, 0.545828785 }, + { 0.001894e-6, 1052.268383188, 5.817167450 }, + /* 181, 190 */ + { 0.001421e-6, 20.355319399, 2.419886601 }, + { 0.001408e-6, 10984.192351700, 2.732084787 }, + { 0.001847e-6, 10873.986030480, 2.903477885 }, + { 0.001391e-6, -8635.942003763, 0.593891500 }, + { 0.001388e-6, -7.046236698, 1.166145902 }, + { 0.001810e-6, -88860.057071188, 0.487355242 }, + { 0.001288e-6, -1990.745017041, 3.913022880 }, + { 0.001297e-6, 23543.230504682, 3.063805171 }, + { 0.001335e-6, -266.607041722, 3.995764039 }, + { 0.001376e-6, 10969.965257698, 5.152914309 }, + /* 191, 200 */ + { 0.001745e-6, 244287.600007027, 3.626395673 }, + { 0.001649e-6, 31441.677569757, 1.952049260 }, + { 0.001416e-6, 9225.539273283, 4.996408389 }, + { 0.001238e-6, 4804.209275927, 5.503379738 }, + { 0.001472e-6, 4590.910180489, 4.164913291 }, + { 0.001169e-6, 6040.347246017, 5.841719038 }, + { 0.001039e-6, 5540.085789459, 2.769753519 }, + { 0.001004e-6, -170.672870619, 0.755008103 }, + { 0.001284e-6, 10575.406682942, 5.306538209 }, + { 0.001278e-6, 71.812653151, 4.713486491 }, + /* 201, 210 */ + { 0.001321e-6, 18209.330263660, 2.624866359 }, + { 0.001297e-6, 21228.392023546, 0.382603541 }, + { 0.000954e-6, 6282.095528923, 0.882213514 }, + { 0.001145e-6, 6058.731054289, 1.169483931 }, + { 0.000979e-6, 5547.199336460, 5.448375984 }, + { 0.000987e-6, -6262.300454499, 2.656486959 }, + { 0.001070e-6, -154717.609887482, 1.827624012 }, + { 0.000991e-6, 4701.116501708, 4.387001801 }, + { 0.001155e-6, -14.227094002, 3.042700750 }, + { 0.001176e-6, 277.034993741, 3.335519004 }, + /* 211, 220 */ + { 0.000890e-6, 13916.019109642, 5.601498297 }, + { 0.000884e-6, -1551.045222648, 1.088831705 }, + { 0.000876e-6, 5017.508371365, 3.969902609 }, + { 0.000806e-6, 15110.466119866, 5.142876744 }, + { 0.000773e-6, -4136.910433516, 0.022067765 }, + { 0.001077e-6, 175.166059800, 1.844913056 }, + { 0.000954e-6, -6284.056171060, 0.968480906 }, + { 0.000737e-6, 5326.786694021, 4.923831588 }, + { 0.000845e-6, -433.711737877, 4.749245231 }, + { 0.000819e-6, 8662.240323563, 5.991247817 }, + /* 221, 230 */ + { 0.000852e-6, 199.072001436, 2.189604979 }, + { 0.000723e-6, 17256.631536341, 6.068719637 }, + { 0.000940e-6, 6037.244203762, 6.197428148 }, + { 0.000885e-6, 11712.955318231, 3.280414875 }, + { 0.000706e-6, 12559.038152982, 2.824848947 }, + { 0.000732e-6, 2379.164473572, 2.501813417 }, + { 0.000764e-6, -6127.655450557, 2.236346329 }, + { 0.000908e-6, 131.541961686, 2.521257490 }, + { 0.000907e-6, 35371.887265976, 3.370195967 }, + { 0.000673e-6, 1066.495477190, 3.876512374 }, + /* 231, 240 */ + { 0.000814e-6, 17654.780539750, 4.627122566 }, + { 0.000630e-6, 36.027866677, 0.156368499 }, + { 0.000798e-6, 515.463871093, 5.151962502 }, + { 0.000798e-6, 148.078724426, 5.909225055 }, + { 0.000806e-6, 309.278322656, 6.054064447 }, + { 0.000607e-6, -39.617508346, 2.839021623 }, + { 0.000601e-6, 412.371096874, 3.984225404 }, + { 0.000646e-6, 11403.676995575, 3.852959484 }, + { 0.000704e-6, 13521.751441591, 2.300991267 }, + { 0.000603e-6, -65147.619767937, 4.140083146 }, + /* 241, 250 */ + { 0.000609e-6, 10177.257679534, 0.437122327 }, + { 0.000631e-6, 5767.611978898, 4.026532329 }, + { 0.000576e-6, 11087.285125918, 4.760293101 }, + { 0.000674e-6, 14945.316173554, 6.270510511 }, + { 0.000726e-6, 5429.879468239, 6.039606892 }, + { 0.000710e-6, 28766.924424484, 5.672617711 }, + { 0.000647e-6, 11856.218651625, 3.397132627 }, + { 0.000678e-6, -5481.254918868, 6.249666675 }, + { 0.000618e-6, 22003.914634870, 2.466427018 }, + { 0.000738e-6, 6134.997125565, 2.242668890 }, + /* 251, 260 */ + { 0.000660e-6, 625.670192312, 5.864091907 }, + { 0.000694e-6, 3496.032826134, 2.668309141 }, + { 0.000531e-6, 6489.261398429, 1.681888780 }, + { 0.000611e-6, -143571.324284214, 2.424978312 }, + { 0.000575e-6, 12043.574281889, 4.216492400 }, + { 0.000553e-6, 12416.588502848, 4.772158039 }, + { 0.000689e-6, 4686.889407707, 6.224271088 }, + { 0.000495e-6, 7342.457780181, 3.817285811 }, + { 0.000567e-6, 3634.621024518, 1.649264690 }, + { 0.000515e-6, 18635.928454536, 3.945345892 }, + /* 261, 270 */ + { 0.000486e-6, -323.505416657, 4.061673868 }, + { 0.000662e-6, 25158.601719765, 1.794058369 }, + { 0.000509e-6, 846.082834751, 3.053874588 }, + { 0.000472e-6, -12569.674818332, 5.112133338 }, + { 0.000461e-6, 6179.983075773, 0.513669325 }, + { 0.000641e-6, 83467.156352816, 3.210727723 }, + { 0.000520e-6, 10344.295065386, 2.445597761 }, + { 0.000493e-6, 18422.629359098, 1.676939306 }, + { 0.000478e-6, 1265.567478626, 5.487314569 }, + { 0.000472e-6, -18.159247265, 1.999707589 }, + /* 271, 280 */ + { 0.000559e-6, 11190.377900137, 5.783236356 }, + { 0.000494e-6, 9623.688276691, 3.022645053 }, + { 0.000463e-6, 5739.157790895, 1.411223013 }, + { 0.000432e-6, 16858.482532933, 1.179256434 }, + { 0.000574e-6, 72140.628666286, 1.758191830 }, + { 0.000484e-6, 17267.268201691, 3.290589143 }, + { 0.000550e-6, 4907.302050146, 0.864024298 }, + { 0.000399e-6, 14.977853527, 2.094441910 }, + { 0.000491e-6, 224.344795702, 0.878372791 }, + { 0.000432e-6, 20426.571092422, 6.003829241 }, + /* 281, 290 */ + { 0.000481e-6, 5749.452731634, 4.309591964 }, + { 0.000480e-6, 5757.317038160, 1.142348571 }, + { 0.000485e-6, 6702.560493867, 0.210580917 }, + { 0.000426e-6, 6055.549660552, 4.274476529 }, + { 0.000480e-6, 5959.570433334, 5.031351030 }, + { 0.000466e-6, 12562.628581634, 4.959581597 }, + { 0.000520e-6, 39302.096962196, 4.788002889 }, + { 0.000458e-6, 12132.439962106, 1.880103788 }, + { 0.000470e-6, 12029.347187887, 1.405611197 }, + { 0.000416e-6, -7477.522860216, 1.082356330 }, + /* 291, 300 */ + { 0.000449e-6, 11609.862544012, 4.179989585 }, + { 0.000465e-6, 17253.041107690, 0.353496295 }, + { 0.000362e-6, -4535.059436924, 1.583849576 }, + { 0.000383e-6, 21954.157609398, 3.747376371 }, + { 0.000389e-6, 17.252277143, 1.395753179 }, + { 0.000331e-6, 18052.929543158, 0.566790582 }, + { 0.000430e-6, 13517.870106233, 0.685827538 }, + { 0.000368e-6, -5756.908003246, 0.731374317 }, + { 0.000330e-6, 10557.594160824, 3.710043680 }, + { 0.000332e-6, 20199.094959633, 1.652901407 }, + /* 301, 310 */ + { 0.000384e-6, 11933.367960670, 5.827781531 }, + { 0.000387e-6, 10454.501386605, 2.541182564 }, + { 0.000325e-6, 15671.081759407, 2.178850542 }, + { 0.000318e-6, 138.517496871, 2.253253037 }, + { 0.000305e-6, 9388.005909415, 0.578340206 }, + { 0.000352e-6, 5749.861766548, 3.000297967 }, + { 0.000311e-6, 6915.859589305, 1.693574249 }, + { 0.000297e-6, 24072.921469776, 1.997249392 }, + { 0.000363e-6, -640.877607382, 5.071820966 }, + { 0.000323e-6, 12592.450019783, 1.072262823 }, + /* 311, 320 */ + { 0.000341e-6, 12146.667056108, 4.700657997 }, + { 0.000290e-6, 9779.108676125, 1.812320441 }, + { 0.000342e-6, 6132.028180148, 4.322238614 }, + { 0.000329e-6, 6268.848755990, 3.033827743 }, + { 0.000374e-6, 17996.031168222, 3.388716544 }, + { 0.000285e-6, -533.214083444, 4.687313233 }, + { 0.000338e-6, 6065.844601290, 0.877776108 }, + { 0.000276e-6, 24.298513841, 0.770299429 }, + { 0.000336e-6, -2388.894020449, 5.353796034 }, + { 0.000290e-6, 3097.883822726, 4.075291557 }, + /* 321, 330 */ + { 0.000318e-6, 709.933048357, 5.941207518 }, + { 0.000271e-6, 13095.842665077, 3.208912203 }, + { 0.000331e-6, 6073.708907816, 4.007881169 }, + { 0.000292e-6, 742.990060533, 2.714333592 }, + { 0.000362e-6, 29088.811415985, 3.215977013 }, + { 0.000280e-6, 12359.966151546, 0.710872502 }, + { 0.000267e-6, 10440.274292604, 4.730108488 }, + { 0.000262e-6, 838.969287750, 1.327720272 }, + { 0.000250e-6, 16496.361396202, 0.898769761 }, + { 0.000325e-6, 20597.243963041, 0.180044365 }, + /* 331, 340 */ + { 0.000268e-6, 6148.010769956, 5.152666276 }, + { 0.000284e-6, 5636.065016677, 5.655385808 }, + { 0.000301e-6, 6080.822454817, 2.135396205 }, + { 0.000294e-6, -377.373607916, 3.708784168 }, + { 0.000236e-6, 2118.763860378, 1.733578756 }, + { 0.000234e-6, 5867.523359379, 5.575209112 }, + { 0.000268e-6, -226858.238553767, 0.069432392 }, + { 0.000265e-6, 167283.761587465, 4.369302826 }, + { 0.000280e-6, 28237.233459389, 5.304829118 }, + { 0.000292e-6, 12345.739057544, 4.096094132 }, + /* 341, 350 */ + { 0.000223e-6, 19800.945956225, 3.069327406 }, + { 0.000301e-6, 43232.306658416, 6.205311188 }, + { 0.000264e-6, 18875.525869774, 1.417263408 }, + { 0.000304e-6, -1823.175188677, 3.409035232 }, + { 0.000301e-6, 109.945688789, 0.510922054 }, + { 0.000260e-6, 813.550283960, 2.389438934 }, + { 0.000299e-6, 316428.228673312, 5.384595078 }, + { 0.000211e-6, 5756.566278634, 3.789392838 }, + { 0.000209e-6, 5750.203491159, 1.661943545 }, + { 0.000240e-6, 12489.885628707, 5.684549045 }, + /* 351, 360 */ + { 0.000216e-6, 6303.851245484, 3.862942261 }, + { 0.000203e-6, 1581.959348283, 5.549853589 }, + { 0.000200e-6, 5642.198242609, 1.016115785 }, + { 0.000197e-6, -70.849445304, 4.690702525 }, + { 0.000227e-6, 6287.008003254, 2.911891613 }, + { 0.000197e-6, 533.623118358, 1.048982898 }, + { 0.000205e-6, -6279.485421340, 1.829362730 }, + { 0.000209e-6, -10988.808157535, 2.636140084 }, + { 0.000208e-6, -227.526189440, 4.127883842 }, + { 0.000191e-6, 415.552490612, 4.401165650 }, + /* 361, 370 */ + { 0.000190e-6, 29296.615389579, 4.175658539 }, + { 0.000264e-6, 66567.485864652, 4.601102551 }, + { 0.000256e-6, -3646.350377354, 0.506364778 }, + { 0.000188e-6, 13119.721102825, 2.032195842 }, + { 0.000185e-6, -209.366942175, 4.694756586 }, + { 0.000198e-6, 25934.124331089, 3.832703118 }, + { 0.000195e-6, 4061.219215394, 3.308463427 }, + { 0.000234e-6, 5113.487598583, 1.716090661 }, + { 0.000188e-6, 1478.866574064, 5.686865780 }, + { 0.000222e-6, 11823.161639450, 1.942386641 }, + /* 371, 380 */ + { 0.000181e-6, 10770.893256262, 1.999482059 }, + { 0.000171e-6, 6546.159773364, 1.182807992 }, + { 0.000206e-6, 70.328180442, 5.934076062 }, + { 0.000169e-6, 20995.392966449, 2.169080622 }, + { 0.000191e-6, 10660.686935042, 5.405515999 }, + { 0.000228e-6, 33019.021112205, 4.656985514 }, + { 0.000184e-6, -4933.208440333, 3.327476868 }, + { 0.000220e-6, -135.625325010, 1.765430262 }, + { 0.000166e-6, 23141.558382925, 3.454132746 }, + { 0.000191e-6, 6144.558353121, 5.020393445 }, + /* 381, 390 */ + { 0.000180e-6, 6084.003848555, 0.602182191 }, + { 0.000163e-6, 17782.732072784, 4.960593133 }, + { 0.000225e-6, 16460.333529525, 2.596451817 }, + { 0.000222e-6, 5905.702242076, 3.731990323 }, + { 0.000204e-6, 227.476132789, 5.636192701 }, + { 0.000159e-6, 16737.577236597, 3.600691544 }, + { 0.000200e-6, 6805.653268085, 0.868220961 }, + { 0.000187e-6, 11919.140866668, 2.629456641 }, + { 0.000161e-6, 127.471796607, 2.862574720 }, + { 0.000205e-6, 6286.666278643, 1.742882331 }, + /* 391, 400 */ + { 0.000189e-6, 153.778810485, 4.812372643 }, + { 0.000168e-6, 16723.350142595, 0.027860588 }, + { 0.000149e-6, 11720.068865232, 0.659721876 }, + { 0.000189e-6, 5237.921013804, 5.245313000 }, + { 0.000143e-6, 6709.674040867, 4.317625647 }, + { 0.000146e-6, 4487.817406270, 4.815297007 }, + { 0.000144e-6, -664.756045130, 5.381366880 }, + { 0.000175e-6, 5127.714692584, 4.728443327 }, + { 0.000162e-6, 6254.626662524, 1.435132069 }, + { 0.000187e-6, 47162.516354635, 1.354371923 }, + /* 401, 410 */ + { 0.000146e-6, 11080.171578918, 3.369695406 }, + { 0.000180e-6, -348.924420448, 2.490902145 }, + { 0.000148e-6, 151.047669843, 3.799109588 }, + { 0.000157e-6, 6197.248551160, 1.284375887 }, + { 0.000167e-6, 146.594251718, 0.759969109 }, + { 0.000133e-6, -5331.357443741, 5.409701889 }, + { 0.000154e-6, 95.979227218, 3.366890614 }, + { 0.000148e-6, -6418.140930027, 3.384104996 }, + { 0.000128e-6, -6525.804453965, 3.803419985 }, + { 0.000130e-6, 11293.470674356, 0.939039445 }, + /* 411, 420 */ + { 0.000152e-6, -5729.506447149, 0.734117523 }, + { 0.000138e-6, 210.117701700, 2.564216078 }, + { 0.000123e-6, 6066.595360816, 4.517099537 }, + { 0.000140e-6, 18451.078546566, 0.642049130 }, + { 0.000126e-6, 11300.584221356, 3.485280663 }, + { 0.000119e-6, 10027.903195729, 3.217431161 }, + { 0.000151e-6, 4274.518310832, 4.404359108 }, + { 0.000117e-6, 6072.958148291, 0.366324650 }, + { 0.000165e-6, -7668.637425143, 4.298212528 }, + { 0.000117e-6, -6245.048177356, 5.379518958 }, + /* 421, 430 */ + { 0.000130e-6, -5888.449964932, 4.527681115 }, + { 0.000121e-6, -543.918059096, 6.109429504 }, + { 0.000162e-6, 9683.594581116, 5.720092446 }, + { 0.000141e-6, 6219.339951688, 0.679068671 }, + { 0.000118e-6, 22743.409379516, 4.881123092 }, + { 0.000129e-6, 1692.165669502, 0.351407289 }, + { 0.000126e-6, 5657.405657679, 5.146592349 }, + { 0.000114e-6, 728.762966531, 0.520791814 }, + { 0.000120e-6, 52.596639600, 0.948516300 }, + { 0.000115e-6, 65.220371012, 3.504914846 }, + /* 431, 440 */ + { 0.000126e-6, 5881.403728234, 5.577502482 }, + { 0.000158e-6, 163096.180360983, 2.957128968 }, + { 0.000134e-6, 12341.806904281, 2.598576764 }, + { 0.000151e-6, 16627.370915377, 3.985702050 }, + { 0.000109e-6, 1368.660252845, 0.014730471 }, + { 0.000131e-6, 6211.263196841, 0.085077024 }, + { 0.000146e-6, 5792.741760812, 0.708426604 }, + { 0.000146e-6, -77.750543984, 3.121576600 }, + { 0.000107e-6, 5341.013788022, 0.288231904 }, + { 0.000138e-6, 6281.591377283, 2.797450317 }, + /* 441, 450 */ + { 0.000113e-6, -6277.552925684, 2.788904128 }, + { 0.000115e-6, -525.758811831, 5.895222200 }, + { 0.000138e-6, 6016.468808270, 6.096188999 }, + { 0.000139e-6, 23539.707386333, 2.028195445 }, + { 0.000146e-6, -4176.041342449, 4.660008502 }, + { 0.000107e-6, 16062.184526117, 4.066520001 }, + { 0.000142e-6, 83783.548222473, 2.936315115 }, + { 0.000128e-6, 9380.959672717, 3.223844306 }, + { 0.000135e-6, 6205.325306007, 1.638054048 }, + { 0.000101e-6, 2699.734819318, 5.481603249 }, + /* 451, 460 */ + { 0.000104e-6, -568.821874027, 2.205734493 }, + { 0.000103e-6, 6321.103522627, 2.440421099 }, + { 0.000119e-6, 6321.208885629, 2.547496264 }, + { 0.000138e-6, 1975.492545856, 2.314608466 }, + { 0.000121e-6, 137.033024162, 4.539108237 }, + { 0.000123e-6, 19402.796952817, 4.538074405 }, + { 0.000119e-6, 22805.735565994, 2.869040566 }, + { 0.000133e-6, 64471.991241142, 6.056405489 }, + { 0.000129e-6, -85.827298831, 2.540635083 }, + { 0.000131e-6, 13613.804277336, 4.005732868 }, + /* 461, 470 */ + { 0.000104e-6, 9814.604100291, 1.959967212 }, + { 0.000112e-6, 16097.679950283, 3.589026260 }, + { 0.000123e-6, 2107.034507542, 1.728627253 }, + { 0.000121e-6, 36949.230808424, 6.072332087 }, + { 0.000108e-6, -12539.853380183, 3.716133846 }, + { 0.000113e-6, -7875.671863624, 2.725771122 }, + { 0.000109e-6, 4171.425536614, 4.033338079 }, + { 0.000101e-6, 6247.911759770, 3.441347021 }, + { 0.000113e-6, 7330.728427345, 0.656372122 }, + { 0.000113e-6, 51092.726050855, 2.791483066 }, + /* 471, 480 */ + { 0.000106e-6, 5621.842923210, 1.815323326 }, + { 0.000101e-6, 111.430161497, 5.711033677 }, + { 0.000103e-6, 909.818733055, 2.812745443 }, + { 0.000101e-6, 1790.642637886, 1.965746028 }, + + /* T */ + { 102.156724e-6, 6283.075849991, 4.249032005 }, + { 1.706807e-6, 12566.151699983, 4.205904248 }, + { 0.269668e-6, 213.299095438, 3.400290479 }, + { 0.265919e-6, 529.690965095, 5.836047367 }, + { 0.210568e-6, -3.523118349, 6.262738348 }, + { 0.077996e-6, 5223.693919802, 4.670344204 }, + /* 481, 490 */ + { 0.054764e-6, 1577.343542448, 4.534800170 }, + { 0.059146e-6, 26.298319800, 1.083044735 }, + { 0.034420e-6, -398.149003408, 5.980077351 }, + { 0.032088e-6, 18849.227549974, 4.162913471 }, + { 0.033595e-6, 5507.553238667, 5.980162321 }, + { 0.029198e-6, 5856.477659115, 0.623811863 }, + { 0.027764e-6, 155.420399434, 3.745318113 }, + { 0.025190e-6, 5746.271337896, 2.980330535 }, + { 0.022997e-6, -796.298006816, 1.174411803 }, + { 0.024976e-6, 5760.498431898, 2.467913690 }, + /* 491, 500 */ + { 0.021774e-6, 206.185548437, 3.854787540 }, + { 0.017925e-6, -775.522611324, 1.092065955 }, + { 0.013794e-6, 426.598190876, 2.699831988 }, + { 0.013276e-6, 6062.663207553, 5.845801920 }, + { 0.011774e-6, 12036.460734888, 2.292832062 }, + { 0.012869e-6, 6076.890301554, 5.333425680 }, + { 0.012152e-6, 1059.381930189, 6.222874454 }, + { 0.011081e-6, -7.113547001, 5.154724984 }, + { 0.010143e-6, 4694.002954708, 4.044013795 }, + { 0.009357e-6, 5486.777843175, 3.416081409 }, + /* 501, 510 */ + { 0.010084e-6, 522.577418094, 0.749320262 }, + { 0.008587e-6, 10977.078804699, 2.777152598 }, + { 0.008628e-6, 6275.962302991, 4.562060226 }, + { 0.008158e-6, -220.412642439, 5.806891533 }, + { 0.007746e-6, 2544.314419883, 1.603197066 }, + { 0.007670e-6, 2146.165416475, 3.000200440 }, + { 0.007098e-6, 74.781598567, 0.443725817 }, + { 0.006180e-6, -536.804512095, 1.302642751 }, + { 0.005818e-6, 5088.628839767, 4.827723531 }, + { 0.004945e-6, -6286.598968340, 0.268305170 }, + /* 511, 520 */ + { 0.004774e-6, 1349.867409659, 5.808636673 }, + { 0.004687e-6, -242.728603974, 5.154890570 }, + { 0.006089e-6, 1748.016413067, 4.403765209 }, + { 0.005975e-6, -1194.447010225, 2.583472591 }, + { 0.004229e-6, 951.718406251, 0.931172179 }, + { 0.005264e-6, 553.569402842, 2.336107252 }, + { 0.003049e-6, 5643.178563677, 1.362634430 }, + { 0.002974e-6, 6812.766815086, 1.583012668 }, + { 0.003403e-6, -2352.866153772, 2.552189886 }, + { 0.003030e-6, 419.484643875, 5.286473844 }, + /* 521, 530 */ + { 0.003210e-6, -7.046236698, 1.863796539 }, + { 0.003058e-6, 9437.762934887, 4.226420633 }, + { 0.002589e-6, 12352.852604545, 1.991935820 }, + { 0.002927e-6, 5216.580372801, 2.319951253 }, + { 0.002425e-6, 5230.807466803, 3.084752833 }, + { 0.002656e-6, 3154.687084896, 2.487447866 }, + { 0.002445e-6, 10447.387839604, 2.347139160 }, + { 0.002990e-6, 4690.479836359, 6.235872050 }, + { 0.002890e-6, 5863.591206116, 0.095197563 }, + { 0.002498e-6, 6438.496249426, 2.994779800 }, + /* 531, 540 */ + { 0.001889e-6, 8031.092263058, 3.569003717 }, + { 0.002567e-6, 801.820931124, 3.425611498 }, + { 0.001803e-6, -71430.695617928, 2.192295512 }, + { 0.001782e-6, 3.932153263, 5.180433689 }, + { 0.001694e-6, -4705.732307544, 4.641779174 }, + { 0.001704e-6, -1592.596013633, 3.997097652 }, + { 0.001735e-6, 5849.364112115, 0.417558428 }, + { 0.001643e-6, 8429.241266467, 2.180619584 }, + { 0.001680e-6, 38.133035638, 4.164529426 }, + { 0.002045e-6, 7084.896781115, 0.526323854 }, + /* 541, 550 */ + { 0.001458e-6, 4292.330832950, 1.356098141 }, + { 0.001437e-6, 20.355319399, 3.895439360 }, + { 0.001738e-6, 6279.552731642, 0.087484036 }, + { 0.001367e-6, 14143.495242431, 3.987576591 }, + { 0.001344e-6, 7234.794256242, 0.090454338 }, + { 0.001438e-6, 11499.656222793, 0.974387904 }, + { 0.001257e-6, 6836.645252834, 1.509069366 }, + { 0.001358e-6, 11513.883316794, 0.495572260 }, + { 0.001628e-6, 7632.943259650, 4.968445721 }, + { 0.001169e-6, 103.092774219, 2.838496795 }, + /* 551, 560 */ + { 0.001162e-6, 4164.311989613, 3.408387778 }, + { 0.001092e-6, 6069.776754553, 3.617942651 }, + { 0.001008e-6, 17789.845619785, 0.286350174 }, + { 0.001008e-6, 639.897286314, 1.610762073 }, + { 0.000918e-6, 10213.285546211, 5.532798067 }, + { 0.001011e-6, -6256.777530192, 0.661826484 }, + { 0.000753e-6, 16730.463689596, 3.905030235 }, + { 0.000737e-6, 11926.254413669, 4.641956361 }, + { 0.000694e-6, 3340.612426700, 2.111120332 }, + { 0.000701e-6, 3894.181829542, 2.760823491 }, + /* 561, 570 */ + { 0.000689e-6, -135.065080035, 4.768800780 }, + { 0.000700e-6, 13367.972631107, 5.760439898 }, + { 0.000664e-6, 6040.347246017, 1.051215840 }, + { 0.000654e-6, 5650.292110678, 4.911332503 }, + { 0.000788e-6, 6681.224853400, 4.699648011 }, + { 0.000628e-6, 5333.900241022, 5.024608847 }, + { 0.000755e-6, -110.206321219, 4.370971253 }, + { 0.000628e-6, 6290.189396992, 3.660478857 }, + { 0.000635e-6, 25132.303399966, 4.121051532 }, + { 0.000534e-6, 5966.683980335, 1.173284524 }, + /* 571, 580 */ + { 0.000543e-6, -433.711737877, 0.345585464 }, + { 0.000517e-6, -1990.745017041, 5.414571768 }, + { 0.000504e-6, 5767.611978898, 2.328281115 }, + { 0.000485e-6, 5753.384884897, 1.685874771 }, + { 0.000463e-6, 7860.419392439, 5.297703006 }, + { 0.000604e-6, 515.463871093, 0.591998446 }, + { 0.000443e-6, 12168.002696575, 4.830881244 }, + { 0.000570e-6, 199.072001436, 3.899190272 }, + { 0.000465e-6, 10969.965257698, 0.476681802 }, + { 0.000424e-6, -7079.373856808, 1.112242763 }, + /* 581, 590 */ + { 0.000427e-6, 735.876513532, 1.994214480 }, + { 0.000478e-6, -6127.655450557, 3.778025483 }, + { 0.000414e-6, 10973.555686350, 5.441088327 }, + { 0.000512e-6, 1589.072895284, 0.107123853 }, + { 0.000378e-6, 10984.192351700, 0.915087231 }, + { 0.000402e-6, 11371.704689758, 4.107281715 }, + { 0.000453e-6, 9917.696874510, 1.917490952 }, + { 0.000395e-6, 149.563197135, 2.763124165 }, + { 0.000371e-6, 5739.157790895, 3.112111866 }, + { 0.000350e-6, 11790.629088659, 0.440639857 }, + /* 591, 600 */ + { 0.000356e-6, 6133.512652857, 5.444568842 }, + { 0.000344e-6, 412.371096874, 5.676832684 }, + { 0.000383e-6, 955.599741609, 5.559734846 }, + { 0.000333e-6, 6496.374945429, 0.261537984 }, + { 0.000340e-6, 6055.549660552, 5.975534987 }, + { 0.000334e-6, 1066.495477190, 2.335063907 }, + { 0.000399e-6, 11506.769769794, 5.321230910 }, + { 0.000314e-6, 18319.536584880, 2.313312404 }, + { 0.000424e-6, 1052.268383188, 1.211961766 }, + { 0.000307e-6, 63.735898303, 3.169551388 }, + /* 601, 610 */ + { 0.000329e-6, 29.821438149, 6.106912080 }, + { 0.000357e-6, 6309.374169791, 4.223760346 }, + { 0.000312e-6, -3738.761430108, 2.180556645 }, + { 0.000301e-6, 309.278322656, 1.499984572 }, + { 0.000268e-6, 12043.574281889, 2.447520648 }, + { 0.000257e-6, 12491.370101415, 3.662331761 }, + { 0.000290e-6, 625.670192312, 1.272834584 }, + { 0.000256e-6, 5429.879468239, 1.913426912 }, + { 0.000339e-6, 3496.032826134, 4.165930011 }, + { 0.000283e-6, 3930.209696220, 4.325565754 }, + /* 611, 620 */ + { 0.000241e-6, 12528.018664345, 3.832324536 }, + { 0.000304e-6, 4686.889407707, 1.612348468 }, + { 0.000259e-6, 16200.772724501, 3.470173146 }, + { 0.000238e-6, 12139.553509107, 1.147977842 }, + { 0.000236e-6, 6172.869528772, 3.776271728 }, + { 0.000296e-6, -7058.598461315, 0.460368852 }, + { 0.000306e-6, 10575.406682942, 0.554749016 }, + { 0.000251e-6, 17298.182327326, 0.834332510 }, + { 0.000290e-6, 4732.030627343, 4.759564091 }, + { 0.000261e-6, 5884.926846583, 0.298259862 }, + /* 621, 630 */ + { 0.000249e-6, 5547.199336460, 3.749366406 }, + { 0.000213e-6, 11712.955318231, 5.415666119 }, + { 0.000223e-6, 4701.116501708, 2.703203558 }, + { 0.000268e-6, -640.877607382, 0.283670793 }, + { 0.000209e-6, 5636.065016677, 1.238477199 }, + { 0.000193e-6, 10177.257679534, 1.943251340 }, + { 0.000182e-6, 6283.143160294, 2.456157599 }, + { 0.000184e-6, -227.526189440, 5.888038582 }, + { 0.000182e-6, -6283.008539689, 0.241332086 }, + { 0.000228e-6, -6284.056171060, 2.657323816 }, + /* 631, 640 */ + { 0.000166e-6, 7238.675591600, 5.930629110 }, + { 0.000167e-6, 3097.883822726, 5.570955333 }, + { 0.000159e-6, -323.505416657, 5.786670700 }, + { 0.000154e-6, -4136.910433516, 1.517805532 }, + { 0.000176e-6, 12029.347187887, 3.139266834 }, + { 0.000167e-6, 12132.439962106, 3.556352289 }, + { 0.000153e-6, 202.253395174, 1.463313961 }, + { 0.000157e-6, 17267.268201691, 1.586837396 }, + { 0.000142e-6, 83996.847317911, 0.022670115 }, + { 0.000152e-6, 17260.154654690, 0.708528947 }, + /* 641, 650 */ + { 0.000144e-6, 6084.003848555, 5.187075177 }, + { 0.000135e-6, 5756.566278634, 1.993229262 }, + { 0.000134e-6, 5750.203491159, 3.457197134 }, + { 0.000144e-6, 5326.786694021, 6.066193291 }, + { 0.000160e-6, 11015.106477335, 1.710431974 }, + { 0.000133e-6, 3634.621024518, 2.836451652 }, + { 0.000134e-6, 18073.704938650, 5.453106665 }, + { 0.000134e-6, 1162.474704408, 5.326898811 }, + { 0.000128e-6, 5642.198242609, 2.511652591 }, + { 0.000160e-6, 632.783739313, 5.628785365 }, + /* 651, 660 */ + { 0.000132e-6, 13916.019109642, 0.819294053 }, + { 0.000122e-6, 14314.168113050, 5.677408071 }, + { 0.000125e-6, 12359.966151546, 5.251984735 }, + { 0.000121e-6, 5749.452731634, 2.210924603 }, + { 0.000136e-6, -245.831646229, 1.646502367 }, + { 0.000120e-6, 5757.317038160, 3.240883049 }, + { 0.000134e-6, 12146.667056108, 3.059480037 }, + { 0.000137e-6, 6206.809778716, 1.867105418 }, + { 0.000141e-6, 17253.041107690, 2.069217456 }, + { 0.000129e-6, -7477.522860216, 2.781469314 }, + /* 661, 670 */ + { 0.000116e-6, 5540.085789459, 4.281176991 }, + { 0.000116e-6, 9779.108676125, 3.320925381 }, + { 0.000129e-6, 5237.921013804, 3.497704076 }, + { 0.000113e-6, 5959.570433334, 0.983210840 }, + { 0.000122e-6, 6282.095528923, 2.674938860 }, + { 0.000140e-6, -11.045700264, 4.957936982 }, + { 0.000108e-6, 23543.230504682, 1.390113589 }, + { 0.000106e-6, -12569.674818332, 0.429631317 }, + { 0.000110e-6, -266.607041722, 5.501340197 }, + { 0.000115e-6, 12559.038152982, 4.691456618 }, + /* 671, 680 */ + { 0.000134e-6, -2388.894020449, 0.577313584 }, + { 0.000109e-6, 10440.274292604, 6.218148717 }, + { 0.000102e-6, -543.918059096, 1.477842615 }, + { 0.000108e-6, 21228.392023546, 2.237753948 }, + { 0.000101e-6, -4535.059436924, 3.100492232 }, + { 0.000103e-6, 76.266071276, 5.594294322 }, + { 0.000104e-6, 949.175608970, 5.674287810 }, + { 0.000101e-6, 13517.870106233, 2.196632348 }, + { 0.000100e-6, 11933.367960670, 4.056084160 }, + + /* T^2 */ + { 4.322990e-6, 6283.075849991, 2.642893748 }, + /* 681, 690 */ + { 0.406495e-6, 0.000000000, 4.712388980 }, + { 0.122605e-6, 12566.151699983, 2.438140634 }, + { 0.019476e-6, 213.299095438, 1.642186981 }, + { 0.016916e-6, 529.690965095, 4.510959344 }, + { 0.013374e-6, -3.523118349, 1.502210314 }, + { 0.008042e-6, 26.298319800, 0.478549024 }, + { 0.007824e-6, 155.420399434, 5.254710405 }, + { 0.004894e-6, 5746.271337896, 4.683210850 }, + { 0.004875e-6, 5760.498431898, 0.759507698 }, + { 0.004416e-6, 5223.693919802, 6.028853166 }, + /* 691, 700 */ + { 0.004088e-6, -7.113547001, 0.060926389 }, + { 0.004433e-6, 77713.771467920, 3.627734103 }, + { 0.003277e-6, 18849.227549974, 2.327912542 }, + { 0.002703e-6, 6062.663207553, 1.271941729 }, + { 0.003435e-6, -775.522611324, 0.747446224 }, + { 0.002618e-6, 6076.890301554, 3.633715689 }, + { 0.003146e-6, 206.185548437, 5.647874613 }, + { 0.002544e-6, 1577.343542448, 6.232904270 }, + { 0.002218e-6, -220.412642439, 1.309509946 }, + { 0.002197e-6, 5856.477659115, 2.407212349 }, + /* 701, 710 */ + { 0.002897e-6, 5753.384884897, 5.863842246 }, + { 0.001766e-6, 426.598190876, 0.754113147 }, + { 0.001738e-6, -796.298006816, 2.714942671 }, + { 0.001695e-6, 522.577418094, 2.629369842 }, + { 0.001584e-6, 5507.553238667, 1.341138229 }, + { 0.001503e-6, -242.728603974, 0.377699736 }, + { 0.001552e-6, -536.804512095, 2.904684667 }, + { 0.001370e-6, -398.149003408, 1.265599125 }, + { 0.001889e-6, -5573.142801634, 4.413514859 }, + { 0.001722e-6, 6069.776754553, 2.445966339 }, + /* 711, 720 */ + { 0.001124e-6, 1059.381930189, 5.041799657 }, + { 0.001258e-6, 553.569402842, 3.849557278 }, + { 0.000831e-6, 951.718406251, 2.471094709 }, + { 0.000767e-6, 4694.002954708, 5.363125422 }, + { 0.000756e-6, 1349.867409659, 1.046195744 }, + { 0.000775e-6, -11.045700264, 0.245548001 }, + { 0.000597e-6, 2146.165416475, 4.543268798 }, + { 0.000568e-6, 5216.580372801, 4.178853144 }, + { 0.000711e-6, 1748.016413067, 5.934271972 }, + { 0.000499e-6, 12036.460734888, 0.624434410 }, + /* 721, 730 */ + { 0.000671e-6, -1194.447010225, 4.136047594 }, + { 0.000488e-6, 5849.364112115, 2.209679987 }, + { 0.000621e-6, 6438.496249426, 4.518860804 }, + { 0.000495e-6, -6286.598968340, 1.868201275 }, + { 0.000456e-6, 5230.807466803, 1.271231591 }, + { 0.000451e-6, 5088.628839767, 0.084060889 }, + { 0.000435e-6, 5643.178563677, 3.324456609 }, + { 0.000387e-6, 10977.078804699, 4.052488477 }, + { 0.000547e-6, 161000.685737473, 2.841633844 }, + { 0.000522e-6, 3154.687084896, 2.171979966 }, + /* 731, 740 */ + { 0.000375e-6, 5486.777843175, 4.983027306 }, + { 0.000421e-6, 5863.591206116, 4.546432249 }, + { 0.000439e-6, 7084.896781115, 0.522967921 }, + { 0.000309e-6, 2544.314419883, 3.172606705 }, + { 0.000347e-6, 4690.479836359, 1.479586566 }, + { 0.000317e-6, 801.820931124, 3.553088096 }, + { 0.000262e-6, 419.484643875, 0.606635550 }, + { 0.000248e-6, 6836.645252834, 3.014082064 }, + { 0.000245e-6, -1592.596013633, 5.519526220 }, + { 0.000225e-6, 4292.330832950, 2.877956536 }, + /* 741, 750 */ + { 0.000214e-6, 7234.794256242, 1.605227587 }, + { 0.000205e-6, 5767.611978898, 0.625804796 }, + { 0.000180e-6, 10447.387839604, 3.499954526 }, + { 0.000229e-6, 199.072001436, 5.632304604 }, + { 0.000214e-6, 639.897286314, 5.960227667 }, + { 0.000175e-6, -433.711737877, 2.162417992 }, + { 0.000209e-6, 515.463871093, 2.322150893 }, + { 0.000173e-6, 6040.347246017, 2.556183691 }, + { 0.000184e-6, 6309.374169791, 4.732296790 }, + { 0.000227e-6, 149854.400134205, 5.385812217 }, + /* 751, 760 */ + { 0.000154e-6, 8031.092263058, 5.120720920 }, + { 0.000151e-6, 5739.157790895, 4.815000443 }, + { 0.000197e-6, 7632.943259650, 0.222827271 }, + { 0.000197e-6, 74.781598567, 3.910456770 }, + { 0.000138e-6, 6055.549660552, 1.397484253 }, + { 0.000149e-6, -6127.655450557, 5.333727496 }, + { 0.000137e-6, 3894.181829542, 4.281749907 }, + { 0.000135e-6, 9437.762934887, 5.979971885 }, + { 0.000139e-6, -2352.866153772, 4.715630782 }, + { 0.000142e-6, 6812.766815086, 0.513330157 }, + /* 761, 770 */ + { 0.000120e-6, -4705.732307544, 0.194160689 }, + { 0.000131e-6, -71430.695617928, 0.000379226 }, + { 0.000124e-6, 6279.552731642, 2.122264908 }, + { 0.000108e-6, -6256.777530192, 0.883445696 }, + + /* T^3 */ + { 0.143388e-6, 6283.075849991, 1.131453581 }, + { 0.006671e-6, 12566.151699983, 0.775148887 }, + { 0.001480e-6, 155.420399434, 0.480016880 }, + { 0.000934e-6, 213.299095438, 6.144453084 }, + { 0.000795e-6, 529.690965095, 2.941595619 }, + { 0.000673e-6, 5746.271337896, 0.120415406 }, + /* 771, 780 */ + { 0.000672e-6, 5760.498431898, 5.317009738 }, + { 0.000389e-6, -220.412642439, 3.090323467 }, + { 0.000373e-6, 6062.663207553, 3.003551964 }, + { 0.000360e-6, 6076.890301554, 1.918913041 }, + { 0.000316e-6, -21.340641002, 5.545798121 }, + { 0.000315e-6, -242.728603974, 1.884932563 }, + { 0.000278e-6, 206.185548437, 1.266254859 }, + { 0.000238e-6, -536.804512095, 4.532664830 }, + { 0.000185e-6, 522.577418094, 4.578313856 }, + { 0.000245e-6, 18849.227549974, 0.587467082 }, + /* 781, 787 */ + { 0.000180e-6, 426.598190876, 5.151178553 }, + { 0.000200e-6, 553.569402842, 5.355983739 }, + { 0.000141e-6, 5223.693919802, 1.336556009 }, + { 0.000104e-6, 5856.477659115, 4.239842759 }, + + /* T^4 */ + { 0.003826e-6, 6283.075849991, 5.705257275 }, + { 0.000303e-6, 12566.151699983, 5.407132842 }, + { 0.000209e-6, 155.420399434, 1.989815753 } + }; + + +/* Time since J2000.0 in Julian millennia. */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJM; + +/* ================= */ +/* Topocentric terms */ +/* ================= */ + +/* Convert UT to local solar time in radians. */ + tsol = fmod(ut, 1.0) * ERFA_D2PI + elong; + +/* FUNDAMENTAL ARGUMENTS: Simon et al. 1994. */ + +/* Combine time argument (millennia) with deg/arcsec factor. */ + w = t / 3600.0; + +/* Sun Mean Longitude. */ + elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * ERFA_DD2R; + +/* Sun Mean Anomaly. */ + emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * ERFA_DD2R; + +/* Mean Elongation of Moon from Sun. */ + d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * ERFA_DD2R; + +/* Mean Longitude of Jupiter. */ + elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * ERFA_DD2R; + +/* Mean Longitude of Saturn. */ + els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * ERFA_DD2R; + +/* TOPOCENTRIC TERMS: Moyer 1981 and Murray 1983. */ + wt = + 0.00029e-10 * u * sin(tsol + elsun - els) + + 0.00100e-10 * u * sin(tsol - 2.0 * emsun) + + 0.00133e-10 * u * sin(tsol - d) + + 0.00133e-10 * u * sin(tsol + elsun - elj) + - 0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun) + - 0.02200e-10 * v * cos(elsun + emsun) + + 0.05312e-10 * u * sin(tsol - emsun) + - 0.13677e-10 * u * sin(tsol + 2.0 * elsun) + - 1.31840e-10 * v * cos(elsun) + + 3.17679e-10 * u * sin(tsol); + +/* ===================== */ +/* Fairhead et al. model */ +/* ===================== */ + +/* T**0 */ + w0 = 0; + for (j = 473; j >= 0; j--) { + w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]); + } + +/* T**1 */ + w1 = 0; + for (j = 678; j >= 474; j--) { + w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]); + } + +/* T**2 */ + w2 = 0; + for (j = 763; j >= 679; j--) { + w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]); + } + +/* T**3 */ + w3 = 0; + for (j = 783; j >= 764; j--) { + w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]); + } + +/* T**4 */ + w4 = 0; + for (j = 786; j >= 784; j--) { + w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]); + } + +/* Multiply by powers of T and combine. */ + wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0; + +/* Adjustments to use JPL planetary masses instead of IAU. */ + wj = 0.00065e-6 * sin(6069.776754 * t + 4.021194) + + 0.00033e-6 * sin( 213.299095 * t + 5.543132) + + (-0.00196e-6 * sin(6208.294251 * t + 5.696701)) + + (-0.00173e-6 * sin( 74.781599 * t + 2.435900)) + + 0.03638e-6 * t * t; + +/* ============ */ +/* Final result */ +/* ============ */ + +/* TDB-TT in seconds. */ + w = wt + wf + wj; + + return w; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/dtf2d.c b/testbed/astropy__astropy/cextern/erfa/dtf2d.c new file mode 100644 index 0000000000000000000000000000000000000000..6d5a8da06060829be517b78e8d0237a4a4350f9d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/dtf2d.c @@ -0,0 +1,212 @@ +#include "erfa.h" +#include + +int eraDtf2d(const char *scale, int iy, int im, int id, + int ihr, int imn, double sec, double *d1, double *d2) +/* +** - - - - - - - - - +** e r a D t f 2 d +** - - - - - - - - - +** +** Encode date and time fields into 2-part Julian Date (or in the case +** of UTC a quasi-JD form that includes special provision for leap +** seconds). +** +** Given: +** scale char[] time scale ID (Note 1) +** iy,im,id int year, month, day in Gregorian calendar (Note 2) +** ihr,imn int hour, minute +** sec double seconds +** +** Returned: +** d1,d2 double 2-part Julian Date (Notes 3,4) +** +** Returned (function value): +** int status: +3 = both of next two +** +2 = time is after end of day (Note 5) +** +1 = dubious year (Note 6) +** 0 = OK +** -1 = bad year +** -2 = bad month +** -3 = bad day +** -4 = bad hour +** -5 = bad minute +** -6 = bad second (<0) +** +** Notes: +** +** 1) scale identifies the time scale. Only the value "UTC" (in upper +** case) is significant, and enables handling of leap seconds (see +** Note 4). +** +** 2) For calendar conventions and limitations, see eraCal2jd. +** +** 3) The sum of the results, d1+d2, is Julian Date, where normally d1 +** is the Julian Day Number and d2 is the fraction of a day. In the +** case of UTC, where the use of JD is problematical, special +** conventions apply: see the next note. +** +** 4) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The ERFA internal convention is that +** the quasi-JD day represents UTC days whether the length is 86399, +** 86400 or 86401 SI seconds. In the 1960-1972 era there were +** smaller jumps (in either direction) each time the linear UTC(TAI) +** expression was changed, and these "mini-leaps" are also included +** in the ERFA convention. +** +** 5) The warning status "time is after end of day" usually means that +** the sec argument is greater than 60.0. However, in a day ending +** in a leap second the limit changes to 61.0 (or 59.0 in the case +** of a negative leap second). +** +** 6) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** 7) Only in the case of continuous and regular time scales (TAI, TT, +** TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly +** speaking. In the other cases (UT1 and UTC) the result must be +** used with circumspection; in particular the difference between +** two such results cannot be interpreted as a precise time +** interval. +** +** Called: +** eraCal2jd Gregorian calendar to JD +** eraDat delta(AT) = TAI-UTC +** eraJd2cal JD to Gregorian calendar +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int js, iy2, im2, id2; + double dj, w, day, seclim, dat0, dat12, dat24, dleap, time; + + +/* Today's Julian Day Number. */ + js = eraCal2jd(iy, im, id, &dj, &w); + if ( js ) return js; + dj += w; + +/* Day length and final minute length in seconds (provisional). */ + day = ERFA_DAYSEC; + seclim = 60.0; + +/* Deal with the UTC leap second case. */ + if ( ! strcmp(scale,"UTC") ) { + + /* TAI-UTC at 0h today. */ + js = eraDat(iy, im, id, 0.0, &dat0); + if ( js < 0 ) return js; + + /* TAI-UTC at 12h today (to detect drift). */ + js = eraDat(iy, im, id, 0.5, &dat12); + if ( js < 0 ) return js; + + /* TAI-UTC at 0h tomorrow (to detect jumps). */ + js = eraJd2cal ( dj, 1.5, &iy2, &im2, &id2, &w); + if ( js ) return js; + js = eraDat(iy2, im2, id2, 0.0, &dat24); + if ( js < 0 ) return js; + + /* Any sudden change in TAI-UTC between today and tomorrow. */ + dleap = dat24 - (2.0*dat12 - dat0); + + /* If leap second day, correct the day and final minute lengths. */ + day += dleap; + if ( ihr == 23 && imn == 59 ) seclim += dleap; + + /* End of UTC-specific actions. */ + } + +/* Validate the time. */ + if ( ihr >= 0 && ihr <= 23 ) { + if ( imn >= 0 && imn <= 59 ) { + if ( sec >= 0 ) { + if ( sec >= seclim ) { + js += 2; + } + } else { + js = -6; + } + } else { + js = -5; + } + } else { + js = -4; + } + if ( js < 0 ) return js; + +/* The time in days. */ + time = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day; + +/* Return the date and time. */ + *d1 = dj; + *d2 = time; + +/* Status. */ + return js; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eceq06.c b/testbed/astropy__astropy/cextern/erfa/eceq06.c new file mode 100644 index 0000000000000000000000000000000000000000..d5f79a57597d9f9c11cfba7773e43f5ffc5128bc --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eceq06.c @@ -0,0 +1,141 @@ +#include "erfa.h" + +void eraEceq06(double date1, double date2, double dl, double db, + double *dr, double *dd) +/* +** - - - - - - - - - - +** e r a E c e q 0 6 +** - - - - - - - - - - +** +** Transformation from ecliptic coordinates (mean equinox and ecliptic +** of date) to ICRS RA,Dec, using the IAU 2006 precession model. +** +** Given: +** date1,date2 double TT as a 2-part Julian date (Note 1) +** dl,db double ecliptic longitude and latitude (radians) +** +** Returned: +** dr,dd double ICRS right ascension and declination (radians) +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) No assumptions are made about whether the coordinates represent +** starlight and embody astrometric effects such as parallax or +** aberration. +** +** 3) The transformation is approximately that from ecliptic longitude +** and latitude (mean equinox and ecliptic of date) to mean J2000.0 +** right ascension and declination, with only frame bias (always +** less than 25 mas) to disturb this classical picture. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006 +** eraTrxp product of transpose of r-matrix and p-vector +** eraC2s unit vector to spherical coordinates +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rm[3][3], v1[3], v2[3], a, b; + + +/* Spherical to Cartesian. */ + eraS2c(dl, db, v1); + +/* Rotation matrix, ICRS equatorial to ecliptic. */ + eraEcm06(date1, date2, rm); + +/* The transformation from ecliptic to ICRS. */ + eraTrxp(rm, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, &a, &b); + +/* Express in conventional ranges. */ + *dr = eraAnp(a); + *dd = eraAnpm(b); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ecm06.c b/testbed/astropy__astropy/cextern/erfa/ecm06.c new file mode 100644 index 0000000000000000000000000000000000000000..7e0d8271ddf3bbe9477e7b267a15f0c6a8854694 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ecm06.c @@ -0,0 +1,144 @@ +#include "erfa.h" + +void eraEcm06(double date1, double date2, double rm[3][3]) +/* +** - - - - - - - - - +** e r a E c m 0 6 +** - - - - - - - - - +** +** ICRS equatorial to ecliptic rotation matrix, IAU 2006. +** +** Given: +** date1,date2 double TT as a 2-part Julian date (Note 1) +** +** Returned: +** rm double[3][3] ICRS to ecliptic rotation matrix +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 1) The matrix is in the sense +** +** E_ep = rm x P_ICRS, +** +** where P_ICRS is a vector with respect to ICRS right ascension +** and declination axes and E_ep is the same vector with respect to +** the (inertial) ecliptic and equinox of date. +** +** 2) P_ICRS is a free vector, merely a direction, typically of unit +** magnitude, and not bound to any particular spatial origin, such +** as the Earth, Sun or SSB. No assumptions are made about whether +** it represents starlight and embodies astrometric effects such as +** parallax or aberration. The transformation is approximately that +** between mean J2000.0 right ascension and declination and ecliptic +** longitude and latitude, with only frame bias (always less than +** 25 mas) to disturb this classical picture. +** +** Called: +** eraObl06 mean obliquity, IAU 2006 +** eraPmat06 PB matrix, IAU 2006 +** eraIr initialize r-matrix to identity +** eraRx rotate around X-axis +** eraRxr product of two r-matrices +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ob, bp[3][3], e[3][3]; + + +/* Obliquity, IAU 2006. */ + ob = eraObl06(date1, date2); + +/* Precession-bias matrix, IAU 2006. */ + eraPmat06(date1, date2, bp); + +/* Equatorial of date to ecliptic matrix. */ + eraIr(e); + eraRx(ob, e); + +/* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */ + eraRxr(e, bp, rm); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ee00.c b/testbed/astropy__astropy/cextern/erfa/ee00.c new file mode 100644 index 0000000000000000000000000000000000000000..51539f8da12afcc5db20d739c1632f2c33501d87 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ee00.c @@ -0,0 +1,137 @@ +#include "erfa.h" + +double eraEe00(double date1, double date2, double epsa, double dpsi) +/* +** - - - - - - - - +** e r a E e 0 0 +** - - - - - - - - +** +** The equation of the equinoxes, compatible with IAU 2000 resolutions, +** given the nutation in longitude and the mean obliquity. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** epsa double mean obliquity (Note 2) +** dpsi double nutation in longitude (Note 3) +** +** Returned (function value): +** double equation of the equinoxes (Note 4) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The obliquity, in radians, is mean of date. +** +** 3) The result, which is in radians, operates in the following sense: +** +** Greenwich apparent ST = GMST + equation of the equinoxes +** +** 4) The result is compatible with the IAU 2000 resolutions. For +** further details, see IERS Conventions 2003 and Capitaine et al. +** (2002). +** +** Called: +** eraEect00 equation of the equinoxes complementary terms +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ee; + + +/* Equation of the equinoxes. */ + ee = dpsi * cos(epsa) + eraEect00(date1, date2); + + return ee; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ee00a.c b/testbed/astropy__astropy/cextern/erfa/ee00a.c new file mode 100644 index 0000000000000000000000000000000000000000..198c9848b0a5ecce71a6555dcec941b0b7894903 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ee00a.c @@ -0,0 +1,144 @@ +#include "erfa.h" + +double eraEe00a(double date1, double date2) +/* +** - - - - - - - - - +** e r a E e 0 0 a +** - - - - - - - - - +** +** Equation of the equinoxes, compatible with IAU 2000 resolutions. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double equation of the equinoxes (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result, which is in radians, operates in the following sense: +** +** Greenwich apparent ST = GMST + equation of the equinoxes +** +** 3) The result is compatible with the IAU 2000 resolutions. For +** further details, see IERS Conventions 2003 and Capitaine et al. +** (2002). +** +** Called: +** eraPr00 IAU 2000 precession adjustments +** eraObl80 mean obliquity, IAU 1980 +** eraNut00a nutation, IAU 2000A +** eraEe00 equation of the equinoxes, IAU 2000 +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003). +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsipr, depspr, epsa, dpsi, deps, ee; + + +/* IAU 2000 precession-rate adjustments. */ + eraPr00(date1, date2, &dpsipr, &depspr); + +/* Mean obliquity, consistent with IAU 2000 precession-nutation. */ + epsa = eraObl80(date1, date2) + depspr; + +/* Nutation in longitude. */ + eraNut00a(date1, date2, &dpsi, &deps); + +/* Equation of the equinoxes. */ + ee = eraEe00(date1, date2, epsa, dpsi); + + return ee; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ee00b.c b/testbed/astropy__astropy/cextern/erfa/ee00b.c new file mode 100644 index 0000000000000000000000000000000000000000..424da004a116ec599d5112085057c7494bd4f466 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ee00b.c @@ -0,0 +1,150 @@ +#include "erfa.h" + +double eraEe00b(double date1, double date2) +/* +** - - - - - - - - - +** e r a E e 0 0 b +** - - - - - - - - - +** +** Equation of the equinoxes, compatible with IAU 2000 resolutions but +** using the truncated nutation model IAU 2000B. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double equation of the equinoxes (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result, which is in radians, operates in the following sense: +** +** Greenwich apparent ST = GMST + equation of the equinoxes +** +** 3) The result is compatible with the IAU 2000 resolutions except +** that accuracy has been compromised for the sake of speed. For +** further details, see McCarthy & Luzum (2001), IERS Conventions +** 2003 and Capitaine et al. (2003). +** +** Called: +** eraPr00 IAU 2000 precession adjustments +** eraObl80 mean obliquity, IAU 1980 +** eraNut00b nutation, IAU 2000B +** eraEe00 equation of the equinoxes, IAU 2000 +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** McCarthy, D.D. & Luzum, B.J., "An abridged model of the +** precession-nutation of the celestial pole", Celestial Mechanics & +** Dynamical Astronomy, 85, 37-49 (2003) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsipr, depspr, epsa, dpsi, deps, ee; + + +/* IAU 2000 precession-rate adjustments. */ + eraPr00(date1, date2, &dpsipr, &depspr); + +/* Mean obliquity, consistent with IAU 2000 precession-nutation. */ + epsa = eraObl80(date1, date2) + depspr; + +/* Nutation in longitude. */ + eraNut00b(date1, date2, &dpsi, &deps); + +/* Equation of the equinoxes. */ + ee = eraEe00(date1, date2, epsa, dpsi); + + return ee; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ee06a.c b/testbed/astropy__astropy/cextern/erfa/ee06a.c new file mode 100644 index 0000000000000000000000000000000000000000..63d8de996e4d3e566a6e536c9be8be17485c6830 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ee06a.c @@ -0,0 +1,131 @@ +#include "erfa.h" + +double eraEe06a(double date1, double date2) +/* +** - - - - - - - - - +** e r a E e 0 6 a +** - - - - - - - - - +** +** Equation of the equinoxes, compatible with IAU 2000 resolutions and +** IAU 2006/2000A precession-nutation. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double equation of the equinoxes (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result, which is in radians, operates in the following sense: +** +** Greenwich apparent ST = GMST + equation of the equinoxes +** +** Called: +** eraAnpm normalize angle into range +/- pi +** eraGst06a Greenwich apparent sidereal time, IAU 2006/2000A +** eraGmst06 Greenwich mean sidereal time, IAU 2006 +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gst06a, gmst06, ee; + + +/* Apparent and mean sidereal times. */ + gst06a = eraGst06a(0.0, 0.0, date1, date2); + gmst06 = eraGmst06(0.0, 0.0, date1, date2); + +/* Equation of the equinoxes. */ + ee = eraAnpm(gst06a - gmst06); + + return ee; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eect00.c b/testbed/astropy__astropy/cextern/erfa/eect00.c new file mode 100644 index 0000000000000000000000000000000000000000..709ba53de1f8f006c52d4e5c199450b4b1d09359 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eect00.c @@ -0,0 +1,291 @@ +#include "erfa.h" + +double eraEect00(double date1, double date2) +/* +** - - - - - - - - - - +** e r a E e c t 0 0 +** - - - - - - - - - - +** +** Equation of the equinoxes complementary terms, consistent with +** IAU 2000 resolutions. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double complementary terms (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The "complementary terms" are part of the equation of the +** equinoxes (EE), classically the difference between apparent and +** mean Sidereal Time: +** +** GAST = GMST + EE +** +** with: +** +** EE = dpsi * cos(eps) +** +** where dpsi is the nutation in longitude and eps is the obliquity +** of date. However, if the rotation of the Earth were constant in +** an inertial frame the classical formulation would lead to +** apparent irregularities in the UT1 timescale traceable to side- +** effects of precession-nutation. In order to eliminate these +** effects from UT1, "complementary terms" were introduced in 1994 +** (IAU, 1994) and took effect from 1997 (Capitaine and Gontier, +** 1993): +** +** GAST = GMST + CT + EE +** +** By convention, the complementary terms are included as part of +** the equation of the equinoxes rather than as part of the mean +** Sidereal Time. This slightly compromises the "geometrical" +** interpretation of mean sidereal time but is otherwise +** inconsequential. +** +** The present function computes CT in the above expression, +** compatible with IAU 2000 resolutions (Capitaine et al., 2002, and +** IERS Conventions 2003). +** +** Called: +** eraFal03 mean anomaly of the Moon +** eraFalp03 mean anomaly of the Sun +** eraFaf03 mean argument of the latitude of the Moon +** eraFad03 mean elongation of the Moon from the Sun +** eraFaom03 mean longitude of the Moon's ascending node +** eraFave03 mean longitude of Venus +** eraFae03 mean longitude of Earth +** eraFapa03 general accumulated precession in longitude +** +** References: +** +** Capitaine, N. & Gontier, A.-M., Astron. Astrophys., 275, +** 645-650 (1993) +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** IAU Resolution C7, Recommendation 3 (1994) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Time since J2000.0, in Julian centuries */ + double t; + +/* Miscellaneous */ + int i, j; + double a, s0, s1; + +/* Fundamental arguments */ + double fa[14]; + +/* Returned value. */ + double eect; + +/* ----------------------------------------- */ +/* The series for the EE complementary terms */ +/* ----------------------------------------- */ + + typedef struct { + int nfa[8]; /* coefficients of l,l',F,D,Om,LVe,LE,pA */ + double s, c; /* sine and cosine coefficients */ + } TERM; + +/* Terms of order t^0 */ + static const TERM e0[] = { + + /* 1-10 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 2640.96e-6, -0.39e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, 63.52e-6, -0.02e-6 }, + {{ 0, 0, 2, -2, 3, 0, 0, 0}, 11.75e-6, 0.01e-6 }, + {{ 0, 0, 2, -2, 1, 0, 0, 0}, 11.21e-6, 0.01e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, -4.55e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 3, 0, 0, 0}, 2.02e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 1, 0, 0, 0}, 1.98e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 3, 0, 0, 0}, -1.72e-6, 0.00e-6 }, + {{ 0, 1, 0, 0, 1, 0, 0, 0}, -1.41e-6, -0.01e-6 }, + {{ 0, 1, 0, 0, -1, 0, 0, 0}, -1.26e-6, -0.01e-6 }, + + /* 11-20 */ + {{ 1, 0, 0, 0, -1, 0, 0, 0}, -0.63e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, 1, 0, 0, 0}, -0.63e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 3, 0, 0, 0}, 0.46e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 1, 0, 0, 0}, 0.45e-6, 0.00e-6 }, + {{ 0, 0, 4, -4, 4, 0, 0, 0}, 0.36e-6, 0.00e-6 }, + {{ 0, 0, 1, -1, 1, -8, 12, 0}, -0.24e-6, -0.12e-6 }, + {{ 0, 0, 2, 0, 0, 0, 0, 0}, 0.32e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, 0.28e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 3, 0, 0, 0}, 0.27e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 1, 0, 0, 0}, 0.26e-6, 0.00e-6 }, + + /* 21-30 */ + {{ 0, 0, 2, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -3, 0, 0, 0}, 0.19e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -1, 0, 0, 0}, 0.18e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 0, 8,-13, -1}, -0.10e-6, 0.05e-6 }, + {{ 0, 0, 0, 2, 0, 0, 0, 0}, 0.15e-6, 0.00e-6 }, + {{ 2, 0, -2, 0, -1, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, 1, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 2, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, -1, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 0, 0, 4, -2, 4, 0, 0, 0}, 0.13e-6, 0.00e-6 }, + + /* 31-33 */ + {{ 0, 0, 2, -2, 4, 0, 0, 0}, -0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -3, 0, 0, 0}, 0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -1, 0, 0, 0}, 0.11e-6, 0.00e-6 } + }; + +/* Terms of order t^1 */ + static const TERM e1[] = { + {{ 0, 0, 0, 0, 1, 0, 0, 0}, -0.87e-6, 0.00e-6 } + }; + +/* Number of terms in the series */ + const int NE0 = (int) (sizeof e0 / sizeof (TERM)); + const int NE1 = (int) (sizeof e1 / sizeof (TERM)); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental epoch J2000.0 and current date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Fundamental Arguments (from IERS Conventions 2003) */ + +/* Mean anomaly of the Moon. */ + fa[0] = eraFal03(t); + +/* Mean anomaly of the Sun. */ + fa[1] = eraFalp03(t); + +/* Mean longitude of the Moon minus that of the ascending node. */ + fa[2] = eraFaf03(t); + +/* Mean elongation of the Moon from the Sun. */ + fa[3] = eraFad03(t); + +/* Mean longitude of the ascending node of the Moon. */ + fa[4] = eraFaom03(t); + +/* Mean longitude of Venus. */ + fa[5] = eraFave03(t); + +/* Mean longitude of Earth. */ + fa[6] = eraFae03(t); + +/* General precession in longitude. */ + fa[7] = eraFapa03(t); + +/* Evaluate the EE complementary terms. */ + s0 = 0.0; + s1 = 0.0; + + for (i = NE0-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)(e0[i].nfa[j]) * fa[j]; + } + s0 += e0[i].s * sin(a) + e0[i].c * cos(a); + } + + for (i = NE1-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)(e1[i].nfa[j]) * fa[j]; + } + s1 += e1[i].s * sin(a) + e1[i].c * cos(a); + } + + eect = (s0 + s1 * t ) * ERFA_DAS2R; + + return eect; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eform.c b/testbed/astropy__astropy/cextern/erfa/eform.c new file mode 100644 index 0000000000000000000000000000000000000000..dffdd7f1d9cf3d6de215ac9c3b478f0bd22fa649 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eform.c @@ -0,0 +1,155 @@ +#include "erfa.h" + +int eraEform ( int n, double *a, double *f ) +/* +** - - - - - - - - - +** e r a E f o r m +** - - - - - - - - - +** +** Earth reference ellipsoids. +** +** Given: +** n int ellipsoid identifier (Note 1) +** +** Returned: +** a double equatorial radius (meters, Note 2) +** f double flattening (Note 2) +** +** Returned (function value): +** int status: 0 = OK +** -1 = illegal identifier (Note 3) +** +** Notes: +** +** 1) The identifier n is a number that specifies the choice of +** reference ellipsoid. The following are supported: +** +** n ellipsoid +** +** 1 ERFA_WGS84 +** 2 ERFA_GRS80 +** 3 ERFA_WGS72 +** +** The n value has no significance outside the ERFA software. For +** convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. +** +** 2) The ellipsoid parameters are returned in the form of equatorial +** radius in meters (a) and flattening (f). The latter is a number +** around 0.00335, i.e. around 1/298. +** +** 3) For the case where an unsupported n value is supplied, zero a and +** f are returned, as well as error status. +** +** References: +** +** Department of Defense World Geodetic System 1984, National +** Imagery and Mapping Agency Technical Report 8350.2, Third +** Edition, p3-2. +** +** Moritz, H., Bull. Geodesique 66-2, 187 (1992). +** +** The Department of Defense World Geodetic System 1972, World +** Geodetic System Committee, May 1974. +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** p220. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Look up a and f for the specified reference ellipsoid. */ + switch ( n ) { + + case ERFA_WGS84: + *a = 6378137.0; + *f = 1.0 / 298.257223563; + break; + + case ERFA_GRS80: + *a = 6378137.0; + *f = 1.0 / 298.257222101; + break; + + case ERFA_WGS72: + *a = 6378135.0; + *f = 1.0 / 298.26; + break; + + default: + + /* Invalid identifier. */ + *a = 0.0; + *f = 0.0; + return -1; + + } + +/* OK status. */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eo06a.c b/testbed/astropy__astropy/cextern/erfa/eo06a.c new file mode 100644 index 0000000000000000000000000000000000000000..47c2b4a245b84948b9c91210f7f6ac944f11fb7f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eo06a.c @@ -0,0 +1,140 @@ +#include "erfa.h" + +double eraEo06a(double date1, double date2) +/* +** - - - - - - - - - +** e r a E o 0 6 a +** - - - - - - - - - +** +** Equation of the origins, IAU 2006 precession and IAU 2000A nutation. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double equation of the origins in radians +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The equation of the origins is the distance between the true +** equinox and the celestial intermediate origin and, equivalently, +** the difference between Earth rotation angle and Greenwich +** apparent sidereal time (ERA-GST). It comprises the precession +** (since J2000.0) in right ascension plus the equation of the +** equinoxes (including the small correction terms). +** +** Called: +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** eraEors equation of the origins, given NPB matrix and s +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r[3][3], x, y, s, eo; + + +/* Classical nutation x precession x bias matrix. */ + eraPnm06a(date1, date2, r); + +/* Extract CIP coordinates. */ + eraBpn2xy(r, &x, &y); + +/* The CIO locator, s. */ + s = eraS06(date1, date2, x, y); + +/* Solve for the EO. */ + eo = eraEors(r, s); + + return eo; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eors.c b/testbed/astropy__astropy/cextern/erfa/eors.c new file mode 100644 index 0000000000000000000000000000000000000000..ec05a0911b606145ce739405db146d2375510175 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eors.c @@ -0,0 +1,117 @@ +#include "erfa.h" + +double eraEors(double rnpb[3][3], double s) +/* +** - - - - - - - - +** e r a E o r s +** - - - - - - - - +** +** Equation of the origins, given the classical NPB matrix and the +** quantity s. +** +** Given: +** rnpb double[3][3] classical nutation x precession x bias matrix +** s double the quantity s (the CIO locator) +** +** Returned (function value): +** double the equation of the origins in radians. +** +** Notes: +** +** 1) The equation of the origins is the distance between the true +** equinox and the celestial intermediate origin and, equivalently, +** the difference between Earth rotation angle and Greenwich +** apparent sidereal time (ERA-GST). It comprises the precession +** (since J2000.0) in right ascension plus the equation of the +** equinoxes (including the small correction terms). +** +** 2) The algorithm is from Wallace & Capitaine (2006). +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, ax, xs, ys, zs, p, q, eo; + + +/* Evaluate Wallace & Capitaine (2006) expression (16). */ + x = rnpb[2][0]; + ax = x / (1.0 + rnpb[2][2]); + xs = 1.0 - ax * x; + ys = -ax * rnpb[2][1]; + zs = -x; + p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs; + q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs; + eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s; + + return eo; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/epb.c b/testbed/astropy__astropy/cextern/erfa/epb.c new file mode 100644 index 0000000000000000000000000000000000000000..8f2575fcb877b94ed5161a737b4a9d27006e6337 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/epb.c @@ -0,0 +1,100 @@ +#include "erfa.h" + +double eraEpb(double dj1, double dj2) +/* +** - - - - - - - +** e r a E p b +** - - - - - - - +** +** Julian Date to Besselian Epoch. +** +** Given: +** dj1,dj2 double Julian Date (see note) +** +** Returned (function value): +** double Besselian Epoch. +** +** Note: +** +** The Julian Date is supplied in two pieces, in the usual ERFA +** manner, which is designed to preserve time resolution. The +** Julian Date is available as a single number by adding dj1 and +** dj2. The maximum resolution is achieved if dj1 is 2451545.0 +** (J2000.0). +** +** Reference: +** +** Lieske, J.H., 1979. Astron.Astrophys., 73, 282. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* J2000.0-B1900.0 (2415019.81352) in days */ + const double D1900 = 36524.68648; + + return 1900.0 + ((dj1 - ERFA_DJ00) + (dj2 + D1900)) / ERFA_DTY; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/epb2jd.c b/testbed/astropy__astropy/cextern/erfa/epb2jd.c new file mode 100644 index 0000000000000000000000000000000000000000..13b9476f6ddbdbbc1570173124dd27883a7b20c7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/epb2jd.c @@ -0,0 +1,100 @@ +#include "erfa.h" + +void eraEpb2jd(double epb, double *djm0, double *djm) +/* +** - - - - - - - - - - +** e r a E p b 2 j d +** - - - - - - - - - - +** +** Besselian Epoch to Julian Date. +** +** Given: +** epb double Besselian Epoch (e.g. 1957.3) +** +** Returned: +** djm0 double MJD zero-point: always 2400000.5 +** djm double Modified Julian Date +** +** Note: +** +** The Julian Date is returned in two pieces, in the usual ERFA +** manner, which is designed to preserve time resolution. The +** Julian Date is available as a single number by adding djm0 and +** djm. +** +** Reference: +** +** Lieske, J.H., 1979, Astron.Astrophys. 73, 282. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + *djm0 = ERFA_DJM0; + *djm = 15019.81352 + (epb - 1900.0) * ERFA_DTY; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/epj.c b/testbed/astropy__astropy/cextern/erfa/epj.c new file mode 100644 index 0000000000000000000000000000000000000000..5247ea26b42302cc87a452c234b814936c1fde17 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/epj.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +double eraEpj(double dj1, double dj2) +/* +** - - - - - - - +** e r a E p j +** - - - - - - - +** +** Julian Date to Julian Epoch. +** +** Given: +** dj1,dj2 double Julian Date (see note) +** +** Returned (function value): +** double Julian Epoch +** +** Note: +** +** The Julian Date is supplied in two pieces, in the usual ERFA +** manner, which is designed to preserve time resolution. The +** Julian Date is available as a single number by adding dj1 and +** dj2. The maximum resolution is achieved if dj1 is 2451545.0 +** (J2000.0). +** +** Reference: +** +** Lieske, J.H., 1979, Astron.Astrophys. 73, 282. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double epj; + + + epj = 2000.0 + ((dj1 - ERFA_DJ00) + dj2) / ERFA_DJY; + + return epj; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/epj2jd.c b/testbed/astropy__astropy/cextern/erfa/epj2jd.c new file mode 100644 index 0000000000000000000000000000000000000000..752ae9968da49039b20a460e7a38971eaf1ede0c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/epj2jd.c @@ -0,0 +1,100 @@ +#include "erfa.h" + +void eraEpj2jd(double epj, double *djm0, double *djm) +/* +** - - - - - - - - - - +** e r a E p j 2 j d +** - - - - - - - - - - +** +** Julian Epoch to Julian Date. +** +** Given: +** epj double Julian Epoch (e.g. 1996.8) +** +** Returned: +** djm0 double MJD zero-point: always 2400000.5 +** djm double Modified Julian Date +** +** Note: +** +** The Julian Date is returned in two pieces, in the usual ERFA +** manner, which is designed to preserve time resolution. The +** Julian Date is available as a single number by adding djm0 and +** djm. +** +** Reference: +** +** Lieske, J.H., 1979, Astron.Astrophys. 73, 282. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + *djm0 = ERFA_DJM0; + *djm = ERFA_DJM00 + (epj - 2000.0) * 365.25; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/epv00.c b/testbed/astropy__astropy/cextern/erfa/epv00.c new file mode 100644 index 0000000000000000000000000000000000000000..9d91fe070a8b749e1c67601bb5719ce6f1f53f7a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/epv00.c @@ -0,0 +1,2598 @@ +#include "erfa.h" + +int eraEpv00(double date1, double date2, + double pvh[2][3], double pvb[2][3]) +/* +** - - - - - - - - - +** e r a E p v 0 0 +** - - - - - - - - - +** +** Earth position and velocity, heliocentric and barycentric, with +** respect to the Barycentric Celestial Reference System. +** +** Given: +** date1,date2 double TDB date (Note 1) +** +** Returned: +** pvh double[2][3] heliocentric Earth position/velocity +** pvb double[2][3] barycentric Earth position/velocity +** +** Returned (function value): +** int status: 0 = OK +** +1 = warning: date outside +** the range 1900-2100 AD +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, among +** others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. However, +** the accuracy of the result is more likely to be limited by the +** algorithm itself than the way the date has been expressed. +** +** n.b. TT can be used instead of TDB in most applications. +** +** 2) On return, the arrays pvh and pvb contain the following: +** +** pvh[0][0] x } +** pvh[0][1] y } heliocentric position, au +** pvh[0][2] z } +** +** pvh[1][0] xdot } +** pvh[1][1] ydot } heliocentric velocity, au/d +** pvh[1][2] zdot } +** +** pvb[0][0] x } +** pvb[0][1] y } barycentric position, au +** pvb[0][2] z } +** +** pvb[1][0] xdot } +** pvb[1][1] ydot } barycentric velocity, au/d +** pvb[1][2] zdot } +** +** The vectors are with respect to the Barycentric Celestial +** Reference System. The time unit is one day in TDB. +** +** 3) The function is a SIMPLIFIED SOLUTION from the planetary theory +** VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics & +** Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original +** Fortran code supplied by P. Bretagnon (private comm., 2000). +** +** 4) Comparisons over the time span 1900-2100 with this simplified +** solution and the JPL DE405 ephemeris give the following results: +** +** RMS max +** Heliocentric: +** position error 3.7 11.2 km +** velocity error 1.4 5.0 mm/s +** +** Barycentric: +** position error 4.6 13.4 km +** velocity error 1.4 4.9 mm/s +** +** Comparisons with the JPL DE406 ephemeris show that by 1800 and +** 2200 the position errors are approximately double their 1900-2100 +** size. By 1500 and 2500 the deterioration is a factor of 10 and +** by 1000 and 3000 a factor of 60. The velocity accuracy falls off +** at about half that rate. +** +** 5) It is permissible to use the same array for pvh and pvb, which +** will receive the barycentric values. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* +** Matrix elements for orienting the analytical model to DE405. +** +** The corresponding Euler angles are: +** +** d ' " +** 1st rotation - 23 26 21.4091 about the x-axis (obliquity) +** 2nd rotation + 0.0475 about the z-axis (RA offset) +** +** These were obtained empirically, by comparisons with DE405 over +** 1900-2100. +*/ + static const double am12 = 0.000000211284, + am13 = -0.000000091603, + am21 = -0.000000230286, + am22 = 0.917482137087, + am23 = -0.397776982902, + am32 = 0.397776982902, + am33 = 0.917482137087; + +/* +** ---------------------- +** Ephemeris Coefficients +** ---------------------- +** +** The ephemeris consists of harmonic terms for predicting (i) the Sun +** to Earth vector and (ii) the Solar-System-barycenter to Sun vector +** respectively. The coefficients are stored in arrays which, although +** 1-demensional, contain groups of three. Each triplet of +** coefficients is the amplitude, phase and frequency for one term in +** the model, and each array contains the number of terms called for by +** the model. +** +** There are eighteen such arrays, named as follows: +** +** array model power of T component +** +** e0x Sun-to-Earth 0 x +** e0y Sun-to-Earth 0 y +** e0z Sun-to-Earth 0 z +** +** e1x Sun-to-Earth 1 x +** e1y Sun-to-Earth 1 y +** e1z Sun-to-Earth 1 z +** +** e2x Sun-to-Earth 2 x +** e2y Sun-to-Earth 2 y +** e2z Sun-to-Earth 2 z +** +** s0x SSB-to-Sun 0 x +** s0y SSB-to-Sun 0 y +** s0z SSB-to-Sun 0 z +** +** s1x SSB-to-Sun 1 x +** s1y SSB-to-Sun 1 y +** s1z SSB-to-Sun 1 z +** +** s2x SSB-to-Sun 2 x +** s2y SSB-to-Sun 2 y +** s2z SSB-to-Sun 2 z +*/ + +/* Sun-to-Earth, T^0, X */ + static const double e0x[] = { + 0.9998292878132e+00, 0.1753485171504e+01, 0.6283075850446e+01, + 0.8352579567414e-02, 0.1710344404582e+01, 0.1256615170089e+02, + 0.5611445335148e-02, 0.0000000000000e+00, 0.0000000000000e+00, + 0.1046664295572e-03, 0.1667225416770e+01, 0.1884922755134e+02, + 0.3110842534677e-04, 0.6687513390251e+00, 0.8399684731857e+02, + 0.2552413503550e-04, 0.5830637358413e+00, 0.5296909721118e+00, + 0.2137207845781e-04, 0.1092330954011e+01, 0.1577343543434e+01, + 0.1680240182951e-04, 0.4955366134987e+00, 0.6279552690824e+01, + 0.1679012370795e-04, 0.6153014091901e+01, 0.6286599010068e+01, + 0.1445526946777e-04, 0.3472744100492e+01, 0.2352866153506e+01, + + 0.1091038246184e-04, 0.3689845786119e+01, 0.5223693906222e+01, + 0.9344399733932e-05, 0.6073934645672e+01, 0.1203646072878e+02, + 0.8993182910652e-05, 0.3175705249069e+01, 0.1021328554739e+02, + 0.5665546034116e-05, 0.2152484672246e+01, 0.1059381944224e+01, + 0.6844146703035e-05, 0.1306964099750e+01, 0.5753384878334e+01, + 0.7346610905565e-05, 0.4354980070466e+01, 0.3981490189893e+00, + 0.6815396474414e-05, 0.2218229211267e+01, 0.4705732307012e+01, + 0.6112787253053e-05, 0.5384788425458e+01, 0.6812766822558e+01, + 0.4518120711239e-05, 0.6087604012291e+01, 0.5884926831456e+01, + 0.4521963430706e-05, 0.1279424524906e+01, 0.6256777527156e+01, + + 0.4497426764085e-05, 0.5369129144266e+01, 0.6309374173736e+01, + 0.4062190566959e-05, 0.5436473303367e+00, 0.6681224869435e+01, + 0.5412193480192e-05, 0.7867838528395e+00, 0.7755226100720e+00, + 0.5469839049386e-05, 0.1461440311134e+01, 0.1414349524433e+02, + 0.5205264083477e-05, 0.4432944696116e+01, 0.7860419393880e+01, + 0.2149759935455e-05, 0.4502237496846e+01, 0.1150676975667e+02, + 0.2279109618501e-05, 0.1239441308815e+01, 0.7058598460518e+01, + 0.2259282939683e-05, 0.3272430985331e+01, 0.4694002934110e+01, + 0.2558950271319e-05, 0.2265471086404e+01, 0.1216800268190e+02, + 0.2561581447555e-05, 0.1454740653245e+01, 0.7099330490126e+00, + + 0.1781441115440e-05, 0.2962068630206e+01, 0.7962980379786e+00, + 0.1612005874644e-05, 0.1473255041006e+01, 0.5486777812467e+01, + 0.1818630667105e-05, 0.3743903293447e+00, 0.6283008715021e+01, + 0.1818601377529e-05, 0.6274174354554e+01, 0.6283142985870e+01, + 0.1554475925257e-05, 0.1624110906816e+01, 0.2513230340178e+02, + 0.2090948029241e-05, 0.5852052276256e+01, 0.1179062909082e+02, + 0.2000176345460e-05, 0.4072093298513e+01, 0.1778984560711e+02, + 0.1289535917759e-05, 0.5217019331069e+01, 0.7079373888424e+01, + 0.1281135307881e-05, 0.4802054538934e+01, 0.3738761453707e+01, + 0.1518229005692e-05, 0.8691914742502e+00, 0.2132990797783e+00, + + 0.9450128579027e-06, 0.4601859529950e+01, 0.1097707878456e+02, + 0.7781119494996e-06, 0.1844352816694e+01, 0.8827390247185e+01, + 0.7733407759912e-06, 0.3582790154750e+01, 0.5507553240374e+01, + 0.7350644318120e-06, 0.2695277788230e+01, 0.1589072916335e+01, + 0.6535928827023e-06, 0.3651327986142e+01, 0.1176985366291e+02, + 0.6324624183656e-06, 0.2241302375862e+01, 0.6262300422539e+01, + 0.6298565300557e-06, 0.4407122406081e+01, 0.6303851278352e+01, + 0.8587037089179e-06, 0.3024307223119e+01, 0.1672837615881e+03, + 0.8299954491035e-06, 0.6192539428237e+01, 0.3340612434717e+01, + 0.6311263503401e-06, 0.2014758795416e+01, 0.7113454667900e-02, + + 0.6005646745452e-06, 0.3399500503397e+01, 0.4136910472696e+01, + 0.7917715109929e-06, 0.2493386877837e+01, 0.6069776770667e+01, + 0.7556958099685e-06, 0.4159491740143e+01, 0.6496374930224e+01, + 0.6773228244949e-06, 0.4034162934230e+01, 0.9437762937313e+01, + 0.5370708577847e-06, 0.1562219163734e+01, 0.1194447056968e+01, + 0.5710804266203e-06, 0.2662730803386e+01, 0.6282095334605e+01, + 0.5709824583726e-06, 0.3985828430833e+01, 0.6284056366286e+01, + 0.5143950896447e-06, 0.1308144688689e+01, 0.6290189305114e+01, + 0.5088010604546e-06, 0.5352817214804e+01, 0.6275962395778e+01, + 0.4960369085172e-06, 0.2644267922349e+01, 0.6127655567643e+01, + + 0.4803137891183e-06, 0.4008844192080e+01, 0.6438496133249e+01, + 0.5731747768225e-06, 0.3794550174597e+01, 0.3154687086868e+01, + 0.4735947960579e-06, 0.6107118308982e+01, 0.3128388763578e+01, + 0.4808348796625e-06, 0.4771458618163e+01, 0.8018209333619e+00, + 0.4115073743137e-06, 0.3327111335159e+01, 0.8429241228195e+01, + 0.5230575889287e-06, 0.5305708551694e+01, 0.1336797263425e+02, + 0.5133977889215e-06, 0.5784230738814e+01, 0.1235285262111e+02, + 0.5065815825327e-06, 0.2052064793679e+01, 0.1185621865188e+02, + 0.4339831593868e-06, 0.3644994195830e+01, 0.1726015463500e+02, + 0.3952928638953e-06, 0.4930376436758e+01, 0.5481254917084e+01, + + 0.4898498111942e-06, 0.4542084219731e+00, 0.9225539266174e+01, + 0.4757490209328e-06, 0.3161126388878e+01, 0.5856477690889e+01, + 0.4727701669749e-06, 0.6214993845446e+00, 0.2544314396739e+01, + 0.3800966681863e-06, 0.3040132339297e+01, 0.4265981595566e+00, + 0.3257301077939e-06, 0.8064977360087e+00, 0.3930209696940e+01, + 0.3255810528674e-06, 0.1974147981034e+01, 0.2146165377750e+01, + 0.3252029748187e-06, 0.2845924913135e+01, 0.4164311961999e+01, + 0.3255505635308e-06, 0.3017900824120e+01, 0.5088628793478e+01, + 0.2801345211990e-06, 0.6109717793179e+01, 0.1256967486051e+02, + 0.3688987740970e-06, 0.2911550235289e+01, 0.1807370494127e+02, + + 0.2475153429458e-06, 0.2179146025856e+01, 0.2629832328990e-01, + 0.3033457749150e-06, 0.1994161050744e+01, 0.4535059491685e+01, + 0.2186743763110e-06, 0.5125687237936e+01, 0.1137170464392e+02, + 0.2764777032774e-06, 0.4822646860252e+00, 0.1256262854127e+02, + 0.2199028768592e-06, 0.4637633293831e+01, 0.1255903824622e+02, + 0.2046482824760e-06, 0.1467038733093e+01, 0.7084896783808e+01, + 0.2611209147507e-06, 0.3044718783485e+00, 0.7143069561767e+02, + 0.2286079656818e-06, 0.4764220356805e+01, 0.8031092209206e+01, + 0.1855071202587e-06, 0.3383637774428e+01, 0.1748016358760e+01, + 0.2324669506784e-06, 0.6189088449251e+01, 0.1831953657923e+02, + + 0.1709528015688e-06, 0.5874966729774e+00, 0.4933208510675e+01, + 0.2168156875828e-06, 0.4302994009132e+01, 0.1044738781244e+02, + 0.2106675556535e-06, 0.3800475419891e+01, 0.7477522907414e+01, + 0.1430213830465e-06, 0.1294660846502e+01, 0.2942463415728e+01, + 0.1388396901944e-06, 0.4594797202114e+01, 0.8635942003952e+01, + 0.1922258844190e-06, 0.4943044543591e+00, 0.1729818233119e+02, + 0.1888460058292e-06, 0.2426943912028e+01, 0.1561374759853e+03, + 0.1789449386107e-06, 0.1582973303499e+00, 0.1592596075957e+01, + 0.1360803685374e-06, 0.5197240440504e+01, 0.1309584267300e+02, + 0.1504038014709e-06, 0.3120360916217e+01, 0.1649636139783e+02, + + 0.1382769533389e-06, 0.6164702888205e+01, 0.7632943190217e+01, + 0.1438059769079e-06, 0.1437423770979e+01, 0.2042657109477e+02, + 0.1326303260037e-06, 0.3609688799679e+01, 0.1213955354133e+02, + 0.1159244950540e-06, 0.5463018167225e+01, 0.5331357529664e+01, + 0.1433118149136e-06, 0.6028909912097e+01, 0.7342457794669e+01, + 0.1234623148594e-06, 0.3109645574997e+01, 0.6279485555400e+01, + 0.1233949875344e-06, 0.3539359332866e+01, 0.6286666145492e+01, + 0.9927196061299e-07, 0.1259321569772e+01, 0.7234794171227e+01, + 0.1242302191316e-06, 0.1065949392609e+01, 0.1511046609763e+02, + 0.1098402195201e-06, 0.2192508743837e+01, 0.1098880815746e+02, + + 0.1158191395315e-06, 0.4054411278650e+01, 0.5729506548653e+01, + 0.9048475596241e-07, 0.5429764748518e+01, 0.9623688285163e+01, + 0.8889853269023e-07, 0.5046586206575e+01, 0.6148010737701e+01, + 0.1048694242164e-06, 0.2628858030806e+01, 0.6836645152238e+01, + 0.1112308378646e-06, 0.4177292719907e+01, 0.1572083878776e+02, + 0.8631729709901e-07, 0.1601345232557e+01, 0.6418140963190e+01, + 0.8527816951664e-07, 0.2463888997513e+01, 0.1471231707864e+02, + 0.7892139456991e-07, 0.3154022088718e+01, 0.2118763888447e+01, + 0.1051782905236e-06, 0.4795035816088e+01, 0.1349867339771e+01, + 0.1048219943164e-06, 0.2952983395230e+01, 0.5999216516294e+01, + + 0.7435760775143e-07, 0.5420547991464e+01, 0.6040347114260e+01, + 0.9869574106949e-07, 0.3695646753667e+01, 0.6566935184597e+01, + 0.9156886364226e-07, 0.3922675306609e+01, 0.5643178611111e+01, + 0.7006834356188e-07, 0.1233968624861e+01, 0.6525804586632e+01, + 0.9806170182601e-07, 0.1919542280684e+01, 0.2122839202813e+02, + 0.9052289673607e-07, 0.4615902724369e+01, 0.4690479774488e+01, + 0.7554200867893e-07, 0.1236863719072e+01, 0.1253985337760e+02, + 0.8215741286498e-07, 0.3286800101559e+00, 0.1097355562493e+02, + 0.7185178575397e-07, 0.5880942158367e+01, 0.6245048154254e+01, + 0.7130726476180e-07, 0.7674871987661e+00, 0.6321103546637e+01, + + 0.6650894461162e-07, 0.6987129150116e+00, 0.5327476111629e+01, + 0.7396888823688e-07, 0.3576824794443e+01, 0.5368044267797e+00, + 0.7420588884775e-07, 0.5033615245369e+01, 0.2354323048545e+02, + 0.6141181642908e-07, 0.9449927045673e+00, 0.1296430071988e+02, + 0.6373557924058e-07, 0.6206342280341e+01, 0.9517183207817e+00, + 0.6359474329261e-07, 0.5036079095757e+01, 0.1990745094947e+01, + 0.5740173582646e-07, 0.6105106371350e+01, 0.9555997388169e+00, + 0.7019864084602e-07, 0.7237747359018e+00, 0.5225775174439e+00, + 0.6398054487042e-07, 0.3976367969666e+01, 0.2407292145756e+02, + 0.7797092650498e-07, 0.4305423910623e+01, 0.2200391463820e+02, + + 0.6466760000900e-07, 0.3500136825200e+01, 0.5230807360890e+01, + 0.7529417043890e-07, 0.3514779246100e+01, 0.1842262939178e+02, + 0.6924571140892e-07, 0.2743457928679e+01, 0.1554202828031e+00, + 0.6220798650222e-07, 0.2242598118209e+01, 0.1845107853235e+02, + 0.5870209391853e-07, 0.2332832707527e+01, 0.6398972393349e+00, + 0.6263953473888e-07, 0.2191105358956e+01, 0.6277552955062e+01, + 0.6257781390012e-07, 0.4457559396698e+01, 0.6288598745829e+01, + 0.5697304945123e-07, 0.3499234761404e+01, 0.1551045220144e+01, + 0.6335438746791e-07, 0.6441691079251e+00, 0.5216580451554e+01, + 0.6377258441152e-07, 0.2252599151092e+01, 0.5650292065779e+01, + + 0.6484841818165e-07, 0.1992812417646e+01, 0.1030928125552e+00, + 0.4735551485250e-07, 0.3744672082942e+01, 0.1431416805965e+02, + 0.4628595996170e-07, 0.1334226211745e+01, 0.5535693017924e+00, + 0.6258152336933e-07, 0.4395836159154e+01, 0.2608790314060e+02, + 0.6196171366594e-07, 0.2587043007997e+01, 0.8467247584405e+02, + 0.6159556952126e-07, 0.4782499769128e+01, 0.2394243902548e+03, + 0.4987741172394e-07, 0.7312257619924e+00, 0.7771377146812e+02, + 0.5459280703142e-07, 0.3001376372532e+01, 0.6179983037890e+01, + 0.4863461189999e-07, 0.3767222128541e+01, 0.9027992316901e+02, + 0.5349912093158e-07, 0.3663594450273e+01, 0.6386168663001e+01, + + 0.5673725607806e-07, 0.4331187919049e+01, 0.6915859635113e+01, + 0.4745485060512e-07, 0.5816195745518e+01, 0.6282970628506e+01, + 0.4745379005326e-07, 0.8323672435672e+00, 0.6283181072386e+01, + 0.4049002796321e-07, 0.3785023976293e+01, 0.6254626709878e+01, + 0.4247084014515e-07, 0.2378220728783e+01, 0.7875671926403e+01, + 0.4026912363055e-07, 0.2864103423269e+01, 0.6311524991013e+01, + 0.4062935011774e-07, 0.2415408595975e+01, 0.3634620989887e+01, + 0.5347771048509e-07, 0.3343479309801e+01, 0.2515860172507e+02, + 0.4829494136505e-07, 0.2821742398262e+01, 0.5760498333002e+01, + 0.4342554404599e-07, 0.5624662458712e+01, 0.7238675589263e+01, + + 0.4021599184361e-07, 0.5557250275009e+00, 0.1101510648075e+02, + 0.4104900474558e-07, 0.3296691780005e+01, 0.6709674010002e+01, + 0.4376532905131e-07, 0.3814443999443e+01, 0.6805653367890e+01, + 0.3314590480650e-07, 0.3560229189250e+01, 0.1259245002418e+02, + 0.3232421839643e-07, 0.5185389180568e+01, 0.1066495398892e+01, + 0.3541176318876e-07, 0.3921381909679e+01, 0.9917696840332e+01, + 0.3689831242681e-07, 0.4190658955386e+01, 0.1192625446156e+02, + 0.3890605376774e-07, 0.5546023371097e+01, 0.7478166569050e-01, + 0.3038559339780e-07, 0.6231032794494e+01, 0.1256621883632e+02, + 0.3137083969782e-07, 0.6207063419190e+01, 0.4292330755499e+01, + + 0.4024004081854e-07, 0.1195257375713e+01, 0.1334167431096e+02, + 0.3300234879283e-07, 0.1804694240998e+01, 0.1057540660594e+02, + 0.3635399155575e-07, 0.5597811343500e+01, 0.6208294184755e+01, + 0.3032668691356e-07, 0.3191059366530e+01, 0.1805292951336e+02, + 0.2809652069058e-07, 0.4094348032570e+01, 0.3523159621801e-02, + 0.3696955383823e-07, 0.5219282738794e+01, 0.5966683958112e+01, + 0.3562894142503e-07, 0.1037247544554e+01, 0.6357857516136e+01, + 0.3510598524148e-07, 0.1430020816116e+01, 0.6599467742779e+01, + 0.3617736142953e-07, 0.3002911403677e+01, 0.6019991944201e+01, + 0.2624524910730e-07, 0.2437046757292e+01, 0.6702560555334e+01, + + 0.2535824204490e-07, 0.1581594689647e+01, 0.3141537925223e+02, + 0.3519787226257e-07, 0.5379863121521e+01, 0.2505706758577e+03, + 0.2578406709982e-07, 0.4904222639329e+01, 0.1673046366289e+02, + 0.3423887981473e-07, 0.3646448997315e+01, 0.6546159756691e+01, + 0.2776083886467e-07, 0.3307829300144e+01, 0.1272157198369e+02, + 0.3379592818379e-07, 0.1747541251125e+01, 0.1494531617769e+02, + 0.3050255426284e-07, 0.1784689432607e-01, 0.4732030630302e+01, + 0.2652378350236e-07, 0.4420055276260e+01, 0.5863591145557e+01, + 0.2374498173768e-07, 0.3629773929208e+01, 0.2388894113936e+01, + 0.2716451255140e-07, 0.3079623706780e+01, 0.1202934727411e+02, + + 0.3038583699229e-07, 0.3312487903507e+00, 0.1256608456547e+02, + 0.2220681228760e-07, 0.5265520401774e+01, 0.1336244973887e+02, + 0.3044156540912e-07, 0.4766664081250e+01, 0.2908881142201e+02, + 0.2731859923561e-07, 0.5069146530691e+01, 0.1391601904066e+02, + 0.2285603018171e-07, 0.5954935112271e+01, 0.6076890225335e+01, + 0.2025006454555e-07, 0.4061789589267e+01, 0.4701116388778e+01, + 0.2012597519804e-07, 0.2485047705241e+01, 0.6262720680387e+01, + 0.2003406962258e-07, 0.4163779209320e+01, 0.6303431020504e+01, + 0.2207863441371e-07, 0.6923839133828e+00, 0.6489261475556e+01, + 0.2481374305624e-07, 0.5944173595676e+01, 0.1204357418345e+02, + + 0.2130923288870e-07, 0.4641013671967e+01, 0.5746271423666e+01, + 0.2446370543391e-07, 0.6125796518757e+01, 0.1495633313810e+00, + 0.1932492759052e-07, 0.2234572324504e+00, 0.1352175143971e+02, + 0.2600122568049e-07, 0.4281012405440e+01, 0.4590910121555e+01, + 0.2431754047488e-07, 0.1429943874870e+00, 0.1162474756779e+01, + 0.1875902869209e-07, 0.9781803816948e+00, 0.6279194432410e+01, + 0.1874381139426e-07, 0.5670368130173e+01, 0.6286957268481e+01, + 0.2156696047173e-07, 0.2008985006833e+01, 0.1813929450232e+02, + 0.1965076182484e-07, 0.2566186202453e+00, 0.4686889479442e+01, + 0.2334816372359e-07, 0.4408121891493e+01, 0.1002183730415e+02, + + 0.1869937408802e-07, 0.5272745038656e+01, 0.2427287361862e+00, + 0.2436236460883e-07, 0.4407720479029e+01, 0.9514313292143e+02, + 0.1761365216611e-07, 0.1943892315074e+00, 0.1351787002167e+02, + 0.2156289480503e-07, 0.1418570924545e+01, 0.6037244212485e+01, + 0.2164748979255e-07, 0.4724603439430e+01, 0.2301353951334e+02, + 0.2222286670853e-07, 0.2400266874598e+01, 0.1266924451345e+02, + 0.2070901414929e-07, 0.5230348028732e+01, 0.6528907488406e+01, + 0.1792745177020e-07, 0.2099190328945e+01, 0.6819880277225e+01, + 0.1841802068445e-07, 0.3467527844848e+00, 0.6514761976723e+02, + 0.1578401631718e-07, 0.7098642356340e+00, 0.2077542790660e-01, + + 0.1561690152531e-07, 0.5943349620372e+01, 0.6272439236156e+01, + 0.1558591045463e-07, 0.7040653478980e+00, 0.6293712464735e+01, + 0.1737356469576e-07, 0.4487064760345e+01, 0.1765478049437e+02, + 0.1434755619991e-07, 0.2993391570995e+01, 0.1102062672231e+00, + 0.1482187806654e-07, 0.2278049198251e+01, 0.1052268489556e+01, + 0.1424812827089e-07, 0.1682114725827e+01, 0.1311972100268e+02, + 0.1380282448623e-07, 0.3262668602579e+01, 0.1017725758696e+02, + 0.1811481244566e-07, 0.3187771221777e+01, 0.1887552587463e+02, + 0.1504446185696e-07, 0.5650162308647e+01, 0.7626583626240e-01, + 0.1740776154137e-07, 0.5487068607507e+01, 0.1965104848470e+02, + + 0.1374339536251e-07, 0.5745688172201e+01, 0.6016468784579e+01, + 0.1761377477704e-07, 0.5748060203659e+01, 0.2593412433514e+02, + 0.1535138225795e-07, 0.6226848505790e+01, 0.9411464614024e+01, + 0.1788140543676e-07, 0.6189318878563e+01, 0.3301902111895e+02, + 0.1375002807996e-07, 0.5371812884394e+01, 0.6327837846670e+00, + 0.1242115758632e-07, 0.1471687569712e+01, 0.3894181736510e+01, + 0.1450977333938e-07, 0.4143836662127e+01, 0.1277945078067e+02, + 0.1297579575023e-07, 0.9003477661957e+00, 0.6549682916313e+01, + 0.1462667934821e-07, 0.5760505536428e+01, 0.1863592847156e+02, + 0.1381774374799e-07, 0.1085471729463e+01, 0.2379164476796e+01, + + 0.1682333169307e-07, 0.5409870870133e+01, 0.1620077269078e+02, + 0.1190812918837e-07, 0.1397205174601e+01, 0.1149965630200e+02, + 0.1221434762106e-07, 0.9001804809095e+00, 0.1257326515556e+02, + 0.1549934644860e-07, 0.4262528275544e+01, 0.1820933031200e+02, + 0.1252138953050e-07, 0.1411642012027e+01, 0.6993008899458e+01, + 0.1237078905387e-07, 0.2844472403615e+01, 0.2435678079171e+02, + 0.1446953389615e-07, 0.5295835522223e+01, 0.3813291813120e-01, + 0.1388446457170e-07, 0.4969428135497e+01, 0.2458316379602e+00, + 0.1019339179228e-07, 0.2491369561806e+01, 0.6112403035119e+01, + 0.1258880815343e-07, 0.4679426248976e+01, 0.5429879531333e+01, + + 0.1297768238261e-07, 0.1074509953328e+01, 0.1249137003520e+02, + 0.9913505718094e-08, 0.4735097918224e+01, 0.6247047890016e+01, + 0.9830453155969e-08, 0.4158649187338e+01, 0.6453748665772e+01, + 0.1192615865309e-07, 0.3438208613699e+01, 0.6290122169689e+01, + 0.9835874798277e-08, 0.1913300781229e+01, 0.6319103810876e+01, + 0.9639087569277e-08, 0.9487683644125e+00, 0.8273820945392e+01, + 0.1175716107001e-07, 0.3228141664287e+01, 0.6276029531202e+01, + 0.1018926508678e-07, 0.2216607854300e+01, 0.1254537627298e+02, + 0.9500087869225e-08, 0.2625116459733e+01, 0.1256517118505e+02, + 0.9664192916575e-08, 0.5860562449214e+01, 0.6259197520765e+01, + + 0.9612858712203e-08, 0.7885682917381e+00, 0.6306954180126e+01, + 0.1117645675413e-07, 0.3932148831189e+01, 0.1779695906178e+02, + 0.1158864052160e-07, 0.9995605521691e+00, 0.1778273215245e+02, + 0.9021043467028e-08, 0.5263769742673e+01, 0.6172869583223e+01, + 0.8836134773563e-08, 0.1496843220365e+01, 0.1692165728891e+01, + 0.1045872200691e-07, 0.7009039517214e+00, 0.2204125344462e+00, + 0.1211463487798e-07, 0.4041544938511e+01, 0.8257698122054e+02, + 0.8541990804094e-08, 0.1447586692316e+01, 0.6393282117669e+01, + 0.1038720703636e-07, 0.4594249718112e+00, 0.1550861511662e+02, + 0.1126722351445e-07, 0.3925550579036e+01, 0.2061856251104e+00, + + 0.8697373859631e-08, 0.4411341856037e+01, 0.9491756770005e+00, + 0.8869380028441e-08, 0.2402659724813e+01, 0.3903911373650e+01, + 0.9247014693258e-08, 0.1401579743423e+01, 0.6267823317922e+01, + 0.9205062930950e-08, 0.5245978000814e+01, 0.6298328382969e+01, + 0.8000745038049e-08, 0.3590803356945e+01, 0.2648454860559e+01, + 0.9168973650819e-08, 0.2470150501679e+01, 0.1498544001348e+03, + 0.1075444949238e-07, 0.1328606161230e+01, 0.3694923081589e+02, + 0.7817298525817e-08, 0.6162256225998e+01, 0.4804209201333e+01, + 0.9541469226356e-08, 0.3942568967039e+01, 0.1256713221673e+02, + 0.9821910122027e-08, 0.2360246287233e+00, 0.1140367694411e+02, + + 0.9897822023777e-08, 0.4619805634280e+01, 0.2280573557157e+02, + 0.7737289283765e-08, 0.3784727847451e+01, 0.7834121070590e+01, + 0.9260204034710e-08, 0.2223352487601e+01, 0.2787043132925e+01, + 0.7320252888486e-08, 0.1288694636874e+01, 0.6282655592598e+01, + 0.7319785780946e-08, 0.5359869567774e+01, 0.6283496108294e+01, + 0.7147219933778e-08, 0.5516616675856e+01, 0.1725663147538e+02, + 0.7946502829878e-08, 0.2630459984567e+01, 0.1241073141809e+02, + 0.9001711808932e-08, 0.2849815827227e+01, 0.6281591679874e+01, + 0.8994041507257e-08, 0.3795244450750e+01, 0.6284560021018e+01, + 0.8298582787358e-08, 0.5236413127363e+00, 0.1241658836951e+02, + + 0.8526596520710e-08, 0.4794605424426e+01, 0.1098419223922e+02, + 0.8209822103197e-08, 0.1578752370328e+01, 0.1096996532989e+02, + 0.6357049861094e-08, 0.5708926113761e+01, 0.1596186371003e+01, + 0.7370473179049e-08, 0.3842402530241e+01, 0.4061219149443e+01, + 0.7232154664726e-08, 0.3067548981535e+01, 0.1610006857377e+03, + 0.6328765494903e-08, 0.1313930030069e+01, 0.1193336791622e+02, + 0.8030064908595e-08, 0.3488500408886e+01, 0.8460828644453e+00, + 0.6275464259232e-08, 0.1532061626198e+01, 0.8531963191132e+00, + 0.7051897446325e-08, 0.3285859929993e+01, 0.5849364236221e+01, + 0.6161593705428e-08, 0.1477341999464e+01, 0.5573142801433e+01, + + 0.7754683957278e-08, 0.1586118663096e+01, 0.8662240327241e+01, + 0.5889928990701e-08, 0.1304887868803e+01, 0.1232342296471e+02, + 0.5705756047075e-08, 0.4555333589350e+01, 0.1258692712880e+02, + 0.5964178808332e-08, 0.3001762842062e+01, 0.5333900173445e+01, + 0.6712446027467e-08, 0.4886780007595e+01, 0.1171295538178e+02, + 0.5941809275464e-08, 0.4701509603824e+01, 0.9779108567966e+01, + 0.5466993627395e-08, 0.4588357817278e+01, 0.1884211409667e+02, + 0.6340512090980e-08, 0.1164543038893e+01, 0.5217580628120e+02, + 0.6325505710045e-08, 0.3919171259645e+01, 0.1041998632314e+02, + 0.6164789509685e-08, 0.2143828253542e+01, 0.6151533897323e+01, + + 0.5263330812430e-08, 0.6066564434241e+01, 0.1885275071096e+02, + 0.5597087780221e-08, 0.2926316429472e+01, 0.4337116142245e+00, + 0.5396556236817e-08, 0.3244303591505e+01, 0.6286362197481e+01, + 0.5396615148223e-08, 0.3404304703662e+01, 0.6279789503410e+01, + 0.7091832443341e-08, 0.8532377803192e+00, 0.4907302013889e+01, + 0.6572352589782e-08, 0.4901966774419e+01, 0.1176433076753e+02, + 0.5960236060795e-08, 0.1874672315797e+01, 0.1422690933580e-01, + 0.5125480043511e-08, 0.3735726064334e+01, 0.1245594543367e+02, + 0.5928241866410e-08, 0.4502033899935e+01, 0.6414617803568e+01, + 0.5249600357424e-08, 0.4372334799878e+01, 0.1151388321134e+02, + + 0.6059171276087e-08, 0.2581617302908e+01, 0.6062663316000e+01, + 0.5295235081662e-08, 0.2974811513158e+01, 0.3496032717521e+01, + 0.5820561875933e-08, 0.1796073748244e+00, 0.2838593341516e+00, + 0.4754696606440e-08, 0.1981998136973e+01, 0.3104930017775e+01, + 0.6385053548955e-08, 0.2559174171605e+00, 0.6133512519065e+01, + 0.6589828273941e-08, 0.2750967106776e+01, 0.4087944051283e+02, + 0.5383376567189e-08, 0.6325947523578e+00, 0.2248384854122e+02, + 0.5928941683538e-08, 0.1672304519067e+01, 0.1581959461667e+01, + 0.4816060709794e-08, 0.3512566172575e+01, 0.9388005868221e+01, + 0.6003381586512e-08, 0.5610932219189e+01, 0.5326786718777e+01, + + 0.5504225393105e-08, 0.4037501131256e+01, 0.6503488384892e+01, + 0.5353772620129e-08, 0.6122774968240e+01, 0.1735668374386e+03, + 0.5786253768544e-08, 0.5527984999515e+01, 0.1350651127443e+00, + 0.5065706702002e-08, 0.9980765573624e+00, 0.1248988586463e+02, + 0.5972838885276e-08, 0.6044489493203e+01, 0.2673594526851e+02, + 0.5323585877961e-08, 0.3924265998147e+01, 0.4171425416666e+01, + 0.5210772682858e-08, 0.6220111376901e+01, 0.2460261242967e+02, + 0.4726549040535e-08, 0.3716043206862e+01, 0.7232251527446e+01, + 0.6029425105059e-08, 0.8548704071116e+00, 0.3227113045244e+03, + 0.4481542826513e-08, 0.1426925072829e+01, 0.5547199253223e+01, + + 0.5836024505068e-08, 0.7135651752625e-01, 0.7285056171570e+02, + 0.4137046613272e-08, 0.5330767643283e+01, 0.1087398597200e+02, + 0.5171977473924e-08, 0.4494262335353e+00, 0.1884570439172e+02, + 0.5694429833732e-08, 0.2952369582215e+01, 0.9723862754494e+02, + 0.4009158925298e-08, 0.3500003416535e+01, 0.6244942932314e+01, + 0.4784939596873e-08, 0.6196709413181e+01, 0.2929661536378e+02, + 0.3983725022610e-08, 0.5103690031897e+01, 0.4274518229222e+01, + 0.3870535232462e-08, 0.3187569587401e+01, 0.6321208768577e+01, + 0.5140501213951e-08, 0.1668924357457e+01, 0.1232032006293e+02, + 0.3849034819355e-08, 0.4445722510309e+01, 0.1726726808967e+02, + + 0.4002383075060e-08, 0.5226224152423e+01, 0.7018952447668e+01, + 0.3890719543549e-08, 0.4371166550274e+01, 0.1491901785440e+02, + 0.4887084607881e-08, 0.5973556689693e+01, 0.1478866649112e+01, + 0.3739939287592e-08, 0.2089084714600e+01, 0.6922973089781e+01, + 0.5031925918209e-08, 0.4658371936827e+01, 0.1715706182245e+02, + 0.4387748764954e-08, 0.4825580552819e+01, 0.2331413144044e+03, + 0.4147398098865e-08, 0.3739003524998e+01, 0.1376059875786e+02, + 0.3719089993586e-08, 0.1148941386536e+01, 0.6297302759782e+01, + 0.3934238461056e-08, 0.1559893008343e+01, 0.7872148766781e+01, + 0.3672471375622e-08, 0.5516145383612e+01, 0.6268848941110e+01, + + 0.3768911277583e-08, 0.6116053700563e+01, 0.4157198507331e+01, + 0.4033388417295e-08, 0.5076821746017e+01, 0.1567108171867e+02, + 0.3764194617832e-08, 0.8164676232075e+00, 0.3185192151914e+01, + 0.4840628226284e-08, 0.1360479453671e+01, 0.1252801878276e+02, + 0.4949443923785e-08, 0.2725622229926e+01, 0.1617106187867e+03, + 0.4117393089971e-08, 0.6054459628492e+00, 0.5642198095270e+01, + 0.3925754020428e-08, 0.8570462135210e+00, 0.2139354194808e+02, + 0.3630551757923e-08, 0.3552067338279e+01, 0.6294805223347e+01, + 0.3627274802357e-08, 0.3096565085313e+01, 0.6271346477544e+01, + 0.3806143885093e-08, 0.6367751709777e+00, 0.1725304118033e+02, + + 0.4433254641565e-08, 0.4848461503937e+01, 0.7445550607224e+01, + 0.3712319846576e-08, 0.1331950643655e+01, 0.4194847048887e+00, + 0.3849847534783e-08, 0.4958368297746e+00, 0.9562891316684e+00, + 0.3483955430165e-08, 0.2237215515707e+01, 0.1161697602389e+02, + 0.3961912730982e-08, 0.3332402188575e+01, 0.2277943724828e+02, + 0.3419978244481e-08, 0.5785600576016e+01, 0.1362553364512e+02, + 0.3329417758177e-08, 0.9812676559709e-01, 0.1685848245639e+02, + 0.4207206893193e-08, 0.9494780468236e+00, 0.2986433403208e+02, + 0.3268548976410e-08, 0.1739332095686e+00, 0.5749861718712e+01, + 0.3321880082685e-08, 0.1423354800666e+01, 0.6279143387820e+01, + + 0.4503173010852e-08, 0.2314972675293e+00, 0.1385561574497e+01, + 0.4316599090954e-08, 0.1012646782616e+00, 0.4176041334900e+01, + 0.3283493323850e-08, 0.5233306881265e+01, 0.6287008313071e+01, + 0.3164033542343e-08, 0.4005597257511e+01, 0.2099539292909e+02, + 0.4159720956725e-08, 0.5365676242020e+01, 0.5905702259363e+01, + 0.3565176892217e-08, 0.4284440620612e+01, 0.3932462625300e-02, + 0.3514440950221e-08, 0.4270562636575e+01, 0.7335344340001e+01, + 0.3540596871909e-08, 0.5953553201060e+01, 0.1234573916645e+02, + 0.2960769905118e-08, 0.1115180417718e+01, 0.2670964694522e+02, + 0.2962213739684e-08, 0.3863811918186e+01, 0.6408777551755e+00, + + 0.3883556700251e-08, 0.1268617928302e+01, 0.6660449441528e+01, + 0.2919225516346e-08, 0.4908605223265e+01, 0.1375773836557e+01, + 0.3115158863370e-08, 0.3744519976885e+01, 0.3802769619140e-01, + 0.4099438144212e-08, 0.4173244670532e+01, 0.4480965020977e+02, + 0.2899531858964e-08, 0.5910601428850e+01, 0.2059724391010e+02, + 0.3289733429855e-08, 0.2488050078239e+01, 0.1081813534213e+02, + 0.3933075612875e-08, 0.1122363652883e+01, 0.3773735910827e+00, + 0.3021403764467e-08, 0.4951973724904e+01, 0.2982630633589e+02, + 0.2798598949757e-08, 0.5117057845513e+01, 0.1937891852345e+02, + 0.3397421302707e-08, 0.6104159180476e+01, 0.6923953605621e+01, + + 0.3720398002179e-08, 0.1184933429829e+01, 0.3066615496545e+02, + 0.3598484186267e-08, 0.3505282086105e+01, 0.6147450479709e+01, + 0.3694594027310e-08, 0.2286651088141e+01, 0.2636725487657e+01, + 0.2680444152969e-08, 0.1871816775482e+00, 0.6816289982179e+01, + 0.3497574865641e-08, 0.3143251755431e+01, 0.6418701221183e+01, + 0.3130274129494e-08, 0.2462167316018e+01, 0.1235996607578e+02, + 0.3241119069551e-08, 0.4256374004686e+01, 0.1652265972112e+02, + 0.2601960842061e-08, 0.4970362941425e+01, 0.1045450126711e+02, + 0.2690601527504e-08, 0.2372657824898e+01, 0.3163918923335e+00, + 0.2908688152664e-08, 0.4232652627721e+01, 0.2828699048865e+02, + + 0.3120456131875e-08, 0.3925747001137e+00, 0.2195415756911e+02, + 0.3148855423384e-08, 0.3093478330445e+01, 0.1172006883645e+02, + 0.3051044261017e-08, 0.5560948248212e+01, 0.6055599646783e+01, + 0.2826006876660e-08, 0.5072790310072e+01, 0.5120601093667e+01, + 0.3100034191711e-08, 0.4998530231096e+01, 0.1799603123222e+02, + 0.2398771640101e-08, 0.2561739802176e+01, 0.6255674361143e+01, + 0.2384002842728e-08, 0.4087420284111e+01, 0.6310477339748e+01, + 0.2842146517568e-08, 0.2515048217955e+01, 0.5469525544182e+01, + 0.2847674371340e-08, 0.5235326497443e+01, 0.1034429499989e+02, + 0.2903722140764e-08, 0.1088200795797e+01, 0.6510552054109e+01, + + 0.3187610710605e-08, 0.4710624424816e+01, 0.1693792562116e+03, + 0.3048869992813e-08, 0.2857975896445e+00, 0.8390110365991e+01, + 0.2860216950984e-08, 0.2241619020815e+01, 0.2243449970715e+00, + 0.2701117683113e-08, 0.6651573305272e-01, 0.6129297044991e+01, + 0.2509891590152e-08, 0.1285135324585e+01, 0.1044027435778e+02, + 0.2623200252223e-08, 0.2981229834530e+00, 0.6436854655901e+01, + 0.2622541669202e-08, 0.6122470726189e+01, 0.9380959548977e+01, + 0.2818435667099e-08, 0.4251087148947e+01, 0.5934151399930e+01, + 0.2365196797465e-08, 0.3465070460790e+01, 0.2470570524223e+02, + 0.2358704646143e-08, 0.5791603815350e+01, 0.8671969964381e+01, + + 0.2388299481390e-08, 0.4142483772941e+01, 0.7096626156709e+01, + 0.1996041217224e-08, 0.2101901889496e+01, 0.1727188400790e+02, + 0.2687593060336e-08, 0.1526689456959e+01, 0.7075506709219e+02, + 0.2618913670810e-08, 0.2397684236095e+01, 0.6632000300961e+01, + 0.2571523050364e-08, 0.5751929456787e+00, 0.6206810014183e+01, + 0.2582135006946e-08, 0.5595464352926e+01, 0.4873985990671e+02, + 0.2372530190361e-08, 0.5092689490655e+01, 0.1590676413561e+02, + 0.2357178484712e-08, 0.4444363527851e+01, 0.3097883698531e+01, + 0.2451590394723e-08, 0.3108251687661e+01, 0.6612329252343e+00, + 0.2370045949608e-08, 0.2608133861079e+01, 0.3459636466239e+02, + + 0.2268997267358e-08, 0.3639717753384e+01, 0.2844914056730e-01, + 0.1731432137906e-08, 0.1741898445707e+00, 0.2019909489111e+02, + 0.1629869741622e-08, 0.3902225646724e+01, 0.3035599730800e+02, + 0.2206215801974e-08, 0.4971131250731e+01, 0.6281667977667e+01, + 0.2205469554680e-08, 0.1677462357110e+01, 0.6284483723224e+01, + 0.2148792362509e-08, 0.4236259604006e+01, 0.1980482729015e+02, + 0.1873733657847e-08, 0.5926814998687e+01, 0.2876692439167e+02, + 0.2026573758959e-08, 0.4349643351962e+01, 0.2449240616245e+02, + 0.1807770325110e-08, 0.5700940482701e+01, 0.2045286941806e+02, + 0.1881174408581e-08, 0.6601286363430e+00, 0.2358125818164e+02, + + 0.1368023671690e-08, 0.2211098592752e+01, 0.2473415438279e+02, + 0.1720017916280e-08, 0.4942488551129e+01, 0.1679593901136e+03, + 0.1702427665131e-08, 0.1452233856386e+01, 0.3338575901272e+03, + 0.1414032510054e-08, 0.5525357721439e+01, 0.1624205518357e+03, + 0.1652626045364e-08, 0.4108794283624e+01, 0.8956999012000e+02, + 0.1642957769686e-08, 0.7344335209984e+00, 0.5267006960365e+02, + 0.1614952403624e-08, 0.3541213951363e+01, 0.3332657872986e+02, + 0.1535988291188e-08, 0.4031094072151e+01, 0.3852657435933e+02, + 0.1593193738177e-08, 0.4185136203609e+01, 0.2282781046519e+03, + 0.1074569126382e-08, 0.1720485636868e+01, 0.8397383534231e+02, + + 0.1074408214509e-08, 0.2758613420318e+01, 0.8401985929482e+02, + 0.9700199670465e-09, 0.4216686842097e+01, 0.7826370942180e+02, + 0.1258433517061e-08, 0.2575068876639e+00, 0.3115650189215e+03, + 0.1240303229539e-08, 0.4800844956756e+00, 0.1784300471910e+03, + 0.9018345948127e-09, 0.3896756361552e+00, 0.5886454391678e+02, + 0.1135301432805e-08, 0.3700805023550e+00, 0.7842370451713e+02, + 0.9215887951370e-09, 0.4364579276638e+01, 0.1014262087719e+03, + 0.1055401054147e-08, 0.2156564222111e+01, 0.5660027930059e+02, + 0.1008725979831e-08, 0.5454015785234e+01, 0.4245678405627e+02, + 0.7217398104321e-09, 0.1597772562175e+01, 0.2457074661053e+03, + + 0.6912033134447e-09, 0.5824090621461e+01, 0.1679936946371e+03, + 0.6833881523549e-09, 0.3578778482835e+01, 0.6053048899753e+02, + 0.4887304205142e-09, 0.3724362812423e+01, 0.9656299901946e+02, + 0.5173709754788e-09, 0.5422427507933e+01, 0.2442876000072e+03, + 0.4671353097145e-09, 0.2396106924439e+01, 0.1435713242844e+03, + 0.5652608439480e-09, 0.2804028838685e+01, 0.8365903305582e+02, + 0.5604061331253e-09, 0.1638816006247e+01, 0.8433466158131e+02, + 0.4712723365400e-09, 0.8979003224474e+00, 0.3164282286739e+03, + 0.4909967465112e-09, 0.3210426725516e+01, 0.4059982187939e+03, + 0.4771358267658e-09, 0.5308027211629e+01, 0.1805255418145e+03, + + 0.3943451445989e-09, 0.2195145341074e+01, 0.2568537517081e+03, + 0.3952109120244e-09, 0.5081189491586e+01, 0.2449975330562e+03, + 0.3788134594789e-09, 0.4345171264441e+01, 0.1568131045107e+03, + 0.3738330190479e-09, 0.2613062847997e+01, 0.3948519331910e+03, + 0.3099866678136e-09, 0.2846760817689e+01, 0.1547176098872e+03, + 0.2002962716768e-09, 0.4921360989412e+01, 0.2268582385539e+03, + 0.2198291338754e-09, 0.1130360117454e+00, 0.1658638954901e+03, + 0.1491958330784e-09, 0.4228195232278e+01, 0.2219950288015e+03, + 0.1475384076173e-09, 0.3005721811604e+00, 0.3052819430710e+03, + 0.1661626624624e-09, 0.7830125621203e+00, 0.2526661704812e+03, + + 0.9015823460025e-10, 0.3807792942715e+01, 0.4171445043968e+03 }; + +/* Sun-to-Earth, T^0, Y */ + static const double e0y[] = { + 0.9998921098898e+00, 0.1826583913846e+00, 0.6283075850446e+01, + -0.2442700893735e-01, 0.0000000000000e+00, 0.0000000000000e+00, + 0.8352929742915e-02, 0.1395277998680e+00, 0.1256615170089e+02, + 0.1046697300177e-03, 0.9641423109763e-01, 0.1884922755134e+02, + 0.3110841876663e-04, 0.5381140401712e+01, 0.8399684731857e+02, + 0.2570269094593e-04, 0.5301016407128e+01, 0.5296909721118e+00, + 0.2147389623610e-04, 0.2662510869850e+01, 0.1577343543434e+01, + 0.1680344384050e-04, 0.5207904119704e+01, 0.6279552690824e+01, + 0.1679117312193e-04, 0.4582187486968e+01, 0.6286599010068e+01, + 0.1440512068440e-04, 0.1900688517726e+01, 0.2352866153506e+01, + + 0.1135139664999e-04, 0.5273108538556e+01, 0.5223693906222e+01, + 0.9345482571018e-05, 0.4503047687738e+01, 0.1203646072878e+02, + 0.9007418719568e-05, 0.1605621059637e+01, 0.1021328554739e+02, + 0.5671536712314e-05, 0.5812849070861e+00, 0.1059381944224e+01, + 0.7451401861666e-05, 0.2807346794836e+01, 0.3981490189893e+00, + 0.6393470057114e-05, 0.6029224133855e+01, 0.5753384878334e+01, + 0.6814275881697e-05, 0.6472990145974e+00, 0.4705732307012e+01, + 0.6113705628887e-05, 0.3813843419700e+01, 0.6812766822558e+01, + 0.4503851367273e-05, 0.4527804370996e+01, 0.5884926831456e+01, + 0.4522249141926e-05, 0.5991783029224e+01, 0.6256777527156e+01, + + 0.4501794307018e-05, 0.3798703844397e+01, 0.6309374173736e+01, + 0.5514927480180e-05, 0.3961257833388e+01, 0.5507553240374e+01, + 0.4062862799995e-05, 0.5256247296369e+01, 0.6681224869435e+01, + 0.5414900429712e-05, 0.5499032014097e+01, 0.7755226100720e+00, + 0.5463153987424e-05, 0.6173092454097e+01, 0.1414349524433e+02, + 0.5071611859329e-05, 0.2870244247651e+01, 0.7860419393880e+01, + 0.2195112094455e-05, 0.2952338617201e+01, 0.1150676975667e+02, + 0.2279139233919e-05, 0.5951775132933e+01, 0.7058598460518e+01, + 0.2278386100876e-05, 0.4845456398785e+01, 0.4694002934110e+01, + 0.2559088003308e-05, 0.6945321117311e+00, 0.1216800268190e+02, + + 0.2561079286856e-05, 0.6167224608301e+01, 0.7099330490126e+00, + 0.1792755796387e-05, 0.1400122509632e+01, 0.7962980379786e+00, + 0.1818715656502e-05, 0.4703347611830e+01, 0.6283142985870e+01, + 0.1818744924791e-05, 0.5086748900237e+01, 0.6283008715021e+01, + 0.1554518791390e-05, 0.5331008042713e-01, 0.2513230340178e+02, + 0.2063265737239e-05, 0.4283680484178e+01, 0.1179062909082e+02, + 0.1497613520041e-05, 0.6074207826073e+01, 0.5486777812467e+01, + 0.2000617940427e-05, 0.2501426281450e+01, 0.1778984560711e+02, + 0.1289731195580e-05, 0.3646340599536e+01, 0.7079373888424e+01, + 0.1282657998934e-05, 0.3232864804902e+01, 0.3738761453707e+01, + + 0.1528915968658e-05, 0.5581433416669e+01, 0.2132990797783e+00, + 0.1187304098432e-05, 0.5453576453694e+01, 0.9437762937313e+01, + 0.7842782928118e-06, 0.2823953922273e+00, 0.8827390247185e+01, + 0.7352892280868e-06, 0.1124369580175e+01, 0.1589072916335e+01, + 0.6570189360797e-06, 0.2089154042840e+01, 0.1176985366291e+02, + 0.6324967590410e-06, 0.6704855581230e+00, 0.6262300422539e+01, + 0.6298289872283e-06, 0.2836414855840e+01, 0.6303851278352e+01, + 0.6476686465855e-06, 0.4852433866467e+00, 0.7113454667900e-02, + 0.8587034651234e-06, 0.1453511005668e+01, 0.1672837615881e+03, + 0.8068948788113e-06, 0.9224087798609e+00, 0.6069776770667e+01, + + 0.8353786011661e-06, 0.4631707184895e+01, 0.3340612434717e+01, + 0.6009324532132e-06, 0.1829498827726e+01, 0.4136910472696e+01, + 0.7558158559566e-06, 0.2588596800317e+01, 0.6496374930224e+01, + 0.5809279504503e-06, 0.5516818853476e+00, 0.1097707878456e+02, + 0.5374131950254e-06, 0.6275674734960e+01, 0.1194447056968e+01, + 0.5711160507326e-06, 0.1091905956872e+01, 0.6282095334605e+01, + 0.5710183170746e-06, 0.2415001635090e+01, 0.6284056366286e+01, + 0.5144373590610e-06, 0.6020336443438e+01, 0.6290189305114e+01, + 0.5103108927267e-06, 0.3775634564605e+01, 0.6275962395778e+01, + 0.4960654697891e-06, 0.1073450946756e+01, 0.6127655567643e+01, + + 0.4786385689280e-06, 0.2431178012310e+01, 0.6438496133249e+01, + 0.6109911263665e-06, 0.5343356157914e+01, 0.3154687086868e+01, + 0.4839898944024e-06, 0.5830833594047e-01, 0.8018209333619e+00, + 0.4734822623919e-06, 0.4536080134821e+01, 0.3128388763578e+01, + 0.4834741473290e-06, 0.2585090489754e+00, 0.7084896783808e+01, + 0.5134858581156e-06, 0.4213317172603e+01, 0.1235285262111e+02, + 0.5064004264978e-06, 0.4814418806478e+00, 0.1185621865188e+02, + 0.3753476772761e-06, 0.1599953399788e+01, 0.8429241228195e+01, + 0.4935264014283e-06, 0.2157417556873e+01, 0.2544314396739e+01, + 0.3950929600897e-06, 0.3359394184254e+01, 0.5481254917084e+01, + + 0.4895849789777e-06, 0.5165704376558e+01, 0.9225539266174e+01, + 0.4215241688886e-06, 0.2065368800993e+01, 0.1726015463500e+02, + 0.3796773731132e-06, 0.1468606346612e+01, 0.4265981595566e+00, + 0.3114178142515e-06, 0.3615638079474e+01, 0.2146165377750e+01, + 0.3260664220838e-06, 0.4417134922435e+01, 0.4164311961999e+01, + 0.3976996123008e-06, 0.4700866883004e+01, 0.5856477690889e+01, + 0.2801459672924e-06, 0.4538902060922e+01, 0.1256967486051e+02, + 0.3638931868861e-06, 0.1334197991475e+01, 0.1807370494127e+02, + 0.2487013269476e-06, 0.3749275558275e+01, 0.2629832328990e-01, + 0.3034165481994e-06, 0.4236622030873e+00, 0.4535059491685e+01, + + 0.2676278825586e-06, 0.5970848007811e+01, 0.3930209696940e+01, + 0.2764903818918e-06, 0.5194636754501e+01, 0.1256262854127e+02, + 0.2485149930507e-06, 0.1002434207846e+01, 0.5088628793478e+01, + 0.2199305540941e-06, 0.3066773098403e+01, 0.1255903824622e+02, + 0.2571106500435e-06, 0.7588312459063e+00, 0.1336797263425e+02, + 0.2049751817158e-06, 0.3444977434856e+01, 0.1137170464392e+02, + 0.2599707296297e-06, 0.1873128542205e+01, 0.7143069561767e+02, + 0.1785018072217e-06, 0.5015891306615e+01, 0.1748016358760e+01, + 0.2324833891115e-06, 0.4618271239730e+01, 0.1831953657923e+02, + 0.1709711119545e-06, 0.5300003455669e+01, 0.4933208510675e+01, + + 0.2107159351716e-06, 0.2229819815115e+01, 0.7477522907414e+01, + 0.1750333080295e-06, 0.6161485880008e+01, 0.1044738781244e+02, + 0.2000598210339e-06, 0.2967357299999e+01, 0.8031092209206e+01, + 0.1380920248681e-06, 0.3027007923917e+01, 0.8635942003952e+01, + 0.1412460470299e-06, 0.6037597163798e+01, 0.2942463415728e+01, + 0.1888459803001e-06, 0.8561476243374e+00, 0.1561374759853e+03, + 0.1788370542585e-06, 0.4869736290209e+01, 0.1592596075957e+01, + 0.1360893296167e-06, 0.3626411886436e+01, 0.1309584267300e+02, + 0.1506846530160e-06, 0.1550975377427e+01, 0.1649636139783e+02, + 0.1800913376176e-06, 0.2075826033190e+01, 0.1729818233119e+02, + + 0.1436261390649e-06, 0.6148876420255e+01, 0.2042657109477e+02, + 0.1220227114151e-06, 0.4382583879906e+01, 0.7632943190217e+01, + 0.1337883603592e-06, 0.2036644327361e+01, 0.1213955354133e+02, + 0.1159326650738e-06, 0.3892276994687e+01, 0.5331357529664e+01, + 0.1352853128569e-06, 0.1447950649744e+01, 0.1673046366289e+02, + 0.1433408296083e-06, 0.4457854692961e+01, 0.7342457794669e+01, + 0.1234701666518e-06, 0.1538818147151e+01, 0.6279485555400e+01, + 0.1234027192007e-06, 0.1968523220760e+01, 0.6286666145492e+01, + 0.1244024091797e-06, 0.5779803499985e+01, 0.1511046609763e+02, + 0.1097934945516e-06, 0.6210975221388e+00, 0.1098880815746e+02, + + 0.1254611329856e-06, 0.2591963807998e+01, 0.1572083878776e+02, + 0.1158247286784e-06, 0.2483612812670e+01, 0.5729506548653e+01, + 0.9039078252960e-07, 0.3857554579796e+01, 0.9623688285163e+01, + 0.9108024978836e-07, 0.5826368512984e+01, 0.7234794171227e+01, + 0.8887068108436e-07, 0.3475694573987e+01, 0.6148010737701e+01, + 0.8632374035438e-07, 0.3059070488983e-01, 0.6418140963190e+01, + 0.7893186992967e-07, 0.1583194837728e+01, 0.2118763888447e+01, + 0.8297650201172e-07, 0.8519770534637e+00, 0.1471231707864e+02, + 0.1019759578988e-06, 0.1319598738732e+00, 0.1349867339771e+01, + 0.1010037696236e-06, 0.9937860115618e+00, 0.6836645152238e+01, + + 0.1047727548266e-06, 0.1382138405399e+01, 0.5999216516294e+01, + 0.7351993881086e-07, 0.3833397851735e+01, 0.6040347114260e+01, + 0.9868771092341e-07, 0.2124913814390e+01, 0.6566935184597e+01, + 0.7007321959390e-07, 0.5946305343763e+01, 0.6525804586632e+01, + 0.6861411679709e-07, 0.4574654977089e+01, 0.7238675589263e+01, + 0.7554519809614e-07, 0.5949232686844e+01, 0.1253985337760e+02, + 0.9541880448335e-07, 0.3495242990564e+01, 0.2122839202813e+02, + 0.7185606722155e-07, 0.4310113471661e+01, 0.6245048154254e+01, + 0.7131360871710e-07, 0.5480309323650e+01, 0.6321103546637e+01, + 0.6651142021039e-07, 0.5411097713654e+01, 0.5327476111629e+01, + + 0.8538618213667e-07, 0.1827849973951e+01, 0.1101510648075e+02, + 0.8634954288044e-07, 0.5443584943349e+01, 0.5643178611111e+01, + 0.7449415051484e-07, 0.2011535459060e+01, 0.5368044267797e+00, + 0.7421047599169e-07, 0.3464562529249e+01, 0.2354323048545e+02, + 0.6140694354424e-07, 0.5657556228815e+01, 0.1296430071988e+02, + 0.6353525143033e-07, 0.3463816593821e+01, 0.1990745094947e+01, + 0.6221964013447e-07, 0.1532259498697e+01, 0.9517183207817e+00, + 0.5852480257244e-07, 0.1375396598875e+01, 0.9555997388169e+00, + 0.6398637498911e-07, 0.2405645801972e+01, 0.2407292145756e+02, + 0.7039744069878e-07, 0.5397541799027e+01, 0.5225775174439e+00, + + 0.6977997694382e-07, 0.4762347105419e+01, 0.1097355562493e+02, + 0.7460629558396e-07, 0.2711944692164e+01, 0.2200391463820e+02, + 0.5376577536101e-07, 0.2352980430239e+01, 0.1431416805965e+02, + 0.7530607893556e-07, 0.1943940180699e+01, 0.1842262939178e+02, + 0.6822928971605e-07, 0.4337651846959e+01, 0.1554202828031e+00, + 0.6220772380094e-07, 0.6716871369278e+00, 0.1845107853235e+02, + 0.6586950799043e-07, 0.2229714460505e+01, 0.5216580451554e+01, + 0.5873800565771e-07, 0.7627013920580e+00, 0.6398972393349e+00, + 0.6264346929745e-07, 0.6202785478961e+00, 0.6277552955062e+01, + 0.6257929115669e-07, 0.2886775596668e+01, 0.6288598745829e+01, + + 0.5343536033409e-07, 0.1977241012051e+01, 0.4690479774488e+01, + 0.5587849781714e-07, 0.1922923484825e+01, 0.1551045220144e+01, + 0.6905100845603e-07, 0.3570757164631e+01, 0.1030928125552e+00, + 0.6178957066649e-07, 0.5197558947765e+01, 0.5230807360890e+01, + 0.6187270224331e-07, 0.8193497368922e+00, 0.5650292065779e+01, + 0.5385664291426e-07, 0.5406336665586e+01, 0.7771377146812e+02, + 0.6329363917926e-07, 0.2837760654536e+01, 0.2608790314060e+02, + 0.4546018761604e-07, 0.2933580297050e+01, 0.5535693017924e+00, + 0.6196091049375e-07, 0.4157871494377e+01, 0.8467247584405e+02, + 0.6159555108218e-07, 0.3211703561703e+01, 0.2394243902548e+03, + + 0.4995340539317e-07, 0.1459098102922e+01, 0.4732030630302e+01, + 0.5457031243572e-07, 0.1430457676136e+01, 0.6179983037890e+01, + 0.4863461418397e-07, 0.2196425916730e+01, 0.9027992316901e+02, + 0.5342947626870e-07, 0.2086612890268e+01, 0.6386168663001e+01, + 0.5674296648439e-07, 0.2760204966535e+01, 0.6915859635113e+01, + 0.4745783120161e-07, 0.4245368971862e+01, 0.6282970628506e+01, + 0.4745676961198e-07, 0.5544725787016e+01, 0.6283181072386e+01, + 0.4049796869973e-07, 0.2213984363586e+01, 0.6254626709878e+01, + 0.4248333596940e-07, 0.8075781952896e+00, 0.7875671926403e+01, + 0.4027178070205e-07, 0.1293268540378e+01, 0.6311524991013e+01, + + 0.4066543943476e-07, 0.3986141175804e+01, 0.3634620989887e+01, + 0.4858863787880e-07, 0.1276112738231e+01, 0.5760498333002e+01, + 0.5277398263530e-07, 0.4916111741527e+01, 0.2515860172507e+02, + 0.4105635656559e-07, 0.1725805864426e+01, 0.6709674010002e+01, + 0.4376781925772e-07, 0.2243642442106e+01, 0.6805653367890e+01, + 0.3235827894693e-07, 0.3614135118271e+01, 0.1066495398892e+01, + 0.3073244740308e-07, 0.2460873393460e+01, 0.5863591145557e+01, + 0.3088609271373e-07, 0.5678431771790e+01, 0.9917696840332e+01, + 0.3393022279836e-07, 0.3814017477291e+01, 0.1391601904066e+02, + 0.3038686508802e-07, 0.4660216229171e+01, 0.1256621883632e+02, + + 0.4019677752497e-07, 0.5906906243735e+01, 0.1334167431096e+02, + 0.3288834998232e-07, 0.9536146445882e+00, 0.1620077269078e+02, + 0.3889973794631e-07, 0.3942205097644e+01, 0.7478166569050e-01, + 0.3050438987141e-07, 0.1624810271286e+01, 0.1805292951336e+02, + 0.3601142564638e-07, 0.4030467142575e+01, 0.6208294184755e+01, + 0.3689015557141e-07, 0.3648878818694e+01, 0.5966683958112e+01, + 0.3563471893565e-07, 0.5749584017096e+01, 0.6357857516136e+01, + 0.2776183170667e-07, 0.2630124187070e+01, 0.3523159621801e-02, + 0.2922350530341e-07, 0.1790346403629e+01, 0.1272157198369e+02, + 0.3511076917302e-07, 0.6142198301611e+01, 0.6599467742779e+01, + + 0.3619351007632e-07, 0.1432421386492e+01, 0.6019991944201e+01, + 0.2561254711098e-07, 0.2302822475792e+01, 0.1259245002418e+02, + 0.2626903942920e-07, 0.8660470994571e+00, 0.6702560555334e+01, + 0.2550187397083e-07, 0.6069721995383e+01, 0.1057540660594e+02, + 0.2535873526138e-07, 0.1079020331795e-01, 0.3141537925223e+02, + 0.3519786153847e-07, 0.3809066902283e+01, 0.2505706758577e+03, + 0.3424651492873e-07, 0.2075435114417e+01, 0.6546159756691e+01, + 0.2372676630861e-07, 0.2057803120154e+01, 0.2388894113936e+01, + 0.2710980779541e-07, 0.1510068488010e+01, 0.1202934727411e+02, + 0.3038710889704e-07, 0.5043617528901e+01, 0.1256608456547e+02, + + 0.2220364130585e-07, 0.3694793218205e+01, 0.1336244973887e+02, + 0.3025880825460e-07, 0.5450618999049e-01, 0.2908881142201e+02, + 0.2784493486864e-07, 0.3381164084502e+01, 0.1494531617769e+02, + 0.2294414142438e-07, 0.4382309025210e+01, 0.6076890225335e+01, + 0.2012723294724e-07, 0.9142212256518e+00, 0.6262720680387e+01, + 0.2036357831958e-07, 0.5676172293154e+01, 0.4701116388778e+01, + 0.2003474823288e-07, 0.2592767977625e+01, 0.6303431020504e+01, + 0.2207144900109e-07, 0.5404976271180e+01, 0.6489261475556e+01, + 0.2481664905135e-07, 0.4373284587027e+01, 0.1204357418345e+02, + 0.2674949182295e-07, 0.5859182188482e+01, 0.4590910121555e+01, + + 0.2450554720322e-07, 0.4555381557451e+01, 0.1495633313810e+00, + 0.2601975986457e-07, 0.3933165584959e+01, 0.1965104848470e+02, + 0.2199860022848e-07, 0.5227977189087e+01, 0.1351787002167e+02, + 0.2448121172316e-07, 0.4858060353949e+01, 0.1162474756779e+01, + 0.1876014864049e-07, 0.5690546553605e+01, 0.6279194432410e+01, + 0.1874513219396e-07, 0.4099539297446e+01, 0.6286957268481e+01, + 0.2156380842559e-07, 0.4382594769913e+00, 0.1813929450232e+02, + 0.1981691240061e-07, 0.1829784152444e+01, 0.4686889479442e+01, + 0.2329992648539e-07, 0.2836254278973e+01, 0.1002183730415e+02, + 0.1765184135302e-07, 0.2803494925833e+01, 0.4292330755499e+01, + + 0.2436368366085e-07, 0.2836897959677e+01, 0.9514313292143e+02, + 0.2164089203889e-07, 0.6127522446024e+01, 0.6037244212485e+01, + 0.1847755034221e-07, 0.3683163635008e+01, 0.2427287361862e+00, + 0.1674798769966e-07, 0.3316993867246e+00, 0.1311972100268e+02, + 0.2222542124356e-07, 0.8294097805480e+00, 0.1266924451345e+02, + 0.2071074505925e-07, 0.3659492220261e+01, 0.6528907488406e+01, + 0.1608224471835e-07, 0.4774492067182e+01, 0.1352175143971e+02, + 0.1857583439071e-07, 0.2873120597682e+01, 0.8662240327241e+01, + 0.1793018836159e-07, 0.5282441177929e+00, 0.6819880277225e+01, + 0.1575391221692e-07, 0.1320789654258e+01, 0.1102062672231e+00, + + 0.1840132009557e-07, 0.1917110916256e+01, 0.6514761976723e+02, + 0.1760917288281e-07, 0.2972635937132e+01, 0.5746271423666e+01, + 0.1561779518516e-07, 0.4372569261981e+01, 0.6272439236156e+01, + 0.1558687885205e-07, 0.5416424926425e+01, 0.6293712464735e+01, + 0.1951359382579e-07, 0.3094448898752e+01, 0.2301353951334e+02, + 0.1569144275614e-07, 0.2802103689808e+01, 0.1765478049437e+02, + 0.1479130389462e-07, 0.2136435020467e+01, 0.2077542790660e-01, + 0.1467828510764e-07, 0.7072627435674e+00, 0.1052268489556e+01, + 0.1627627337440e-07, 0.3947607143237e+01, 0.6327837846670e+00, + 0.1503498479758e-07, 0.4079248909190e+01, 0.7626583626240e-01, + + 0.1297967708237e-07, 0.6269637122840e+01, 0.1149965630200e+02, + 0.1374416896634e-07, 0.4175657970702e+01, 0.6016468784579e+01, + 0.1783812325219e-07, 0.1476540547560e+01, 0.3301902111895e+02, + 0.1525884228756e-07, 0.4653477715241e+01, 0.9411464614024e+01, + 0.1451067396763e-07, 0.2573001128225e+01, 0.1277945078067e+02, + 0.1297713111950e-07, 0.5612799618771e+01, 0.6549682916313e+01, + 0.1462784012820e-07, 0.4189661623870e+01, 0.1863592847156e+02, + 0.1384185980007e-07, 0.2656915472196e+01, 0.2379164476796e+01, + 0.1221497599801e-07, 0.5612515760138e+01, 0.1257326515556e+02, + 0.1560574525896e-07, 0.4783414317919e+01, 0.1887552587463e+02, + + 0.1544598372036e-07, 0.2694431138063e+01, 0.1820933031200e+02, + 0.1531678928696e-07, 0.4105103489666e+01, 0.2593412433514e+02, + 0.1349321503795e-07, 0.3082437194015e+00, 0.5120601093667e+01, + 0.1252030290917e-07, 0.6124072334087e+01, 0.6993008899458e+01, + 0.1459243816687e-07, 0.3733103981697e+01, 0.3813291813120e-01, + 0.1226103625262e-07, 0.1267127706817e+01, 0.2435678079171e+02, + 0.1019449641504e-07, 0.4367790112269e+01, 0.1725663147538e+02, + 0.1380789433607e-07, 0.3387201768700e+01, 0.2458316379602e+00, + 0.1019453421658e-07, 0.9204143073737e+00, 0.6112403035119e+01, + 0.1297929434405e-07, 0.5786874896426e+01, 0.1249137003520e+02, + + 0.9912677786097e-08, 0.3164232870746e+01, 0.6247047890016e+01, + 0.9829386098599e-08, 0.2586762413351e+01, 0.6453748665772e+01, + 0.1226807746104e-07, 0.6239068436607e+01, 0.5429879531333e+01, + 0.1192691755997e-07, 0.1867380051424e+01, 0.6290122169689e+01, + 0.9836499227081e-08, 0.3424716293727e+00, 0.6319103810876e+01, + 0.9642862564285e-08, 0.5661372990657e+01, 0.8273820945392e+01, + 0.1165184404862e-07, 0.5768367239093e+01, 0.1778273215245e+02, + 0.1175794418818e-07, 0.1657351222943e+01, 0.6276029531202e+01, + 0.1018948635601e-07, 0.6458292350865e+00, 0.1254537627298e+02, + 0.9500383606676e-08, 0.1054306140741e+01, 0.1256517118505e+02, + + 0.1227512202906e-07, 0.2505278379114e+01, 0.2248384854122e+02, + 0.9664792009993e-08, 0.4289737277000e+01, 0.6259197520765e+01, + 0.9613285666331e-08, 0.5500597673141e+01, 0.6306954180126e+01, + 0.1117906736211e-07, 0.2361405953468e+01, 0.1779695906178e+02, + 0.9611378640782e-08, 0.2851310576269e+01, 0.2061856251104e+00, + 0.8845354852370e-08, 0.6208777705343e+01, 0.1692165728891e+01, + 0.1054046966600e-07, 0.5413091423934e+01, 0.2204125344462e+00, + 0.1215539124483e-07, 0.5613969479755e+01, 0.8257698122054e+02, + 0.9932460955209e-08, 0.1106124877015e+01, 0.1017725758696e+02, + 0.8785804715043e-08, 0.2869224476477e+01, 0.9491756770005e+00, + + 0.8538084097562e-08, 0.6159640899344e+01, 0.6393282117669e+01, + 0.8648994369529e-08, 0.1374901198784e+01, 0.4804209201333e+01, + 0.1039063219067e-07, 0.5171080641327e+01, 0.1550861511662e+02, + 0.8867983926439e-08, 0.8317320304902e+00, 0.3903911373650e+01, + 0.8327495955244e-08, 0.3605591969180e+01, 0.6172869583223e+01, + 0.9243088356133e-08, 0.6114299196843e+01, 0.6267823317922e+01, + 0.9205657357835e-08, 0.3675153683737e+01, 0.6298328382969e+01, + 0.1033269714606e-07, 0.3313328813024e+01, 0.5573142801433e+01, + 0.8001706275552e-08, 0.2019980960053e+01, 0.2648454860559e+01, + 0.9171858254191e-08, 0.8992015524177e+00, 0.1498544001348e+03, + + 0.1075327150242e-07, 0.2898669963648e+01, 0.3694923081589e+02, + 0.9884866689828e-08, 0.4946715904478e+01, 0.1140367694411e+02, + 0.9541835576677e-08, 0.2371787888469e+01, 0.1256713221673e+02, + 0.7739903376237e-08, 0.2213775190612e+01, 0.7834121070590e+01, + 0.7311962684106e-08, 0.3429378787739e+01, 0.1192625446156e+02, + 0.9724904869624e-08, 0.6195878564404e+01, 0.2280573557157e+02, + 0.9251628983612e-08, 0.6511509527390e+00, 0.2787043132925e+01, + 0.7320763787842e-08, 0.6001083639421e+01, 0.6282655592598e+01, + 0.7320296650962e-08, 0.3789073265087e+01, 0.6283496108294e+01, + 0.7947032271039e-08, 0.1059659582204e+01, 0.1241073141809e+02, + + 0.9005277053115e-08, 0.1280315624361e+01, 0.6281591679874e+01, + 0.8995601652048e-08, 0.2224439106766e+01, 0.6284560021018e+01, + 0.8288040568796e-08, 0.5234914433867e+01, 0.1241658836951e+02, + 0.6359381347255e-08, 0.4137989441490e+01, 0.1596186371003e+01, + 0.8699572228626e-08, 0.1758411009497e+01, 0.6133512519065e+01, + 0.6456797542736e-08, 0.5919285089994e+01, 0.1685848245639e+02, + 0.7424573475452e-08, 0.5414616938827e+01, 0.4061219149443e+01, + 0.7235671196168e-08, 0.1496516557134e+01, 0.1610006857377e+03, + 0.8104015182733e-08, 0.1919918242764e+01, 0.8460828644453e+00, + 0.8098576535937e-08, 0.3819615855458e+01, 0.3894181736510e+01, + + 0.6275292346625e-08, 0.6244264115141e+01, 0.8531963191132e+00, + 0.6052432989112e-08, 0.5037731872610e+00, 0.1567108171867e+02, + 0.5705651535817e-08, 0.2984557271995e+01, 0.1258692712880e+02, + 0.5789650115138e-08, 0.6087038140697e+01, 0.1193336791622e+02, + 0.5512132153377e-08, 0.5855668994076e+01, 0.1232342296471e+02, + 0.7388890819102e-08, 0.2443128574740e+01, 0.4907302013889e+01, + 0.5467593991798e-08, 0.3017561234194e+01, 0.1884211409667e+02, + 0.6388519802999e-08, 0.5887386712935e+01, 0.5217580628120e+02, + 0.6106777149944e-08, 0.3483461059895e+00, 0.1422690933580e-01, + 0.7383420275489e-08, 0.5417387056707e+01, 0.2358125818164e+02, + + 0.5505208141738e-08, 0.2848193644783e+01, 0.1151388321134e+02, + 0.6310757462877e-08, 0.2349882520828e+01, 0.1041998632314e+02, + 0.6166904929691e-08, 0.5728575944077e+00, 0.6151533897323e+01, + 0.5263442042754e-08, 0.4495796125937e+01, 0.1885275071096e+02, + 0.5591828082629e-08, 0.1355441967677e+01, 0.4337116142245e+00, + 0.5397051680497e-08, 0.1673422864307e+01, 0.6286362197481e+01, + 0.5396992745159e-08, 0.1833502206373e+01, 0.6279789503410e+01, + 0.6572913000726e-08, 0.3331122065824e+01, 0.1176433076753e+02, + 0.5123421866413e-08, 0.2165327142679e+01, 0.1245594543367e+02, + 0.5930495725999e-08, 0.2931146089284e+01, 0.6414617803568e+01, + + 0.6431797403933e-08, 0.4134407994088e+01, 0.1350651127443e+00, + 0.5003182207604e-08, 0.3805420303749e+01, 0.1096996532989e+02, + 0.5587731032504e-08, 0.1082469260599e+01, 0.6062663316000e+01, + 0.5935263407816e-08, 0.8384333678401e+00, 0.5326786718777e+01, + 0.4756019827760e-08, 0.3552588749309e+01, 0.3104930017775e+01, + 0.6599951172637e-08, 0.4320826409528e+01, 0.4087944051283e+02, + 0.5902606868464e-08, 0.4811879454445e+01, 0.5849364236221e+01, + 0.5921147809031e-08, 0.9942628922396e-01, 0.1581959461667e+01, + 0.5505382581266e-08, 0.2466557607764e+01, 0.6503488384892e+01, + 0.5353771071862e-08, 0.4551978748683e+01, 0.1735668374386e+03, + + 0.5063282210946e-08, 0.5710812312425e+01, 0.1248988586463e+02, + 0.5926120403383e-08, 0.1333998428358e+01, 0.2673594526851e+02, + 0.5211016176149e-08, 0.4649315360760e+01, 0.2460261242967e+02, + 0.5347075084894e-08, 0.5512754081205e+01, 0.4171425416666e+01, + 0.4872609773574e-08, 0.1308025299938e+01, 0.5333900173445e+01, + 0.4727711321420e-08, 0.2144908368062e+01, 0.7232251527446e+01, + 0.6029426018652e-08, 0.5567259412084e+01, 0.3227113045244e+03, + 0.4321485284369e-08, 0.5230667156451e+01, 0.9388005868221e+01, + 0.4476406760553e-08, 0.6134081115303e+01, 0.5547199253223e+01, + 0.5835268277420e-08, 0.4783808492071e+01, 0.7285056171570e+02, + + 0.5172183602748e-08, 0.5161817911099e+01, 0.1884570439172e+02, + 0.5693571465184e-08, 0.1381646203111e+01, 0.9723862754494e+02, + 0.4060634965349e-08, 0.3876705259495e+00, 0.4274518229222e+01, + 0.3967398770473e-08, 0.5029491776223e+01, 0.3496032717521e+01, + 0.3943754005255e-08, 0.1923162955490e+01, 0.6244942932314e+01, + 0.4781323427824e-08, 0.4633332586423e+01, 0.2929661536378e+02, + 0.3871483781204e-08, 0.1616650009743e+01, 0.6321208768577e+01, + 0.5141741733997e-08, 0.9817316704659e-01, 0.1232032006293e+02, + 0.4002385978497e-08, 0.3656161212139e+01, 0.7018952447668e+01, + 0.4901092604097e-08, 0.4404098713092e+01, 0.1478866649112e+01, + + 0.3740932630345e-08, 0.5181188732639e+00, 0.6922973089781e+01, + 0.4387283718538e-08, 0.3254859566869e+01, 0.2331413144044e+03, + 0.5019197802033e-08, 0.3086773224677e+01, 0.1715706182245e+02, + 0.3834931695175e-08, 0.2797882673542e+01, 0.1491901785440e+02, + 0.3760413942497e-08, 0.2892676280217e+01, 0.1726726808967e+02, + 0.3719717204628e-08, 0.5861046025739e+01, 0.6297302759782e+01, + 0.4145623530149e-08, 0.2168239627033e+01, 0.1376059875786e+02, + 0.3932788425380e-08, 0.6271811124181e+01, 0.7872148766781e+01, + 0.3686377476857e-08, 0.3936853151404e+01, 0.6268848941110e+01, + 0.3779077950339e-08, 0.1404148734043e+01, 0.4157198507331e+01, + + 0.4091334550598e-08, 0.2452436180854e+01, 0.9779108567966e+01, + 0.3926694536146e-08, 0.6102292739040e+01, 0.1098419223922e+02, + 0.4841000253289e-08, 0.6072760457276e+01, 0.1252801878276e+02, + 0.4949340130240e-08, 0.1154832815171e+01, 0.1617106187867e+03, + 0.3761557737360e-08, 0.5527545321897e+01, 0.3185192151914e+01, + 0.3647396268188e-08, 0.1525035688629e+01, 0.6271346477544e+01, + 0.3932405074189e-08, 0.5570681040569e+01, 0.2139354194808e+02, + 0.3631322501141e-08, 0.1981240601160e+01, 0.6294805223347e+01, + 0.4130007425139e-08, 0.2050060880201e+01, 0.2195415756911e+02, + 0.4433905965176e-08, 0.3277477970321e+01, 0.7445550607224e+01, + + 0.3851814176947e-08, 0.5210690074886e+01, 0.9562891316684e+00, + 0.3485807052785e-08, 0.6653274904611e+00, 0.1161697602389e+02, + 0.3979772816991e-08, 0.1767941436148e+01, 0.2277943724828e+02, + 0.3402607460500e-08, 0.3421746306465e+01, 0.1087398597200e+02, + 0.4049993000926e-08, 0.1127144787547e+01, 0.3163918923335e+00, + 0.3420511182382e-08, 0.4214794779161e+01, 0.1362553364512e+02, + 0.3640772365012e-08, 0.5324905497687e+01, 0.1725304118033e+02, + 0.3323037987501e-08, 0.6135761838271e+01, 0.6279143387820e+01, + 0.4503141663637e-08, 0.1802305450666e+01, 0.1385561574497e+01, + 0.4314560055588e-08, 0.4812299731574e+01, 0.4176041334900e+01, + + 0.3294226949110e-08, 0.3657547059723e+01, 0.6287008313071e+01, + 0.3215657197281e-08, 0.4866676894425e+01, 0.5749861718712e+01, + 0.4129362656266e-08, 0.3809342558906e+01, 0.5905702259363e+01, + 0.3137762976388e-08, 0.2494635174443e+01, 0.2099539292909e+02, + 0.3514010952384e-08, 0.2699961831678e+01, 0.7335344340001e+01, + 0.3327607571530e-08, 0.3318457714816e+01, 0.5436992986000e+01, + 0.3541066946675e-08, 0.4382703582466e+01, 0.1234573916645e+02, + 0.3216179847052e-08, 0.5271066317054e+01, 0.3802769619140e-01, + 0.2959045059570e-08, 0.5819591585302e+01, 0.2670964694522e+02, + 0.3884040326665e-08, 0.5980934960428e+01, 0.6660449441528e+01, + + 0.2922027539886e-08, 0.3337290282483e+01, 0.1375773836557e+01, + 0.4110846382042e-08, 0.5742978187327e+01, 0.4480965020977e+02, + 0.2934508411032e-08, 0.2278075804200e+01, 0.6408777551755e+00, + 0.3966896193000e-08, 0.5835747858477e+01, 0.3773735910827e+00, + 0.3286695827610e-08, 0.5838898193902e+01, 0.3932462625300e-02, + 0.3720643094196e-08, 0.1122212337858e+01, 0.1646033343740e+02, + 0.3285508906174e-08, 0.9182250996416e+00, 0.1081813534213e+02, + 0.3753880575973e-08, 0.5174761973266e+01, 0.5642198095270e+01, + 0.3022129385587e-08, 0.3381611020639e+01, 0.2982630633589e+02, + 0.2798569205621e-08, 0.3546193723922e+01, 0.1937891852345e+02, + + 0.3397872070505e-08, 0.4533203197934e+01, 0.6923953605621e+01, + 0.3708099772977e-08, 0.2756168198616e+01, 0.3066615496545e+02, + 0.3599283541510e-08, 0.1934395469918e+01, 0.6147450479709e+01, + 0.3688702753059e-08, 0.7149920971109e+00, 0.2636725487657e+01, + 0.2681084724003e-08, 0.4899819493154e+01, 0.6816289982179e+01, + 0.3495993460759e-08, 0.1572418915115e+01, 0.6418701221183e+01, + 0.3130770324995e-08, 0.8912190180489e+00, 0.1235996607578e+02, + 0.2744353821941e-08, 0.3800821940055e+01, 0.2059724391010e+02, + 0.2842732906341e-08, 0.2644717440029e+01, 0.2828699048865e+02, + 0.3046882682154e-08, 0.3987793020179e+01, 0.6055599646783e+01, + + 0.2399072455143e-08, 0.9908826440764e+00, 0.6255674361143e+01, + 0.2384306274204e-08, 0.2516149752220e+01, 0.6310477339748e+01, + 0.2977324500559e-08, 0.5849195642118e+01, 0.1652265972112e+02, + 0.3062835258972e-08, 0.1681660100162e+01, 0.1172006883645e+02, + 0.3109682589231e-08, 0.5804143987737e+00, 0.2751146787858e+02, + 0.2903920355299e-08, 0.5800768280123e+01, 0.6510552054109e+01, + 0.2823221989212e-08, 0.9241118370216e+00, 0.5469525544182e+01, + 0.3187949696649e-08, 0.3139776445735e+01, 0.1693792562116e+03, + 0.2922559771655e-08, 0.3549440782984e+01, 0.2630839062450e+00, + 0.2436302066603e-08, 0.4735540696319e+01, 0.3946258593675e+00, + + 0.3049473043606e-08, 0.4998289124561e+01, 0.8390110365991e+01, + 0.2863682575784e-08, 0.6709515671102e+00, 0.2243449970715e+00, + 0.2641750517966e-08, 0.5410978257284e+01, 0.2986433403208e+02, + 0.2704093466243e-08, 0.4778317207821e+01, 0.6129297044991e+01, + 0.2445522177011e-08, 0.6009020662222e+01, 0.1171295538178e+02, + 0.2623608810230e-08, 0.5010449777147e+01, 0.6436854655901e+01, + 0.2079259704053e-08, 0.5980943768809e+01, 0.2019909489111e+02, + 0.2820225596771e-08, 0.2679965110468e+01, 0.5934151399930e+01, + 0.2365221950927e-08, 0.1894231148810e+01, 0.2470570524223e+02, + 0.2359682077149e-08, 0.4220752950780e+01, 0.8671969964381e+01, + + 0.2387577137206e-08, 0.2571783940617e+01, 0.7096626156709e+01, + 0.1982102089816e-08, 0.5169765997119e+00, 0.1727188400790e+02, + 0.2687502389925e-08, 0.6239078264579e+01, 0.7075506709219e+02, + 0.2207751669135e-08, 0.2031184412677e+01, 0.4377611041777e+01, + 0.2618370214274e-08, 0.8266079985979e+00, 0.6632000300961e+01, + 0.2591951887361e-08, 0.8819350522008e+00, 0.4873985990671e+02, + 0.2375055656248e-08, 0.3520944177789e+01, 0.1590676413561e+02, + 0.2472019978911e-08, 0.1551431908671e+01, 0.6612329252343e+00, + 0.2368157127199e-08, 0.4178610147412e+01, 0.3459636466239e+02, + 0.1764846605693e-08, 0.1506764000157e+01, 0.1980094587212e+02, + + 0.2291769608798e-08, 0.2118250611782e+01, 0.2844914056730e-01, + 0.2209997316943e-08, 0.3363255261678e+01, 0.2666070658668e+00, + 0.2292699097923e-08, 0.4200423956460e+00, 0.1484170571900e-02, + 0.1629683015329e-08, 0.2331362582487e+01, 0.3035599730800e+02, + 0.2206492862426e-08, 0.3400274026992e+01, 0.6281667977667e+01, + 0.2205746568257e-08, 0.1066051230724e+00, 0.6284483723224e+01, + 0.2026310767991e-08, 0.2779066487979e+01, 0.2449240616245e+02, + 0.1762977622163e-08, 0.9951450691840e+00, 0.2045286941806e+02, + 0.1368535049606e-08, 0.6402447365817e+00, 0.2473415438279e+02, + 0.1720598775450e-08, 0.2303524214705e+00, 0.1679593901136e+03, + + 0.1702429015449e-08, 0.6164622655048e+01, 0.3338575901272e+03, + 0.1414033197685e-08, 0.3954561185580e+01, 0.1624205518357e+03, + 0.1573768958043e-08, 0.2028286308984e+01, 0.3144167757552e+02, + 0.1650705184447e-08, 0.2304040666128e+01, 0.5267006960365e+02, + 0.1651087618855e-08, 0.2538461057280e+01, 0.8956999012000e+02, + 0.1616409518983e-08, 0.5111054348152e+01, 0.3332657872986e+02, + 0.1537175173581e-08, 0.5601130666603e+01, 0.3852657435933e+02, + 0.1593191980553e-08, 0.2614340453411e+01, 0.2282781046519e+03, + 0.1499480170643e-08, 0.3624721577264e+01, 0.2823723341956e+02, + 0.1493807843235e-08, 0.4214569879008e+01, 0.2876692439167e+02, + + 0.1074571199328e-08, 0.1496911744704e+00, 0.8397383534231e+02, + 0.1074406983417e-08, 0.1187817671922e+01, 0.8401985929482e+02, + 0.9757576855851e-09, 0.2655703035858e+01, 0.7826370942180e+02, + 0.1258432887565e-08, 0.4969896184844e+01, 0.3115650189215e+03, + 0.1240336343282e-08, 0.5192460776926e+01, 0.1784300471910e+03, + 0.9016107005164e-09, 0.1960356923057e+01, 0.5886454391678e+02, + 0.1135392360918e-08, 0.5082427809068e+01, 0.7842370451713e+02, + 0.9216046089565e-09, 0.2793775037273e+01, 0.1014262087719e+03, + 0.1061276615030e-08, 0.3726144311409e+01, 0.5660027930059e+02, + 0.1010110596263e-08, 0.7404080708937e+00, 0.4245678405627e+02, + + 0.7217424756199e-09, 0.2697449980577e-01, 0.2457074661053e+03, + 0.6912003846756e-09, 0.4253296276335e+01, 0.1679936946371e+03, + 0.6871814664847e-09, 0.5148072412354e+01, 0.6053048899753e+02, + 0.4887158016343e-09, 0.2153581148294e+01, 0.9656299901946e+02, + 0.5161802866314e-09, 0.3852750634351e+01, 0.2442876000072e+03, + 0.5652599559057e-09, 0.1233233356270e+01, 0.8365903305582e+02, + 0.4710812608586e-09, 0.5610486976767e+01, 0.3164282286739e+03, + 0.4909977500324e-09, 0.1639629524123e+01, 0.4059982187939e+03, + 0.4772641839378e-09, 0.3737100368583e+01, 0.1805255418145e+03, + 0.4487562567153e-09, 0.1158417054478e+00, 0.8433466158131e+02, + + 0.3943441230497e-09, 0.6243502862796e+00, 0.2568537517081e+03, + 0.3952236913598e-09, 0.3510377382385e+01, 0.2449975330562e+03, + 0.3788898363417e-09, 0.5916128302299e+01, 0.1568131045107e+03, + 0.3738329328831e-09, 0.1042266763456e+01, 0.3948519331910e+03, + 0.2451199165151e-09, 0.1166788435700e+01, 0.1435713242844e+03, + 0.2436734402904e-09, 0.3254726114901e+01, 0.2268582385539e+03, + 0.2213605274325e-09, 0.1687210598530e+01, 0.1658638954901e+03, + 0.1491521204829e-09, 0.2657541786794e+01, 0.2219950288015e+03, + 0.1474995329744e-09, 0.5013089805819e+01, 0.3052819430710e+03, + 0.1661939475656e-09, 0.5495315428418e+01, 0.2526661704812e+03, + + 0.9015946748003e-10, 0.2236989966505e+01, 0.4171445043968e+03 }; + +/* Sun-to-Earth, T^0, Z */ + static const double e0z[] = { + 0.2796207639075e-05, 0.3198701560209e+01, 0.8433466158131e+02, + 0.1016042198142e-05, 0.5422360395913e+01, 0.5507553240374e+01, + 0.8044305033647e-06, 0.3880222866652e+01, 0.5223693906222e+01, + 0.4385347909274e-06, 0.3704369937468e+01, 0.2352866153506e+01, + 0.3186156414906e-06, 0.3999639363235e+01, 0.1577343543434e+01, + 0.2272412285792e-06, 0.3984738315952e+01, 0.1047747311755e+01, + 0.1645620103007e-06, 0.3565412516841e+01, 0.5856477690889e+01, + 0.1815836921166e-06, 0.4984507059020e+01, 0.6283075850446e+01, + 0.1447461676364e-06, 0.3702753570108e+01, 0.9437762937313e+01, + 0.1430760876382e-06, 0.3409658712357e+01, 0.1021328554739e+02, + + 0.1120445753226e-06, 0.4829561570246e+01, 0.1414349524433e+02, + 0.1090232840797e-06, 0.2080729178066e+01, 0.6812766822558e+01, + 0.9715727346551e-07, 0.3476295881948e+01, 0.4694002934110e+01, + 0.1036267136217e-06, 0.4056639536648e+01, 0.7109288135493e+02, + 0.8752665271340e-07, 0.4448159519911e+01, 0.5753384878334e+01, + 0.8331864956004e-07, 0.4991704044208e+01, 0.7084896783808e+01, + 0.6901658670245e-07, 0.4325358994219e+01, 0.6275962395778e+01, + 0.9144536848998e-07, 0.1141826375363e+01, 0.6620890113188e+01, + 0.7205085037435e-07, 0.3624344170143e+01, 0.5296909721118e+00, + 0.7697874654176e-07, 0.5554257458998e+01, 0.1676215758509e+03, + + 0.5197545738384e-07, 0.6251760961735e+01, 0.1807370494127e+02, + 0.5031345378608e-07, 0.2497341091913e+01, 0.4705732307012e+01, + 0.4527110205840e-07, 0.2335079920992e+01, 0.6309374173736e+01, + 0.4753355798089e-07, 0.7094148987474e+00, 0.5884926831456e+01, + 0.4296951977516e-07, 0.1101916352091e+01, 0.6681224869435e+01, + 0.3855341568387e-07, 0.1825495405486e+01, 0.5486777812467e+01, + 0.5253930970990e-07, 0.4424740687208e+01, 0.7860419393880e+01, + 0.4024630496471e-07, 0.5120498157053e+01, 0.1336797263425e+02, + 0.4061069791453e-07, 0.6029771435451e+01, 0.3930209696940e+01, + 0.3797883804205e-07, 0.4435193600836e+00, 0.3154687086868e+01, + + 0.2933033225587e-07, 0.5124157356507e+01, 0.1059381944224e+01, + 0.3503000930426e-07, 0.5421830162065e+01, 0.6069776770667e+01, + 0.3670096214050e-07, 0.4582101667297e+01, 0.1219403291462e+02, + 0.2905609437008e-07, 0.1926566420072e+01, 0.1097707878456e+02, + 0.2466827821713e-07, 0.6090174539834e+00, 0.6496374930224e+01, + 0.2691647295332e-07, 0.1393432595077e+01, 0.2200391463820e+02, + 0.2150554667946e-07, 0.4308671715951e+01, 0.5643178611111e+01, + 0.2237481922680e-07, 0.8133968269414e+00, 0.8635942003952e+01, + 0.1817741038157e-07, 0.3755205127454e+01, 0.3340612434717e+01, + 0.2227820762132e-07, 0.2759558596664e+01, 0.1203646072878e+02, + + 0.1944713772307e-07, 0.5699645869121e+01, 0.1179062909082e+02, + 0.1527340520662e-07, 0.1986749091746e+01, 0.3981490189893e+00, + 0.1577282574914e-07, 0.3205017217983e+01, 0.5088628793478e+01, + 0.1424738825424e-07, 0.6256747903666e+01, 0.2544314396739e+01, + 0.1616563121701e-07, 0.2601671259394e+00, 0.1729818233119e+02, + 0.1401210391692e-07, 0.4686939173506e+01, 0.7058598460518e+01, + 0.1488726974214e-07, 0.2815862451372e+01, 0.2593412433514e+02, + 0.1692626442388e-07, 0.4956894109797e+01, 0.1564752902480e+03, + 0.1123571582910e-07, 0.2381192697696e+01, 0.3738761453707e+01, + 0.9903308606317e-08, 0.4294851657684e+01, 0.9225539266174e+01, + + 0.9174533187191e-08, 0.3075171510642e+01, 0.4164311961999e+01, + 0.8645985631457e-08, 0.5477534821633e+00, 0.8429241228195e+01, + -0.1085876492688e-07, 0.0000000000000e+00, 0.0000000000000e+00, + 0.9264309077815e-08, 0.5968571670097e+01, 0.7079373888424e+01, + 0.8243116984954e-08, 0.1489098777643e+01, 0.1044738781244e+02, + 0.8268102113708e-08, 0.3512977691983e+01, 0.1150676975667e+02, + 0.9043613988227e-08, 0.1290704408221e+00, 0.1101510648075e+02, + 0.7432912038789e-08, 0.1991086893337e+01, 0.2608790314060e+02, + 0.8586233727285e-08, 0.4238357924414e+01, 0.2986433403208e+02, + 0.7612230060131e-08, 0.2911090150166e+01, 0.4732030630302e+01, + + 0.7097787751408e-08, 0.1908938392390e+01, 0.8031092209206e+01, + 0.7640237040175e-08, 0.6129219000168e+00, 0.7962980379786e+00, + 0.7070445688081e-08, 0.1380417036651e+01, 0.2146165377750e+01, + 0.7690770957702e-08, 0.1680504249084e+01, 0.2122839202813e+02, + 0.8051292542594e-08, 0.5127423484511e+01, 0.2942463415728e+01, + 0.5902709104515e-08, 0.2020274190917e+01, 0.7755226100720e+00, + 0.5134567496462e-08, 0.2606778676418e+01, 0.1256615170089e+02, + 0.5525802046102e-08, 0.1613011769663e+01, 0.8018209333619e+00, + 0.5880724784221e-08, 0.4604483417236e+01, 0.4690479774488e+01, + 0.5211699081370e-08, 0.5718964114193e+01, 0.8827390247185e+01, + + 0.4891849573562e-08, 0.3689658932196e+01, 0.2132990797783e+00, + 0.5150246069997e-08, 0.4099769855122e+01, 0.6480980550449e+02, + 0.5102434319633e-08, 0.5660834602509e+01, 0.3379454372902e+02, + 0.5083405254252e-08, 0.9842221218974e+00, 0.4136910472696e+01, + 0.4206562585682e-08, 0.1341363634163e+00, 0.3128388763578e+01, + 0.4663249683579e-08, 0.8130132735866e+00, 0.5216580451554e+01, + 0.4099474416530e-08, 0.5791497770644e+01, 0.4265981595566e+00, + 0.4628251220767e-08, 0.1249802769331e+01, 0.1572083878776e+02, + 0.5024068728142e-08, 0.4795684802743e+01, 0.6290189305114e+01, + 0.5120234327758e-08, 0.3810420387208e+01, 0.5230807360890e+01, + + 0.5524029815280e-08, 0.1029264714351e+01, 0.2397622045175e+03, + 0.4757415718860e-08, 0.3528044781779e+01, 0.1649636139783e+02, + 0.3915786131127e-08, 0.5593889282646e+01, 0.1589072916335e+01, + 0.4869053149991e-08, 0.3299636454433e+01, 0.7632943190217e+01, + 0.3649365703729e-08, 0.1286049002584e+01, 0.6206810014183e+01, + 0.3992493949002e-08, 0.3100307589464e+01, 0.2515860172507e+02, + 0.3320247477418e-08, 0.6212683940807e+01, 0.1216800268190e+02, + 0.3287123739696e-08, 0.4699118445928e+01, 0.7234794171227e+01, + 0.3472776811103e-08, 0.2630507142004e+01, 0.7342457794669e+01, + 0.3423253294767e-08, 0.2946432844305e+01, 0.9623688285163e+01, + + 0.3896173898244e-08, 0.1224834179264e+01, 0.6438496133249e+01, + 0.3388455337924e-08, 0.1543807616351e+01, 0.1494531617769e+02, + 0.3062704716523e-08, 0.1191777572310e+01, 0.8662240327241e+01, + 0.3270075600400e-08, 0.5483498767737e+01, 0.1194447056968e+01, + 0.3101209215259e-08, 0.8000833804348e+00, 0.3772475342596e+02, + 0.2780883347311e-08, 0.4077980721888e+00, 0.5863591145557e+01, + 0.2903605931824e-08, 0.2617490302147e+01, 0.1965104848470e+02, + 0.2682014743119e-08, 0.2634703158290e+01, 0.7238675589263e+01, + 0.2534360108492e-08, 0.6102446114873e+01, 0.6836645152238e+01, + 0.2392564882509e-08, 0.3681820208691e+01, 0.5849364236221e+01, + + 0.2656667254856e-08, 0.6216045388886e+01, 0.6133512519065e+01, + 0.2331242096773e-08, 0.5864949777744e+01, 0.4535059491685e+01, + 0.2287898363668e-08, 0.4566628532802e+01, 0.7477522907414e+01, + 0.2336944521306e-08, 0.2442722126930e+01, 0.1137170464392e+02, + 0.3156632236269e-08, 0.1626628050682e+01, 0.2509084901204e+03, + 0.2982612402766e-08, 0.2803604512609e+01, 0.1748016358760e+01, + 0.2774031674807e-08, 0.4654002897158e+01, 0.8223916695780e+02, + 0.2295236548638e-08, 0.4326518333253e+01, 0.3378142627421e+00, + 0.2190714699873e-08, 0.4519614578328e+01, 0.2908881142201e+02, + 0.2191495845045e-08, 0.3012626912549e+01, 0.1673046366289e+02, + + 0.2492901628386e-08, 0.1290101424052e+00, 0.1543797956245e+03, + 0.1993778064319e-08, 0.3864046799414e+01, 0.1778984560711e+02, + 0.1898146479022e-08, 0.5053777235891e+01, 0.2042657109477e+02, + 0.1918280127634e-08, 0.2222470192548e+01, 0.4165496312290e+02, + 0.1916351061607e-08, 0.8719067257774e+00, 0.7737595720538e+02, + 0.1834720181466e-08, 0.4031491098040e+01, 0.2358125818164e+02, + 0.1249201523806e-08, 0.5938379466835e+01, 0.3301902111895e+02, + 0.1477304050539e-08, 0.6544722606797e+00, 0.9548094718417e+02, + 0.1264316431249e-08, 0.2059072853236e+01, 0.8399684731857e+02, + 0.1203526495039e-08, 0.3644813532605e+01, 0.4558517281984e+02, + + 0.9221681059831e-09, 0.3241815055602e+01, 0.7805158573086e+02, + 0.7849278367646e-09, 0.5043812342457e+01, 0.5217580628120e+02, + 0.7983392077387e-09, 0.5000024502753e+01, 0.1501922143975e+03, + 0.7925395431654e-09, 0.1398734871821e-01, 0.9061773743175e+02, + 0.7640473285886e-09, 0.5067111723130e+01, 0.4951538251678e+02, + 0.5398937754482e-09, 0.5597382200075e+01, 0.1613385000004e+03, + 0.5626247550193e-09, 0.2601338209422e+01, 0.7318837597844e+02, + 0.5525197197855e-09, 0.5814832109256e+01, 0.1432335100216e+03, + 0.5407629837898e-09, 0.3384820609076e+01, 0.3230491187871e+03, + 0.3856739119801e-09, 0.1072391840473e+01, 0.2334791286671e+03, + + 0.3856425239987e-09, 0.2369540393327e+01, 0.1739046517013e+03, + 0.4350867755983e-09, 0.5255575751082e+01, 0.1620484330494e+03, + 0.3844113924996e-09, 0.5482356246182e+01, 0.9757644180768e+02, + 0.2854869155431e-09, 0.9573634763143e+00, 0.1697170704744e+03, + 0.1719227671416e-09, 0.1887203025202e+01, 0.2265204242912e+03, + 0.1527846879755e-09, 0.3982183931157e+01, 0.3341954043900e+03, + 0.1128229264847e-09, 0.2787457156298e+01, 0.3119028331842e+03 }; + +/* Sun-to-Earth, T^1, X */ + static const double e1x[] = { + 0.1234046326004e-05, 0.0000000000000e+00, 0.0000000000000e+00, + 0.5150068824701e-06, 0.6002664557501e+01, 0.1256615170089e+02, + 0.1290743923245e-07, 0.5959437664199e+01, 0.1884922755134e+02, + 0.1068615564952e-07, 0.2015529654209e+01, 0.6283075850446e+01, + 0.2079619142538e-08, 0.1732960531432e+01, 0.6279552690824e+01, + 0.2078009243969e-08, 0.4915604476996e+01, 0.6286599010068e+01, + 0.6206330058856e-09, 0.3616457953824e+00, 0.4705732307012e+01, + 0.5989335313746e-09, 0.3802607304474e+01, 0.6256777527156e+01, + 0.5958495663840e-09, 0.2845866560031e+01, 0.6309374173736e+01, + 0.4866923261539e-09, 0.5213203771824e+01, 0.7755226100720e+00, + + 0.4267785823142e-09, 0.4368189727818e+00, 0.1059381944224e+01, + 0.4610675141648e-09, 0.1837249181372e-01, 0.7860419393880e+01, + 0.3626989993973e-09, 0.2161590545326e+01, 0.5753384878334e+01, + 0.3563071194389e-09, 0.1452631954746e+01, 0.5884926831456e+01, + 0.3557015642807e-09, 0.4470593393054e+01, 0.6812766822558e+01, + 0.3210412089122e-09, 0.5195926078314e+01, 0.6681224869435e+01, + 0.2875473577986e-09, 0.5916256610193e+01, 0.2513230340178e+02, + 0.2842913681629e-09, 0.1149902426047e+01, 0.6127655567643e+01, + 0.2751248215916e-09, 0.5502088574662e+01, 0.6438496133249e+01, + 0.2481432881127e-09, 0.2921989846637e+01, 0.5486777812467e+01, + + 0.2059885976560e-09, 0.3718070376585e+01, 0.7079373888424e+01, + 0.2015522342591e-09, 0.5979395259740e+01, 0.6290189305114e+01, + 0.1995364084253e-09, 0.6772087985494e+00, 0.6275962395778e+01, + 0.1957436436943e-09, 0.2899210654665e+01, 0.5507553240374e+01, + 0.1651609818948e-09, 0.6228206482192e+01, 0.1150676975667e+02, + 0.1822980550699e-09, 0.1469348746179e+01, 0.1179062909082e+02, + 0.1675223159760e-09, 0.3813910555688e+01, 0.7058598460518e+01, + 0.1706491764745e-09, 0.3004380506684e+00, 0.7113454667900e-02, + 0.1392952362615e-09, 0.1440393973406e+01, 0.7962980379786e+00, + 0.1209868266342e-09, 0.4150425791727e+01, 0.4694002934110e+01, + + 0.1009827202611e-09, 0.3290040429843e+01, 0.3738761453707e+01, + 0.1047261388602e-09, 0.4229590090227e+01, 0.6282095334605e+01, + 0.1047006652004e-09, 0.2418967680575e+01, 0.6284056366286e+01, + 0.9609993143095e-10, 0.4627943659201e+01, 0.6069776770667e+01, + 0.9590900593873e-10, 0.1894393939924e+01, 0.4136910472696e+01, + 0.9146249188071e-10, 0.2010647519562e+01, 0.6496374930224e+01, + 0.8545274480290e-10, 0.5529846956226e-01, 0.1194447056968e+01, + 0.8224377881194e-10, 0.1254304102174e+01, 0.1589072916335e+01, + 0.6183529510410e-10, 0.3360862168815e+01, 0.8827390247185e+01, + 0.6259255147141e-10, 0.4755628243179e+01, 0.8429241228195e+01, + + 0.5539291694151e-10, 0.5371746955142e+01, 0.4933208510675e+01, + 0.7328259466314e-10, 0.4927699613906e+00, 0.4535059491685e+01, + 0.6017835843560e-10, 0.5776682001734e-01, 0.1255903824622e+02, + 0.7079827775243e-10, 0.4395059432251e+01, 0.5088628793478e+01, + 0.5170358878213e-10, 0.5154062619954e+01, 0.1176985366291e+02, + 0.4872301838682e-10, 0.6289611648973e+00, 0.6040347114260e+01, + 0.5249869411058e-10, 0.5617272046949e+01, 0.3154687086868e+01, + 0.4716172354411e-10, 0.3965901800877e+01, 0.5331357529664e+01, + 0.4871214940964e-10, 0.4627507050093e+01, 0.1256967486051e+02, + 0.4598076850751e-10, 0.6023631226459e+01, 0.6525804586632e+01, + + 0.4562196089485e-10, 0.4138562084068e+01, 0.3930209696940e+01, + 0.4325493872224e-10, 0.1330845906564e+01, 0.7632943190217e+01, + 0.5673781176748e-10, 0.2558752615657e+01, 0.5729506548653e+01, + 0.3961436642503e-10, 0.2728071734630e+01, 0.7234794171227e+01, + 0.5101868209058e-10, 0.4113444965144e+01, 0.6836645152238e+01, + 0.5257043167676e-10, 0.6195089830590e+01, 0.8031092209206e+01, + 0.5076613989393e-10, 0.2305124132918e+01, 0.7477522907414e+01, + 0.3342169352778e-10, 0.5415998155071e+01, 0.1097707878456e+02, + 0.3545881983591e-10, 0.3727160564574e+01, 0.4164311961999e+01, + 0.3364063738599e-10, 0.2901121049204e+00, 0.1137170464392e+02, + + 0.3357039670776e-10, 0.1652229354331e+01, 0.5223693906222e+01, + 0.4307412268687e-10, 0.4938909587445e+01, 0.1592596075957e+01, + 0.3405769115435e-10, 0.2408890766511e+01, 0.3128388763578e+01, + 0.3001926198480e-10, 0.4862239006386e+01, 0.1748016358760e+01, + 0.2778264787325e-10, 0.5241168661353e+01, 0.7342457794669e+01, + 0.2676159480666e-10, 0.3423593942199e+01, 0.2146165377750e+01, + 0.2954273399939e-10, 0.1881721265406e+01, 0.5368044267797e+00, + 0.3309362888795e-10, 0.1931525677349e+01, 0.8018209333619e+00, + 0.2810283608438e-10, 0.2414659495050e+01, 0.5225775174439e+00, + 0.3378045637764e-10, 0.4238019163430e+01, 0.1554202828031e+00, + + 0.2558134979840e-10, 0.1828225235805e+01, 0.5230807360890e+01, + 0.2273755578447e-10, 0.5858184283998e+01, 0.7084896783808e+01, + 0.2294176037690e-10, 0.4514589779057e+01, 0.1726015463500e+02, + 0.2533506099435e-10, 0.2355717851551e+01, 0.5216580451554e+01, + 0.2716685375812e-10, 0.2221003625100e+01, 0.8635942003952e+01, + 0.2419043435198e-10, 0.5955704951635e+01, 0.4690479774488e+01, + 0.2521232544812e-10, 0.1395676848521e+01, 0.5481254917084e+01, + 0.2630195021491e-10, 0.5727468918743e+01, 0.2629832328990e-01, + 0.2548395840944e-10, 0.2628351859400e-03, 0.1349867339771e+01 }; + +/* Sun-to-Earth, T^1, Y */ + static const double e1y[] = { + 0.9304690546528e-06, 0.0000000000000e+00, 0.0000000000000e+00, + 0.5150715570663e-06, 0.4431807116294e+01, 0.1256615170089e+02, + 0.1290825411056e-07, 0.4388610039678e+01, 0.1884922755134e+02, + 0.4645466665386e-08, 0.5827263376034e+01, 0.6283075850446e+01, + 0.2079625310718e-08, 0.1621698662282e+00, 0.6279552690824e+01, + 0.2078189850907e-08, 0.3344713435140e+01, 0.6286599010068e+01, + 0.6207190138027e-09, 0.5074049319576e+01, 0.4705732307012e+01, + 0.5989826532569e-09, 0.2231842216620e+01, 0.6256777527156e+01, + 0.5961360812618e-09, 0.1274975769045e+01, 0.6309374173736e+01, + 0.4874165471016e-09, 0.3642277426779e+01, 0.7755226100720e+00, + + 0.4283834034360e-09, 0.5148765510106e+01, 0.1059381944224e+01, + 0.4652389287529e-09, 0.4715794792175e+01, 0.7860419393880e+01, + 0.3751707476401e-09, 0.6617207370325e+00, 0.5753384878334e+01, + 0.3559998806198e-09, 0.6155548875404e+01, 0.5884926831456e+01, + 0.3558447558857e-09, 0.2898827297664e+01, 0.6812766822558e+01, + 0.3211116927106e-09, 0.3625813502509e+01, 0.6681224869435e+01, + 0.2875609914672e-09, 0.4345435813134e+01, 0.2513230340178e+02, + 0.2843109704069e-09, 0.5862263940038e+01, 0.6127655567643e+01, + 0.2744676468427e-09, 0.3926419475089e+01, 0.6438496133249e+01, + 0.2481285237789e-09, 0.1351976572828e+01, 0.5486777812467e+01, + + 0.2060338481033e-09, 0.2147556998591e+01, 0.7079373888424e+01, + 0.2015822358331e-09, 0.4408358972216e+01, 0.6290189305114e+01, + 0.2001195944195e-09, 0.5385829822531e+01, 0.6275962395778e+01, + 0.1953667642377e-09, 0.1304933746120e+01, 0.5507553240374e+01, + 0.1839744078713e-09, 0.6173567228835e+01, 0.1179062909082e+02, + 0.1643334294845e-09, 0.4635942997523e+01, 0.1150676975667e+02, + 0.1768051018652e-09, 0.5086283558874e+01, 0.7113454667900e-02, + 0.1674874205489e-09, 0.2243332137241e+01, 0.7058598460518e+01, + 0.1421445397609e-09, 0.6186899771515e+01, 0.7962980379786e+00, + 0.1255163958267e-09, 0.5730238465658e+01, 0.4694002934110e+01, + + 0.1013945281961e-09, 0.1726055228402e+01, 0.3738761453707e+01, + 0.1047294335852e-09, 0.2658801228129e+01, 0.6282095334605e+01, + 0.1047103879392e-09, 0.8481047835035e+00, 0.6284056366286e+01, + 0.9530343962826e-10, 0.3079267149859e+01, 0.6069776770667e+01, + 0.9604637611690e-10, 0.3258679792918e+00, 0.4136910472696e+01, + 0.9153518537177e-10, 0.4398599886584e+00, 0.6496374930224e+01, + 0.8562458214922e-10, 0.4772686794145e+01, 0.1194447056968e+01, + 0.8232525360654e-10, 0.5966220721679e+01, 0.1589072916335e+01, + 0.6150223411438e-10, 0.1780985591923e+01, 0.8827390247185e+01, + 0.6272087858000e-10, 0.3184305429012e+01, 0.8429241228195e+01, + + 0.5540476311040e-10, 0.3801260595433e+01, 0.4933208510675e+01, + 0.7331901699361e-10, 0.5205948591865e+01, 0.4535059491685e+01, + 0.6018528702791e-10, 0.4770139083623e+01, 0.1255903824622e+02, + 0.5150530724804e-10, 0.3574796899585e+01, 0.1176985366291e+02, + 0.6471933741811e-10, 0.2679787266521e+01, 0.5088628793478e+01, + 0.5317460644174e-10, 0.9528763345494e+00, 0.3154687086868e+01, + 0.4832187748783e-10, 0.5329322498232e+01, 0.6040347114260e+01, + 0.4716763555110e-10, 0.2395235316466e+01, 0.5331357529664e+01, + 0.4871509139861e-10, 0.3056663648823e+01, 0.1256967486051e+02, + 0.4598417696768e-10, 0.4452762609019e+01, 0.6525804586632e+01, + + 0.5674189533175e-10, 0.9879680872193e+00, 0.5729506548653e+01, + 0.4073560328195e-10, 0.5939127696986e+01, 0.7632943190217e+01, + 0.5040994945359e-10, 0.4549875824510e+01, 0.8031092209206e+01, + 0.5078185134679e-10, 0.7346659893982e+00, 0.7477522907414e+01, + 0.3769343537061e-10, 0.1071317188367e+01, 0.7234794171227e+01, + 0.4980331365299e-10, 0.2500345341784e+01, 0.6836645152238e+01, + 0.3458236594757e-10, 0.3825159450711e+01, 0.1097707878456e+02, + 0.3578859493602e-10, 0.5299664791549e+01, 0.4164311961999e+01, + 0.3370504646419e-10, 0.5002316301593e+01, 0.1137170464392e+02, + 0.3299873338428e-10, 0.2526123275282e+01, 0.3930209696940e+01, + + 0.4304917318409e-10, 0.3368078557132e+01, 0.1592596075957e+01, + 0.3402418753455e-10, 0.8385495425800e+00, 0.3128388763578e+01, + 0.2778460572146e-10, 0.3669905203240e+01, 0.7342457794669e+01, + 0.2782710128902e-10, 0.2691664812170e+00, 0.1748016358760e+01, + 0.2711725179646e-10, 0.4707487217718e+01, 0.5296909721118e+00, + 0.2981760946340e-10, 0.3190260867816e+00, 0.5368044267797e+00, + 0.2811672977772e-10, 0.3196532315372e+01, 0.7084896783808e+01, + 0.2863454474467e-10, 0.2263240324780e+00, 0.5223693906222e+01, + 0.3333464634051e-10, 0.3498451685065e+01, 0.8018209333619e+00, + 0.3312991747609e-10, 0.5839154477412e+01, 0.1554202828031e+00, + + 0.2813255564006e-10, 0.8268044346621e+00, 0.5225775174439e+00, + 0.2665098083966e-10, 0.3934021725360e+01, 0.5216580451554e+01, + 0.2349795705216e-10, 0.5197620913779e+01, 0.2146165377750e+01, + 0.2330352293961e-10, 0.2984999231807e+01, 0.1726015463500e+02, + 0.2728001683419e-10, 0.6521679638544e+00, 0.8635942003952e+01, + 0.2484061007669e-10, 0.3468955561097e+01, 0.5230807360890e+01, + 0.2646328768427e-10, 0.1013724533516e+01, 0.2629832328990e-01, + 0.2518630264831e-10, 0.6108081057122e+01, 0.5481254917084e+01, + 0.2421901455384e-10, 0.1651097776260e+01, 0.1349867339771e+01, + 0.6348533267831e-11, 0.3220226560321e+01, 0.8433466158131e+02 }; + +/* Sun-to-Earth, T^1, Z */ + static const double e1z[] = { + 0.2278290449966e-05, 0.3413716033863e+01, 0.6283075850446e+01, + 0.5429458209830e-07, 0.0000000000000e+00, 0.0000000000000e+00, + 0.1903240492525e-07, 0.3370592358297e+01, 0.1256615170089e+02, + 0.2385409276743e-09, 0.3327914718416e+01, 0.1884922755134e+02, + 0.8676928342573e-10, 0.1824006811264e+01, 0.5223693906222e+01, + 0.7765442593544e-10, 0.3888564279247e+01, 0.5507553240374e+01, + 0.7066158332715e-10, 0.5194267231944e+01, 0.2352866153506e+01, + 0.7092175288657e-10, 0.2333246960021e+01, 0.8399684731857e+02, + 0.5357582213535e-10, 0.2224031176619e+01, 0.5296909721118e+00, + 0.3828035865021e-10, 0.2156710933584e+01, 0.6279552690824e+01, + + 0.3824857220427e-10, 0.1529755219915e+01, 0.6286599010068e+01, + 0.3286995181628e-10, 0.4879512900483e+01, 0.1021328554739e+02 }; + +/* Sun-to-Earth, T^2, X */ + static const double e2x[] = { + -0.4143818297913e-10, 0.0000000000000e+00, 0.0000000000000e+00, + 0.2171497694435e-10, 0.4398225628264e+01, 0.1256615170089e+02, + 0.9845398442516e-11, 0.2079720838384e+00, 0.6283075850446e+01, + 0.9256833552682e-12, 0.4191264694361e+01, 0.1884922755134e+02, + 0.1022049384115e-12, 0.5381133195658e+01, 0.8399684731857e+02 }; + +/* Sun-to-Earth, T^2, Y */ + static const double e2y[] = { + 0.5063375872532e-10, 0.0000000000000e+00, 0.0000000000000e+00, + 0.2173815785980e-10, 0.2827805833053e+01, 0.1256615170089e+02, + 0.1010231999920e-10, 0.4634612377133e+01, 0.6283075850446e+01, + 0.9259745317636e-12, 0.2620612076189e+01, 0.1884922755134e+02, + 0.1022202095812e-12, 0.3809562326066e+01, 0.8399684731857e+02 }; + +/* Sun-to-Earth, T^2, Z */ + static const double e2z[] = { + 0.9722666114891e-10, 0.5152219582658e+01, 0.6283075850446e+01, + -0.3494819171909e-11, 0.0000000000000e+00, 0.0000000000000e+00, + 0.6713034376076e-12, 0.6440188750495e+00, 0.1256615170089e+02 }; + +/* SSB-to-Sun, T^0, X */ + static const double s0x[] = { + 0.4956757536410e-02, 0.3741073751789e+01, 0.5296909721118e+00, + 0.2718490072522e-02, 0.4016011511425e+01, 0.2132990797783e+00, + 0.1546493974344e-02, 0.2170528330642e+01, 0.3813291813120e-01, + 0.8366855276341e-03, 0.2339614075294e+01, 0.7478166569050e-01, + 0.2936777942117e-03, 0.0000000000000e+00, 0.0000000000000e+00, + 0.1201317439469e-03, 0.4090736353305e+01, 0.1059381944224e+01, + 0.7578550887230e-04, 0.3241518088140e+01, 0.4265981595566e+00, + 0.1941787367773e-04, 0.1012202064330e+01, 0.2061856251104e+00, + 0.1889227765991e-04, 0.3892520416440e+01, 0.2204125344462e+00, + 0.1937896968613e-04, 0.4797779441161e+01, 0.1495633313810e+00, + + 0.1434506110873e-04, 0.3868960697933e+01, 0.5225775174439e+00, + 0.1406659911580e-04, 0.4759766557397e+00, 0.5368044267797e+00, + 0.1179022300202e-04, 0.7774961520598e+00, 0.7626583626240e-01, + 0.8085864460959e-05, 0.3254654471465e+01, 0.3664874755930e-01, + 0.7622752967615e-05, 0.4227633103489e+01, 0.3961708870310e-01, + 0.6209171139066e-05, 0.2791828325711e+00, 0.7329749511860e-01, + 0.4366435633970e-05, 0.4440454875925e+01, 0.1589072916335e+01, + 0.3792124889348e-05, 0.5156393842356e+01, 0.7113454667900e-02, + 0.3154548963402e-05, 0.6157005730093e+01, 0.4194847048887e+00, + 0.3088359882942e-05, 0.2494567553163e+01, 0.6398972393349e+00, + + 0.2788440902136e-05, 0.4934318747989e+01, 0.1102062672231e+00, + 0.3039928456376e-05, 0.4895077702640e+01, 0.6283075850446e+01, + 0.2272258457679e-05, 0.5278394064764e+01, 0.1030928125552e+00, + 0.2162007057957e-05, 0.5802978019099e+01, 0.3163918923335e+00, + 0.1767632855737e-05, 0.3415346595193e-01, 0.1021328554739e+02, + 0.1349413459362e-05, 0.2001643230755e+01, 0.1484170571900e-02, + 0.1170141900476e-05, 0.2424750491620e+01, 0.6327837846670e+00, + 0.1054355266820e-05, 0.3123311487576e+01, 0.4337116142245e+00, + 0.9800822461610e-06, 0.3026258088130e+01, 0.1052268489556e+01, + 0.1091203749931e-05, 0.3157811670347e+01, 0.1162474756779e+01, + + 0.6960236715913e-06, 0.8219570542313e+00, 0.1066495398892e+01, + 0.5689257296909e-06, 0.1323052375236e+01, 0.9491756770005e+00, + 0.6613172135802e-06, 0.2765348881598e+00, 0.8460828644453e+00, + 0.6277702517571e-06, 0.5794064466382e+01, 0.1480791608091e+00, + 0.6304884066699e-06, 0.7323555380787e+00, 0.2243449970715e+00, + 0.4897850467382e-06, 0.3062464235399e+01, 0.3340612434717e+01, + 0.3759148598786e-06, 0.4588290469664e+01, 0.3516457698740e-01, + 0.3110520548195e-06, 0.1374299536572e+01, 0.6373574839730e-01, + 0.3064708359780e-06, 0.4222267485047e+01, 0.1104591729320e-01, + 0.2856347168241e-06, 0.3714202944973e+01, 0.1510475019529e+00, + + 0.2840945514288e-06, 0.2847972875882e+01, 0.4110125927500e-01, + 0.2378951599405e-06, 0.3762072563388e+01, 0.2275259891141e+00, + 0.2714229481417e-06, 0.1036049980031e+01, 0.2535050500000e-01, + 0.2323551717307e-06, 0.4682388599076e+00, 0.8582758298370e-01, + 0.1881790512219e-06, 0.4790565425418e+01, 0.2118763888447e+01, + 0.2261353968371e-06, 0.1669144912212e+01, 0.7181332454670e-01, + 0.2214546389848e-06, 0.3937717281614e+01, 0.2968341143800e-02, + 0.2184915594933e-06, 0.1129169845099e+00, 0.7775000683430e-01, + 0.2000164937936e-06, 0.4030009638488e+01, 0.2093666171530e+00, + 0.1966105136719e-06, 0.8745955786834e+00, 0.2172315424036e+00, + + 0.1904742332624e-06, 0.5919743598964e+01, 0.2022531624851e+00, + 0.1657399705031e-06, 0.2549141484884e+01, 0.7358765972222e+00, + 0.1574070533987e-06, 0.5277533020230e+01, 0.7429900518901e+00, + 0.1832261651039e-06, 0.3064688127777e+01, 0.3235053470014e+00, + 0.1733615346569e-06, 0.3011432799094e+01, 0.1385174140878e+00, + 0.1549124014496e-06, 0.4005569132359e+01, 0.5154640627760e+00, + 0.1637044713838e-06, 0.1831375966632e+01, 0.8531963191132e+00, + 0.1123420082383e-06, 0.1180270407578e+01, 0.1990721704425e+00, + 0.1083754165740e-06, 0.3414101320863e+00, 0.5439178814476e+00, + 0.1156638012655e-06, 0.6130479452594e+00, 0.5257585094865e+00, + + 0.1142548785134e-06, 0.3724761948846e+01, 0.5336234347371e+00, + 0.7921463895965e-07, 0.2435425589361e+01, 0.1478866649112e+01, + 0.7428600285231e-07, 0.3542144398753e+01, 0.2164800718209e+00, + 0.8323211246747e-07, 0.3525058072354e+01, 0.1692165728891e+01, + 0.7257595116312e-07, 0.1364299431982e+01, 0.2101180877357e+00, + 0.7111185833236e-07, 0.2460478875808e+01, 0.4155522422634e+00, + 0.6868090383716e-07, 0.4397327670704e+01, 0.1173197218910e+00, + 0.7226419974175e-07, 0.4042647308905e+01, 0.1265567569334e+01, + 0.6955642383177e-07, 0.2865047906085e+01, 0.9562891316684e+00, + 0.7492139296331e-07, 0.5014278994215e+01, 0.1422690933580e-01, + + 0.6598363128857e-07, 0.2376730020492e+01, 0.6470106940028e+00, + 0.7381147293385e-07, 0.3272990384244e+01, 0.1581959461667e+01, + 0.6402909624032e-07, 0.5302290955138e+01, 0.9597935788730e-01, + 0.6237454263857e-07, 0.5444144425332e+01, 0.7084920306520e-01, + 0.5241198544016e-07, 0.4215359579205e+01, 0.5265099800692e+00, + 0.5144463853918e-07, 0.1218916689916e+00, 0.5328719641544e+00, + 0.5868164772299e-07, 0.2369402002213e+01, 0.7871412831580e-01, + 0.6233195669151e-07, 0.1254922242403e+01, 0.2608790314060e+02, + 0.6068463791422e-07, 0.5679713760431e+01, 0.1114304132498e+00, + 0.4359361135065e-07, 0.6097219641646e+00, 0.1375773836557e+01, + + 0.4686510366826e-07, 0.4786231041431e+01, 0.1143987543936e+00, + 0.3758977287225e-07, 0.1167368068139e+01, 0.1596186371003e+01, + 0.4282051974778e-07, 0.1519471064319e+01, 0.2770348281756e+00, + 0.5153765386113e-07, 0.1860532322984e+01, 0.2228608264996e+00, + 0.4575129387188e-07, 0.7632857887158e+00, 0.1465949902372e+00, + 0.3326844933286e-07, 0.1298219485285e+01, 0.5070101000000e-01, + 0.3748617450984e-07, 0.1046510321062e+01, 0.4903339079539e+00, + 0.2816756661499e-07, 0.3434522346190e+01, 0.2991266627620e+00, + 0.3412750405039e-07, 0.2523766270318e+01, 0.3518164938661e+00, + 0.2655796761776e-07, 0.2904422260194e+01, 0.6256703299991e+00, + + 0.2963597929458e-07, 0.5923900431149e+00, 0.1099462426779e+00, + 0.2539523734781e-07, 0.4851947722567e+01, 0.1256615170089e+02, + 0.2283087914139e-07, 0.3400498595496e+01, 0.6681224869435e+01, + 0.2321309799331e-07, 0.5789099148673e+01, 0.3368040641550e-01, + 0.2549657649750e-07, 0.3991856479792e-01, 0.1169588211447e+01, + 0.2290462303977e-07, 0.2788567577052e+01, 0.1045155034888e+01, + 0.1945398522914e-07, 0.3290896998176e+01, 0.1155361302111e+01, + 0.1849171512638e-07, 0.2698060129367e+01, 0.4452511715700e-02, + 0.1647199834254e-07, 0.3016735644085e+01, 0.4408250688924e+00, + 0.1529530765273e-07, 0.5573043116178e+01, 0.6521991896920e-01, + + 0.1433199339978e-07, 0.1481192356147e+01, 0.9420622223326e+00, + 0.1729134193602e-07, 0.1422817538933e+01, 0.2108507877249e+00, + 0.1716463931346e-07, 0.3469468901855e+01, 0.2157473718317e+00, + 0.1391206061378e-07, 0.6122436220547e+01, 0.4123712502208e+00, + 0.1404746661924e-07, 0.1647765641936e+01, 0.4258542984690e-01, + 0.1410452399455e-07, 0.5989729161964e+01, 0.2258291676434e+00, + 0.1089828772168e-07, 0.2833705509371e+01, 0.4226656969313e+00, + 0.1047374564948e-07, 0.5090690007331e+00, 0.3092784376656e+00, + 0.1358279126532e-07, 0.5128990262836e+01, 0.7923417740620e-01, + 0.1020456476148e-07, 0.9632772880808e+00, 0.1456308687557e+00, + + 0.1033428735328e-07, 0.3223779318418e+01, 0.1795258541446e+01, + 0.1412435841540e-07, 0.2410271572721e+01, 0.1525316725248e+00, + 0.9722759371574e-08, 0.2333531395690e+01, 0.8434341241180e-01, + 0.9657334084704e-08, 0.6199270974168e+01, 0.1272681024002e+01, + 0.1083641148690e-07, 0.2864222292929e+01, 0.7032915397480e-01, + 0.1067318403838e-07, 0.5833458866568e+00, 0.2123349582968e+00, + 0.1062366201976e-07, 0.4307753989494e+01, 0.2142632012598e+00, + 0.1236364149266e-07, 0.2873917870593e+01, 0.1847279083684e+00, + 0.1092759489593e-07, 0.2959887266733e+01, 0.1370332435159e+00, + 0.8912069362899e-08, 0.5141213702562e+01, 0.2648454860559e+01, + + 0.9656467707970e-08, 0.4532182462323e+01, 0.4376440768498e+00, + 0.8098386150135e-08, 0.2268906338379e+01, 0.2880807454688e+00, + 0.7857714675000e-08, 0.4055544260745e+01, 0.2037373330570e+00, + 0.7288455940646e-08, 0.5357901655142e+01, 0.1129145838217e+00, + 0.9450595950552e-08, 0.4264926963939e+01, 0.5272426800584e+00, + 0.9381718247537e-08, 0.7489366976576e-01, 0.5321392641652e+00, + 0.7079052646038e-08, 0.1923311052874e+01, 0.6288513220417e+00, + 0.9259004415344e-08, 0.2970256853438e+01, 0.1606092486742e+00, + 0.8259801499742e-08, 0.3327056314697e+01, 0.8389694097774e+00, + 0.6476334355779e-08, 0.2954925505727e+01, 0.2008557621224e+01, + + 0.5984021492007e-08, 0.9138753105829e+00, 0.2042657109477e+02, + 0.5989546863181e-08, 0.3244464082031e+01, 0.2111650433779e+01, + 0.6233108606023e-08, 0.4995232638403e+00, 0.4305306221819e+00, + 0.6877299149965e-08, 0.2834987233449e+01, 0.9561746721300e-02, + 0.8311234227190e-08, 0.2202951835758e+01, 0.3801276407308e+00, + 0.6599472832414e-08, 0.4478581462618e+01, 0.1063314406849e+01, + 0.6160491096549e-08, 0.5145858696411e+01, 0.1368660381889e+01, + 0.6164772043891e-08, 0.3762976697911e+00, 0.4234171675140e+00, + 0.6363248684450e-08, 0.3162246718685e+01, 0.1253008786510e-01, + 0.6448587520999e-08, 0.3442693302119e+01, 0.5287268506303e+00, + + 0.6431662283977e-08, 0.8977549136606e+00, 0.5306550935933e+00, + 0.6351223158474e-08, 0.4306447410369e+01, 0.5217580628120e+02, + 0.5476721393451e-08, 0.3888529177855e+01, 0.2221856701002e+01, + 0.5341772572619e-08, 0.2655560662512e+01, 0.7466759693650e-01, + 0.5337055758302e-08, 0.5164990735946e+01, 0.7489573444450e-01, + 0.5373120816787e-08, 0.6041214553456e+01, 0.1274714967946e+00, + 0.5392351705426e-08, 0.9177763485932e+00, 0.1055449481598e+01, + 0.6688495850205e-08, 0.3089608126937e+01, 0.2213766559277e+00, + 0.5072003660362e-08, 0.4311316541553e+01, 0.2132517061319e+00, + 0.5070726650455e-08, 0.5790675464444e+00, 0.2133464534247e+00, + + 0.5658012950032e-08, 0.2703945510675e+01, 0.7287631425543e+00, + 0.4835509924854e-08, 0.2975422976065e+01, 0.7160067364790e-01, + 0.6479821978012e-08, 0.1324168733114e+01, 0.2209183458640e-01, + 0.6230636494980e-08, 0.2860103632836e+01, 0.3306188016693e+00, + 0.4649239516213e-08, 0.4832259763403e+01, 0.7796265773310e-01, + 0.6487325792700e-08, 0.2726165825042e+01, 0.3884652414254e+00, + 0.4682823682770e-08, 0.6966602455408e+00, 0.1073608853559e+01, + 0.5704230804976e-08, 0.5669634104606e+01, 0.8731175355560e-01, + 0.6125413585489e-08, 0.1513386538915e+01, 0.7605151500000e-01, + 0.6035825038187e-08, 0.1983509168227e+01, 0.9846002785331e+00, + + 0.4331123462303e-08, 0.2782892992807e+01, 0.4297791515992e+00, + 0.4681107685143e-08, 0.5337232886836e+01, 0.2127790306879e+00, + 0.4669105829655e-08, 0.5837133792160e+01, 0.2138191288687e+00, + 0.5138823602365e-08, 0.3080560200507e+01, 0.7233337363710e-01, + 0.4615856664534e-08, 0.1661747897471e+01, 0.8603097737811e+00, + 0.4496916702197e-08, 0.2112508027068e+01, 0.7381754420900e-01, + 0.4278479042945e-08, 0.5716528462627e+01, 0.7574578717200e-01, + 0.3840525503932e-08, 0.6424172726492e+00, 0.3407705765729e+00, + 0.4866636509685e-08, 0.4919244697715e+01, 0.7722995774390e-01, + 0.3526100639296e-08, 0.2550821052734e+01, 0.6225157782540e-01, + + 0.3939558488075e-08, 0.3939331491710e+01, 0.5268983110410e-01, + 0.4041268772576e-08, 0.2275337571218e+01, 0.3503323232942e+00, + 0.3948761842853e-08, 0.1999324200790e+01, 0.1451108196653e+00, + 0.3258394550029e-08, 0.9121001378200e+00, 0.5296435984654e+00, + 0.3257897048761e-08, 0.3428428660869e+01, 0.5297383457582e+00, + 0.3842559031298e-08, 0.6132927720035e+01, 0.9098186128426e+00, + 0.3109920095448e-08, 0.7693650193003e+00, 0.3932462625300e-02, + 0.3132237775119e-08, 0.3621293854908e+01, 0.2346394437820e+00, + 0.3942189421510e-08, 0.4841863659733e+01, 0.3180992042600e-02, + 0.3796972285340e-08, 0.1814174994268e+01, 0.1862120789403e+00, + + 0.3995640233688e-08, 0.1386990406091e+01, 0.4549093064213e+00, + 0.2875013727414e-08, 0.9178318587177e+00, 0.1905464808669e+01, + 0.3073719932844e-08, 0.2688923811835e+01, 0.3628624111593e+00, + 0.2731016580075e-08, 0.1188259127584e+01, 0.2131850110243e+00, + 0.2729549896546e-08, 0.3702160634273e+01, 0.2134131485323e+00, + 0.3339372892449e-08, 0.7199163960331e+00, 0.2007689919132e+00, + 0.2898833764204e-08, 0.1916709364999e+01, 0.5291709230214e+00, + 0.2894536549362e-08, 0.2424043195547e+01, 0.5302110212022e+00, + 0.3096872473843e-08, 0.4445894977497e+01, 0.2976424921901e+00, + 0.2635672326810e-08, 0.3814366984117e+01, 0.1485980103780e+01, + + 0.3649302697001e-08, 0.2924200596084e+01, 0.6044726378023e+00, + 0.3127954585895e-08, 0.1842251648327e+01, 0.1084620721060e+00, + 0.2616040173947e-08, 0.4155841921984e+01, 0.1258454114666e+01, + 0.2597395859860e-08, 0.1158045978874e+00, 0.2103781122809e+00, + 0.2593286172210e-08, 0.4771850408691e+01, 0.2162200472757e+00, + 0.2481823585747e-08, 0.4608842558889e+00, 0.1062562936266e+01, + 0.2742219550725e-08, 0.1538781127028e+01, 0.5651155736444e+00, + 0.3199558469610e-08, 0.3226647822878e+00, 0.7036329877322e+00, + 0.2666088542957e-08, 0.1967991731219e+00, 0.1400015846597e+00, + 0.2397067430580e-08, 0.3707036669873e+01, 0.2125476091956e+00, + + 0.2376570772738e-08, 0.1182086628042e+01, 0.2140505503610e+00, + 0.2547228007887e-08, 0.4906256820629e+01, 0.1534957940063e+00, + 0.2265575594114e-08, 0.3414949866857e+01, 0.2235935264888e+00, + 0.2464381430585e-08, 0.4599122275378e+01, 0.2091065926078e+00, + 0.2433408527044e-08, 0.2830751145445e+00, 0.2174915669488e+00, + 0.2443605509076e-08, 0.4212046432538e+01, 0.1739420156204e+00, + 0.2319779262465e-08, 0.9881978408630e+00, 0.7530171478090e-01, + 0.2284622835465e-08, 0.5565347331588e+00, 0.7426161660010e-01, + 0.2467268750783e-08, 0.5655708150766e+00, 0.2526561439362e+00, + 0.2808513492782e-08, 0.1418405053408e+01, 0.5636314030725e+00, + + 0.2329528932532e-08, 0.4069557545675e+01, 0.1056200952181e+01, + 0.9698639532817e-09, 0.1074134313634e+01, 0.7826370942180e+02 }; + +/* SSB-to-Sun, T^0, Y */ + static const double s0y[] = { + 0.4955392320126e-02, 0.2170467313679e+01, 0.5296909721118e+00, + 0.2722325167392e-02, 0.2444433682196e+01, 0.2132990797783e+00, + 0.1546579925346e-02, 0.5992779281546e+00, 0.3813291813120e-01, + 0.8363140252966e-03, 0.7687356310801e+00, 0.7478166569050e-01, + 0.3385792683603e-03, 0.0000000000000e+00, 0.0000000000000e+00, + 0.1201192221613e-03, 0.2520035601514e+01, 0.1059381944224e+01, + 0.7587125720554e-04, 0.1669954006449e+01, 0.4265981595566e+00, + 0.1964155361250e-04, 0.5707743963343e+01, 0.2061856251104e+00, + 0.1891900364909e-04, 0.2320960679937e+01, 0.2204125344462e+00, + 0.1937373433356e-04, 0.3226940689555e+01, 0.1495633313810e+00, + + 0.1437139941351e-04, 0.2301626908096e+01, 0.5225775174439e+00, + 0.1406267683099e-04, 0.5188579265542e+01, 0.5368044267797e+00, + 0.1178703080346e-04, 0.5489483248476e+01, 0.7626583626240e-01, + 0.8079835186041e-05, 0.1683751835264e+01, 0.3664874755930e-01, + 0.7623253594652e-05, 0.2656400462961e+01, 0.3961708870310e-01, + 0.6248667483971e-05, 0.4992775362055e+01, 0.7329749511860e-01, + 0.4366353695038e-05, 0.2869706279678e+01, 0.1589072916335e+01, + 0.3829101568895e-05, 0.3572131359950e+01, 0.7113454667900e-02, + 0.3175733773908e-05, 0.4535372530045e+01, 0.4194847048887e+00, + 0.3092437902159e-05, 0.9230153317909e+00, 0.6398972393349e+00, + + 0.2874168812154e-05, 0.3363143761101e+01, 0.1102062672231e+00, + 0.3040119321826e-05, 0.3324250895675e+01, 0.6283075850446e+01, + 0.2699723308006e-05, 0.2917882441928e+00, 0.1030928125552e+00, + 0.2134832683534e-05, 0.4220997202487e+01, 0.3163918923335e+00, + 0.1770412139433e-05, 0.4747318496462e+01, 0.1021328554739e+02, + 0.1377264209373e-05, 0.4305058462401e+00, 0.1484170571900e-02, + 0.1127814538960e-05, 0.8538177240740e+00, 0.6327837846670e+00, + 0.1055608090130e-05, 0.1551800742580e+01, 0.4337116142245e+00, + 0.9802673861420e-06, 0.1459646735377e+01, 0.1052268489556e+01, + 0.1090329461951e-05, 0.1587351228711e+01, 0.1162474756779e+01, + + 0.6959590025090e-06, 0.5534442628766e+01, 0.1066495398892e+01, + 0.5664914529542e-06, 0.6030673003297e+01, 0.9491756770005e+00, + 0.6607787763599e-06, 0.4989507233927e+01, 0.8460828644453e+00, + 0.6269725742838e-06, 0.4222951804572e+01, 0.1480791608091e+00, + 0.6301889697863e-06, 0.5444316669126e+01, 0.2243449970715e+00, + 0.4891042662861e-06, 0.1490552839784e+01, 0.3340612434717e+01, + 0.3457083123290e-06, 0.3030475486049e+01, 0.3516457698740e-01, + 0.3032559967314e-06, 0.2652038793632e+01, 0.1104591729320e-01, + 0.2841133988903e-06, 0.1276744786829e+01, 0.4110125927500e-01, + 0.2855564444432e-06, 0.2143368674733e+01, 0.1510475019529e+00, + + 0.2765157135038e-06, 0.5444186109077e+01, 0.6373574839730e-01, + 0.2382312465034e-06, 0.2190521137593e+01, 0.2275259891141e+00, + 0.2808060365077e-06, 0.5735195064841e+01, 0.2535050500000e-01, + 0.2332175234405e-06, 0.9481985524859e-01, 0.7181332454670e-01, + 0.2322488199659e-06, 0.5180499361533e+01, 0.8582758298370e-01, + 0.1881850258423e-06, 0.3219788273885e+01, 0.2118763888447e+01, + 0.2196111392808e-06, 0.2366941159761e+01, 0.2968341143800e-02, + 0.2183810335519e-06, 0.4825445110915e+01, 0.7775000683430e-01, + 0.2002733093326e-06, 0.2457148995307e+01, 0.2093666171530e+00, + 0.1967111767229e-06, 0.5586291545459e+01, 0.2172315424036e+00, + + 0.1568473250543e-06, 0.3708003123320e+01, 0.7429900518901e+00, + 0.1852528314300e-06, 0.4310638151560e+01, 0.2022531624851e+00, + 0.1832111226447e-06, 0.1494665322656e+01, 0.3235053470014e+00, + 0.1746805502310e-06, 0.1451378500784e+01, 0.1385174140878e+00, + 0.1555730966650e-06, 0.1068040418198e+01, 0.7358765972222e+00, + 0.1554883462559e-06, 0.2442579035461e+01, 0.5154640627760e+00, + 0.1638380568746e-06, 0.2597913420625e+00, 0.8531963191132e+00, + 0.1159938593640e-06, 0.5834512021280e+01, 0.1990721704425e+00, + 0.1083427965695e-06, 0.5054033177950e+01, 0.5439178814476e+00, + 0.1156480369431e-06, 0.5325677432457e+01, 0.5257585094865e+00, + + 0.1141308860095e-06, 0.2153403923857e+01, 0.5336234347371e+00, + 0.7913146470946e-07, 0.8642846847027e+00, 0.1478866649112e+01, + 0.7439752463733e-07, 0.1970628496213e+01, 0.2164800718209e+00, + 0.7280277104079e-07, 0.6073307250609e+01, 0.2101180877357e+00, + 0.8319567719136e-07, 0.1954371928334e+01, 0.1692165728891e+01, + 0.7137705549290e-07, 0.8904989440909e+00, 0.4155522422634e+00, + 0.6900825396225e-07, 0.2825717714977e+01, 0.1173197218910e+00, + 0.7245757216635e-07, 0.2481677513331e+01, 0.1265567569334e+01, + 0.6961165696255e-07, 0.1292955312978e+01, 0.9562891316684e+00, + 0.7571804456890e-07, 0.3427517575069e+01, 0.1422690933580e-01, + + 0.6605425721904e-07, 0.8052192701492e+00, 0.6470106940028e+00, + 0.7375477357248e-07, 0.1705076390088e+01, 0.1581959461667e+01, + 0.7041664951470e-07, 0.4848356967891e+00, 0.9597935788730e-01, + 0.6322199535763e-07, 0.3878069473909e+01, 0.7084920306520e-01, + 0.5244380279191e-07, 0.2645560544125e+01, 0.5265099800692e+00, + 0.5143125704988e-07, 0.4834486101370e+01, 0.5328719641544e+00, + 0.5871866319373e-07, 0.7981472548900e+00, 0.7871412831580e-01, + 0.6300822573871e-07, 0.5979398788281e+01, 0.2608790314060e+02, + 0.6062154271548e-07, 0.4108655402756e+01, 0.1114304132498e+00, + 0.4361912339976e-07, 0.5322624319280e+01, 0.1375773836557e+01, + + 0.4417005920067e-07, 0.6240817359284e+01, 0.2770348281756e+00, + 0.4686806749936e-07, 0.3214977301156e+01, 0.1143987543936e+00, + 0.3758892132305e-07, 0.5879809634765e+01, 0.1596186371003e+01, + 0.5151351332319e-07, 0.2893377688007e+00, 0.2228608264996e+00, + 0.4554683578572e-07, 0.5475427144122e+01, 0.1465949902372e+00, + 0.3442381385338e-07, 0.5992034796640e+01, 0.5070101000000e-01, + 0.2831093954933e-07, 0.5367350273914e+01, 0.3092784376656e+00, + 0.3756267090084e-07, 0.5758171285420e+01, 0.4903339079539e+00, + 0.2816374679892e-07, 0.1863718700923e+01, 0.2991266627620e+00, + 0.3419307025569e-07, 0.9524347534130e+00, 0.3518164938661e+00, + + 0.2904250494239e-07, 0.5304471615602e+01, 0.1099462426779e+00, + 0.2471734511206e-07, 0.1297069793530e+01, 0.6256703299991e+00, + 0.2539620831872e-07, 0.3281126083375e+01, 0.1256615170089e+02, + 0.2281017868007e-07, 0.1829122133165e+01, 0.6681224869435e+01, + 0.2275319473335e-07, 0.5797198160181e+01, 0.3932462625300e-02, + 0.2547755368442e-07, 0.4752697708330e+01, 0.1169588211447e+01, + 0.2285979669317e-07, 0.1223205292886e+01, 0.1045155034888e+01, + 0.1913386560994e-07, 0.1757532993389e+01, 0.1155361302111e+01, + 0.1809020525147e-07, 0.4246116108791e+01, 0.3368040641550e-01, + 0.1649213300201e-07, 0.1445162890627e+01, 0.4408250688924e+00, + + 0.1834972793932e-07, 0.1126917567225e+01, 0.4452511715700e-02, + 0.1439550648138e-07, 0.6160756834764e+01, 0.9420622223326e+00, + 0.1487645457041e-07, 0.4358761931792e+01, 0.4123712502208e+00, + 0.1731729516660e-07, 0.6134456753344e+01, 0.2108507877249e+00, + 0.1717747163567e-07, 0.1898186084455e+01, 0.2157473718317e+00, + 0.1418190430374e-07, 0.4180286741266e+01, 0.6521991896920e-01, + 0.1404844134873e-07, 0.7654053565412e-01, 0.4258542984690e-01, + 0.1409842846538e-07, 0.4418612420312e+01, 0.2258291676434e+00, + 0.1090948346291e-07, 0.1260615686131e+01, 0.4226656969313e+00, + 0.1357577323612e-07, 0.3558248818690e+01, 0.7923417740620e-01, + + 0.1018154061960e-07, 0.5676087241256e+01, 0.1456308687557e+00, + 0.1412073972109e-07, 0.8394392632422e+00, 0.1525316725248e+00, + 0.1030938326496e-07, 0.1653593274064e+01, 0.1795258541446e+01, + 0.1180081567104e-07, 0.1285802592036e+01, 0.7032915397480e-01, + 0.9708510575650e-08, 0.7631889488106e+00, 0.8434341241180e-01, + 0.9637689663447e-08, 0.4630642649176e+01, 0.1272681024002e+01, + 0.1068910429389e-07, 0.5294934032165e+01, 0.2123349582968e+00, + 0.1063716179336e-07, 0.2736266800832e+01, 0.2142632012598e+00, + 0.1234858713814e-07, 0.1302891146570e+01, 0.1847279083684e+00, + 0.8912631189738e-08, 0.3570415993621e+01, 0.2648454860559e+01, + + 0.1036378285534e-07, 0.4236693440949e+01, 0.1370332435159e+00, + 0.9667798501561e-08, 0.2960768892398e+01, 0.4376440768498e+00, + 0.8108314201902e-08, 0.6987781646841e+00, 0.2880807454688e+00, + 0.7648364324628e-08, 0.2499017863863e+01, 0.2037373330570e+00, + 0.7286136828406e-08, 0.3787426951665e+01, 0.1129145838217e+00, + 0.9448237743913e-08, 0.2694354332983e+01, 0.5272426800584e+00, + 0.9374276106428e-08, 0.4787121277064e+01, 0.5321392641652e+00, + 0.7100226287462e-08, 0.3530238792101e+00, 0.6288513220417e+00, + 0.9253056659571e-08, 0.1399478925664e+01, 0.1606092486742e+00, + 0.6636432145504e-08, 0.3479575438447e+01, 0.1368660381889e+01, + + 0.6469975312932e-08, 0.1383669964800e+01, 0.2008557621224e+01, + 0.7335849729765e-08, 0.1243698166898e+01, 0.9561746721300e-02, + 0.8743421205855e-08, 0.3776164289301e+01, 0.3801276407308e+00, + 0.5993635744494e-08, 0.5627122113596e+01, 0.2042657109477e+02, + 0.5981008479693e-08, 0.1674336636752e+01, 0.2111650433779e+01, + 0.6188535145838e-08, 0.5214925208672e+01, 0.4305306221819e+00, + 0.6596074017566e-08, 0.2907653268124e+01, 0.1063314406849e+01, + 0.6630815126226e-08, 0.2127643669658e+01, 0.8389694097774e+00, + 0.6156772830040e-08, 0.5082160803295e+01, 0.4234171675140e+00, + 0.6446960563014e-08, 0.1872100916905e+01, 0.5287268506303e+00, + + 0.6429324424668e-08, 0.5610276103577e+01, 0.5306550935933e+00, + 0.6302232396465e-08, 0.1592152049607e+01, 0.1253008786510e-01, + 0.6399244436159e-08, 0.2746214421532e+01, 0.5217580628120e+02, + 0.5474965172558e-08, 0.2317666374383e+01, 0.2221856701002e+01, + 0.5339293190692e-08, 0.1084724961156e+01, 0.7466759693650e-01, + 0.5334733683389e-08, 0.3594106067745e+01, 0.7489573444450e-01, + 0.5392665782110e-08, 0.5630254365606e+01, 0.1055449481598e+01, + 0.6682075673789e-08, 0.1518480041732e+01, 0.2213766559277e+00, + 0.5079130495960e-08, 0.2739765115711e+01, 0.2132517061319e+00, + 0.5077759793261e-08, 0.5290711290094e+01, 0.2133464534247e+00, + + 0.4832037368310e-08, 0.1404473217200e+01, 0.7160067364790e-01, + 0.6463279674802e-08, 0.6038381695210e+01, 0.2209183458640e-01, + 0.6240592771560e-08, 0.1290170653666e+01, 0.3306188016693e+00, + 0.4672013521493e-08, 0.3261895939677e+01, 0.7796265773310e-01, + 0.6500650750348e-08, 0.1154522312095e+01, 0.3884652414254e+00, + 0.6344161389053e-08, 0.6206111545062e+01, 0.7605151500000e-01, + 0.4682518370646e-08, 0.5409118796685e+01, 0.1073608853559e+01, + 0.5329460015591e-08, 0.1202985784864e+01, 0.7287631425543e+00, + 0.5701588675898e-08, 0.4098715257064e+01, 0.8731175355560e-01, + 0.6030690867211e-08, 0.4132033218460e+00, 0.9846002785331e+00, + + 0.4336256312655e-08, 0.1211415991827e+01, 0.4297791515992e+00, + 0.4688498808975e-08, 0.3765479072409e+01, 0.2127790306879e+00, + 0.4675578609335e-08, 0.4265540037226e+01, 0.2138191288687e+00, + 0.4225578112158e-08, 0.5237566010676e+01, 0.3407705765729e+00, + 0.5139422230028e-08, 0.1507173079513e+01, 0.7233337363710e-01, + 0.4619995093571e-08, 0.9023957449848e-01, 0.8603097737811e+00, + 0.4494776255461e-08, 0.5414930552139e+00, 0.7381754420900e-01, + 0.4274026276788e-08, 0.4145735303659e+01, 0.7574578717200e-01, + 0.5018141789353e-08, 0.3344408829055e+01, 0.3180992042600e-02, + 0.4866163952181e-08, 0.3348534657607e+01, 0.7722995774390e-01, + + 0.4111986020501e-08, 0.4198823597220e+00, 0.1451108196653e+00, + 0.3356142784950e-08, 0.5609144747180e+01, 0.1274714967946e+00, + 0.4070575554551e-08, 0.7028411059224e+00, 0.3503323232942e+00, + 0.3257451857278e-08, 0.5624697983086e+01, 0.5296435984654e+00, + 0.3256973703026e-08, 0.1857842076707e+01, 0.5297383457582e+00, + 0.3830771508640e-08, 0.4562887279931e+01, 0.9098186128426e+00, + 0.3725024005962e-08, 0.2358058692652e+00, 0.1084620721060e+00, + 0.3136763921756e-08, 0.2049731526845e+01, 0.2346394437820e+00, + 0.3795147256194e-08, 0.2432356296933e+00, 0.1862120789403e+00, + 0.2877342229911e-08, 0.5631101279387e+01, 0.1905464808669e+01, + + 0.3076931798805e-08, 0.1117615737392e+01, 0.3628624111593e+00, + 0.2734765945273e-08, 0.5899826516955e+01, 0.2131850110243e+00, + 0.2733405296885e-08, 0.2130562964070e+01, 0.2134131485323e+00, + 0.2898552353410e-08, 0.3462387048225e+00, 0.5291709230214e+00, + 0.2893736103681e-08, 0.8534352781543e+00, 0.5302110212022e+00, + 0.3095717734137e-08, 0.2875061429041e+01, 0.2976424921901e+00, + 0.2636190425832e-08, 0.2242512846659e+01, 0.1485980103780e+01, + 0.3645512095537e-08, 0.1354016903958e+01, 0.6044726378023e+00, + 0.2808173547723e-08, 0.6705114365631e-01, 0.6225157782540e-01, + 0.2625012866888e-08, 0.4775705748482e+01, 0.5268983110410e-01, + + 0.2572233995651e-08, 0.2638924216139e+01, 0.1258454114666e+01, + 0.2604238824792e-08, 0.4826358927373e+01, 0.2103781122809e+00, + 0.2596886385239e-08, 0.3200388483118e+01, 0.2162200472757e+00, + 0.3228057304264e-08, 0.5384848409563e+01, 0.2007689919132e+00, + 0.2481601798252e-08, 0.5173373487744e+01, 0.1062562936266e+01, + 0.2745977498864e-08, 0.6250966149853e+01, 0.5651155736444e+00, + 0.2669878833811e-08, 0.4906001352499e+01, 0.1400015846597e+00, + 0.3203986611711e-08, 0.5034333010005e+01, 0.7036329877322e+00, + 0.3354961227212e-08, 0.6108262423137e+01, 0.4549093064213e+00, + 0.2400407324558e-08, 0.2135399294955e+01, 0.2125476091956e+00, + + 0.2379905859802e-08, 0.5893721933961e+01, 0.2140505503610e+00, + 0.2550844302187e-08, 0.3331940762063e+01, 0.1534957940063e+00, + 0.2268824211001e-08, 0.1843418461035e+01, 0.2235935264888e+00, + 0.2464700891204e-08, 0.3029548547230e+01, 0.2091065926078e+00, + 0.2436814726024e-08, 0.4994717970364e+01, 0.2174915669488e+00, + 0.2443623894745e-08, 0.2645102591375e+01, 0.1739420156204e+00, + 0.2318701783838e-08, 0.5700547397897e+01, 0.7530171478090e-01, + 0.2284448700256e-08, 0.5268898905872e+01, 0.7426161660010e-01, + 0.2468848123510e-08, 0.5276280575078e+01, 0.2526561439362e+00, + 0.2814052350303e-08, 0.6130168623475e+01, 0.5636314030725e+00, + + 0.2243662755220e-08, 0.6631692457995e+00, 0.8886590321940e-01, + 0.2330795855941e-08, 0.2499435487702e+01, 0.1056200952181e+01, + 0.9757679038404e-09, 0.5796846023126e+01, 0.7826370942180e+02 }; + +/* SSB-to-Sun, T^0, Z */ + static const double s0z[] = { + 0.1181255122986e-03, 0.4607918989164e+00, 0.2132990797783e+00, + 0.1127777651095e-03, 0.4169146331296e+00, 0.5296909721118e+00, + 0.4777754401806e-04, 0.4582657007130e+01, 0.3813291813120e-01, + 0.1129354285772e-04, 0.5758735142480e+01, 0.7478166569050e-01, + -0.1149543637123e-04, 0.0000000000000e+00, 0.0000000000000e+00, + 0.3298730512306e-05, 0.5978801994625e+01, 0.4265981595566e+00, + 0.2733376706079e-05, 0.7665413691040e+00, 0.1059381944224e+01, + 0.9426389657270e-06, 0.3710201265838e+01, 0.2061856251104e+00, + 0.8187517749552e-06, 0.3390675605802e+00, 0.2204125344462e+00, + 0.4080447871819e-06, 0.4552296640088e+00, 0.5225775174439e+00, + + 0.3169973017028e-06, 0.3445455899321e+01, 0.5368044267797e+00, + 0.2438098615549e-06, 0.5664675150648e+01, 0.3664874755930e-01, + 0.2601897517235e-06, 0.1931894095697e+01, 0.1495633313810e+00, + 0.2314558080079e-06, 0.3666319115574e+00, 0.3961708870310e-01, + 0.1962549548002e-06, 0.3167411699020e+01, 0.7626583626240e-01, + 0.2180518287925e-06, 0.1544420746580e+01, 0.7113454667900e-02, + 0.1451382442868e-06, 0.1583756740070e+01, 0.1102062672231e+00, + 0.1358439007389e-06, 0.5239941758280e+01, 0.6398972393349e+00, + 0.1050585898028e-06, 0.2266958352859e+01, 0.3163918923335e+00, + 0.1050029870186e-06, 0.2711495250354e+01, 0.4194847048887e+00, + + 0.9934920679800e-07, 0.1116208151396e+01, 0.1589072916335e+01, + 0.1048395331560e-06, 0.3408619600206e+01, 0.1021328554739e+02, + 0.8370147196668e-07, 0.3810459401087e+01, 0.2535050500000e-01, + 0.7989856510998e-07, 0.3769910473647e+01, 0.7329749511860e-01, + 0.5441221655233e-07, 0.2416994903374e+01, 0.1030928125552e+00, + 0.4610812906784e-07, 0.5858503336994e+01, 0.4337116142245e+00, + 0.3923022803444e-07, 0.3354170010125e+00, 0.1484170571900e-02, + 0.2610725582128e-07, 0.5410600646324e+01, 0.6327837846670e+00, + 0.2455279767721e-07, 0.6120216681403e+01, 0.1162474756779e+01, + 0.2375530706525e-07, 0.6055443426143e+01, 0.1052268489556e+01, + + 0.1782967577553e-07, 0.3146108708004e+01, 0.8460828644453e+00, + 0.1581687095238e-07, 0.6255496089819e+00, 0.3340612434717e+01, + 0.1594657672461e-07, 0.3782604300261e+01, 0.1066495398892e+01, + 0.1563448615040e-07, 0.1997775733196e+01, 0.2022531624851e+00, + 0.1463624258525e-07, 0.1736316792088e+00, 0.3516457698740e-01, + 0.1331585056673e-07, 0.4331941830747e+01, 0.9491756770005e+00, + 0.1130634557637e-07, 0.6152017751825e+01, 0.2968341143800e-02, + 0.1028949607145e-07, 0.2101792614637e+00, 0.2275259891141e+00, + 0.1024074971618e-07, 0.4071833211074e+01, 0.5070101000000e-01, + 0.8826956060303e-08, 0.4861633688145e+00, 0.2093666171530e+00, + + 0.8572230171541e-08, 0.5268190724302e+01, 0.4110125927500e-01, + 0.7649332643544e-08, 0.5134543417106e+01, 0.2608790314060e+02, + 0.8581673291033e-08, 0.2920218146681e+01, 0.1480791608091e+00, + 0.8430589300938e-08, 0.3604576619108e+01, 0.2172315424036e+00, + 0.7776165501012e-08, 0.3772942249792e+01, 0.6373574839730e-01, + 0.8311070234408e-08, 0.6200412329888e+01, 0.3235053470014e+00, + 0.6927365212582e-08, 0.4543353113437e+01, 0.8531963191132e+00, + 0.6791574208598e-08, 0.2882188406238e+01, 0.7181332454670e-01, + 0.5593100811839e-08, 0.1776646892780e+01, 0.7429900518901e+00, + 0.4553381853021e-08, 0.3949617611240e+01, 0.7775000683430e-01, + + 0.5758000450068e-08, 0.3859251775075e+01, 0.1990721704425e+00, + 0.4281283457133e-08, 0.1466294631206e+01, 0.2118763888447e+01, + 0.4206935661097e-08, 0.5421776011706e+01, 0.1104591729320e-01, + 0.4213751641837e-08, 0.3412048993322e+01, 0.2243449970715e+00, + 0.5310506239878e-08, 0.5421641370995e+00, 0.5154640627760e+00, + 0.3827450341320e-08, 0.8887314524995e+00, 0.1510475019529e+00, + 0.4292435241187e-08, 0.1405043757194e+01, 0.1422690933580e-01, + 0.3189780702289e-08, 0.1060049293445e+01, 0.1173197218910e+00, + 0.3226611928069e-08, 0.6270858897442e+01, 0.2164800718209e+00, + 0.2893897608830e-08, 0.5117563223301e+01, 0.6470106940028e+00, + + 0.3239852024578e-08, 0.4079092237983e+01, 0.2101180877357e+00, + 0.2956892222200e-08, 0.1594917021704e+01, 0.3092784376656e+00, + 0.2980177912437e-08, 0.5258787667564e+01, 0.4155522422634e+00, + 0.3163725690776e-08, 0.3854589225479e+01, 0.8582758298370e-01, + 0.2662262399118e-08, 0.3561326430187e+01, 0.5257585094865e+00, + 0.2766689135729e-08, 0.3180732086830e+00, 0.1385174140878e+00, + 0.2411600278464e-08, 0.3324798335058e+01, 0.5439178814476e+00, + 0.2483527695131e-08, 0.4169069291947e+00, 0.5336234347371e+00, + 0.7788777276590e-09, 0.1900569908215e+01, 0.5217580628120e+02 }; + +/* SSB-to-Sun, T^1, X */ + static const double s1x[] = { + -0.1296310361520e-07, 0.0000000000000e+00, 0.0000000000000e+00, + 0.8975769009438e-08, 0.1128891609250e+01, 0.4265981595566e+00, + 0.7771113441307e-08, 0.2706039877077e+01, 0.2061856251104e+00, + 0.7538303866642e-08, 0.2191281289498e+01, 0.2204125344462e+00, + 0.6061384579336e-08, 0.3248167319958e+01, 0.1059381944224e+01, + 0.5726994235594e-08, 0.5569981398610e+01, 0.5225775174439e+00, + 0.5616492836424e-08, 0.5057386614909e+01, 0.5368044267797e+00, + 0.1010881584769e-08, 0.3473577116095e+01, 0.7113454667900e-02, + 0.7259606157626e-09, 0.3651858593665e+00, 0.6398972393349e+00, + 0.8755095026935e-09, 0.1662835408338e+01, 0.4194847048887e+00, + + 0.5370491182812e-09, 0.1327673878077e+01, 0.4337116142245e+00, + 0.5743773887665e-09, 0.4250200846687e+01, 0.2132990797783e+00, + 0.4408103140300e-09, 0.3598752574277e+01, 0.1589072916335e+01, + 0.3101892374445e-09, 0.4887822983319e+01, 0.1052268489556e+01, + 0.3209453713578e-09, 0.9702272295114e+00, 0.5296909721118e+00, + 0.3017228286064e-09, 0.5484462275949e+01, 0.1066495398892e+01, + 0.3200700038601e-09, 0.2846613338643e+01, 0.1495633313810e+00, + 0.2137637279911e-09, 0.5692163292729e+00, 0.3163918923335e+00, + 0.1899686386727e-09, 0.2061077157189e+01, 0.2275259891141e+00, + 0.1401994545308e-09, 0.4177771136967e+01, 0.1102062672231e+00, + + 0.1578057810499e-09, 0.5782460597335e+01, 0.7626583626240e-01, + 0.1237713253351e-09, 0.5705900866881e+01, 0.5154640627760e+00, + 0.1313076837395e-09, 0.5163438179576e+01, 0.3664874755930e-01, + 0.1184963304860e-09, 0.3054804427242e+01, 0.6327837846670e+00, + 0.1238130878565e-09, 0.2317292575962e+01, 0.3961708870310e-01, + 0.1015959527736e-09, 0.2194643645526e+01, 0.7329749511860e-01, + 0.9017954423714e-10, 0.2868603545435e+01, 0.1990721704425e+00, + 0.8668024955603e-10, 0.4923849675082e+01, 0.5439178814476e+00, + 0.7756083930103e-10, 0.3014334135200e+01, 0.9491756770005e+00, + 0.7536503401741e-10, 0.2704886279769e+01, 0.1030928125552e+00, + + 0.5483308679332e-10, 0.6010983673799e+01, 0.8531963191132e+00, + 0.5184339620428e-10, 0.1952704573291e+01, 0.2093666171530e+00, + 0.5108658712030e-10, 0.2958575786649e+01, 0.2172315424036e+00, + 0.5019424524650e-10, 0.1736317621318e+01, 0.2164800718209e+00, + 0.4909312625978e-10, 0.3167216416257e+01, 0.2101180877357e+00, + 0.4456638901107e-10, 0.7697579923471e+00, 0.3235053470014e+00, + 0.4227030350925e-10, 0.3490910137928e+01, 0.6373574839730e-01, + 0.4095456040093e-10, 0.5178888984491e+00, 0.6470106940028e+00, + 0.4990537041422e-10, 0.3323887668974e+01, 0.1422690933580e-01, + 0.4321170010845e-10, 0.4288484987118e+01, 0.7358765972222e+00, + + 0.3544072091802e-10, 0.6021051579251e+01, 0.5265099800692e+00, + 0.3480198638687e-10, 0.4600027054714e+01, 0.5328719641544e+00, + 0.3440287244435e-10, 0.4349525970742e+01, 0.8582758298370e-01, + 0.3330628322713e-10, 0.2347391505082e+01, 0.1104591729320e-01, + 0.2973060707184e-10, 0.4789409286400e+01, 0.5257585094865e+00, + 0.2932606766089e-10, 0.5831693799927e+01, 0.5336234347371e+00, + 0.2876972310953e-10, 0.2692638514771e+01, 0.1173197218910e+00, + 0.2827488278556e-10, 0.2056052487960e+01, 0.2022531624851e+00, + 0.2515028239756e-10, 0.7411863262449e+00, 0.9597935788730e-01, + 0.2853033744415e-10, 0.3948481024894e+01, 0.2118763888447e+01 }; + +/* SSB-to-Sun, T^1, Y */ + static const double s1y[] = { + 0.8989047573576e-08, 0.5840593672122e+01, 0.4265981595566e+00, + 0.7815938401048e-08, 0.1129664707133e+01, 0.2061856251104e+00, + 0.7550926713280e-08, 0.6196589104845e+00, 0.2204125344462e+00, + 0.6056556925895e-08, 0.1677494667846e+01, 0.1059381944224e+01, + 0.5734142698204e-08, 0.4000920852962e+01, 0.5225775174439e+00, + 0.5614341822459e-08, 0.3486722577328e+01, 0.5368044267797e+00, + 0.1028678147656e-08, 0.1877141024787e+01, 0.7113454667900e-02, + 0.7270792075266e-09, 0.5077167301739e+01, 0.6398972393349e+00, + 0.8734141726040e-09, 0.9069550282609e-01, 0.4194847048887e+00, + 0.5377371402113e-09, 0.6039381844671e+01, 0.4337116142245e+00, + + 0.4729719431571e-09, 0.2153086311760e+01, 0.2132990797783e+00, + 0.4458052820973e-09, 0.5059830025565e+01, 0.5296909721118e+00, + 0.4406855467908e-09, 0.2027971692630e+01, 0.1589072916335e+01, + 0.3101659310977e-09, 0.3317677981860e+01, 0.1052268489556e+01, + 0.3016749232545e-09, 0.3913703482532e+01, 0.1066495398892e+01, + 0.3198541352656e-09, 0.1275513098525e+01, 0.1495633313810e+00, + 0.2142065389871e-09, 0.5301351614597e+01, 0.3163918923335e+00, + 0.1902615247592e-09, 0.4894943352736e+00, 0.2275259891141e+00, + 0.1613410990871e-09, 0.2449891130437e+01, 0.1102062672231e+00, + 0.1576992165097e-09, 0.4211421447633e+01, 0.7626583626240e-01, + + 0.1241637259894e-09, 0.4140803368133e+01, 0.5154640627760e+00, + 0.1313974830355e-09, 0.3591920305503e+01, 0.3664874755930e-01, + 0.1181697118258e-09, 0.1506314382788e+01, 0.6327837846670e+00, + 0.1238239742779e-09, 0.7461405378404e+00, 0.3961708870310e-01, + 0.1010107068241e-09, 0.6271010795475e+00, 0.7329749511860e-01, + 0.9226316616509e-10, 0.1259158839583e+01, 0.1990721704425e+00, + 0.8664946419555e-10, 0.3353244696934e+01, 0.5439178814476e+00, + 0.7757230468978e-10, 0.1447677295196e+01, 0.9491756770005e+00, + 0.7693168628139e-10, 0.1120509896721e+01, 0.1030928125552e+00, + 0.5487897454612e-10, 0.4439380426795e+01, 0.8531963191132e+00, + + 0.5196118677218e-10, 0.3788856619137e+00, 0.2093666171530e+00, + 0.5110853339935e-10, 0.1386879372016e+01, 0.2172315424036e+00, + 0.5027804534813e-10, 0.1647881805466e+00, 0.2164800718209e+00, + 0.4922485922674e-10, 0.1594315079862e+01, 0.2101180877357e+00, + 0.6155599524400e-10, 0.0000000000000e+00, 0.0000000000000e+00, + 0.4447147832161e-10, 0.5480720918976e+01, 0.3235053470014e+00, + 0.4144691276422e-10, 0.1931371033660e+01, 0.6373574839730e-01, + 0.4099950625452e-10, 0.5229611294335e+01, 0.6470106940028e+00, + 0.5060541682953e-10, 0.1731112486298e+01, 0.1422690933580e-01, + 0.4293615946300e-10, 0.2714571038925e+01, 0.7358765972222e+00, + + 0.3545659845763e-10, 0.4451041444634e+01, 0.5265099800692e+00, + 0.3479112041196e-10, 0.3029385448081e+01, 0.5328719641544e+00, + 0.3438516493570e-10, 0.2778507143731e+01, 0.8582758298370e-01, + 0.3297341285033e-10, 0.7898709807584e+00, 0.1104591729320e-01, + 0.2972585818015e-10, 0.3218785316973e+01, 0.5257585094865e+00, + 0.2931707295017e-10, 0.4260731012098e+01, 0.5336234347371e+00, + 0.2897198149403e-10, 0.1120753978101e+01, 0.1173197218910e+00, + 0.2832293240878e-10, 0.4597682717827e+00, 0.2022531624851e+00, + 0.2864348326612e-10, 0.2169939928448e+01, 0.9597935788730e-01, + 0.2852714675471e-10, 0.2377659870578e+01, 0.2118763888447e+01 }; + +/* SSB-to-Sun, T^1, Z */ + static const double s1z[] = { + 0.5444220475678e-08, 0.1803825509310e+01, 0.2132990797783e+00, + 0.3883412695596e-08, 0.4668616389392e+01, 0.5296909721118e+00, + 0.1334341434551e-08, 0.0000000000000e+00, 0.0000000000000e+00, + 0.3730001266883e-09, 0.5401405918943e+01, 0.2061856251104e+00, + 0.2894929197956e-09, 0.4932415609852e+01, 0.2204125344462e+00, + 0.2857950357701e-09, 0.3154625362131e+01, 0.7478166569050e-01, + 0.2499226432292e-09, 0.3657486128988e+01, 0.4265981595566e+00, + 0.1937705443593e-09, 0.5740434679002e+01, 0.1059381944224e+01, + 0.1374894396320e-09, 0.1712857366891e+01, 0.5368044267797e+00, + 0.1217248678408e-09, 0.2312090870932e+01, 0.5225775174439e+00, + + 0.7961052740870e-10, 0.5283368554163e+01, 0.3813291813120e-01, + 0.4979225949689e-10, 0.4298290471860e+01, 0.4194847048887e+00, + 0.4388552286597e-10, 0.6145515047406e+01, 0.7113454667900e-02, + 0.2586835212560e-10, 0.3019448001809e+01, 0.6398972393349e+00 }; + +/* SSB-to-Sun, T^2, X */ + static const double s2x[] = { + 0.1603551636587e-11, 0.4404109410481e+01, 0.2061856251104e+00, + 0.1556935889384e-11, 0.4818040873603e+00, 0.2204125344462e+00, + 0.1182594414915e-11, 0.9935762734472e+00, 0.5225775174439e+00, + 0.1158794583180e-11, 0.3353180966450e+01, 0.5368044267797e+00, + 0.9597358943932e-12, 0.5567045358298e+01, 0.2132990797783e+00, + 0.6511516579605e-12, 0.5630872420788e+01, 0.4265981595566e+00, + 0.7419792747688e-12, 0.2156188581957e+01, 0.5296909721118e+00, + 0.3951972655848e-12, 0.1981022541805e+01, 0.1059381944224e+01, + 0.4478223877045e-12, 0.0000000000000e+00, 0.0000000000000e+00 }; + +/* SSB-to-Sun, T^2, Y */ + static const double s2y[] = { + 0.1609114495091e-11, 0.2831096993481e+01, 0.2061856251104e+00, + 0.1560330784946e-11, 0.5193058213906e+01, 0.2204125344462e+00, + 0.1183535479202e-11, 0.5707003443890e+01, 0.5225775174439e+00, + 0.1158183066182e-11, 0.1782400404928e+01, 0.5368044267797e+00, + 0.1032868027407e-11, 0.4036925452011e+01, 0.2132990797783e+00, + 0.6540142847741e-12, 0.4058241056717e+01, 0.4265981595566e+00, + 0.7305236491596e-12, 0.6175401942957e+00, 0.5296909721118e+00, + -0.5580725052968e-12, 0.0000000000000e+00, 0.0000000000000e+00, + 0.3946122651015e-12, 0.4108265279171e+00, 0.1059381944224e+01 }; + +/* SSB-to-Sun, T^2, Z */ + static const double s2z[] = { + 0.3749920358054e-12, 0.3230285558668e+01, 0.2132990797783e+00, + 0.2735037220939e-12, 0.6154322683046e+01, 0.5296909721118e+00 }; + +/* Pointers to coefficient arrays, in x,y,z sets */ + static const double *ce0[] = { e0x, e0y, e0z }, + *ce1[] = { e1x, e1y, e1z }, + *ce2[] = { e2x, e2y, e2z }, + *cs0[] = { s0x, s0y, s0z }, + *cs1[] = { s1x, s1y, s1z }, + *cs2[] = { s2x, s2y, s2z }; + const double *coeffs; + +/* Numbers of terms for each component of the model, in x,y,z sets */ + static const int ne0[3] = {(int)(sizeof e0x / sizeof (double) / 3), + (int)(sizeof e0y / sizeof (double) / 3), + (int)(sizeof e0z / sizeof (double) / 3) }, + ne1[3] = {(int)(sizeof e1x / sizeof (double) / 3), + (int)(sizeof e1y / sizeof (double) / 3), + (int)(sizeof e1z / sizeof (double) / 3) }, + ne2[3] = {(int)(sizeof e2x / sizeof (double) / 3), + (int)(sizeof e2y / sizeof (double) / 3), + (int)(sizeof e2z / sizeof (double) / 3) }, + ns0[3] = {(int)(sizeof s0x / sizeof (double) / 3), + (int)(sizeof s0y / sizeof (double) / 3), + (int)(sizeof s0z / sizeof (double) / 3) }, + ns1[3] = {(int)(sizeof s1x / sizeof (double) / 3), + (int)(sizeof s1y / sizeof (double) / 3), + (int)(sizeof s1z / sizeof (double) / 3) }, + ns2[3] = {(int)(sizeof s2x / sizeof (double) / 3), + (int)(sizeof s2y / sizeof (double) / 3), + (int)(sizeof s2z / sizeof (double) / 3) }; + int nterms; + +/* Miscellaneous */ + int jstat, i, j; + double t, t2, xyz, xyzd, a, b, c, ct, p, cp, + ph[3], vh[3], pb[3], vb[3], x, y, z; + +/*--------------------------------------------------------------------*/ + +/* Time since reference epoch, Julian years. */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJY; + t2 = t*t; + +/* Set status. */ + jstat = fabs(t) <= 100.0 ? 0 : 1; + +/* X then Y then Z. */ + for (i = 0; i < 3; i++) { + + /* Initialize position and velocity component. */ + xyz = 0.0; + xyzd = 0.0; + + /* ------------------------------------------------ */ + /* Obtain component of Sun to Earth ecliptic vector */ + /* ------------------------------------------------ */ + + /* Sun to Earth, T^0 terms. */ + coeffs = ce0[i]; + nterms = ne0[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + p = b + c*t; + xyz += a*cos(p); + xyzd -= a*c*sin(p); + } + + /* Sun to Earth, T^1 terms. */ + coeffs = ce1[i]; + nterms = ne1[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + ct = c*t; + p = b + ct; + cp = cos(p); + xyz += a*t*cp; + xyzd += a*( cp - ct*sin(p) ); + } + + /* Sun to Earth, T^2 terms. */ + coeffs = ce2[i]; + nterms = ne2[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + ct = c*t; + p = b + ct; + cp = cos(p); + xyz += a*t2*cp; + xyzd += a*t*( 2.0*cp - ct*sin(p) ); + } + + /* Heliocentric Earth position and velocity component. */ + ph[i] = xyz; + vh[i] = xyzd / ERFA_DJY; + + /* ------------------------------------------------ */ + /* Obtain component of SSB to Earth ecliptic vector */ + /* ------------------------------------------------ */ + + /* SSB to Sun, T^0 terms. */ + coeffs = cs0[i]; + nterms = ns0[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + p = b + c*t; + xyz += a*cos(p); + xyzd -= a*c*sin(p); + } + + /* SSB to Sun, T^1 terms. */ + coeffs = cs1[i]; + nterms = ns1[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + ct = c*t; + p = b + ct; + cp = cos(p); + xyz += a*t*cp; + xyzd += a*(cp - ct*sin(p)); + } + + /* SSB to Sun, T^2 terms. */ + coeffs = cs2[i]; + nterms = ns2[i]; + for (j = 0; j < nterms; j++) { + a = *coeffs++; + b = *coeffs++; + c = *coeffs++; + ct = c*t; + p = b + ct; + cp = cos(p); + xyz += a*t2*cp; + xyzd += a*t*(2.0*cp - ct*sin(p)); + } + + /* Barycentric Earth position and velocity component. */ + pb[i] = xyz; + vb[i] = xyzd / ERFA_DJY; + + /* Next Cartesian component. */ + } + +/* Rotate from ecliptic to BCRS coordinates. */ + + x = ph[0]; + y = ph[1]; + z = ph[2]; + pvh[0][0] = x + am12*y + am13*z; + pvh[0][1] = am21*x + am22*y + am23*z; + pvh[0][2] = am32*y + am33*z; + + x = vh[0]; + y = vh[1]; + z = vh[2]; + pvh[1][0] = x + am12*y + am13*z; + pvh[1][1] = am21*x + am22*y + am23*z; + pvh[1][2] = am32*y + am33*z; + + x = pb[0]; + y = pb[1]; + z = pb[2]; + pvb[0][0] = x + am12*y + am13*z; + pvb[0][1] = am21*x + am22*y + am23*z; + pvb[0][2] = am32*y + am33*z; + + x = vb[0]; + y = vb[1]; + z = vb[2]; + pvb[1][0] = x + am12*y + am13*z; + pvb[1][1] = am21*x + am22*y + am23*z; + pvb[1][2] = am32*y + am33*z; + +/* Return the status. */ + return jstat; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eqec06.c b/testbed/astropy__astropy/cextern/erfa/eqec06.c new file mode 100644 index 0000000000000000000000000000000000000000..70d0ed6b0d10abda9bbb5cafd533ed4febb3a7da --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eqec06.c @@ -0,0 +1,142 @@ +#include "erfa.h" + +void eraEqec06(double date1, double date2, double dr, double dd, + double *dl, double *db) +/* +** - - - - - - - - - - +** e r a E q e c 0 6 +** - - - - - - - - - - +** +** Transformation from ICRS equatorial coordinates to ecliptic +** coordinates (mean equinox and ecliptic of date) using IAU 2006 +** precession model. +** +** Given: +** date1,date2 double TT as a 2-part Julian date (Note 1) +** dr,dd double ICRS right ascension and declination (radians) +** +** Returned: +** dl,db double ecliptic longitude and latitude (radians) +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) No assumptions are made about whether the coordinates represent +** starlight and embody astrometric effects such as parallax or +** aberration. +** +** 3) The transformation is approximately that from mean J2000.0 right +** ascension and declination to ecliptic longitude and latitude +** (mean equinox and ecliptic of date), with only frame bias (always +** less than 25 mas) to disturb this classical picture. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006 +** eraRxp product of r-matrix and p-vector +** eraC2s unit vector to spherical coordinates +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rm[3][3], v1[3], v2[3], a, b; + + +/* Spherical to Cartesian. */ + eraS2c(dr, dd, v1); + +/* Rotation matrix, ICRS equatorial to ecliptic. */ + eraEcm06(date1, date2, rm); + +/* The transformation from ICRS to ecliptic. */ + eraRxp(rm, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, &a, &b); + +/* Express in conventional ranges. */ + *dl = eraAnp(a); + *db = eraAnpm(b); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/eqeq94.c b/testbed/astropy__astropy/cextern/erfa/eqeq94.c new file mode 100644 index 0000000000000000000000000000000000000000..8d677385d2da3b329502483560372f6b91565b10 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/eqeq94.c @@ -0,0 +1,141 @@ +#include "erfa.h" + +double eraEqeq94(double date1, double date2) +/* +** - - - - - - - - - - +** e r a E q e q 9 4 +** - - - - - - - - - - +** +** Equation of the equinoxes, IAU 1994 model. +** +** Given: +** date1,date2 double TDB date (Note 1) +** +** Returned (function value): +** double equation of the equinoxes (Note 2) +** +** Notes: +** +** 1) The date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result, which is in radians, operates in the following sense: +** +** Greenwich apparent ST = GMST + equation of the equinoxes +** +** Called: +** eraAnpm normalize angle into range +/- pi +** eraNut80 nutation, IAU 1980 +** eraObl80 mean obliquity, IAU 1980 +** +** References: +** +** IAU Resolution C7, Recommendation 3 (1994). +** +** Capitaine, N. & Gontier, A.-M., 1993, Astron. Astrophys., 275, +** 645-650. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, om, dpsi, deps, eps0, ee; + + +/* Interval between fundamental epoch J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Longitude of the mean ascending node of the lunar orbit on the */ +/* ecliptic, measured from the mean equinox of date. */ + om = eraAnpm((450160.280 + (-482890.539 + + (7.455 + 0.008 * t) * t) * t) * ERFA_DAS2R + + fmod(-5.0 * t, 1.0) * ERFA_D2PI); + +/* Nutation components and mean obliquity. */ + eraNut80(date1, date2, &dpsi, &deps); + eps0 = eraObl80(date1, date2); + +/* Equation of the equinoxes. */ + ee = dpsi*cos(eps0) + ERFA_DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om)); + + return ee; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/era00.c b/testbed/astropy__astropy/cextern/erfa/era00.c new file mode 100644 index 0000000000000000000000000000000000000000..b3badc547c5352e898779b4040f2eebc3b8edff5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/era00.c @@ -0,0 +1,145 @@ +#include "erfa.h" + +double eraEra00(double dj1, double dj2) +/* +** - - - - - - - - - +** e r a E r a 0 0 +** - - - - - - - - - +** +** Earth rotation angle (IAU 2000 model). +** +** Given: +** dj1,dj2 double UT1 as a 2-part Julian Date (see note) +** +** Returned (function value): +** double Earth rotation angle (radians), range 0-2pi +** +** Notes: +** +** 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any +** convenient way between the arguments dj1 and dj2. For example, +** JD(UT1)=2450123.7 could be expressed in any of these ways, +** among others: +** +** dj1 dj2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. The date & time method is +** best matched to the algorithm used: maximum precision is +** delivered when the dj1 argument is for 0hrs UT1 on the day in +** question and the dj2 argument lies in the range 0 to 1, or vice +** versa. +** +** 2) The algorithm is adapted from Expression 22 of Capitaine et al. +** 2000. The time argument has been expressed in days directly, +** and, to retain precision, integer contributions have been +** eliminated. The same formulation is given in IERS Conventions +** (2003), Chap. 5, Eq. 14. +** +** Called: +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron. +** Astrophys., 355, 398-405. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double d1, d2, t, f, theta; + + +/* Days since fundamental epoch. */ + if (dj1 < dj2) { + d1 = dj1; + d2 = dj2; + } else { + d1 = dj2; + d2 = dj1; + } + t = d1 + (d2- ERFA_DJ00); + +/* Fractional part of T (days). */ + f = fmod(d1, 1.0) + fmod(d2, 1.0); + +/* Earth rotation angle at this UT1. */ + theta = eraAnp(ERFA_D2PI * (f + 0.7790572732640 + + 0.00273781191135448 * t)); + + return theta; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/erfa.h b/testbed/astropy__astropy/cextern/erfa/erfa.h new file mode 100644 index 0000000000000000000000000000000000000000..9cdf57ee325f5dbbb3af4464bfaac89c68431107 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/erfa.h @@ -0,0 +1,520 @@ +#ifndef ERFAHDEF +#define ERFAHDEF + +/* +** - - - - - - - +** e r f a . h +** - - - - - - - +** +** Prototype function declarations for ERFA library. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ + +#include "erfam.h" +#include "math.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Astronomy/Calendars */ +int eraCal2jd(int iy, int im, int id, double *djm0, double *djm); +double eraEpb(double dj1, double dj2); +void eraEpb2jd(double epb, double *djm0, double *djm); +double eraEpj(double dj1, double dj2); +void eraEpj2jd(double epj, double *djm0, double *djm); +int eraJd2cal(double dj1, double dj2, + int *iy, int *im, int *id, double *fd); +int eraJdcalf(int ndp, double dj1, double dj2, int iymdf[4]); + +/* Astronomy/Astrometry */ +void eraAb(double pnat[3], double v[3], double s, double bm1, + double ppr[3]); +void eraApcg(double date1, double date2, + double ebpv[2][3], double ehp[3], + eraASTROM *astrom); +void eraApcg13(double date1, double date2, eraASTROM *astrom); +void eraApci(double date1, double date2, + double ebpv[2][3], double ehp[3], + double x, double y, double s, + eraASTROM *astrom); +void eraApci13(double date1, double date2, + eraASTROM *astrom, double *eo); +void eraApco(double date1, double date2, + double ebpv[2][3], double ehp[3], + double x, double y, double s, double theta, + double elong, double phi, double hm, + double xp, double yp, double sp, + double refa, double refb, + eraASTROM *astrom); +int eraApco13(double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + eraASTROM *astrom, double *eo); +void eraApcs(double date1, double date2, double pv[2][3], + double ebpv[2][3], double ehp[3], + eraASTROM *astrom); +void eraApcs13(double date1, double date2, double pv[2][3], + eraASTROM *astrom); +void eraAper(double theta, eraASTROM *astrom); +void eraAper13(double ut11, double ut12, eraASTROM *astrom); +void eraApio(double sp, double theta, + double elong, double phi, double hm, double xp, double yp, + double refa, double refb, + eraASTROM *astrom); +int eraApio13(double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + eraASTROM *astrom); +void eraAtci13(double rc, double dc, + double pr, double pd, double px, double rv, + double date1, double date2, + double *ri, double *di, double *eo); +void eraAtciq(double rc, double dc, double pr, double pd, + double px, double rv, eraASTROM *astrom, + double *ri, double *di); +void eraAtciqn(double rc, double dc, double pr, double pd, + double px, double rv, eraASTROM *astrom, + int n, eraLDBODY b[], double *ri, double *di); +void eraAtciqz(double rc, double dc, eraASTROM *astrom, + double *ri, double *di); +int eraAtco13(double rc, double dc, + double pr, double pd, double px, double rv, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *aob, double *zob, double *hob, + double *dob, double *rob, double *eo); +void eraAtic13(double ri, double di, + double date1, double date2, + double *rc, double *dc, double *eo); +void eraAticq(double ri, double di, eraASTROM *astrom, + double *rc, double *dc); +void eraAticqn(double ri, double di, eraASTROM *astrom, + int n, eraLDBODY b[], double *rc, double *dc); +int eraAtio13(double ri, double di, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *aob, double *zob, double *hob, + double *dob, double *rob); +void eraAtioq(double ri, double di, eraASTROM *astrom, + double *aob, double *zob, + double *hob, double *dob, double *rob); +int eraAtoc13(const char *type, double ob1, double ob2, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *rc, double *dc); +int eraAtoi13(const char *type, double ob1, double ob2, + double utc1, double utc2, double dut1, + double elong, double phi, double hm, double xp, double yp, + double phpa, double tc, double rh, double wl, + double *ri, double *di); +void eraAtoiq(const char *type, + double ob1, double ob2, eraASTROM *astrom, + double *ri, double *di); +void eraLd(double bm, double p[3], double q[3], double e[3], + double em, double dlim, double p1[3]); +void eraLdn(int n, eraLDBODY b[], double ob[3], double sc[3], + double sn[3]); +void eraLdsun(double p[3], double e[3], double em, double p1[3]); +void eraPmpx(double rc, double dc, double pr, double pd, + double px, double rv, double pmt, double pob[3], + double pco[3]); +int eraPmsafe(double ra1, double dec1, double pmr1, double pmd1, + double px1, double rv1, + double ep1a, double ep1b, double ep2a, double ep2b, + double *ra2, double *dec2, double *pmr2, double *pmd2, + double *px2, double *rv2); +void eraPvtob(double elong, double phi, double height, double xp, + double yp, double sp, double theta, double pv[2][3]); +void eraRefco(double phpa, double tc, double rh, double wl, + double *refa, double *refb); + +/* Astronomy/Ephemerides */ +int eraEpv00(double date1, double date2, + double pvh[2][3], double pvb[2][3]); +int eraPlan94(double date1, double date2, int np, double pv[2][3]); + +/* Astronomy/FundamentalArgs */ +double eraFad03(double t); +double eraFae03(double t); +double eraFaf03(double t); +double eraFaju03(double t); +double eraFal03(double t); +double eraFalp03(double t); +double eraFama03(double t); +double eraFame03(double t); +double eraFane03(double t); +double eraFaom03(double t); +double eraFapa03(double t); +double eraFasa03(double t); +double eraFaur03(double t); +double eraFave03(double t); + +/* Astronomy/PrecNutPolar */ +void eraBi00(double *dpsibi, double *depsbi, double *dra); +void eraBp00(double date1, double date2, + double rb[3][3], double rp[3][3], double rbp[3][3]); +void eraBp06(double date1, double date2, + double rb[3][3], double rp[3][3], double rbp[3][3]); +void eraBpn2xy(double rbpn[3][3], double *x, double *y); +void eraC2i00a(double date1, double date2, double rc2i[3][3]); +void eraC2i00b(double date1, double date2, double rc2i[3][3]); +void eraC2i06a(double date1, double date2, double rc2i[3][3]); +void eraC2ibpn(double date1, double date2, double rbpn[3][3], + double rc2i[3][3]); +void eraC2ixy(double date1, double date2, double x, double y, + double rc2i[3][3]); +void eraC2ixys(double x, double y, double s, double rc2i[3][3]); +void eraC2t00a(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]); +void eraC2t00b(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]); +void eraC2t06a(double tta, double ttb, double uta, double utb, + double xp, double yp, double rc2t[3][3]); +void eraC2tcio(double rc2i[3][3], double era, double rpom[3][3], + double rc2t[3][3]); +void eraC2teqx(double rbpn[3][3], double gst, double rpom[3][3], + double rc2t[3][3]); +void eraC2tpe(double tta, double ttb, double uta, double utb, + double dpsi, double deps, double xp, double yp, + double rc2t[3][3]); +void eraC2txy(double tta, double ttb, double uta, double utb, + double x, double y, double xp, double yp, + double rc2t[3][3]); +double eraEo06a(double date1, double date2); +double eraEors(double rnpb[3][3], double s); +void eraFw2m(double gamb, double phib, double psi, double eps, + double r[3][3]); +void eraFw2xy(double gamb, double phib, double psi, double eps, + double *x, double *y); +void eraLtp(double epj, double rp[3][3]); +void eraLtpb(double epj, double rpb[3][3]); +void eraLtpecl(double epj, double vec[3]); +void eraLtpequ(double epj, double veq[3]); +void eraNum00a(double date1, double date2, double rmatn[3][3]); +void eraNum00b(double date1, double date2, double rmatn[3][3]); +void eraNum06a(double date1, double date2, double rmatn[3][3]); +void eraNumat(double epsa, double dpsi, double deps, double rmatn[3][3]); +void eraNut00a(double date1, double date2, double *dpsi, double *deps); +void eraNut00b(double date1, double date2, double *dpsi, double *deps); +void eraNut06a(double date1, double date2, double *dpsi, double *deps); +void eraNut80(double date1, double date2, double *dpsi, double *deps); +void eraNutm80(double date1, double date2, double rmatn[3][3]); +double eraObl06(double date1, double date2); +double eraObl80(double date1, double date2); +void eraP06e(double date1, double date2, + double *eps0, double *psia, double *oma, double *bpa, + double *bqa, double *pia, double *bpia, + double *epsa, double *chia, double *za, double *zetaa, + double *thetaa, double *pa, + double *gam, double *phi, double *psi); +void eraPb06(double date1, double date2, + double *bzeta, double *bz, double *btheta); +void eraPfw06(double date1, double date2, + double *gamb, double *phib, double *psib, double *epsa); +void eraPmat00(double date1, double date2, double rbp[3][3]); +void eraPmat06(double date1, double date2, double rbp[3][3]); +void eraPmat76(double date1, double date2, double rmatp[3][3]); +void eraPn00(double date1, double date2, double dpsi, double deps, + double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]); +void eraPn00a(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]); +void eraPn00b(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]); +void eraPn06(double date1, double date2, double dpsi, double deps, + double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]); +void eraPn06a(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]); +void eraPnm00a(double date1, double date2, double rbpn[3][3]); +void eraPnm00b(double date1, double date2, double rbpn[3][3]); +void eraPnm06a(double date1, double date2, double rnpb[3][3]); +void eraPnm80(double date1, double date2, double rmatpn[3][3]); +void eraPom00(double xp, double yp, double sp, double rpom[3][3]); +void eraPr00(double date1, double date2, + double *dpsipr, double *depspr); +void eraPrec76(double date01, double date02, + double date11, double date12, + double *zeta, double *z, double *theta); +double eraS00(double date1, double date2, double x, double y); +double eraS00a(double date1, double date2); +double eraS00b(double date1, double date2); +double eraS06(double date1, double date2, double x, double y); +double eraS06a(double date1, double date2); +double eraSp00(double date1, double date2); +void eraXy06(double date1, double date2, double *x, double *y); +void eraXys00a(double date1, double date2, + double *x, double *y, double *s); +void eraXys00b(double date1, double date2, + double *x, double *y, double *s); +void eraXys06a(double date1, double date2, + double *x, double *y, double *s); + +/* Astronomy/RotationAndTime */ +double eraEe00(double date1, double date2, double epsa, double dpsi); +double eraEe00a(double date1, double date2); +double eraEe00b(double date1, double date2); +double eraEe06a(double date1, double date2); +double eraEect00(double date1, double date2); +double eraEqeq94(double date1, double date2); +double eraEra00(double dj1, double dj2); +double eraGmst00(double uta, double utb, double tta, double ttb); +double eraGmst06(double uta, double utb, double tta, double ttb); +double eraGmst82(double dj1, double dj2); +double eraGst00a(double uta, double utb, double tta, double ttb); +double eraGst00b(double uta, double utb); +double eraGst06(double uta, double utb, double tta, double ttb, + double rnpb[3][3]); +double eraGst06a(double uta, double utb, double tta, double ttb); +double eraGst94(double uta, double utb); + +/* Astronomy/SpaceMotion */ +int eraPvstar(double pv[2][3], double *ra, double *dec, + double *pmr, double *pmd, double *px, double *rv); +int eraStarpv(double ra, double dec, + double pmr, double pmd, double px, double rv, + double pv[2][3]); + +/* Astronomy/StarCatalogs */ +void eraFk52h(double r5, double d5, + double dr5, double dd5, double px5, double rv5, + double *rh, double *dh, + double *drh, double *ddh, double *pxh, double *rvh); +void eraFk5hip(double r5h[3][3], double s5h[3]); +void eraFk5hz(double r5, double d5, double date1, double date2, + double *rh, double *dh); +void eraH2fk5(double rh, double dh, + double drh, double ddh, double pxh, double rvh, + double *r5, double *d5, + double *dr5, double *dd5, double *px5, double *rv5); +void eraHfk5z(double rh, double dh, double date1, double date2, + double *r5, double *d5, double *dr5, double *dd5); +int eraStarpm(double ra1, double dec1, + double pmr1, double pmd1, double px1, double rv1, + double ep1a, double ep1b, double ep2a, double ep2b, + double *ra2, double *dec2, + double *pmr2, double *pmd2, double *px2, double *rv2); + +/* Astronomy/EclipticCoordinates */ +void eraEceq06(double date1, double date2, double dl, double db, + double *dr, double *dd); +void eraEcm06(double date1, double date2, double rm[3][3]); +void eraEqec06(double date1, double date2, double dr, double dd, + double *dl, double *db); +void eraLteceq(double epj, double dl, double db, double *dr, double *dd); +void eraLtecm(double epj, double rm[3][3]); +void eraLteqec(double epj, double dr, double dd, double *dl, double *db); + +/* Astronomy/GalacticCoordinates */ +void eraG2icrs(double dl, double db, double *dr, double *dd); +void eraIcrs2g(double dr, double dd, double *dl, double *db); + +/* Astronomy/GeodeticGeocentric */ +int eraEform(int n, double *a, double *f); +int eraGc2gd(int n, double xyz[3], + double *elong, double *phi, double *height); +int eraGc2gde(double a, double f, double xyz[3], + double *elong, double *phi, double *height); +int eraGd2gc(int n, double elong, double phi, double height, + double xyz[3]); +int eraGd2gce(double a, double f, + double elong, double phi, double height, double xyz[3]); + +/* Astronomy/Timescales */ +int eraD2dtf(const char *scale, int ndp, double d1, double d2, + int *iy, int *im, int *id, int ihmsf[4]); +int eraDat(int iy, int im, int id, double fd, double *deltat); +double eraDtdb(double date1, double date2, + double ut, double elong, double u, double v); +int eraDtf2d(const char *scale, int iy, int im, int id, + int ihr, int imn, double sec, double *d1, double *d2); +int eraTaitt(double tai1, double tai2, double *tt1, double *tt2); +int eraTaiut1(double tai1, double tai2, double dta, + double *ut11, double *ut12); +int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2); +int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2); +int eraTcgtt(double tcg1, double tcg2, double *tt1, double *tt2); +int eraTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2); +int eraTdbtt(double tdb1, double tdb2, double dtr, + double *tt1, double *tt2); +int eraTttai(double tt1, double tt2, double *tai1, double *tai2); +int eraTttcg(double tt1, double tt2, double *tcg1, double *tcg2); +int eraTttdb(double tt1, double tt2, double dtr, + double *tdb1, double *tdb2); +int eraTtut1(double tt1, double tt2, double dt, + double *ut11, double *ut12); +int eraUt1tai(double ut11, double ut12, double dta, + double *tai1, double *tai2); +int eraUt1tt(double ut11, double ut12, double dt, + double *tt1, double *tt2); +int eraUt1utc(double ut11, double ut12, double dut1, + double *utc1, double *utc2); +int eraUtctai(double utc1, double utc2, double *tai1, double *tai2); +int eraUtcut1(double utc1, double utc2, double dut1, + double *ut11, double *ut12); + +/* VectorMatrix/AngleOps */ +void eraA2af(int ndp, double angle, char *sign, int idmsf[4]); +void eraA2tf(int ndp, double angle, char *sign, int ihmsf[4]); +int eraAf2a(char s, int ideg, int iamin, double asec, double *rad); +double eraAnp(double a); +double eraAnpm(double a); +void eraD2tf(int ndp, double days, char *sign, int ihmsf[4]); +int eraTf2a(char s, int ihour, int imin, double sec, double *rad); +int eraTf2d(char s, int ihour, int imin, double sec, double *days); + +/* VectorMatrix/BuildRotations */ +void eraRx(double phi, double r[3][3]); +void eraRy(double theta, double r[3][3]); +void eraRz(double psi, double r[3][3]); + +/* VectorMatrix/CopyExtendExtract */ +void eraCp(double p[3], double c[3]); +void eraCpv(double pv[2][3], double c[2][3]); +void eraCr(double r[3][3], double c[3][3]); +void eraP2pv(double p[3], double pv[2][3]); +void eraPv2p(double pv[2][3], double p[3]); + +/* VectorMatrix/Initialization */ +void eraIr(double r[3][3]); +void eraZp(double p[3]); +void eraZpv(double pv[2][3]); +void eraZr(double r[3][3]); + +/* VectorMatrix/MatrixOps */ +void eraRxr(double a[3][3], double b[3][3], double atb[3][3]); +void eraTr(double r[3][3], double rt[3][3]); + +/* VectorMatrix/MatrixVectorProducts */ +void eraRxp(double r[3][3], double p[3], double rp[3]); +void eraRxpv(double r[3][3], double pv[2][3], double rpv[2][3]); +void eraTrxp(double r[3][3], double p[3], double trp[3]); +void eraTrxpv(double r[3][3], double pv[2][3], double trpv[2][3]); + +/* VectorMatrix/RotationVectors */ +void eraRm2v(double r[3][3], double w[3]); +void eraRv2m(double w[3], double r[3][3]); + +/* VectorMatrix/SeparationAndAngle */ +double eraPap(double a[3], double b[3]); +double eraPas(double al, double ap, double bl, double bp); +double eraSepp(double a[3], double b[3]); +double eraSeps(double al, double ap, double bl, double bp); + +/* VectorMatrix/SphericalCartesian */ +void eraC2s(double p[3], double *theta, double *phi); +void eraP2s(double p[3], double *theta, double *phi, double *r); +void eraPv2s(double pv[2][3], + double *theta, double *phi, double *r, + double *td, double *pd, double *rd); +void eraS2c(double theta, double phi, double c[3]); +void eraS2p(double theta, double phi, double r, double p[3]); +void eraS2pv(double theta, double phi, double r, + double td, double pd, double rd, + double pv[2][3]); + +/* VectorMatrix/VectorOps */ +double eraPdp(double a[3], double b[3]); +double eraPm(double p[3]); +void eraPmp(double a[3], double b[3], double amb[3]); +void eraPn(double p[3], double *r, double u[3]); +void eraPpp(double a[3], double b[3], double apb[3]); +void eraPpsp(double a[3], double s, double b[3], double apsb[3]); +void eraPvdpv(double a[2][3], double b[2][3], double adb[2]); +void eraPvm(double pv[2][3], double *r, double *s); +void eraPvmpv(double a[2][3], double b[2][3], double amb[2][3]); +void eraPvppv(double a[2][3], double b[2][3], double apb[2][3]); +void eraPvu(double dt, double pv[2][3], double upv[2][3]); +void eraPvup(double dt, double pv[2][3], double p[3]); +void eraPvxpv(double a[2][3], double b[2][3], double axb[2][3]); +void eraPxp(double a[3], double b[3], double axb[3]); +void eraS2xpv(double s1, double s2, double pv[2][3], double spv[2][3]); +void eraSxp(double s, double p[3], double sp[3]); +void eraSxpv(double s, double pv[2][3], double spv[2][3]); + +#ifdef __cplusplus +} +#endif + + +#include "erfaextra.h" + +#endif + + +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/erfaextra.h b/testbed/astropy__astropy/cextern/erfa/erfaextra.h new file mode 100644 index 0000000000000000000000000000000000000000..3b61fa4324b65cd6ec88d5c0b1f854369ad9f89b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/erfaextra.h @@ -0,0 +1,59 @@ +/* +** Copyright (C) 2016-2017, NumFOCUS Foundation. +** +** Licensed under a 3-clause BSD style license - see LICENSE +** +** This file is NOT derived from SOFA sources +*/ + + +#ifndef _ERFA_EXTRA_H +#define _ERFA_EXTRA_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** Returns the package version +** as defined in configure.ac +** in string format +*/ +const char* eraVersion(void); + +/* +** Returns the package major version +** as defined in configure.ac +** as integer +*/ +int eraVersionMajor(void); + +/* +** Returns the package minor version +** as defined in configure.ac +** as integer +*/ +int eraVersionMinor(void); + +/* +** Returns the package micro version +** as defined in configure.ac +** as integer +*/ +int eraVersionMicro(void); + +/* +** Returns the orresponding SOFA version +** as defined in configure.ac +** in string format +*/ +const char* eraSofaVersion(void); + + +#ifdef __cplusplus +} +#endif + +#endif /* _ERFA_EXTRA_H */ + diff --git a/testbed/astropy__astropy/cextern/erfa/erfam.h b/testbed/astropy__astropy/cextern/erfa/erfam.h new file mode 100644 index 0000000000000000000000000000000000000000..bad4ba2d34c1b403df940532b6b28be9756a3711 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/erfam.h @@ -0,0 +1,208 @@ +#ifndef ERFAMHDEF +#define ERFAMHDEF + +/* +** - - - - - - - - +** e r f a m . h +** - - - - - - - - +** +** Macros used by ERFA library. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ + +/* Star-independent astrometry parameters */ +typedef struct { + double pmt; /* PM time interval (SSB, Julian years) */ + double eb[3]; /* SSB to observer (vector, au) */ + double eh[3]; /* Sun to observer (unit vector) */ + double em; /* distance from Sun to observer (au) */ + double v[3]; /* barycentric observer velocity (vector, c) */ + double bm1; /* sqrt(1-|v|^2): reciprocal of Lorenz factor */ + double bpn[3][3]; /* bias-precession-nutation matrix */ + double along; /* longitude + s' + dERA(DUT) (radians) */ + double phi; /* geodetic latitude (radians) */ + double xpl; /* polar motion xp wrt local meridian (radians) */ + double ypl; /* polar motion yp wrt local meridian (radians) */ + double sphi; /* sine of geodetic latitude */ + double cphi; /* cosine of geodetic latitude */ + double diurab; /* magnitude of diurnal aberration vector */ + double eral; /* "local" Earth rotation angle (radians) */ + double refa; /* refraction constant A (radians) */ + double refb; /* refraction constant B (radians) */ +} eraASTROM; +/* (Vectors eb, eh, em and v are all with respect to BCRS axes.) */ + +/* Body parameters for light deflection */ +typedef struct { + double bm; /* mass of the body (solar masses) */ + double dl; /* deflection limiter (radians^2/2) */ + double pv[2][3]; /* barycentric PV of the body (au, au/day) */ +} eraLDBODY; + +/* Pi */ +#define ERFA_DPI (3.141592653589793238462643) + +/* 2Pi */ +#define ERFA_D2PI (6.283185307179586476925287) + +/* Radians to degrees */ +#define ERFA_DR2D (57.29577951308232087679815) + +/* Degrees to radians */ +#define ERFA_DD2R (1.745329251994329576923691e-2) + +/* Radians to arcseconds */ +#define ERFA_DR2AS (206264.8062470963551564734) + +/* Arcseconds to radians */ +#define ERFA_DAS2R (4.848136811095359935899141e-6) + +/* Seconds of time to radians */ +#define ERFA_DS2R (7.272205216643039903848712e-5) + +/* Arcseconds in a full circle */ +#define ERFA_TURNAS (1296000.0) + +/* Milliarcseconds to radians */ +#define ERFA_DMAS2R (ERFA_DAS2R / 1e3) + +/* Length of tropical year B1900 (days) */ +#define ERFA_DTY (365.242198781) + +/* Seconds per day. */ +#define ERFA_DAYSEC (86400.0) + +/* Days per Julian year */ +#define ERFA_DJY (365.25) + +/* Days per Julian century */ +#define ERFA_DJC (36525.0) + +/* Days per Julian millennium */ +#define ERFA_DJM (365250.0) + +/* Reference epoch (J2000.0), Julian Date */ +#define ERFA_DJ00 (2451545.0) + +/* Julian Date of Modified Julian Date zero */ +#define ERFA_DJM0 (2400000.5) + +/* Reference epoch (J2000.0), Modified Julian Date */ +#define ERFA_DJM00 (51544.5) + +/* 1977 Jan 1.0 as MJD */ +#define ERFA_DJM77 (43144.0) + +/* TT minus TAI (s) */ +#define ERFA_TTMTAI (32.184) + +/* Astronomical unit (m, IAU 2012) */ +#define ERFA_DAU (149597870.7e3) + +/* Speed of light (m/s) */ +#define ERFA_CMPS 299792458.0 + +/* Light time for 1 au (s) */ +#define ERFA_AULT (ERFA_DAU/ERFA_CMPS) + +/* Speed of light (au per day) */ +#define ERFA_DC (ERFA_DAYSEC/ERFA_AULT) + +/* L_G = 1 - d(TT)/d(TCG) */ +#define ERFA_ELG (6.969290134e-10) + +/* L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 */ +#define ERFA_ELB (1.550519768e-8) +#define ERFA_TDB0 (-6.55e-5) + +/* Schwarzschild radius of the Sun (au) */ +/* = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */ +#define ERFA_SRS 1.97412574336e-8 + +/* ERFA_DINT(A) - truncate to nearest whole number towards zero (double) */ +#define ERFA_DINT(A) ((A)<0.0?ceil(A):floor(A)) + +/* ERFA_DNINT(A) - round to nearest whole number (double) */ +#define ERFA_DNINT(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5)) + +/* ERFA_DSIGN(A,B) - magnitude of A with sign of B (double) */ +#define ERFA_DSIGN(A,B) ((B)<0.0?-fabs(A):fabs(A)) + +/* max(A,B) - larger (most +ve) of two numbers (generic) */ +#define ERFA_GMAX(A,B) (((A)>(B))?(A):(B)) + +/* min(A,B) - smaller (least +ve) of two numbers (generic) */ +#define ERFA_GMIN(A,B) (((A)<(B))?(A):(B)) + +/* Reference ellipsoids */ +#define ERFA_WGS84 1 +#define ERFA_GRS80 2 +#define ERFA_WGS72 3 + +#endif + + +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/erfaversion.c b/testbed/astropy__astropy/cextern/erfa/erfaversion.c new file mode 100644 index 0000000000000000000000000000000000000000..48cede511495dc9d87e9079827f72c5be528f20b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/erfaversion.c @@ -0,0 +1,53 @@ +/* +** Copyright (C) 2016-2017, NumFOCUS Foundation. +** +** Licensed under a 3-clause BSD style license - see LICENSE +** +** This file is NOT derived from SOFA sources +*/ + + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.4.0" + +/* Define to the major version of this package. */ +#define PACKAGE_VERSION_MAJOR 1 + +/* Define to the micro version of this package. */ +#define PACKAGE_VERSION_MICRO 0 + +/* Define to the minor version of this package. */ +#define PACKAGE_VERSION_MINOR 4 + +/* Define to the version of SOFA */ +#define SOFA_VERSION "20170420" + + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + + +const char* eraVersion(void) { + return PACKAGE_VERSION; +} + + +int eraVersionMajor(void) { + return PACKAGE_VERSION_MAJOR; +} + + +int eraVersionMinor(void) { + return PACKAGE_VERSION_MINOR; +} + + +int eraVersionMicro(void) { + return PACKAGE_VERSION_MICRO; +} + + +const char* eraSofaVersion(void) { + return SOFA_VERSION; +} diff --git a/testbed/astropy__astropy/cextern/erfa/fad03.c b/testbed/astropy__astropy/cextern/erfa/fad03.c new file mode 100644 index 0000000000000000000000000000000000000000..cba156026798accb549611bd1ba2b4481dd1e4c7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fad03.c @@ -0,0 +1,112 @@ +#include "erfa.h" + +double eraFad03(double t) +/* +** - - - - - - - - - +** e r a F a d 0 3 +** - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean elongation of the Moon from the Sun. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double D, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean elongation of the Moon from the Sun (IERS Conventions 2003). */ + a = fmod( 1072260.703692 + + t * ( 1602961601.2090 + + t * ( - 6.3706 + + t * ( 0.006593 + + t * ( - 0.00003169 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R; + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fae03.c b/testbed/astropy__astropy/cextern/erfa/fae03.c new file mode 100644 index 0000000000000000000000000000000000000000..b8c87dd81b022d29d036441655872818096ef8a5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fae03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFae03(double t) +/* +** - - - - - - - - - +** e r a F a e 0 3 +** - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Earth. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Earth, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Earth (IERS Conventions 2003). */ + a = fmod(1.753470314 + 628.3075849991 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/faf03.c b/testbed/astropy__astropy/cextern/erfa/faf03.c new file mode 100644 index 0000000000000000000000000000000000000000..76bd45fc80fae499b3951e935f675c3a9f90cc51 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/faf03.c @@ -0,0 +1,115 @@ +#include "erfa.h" + +double eraFaf03(double t) +/* +** - - - - - - - - - +** e r a F a f 0 3 +** - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of the Moon minus mean longitude of the ascending +** node. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double F, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of the Moon minus that of the ascending node */ +/* (IERS Conventions 2003). */ + a = fmod( 335779.526232 + + t * ( 1739527262.8478 + + t * ( - 12.7512 + + t * ( - 0.001037 + + t * ( 0.00000417 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R; + + return a; + + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/faju03.c b/testbed/astropy__astropy/cextern/erfa/faju03.c new file mode 100644 index 0000000000000000000000000000000000000000..786d974e6b5d3b4757ddcaae249fd6ebca2c94a3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/faju03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFaju03(double t) +/* +** - - - - - - - - - - +** e r a F a j u 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Jupiter. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Jupiter, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Jupiter (IERS Conventions 2003). */ + a = fmod(0.599546497 + 52.9690962641 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fal03.c b/testbed/astropy__astropy/cextern/erfa/fal03.c new file mode 100644 index 0000000000000000000000000000000000000000..61c76203d52f358a3965d87039bc44b467dbf186 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fal03.c @@ -0,0 +1,112 @@ +#include "erfa.h" + +double eraFal03(double t) +/* +** - - - - - - - - - +** e r a F a l 0 3 +** - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean anomaly of the Moon. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double l, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean anomaly of the Moon (IERS Conventions 2003). */ + a = fmod( 485868.249036 + + t * ( 1717915923.2178 + + t * ( 31.8792 + + t * ( 0.051635 + + t * ( - 0.00024470 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R; + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/falp03.c b/testbed/astropy__astropy/cextern/erfa/falp03.c new file mode 100644 index 0000000000000000000000000000000000000000..bfd40bd96be91127a4a079059f84da806da3e3f7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/falp03.c @@ -0,0 +1,112 @@ +#include "erfa.h" + +double eraFalp03(double t) +/* +** - - - - - - - - - - +** e r a F a l p 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean anomaly of the Sun. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double l', radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean anomaly of the Sun (IERS Conventions 2003). */ + a = fmod( 1287104.793048 + + t * ( 129596581.0481 + + t * ( - 0.5532 + + t * ( 0.000136 + + t * ( - 0.00001149 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R; + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fama03.c b/testbed/astropy__astropy/cextern/erfa/fama03.c new file mode 100644 index 0000000000000000000000000000000000000000..03bb7e583b4838620122d72f927219252ed4fd74 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fama03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFama03(double t) +/* +** - - - - - - - - - - +** e r a F a m a 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Mars. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Mars, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Mars (IERS Conventions 2003). */ + a = fmod(6.203480913 + 334.0612426700 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fame03.c b/testbed/astropy__astropy/cextern/erfa/fame03.c new file mode 100644 index 0000000000000000000000000000000000000000..8b69182011dbc5c72e58792645f9e06f081151f0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fame03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFame03(double t) +/* +** - - - - - - - - - - +** e r a F a m e 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Mercury. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Mercury, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Mercury (IERS Conventions 2003). */ + a = fmod(4.402608842 + 2608.7903141574 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fane03.c b/testbed/astropy__astropy/cextern/erfa/fane03.c new file mode 100644 index 0000000000000000000000000000000000000000..33a5f9178e917b026182c97a09cd299c5223baaa --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fane03.c @@ -0,0 +1,108 @@ +#include "erfa.h" + +double eraFane03(double t) +/* +** - - - - - - - - - - +** e r a F a n e 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Neptune. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Neptune, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is adapted from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Neptune (IERS Conventions 2003). */ + a = fmod(5.311886287 + 3.8133035638 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/faom03.c b/testbed/astropy__astropy/cextern/erfa/faom03.c new file mode 100644 index 0000000000000000000000000000000000000000..845bed1c7548f5b69530b42671bd69f499b63b90 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/faom03.c @@ -0,0 +1,113 @@ +#include "erfa.h" + +double eraFaom03(double t) +/* +** - - - - - - - - - - +** e r a F a o m 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of the Moon's ascending node. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double Omega, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of the Moon's ascending node */ +/* (IERS Conventions 2003). */ + a = fmod( 450160.398036 + + t * ( - 6962890.5431 + + t * ( 7.4722 + + t * ( 0.007702 + + t * ( - 0.00005939 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R; + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fapa03.c b/testbed/astropy__astropy/cextern/erfa/fapa03.c new file mode 100644 index 0000000000000000000000000000000000000000..3d4376c38118e93a2812eaa616023b50bccc75fa --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fapa03.c @@ -0,0 +1,112 @@ +#include "erfa.h" + +double eraFapa03(double t) +/* +** - - - - - - - - - - +** e r a F a p a 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** general accumulated precession in longitude. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double general precession in longitude, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003). It +** is taken from Kinoshita & Souchay (1990) and comes originally +** from Lieske et al. (1977). +** +** References: +** +** Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron. +** 48, 187 +** +** Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, +** Astron.Astrophys. 58, 1-16 +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* General accumulated precession in longitude. */ + a = (0.024381750 + 0.00000538691 * t) * t; + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fasa03.c b/testbed/astropy__astropy/cextern/erfa/fasa03.c new file mode 100644 index 0000000000000000000000000000000000000000..767561134b59e062dc4aea7005c2b465c2a4fe87 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fasa03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFasa03(double t) +/* +** - - - - - - - - - - +** e r a F a s a 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Saturn. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Saturn, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Saturn (IERS Conventions 2003). */ + a = fmod(0.874016757 + 21.3299104960 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/faur03.c b/testbed/astropy__astropy/cextern/erfa/faur03.c new file mode 100644 index 0000000000000000000000000000000000000000..1ad27c00a987dc69c0f6d4aed7cb985b2de67ad2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/faur03.c @@ -0,0 +1,108 @@ +#include "erfa.h" + +double eraFaur03(double t) +/* +** - - - - - - - - - - +** e r a F a u r 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Uranus. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Uranus, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** is adapted from Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Uranus (IERS Conventions 2003). */ + a = fmod(5.481293872 + 7.4781598567 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fave03.c b/testbed/astropy__astropy/cextern/erfa/fave03.c new file mode 100644 index 0000000000000000000000000000000000000000..591e42942f50f6da2cc24741e38b2ac91fc155c0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fave03.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +double eraFave03(double t) +/* +** - - - - - - - - - - +** e r a F a v e 0 3 +** - - - - - - - - - - +** +** Fundamental argument, IERS Conventions (2003): +** mean longitude of Venus. +** +** Given: +** t double TDB, Julian centuries since J2000.0 (Note 1) +** +** Returned (function value): +** double mean longitude of Venus, radians (Note 2) +** +** Notes: +** +** 1) Though t is strictly TDB, it is usually more convenient to use +** TT, which makes no significant difference. +** +** 2) The expression used is as adopted in IERS Conventions (2003) and +** comes from Souchay et al. (1999) after Simon et al. (1994). +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double a; + + +/* Mean longitude of Venus (IERS Conventions 2003). */ + a = fmod(3.176146697 + 1021.3285546211 * t, ERFA_D2PI); + + return a; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fk52h.c b/testbed/astropy__astropy/cextern/erfa/fk52h.c new file mode 100644 index 0000000000000000000000000000000000000000..d922171bdb6ab1fdd65168434a516aafe2036436 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fk52h.c @@ -0,0 +1,152 @@ +#include "erfa.h" + +void eraFk52h(double r5, double d5, + double dr5, double dd5, double px5, double rv5, + double *rh, double *dh, + double *drh, double *ddh, double *pxh, double *rvh) +/* +** - - - - - - - - - +** e r a F k 5 2 h +** - - - - - - - - - +** +** Transform FK5 (J2000.0) star data into the Hipparcos system. +** +** Given (all FK5, equinox J2000.0, epoch J2000.0): +** r5 double RA (radians) +** d5 double Dec (radians) +** dr5 double proper motion in RA (dRA/dt, rad/Jyear) +** dd5 double proper motion in Dec (dDec/dt, rad/Jyear) +** px5 double parallax (arcsec) +** rv5 double radial velocity (km/s, positive = receding) +** +** Returned (all Hipparcos, epoch J2000.0): +** rh double RA (radians) +** dh double Dec (radians) +** drh double proper motion in RA (dRA/dt, rad/Jyear) +** ddh double proper motion in Dec (dDec/dt, rad/Jyear) +** pxh double parallax (arcsec) +** rvh double radial velocity (km/s, positive = receding) +** +** Notes: +** +** 1) This function transforms FK5 star positions and proper motions +** into the system of the Hipparcos catalog. +** +** 2) The proper motions in RA are dRA/dt rather than +** cos(Dec)*dRA/dt, and are per year rather than per century. +** +** 3) The FK5 to Hipparcos transformation is modeled as a pure +** rotation and spin; zonal errors in the FK5 catalog are not +** taken into account. +** +** 4) See also eraH2fk5, eraFk5hz, eraHfk5z. +** +** Called: +** eraStarpv star catalog data to space motion pv-vector +** eraFk5hip FK5 to Hipparcos rotation and spin +** eraRxp product of r-matrix and p-vector +** eraPxp vector product of two p-vectors +** eraPpp p-vector plus p-vector +** eraPvstar space motion pv-vector to star catalog data +** +** Reference: +** +** F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double pv5[2][3], r5h[3][3], s5h[3], wxp[3], vv[3], pvh[2][3]; + + +/* FK5 barycentric position/velocity pv-vector (normalized). */ + eraStarpv(r5, d5, dr5, dd5, px5, rv5, pv5); + +/* FK5 to Hipparcos orientation matrix and spin vector. */ + eraFk5hip(r5h, s5h); + +/* Make spin units per day instead of per year. */ + for ( i = 0; i < 3; s5h[i++] /= 365.25 ); + +/* Orient the FK5 position into the Hipparcos system. */ + eraRxp(r5h, pv5[0], pvh[0]); + +/* Apply spin to the position giving an extra space motion component. */ + eraPxp(pv5[0], s5h, wxp); + +/* Add this component to the FK5 space motion. */ + eraPpp(wxp, pv5[1], vv); + +/* Orient the FK5 space motion into the Hipparcos system. */ + eraRxp(r5h, vv, pvh[1]); + +/* Hipparcos pv-vector to spherical. */ + eraPvstar(pvh, rh, dh, drh, ddh, pxh, rvh); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fk5hip.c b/testbed/astropy__astropy/cextern/erfa/fk5hip.c new file mode 100644 index 0000000000000000000000000000000000000000..237a00dfae2b2eec022fc56b22f81ff7826cb9df --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fk5hip.c @@ -0,0 +1,135 @@ +#include "erfa.h" + +void eraFk5hip(double r5h[3][3], double s5h[3]) +/* +** - - - - - - - - - - +** e r a F k 5 h i p +** - - - - - - - - - - +** +** FK5 to Hipparcos rotation and spin. +** +** Returned: +** r5h double[3][3] r-matrix: FK5 rotation wrt Hipparcos (Note 2) +** s5h double[3] r-vector: FK5 spin wrt Hipparcos (Note 3) +** +** Notes: +** +** 1) This function models the FK5 to Hipparcos transformation as a +** pure rotation and spin; zonal errors in the FK5 catalogue are +** not taken into account. +** +** 2) The r-matrix r5h operates in the sense: +** +** P_Hipparcos = r5h x P_FK5 +** +** where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is +** the equivalent Hipparcos p-vector. +** +** 3) The r-vector s5h represents the time derivative of the FK5 to +** Hipparcos rotation. The units are radians per year (Julian, +** TDB). +** +** Called: +** eraRv2m r-vector to r-matrix +** +** Reference: +** +** F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double v[3]; + +/* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */ + double epx, epy, epz; + double omx, omy, omz; + + + epx = -19.9e-3 * ERFA_DAS2R; + epy = -9.1e-3 * ERFA_DAS2R; + epz = 22.9e-3 * ERFA_DAS2R; + + omx = -0.30e-3 * ERFA_DAS2R; + omy = 0.60e-3 * ERFA_DAS2R; + omz = 0.70e-3 * ERFA_DAS2R; + +/* FK5 to Hipparcos orientation expressed as an r-vector. */ + v[0] = epx; + v[1] = epy; + v[2] = epz; + +/* Re-express as an r-matrix. */ + eraRv2m(v, r5h); + +/* Hipparcos wrt FK5 spin expressed as an r-vector. */ + s5h[0] = omx; + s5h[1] = omy; + s5h[2] = omz; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fk5hz.c b/testbed/astropy__astropy/cextern/erfa/fk5hz.c new file mode 100644 index 0000000000000000000000000000000000000000..10ed953e9f22f8e9ed77a8d7df08e164c53fe431 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fk5hz.c @@ -0,0 +1,169 @@ +#include "erfa.h" + +void eraFk5hz(double r5, double d5, double date1, double date2, + double *rh, double *dh) +/* +** - - - - - - - - - +** e r a F k 5 h z +** - - - - - - - - - +** +** Transform an FK5 (J2000.0) star position into the system of the +** Hipparcos catalogue, assuming zero Hipparcos proper motion. +** +** Given: +** r5 double FK5 RA (radians), equinox J2000.0, at date +** d5 double FK5 Dec (radians), equinox J2000.0, at date +** date1,date2 double TDB date (Notes 1,2) +** +** Returned: +** rh double Hipparcos RA (radians) +** dh double Hipparcos Dec (radians) +** +** Notes: +** +** 1) This function converts a star position from the FK5 system to +** the Hipparcos system, in such a way that the Hipparcos proper +** motion is zero. Because such a star has, in general, a non-zero +** proper motion in the FK5 system, the function requires the date +** at which the position in the FK5 system was determined. +** +** 2) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 3) The FK5 to Hipparcos transformation is modeled as a pure +** rotation and spin; zonal errors in the FK5 catalogue are not +** taken into account. +** +** 4) The position returned by this function is in the Hipparcos +** reference system but at date date1+date2. +** +** 5) See also eraFk52h, eraH2fk5, eraHfk5z. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraFk5hip FK5 to Hipparcos rotation and spin +** eraSxp multiply p-vector by scalar +** eraRv2m r-vector to r-matrix +** eraTrxp product of transpose of r-matrix and p-vector +** eraPxp vector product of two p-vectors +** eraC2s p-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Reference: +** +** F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, p5e[3], r5h[3][3], s5h[3], vst[3], rst[3][3], p5[3], + ph[3], w; + + +/* Interval from given date to fundamental epoch J2000.0 (JY). */ + t = - ((date1 - ERFA_DJ00) + date2) / ERFA_DJY; + +/* FK5 barycentric position vector. */ + eraS2c(r5, d5, p5e); + +/* FK5 to Hipparcos orientation matrix and spin vector. */ + eraFk5hip(r5h, s5h); + +/* Accumulated Hipparcos wrt FK5 spin over that interval. */ + eraSxp(t, s5h, vst); + +/* Express the accumulated spin as a rotation matrix. */ + eraRv2m(vst, rst); + +/* Derotate the vector's FK5 axes back to date. */ + eraTrxp(rst, p5e, p5); + +/* Rotate the vector into the Hipparcos system. */ + eraRxp(r5h, p5, ph); + +/* Hipparcos vector to spherical. */ + eraC2s(ph, &w, dh); + *rh = eraAnp(w); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fw2m.c b/testbed/astropy__astropy/cextern/erfa/fw2m.c new file mode 100644 index 0000000000000000000000000000000000000000..db6f8d57a8f37e8254bbf5ae369df0e41611c770 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fw2m.c @@ -0,0 +1,143 @@ +#include "erfa.h" + +void eraFw2m(double gamb, double phib, double psi, double eps, + double r[3][3]) +/* +** - - - - - - - - +** e r a F w 2 m +** - - - - - - - - +** +** Form rotation matrix given the Fukushima-Williams angles. +** +** Given: +** gamb double F-W angle gamma_bar (radians) +** phib double F-W angle phi_bar (radians) +** psi double F-W angle psi (radians) +** eps double F-W angle epsilon (radians) +** +** Returned: +** r double[3][3] rotation matrix +** +** Notes: +** +** 1) Naming the following points: +** +** e = J2000.0 ecliptic pole, +** p = GCRS pole, +** E = ecliptic pole of date, +** and P = CIP, +** +** the four Fukushima-Williams angles are as follows: +** +** gamb = gamma = epE +** phib = phi = pE +** psi = psi = pEP +** eps = epsilon = EP +** +** 2) The matrix representing the combined effects of frame bias, +** precession and nutation is: +** +** NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb) +** +** 3) Three different matrices can be constructed, depending on the +** supplied angles: +** +** o To obtain the nutation x precession x frame bias matrix, +** generate the four precession angles, generate the nutation +** components and add them to the psi_bar and epsilon_A angles, +** and call the present function. +** +** o To obtain the precession x frame bias matrix, generate the +** four precession angles and call the present function. +** +** o To obtain the frame bias matrix, generate the four precession +** angles for date J2000.0 and call the present function. +** +** The nutation-only and precession-only matrices can if necessary +** be obtained by combining these three appropriately. +** +** Called: +** eraIr initialize r-matrix to identity +** eraRz rotate around Z-axis +** eraRx rotate around X-axis +** +** Reference: +** +** Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Construct the matrix. */ + eraIr(r); + eraRz(gamb, r); + eraRx(phib, r); + eraRz(-psi, r); + eraRx(-eps, r); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/fw2xy.c b/testbed/astropy__astropy/cextern/erfa/fw2xy.c new file mode 100644 index 0000000000000000000000000000000000000000..d23cf1f62a17d45c7e168dfc9ab1a25c09c3a70d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/fw2xy.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +void eraFw2xy(double gamb, double phib, double psi, double eps, + double *x, double *y) +/* +** - - - - - - - - - +** e r a F w 2 x y +** - - - - - - - - - +** +** CIP X,Y given Fukushima-Williams bias-precession-nutation angles. +** +** Given: +** gamb double F-W angle gamma_bar (radians) +** phib double F-W angle phi_bar (radians) +** psi double F-W angle psi (radians) +** eps double F-W angle epsilon (radians) +** +** Returned: +** x,y double CIP unit vector X,Y +** +** Notes: +** +** 1) Naming the following points: +** +** e = J2000.0 ecliptic pole, +** p = GCRS pole +** E = ecliptic pole of date, +** and P = CIP, +** +** the four Fukushima-Williams angles are as follows: +** +** gamb = gamma = epE +** phib = phi = pE +** psi = psi = pEP +** eps = epsilon = EP +** +** 2) The matrix representing the combined effects of frame bias, +** precession and nutation is: +** +** NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb) +** +** The returned values x,y are elements [2][0] and [2][1] of the +** matrix. Near J2000.0, they are essentially angles in radians. +** +** Called: +** eraFw2m F-W angles to r-matrix +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** +** Reference: +** +** Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r[3][3]; + + +/* Form NxPxB matrix. */ + eraFw2m(gamb, phib, psi, eps, r); + +/* Extract CIP X,Y. */ + eraBpn2xy(r, x, y); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/g2icrs.c b/testbed/astropy__astropy/cextern/erfa/g2icrs.c new file mode 100644 index 0000000000000000000000000000000000000000..c7500e3b4b459f64514b7ca5ef248c048e385330 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/g2icrs.c @@ -0,0 +1,170 @@ +#include "erfa.h" + +void eraG2icrs ( double dl, double db, double *dr, double *dd ) +/* +** - - - - - - - - - - +** e r a G 2 i c r s +** - - - - - - - - - - +** +** Transformation from Galactic Coordinates to ICRS. +** +** Given: +** dl double galactic longitude (radians) +** db double galactic latitude (radians) +** +** Returned: +** dr double ICRS right ascension (radians) +** dd double ICRS declination (radians) +** +** Notes: +** +** 1) The IAU 1958 system of Galactic coordinates was defined with +** respect to the now obsolete reference system FK4 B1950.0. When +** interpreting the system in a modern context, several factors have +** to be taken into account: +** +** . The inclusion in FK4 positions of the E-terms of aberration. +** +** . The distortion of the FK4 proper motion system by differential +** Galactic rotation. +** +** . The use of the B1950.0 equinox rather than the now-standard +** J2000.0. +** +** . The frame bias between ICRS and the J2000.0 mean place system. +** +** The Hipparcos Catalogue (Perryman & ESA 1997) provides a rotation +** matrix that transforms directly between ICRS and Galactic +** coordinates with the above factors taken into account. The +** matrix is derived from three angles, namely the ICRS coordinates +** of the Galactic pole and the longitude of the ascending node of +** the galactic equator on the ICRS equator. They are given in +** degrees to five decimal places and for canonical purposes are +** regarded as exact. In the Hipparcos Catalogue the matrix +** elements are given to 10 decimal places (about 20 microarcsec). +** In the present ERFA function the matrix elements have been +** recomputed from the canonical three angles and are given to 30 +** decimal places. +** +** 2) The inverse transformation is performed by the function eraIcrs2g. +** +** Called: +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** eraS2c spherical coordinates to unit vector +** eraTrxp product of transpose of r-matrix and p-vector +** eraC2s p-vector to spherical +** +** Reference: +** Perryman M.A.C. & ESA, 1997, ESA SP-1200, The Hipparcos and Tycho +** catalogues. Astrometric and photometric star catalogues +** derived from the ESA Hipparcos Space Astrometry Mission. ESA +** Publications Division, Noordwijk, Netherlands. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double v1[3], v2[3]; + +/* +** L2,B2 system of galactic coordinates in the form presented in the +** Hipparcos Catalogue. In degrees: +** +** P = 192.85948 right ascension of the Galactic north pole in ICRS +** Q = 27.12825 declination of the Galactic north pole in ICRS +** R = 32.93192 longitude of the ascending node of the Galactic +** plane on the ICRS equator +** +** ICRS to galactic rotation matrix, obtained by computing +** R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown: +*/ + double r[3][3] = { { -0.054875560416215368492398900454, + -0.873437090234885048760383168409, + -0.483835015548713226831774175116 }, + { +0.494109427875583673525222371358, + -0.444829629960011178146614061616, + +0.746982244497218890527388004556 }, + { -0.867666149019004701181616534570, + -0.198076373431201528180486091412, + +0.455983776175066922272100478348 } }; + + +/* Spherical to Cartesian. */ + eraS2c(dl, db, v1); + +/* Galactic to ICRS. */ + eraTrxp(r, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, dr, dd); + +/* Express in conventional ranges. */ + *dr = eraAnp(*dr); + *dd = eraAnpm(*dd); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gc2gd.c b/testbed/astropy__astropy/cextern/erfa/gc2gd.c new file mode 100644 index 0000000000000000000000000000000000000000..7e792d2965b5623edf61d4b16ab0e1ad7da1dee7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gc2gd.c @@ -0,0 +1,143 @@ +#include "erfa.h" + +int eraGc2gd ( int n, double xyz[3], + double *elong, double *phi, double *height ) +/* +** - - - - - - - - - +** e r a G c 2 g d +** - - - - - - - - - +** +** Transform geocentric coordinates to geodetic using the specified +** reference ellipsoid. +** +** Given: +** n int ellipsoid identifier (Note 1) +** xyz double[3] geocentric vector (Note 2) +** +** Returned: +** elong double longitude (radians, east +ve, Note 3) +** phi double latitude (geodetic, radians, Note 3) +** height double height above ellipsoid (geodetic, Notes 2,3) +** +** Returned (function value): +** int status: 0 = OK +** -1 = illegal identifier (Note 3) +** -2 = internal error (Note 3) +** +** Notes: +** +** 1) The identifier n is a number that specifies the choice of +** reference ellipsoid. The following are supported: +** +** n ellipsoid +** +** 1 ERFA_WGS84 +** 2 ERFA_GRS80 +** 3 ERFA_WGS72 +** +** The n value has no significance outside the ERFA software. For +** convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. +** +** 2) The geocentric vector (xyz, given) and height (height, returned) +** are in meters. +** +** 3) An error status -1 means that the identifier n is illegal. An +** error status -2 is theoretically impossible. In all error cases, +** all three results are set to -1e9. +** +** 4) The inverse transformation is performed in the function eraGd2gc. +** +** Called: +** eraEform Earth reference ellipsoids +** eraGc2gde geocentric to geodetic transformation, general +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + double a, f; + + +/* Obtain reference ellipsoid parameters. */ + j = eraEform ( n, &a, &f ); + +/* If OK, transform x,y,z to longitude, geodetic latitude, height. */ + if ( j == 0 ) { + j = eraGc2gde ( a, f, xyz, elong, phi, height ); + if ( j < 0 ) j = -2; + } + +/* Deal with any errors. */ + if ( j < 0 ) { + *elong = -1e9; + *phi = -1e9; + *height = -1e9; + } + +/* Return the status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gc2gde.c b/testbed/astropy__astropy/cextern/erfa/gc2gde.c new file mode 100644 index 0000000000000000000000000000000000000000..2f6686b5c96ed05bcabcb274ffc95b6eb81eabb5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gc2gde.c @@ -0,0 +1,208 @@ +#include "erfa.h" + +int eraGc2gde ( double a, double f, double xyz[3], + double *elong, double *phi, double *height ) +/* +** - - - - - - - - - - +** e r a G c 2 g d e +** - - - - - - - - - - +** +** Transform geocentric coordinates to geodetic for a reference +** ellipsoid of specified form. +** +** Given: +** a double equatorial radius (Notes 2,4) +** f double flattening (Note 3) +** xyz double[3] geocentric vector (Note 4) +** +** Returned: +** elong double longitude (radians, east +ve) +** phi double latitude (geodetic, radians) +** height double height above ellipsoid (geodetic, Note 4) +** +** Returned (function value): +** int status: 0 = OK +** -1 = illegal f +** -2 = illegal a +** +** Notes: +** +** 1) This function is based on the GCONV2H Fortran subroutine by +** Toshio Fukushima (see reference). +** +** 2) The equatorial radius, a, can be in any units, but meters is +** the conventional choice. +** +** 3) The flattening, f, is (for the Earth) a value around 0.00335, +** i.e. around 1/298. +** +** 4) The equatorial radius, a, and the geocentric vector, xyz, +** must be given in the same units, and determine the units of +** the returned height, height. +** +** 5) If an error occurs (status < 0), elong, phi and height are +** unchanged. +** +** 6) The inverse transformation is performed in the function +** eraGd2gce. +** +** 7) The transformation for a standard ellipsoid (such as ERFA_WGS84) can +** more conveniently be performed by calling eraGc2gd, which uses a +** numerical code to identify the required A and F values. +** +** Reference: +** +** Fukushima, T., "Transformation from Cartesian to geodetic +** coordinates accelerated by Halley's method", J.Geodesy (2006) +** 79: 689-693 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc, + c0, c02, c03, s02, s03, a02, a0, a03, d0, f0, b0, s1, + cc, s12, cc2; + + +/* ------------- */ +/* Preliminaries */ +/* ------------- */ + +/* Validate ellipsoid parameters. */ + if ( f < 0.0 || f >= 1.0 ) return -1; + if ( a <= 0.0 ) return -2; + +/* Functions of ellipsoid parameters (with further validation of f). */ + aeps2 = a*a * 1e-32; + e2 = (2.0 - f) * f; + e4t = e2*e2 * 1.5; + ec2 = 1.0 - e2; + if ( ec2 <= 0.0 ) return -1; + ec = sqrt(ec2); + b = a * ec; + +/* Cartesian components. */ + x = xyz[0]; + y = xyz[1]; + z = xyz[2]; + +/* Distance from polar axis squared. */ + p2 = x*x + y*y; + +/* Longitude. */ + *elong = p2 > 0.0 ? atan2(y, x) : 0.0; + +/* Unsigned z-coordinate. */ + absz = fabs(z); + +/* Proceed unless polar case. */ + if ( p2 > aeps2 ) { + + /* Distance from polar axis. */ + p = sqrt(p2); + + /* Normalization. */ + s0 = absz / a; + pn = p / a; + zc = ec * s0; + + /* Prepare Newton correction factors. */ + c0 = ec * pn; + c02 = c0 * c0; + c03 = c02 * c0; + s02 = s0 * s0; + s03 = s02 * s0; + a02 = c02 + s02; + a0 = sqrt(a02); + a03 = a02 * a0; + d0 = zc*a03 + e2*s03; + f0 = pn*a03 - e2*c03; + + /* Prepare Halley correction factor. */ + b0 = e4t * s02 * c02 * pn * (a0 - ec); + s1 = d0*f0 - b0*s0; + cc = ec * (f0*f0 - b0*c0); + + /* Evaluate latitude and height. */ + *phi = atan(s1/cc); + s12 = s1 * s1; + cc2 = cc * cc; + *height = (p*cc + absz*s1 - a * sqrt(ec2*s12 + cc2)) / + sqrt(s12 + cc2); + } else { + + /* Exception: pole. */ + *phi = ERFA_DPI / 2.0; + *height = absz - b; + } + +/* Restore sign of latitude. */ + if ( z < 0 ) *phi = -*phi; + +/* OK status. */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gd2gc.c b/testbed/astropy__astropy/cextern/erfa/gd2gc.c new file mode 100644 index 0000000000000000000000000000000000000000..1000fa4b1a7a007b018621c984b7198e316b2a05 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gd2gc.c @@ -0,0 +1,142 @@ +#include "erfa.h" + +int eraGd2gc ( int n, double elong, double phi, double height, + double xyz[3] ) +/* +** - - - - - - - - - +** e r a G d 2 g c +** - - - - - - - - - +** +** Transform geodetic coordinates to geocentric using the specified +** reference ellipsoid. +** +** Given: +** n int ellipsoid identifier (Note 1) +** elong double longitude (radians, east +ve) +** phi double latitude (geodetic, radians, Note 3) +** height double height above ellipsoid (geodetic, Notes 2,3) +** +** Returned: +** xyz double[3] geocentric vector (Note 2) +** +** Returned (function value): +** int status: 0 = OK +** -1 = illegal identifier (Note 3) +** -2 = illegal case (Note 3) +** +** Notes: +** +** 1) The identifier n is a number that specifies the choice of +** reference ellipsoid. The following are supported: +** +** n ellipsoid +** +** 1 ERFA_WGS84 +** 2 ERFA_GRS80 +** 3 ERFA_WGS72 +** +** The n value has no significance outside the ERFA software. For +** convenience, symbols ERFA_WGS84 etc. are defined in erfam.h. +** +** 2) The height (height, given) and the geocentric vector (xyz, +** returned) are in meters. +** +** 3) No validation is performed on the arguments elong, phi and +** height. An error status -1 means that the identifier n is +** illegal. An error status -2 protects against cases that would +** lead to arithmetic exceptions. In all error cases, xyz is set +** to zeros. +** +** 4) The inverse transformation is performed in the function eraGc2gd. +** +** Called: +** eraEform Earth reference ellipsoids +** eraGd2gce geodetic to geocentric transformation, general +** eraZp zero p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j; + double a, f; + + +/* Obtain reference ellipsoid parameters. */ + j = eraEform ( n, &a, &f ); + +/* If OK, transform longitude, geodetic latitude, height to x,y,z. */ + if ( j == 0 ) { + j = eraGd2gce ( a, f, elong, phi, height, xyz ); + if ( j != 0 ) j = -2; + } + +/* Deal with any errors. */ + if ( j != 0 ) eraZp ( xyz ); + +/* Return the status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gd2gce.c b/testbed/astropy__astropy/cextern/erfa/gd2gce.c new file mode 100644 index 0000000000000000000000000000000000000000..2d6b906e399676338c3ee75e2c097285c873b86e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gd2gce.c @@ -0,0 +1,146 @@ +#include "erfa.h" + +int eraGd2gce ( double a, double f, double elong, double phi, + double height, double xyz[3] ) +/* +** - - - - - - - - - - +** e r a G d 2 g c e +** - - - - - - - - - - +** +** Transform geodetic coordinates to geocentric for a reference +** ellipsoid of specified form. +** +** Given: +** a double equatorial radius (Notes 1,4) +** f double flattening (Notes 2,4) +** elong double longitude (radians, east +ve) +** phi double latitude (geodetic, radians, Note 4) +** height double height above ellipsoid (geodetic, Notes 3,4) +** +** Returned: +** xyz double[3] geocentric vector (Note 3) +** +** Returned (function value): +** int status: 0 = OK +** -1 = illegal case (Note 4) +** Notes: +** +** 1) The equatorial radius, a, can be in any units, but meters is +** the conventional choice. +** +** 2) The flattening, f, is (for the Earth) a value around 0.00335, +** i.e. around 1/298. +** +** 3) The equatorial radius, a, and the height, height, must be +** given in the same units, and determine the units of the +** returned geocentric vector, xyz. +** +** 4) No validation is performed on individual arguments. The error +** status -1 protects against (unrealistic) cases that would lead +** to arithmetic exceptions. If an error occurs, xyz is unchanged. +** +** 5) The inverse transformation is performed in the function +** eraGc2gde. +** +** 6) The transformation for a standard ellipsoid (such as ERFA_WGS84) can +** more conveniently be performed by calling eraGd2gc, which uses a +** numerical code to identify the required a and f values. +** +** References: +** +** Green, R.M., Spherical Astronomy, Cambridge University Press, +** (1985) Section 4.5, p96. +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 4.22, p202. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double sp, cp, w, d, ac, as, r; + + +/* Functions of geodetic latitude. */ + sp = sin(phi); + cp = cos(phi); + w = 1.0 - f; + w = w * w; + d = cp*cp + w*sp*sp; + if ( d <= 0.0 ) return -1; + ac = a / sqrt(d); + as = w * ac; + +/* Geocentric vector. */ + r = (ac + height) * cp; + xyz[0] = r * cos(elong); + xyz[1] = r * sin(elong); + xyz[2] = (as + height) * sp; + +/* Success. */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gmst00.c b/testbed/astropy__astropy/cextern/erfa/gmst00.c new file mode 100644 index 0000000000000000000000000000000000000000..3522aa7d653b59d0279d2f88bf27bcad8e1e6fbf --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gmst00.c @@ -0,0 +1,154 @@ +#include "erfa.h" + +double eraGmst00(double uta, double utb, double tta, double ttb) +/* +** - - - - - - - - - - +** e r a G m s t 0 0 +** - - - - - - - - - - +** +** Greenwich mean sidereal time (model consistent with IAU 2000 +** resolutions). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** tta,ttb double TT as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich mean sidereal time (radians) +** +** Notes: +** +** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both +** Julian Dates, apportioned in any convenient way between the +** argument pairs. For example, JD=2450123.7 could be expressed in +** any of these ways, among others: +** +** Part A Part B +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable (in the case of UT; the TT is not at all critical +** in this respect). The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** Rotation Angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation +** and TT to predict the effects of precession. If UT1 is used for +** both purposes, errors of order 100 microarcseconds result. +** +** 3) This GMST is compatible with the IAU 2000 resolutions and must be +** used only in conjunction with other IAU 2000 compatible +** components such as precession-nutation and equation of the +** equinoxes. +** +** 4) The result is returned in the range 0 to 2pi. +** +** 5) The algorithm is from Capitaine et al. (2003) and IERS +** Conventions 2003. +** +** Called: +** eraEra00 Earth rotation angle, IAU 2000 +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, gmst; + + +/* TT Julian centuries since J2000.0. */ + t = ((tta - ERFA_DJ00) + ttb) / ERFA_DJC; + +/* Greenwich Mean Sidereal Time, IAU 2000. */ + gmst = eraAnp(eraEra00(uta, utb) + + ( 0.014506 + + ( 4612.15739966 + + ( 1.39667721 + + ( -0.00009344 + + ( 0.00001882 ) + * t) * t) * t) * t) * ERFA_DAS2R); + + return gmst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gmst06.c b/testbed/astropy__astropy/cextern/erfa/gmst06.c new file mode 100644 index 0000000000000000000000000000000000000000..de1d735b049d7b9a29305ea27d0f2984da7abc17 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gmst06.c @@ -0,0 +1,145 @@ +#include "erfa.h" + +double eraGmst06(double uta, double utb, double tta, double ttb) +/* +** - - - - - - - - - - +** e r a G m s t 0 6 +** - - - - - - - - - - +** +** Greenwich mean sidereal time (consistent with IAU 2006 precession). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** tta,ttb double TT as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich mean sidereal time (radians) +** +** Notes: +** +** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both +** Julian Dates, apportioned in any convenient way between the +** argument pairs. For example, JD=2450123.7 could be expressed in +** any of these ways, among others: +** +** Part A Part B +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable (in the case of UT; the TT is not at all critical +** in this respect). The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** rotation angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation +** and TT to predict the effects of precession. If UT1 is used for +** both purposes, errors of order 100 microarcseconds result. +** +** 3) This GMST is compatible with the IAU 2006 precession and must not +** be used with other precession models. +** +** 4) The result is returned in the range 0 to 2pi. +** +** Called: +** eraEra00 Earth rotation angle, IAU 2000 +** eraAnp normalize angle into range 0 to 2pi +** +** Reference: +** +** Capitaine, N., Wallace, P.T. & Chapront, J., 2005, +** Astron.Astrophys. 432, 355 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, gmst; + + +/* TT Julian centuries since J2000.0. */ + t = ((tta - ERFA_DJ00) + ttb) / ERFA_DJC; + +/* Greenwich mean sidereal time, IAU 2006. */ + gmst = eraAnp(eraEra00(uta, utb) + + ( 0.014506 + + ( 4612.156534 + + ( 1.3915817 + + ( -0.00000044 + + ( -0.000029956 + + ( -0.0000000368 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R); + + return gmst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gmst82.c b/testbed/astropy__astropy/cextern/erfa/gmst82.c new file mode 100644 index 0000000000000000000000000000000000000000..021d31528eb85a48118db899fcb7ef12168ff184 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gmst82.c @@ -0,0 +1,160 @@ +#include "erfa.h" + +double eraGmst82(double dj1, double dj2) +/* +** - - - - - - - - - - +** e r a G m s t 8 2 +** - - - - - - - - - - +** +** Universal Time to Greenwich mean sidereal time (IAU 1982 model). +** +** Given: +** dj1,dj2 double UT1 Julian Date (see note) +** +** Returned (function value): +** double Greenwich mean sidereal time (radians) +** +** Notes: +** +** 1) The UT1 date dj1+dj2 is a Julian Date, apportioned in any +** convenient way between the arguments dj1 and dj2. For example, +** JD(UT1)=2450123.7 could be expressed in any of these ways, +** among others: +** +** dj1 dj2 +** +** 2450123.7 0 (JD method) +** 2451545 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. The date & time method is +** best matched to the algorithm used: maximum accuracy (or, at +** least, minimum noise) is delivered when the dj1 argument is for +** 0hrs UT1 on the day in question and the dj2 argument lies in the +** range 0 to 1, or vice versa. +** +** 2) The algorithm is based on the IAU 1982 expression. This is +** always described as giving the GMST at 0 hours UT1. In fact, it +** gives the difference between the GMST and the UT, the steady +** 4-minutes-per-day drawing-ahead of ST with respect to UT. When +** whole days are ignored, the expression happens to equal the GMST +** at 0 hours UT1 each day. +** +** 3) In this function, the entire UT1 (the sum of the two arguments +** dj1 and dj2) is used directly as the argument for the standard +** formula, the constant term of which is adjusted by 12 hours to +** take account of the noon phasing of Julian Date. The UT1 is then +** added, but omitting whole days to conserve accuracy. +** +** Called: +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Transactions of the International Astronomical Union, +** XVIII B, 67 (1983). +** +** Aoki et al., Astron. Astrophys. 105, 359-361 (1982). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Coefficients of IAU 1982 GMST-UT1 model */ + double A = 24110.54841 - ERFA_DAYSEC / 2.0; + double B = 8640184.812866; + double C = 0.093104; + double D = -6.2e-6; + +/* Note: the first constant, A, has to be adjusted by 12 hours */ +/* because the UT1 is supplied as a Julian date, which begins */ +/* at noon. */ + + double d1, d2, t, f, gmst; + + +/* Julian centuries since fundamental epoch. */ + if (dj1 < dj2) { + d1 = dj1; + d2 = dj2; + } else { + d1 = dj2; + d2 = dj1; + } + t = (d1 + (d2 - ERFA_DJ00)) / ERFA_DJC; + +/* Fractional part of JD(UT1), in seconds. */ + f = ERFA_DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0)); + +/* GMST at this UT1. */ + gmst = eraAnp(ERFA_DS2R * ((A + (B + (C + D * t) * t) * t) + f)); + + return gmst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gst00a.c b/testbed/astropy__astropy/cextern/erfa/gst00a.c new file mode 100644 index 0000000000000000000000000000000000000000..98f5c02d0784623e6fed5c8e5a49b9502eb92bdf --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gst00a.c @@ -0,0 +1,147 @@ +#include "erfa.h" + +double eraGst00a(double uta, double utb, double tta, double ttb) +/* +** - - - - - - - - - - +** e r a G s t 0 0 a +** - - - - - - - - - - +** +** Greenwich apparent sidereal time (consistent with IAU 2000 +** resolutions). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** tta,ttb double TT as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich apparent sidereal time (radians) +** +** Notes: +** +** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both +** Julian Dates, apportioned in any convenient way between the +** argument pairs. For example, JD=2450123.7 could be expressed in +** any of these ways, among others: +** +** Part A Part B +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable (in the case of UT; the TT is not at all critical +** in this respect). The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** Rotation Angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation +** and TT to predict the effects of precession-nutation. If UT1 is +** used for both purposes, errors of order 100 microarcseconds +** result. +** +** 3) This GAST is compatible with the IAU 2000 resolutions and must be +** used only in conjunction with other IAU 2000 compatible +** components such as precession-nutation. +** +** 4) The result is returned in the range 0 to 2pi. +** +** 5) The algorithm is from Capitaine et al. (2003) and IERS +** Conventions 2003. +** +** Called: +** eraGmst00 Greenwich mean sidereal time, IAU 2000 +** eraEe00a equation of the equinoxes, IAU 2000A +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gmst00, ee00a, gst; + + + gmst00 = eraGmst00(uta, utb, tta, ttb); + ee00a = eraEe00a(tta, ttb); + gst = eraAnp(gmst00 + ee00a); + + return gst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gst00b.c b/testbed/astropy__astropy/cextern/erfa/gst00b.c new file mode 100644 index 0000000000000000000000000000000000000000..a320013ca262aa8eaa3d44e81842d27d0b50c575 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gst00b.c @@ -0,0 +1,155 @@ +#include "erfa.h" + +double eraGst00b(double uta, double utb) +/* +** - - - - - - - - - - +** e r a G s t 0 0 b +** - - - - - - - - - - +** +** Greenwich apparent sidereal time (consistent with IAU 2000 +** resolutions but using the truncated nutation model IAU 2000B). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich apparent sidereal time (radians) +** +** Notes: +** +** 1) The UT1 date uta+utb is a Julian Date, apportioned in any +** convenient way between the argument pair. For example, +** JD=2450123.7 could be expressed in any of these ways, among +** others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** Rotation Angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) The result is compatible with the IAU 2000 resolutions, except +** that accuracy has been compromised for the sake of speed and +** convenience in two respects: +** +** . UT is used instead of TDB (or TT) to compute the precession +** component of GMST and the equation of the equinoxes. This +** results in errors of order 0.1 mas at present. +** +** . The IAU 2000B abridged nutation model (McCarthy & Luzum, 2001) +** is used, introducing errors of up to 1 mas. +** +** 3) This GAST is compatible with the IAU 2000 resolutions and must be +** used only in conjunction with other IAU 2000 compatible +** components such as precession-nutation. +** +** 4) The result is returned in the range 0 to 2pi. +** +** 5) The algorithm is from Capitaine et al. (2003) and IERS +** Conventions 2003. +** +** Called: +** eraGmst00 Greenwich mean sidereal time, IAU 2000 +** eraEe00b equation of the equinoxes, IAU 2000B +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to +** implement the IAU 2000 definition of UT1", Astronomy & +** Astrophysics, 406, 1135-1149 (2003) +** +** McCarthy, D.D. & Luzum, B.J., "An abridged model of the +** precession-nutation of the celestial pole", Celestial Mechanics & +** Dynamical Astronomy, 85, 37-49 (2003) +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gmst00, ee00b, gst; + + + gmst00 = eraGmst00(uta, utb, uta, utb); + ee00b = eraEe00b(uta, utb); + gst = eraAnp(gmst00 + ee00b); + + return gst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gst06.c b/testbed/astropy__astropy/cextern/erfa/gst06.c new file mode 100644 index 0000000000000000000000000000000000000000..164d6bc24a9f152e8b7e197d46c2b9bbc4699608 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gst06.c @@ -0,0 +1,149 @@ +#include "erfa.h" + +double eraGst06(double uta, double utb, double tta, double ttb, + double rnpb[3][3]) +/* +** - - - - - - - - - +** e r a G s t 0 6 +** - - - - - - - - - +** +** Greenwich apparent sidereal time, IAU 2006, given the NPB matrix. +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** tta,ttb double TT as a 2-part Julian Date (Notes 1,2) +** rnpb double[3][3] nutation x precession x bias matrix +** +** Returned (function value): +** double Greenwich apparent sidereal time (radians) +** +** Notes: +** +** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both +** Julian Dates, apportioned in any convenient way between the +** argument pairs. For example, JD=2450123.7 could be expressed in +** any of these ways, among others: +** +** Part A Part B +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable (in the case of UT; the TT is not at all critical +** in this respect). The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** rotation angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation +** and TT to predict the effects of precession-nutation. If UT1 is +** used for both purposes, errors of order 100 microarcseconds +** result. +** +** 3) Although the function uses the IAU 2006 series for s+XY/2, it is +** otherwise independent of the precession-nutation model and can in +** practice be used with any equinox-based NPB matrix. +** +** 4) The result is returned in the range 0 to 2pi. +** +** Called: +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** eraAnp normalize angle into range 0 to 2pi +** eraEra00 Earth rotation angle, IAU 2000 +** eraEors equation of the origins, given NPB matrix and s +** +** Reference: +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y, s, era, eors, gst; + + +/* Extract CIP coordinates. */ + eraBpn2xy(rnpb, &x, &y); + +/* The CIO locator, s. */ + s = eraS06(tta, ttb, x, y); + +/* Greenwich apparent sidereal time. */ + era = eraEra00(uta, utb); + eors = eraEors(rnpb, s); + gst = eraAnp(era - eors); + + return gst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gst06a.c b/testbed/astropy__astropy/cextern/erfa/gst06a.c new file mode 100644 index 0000000000000000000000000000000000000000..01af4926d97d0babe5454edcb586567795a206e1 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gst06a.c @@ -0,0 +1,140 @@ +#include "erfa.h" + +double eraGst06a(double uta, double utb, double tta, double ttb) +/* +** - - - - - - - - - - +** e r a G s t 0 6 a +** - - - - - - - - - - +** +** Greenwich apparent sidereal time (consistent with IAU 2000 and 2006 +** resolutions). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** tta,ttb double TT as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich apparent sidereal time (radians) +** +** Notes: +** +** 1) The UT1 and TT dates uta+utb and tta+ttb respectively, are both +** Julian Dates, apportioned in any convenient way between the +** argument pairs. For example, JD=2450123.7 could be expressed in +** any of these ways, among others: +** +** Part A Part B +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable (in the case of UT; the TT is not at all critical +** in this respect). The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** rotation angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) Both UT1 and TT are required, UT1 to predict the Earth rotation +** and TT to predict the effects of precession-nutation. If UT1 is +** used for both purposes, errors of order 100 microarcseconds +** result. +** +** 3) This GAST is compatible with the IAU 2000/2006 resolutions and +** must be used only in conjunction with IAU 2006 precession and +** IAU 2000A nutation. +** +** 4) The result is returned in the range 0 to 2pi. +** +** Called: +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraGst06 Greenwich apparent ST, IAU 2006, given NPB matrix +** +** Reference: +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rnpb[3][3], gst; + + +/* Classical nutation x precession x bias matrix, IAU 2000A. */ + eraPnm06a(tta, ttb, rnpb); + +/* Greenwich apparent sidereal time. */ + gst = eraGst06(uta, utb, tta, ttb, rnpb); + + return gst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/gst94.c b/testbed/astropy__astropy/cextern/erfa/gst94.c new file mode 100644 index 0000000000000000000000000000000000000000..8e6c63ac44a0a9f73e1449f3e429c4e2bca29f9e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/gst94.c @@ -0,0 +1,140 @@ +#include "erfa.h" + +double eraGst94(double uta, double utb) +/* +** - - - - - - - - - +** e r a G s t 9 4 +** - - - - - - - - - +** +** Greenwich apparent sidereal time (consistent with IAU 1982/94 +** resolutions). +** +** Given: +** uta,utb double UT1 as a 2-part Julian Date (Notes 1,2) +** +** Returned (function value): +** double Greenwich apparent sidereal time (radians) +** +** Notes: +** +** 1) The UT1 date uta+utb is a Julian Date, apportioned in any +** convenient way between the argument pair. For example, +** JD=2450123.7 could be expressed in any of these ways, among +** others: +** +** uta utb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 and MJD methods are good compromises +** between resolution and convenience. For UT, the date & time +** method is best matched to the algorithm that is used by the Earth +** Rotation Angle function, called internally: maximum precision is +** delivered when the uta argument is for 0hrs UT1 on the day in +** question and the utb argument lies in the range 0 to 1, or vice +** versa. +** +** 2) The result is compatible with the IAU 1982 and 1994 resolutions, +** except that accuracy has been compromised for the sake of +** convenience in that UT is used instead of TDB (or TT) to compute +** the equation of the equinoxes. +** +** 3) This GAST must be used only in conjunction with contemporaneous +** IAU standards such as 1976 precession, 1980 obliquity and 1982 +** nutation. It is not compatible with the IAU 2000 resolutions. +** +** 4) The result is returned in the range 0 to 2pi. +** +** Called: +** eraGmst82 Greenwich mean sidereal time, IAU 1982 +** eraEqeq94 equation of the equinoxes, IAU 1994 +** eraAnp normalize angle into range 0 to 2pi +** +** References: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** IAU Resolution C7, Recommendation 3 (1994) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gmst82, eqeq94, gst; + + + gmst82 = eraGmst82(uta, utb); + eqeq94 = eraEqeq94(uta, utb); + gst = eraAnp(gmst82 + eqeq94); + + return gst; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/h2fk5.c b/testbed/astropy__astropy/cextern/erfa/h2fk5.c new file mode 100644 index 0000000000000000000000000000000000000000..e2690b6858628e29cac199e025a5bbe8792f0e40 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/h2fk5.c @@ -0,0 +1,157 @@ +#include "erfa.h" + +void eraH2fk5(double rh, double dh, + double drh, double ddh, double pxh, double rvh, + double *r5, double *d5, + double *dr5, double *dd5, double *px5, double *rv5) +/* +** - - - - - - - - - +** e r a H 2 f k 5 +** - - - - - - - - - +** +** Transform Hipparcos star data into the FK5 (J2000.0) system. +** +** Given (all Hipparcos, epoch J2000.0): +** rh double RA (radians) +** dh double Dec (radians) +** drh double proper motion in RA (dRA/dt, rad/Jyear) +** ddh double proper motion in Dec (dDec/dt, rad/Jyear) +** pxh double parallax (arcsec) +** rvh double radial velocity (km/s, positive = receding) +** +** Returned (all FK5, equinox J2000.0, epoch J2000.0): +** r5 double RA (radians) +** d5 double Dec (radians) +** dr5 double proper motion in RA (dRA/dt, rad/Jyear) +** dd5 double proper motion in Dec (dDec/dt, rad/Jyear) +** px5 double parallax (arcsec) +** rv5 double radial velocity (km/s, positive = receding) +** +** Notes: +** +** 1) This function transforms Hipparcos star positions and proper +** motions into FK5 J2000.0. +** +** 2) The proper motions in RA are dRA/dt rather than +** cos(Dec)*dRA/dt, and are per year rather than per century. +** +** 3) The FK5 to Hipparcos transformation is modeled as a pure +** rotation and spin; zonal errors in the FK5 catalog are not +** taken into account. +** +** 4) See also eraFk52h, eraFk5hz, eraHfk5z. +** +** Called: +** eraStarpv star catalog data to space motion pv-vector +** eraFk5hip FK5 to Hipparcos rotation and spin +** eraRv2m r-vector to r-matrix +** eraRxp product of r-matrix and p-vector +** eraTrxp product of transpose of r-matrix and p-vector +** eraPxp vector product of two p-vectors +** eraPmp p-vector minus p-vector +** eraPvstar space motion pv-vector to star catalog data +** +** Reference: +** +** F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double pvh[2][3], r5h[3][3], s5h[3], sh[3], wxp[3], vv[3], pv5[2][3]; + + +/* Hipparcos barycentric position/velocity pv-vector (normalized). */ + eraStarpv(rh, dh, drh, ddh, pxh, rvh, pvh); + +/* FK5 to Hipparcos orientation matrix and spin vector. */ + eraFk5hip(r5h, s5h); + +/* Make spin units per day instead of per year. */ + for ( i = 0; i < 3; s5h[i++] /= 365.25 ); + +/* Orient the spin into the Hipparcos system. */ + eraRxp(r5h, s5h, sh); + +/* De-orient the Hipparcos position into the FK5 system. */ + eraTrxp(r5h, pvh[0], pv5[0]); + +/* Apply spin to the position giving an extra space motion component. */ + eraPxp(pvh[0], sh, wxp); + +/* Subtract this component from the Hipparcos space motion. */ + eraPmp(pvh[1], wxp, vv); + +/* De-orient the Hipparcos space motion into the FK5 system. */ + eraTrxp(r5h, vv, pv5[1]); + +/* FK5 pv-vector to spherical. */ + eraPvstar(pv5, r5, d5, dr5, dd5, px5, rv5); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/hfk5z.c b/testbed/astropy__astropy/cextern/erfa/hfk5z.c new file mode 100644 index 0000000000000000000000000000000000000000..70c97623f1932ce267320af05f0f186f885b5217 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/hfk5z.c @@ -0,0 +1,184 @@ +#include "erfa.h" + +void eraHfk5z(double rh, double dh, double date1, double date2, + double *r5, double *d5, double *dr5, double *dd5) +/* +** - - - - - - - - - +** e r a H f k 5 z +** - - - - - - - - - +** +** Transform a Hipparcos star position into FK5 J2000.0, assuming +** zero Hipparcos proper motion. +** +** Given: +** rh double Hipparcos RA (radians) +** dh double Hipparcos Dec (radians) +** date1,date2 double TDB date (Note 1) +** +** Returned (all FK5, equinox J2000.0, date date1+date2): +** r5 double RA (radians) +** d5 double Dec (radians) +** dr5 double FK5 RA proper motion (rad/year, Note 4) +** dd5 double Dec proper motion (rad/year, Note 4) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** 3) The FK5 to Hipparcos transformation is modeled as a pure rotation +** and spin; zonal errors in the FK5 catalogue are not taken into +** account. +** +** 4) It was the intention that Hipparcos should be a close +** approximation to an inertial frame, so that distant objects have +** zero proper motion; such objects have (in general) non-zero +** proper motion in FK5, and this function returns those fictitious +** proper motions. +** +** 5) The position returned by this function is in the FK5 J2000.0 +** reference system but at date date1+date2. +** +** 6) See also eraFk52h, eraH2fk5, eraFk5zhz. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraFk5hip FK5 to Hipparcos rotation and spin +** eraRxp product of r-matrix and p-vector +** eraSxp multiply p-vector by scalar +** eraRxr product of two r-matrices +** eraTrxp product of transpose of r-matrix and p-vector +** eraPxp vector product of two p-vectors +** eraPv2s pv-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Reference: +** +** F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, ph[3], r5h[3][3], s5h[3], sh[3], vst[3], + rst[3][3], r5ht[3][3], pv5e[2][3], vv[3], + w, r, v; + + +/* Time interval from fundamental epoch J2000.0 to given date (JY). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJY; + +/* Hipparcos barycentric position vector (normalized). */ + eraS2c(rh, dh, ph); + +/* FK5 to Hipparcos orientation matrix and spin vector. */ + eraFk5hip(r5h, s5h); + +/* Rotate the spin into the Hipparcos system. */ + eraRxp(r5h, s5h, sh); + +/* Accumulated Hipparcos wrt FK5 spin over that interval. */ + eraSxp(t, s5h, vst); + +/* Express the accumulated spin as a rotation matrix. */ + eraRv2m(vst, rst); + +/* Rotation matrix: accumulated spin, then FK5 to Hipparcos. */ + eraRxr(r5h, rst, r5ht); + +/* De-orient & de-spin the Hipparcos position into FK5 J2000.0. */ + eraTrxp(r5ht, ph, pv5e[0]); + +/* Apply spin to the position giving a space motion. */ + eraPxp(sh, ph, vv); + +/* De-orient & de-spin the Hipparcos space motion into FK5 J2000.0. */ + eraTrxp(r5ht, vv, pv5e[1]); + +/* FK5 position/velocity pv-vector to spherical. */ + eraPv2s(pv5e, &w, d5, &r, dr5, dd5, &v); + *r5 = eraAnp(w); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/icrs2g.c b/testbed/astropy__astropy/cextern/erfa/icrs2g.c new file mode 100644 index 0000000000000000000000000000000000000000..b4027af9366334b2ccb2062d30d4154497f53c10 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/icrs2g.c @@ -0,0 +1,170 @@ +#include "erfa.h" + +void eraIcrs2g ( double dr, double dd, double *dl, double *db ) +/* +** - - - - - - - - - - +** e r a I c r s 2 g +** - - - - - - - - - - +** +** Transformation from ICRS to Galactic Coordinates. +** +** Given: +** dr double ICRS right ascension (radians) +** dd double ICRS declination (radians) +** +** Returned: +** dl double galactic longitude (radians) +** db double galactic latitude (radians) +** +** Notes: +** +** 1) The IAU 1958 system of Galactic coordinates was defined with +** respect to the now obsolete reference system FK4 B1950.0. When +** interpreting the system in a modern context, several factors have +** to be taken into account: +** +** . The inclusion in FK4 positions of the E-terms of aberration. +** +** . The distortion of the FK4 proper motion system by differential +** Galactic rotation. +** +** . The use of the B1950.0 equinox rather than the now-standard +** J2000.0. +** +** . The frame bias between ICRS and the J2000.0 mean place system. +** +** The Hipparcos Catalogue (Perryman & ESA 1997) provides a rotation +** matrix that transforms directly between ICRS and Galactic +** coordinates with the above factors taken into account. The +** matrix is derived from three angles, namely the ICRS coordinates +** of the Galactic pole and the longitude of the ascending node of +** the galactic equator on the ICRS equator. They are given in +** degrees to five decimal places and for canonical purposes are +** regarded as exact. In the Hipparcos Catalogue the matrix +** elements are given to 10 decimal places (about 20 microarcsec). +** In the present ERFA function the matrix elements have been +** recomputed from the canonical three angles and are given to 30 +** decimal places. +** +** 2) The inverse transformation is performed by the function eraG2icrs. +** +** Called: +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** eraS2c spherical coordinates to unit vector +** eraRxp product of r-matrix and p-vector +** eraC2s p-vector to spherical +** +** Reference: +** Perryman M.A.C. & ESA, 1997, ESA SP-1200, The Hipparcos and Tycho +** catalogues. Astrometric and photometric star catalogues +** derived from the ESA Hipparcos Space Astrometry Mission. ESA +** Publications Division, Noordwijk, Netherlands. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double v1[3], v2[3]; + +/* +** L2,B2 system of galactic coordinates in the form presented in the +** Hipparcos Catalogue. In degrees: +** +** P = 192.85948 right ascension of the Galactic north pole in ICRS +** Q = 27.12825 declination of the Galactic north pole in ICRS +** R = 32.93192 longitude of the ascending node of the Galactic +** plane on the ICRS equator +** +** ICRS to galactic rotation matrix, obtained by computing +** R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown: +*/ + double r[3][3] = { { -0.054875560416215368492398900454, + -0.873437090234885048760383168409, + -0.483835015548713226831774175116 }, + { +0.494109427875583673525222371358, + -0.444829629960011178146614061616, + +0.746982244497218890527388004556 }, + { -0.867666149019004701181616534570, + -0.198076373431201528180486091412, + +0.455983776175066922272100478348 } }; + + +/* Spherical to Cartesian. */ + eraS2c(dr, dd, v1); + +/* ICRS to Galactic. */ + eraRxp(r, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, dl, db); + +/* Express in conventional ranges. */ + *dl = eraAnp(*dl); + *db = eraAnpm(*db); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ir.c b/testbed/astropy__astropy/cextern/erfa/ir.c new file mode 100644 index 0000000000000000000000000000000000000000..57c715d70368b85a3eac1bb2ff22c57f9eaaadc6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ir.c @@ -0,0 +1,92 @@ +#include "erfa.h" + +void eraIr(double r[3][3]) +/* +** - - - - - - +** e r a I r +** - - - - - - +** +** Initialize an r-matrix to the identity matrix. +** +** Returned: +** r double[3][3] r-matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + r[0][0] = 1.0; + r[0][1] = 0.0; + r[0][2] = 0.0; + r[1][0] = 0.0; + r[1][1] = 1.0; + r[1][2] = 0.0; + r[2][0] = 0.0; + r[2][1] = 0.0; + r[2][2] = 1.0; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/jd2cal.c b/testbed/astropy__astropy/cextern/erfa/jd2cal.c new file mode 100644 index 0000000000000000000000000000000000000000..d264d40cc0d919d4d37721e0535e949e8104f6d5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/jd2cal.c @@ -0,0 +1,164 @@ +#include "erfa.h" + +int eraJd2cal(double dj1, double dj2, + int *iy, int *im, int *id, double *fd) +/* +** - - - - - - - - - - +** e r a J d 2 c a l +** - - - - - - - - - - +** +** Julian Date to Gregorian year, month, day, and fraction of a day. +** +** Given: +** dj1,dj2 double Julian Date (Notes 1, 2) +** +** Returned (arguments): +** iy int year +** im int month +** id int day +** fd double fraction of day +** +** Returned (function value): +** int status: +** 0 = OK +** -1 = unacceptable date (Note 1) +** +** Notes: +** +** 1) The earliest valid date is -68569.5 (-4900 March 1). The +** largest value accepted is 1e9. +** +** 2) The Julian Date is apportioned in any convenient way between +** the arguments dj1 and dj2. For example, JD=2450123.7 could +** be expressed in any of these ways, among others: +** +** dj1 dj2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** 3) In early eras the conversion is from the "proleptic Gregorian +** calendar"; no account is taken of the date(s) of adoption of +** the Gregorian calendar, nor is the AD/BC numbering convention +** observed. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 12.92 (p604). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Minimum and maximum allowed JD */ + const double DJMIN = -68569.5; + const double DJMAX = 1e9; + + long jd, l, n, i, k; + double dj, d1, d2, f1, f2, f, d; + + +/* Verify date is acceptable. */ + dj = dj1 + dj2; + if (dj < DJMIN || dj > DJMAX) return -1; + +/* Copy the date, big then small, and re-align to midnight. */ + if (dj1 >= dj2) { + d1 = dj1; + d2 = dj2; + } else { + d1 = dj2; + d2 = dj1; + } + d2 -= 0.5; + +/* Separate day and fraction. */ + f1 = fmod(d1, 1.0); + f2 = fmod(d2, 1.0); + f = fmod(f1 + f2, 1.0); + if (f < 0.0) f += 1.0; + d = ERFA_DNINT(d1-f1) + ERFA_DNINT(d2-f2) + ERFA_DNINT(f1+f2-f); + jd = (long) ERFA_DNINT(d) + 1L; + +/* Express day in Gregorian calendar. */ + l = jd + 68569L; + n = (4L * l) / 146097L; + l -= (146097L * n + 3L) / 4L; + i = (4000L * (l + 1L)) / 1461001L; + l -= (1461L * i) / 4L - 31L; + k = (80L * l) / 2447L; + *id = (int) (l - (2447L * k) / 80L); + l = k / 11L; + *im = (int) (k + 2L - 12L * l); + *iy = (int) (100L * (n - 49L) + i + l); + *fd = f; + + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/jdcalf.c b/testbed/astropy__astropy/cextern/erfa/jdcalf.c new file mode 100644 index 0000000000000000000000000000000000000000..15aa086b3ed5e2abc175c9e9f07cfc206eb0f601 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/jdcalf.c @@ -0,0 +1,170 @@ +#include "erfa.h" + +int eraJdcalf(int ndp, double dj1, double dj2, int iymdf[4]) +/* +** - - - - - - - - - - +** e r a J d c a l f +** - - - - - - - - - - +** +** Julian Date to Gregorian Calendar, expressed in a form convenient +** for formatting messages: rounded to a specified precision. +** +** Given: +** ndp int number of decimal places of days in fraction +** dj1,dj2 double dj1+dj2 = Julian Date (Note 1) +** +** Returned: +** iymdf int[4] year, month, day, fraction in Gregorian +** calendar +** +** Returned (function value): +** int status: +** -1 = date out of range +** 0 = OK +** +1 = NDP not 0-9 (interpreted as 0) +** +** Notes: +** +** 1) The Julian Date is apportioned in any convenient way between +** the arguments dj1 and dj2. For example, JD=2450123.7 could +** be expressed in any of these ways, among others: +** +** dj1 dj2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** 2) In early eras the conversion is from the "Proleptic Gregorian +** Calendar"; no account is taken of the date(s) of adoption of +** the Gregorian Calendar, nor is the AD/BC numbering convention +** observed. +** +** 3) Refer to the function eraJd2cal. +** +** 4) NDP should be 4 or less if internal overflows are to be +** avoided on machines which use 16-bit integers. +** +** Called: +** eraJd2cal JD to Gregorian calendar +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 12.92 (p604). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int j, js; + double denom, d1, d2, f1, f2, f; + + +/* Denominator of fraction (e.g. 100 for 2 decimal places). */ + if ((ndp >= 0) && (ndp <= 9)) { + j = 0; + denom = pow(10.0, ndp); + } else { + j = 1; + denom = 1.0; + } + +/* Copy the date, big then small, and realign to midnight. */ + if (dj1 >= dj2) { + d1 = dj1; + d2 = dj2; + } else { + d1 = dj2; + d2 = dj1; + } + d2 -= 0.5; + +/* Separate days and fractions. */ + f1 = fmod(d1, 1.0); + f2 = fmod(d2, 1.0); + d1 = ERFA_DNINT(d1-f1); + d2 = ERFA_DNINT(d2-f2); + +/* Round the total fraction to the specified number of places. */ + f = ERFA_DNINT((f1+f2)*denom) / denom; + +/* Re-assemble the rounded date and re-align to noon. */ + d2 += f + 0.5; + +/* Convert to Gregorian calendar. */ + js = eraJd2cal(d1, d2, &iymdf[0], &iymdf[1], &iymdf[2], &f); + if (js == 0) { + iymdf[3] = (int) (f * denom); + } else { + j = js; + } + +/* Return the status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ld.c b/testbed/astropy__astropy/cextern/erfa/ld.c new file mode 100644 index 0000000000000000000000000000000000000000..c96d930d93028475c88f3d01d760aa46d24e83c4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ld.c @@ -0,0 +1,161 @@ +#include "erfa.h" + +void eraLd(double bm, double p[3], double q[3], double e[3], + double em, double dlim, double p1[3]) +/* +** - - - - - - +** e r a L d +** - - - - - - +** +** Apply light deflection by a solar-system body, as part of +** transforming coordinate direction into natural direction. +** +** Given: +** bm double mass of the gravitating body (solar masses) +** p double[3] direction from observer to source (unit vector) +** q double[3] direction from body to source (unit vector) +** e double[3] direction from body to observer (unit vector) +** em double distance from body to observer (au) +** dlim double deflection limiter (Note 4) +** +** Returned: +** p1 double[3] observer to deflected source (unit vector) +** +** Notes: +** +** 1) The algorithm is based on Expr. (70) in Klioner (2003) and +** Expr. (7.63) in the Explanatory Supplement (Urban & Seidelmann +** 2013), with some rearrangement to minimize the effects of machine +** precision. +** +** 2) The mass parameter bm can, as required, be adjusted in order to +** allow for such effects as quadrupole field. +** +** 3) The barycentric position of the deflecting body should ideally +** correspond to the time of closest approach of the light ray to +** the body. +** +** 4) The deflection limiter parameter dlim is phi^2/2, where phi is +** the angular separation (in radians) between source and body at +** which limiting is applied. As phi shrinks below the chosen +** threshold, the deflection is artificially reduced, reaching zero +** for phi = 0. +** +** 5) The returned vector p1 is not normalized, but the consequential +** departure from unit magnitude is always negligible. +** +** 6) The arguments p and p1 can be the same array. +** +** 7) To accumulate total light deflection taking into account the +** contributions from several bodies, call the present function for +** each body in succession, in decreasing order of distance from the +** observer. +** +** 8) For efficiency, validation is omitted. The supplied vectors must +** be of unit magnitude, and the deflection limiter non-zero and +** positive. +** +** References: +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013). +** +** Klioner, Sergei A., "A practical relativistic model for micro- +** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003). +** +** Called: +** eraPdp scalar product of two p-vectors +** eraPxp vector product of two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double qpe[3], qdqpe, w, eq[3], peq[3]; + + +/* q . (q + e). */ + for (i = 0; i < 3; i++) { + qpe[i] = q[i] + e[i]; + } + qdqpe = eraPdp(q, qpe); + +/* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */ + w = bm * ERFA_SRS / em / ERFA_GMAX(qdqpe,dlim); + +/* p x (e x q). */ + eraPxp(e, q, eq); + eraPxp(p, eq, peq); + +/* Apply the deflection. */ + for (i = 0; i < 3; i++) { + p1[i] = p[i] + w*peq[i]; + } + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ldn.c b/testbed/astropy__astropy/cextern/erfa/ldn.c new file mode 100644 index 0000000000000000000000000000000000000000..da1d9091ebbb7618967c03c513fbf1deccec2481 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ldn.c @@ -0,0 +1,183 @@ +#include "erfa.h" + +void eraLdn(int n, eraLDBODY b[], double ob[3], double sc[3], + double sn[3]) +/*+ +** - - - - - - - +** e r a L d n +** - - - - - - - +** +** For a star, apply light deflection by multiple solar-system bodies, +** as part of transforming coordinate direction into natural direction. +** +** Given: +** n int number of bodies (note 1) +** b eraLDBODY[n] data for each of the n bodies (Notes 1,2): +** bm double mass of the body (solar masses, Note 3) +** dl double deflection limiter (Note 4) +** pv [2][3] barycentric PV of the body (au, au/day) +** ob double[3] barycentric position of the observer (au) +** sc double[3] observer to star coord direction (unit vector) +** +** Returned: +** sn double[3] observer to deflected star (unit vector) +** +** 1) The array b contains n entries, one for each body to be +** considered. If n = 0, no gravitational light deflection will be +** applied, not even for the Sun. +** +** 2) The array b should include an entry for the Sun as well as for +** any planet or other body to be taken into account. The entries +** should be in the order in which the light passes the body. +** +** 3) In the entry in the b array for body i, the mass parameter +** b[i].bm can, as required, be adjusted in order to allow for such +** effects as quadrupole field. +** +** 4) The deflection limiter parameter b[i].dl is phi^2/2, where phi is +** the angular separation (in radians) between star and body at +** which limiting is applied. As phi shrinks below the chosen +** threshold, the deflection is artificially reduced, reaching zero +** for phi = 0. Example values suitable for a terrestrial +** observer, together with masses, are as follows: +** +** body i b[i].bm b[i].dl +** +** Sun 1.0 6e-6 +** Jupiter 0.00095435 3e-9 +** Saturn 0.00028574 3e-10 +** +** 5) For cases where the starlight passes the body before reaching the +** observer, the body is placed back along its barycentric track by +** the light time from that point to the observer. For cases where +** the body is "behind" the observer no such shift is applied. If +** a different treatment is preferred, the user has the option of +** instead using the eraLd function. Similarly, eraLd can be used +** for cases where the source is nearby, not a star. +** +** 6) The returned vector sn is not normalized, but the consequential +** departure from unit magnitude is always negligible. +** +** 7) The arguments sc and sn can be the same array. +** +** 8) For efficiency, validation is omitted. The supplied masses must +** be greater than zero, the position and velocity vectors must be +** right, and the deflection limiter greater than zero. +** +** Reference: +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013), Section 7.2.4. +** +** Called: +** eraCp copy p-vector +** eraPdp scalar product of two p-vectors +** eraPmp p-vector minus p-vector +** eraPpsp p-vector plus scaled p-vector +** eraPn decompose p-vector into modulus and direction +** eraLd light deflection by a solar-system body +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Light time for 1 au (days) */ + const double CR = ERFA_AULT/ERFA_DAYSEC; + + int i; + double v[3], dt, ev[3], em, e[3]; + + +/* Star direction prior to deflection. */ + eraCp(sc, sn); + +/* Body by body. */ + for ( i = 0; i < n; i++ ) { + + /* Body to observer vector at epoch of observation (au). */ + eraPmp ( ob, b[i].pv[0], v ); + + /* Minus the time since the light passed the body (days). */ + dt = eraPdp(sn,v) * CR; + + /* Neutralize if the star is "behind" the observer. */ + dt = ERFA_GMIN(dt, 0.0); + + /* Backtrack the body to the time the light was passing the body. */ + eraPpsp(v, -dt, b[i].pv[1], ev); + + /* Body to observer vector as magnitude and direction. */ + eraPn(ev, &em, e); + + /* Apply light deflection for this body. */ + eraLd ( b[i].bm, sn, sn, e, em, b[i].dl, sn ); + + /* Next body. */ + } + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ldsun.c b/testbed/astropy__astropy/cextern/erfa/ldsun.c new file mode 100644 index 0000000000000000000000000000000000000000..1e41a8ed0787479383f30f94e6cc8f54e9471396 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ldsun.c @@ -0,0 +1,115 @@ +#include "erfa.h" + +void eraLdsun(double p[3], double e[3], double em, double p1[3]) +/* +** - - - - - - - - - +** e r a L d s u n +** - - - - - - - - - +** +** Deflection of starlight by the Sun. +** +** Given: +** p double[3] direction from observer to star (unit vector) +** e double[3] direction from Sun to observer (unit vector) +** em double distance from Sun to observer (au) +** +** Returned: +** p1 double[3] observer to deflected star (unit vector) +** +** Notes: +** +** 1) The source is presumed to be sufficiently distant that its +** directions seen from the Sun and the observer are essentially +** the same. +** +** 2) The deflection is restrained when the angle between the star and +** the center of the Sun is less than a threshold value, falling to +** zero deflection for zero separation. The chosen threshold value +** is within the solar limb for all solar-system applications, and +** is about 5 arcminutes for the case of a terrestrial observer. +** +** 3) The arguments p and p1 can be the same array. +** +** Called: +** eraLd light deflection by a solar-system body +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double em2, dlim; + + +/* Deflection limiter (smaller for distant observers). */ + em2 = em*em; + if ( em2 < 1.0 ) em2 = 1.0; + dlim = 1e-6 / (em2 > 1.0 ? em2 : 1.0); + +/* Apply the deflection. */ + eraLd(1.0, p, p, e, em, dlim, p1); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/lteceq.c b/testbed/astropy__astropy/cextern/erfa/lteceq.c new file mode 100644 index 0000000000000000000000000000000000000000..53622706c889da7ec391cf0e41d3fe80c081115e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/lteceq.c @@ -0,0 +1,138 @@ +#include "erfa.h" + +void eraLteceq(double epj, double dl, double db, double *dr, double *dd) +/* +** - - - - - - - - - - +** e r a L t e c e q +** - - - - - - - - - - +** +** Transformation from ecliptic coordinates (mean equinox and ecliptic +** of date) to ICRS RA,Dec, using a long-term precession model. +** +** Given: +** epj double Julian epoch (TT) +** dl,db double ecliptic longitude and latitude (radians) +** +** Returned: +** dr,dd double ICRS right ascension and declination (radians) +** +** 1) No assumptions are made about whether the coordinates represent +** starlight and embody astrometric effects such as parallax or +** aberration. +** +** 2) The transformation is approximately that from ecliptic longitude +** and latitude (mean equinox and ecliptic of date) to mean J2000.0 +** right ascension and declination, with only frame bias (always +** less than 25 mas) to disturb this classical picture. +** +** 3) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraLtecm J2000.0 to ecliptic rotation matrix, long term +** eraTrxp product of transpose of r-matrix and p-vector +** eraC2s unit vector to spherical coordinates +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rm[3][3], v1[3], v2[3], a, b; + + +/* Spherical to Cartesian. */ + eraS2c(dl, db, v1); + +/* Rotation matrix, ICRS equatorial to ecliptic. */ + eraLtecm(epj, rm); + +/* The transformation from ecliptic to ICRS. */ + eraTrxp(rm, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, &a, &b); + +/* Express in conventional ranges. */ + *dr = eraAnp(a); + *dd = eraAnpm(b); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ltecm.c b/testbed/astropy__astropy/cextern/erfa/ltecm.c new file mode 100644 index 0000000000000000000000000000000000000000..664c879633556ec7caed9bcde88909a6cff0eccf --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ltecm.c @@ -0,0 +1,157 @@ +#include "erfa.h" + +void eraLtecm(double epj, double rm[3][3]) +/* +** - - - - - - - - - +** e r a L t e c m +** - - - - - - - - - +** +** ICRS equatorial to ecliptic rotation matrix, long-term. +** +** Given: +** epj double Julian epoch (TT) +** +** Returned: +** rm double[3][3] ICRS to ecliptic rotation matrix +** +** Notes: +** +** 1) The matrix is in the sense +** +** E_ep = rm x P_ICRS, +** +** where P_ICRS is a vector with respect to ICRS right ascension +** and declination axes and E_ep is the same vector with respect to +** the (inertial) ecliptic and equinox of epoch epj. +** +** 2) P_ICRS is a free vector, merely a direction, typically of unit +** magnitude, and not bound to any particular spatial origin, such +** as the Earth, Sun or SSB. No assumptions are made about whether +** it represents starlight and embodies astrometric effects such as +** parallax or aberration. The transformation is approximately that +** between mean J2000.0 right ascension and declination and ecliptic +** longitude and latitude, with only frame bias (always less than +** 25 mas) to disturb this classical picture. +** +** 3) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** Called: +** eraLtpequ equator pole, long term +** eraLtpecl ecliptic pole, long term +** eraPxp vector product +** eraPn normalize vector +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */ + const double dx = -0.016617 * ERFA_DAS2R, + de = -0.0068192 * ERFA_DAS2R, + dr = -0.0146 * ERFA_DAS2R; + + double p[3], z[3], w[3], s, x[3], y[3]; + + +/* Equator pole. */ + eraLtpequ(epj, p); + +/* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */ + eraLtpecl(epj, z); + +/* Equinox (top row of matrix). */ + eraPxp(p, z, w); + eraPn(w, &s, x); + +/* Middle row of matrix. */ + eraPxp(z, x, y); + +/* Combine with frame bias. */ + rm[0][0] = x[0] - x[1]*dr + x[2]*dx; + rm[0][1] = x[0]*dr + x[1] + x[2]*de; + rm[0][2] = - x[0]*dx - x[1]*de + x[2]; + rm[1][0] = y[0] - y[1]*dr + y[2]*dx; + rm[1][1] = y[0]*dr + y[1] + y[2]*de; + rm[1][2] = - y[0]*dx - y[1]*de + y[2]; + rm[2][0] = z[0] - z[1]*dr + z[2]*dx; + rm[2][1] = z[0]*dr + z[1] + z[2]*de; + rm[2][2] = - z[0]*dx - z[1]*de + z[2]; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/lteqec.c b/testbed/astropy__astropy/cextern/erfa/lteqec.c new file mode 100644 index 0000000000000000000000000000000000000000..c331e76ebf70b0c56f7f34a75a730412336c5655 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/lteqec.c @@ -0,0 +1,139 @@ +#include "erfa.h" + +void eraLteqec(double epj, double dr, double dd, double *dl, double *db) +/* +** - - - - - - - - - - +** e r a L t e q e c +** - - - - - - - - - - +** +** Transformation from ICRS equatorial coordinates to ecliptic +** coordinates (mean equinox and ecliptic of date) using a long-term +** precession model. +** +** Given: +** epj double Julian epoch (TT) +** dr,dd double ICRS right ascension and declination (radians) +** +** Returned: +** dl,db double ecliptic longitude and latitude (radians) +** +** 1) No assumptions are made about whether the coordinates represent +** starlight and embody astrometric effects such as parallax or +** aberration. +** +** 2) The transformation is approximately that from mean J2000.0 right +** ascension and declination to ecliptic longitude and latitude +** (mean equinox and ecliptic of date), with only frame bias (always +** less than 25 mas) to disturb this classical picture. +** +** 3) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraLtecm J2000.0 to ecliptic rotation matrix, long term +** eraRxp product of r-matrix and p-vector +** eraC2s unit vector to spherical coordinates +** eraAnp normalize angle into range 0 to 2pi +** eraAnpm normalize angle into range +/- pi +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rm[3][3], v1[3], v2[3], a, b; + + +/* Spherical to Cartesian. */ + eraS2c(dr, dd, v1); + +/* Rotation matrix, ICRS equatorial to ecliptic. */ + eraLtecm(epj, rm); + +/* The transformation from ICRS to ecliptic. */ + eraRxp(rm, v1, v2); + +/* Cartesian to spherical. */ + eraC2s(v2, &a, &b); + +/* Express in conventional ranges. */ + *dl = eraAnp(a); + *db = eraAnpm(b); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ltp.c b/testbed/astropy__astropy/cextern/erfa/ltp.c new file mode 100644 index 0000000000000000000000000000000000000000..a2a32b6b9ff21d2d6bc638ef025a61621be61708 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ltp.c @@ -0,0 +1,140 @@ +#include "erfa.h" + +void eraLtp(double epj, double rp[3][3]) +/* +** - - - - - - - +** e r a L t p +** - - - - - - - +** +** Long-term precession matrix. +** +** Given: +** epj double Julian epoch (TT) +** +** Returned: +** rp double[3][3] precession matrix, J2000.0 to date +** +** Notes: +** +** 1) The matrix is in the sense +** +** P_date = rp x P_J2000, +** +** where P_J2000 is a vector with respect to the J2000.0 mean +** equator and equinox and P_date is the same vector with respect to +** the equator and equinox of epoch epj. +** +** 2) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** Called: +** eraLtpequ equator pole, long term +** eraLtpecl ecliptic pole, long term +** eraPxp vector product +** eraPn normalize vector +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double peqr[3], pecl[3], v[3], w, eqx[3]; + + +/* Equator pole (bottom row of matrix). */ + eraLtpequ(epj, peqr); + +/* Ecliptic pole. */ + eraLtpecl(epj, pecl); + +/* Equinox (top row of matrix). */ + eraPxp(peqr, pecl, v); + eraPn(v, &w, eqx); + +/* Middle row of matrix. */ + eraPxp(peqr, eqx, v); + +/* Assemble the matrix. */ + for ( i = 0; i < 3; i++ ) { + rp[0][i] = eqx[i]; + rp[1][i] = v[i]; + rp[2][i] = peqr[i]; + } + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ltpb.c b/testbed/astropy__astropy/cextern/erfa/ltpb.c new file mode 100644 index 0000000000000000000000000000000000000000..d86e72900dcd131534bb1251ab550d0d213e64c6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ltpb.c @@ -0,0 +1,133 @@ +#include "erfa.h" + +void eraLtpb(double epj, double rpb[3][3]) +/* +** - - - - - - - - +** e r a L t p b +** - - - - - - - - +** +** Long-term precession matrix, including ICRS frame bias. +** +** Given: +** epj double Julian epoch (TT) +** +** Returned: +** rpb double[3][3] precession-bias matrix, J2000.0 to date +** +** Notes: +** +** 1) The matrix is in the sense +** +** P_date = rpb x P_ICRS, +** +** where P_ICRS is a vector in the Geocentric Celestial Reference +** System, and P_date is the vector with respect to the Celestial +** Intermediate Reference System at that date but with nutation +** neglected. +** +** 2) A first order frame bias formulation is used, of sub- +** microarcsecond accuracy compared with a full 3D rotation. +** +** 3) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */ + const double dx = -0.016617 * ERFA_DAS2R, + de = -0.0068192 * ERFA_DAS2R, + dr = -0.0146 * ERFA_DAS2R; + + int i; + double rp[3][3]; + + +/* Precession matrix. */ + eraLtp(epj, rp); + +/* Apply the bias. */ + for ( i = 0; i < 3; i++ ) { + rpb[i][0] = rp[i][0] - rp[i][1]*dr + rp[i][2]*dx; + rpb[i][1] = rp[i][0]*dr + rp[i][1] + rp[i][2]*de; + rpb[i][2] = -rp[i][0]*dx - rp[i][1]*de + rp[i][2]; + } + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ltpecl.c b/testbed/astropy__astropy/cextern/erfa/ltpecl.c new file mode 100644 index 0000000000000000000000000000000000000000..924e23b4146d15a049c161d22658c5e99f91bda6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ltpecl.c @@ -0,0 +1,177 @@ +#include "erfa.h" + +void eraLtpecl(double epj, double vec[3]) +/* +** - - - - - - - - - - +** e r a L t p e c l +** - - - - - - - - - - +** +** Long-term precession of the ecliptic. +** +** Given: +** epj double Julian epoch (TT) +** +** Returned: +** vec double[3] ecliptic pole unit vector +** +** Notes: +** +** 1) The returned vector is with respect to the J2000.0 mean equator +** and equinox. +** +** 2) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Obliquity at J2000.0 (radians). */ + static const double eps0 = 84381.406 * ERFA_DAS2R; + +/* Polynomial coefficients */ + enum { NPOL = 4 }; + static const double pqpol[2][NPOL] = { + { 5851.607687, + -0.1189000, + -0.00028913, + 0.000000101}, + {-1600.886300, + 1.1689818, + -0.00000020, + -0.000000437} + }; + +/* Periodic coefficients */ + static const double pqper[][5] = { + { 708.15,-5486.751211,-684.661560, 667.666730,-5523.863691}, + {2309.00, -17.127623,2446.283880,-2354.886252, -549.747450}, + {1620.00, -617.517403, 399.671049, -428.152441, -310.998056}, + { 492.20, 413.442940,-356.652376, 376.202861, 421.535876}, + {1183.00, 78.614193,-186.387003, 184.778874, -36.776172}, + { 622.00, -180.732815,-316.800070, 335.321713, -145.278396}, + { 882.00, -87.676083, 198.296701, -185.138669, -34.744450}, + { 547.00, 46.140315, 101.135679, -120.972830, 22.885731} + }; + static const int NPER = (int) ( sizeof pqper / 5 / sizeof (double) ); + +/* Miscellaneous */ + int i; + double t, p, q, w, a, s, c; + + +/* Centuries since J2000. */ + t = ( epj - 2000.0 ) / 100.0; + +/* Initialize P_A and Q_A accumulators. */ + p = 0.0; + q = 0.0; + +/* Periodic terms. */ + w = ERFA_D2PI*t; + for ( i = 0; i < NPER; i++ ) { + a = w/pqper[i][0]; + s = sin(a); + c = cos(a); + p += c*pqper[i][1] + s*pqper[i][3]; + q += c*pqper[i][2] + s*pqper[i][4]; + } + +/* Polynomial terms. */ + w = 1.0; + for ( i = 0; i < NPOL; i++ ) { + p += pqpol[0][i]*w; + q += pqpol[1][i]*w; + w *= t; + } + +/* P_A and Q_A (radians). */ + p *= ERFA_DAS2R; + q *= ERFA_DAS2R; + +/* Form the ecliptic pole vector. */ + w = 1.0 - p*p - q*q; + w = w < 0.0 ? 0.0 : sqrt(w); + s = sin(eps0); + c = cos(eps0); + vec[0] = p; + vec[1] = - q*c - w*s; + vec[2] = - q*s + w*c; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ltpequ.c b/testbed/astropy__astropy/cextern/erfa/ltpequ.c new file mode 100644 index 0000000000000000000000000000000000000000..0f16844e10727ea3e35e0e536f5c0af9a0919382 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ltpequ.c @@ -0,0 +1,177 @@ +#include "erfa.h" + +void eraLtpequ(double epj, double veq[3]) +/* +** - - - - - - - - - - +** e r a L t p e q u +** - - - - - - - - - - +** +** Long-term precession of the equator. +** +** Given: +** epj double Julian epoch (TT) +** +** Returned: +** veq double[3] equator pole unit vector +** +** Notes: +** +** 1) The returned vector is with respect to the J2000.0 mean equator +** and equinox. +** +** 2) The Vondrak et al. (2011, 2012) 400 millennia precession model +** agrees with the IAU 2006 precession at J2000.0 and stays within +** 100 microarcseconds during the 20th and 21st centuries. It is +** accurate to a few arcseconds throughout the historical period, +** worsening to a few tenths of a degree at the end of the +** +/- 200,000 year time span. +** +** References: +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession +** expressions, valid for long time intervals, Astron.Astrophys. 534, +** A22 +** +** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession +** expressions, valid for long time intervals (Corrigendum), +** Astron.Astrophys. 541, C1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Polynomial coefficients */ + enum { NPOL = 4 }; + static const double xypol[2][NPOL] = { + { 5453.282155, + 0.4252841, + -0.00037173, + -0.000000152}, + {-73750.930350, + -0.7675452, + -0.00018725, + 0.000000231} + }; + +/* Periodic coefficients */ + static const double xyper[][5] = { + { 256.75, -819.940624,75004.344875,81491.287984, 1558.515853}, + { 708.15,-8444.676815, 624.033993, 787.163481, 7774.939698}, + { 274.20, 2600.009459, 1251.136893, 1251.296102,-2219.534038}, + { 241.45, 2755.175630,-1102.212834,-1257.950837,-2523.969396}, + {2309.00, -167.659835,-2660.664980,-2966.799730, 247.850422}, + { 492.20, 871.855056, 699.291817, 639.744522, -846.485643}, + { 396.10, 44.769698, 153.167220, 131.600209,-1393.124055}, + { 288.90, -512.313065, -950.865637, -445.040117, 368.526116}, + { 231.10, -819.415595, 499.754645, 584.522874, 749.045012}, + {1610.00, -538.071099, -145.188210, -89.756563, 444.704518}, + { 620.00, -189.793622, 558.116553, 524.429630, 235.934465}, + { 157.87, -402.922932, -23.923029, -13.549067, 374.049623}, + { 220.30, 179.516345, -165.405086, -210.157124, -171.330180}, + {1200.00, -9.814756, 9.344131, -44.919798, -22.899655} + }; + static const int NPER = (int) ( sizeof xyper / 5 / sizeof (double) ); + +/* Miscellaneous */ + int i; + double t, x, y, w, a, s, c; + + +/* Centuries since J2000. */ + t = ( epj - 2000.0 ) / 100.0; + +/* Initialize X and Y accumulators. */ + x = 0.0; + y = 0.0; + +/* Periodic terms. */ + w = ERFA_D2PI * t; + for ( i = 0; i < NPER; i++ ) { + a = w / xyper[i][0]; + s = sin(a); + c = cos(a); + x += c*xyper[i][1] + s*xyper[i][3]; + y += c*xyper[i][2] + s*xyper[i][4]; + } + +/* Polynomial terms. */ + w = 1.0; + for ( i = 0; i < NPOL; i++ ) { + x += xypol[0][i]*w; + y += xypol[1][i]*w; + w *= t; + } + +/* X and Y (direction cosines). */ + x *= ERFA_DAS2R; + y *= ERFA_DAS2R; + +/* Form the equator pole vector. */ + veq[0] = x; + veq[1] = y; + w = 1.0 - x*x - y*y; + veq[2] = w < 0.0 ? 0.0 : sqrt(w); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/num00a.c b/testbed/astropy__astropy/cextern/erfa/num00a.c new file mode 100644 index 0000000000000000000000000000000000000000..e611a0c30781cbd525530ae27f45c8ba27dbe50f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/num00a.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +void eraNum00a(double date1, double date2, double rmatn[3][3]) +/* +** - - - - - - - - - - +** e r a N u m 0 0 a +** - - - - - - - - - - +** +** Form the matrix of nutation for a given date, IAU 2000A model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rmatn double[3][3] nutation matrix +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(true) = rmatn * V(mean), where +** the p-vector V(true) is with respect to the true equatorial triad +** of date and the p-vector V(mean) is with respect to the mean +** equatorial triad of date. +** +** 3) A faster, but slightly less accurate result (about 1 mas), can be +** obtained by using instead the eraNum00b function. +** +** Called: +** eraPn00a bias/precession/nutation, IAU 2000A +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.222-3 (p114). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rbpn[3][3]; + + +/* Obtain the required matrix (discarding other results). */ + eraPn00a(date1, date2, + &dpsi, &deps, &epsa, rb, rp, rbp, rmatn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/num00b.c b/testbed/astropy__astropy/cextern/erfa/num00b.c new file mode 100644 index 0000000000000000000000000000000000000000..d52604743c6e0f1ab8cf1a380b9f2d383c4b7ae7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/num00b.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +void eraNum00b(double date1, double date2, double rmatn[3][3]) +/* +** - - - - - - - - - - +** e r a N u m 0 0 b +** - - - - - - - - - - +** +** Form the matrix of nutation for a given date, IAU 2000B model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rmatn double[3][3] nutation matrix +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(true) = rmatn * V(mean), where +** the p-vector V(true) is with respect to the true equatorial triad +** of date and the p-vector V(mean) is with respect to the mean +** equatorial triad of date. +** +** 3) The present function is faster, but slightly less accurate (about +** 1 mas), than the eraNum00a function. +** +** Called: +** eraPn00b bias/precession/nutation, IAU 2000B +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.222-3 (p114). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rbpn[3][3]; + + +/* Obtain the required matrix (discarding other results). */ + eraPn00b(date1, date2, + &dpsi, &deps, &epsa, rb, rp, rbp, rmatn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/num06a.c b/testbed/astropy__astropy/cextern/erfa/num06a.c new file mode 100644 index 0000000000000000000000000000000000000000..56faa3689ab1c8f1fdad66ab51f62f0a14835178 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/num06a.c @@ -0,0 +1,134 @@ +#include "erfa.h" + +void eraNum06a(double date1, double date2, double rmatn[3][3]) +/* +** - - - - - - - - - - +** e r a N u m 0 6 a +** - - - - - - - - - - +** +** Form the matrix of nutation for a given date, IAU 2006/2000A model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rmatn double[3][3] nutation matrix +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(true) = rmatn * V(mean), where +** the p-vector V(true) is with respect to the true equatorial triad +** of date and the p-vector V(mean) is with respect to the mean +** equatorial triad of date. +** +** Called: +** eraObl06 mean obliquity, IAU 2006 +** eraNut06a nutation, IAU 2006/2000A +** eraNumat form nutation matrix +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.222-3 (p114). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double eps, dp, de; + + +/* Mean obliquity. */ + eps = eraObl06(date1, date2); + +/* Nutation components. */ + eraNut06a(date1, date2, &dp, &de); + +/* Nutation matrix. */ + eraNumat(eps, dp, de, rmatn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/numat.c b/testbed/astropy__astropy/cextern/erfa/numat.c new file mode 100644 index 0000000000000000000000000000000000000000..83082cee7a8899b6a977c4af65859fb3ccab31f7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/numat.c @@ -0,0 +1,118 @@ +#include "erfa.h" + +void eraNumat(double epsa, double dpsi, double deps, double rmatn[3][3]) +/* +** - - - - - - - - - +** e r a N u m a t +** - - - - - - - - - +** +** Form the matrix of nutation. +** +** Given: +** epsa double mean obliquity of date (Note 1) +** dpsi,deps double nutation (Note 2) +** +** Returned: +** rmatn double[3][3] nutation matrix (Note 3) +** +** Notes: +** +** +** 1) The supplied mean obliquity epsa, must be consistent with the +** precession-nutation models from which dpsi and deps were obtained. +** +** 2) The caller is responsible for providing the nutation components; +** they are in longitude and obliquity, in radians and are with +** respect to the equinox and ecliptic of date. +** +** 3) The matrix operates in the sense V(true) = rmatn * V(mean), +** where the p-vector V(true) is with respect to the true +** equatorial triad of date and the p-vector V(mean) is with +** respect to the mean equatorial triad of date. +** +** Called: +** eraIr initialize r-matrix to identity +** eraRx rotate around X-axis +** eraRz rotate around Z-axis +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.222-3 (p114). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Build the rotation matrix. */ + eraIr(rmatn); + eraRx(epsa, rmatn); + eraRz(-dpsi, rmatn); + eraRx(-(epsa + deps), rmatn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/nut00a.c b/testbed/astropy__astropy/cextern/erfa/nut00a.c new file mode 100644 index 0000000000000000000000000000000000000000..694b2f9de108d6b5fd605438b25eea50b4ba1637 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/nut00a.c @@ -0,0 +1,2056 @@ +#include "erfa.h" + +void eraNut00a(double date1, double date2, double *dpsi, double *deps) +/* +** - - - - - - - - - - +** e r a N u t 0 0 a +** - - - - - - - - - - +** +** Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation +** with free core nutation omitted). +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation, luni-solar + planetary (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components in longitude and obliquity are in radians +** and with respect to the equinox and ecliptic of date. The +** obliquity at J2000.0 is assumed to be the Lieske et al. (1977) +** value of 84381.448 arcsec. +** +** Both the luni-solar and planetary nutations are included. The +** latter are due to direct planetary nutations and the +** perturbations of the lunar and terrestrial orbits. +** +** 3) The function computes the MHB2000 nutation series with the +** associated corrections for planetary nutations. It is an +** implementation of the nutation part of the IAU 2000A precession- +** nutation model, formally adopted by the IAU General Assembly in +** 2000, namely MHB2000 (Mathews et al. 2002), but with the free +** core nutation (FCN - see Note 4) omitted. +** +** 4) The full MHB2000 model also contains contributions to the +** nutations in longitude and obliquity due to the free-excitation +** of the free-core-nutation during the period 1979-2000. These FCN +** terms, which are time-dependent and unpredictable, are NOT +** included in the present function and, if required, must be +** independently computed. With the FCN corrections included, the +** present function delivers a pole which is at current epochs +** accurate to a few hundred microarcseconds. The omission of FCN +** introduces further errors of about that size. +** +** 5) The present function provides classical nutation. The MHB2000 +** algorithm, from which it is adapted, deals also with (i) the +** offsets between the GCRS and mean poles and (ii) the adjustments +** in longitude and obliquity due to the changed precession rates. +** These additional functions, namely frame bias and precession +** adjustments, are supported by the ERFA functions eraBi00 and +** eraPr00. +** +** 6) The MHB2000 algorithm also provides "total" nutations, comprising +** the arithmetic sum of the frame bias, precession adjustments, +** luni-solar nutation and planetary nutation. These total +** nutations can be used in combination with an existing IAU 1976 +** precession implementation, such as eraPmat76, to deliver GCRS- +** to-true predictions of sub-mas accuracy at current dates. +** However, there are three shortcomings in the MHB2000 model that +** must be taken into account if more accurate or definitive results +** are required (see Wallace 2002): +** +** (i) The MHB2000 total nutations are simply arithmetic sums, +** yet in reality the various components are successive Euler +** rotations. This slight lack of rigor leads to cross terms +** that exceed 1 mas after a century. The rigorous procedure +** is to form the GCRS-to-true rotation matrix by applying the +** bias, precession and nutation in that order. +** +** (ii) Although the precession adjustments are stated to be with +** respect to Lieske et al. (1977), the MHB2000 model does +** not specify which set of Euler angles are to be used and +** how the adjustments are to be applied. The most literal +** and straightforward procedure is to adopt the 4-rotation +** epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR +** to psi_A and DEPSPR to both omega_A and eps_A. +** +** (iii) The MHB2000 model predates the determination by Chapront +** et al. (2002) of a 14.6 mas displacement between the +** J2000.0 mean equinox and the origin of the ICRS frame. It +** should, however, be noted that neglecting this displacement +** when calculating star coordinates does not lead to a +** 14.6 mas change in right ascension, only a small second- +** order distortion in the pattern of the precession-nutation +** effect. +** +** For these reasons, the ERFA functions do not generate the "total +** nutations" directly, though they can of course easily be +** generated by calling eraBi00, eraPr00 and the present function +** and adding the results. +** +** 7) The MHB2000 model contains 41 instances where the same frequency +** appears multiple times, of which 38 are duplicates and three are +** triplicates. To keep the present code close to the original MHB +** algorithm, this small inefficiency has not been corrected. +** +** Called: +** eraFal03 mean anomaly of the Moon +** eraFaf03 mean argument of the latitude of the Moon +** eraFaom03 mean longitude of the Moon's ascending node +** eraFame03 mean longitude of Mercury +** eraFave03 mean longitude of Venus +** eraFae03 mean longitude of Earth +** eraFama03 mean longitude of Mars +** eraFaju03 mean longitude of Jupiter +** eraFasa03 mean longitude of Saturn +** eraFaur03 mean longitude of Uranus +** eraFapa03 general accumulated precession in longitude +** +** References: +** +** Chapront, J., Chapront-Touze, M. & Francou, G. 2002, +** Astron.Astrophys. 387, 700 +** +** Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, +** Astron.Astrophys. 58, 1-16 +** +** Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res. +** 107, B4. The MHB_2000 code itself was obtained on 9th September +** 2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A. +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Wallace, P.T., "Software for Implementing the IAU 2000 +** Resolutions", in IERS Workshop 5.1 (2002) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i; + double t, el, elp, f, d, om, arg, dp, de, sarg, carg, + al, af, ad, aom, alme, alve, alea, alma, + alju, alsa, alur, alne, apa, dpsils, depsls, + dpsipl, depspl; + +/* Units of 0.1 microarcsecond to radians */ + const double U2R = ERFA_DAS2R / 1e7; + +/* ------------------------- */ +/* Luni-Solar nutation model */ +/* ------------------------- */ + +/* The units for the sine and cosine coefficients are */ +/* 0.1 microarcsecond and the same per Julian century */ + + static const struct { + int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */ + double sp,spt,cp; /* longitude sin, t*sin, cos coefficients */ + double ce,cet,se; /* obliquity cos, t*cos, sin coefficients */ + } xls[] = { + + /* 1- 10 */ + { 0, 0, 0, 0, 1, + -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0}, + { 0, 0, 2,-2, 2, + -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0}, + { 0, 0, 2, 0, 2,-2276413.0,-234.0,2796.0,978459.0,-485.0, 1374.0}, + { 0, 0, 0, 0, 2,2074554.0, 207.0, -698.0,-897492.0,470.0, -291.0}, + { 0, 1, 0, 0, 0,1475877.0,-3633.0,11817.0,73871.0,-184.0,-1924.0}, + { 0, 1, 2,-2, 2,-516821.0,1226.0, -524.0,224386.0,-677.0, -174.0}, + { 1, 0, 0, 0, 0, 711159.0, 73.0, -872.0, -6750.0, 0.0, 358.0}, + { 0, 0, 2, 0, 1,-387298.0,-367.0, 380.0, 200728.0, 18.0, 318.0}, + { 1, 0, 2, 0, 2,-301461.0, -36.0, 816.0, 129025.0,-63.0, 367.0}, + { 0,-1, 2,-2, 2, 215829.0,-494.0, 111.0, -95929.0,299.0, 132.0}, + + /* 11-20 */ + { 0, 0, 2,-2, 1, 128227.0, 137.0, 181.0, -68982.0, -9.0, 39.0}, + {-1, 0, 2, 0, 2, 123457.0, 11.0, 19.0, -53311.0, 32.0, -4.0}, + {-1, 0, 0, 2, 0, 156994.0, 10.0, -168.0, -1235.0, 0.0, 82.0}, + { 1, 0, 0, 0, 1, 63110.0, 63.0, 27.0, -33228.0, 0.0, -9.0}, + {-1, 0, 0, 0, 1, -57976.0, -63.0, -189.0, 31429.0, 0.0, -75.0}, + {-1, 0, 2, 2, 2, -59641.0, -11.0, 149.0, 25543.0,-11.0, 66.0}, + { 1, 0, 2, 0, 1, -51613.0, -42.0, 129.0, 26366.0, 0.0, 78.0}, + {-2, 0, 2, 0, 1, 45893.0, 50.0, 31.0, -24236.0,-10.0, 20.0}, + { 0, 0, 0, 2, 0, 63384.0, 11.0, -150.0, -1220.0, 0.0, 29.0}, + { 0, 0, 2, 2, 2, -38571.0, -1.0, 158.0, 16452.0,-11.0, 68.0}, + + /* 21-30 */ + { 0,-2, 2,-2, 2, 32481.0, 0.0, 0.0, -13870.0, 0.0, 0.0}, + {-2, 0, 0, 2, 0, -47722.0, 0.0, -18.0, 477.0, 0.0, -25.0}, + { 2, 0, 2, 0, 2, -31046.0, -1.0, 131.0, 13238.0,-11.0, 59.0}, + { 1, 0, 2,-2, 2, 28593.0, 0.0, -1.0, -12338.0, 10.0, -3.0}, + {-1, 0, 2, 0, 1, 20441.0, 21.0, 10.0, -10758.0, 0.0, -3.0}, + { 2, 0, 0, 0, 0, 29243.0, 0.0, -74.0, -609.0, 0.0, 13.0}, + { 0, 0, 2, 0, 0, 25887.0, 0.0, -66.0, -550.0, 0.0, 11.0}, + { 0, 1, 0, 0, 1, -14053.0, -25.0, 79.0, 8551.0, -2.0, -45.0}, + {-1, 0, 0, 2, 1, 15164.0, 10.0, 11.0, -8001.0, 0.0, -1.0}, + { 0, 2, 2,-2, 2, -15794.0, 72.0, -16.0, 6850.0,-42.0, -5.0}, + + /* 31-40 */ + { 0, 0,-2, 2, 0, 21783.0, 0.0, 13.0, -167.0, 0.0, 13.0}, + { 1, 0, 0,-2, 1, -12873.0, -10.0, -37.0, 6953.0, 0.0, -14.0}, + { 0,-1, 0, 0, 1, -12654.0, 11.0, 63.0, 6415.0, 0.0, 26.0}, + {-1, 0, 2, 2, 1, -10204.0, 0.0, 25.0, 5222.0, 0.0, 15.0}, + { 0, 2, 0, 0, 0, 16707.0, -85.0, -10.0, 168.0, -1.0, 10.0}, + { 1, 0, 2, 2, 2, -7691.0, 0.0, 44.0, 3268.0, 0.0, 19.0}, + {-2, 0, 2, 0, 0, -11024.0, 0.0, -14.0, 104.0, 0.0, 2.0}, + { 0, 1, 2, 0, 2, 7566.0, -21.0, -11.0, -3250.0, 0.0, -5.0}, + { 0, 0, 2, 2, 1, -6637.0, -11.0, 25.0, 3353.0, 0.0, 14.0}, + { 0,-1, 2, 0, 2, -7141.0, 21.0, 8.0, 3070.0, 0.0, 4.0}, + + /* 41-50 */ + { 0, 0, 0, 2, 1, -6302.0, -11.0, 2.0, 3272.0, 0.0, 4.0}, + { 1, 0, 2,-2, 1, 5800.0, 10.0, 2.0, -3045.0, 0.0, -1.0}, + { 2, 0, 2,-2, 2, 6443.0, 0.0, -7.0, -2768.0, 0.0, -4.0}, + {-2, 0, 0, 2, 1, -5774.0, -11.0, -15.0, 3041.0, 0.0, -5.0}, + { 2, 0, 2, 0, 1, -5350.0, 0.0, 21.0, 2695.0, 0.0, 12.0}, + { 0,-1, 2,-2, 1, -4752.0, -11.0, -3.0, 2719.0, 0.0, -3.0}, + { 0, 0, 0,-2, 1, -4940.0, -11.0, -21.0, 2720.0, 0.0, -9.0}, + {-1,-1, 0, 2, 0, 7350.0, 0.0, -8.0, -51.0, 0.0, 4.0}, + { 2, 0, 0,-2, 1, 4065.0, 0.0, 6.0, -2206.0, 0.0, 1.0}, + { 1, 0, 0, 2, 0, 6579.0, 0.0, -24.0, -199.0, 0.0, 2.0}, + + /* 51-60 */ + { 0, 1, 2,-2, 1, 3579.0, 0.0, 5.0, -1900.0, 0.0, 1.0}, + { 1,-1, 0, 0, 0, 4725.0, 0.0, -6.0, -41.0, 0.0, 3.0}, + {-2, 0, 2, 0, 2, -3075.0, 0.0, -2.0, 1313.0, 0.0, -1.0}, + { 3, 0, 2, 0, 2, -2904.0, 0.0, 15.0, 1233.0, 0.0, 7.0}, + { 0,-1, 0, 2, 0, 4348.0, 0.0, -10.0, -81.0, 0.0, 2.0}, + { 1,-1, 2, 0, 2, -2878.0, 0.0, 8.0, 1232.0, 0.0, 4.0}, + { 0, 0, 0, 1, 0, -4230.0, 0.0, 5.0, -20.0, 0.0, -2.0}, + {-1,-1, 2, 2, 2, -2819.0, 0.0, 7.0, 1207.0, 0.0, 3.0}, + {-1, 0, 2, 0, 0, -4056.0, 0.0, 5.0, 40.0, 0.0, -2.0}, + { 0,-1, 2, 2, 2, -2647.0, 0.0, 11.0, 1129.0, 0.0, 5.0}, + + /* 61-70 */ + {-2, 0, 0, 0, 1, -2294.0, 0.0, -10.0, 1266.0, 0.0, -4.0}, + { 1, 1, 2, 0, 2, 2481.0, 0.0, -7.0, -1062.0, 0.0, -3.0}, + { 2, 0, 0, 0, 1, 2179.0, 0.0, -2.0, -1129.0, 0.0, -2.0}, + {-1, 1, 0, 1, 0, 3276.0, 0.0, 1.0, -9.0, 0.0, 0.0}, + { 1, 1, 0, 0, 0, -3389.0, 0.0, 5.0, 35.0, 0.0, -2.0}, + { 1, 0, 2, 0, 0, 3339.0, 0.0, -13.0, -107.0, 0.0, 1.0}, + {-1, 0, 2,-2, 1, -1987.0, 0.0, -6.0, 1073.0, 0.0, -2.0}, + { 1, 0, 0, 0, 2, -1981.0, 0.0, 0.0, 854.0, 0.0, 0.0}, + {-1, 0, 0, 1, 0, 4026.0, 0.0, -353.0, -553.0, 0.0, -139.0}, + { 0, 0, 2, 1, 2, 1660.0, 0.0, -5.0, -710.0, 0.0, -2.0}, + + /* 71-80 */ + {-1, 0, 2, 4, 2, -1521.0, 0.0, 9.0, 647.0, 0.0, 4.0}, + {-1, 1, 0, 1, 1, 1314.0, 0.0, 0.0, -700.0, 0.0, 0.0}, + { 0,-2, 2,-2, 1, -1283.0, 0.0, 0.0, 672.0, 0.0, 0.0}, + { 1, 0, 2, 2, 1, -1331.0, 0.0, 8.0, 663.0, 0.0, 4.0}, + {-2, 0, 2, 2, 2, 1383.0, 0.0, -2.0, -594.0, 0.0, -2.0}, + {-1, 0, 0, 0, 2, 1405.0, 0.0, 4.0, -610.0, 0.0, 2.0}, + { 1, 1, 2,-2, 2, 1290.0, 0.0, 0.0, -556.0, 0.0, 0.0}, + {-2, 0, 2, 4, 2, -1214.0, 0.0, 5.0, 518.0, 0.0, 2.0}, + {-1, 0, 4, 0, 2, 1146.0, 0.0, -3.0, -490.0, 0.0, -1.0}, + { 2, 0, 2,-2, 1, 1019.0, 0.0, -1.0, -527.0, 0.0, -1.0}, + + /* 81-90 */ + { 2, 0, 2, 2, 2, -1100.0, 0.0, 9.0, 465.0, 0.0, 4.0}, + { 1, 0, 0, 2, 1, -970.0, 0.0, 2.0, 496.0, 0.0, 1.0}, + { 3, 0, 0, 0, 0, 1575.0, 0.0, -6.0, -50.0, 0.0, 0.0}, + { 3, 0, 2,-2, 2, 934.0, 0.0, -3.0, -399.0, 0.0, -1.0}, + { 0, 0, 4,-2, 2, 922.0, 0.0, -1.0, -395.0, 0.0, -1.0}, + { 0, 1, 2, 0, 1, 815.0, 0.0, -1.0, -422.0, 0.0, -1.0}, + { 0, 0,-2, 2, 1, 834.0, 0.0, 2.0, -440.0, 0.0, 1.0}, + { 0, 0, 2,-2, 3, 1248.0, 0.0, 0.0, -170.0, 0.0, 1.0}, + {-1, 0, 0, 4, 0, 1338.0, 0.0, -5.0, -39.0, 0.0, 0.0}, + { 2, 0,-2, 0, 1, 716.0, 0.0, -2.0, -389.0, 0.0, -1.0}, + + /* 91-100 */ + {-2, 0, 0, 4, 0, 1282.0, 0.0, -3.0, -23.0, 0.0, 1.0}, + {-1,-1, 0, 2, 1, 742.0, 0.0, 1.0, -391.0, 0.0, 0.0}, + {-1, 0, 0, 1, 1, 1020.0, 0.0, -25.0, -495.0, 0.0, -10.0}, + { 0, 1, 0, 0, 2, 715.0, 0.0, -4.0, -326.0, 0.0, 2.0}, + { 0, 0,-2, 0, 1, -666.0, 0.0, -3.0, 369.0, 0.0, -1.0}, + { 0,-1, 2, 0, 1, -667.0, 0.0, 1.0, 346.0, 0.0, 1.0}, + { 0, 0, 2,-1, 2, -704.0, 0.0, 0.0, 304.0, 0.0, 0.0}, + { 0, 0, 2, 4, 2, -694.0, 0.0, 5.0, 294.0, 0.0, 2.0}, + {-2,-1, 0, 2, 0, -1014.0, 0.0, -1.0, 4.0, 0.0, -1.0}, + { 1, 1, 0,-2, 1, -585.0, 0.0, -2.0, 316.0, 0.0, -1.0}, + + /* 101-110 */ + {-1, 1, 0, 2, 0, -949.0, 0.0, 1.0, 8.0, 0.0, -1.0}, + {-1, 1, 0, 1, 2, -595.0, 0.0, 0.0, 258.0, 0.0, 0.0}, + { 1,-1, 0, 0, 1, 528.0, 0.0, 0.0, -279.0, 0.0, 0.0}, + { 1,-1, 2, 2, 2, -590.0, 0.0, 4.0, 252.0, 0.0, 2.0}, + {-1, 1, 2, 2, 2, 570.0, 0.0, -2.0, -244.0, 0.0, -1.0}, + { 3, 0, 2, 0, 1, -502.0, 0.0, 3.0, 250.0, 0.0, 2.0}, + { 0, 1,-2, 2, 0, -875.0, 0.0, 1.0, 29.0, 0.0, 0.0}, + {-1, 0, 0,-2, 1, -492.0, 0.0, -3.0, 275.0, 0.0, -1.0}, + { 0, 1, 2, 2, 2, 535.0, 0.0, -2.0, -228.0, 0.0, -1.0}, + {-1,-1, 2, 2, 1, -467.0, 0.0, 1.0, 240.0, 0.0, 1.0}, + + /* 111-120 */ + { 0,-1, 0, 0, 2, 591.0, 0.0, 0.0, -253.0, 0.0, 0.0}, + { 1, 0, 2,-4, 1, -453.0, 0.0, -1.0, 244.0, 0.0, -1.0}, + {-1, 0,-2, 2, 0, 766.0, 0.0, 1.0, 9.0, 0.0, 0.0}, + { 0,-1, 2, 2, 1, -446.0, 0.0, 2.0, 225.0, 0.0, 1.0}, + { 2,-1, 2, 0, 2, -488.0, 0.0, 2.0, 207.0, 0.0, 1.0}, + { 0, 0, 0, 2, 2, -468.0, 0.0, 0.0, 201.0, 0.0, 0.0}, + { 1,-1, 2, 0, 1, -421.0, 0.0, 1.0, 216.0, 0.0, 1.0}, + {-1, 1, 2, 0, 2, 463.0, 0.0, 0.0, -200.0, 0.0, 0.0}, + { 0, 1, 0, 2, 0, -673.0, 0.0, 2.0, 14.0, 0.0, 0.0}, + { 0,-1,-2, 2, 0, 658.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 121-130 */ + { 0, 3, 2,-2, 2, -438.0, 0.0, 0.0, 188.0, 0.0, 0.0}, + { 0, 0, 0, 1, 1, -390.0, 0.0, 0.0, 205.0, 0.0, 0.0}, + {-1, 0, 2, 2, 0, 639.0, -11.0, -2.0, -19.0, 0.0, 0.0}, + { 2, 1, 2, 0, 2, 412.0, 0.0, -2.0, -176.0, 0.0, -1.0}, + { 1, 1, 0, 0, 1, -361.0, 0.0, 0.0, 189.0, 0.0, 0.0}, + { 1, 1, 2, 0, 1, 360.0, 0.0, -1.0, -185.0, 0.0, -1.0}, + { 2, 0, 0, 2, 0, 588.0, 0.0, -3.0, -24.0, 0.0, 0.0}, + { 1, 0,-2, 2, 0, -578.0, 0.0, 1.0, 5.0, 0.0, 0.0}, + {-1, 0, 0, 2, 2, -396.0, 0.0, 0.0, 171.0, 0.0, 0.0}, + { 0, 1, 0, 1, 0, 565.0, 0.0, -1.0, -6.0, 0.0, 0.0}, + + /* 131-140 */ + { 0, 1, 0,-2, 1, -335.0, 0.0, -1.0, 184.0, 0.0, -1.0}, + {-1, 0, 2,-2, 2, 357.0, 0.0, 1.0, -154.0, 0.0, 0.0}, + { 0, 0, 0,-1, 1, 321.0, 0.0, 1.0, -174.0, 0.0, 0.0}, + {-1, 1, 0, 0, 1, -301.0, 0.0, -1.0, 162.0, 0.0, 0.0}, + { 1, 0, 2,-1, 2, -334.0, 0.0, 0.0, 144.0, 0.0, 0.0}, + { 1,-1, 0, 2, 0, 493.0, 0.0, -2.0, -15.0, 0.0, 0.0}, + { 0, 0, 0, 4, 0, 494.0, 0.0, -2.0, -19.0, 0.0, 0.0}, + { 1, 0, 2, 1, 2, 337.0, 0.0, -1.0, -143.0, 0.0, -1.0}, + { 0, 0, 2, 1, 1, 280.0, 0.0, -1.0, -144.0, 0.0, 0.0}, + { 1, 0, 0,-2, 2, 309.0, 0.0, 1.0, -134.0, 0.0, 0.0}, + + /* 141-150 */ + {-1, 0, 2, 4, 1, -263.0, 0.0, 2.0, 131.0, 0.0, 1.0}, + { 1, 0,-2, 0, 1, 253.0, 0.0, 1.0, -138.0, 0.0, 0.0}, + { 1, 1, 2,-2, 1, 245.0, 0.0, 0.0, -128.0, 0.0, 0.0}, + { 0, 0, 2, 2, 0, 416.0, 0.0, -2.0, -17.0, 0.0, 0.0}, + {-1, 0, 2,-1, 1, -229.0, 0.0, 0.0, 128.0, 0.0, 0.0}, + {-2, 0, 2, 2, 1, 231.0, 0.0, 0.0, -120.0, 0.0, 0.0}, + { 4, 0, 2, 0, 2, -259.0, 0.0, 2.0, 109.0, 0.0, 1.0}, + { 2,-1, 0, 0, 0, 375.0, 0.0, -1.0, -8.0, 0.0, 0.0}, + { 2, 1, 2,-2, 2, 252.0, 0.0, 0.0, -108.0, 0.0, 0.0}, + { 0, 1, 2, 1, 2, -245.0, 0.0, 1.0, 104.0, 0.0, 0.0}, + + /* 151-160 */ + { 1, 0, 4,-2, 2, 243.0, 0.0, -1.0, -104.0, 0.0, 0.0}, + {-1,-1, 0, 0, 1, 208.0, 0.0, 1.0, -112.0, 0.0, 0.0}, + { 0, 1, 0, 2, 1, 199.0, 0.0, 0.0, -102.0, 0.0, 0.0}, + {-2, 0, 2, 4, 1, -208.0, 0.0, 1.0, 105.0, 0.0, 0.0}, + { 2, 0, 2, 0, 0, 335.0, 0.0, -2.0, -14.0, 0.0, 0.0}, + { 1, 0, 0, 1, 0, -325.0, 0.0, 1.0, 7.0, 0.0, 0.0}, + {-1, 0, 0, 4, 1, -187.0, 0.0, 0.0, 96.0, 0.0, 0.0}, + {-1, 0, 4, 0, 1, 197.0, 0.0, -1.0, -100.0, 0.0, 0.0}, + { 2, 0, 2, 2, 1, -192.0, 0.0, 2.0, 94.0, 0.0, 1.0}, + { 0, 0, 2,-3, 2, -188.0, 0.0, 0.0, 83.0, 0.0, 0.0}, + + /* 161-170 */ + {-1,-2, 0, 2, 0, 276.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 1, 0, 0, 0, -286.0, 0.0, 1.0, 6.0, 0.0, 0.0}, + { 0, 0, 4, 0, 2, 186.0, 0.0, -1.0, -79.0, 0.0, 0.0}, + { 0, 0, 0, 0, 3, -219.0, 0.0, 0.0, 43.0, 0.0, 0.0}, + { 0, 3, 0, 0, 0, 276.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 2,-4, 1, -153.0, 0.0, -1.0, 84.0, 0.0, 0.0}, + { 0,-1, 0, 2, 1, -156.0, 0.0, 0.0, 81.0, 0.0, 0.0}, + { 0, 0, 0, 4, 1, -154.0, 0.0, 1.0, 78.0, 0.0, 0.0}, + {-1,-1, 2, 4, 2, -174.0, 0.0, 1.0, 75.0, 0.0, 0.0}, + { 1, 0, 2, 4, 2, -163.0, 0.0, 2.0, 69.0, 0.0, 1.0}, + + /* 171-180 */ + {-2, 2, 0, 2, 0, -228.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-2,-1, 2, 0, 1, 91.0, 0.0, -4.0, -54.0, 0.0, -2.0}, + {-2, 0, 0, 2, 2, 175.0, 0.0, 0.0, -75.0, 0.0, 0.0}, + {-1,-1, 2, 0, 2, -159.0, 0.0, 0.0, 69.0, 0.0, 0.0}, + { 0, 0, 4,-2, 1, 141.0, 0.0, 0.0, -72.0, 0.0, 0.0}, + { 3, 0, 2,-2, 1, 147.0, 0.0, 0.0, -75.0, 0.0, 0.0}, + {-2,-1, 0, 2, 1, -132.0, 0.0, 0.0, 69.0, 0.0, 0.0}, + { 1, 0, 0,-1, 1, 159.0, 0.0, -28.0, -54.0, 0.0, 11.0}, + { 0,-2, 0, 2, 0, 213.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + {-2, 0, 0, 4, 1, 123.0, 0.0, 0.0, -64.0, 0.0, 0.0}, + + /* 181-190 */ + {-3, 0, 0, 0, 1, -118.0, 0.0, -1.0, 66.0, 0.0, 0.0}, + { 1, 1, 2, 2, 2, 144.0, 0.0, -1.0, -61.0, 0.0, 0.0}, + { 0, 0, 2, 4, 1, -121.0, 0.0, 1.0, 60.0, 0.0, 0.0}, + { 3, 0, 2, 2, 2, -134.0, 0.0, 1.0, 56.0, 0.0, 1.0}, + {-1, 1, 2,-2, 1, -105.0, 0.0, 0.0, 57.0, 0.0, 0.0}, + { 2, 0, 0,-4, 1, -102.0, 0.0, 0.0, 56.0, 0.0, 0.0}, + { 0, 0, 0,-2, 2, 120.0, 0.0, 0.0, -52.0, 0.0, 0.0}, + { 2, 0, 2,-4, 1, 101.0, 0.0, 0.0, -54.0, 0.0, 0.0}, + {-1, 1, 0, 2, 1, -113.0, 0.0, 0.0, 59.0, 0.0, 0.0}, + { 0, 0, 2,-1, 1, -106.0, 0.0, 0.0, 61.0, 0.0, 0.0}, + + /* 191-200 */ + { 0,-2, 2, 2, 2, -129.0, 0.0, 1.0, 55.0, 0.0, 0.0}, + { 2, 0, 0, 2, 1, -114.0, 0.0, 0.0, 57.0, 0.0, 0.0}, + { 4, 0, 2,-2, 2, 113.0, 0.0, -1.0, -49.0, 0.0, 0.0}, + { 2, 0, 0,-2, 2, -102.0, 0.0, 0.0, 44.0, 0.0, 0.0}, + { 0, 2, 0, 0, 1, -94.0, 0.0, 0.0, 51.0, 0.0, 0.0}, + { 1, 0, 0,-4, 1, -100.0, 0.0, -1.0, 56.0, 0.0, 0.0}, + { 0, 2, 2,-2, 1, 87.0, 0.0, 0.0, -47.0, 0.0, 0.0}, + {-3, 0, 0, 4, 0, 161.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-1, 1, 2, 0, 1, 96.0, 0.0, 0.0, -50.0, 0.0, 0.0}, + {-1,-1, 0, 4, 0, 151.0, 0.0, -1.0, -5.0, 0.0, 0.0}, + + /* 201-210 */ + {-1,-2, 2, 2, 2, -104.0, 0.0, 0.0, 44.0, 0.0, 0.0}, + {-2,-1, 2, 4, 2, -110.0, 0.0, 0.0, 48.0, 0.0, 0.0}, + { 1,-1, 2, 2, 1, -100.0, 0.0, 1.0, 50.0, 0.0, 0.0}, + {-2, 1, 0, 2, 0, 92.0, 0.0, -5.0, 12.0, 0.0, -2.0}, + {-2, 1, 2, 0, 1, 82.0, 0.0, 0.0, -45.0, 0.0, 0.0}, + { 2, 1, 0,-2, 1, 82.0, 0.0, 0.0, -45.0, 0.0, 0.0}, + {-3, 0, 2, 0, 1, -78.0, 0.0, 0.0, 41.0, 0.0, 0.0}, + {-2, 0, 2,-2, 1, -77.0, 0.0, 0.0, 43.0, 0.0, 0.0}, + {-1, 1, 0, 2, 2, 2.0, 0.0, 0.0, 54.0, 0.0, 0.0}, + { 0,-1, 2,-1, 2, 94.0, 0.0, 0.0, -40.0, 0.0, 0.0}, + + /* 211-220 */ + {-1, 0, 4,-2, 2, -93.0, 0.0, 0.0, 40.0, 0.0, 0.0}, + { 0,-2, 2, 0, 2, -83.0, 0.0, 10.0, 40.0, 0.0, -2.0}, + {-1, 0, 2, 1, 2, 83.0, 0.0, 0.0, -36.0, 0.0, 0.0}, + { 2, 0, 0, 0, 2, -91.0, 0.0, 0.0, 39.0, 0.0, 0.0}, + { 0, 0, 2, 0, 3, 128.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-2, 0, 4, 0, 2, -79.0, 0.0, 0.0, 34.0, 0.0, 0.0}, + {-1, 0,-2, 0, 1, -83.0, 0.0, 0.0, 47.0, 0.0, 0.0}, + {-1, 1, 2, 2, 1, 84.0, 0.0, 0.0, -44.0, 0.0, 0.0}, + { 3, 0, 0, 0, 1, 83.0, 0.0, 0.0, -43.0, 0.0, 0.0}, + {-1, 0, 2, 3, 2, 91.0, 0.0, 0.0, -39.0, 0.0, 0.0}, + + /* 221-230 */ + { 2,-1, 2, 0, 1, -77.0, 0.0, 0.0, 39.0, 0.0, 0.0}, + { 0, 1, 2, 2, 1, 84.0, 0.0, 0.0, -43.0, 0.0, 0.0}, + { 0,-1, 2, 4, 2, -92.0, 0.0, 1.0, 39.0, 0.0, 0.0}, + { 2,-1, 2, 2, 2, -92.0, 0.0, 1.0, 39.0, 0.0, 0.0}, + { 0, 2,-2, 2, 0, -94.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 2,-1, 1, 68.0, 0.0, 0.0, -36.0, 0.0, 0.0}, + { 0,-2, 0, 0, 1, -61.0, 0.0, 0.0, 32.0, 0.0, 0.0}, + { 1, 0, 2,-4, 2, 71.0, 0.0, 0.0, -31.0, 0.0, 0.0}, + { 1,-1, 0,-2, 1, 62.0, 0.0, 0.0, -34.0, 0.0, 0.0}, + {-1,-1, 2, 0, 1, -63.0, 0.0, 0.0, 33.0, 0.0, 0.0}, + + /* 231-240 */ + { 1,-1, 2,-2, 2, -73.0, 0.0, 0.0, 32.0, 0.0, 0.0}, + {-2,-1, 0, 4, 0, 115.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 0, 0, 3, 0, -103.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2,-1, 2, 2, 2, 63.0, 0.0, 0.0, -28.0, 0.0, 0.0}, + { 0, 2, 2, 0, 2, 74.0, 0.0, 0.0, -32.0, 0.0, 0.0}, + { 1, 1, 0, 2, 0, -103.0, 0.0, -3.0, 3.0, 0.0, -1.0}, + { 2, 0, 2,-1, 2, -69.0, 0.0, 0.0, 30.0, 0.0, 0.0}, + { 1, 0, 2, 1, 1, 57.0, 0.0, 0.0, -29.0, 0.0, 0.0}, + { 4, 0, 0, 0, 0, 94.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 2, 1, 2, 0, 1, 64.0, 0.0, 0.0, -33.0, 0.0, 0.0}, + + /* 241-250 */ + { 3,-1, 2, 0, 2, -63.0, 0.0, 0.0, 26.0, 0.0, 0.0}, + {-2, 2, 0, 2, 1, -38.0, 0.0, 0.0, 20.0, 0.0, 0.0}, + { 1, 0, 2,-3, 1, -43.0, 0.0, 0.0, 24.0, 0.0, 0.0}, + { 1, 1, 2,-4, 1, -45.0, 0.0, 0.0, 23.0, 0.0, 0.0}, + {-1,-1, 2,-2, 1, 47.0, 0.0, 0.0, -24.0, 0.0, 0.0}, + { 0,-1, 0,-1, 1, -48.0, 0.0, 0.0, 25.0, 0.0, 0.0}, + { 0,-1, 0,-2, 1, 45.0, 0.0, 0.0, -26.0, 0.0, 0.0}, + {-2, 0, 0, 0, 2, 56.0, 0.0, 0.0, -25.0, 0.0, 0.0}, + {-2, 0,-2, 2, 0, 88.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 0,-2, 4, 0, -75.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 251-260 */ + { 1,-2, 0, 0, 0, 85.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 0, 1, 1, 49.0, 0.0, 0.0, -26.0, 0.0, 0.0}, + {-1, 2, 0, 2, 0, -74.0, 0.0, -3.0, -1.0, 0.0, -1.0}, + { 1,-1, 2,-2, 1, -39.0, 0.0, 0.0, 21.0, 0.0, 0.0}, + { 1, 2, 2,-2, 2, 45.0, 0.0, 0.0, -20.0, 0.0, 0.0}, + { 2,-1, 2,-2, 2, 51.0, 0.0, 0.0, -22.0, 0.0, 0.0}, + { 1, 0, 2,-1, 1, -40.0, 0.0, 0.0, 21.0, 0.0, 0.0}, + { 2, 1, 2,-2, 1, 41.0, 0.0, 0.0, -21.0, 0.0, 0.0}, + {-2, 0, 0,-2, 1, -42.0, 0.0, 0.0, 24.0, 0.0, 0.0}, + { 1,-2, 2, 0, 2, -51.0, 0.0, 0.0, 22.0, 0.0, 0.0}, + + /* 261-270 */ + { 0, 1, 2, 1, 1, -42.0, 0.0, 0.0, 22.0, 0.0, 0.0}, + { 1, 0, 4,-2, 1, 39.0, 0.0, 0.0, -21.0, 0.0, 0.0}, + {-2, 0, 4, 2, 2, 46.0, 0.0, 0.0, -18.0, 0.0, 0.0}, + { 1, 1, 2, 1, 2, -53.0, 0.0, 0.0, 22.0, 0.0, 0.0}, + { 1, 0, 0, 4, 0, 82.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 1, 0, 2, 2, 0, 81.0, 0.0, -1.0, -4.0, 0.0, 0.0}, + { 2, 0, 2, 1, 2, 47.0, 0.0, 0.0, -19.0, 0.0, 0.0}, + { 3, 1, 2, 0, 2, 53.0, 0.0, 0.0, -23.0, 0.0, 0.0}, + { 4, 0, 2, 0, 1, -45.0, 0.0, 0.0, 22.0, 0.0, 0.0}, + {-2,-1, 2, 0, 0, -44.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 271-280 */ + { 0, 1,-2, 2, 1, -33.0, 0.0, 0.0, 16.0, 0.0, 0.0}, + { 1, 0,-2, 1, 0, -61.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 0,-1,-2, 2, 1, 28.0, 0.0, 0.0, -15.0, 0.0, 0.0}, + { 2,-1, 0,-2, 1, -38.0, 0.0, 0.0, 19.0, 0.0, 0.0}, + {-1, 0, 2,-1, 2, -33.0, 0.0, 0.0, 21.0, 0.0, 0.0}, + { 1, 0, 2,-3, 2, -60.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 2,-2, 3, 48.0, 0.0, 0.0, -10.0, 0.0, 0.0}, + { 0, 0, 2,-3, 1, 27.0, 0.0, 0.0, -14.0, 0.0, 0.0}, + {-1, 0,-2, 2, 1, 38.0, 0.0, 0.0, -20.0, 0.0, 0.0}, + { 0, 0, 2,-4, 2, 31.0, 0.0, 0.0, -13.0, 0.0, 0.0}, + + /* 281-290 */ + {-2, 1, 0, 0, 1, -29.0, 0.0, 0.0, 15.0, 0.0, 0.0}, + {-1, 0, 0,-1, 1, 28.0, 0.0, 0.0, -15.0, 0.0, 0.0}, + { 2, 0, 2,-4, 2, -32.0, 0.0, 0.0, 15.0, 0.0, 0.0}, + { 0, 0, 4,-4, 4, 45.0, 0.0, 0.0, -8.0, 0.0, 0.0}, + { 0, 0, 4,-4, 2, -44.0, 0.0, 0.0, 19.0, 0.0, 0.0}, + {-1,-2, 0, 2, 1, 28.0, 0.0, 0.0, -15.0, 0.0, 0.0}, + {-2, 0, 0, 3, 0, -51.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0,-2, 2, 1, -36.0, 0.0, 0.0, 20.0, 0.0, 0.0}, + {-3, 0, 2, 2, 2, 44.0, 0.0, 0.0, -19.0, 0.0, 0.0}, + {-3, 0, 2, 2, 1, 26.0, 0.0, 0.0, -14.0, 0.0, 0.0}, + + /* 291-300 */ + {-2, 0, 2, 2, 0, -60.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2,-1, 0, 0, 1, 35.0, 0.0, 0.0, -18.0, 0.0, 0.0}, + {-2, 1, 2, 2, 2, -27.0, 0.0, 0.0, 11.0, 0.0, 0.0}, + { 1, 1, 0, 1, 0, 47.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0, 1, 4,-2, 2, 36.0, 0.0, 0.0, -15.0, 0.0, 0.0}, + {-1, 1, 0,-2, 1, -36.0, 0.0, 0.0, 20.0, 0.0, 0.0}, + { 0, 0, 0,-4, 1, -35.0, 0.0, 0.0, 19.0, 0.0, 0.0}, + { 1,-1, 0, 2, 1, -37.0, 0.0, 0.0, 19.0, 0.0, 0.0}, + { 1, 1, 0, 2, 1, 32.0, 0.0, 0.0, -16.0, 0.0, 0.0}, + {-1, 2, 2, 2, 2, 35.0, 0.0, 0.0, -14.0, 0.0, 0.0}, + + /* 301-310 */ + { 3, 1, 2,-2, 2, 32.0, 0.0, 0.0, -13.0, 0.0, 0.0}, + { 0,-1, 0, 4, 0, 65.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2,-1, 0, 2, 0, 47.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0, 0, 4, 0, 1, 32.0, 0.0, 0.0, -16.0, 0.0, 0.0}, + { 2, 0, 4,-2, 2, 37.0, 0.0, 0.0, -16.0, 0.0, 0.0}, + {-1,-1, 2, 4, 1, -30.0, 0.0, 0.0, 15.0, 0.0, 0.0}, + { 1, 0, 0, 4, 1, -32.0, 0.0, 0.0, 16.0, 0.0, 0.0}, + { 1,-2, 2, 2, 2, -31.0, 0.0, 0.0, 13.0, 0.0, 0.0}, + { 0, 0, 2, 3, 2, 37.0, 0.0, 0.0, -16.0, 0.0, 0.0}, + {-1, 1, 2, 4, 2, 31.0, 0.0, 0.0, -13.0, 0.0, 0.0}, + + /* 311-320 */ + { 3, 0, 0, 2, 0, 49.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 0, 4, 2, 2, 32.0, 0.0, 0.0, -13.0, 0.0, 0.0}, + { 1, 1, 2, 2, 1, 23.0, 0.0, 0.0, -12.0, 0.0, 0.0}, + {-2, 0, 2, 6, 2, -43.0, 0.0, 0.0, 18.0, 0.0, 0.0}, + { 2, 1, 2, 2, 2, 26.0, 0.0, 0.0, -11.0, 0.0, 0.0}, + {-1, 0, 2, 6, 2, -32.0, 0.0, 0.0, 14.0, 0.0, 0.0}, + { 1, 0, 2, 4, 1, -29.0, 0.0, 0.0, 14.0, 0.0, 0.0}, + { 2, 0, 2, 4, 2, -27.0, 0.0, 0.0, 12.0, 0.0, 0.0}, + { 1, 1,-2, 1, 0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3, 1, 2, 1, 2, -11.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + + /* 321-330 */ + { 2, 0,-2, 0, 2, -21.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + {-1, 0, 0, 1, 2, -34.0, 0.0, 0.0, 15.0, 0.0, 0.0}, + {-4, 0, 2, 2, 1, -10.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + {-1,-1, 0, 1, 0, -36.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0,-2, 2, 2, -9.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 1, 0, 0,-1, 2, -12.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 0,-1, 2,-2, 3, -21.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + {-2, 1, 2, 0, 0, -29.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0, 0, 2,-2, 4, -15.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-2,-2, 0, 2, 0, -20.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 331-340 */ + {-2, 0,-2, 4, 0, 28.0, 0.0, 0.0, 0.0, 0.0, -2.0}, + { 0,-2,-2, 2, 0, 17.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 2, 0,-2, 1, -22.0, 0.0, 0.0, 12.0, 0.0, 0.0}, + { 3, 0, 0,-4, 1, -14.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + {-1, 1, 2,-2, 2, 24.0, 0.0, 0.0, -11.0, 0.0, 0.0}, + { 1,-1, 2,-4, 1, 11.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + { 1, 1, 0,-2, 2, 14.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + {-3, 0, 2, 0, 0, 24.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3, 0, 2, 0, 2, 18.0, 0.0, 0.0, -8.0, 0.0, 0.0}, + {-2, 0, 0, 1, 0, -38.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 341-350 */ + { 0, 0,-2, 1, 0, -31.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3, 0, 0, 2, 1, -16.0, 0.0, 0.0, 8.0, 0.0, 0.0}, + {-1,-1,-2, 2, 0, 29.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 2,-4, 1, -18.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + { 2, 1, 0,-4, 1, -10.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 0, 2, 0,-2, 1, -17.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + { 1, 0, 0,-3, 1, 9.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + {-2, 0, 2,-2, 2, 16.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + {-2,-1, 0, 0, 1, 22.0, 0.0, 0.0, -12.0, 0.0, 0.0}, + {-4, 0, 0, 2, 0, 20.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 351-360 */ + { 1, 1, 0,-4, 1, -13.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + {-1, 0, 2,-4, 1, -17.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + { 0, 0, 4,-4, 1, -14.0, 0.0, 0.0, 8.0, 0.0, 0.0}, + { 0, 3, 2,-2, 2, 0.0, 0.0, 0.0, -7.0, 0.0, 0.0}, + {-3,-1, 0, 4, 0, 14.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3, 0, 0, 4, 1, 19.0, 0.0, 0.0, -10.0, 0.0, 0.0}, + { 1,-1,-2, 2, 0, -34.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 0, 2, 2, -20.0, 0.0, 0.0, 8.0, 0.0, 0.0}, + { 1,-2, 0, 0, 1, 9.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + { 1,-1, 0, 0, 2, -18.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + + /* 361-370 */ + { 0, 0, 0, 1, 2, 13.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + {-1,-1, 2, 0, 0, 17.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1,-2, 2,-2, 2, -12.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 0,-1, 2,-1, 1, 15.0, 0.0, 0.0, -8.0, 0.0, 0.0}, + {-1, 0, 2, 0, 3, -11.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 1, 1, 0, 0, 2, 13.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + {-1, 1, 2, 0, 0, -18.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 2, 0, 0, 0, -35.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 2, 2, 0, 2, 9.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + {-1, 0, 4,-2, 1, -19.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + + /* 371-380 */ + { 3, 0, 2,-4, 2, -26.0, 0.0, 0.0, 11.0, 0.0, 0.0}, + { 1, 2, 2,-2, 1, 8.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 1, 0, 4,-4, 2, -10.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + {-2,-1, 0, 4, 1, 10.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + { 0,-1, 0, 2, 2, -21.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + {-2, 1, 0, 4, 0, -15.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2,-1, 2, 2, 1, 9.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + { 2, 0,-2, 2, 0, -29.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 0, 1, 1, -19.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + { 0, 1, 0, 2, 2, 12.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + + /* 381-390 */ + { 1,-1, 2,-1, 2, 22.0, 0.0, 0.0, -9.0, 0.0, 0.0}, + {-2, 0, 4, 0, 1, -10.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 2, 1, 0, 0, 1, -20.0, 0.0, 0.0, 11.0, 0.0, 0.0}, + { 0, 1, 2, 0, 0, -20.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0,-1, 4,-2, 2, -17.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + { 0, 0, 4,-2, 4, 15.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 0, 2, 2, 0, 1, 8.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + {-3, 0, 0, 6, 0, 14.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 0, 4, 1, -12.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + { 1,-2, 0, 2, 0, 25.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 391-400 */ + {-1, 0, 0, 4, 2, -13.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + {-1,-2, 2, 2, 1, -14.0, 0.0, 0.0, 8.0, 0.0, 0.0}, + {-1, 0, 0,-2, 2, 13.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + { 1, 0,-2,-2, 1, -17.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + { 0, 0,-2,-2, 1, -12.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + {-2, 0,-2, 0, 1, -10.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 0, 0, 0, 3, 1, 10.0, 0.0, 0.0, -6.0, 0.0, 0.0}, + { 0, 0, 0, 3, 0, -15.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 1, 0, 4, 0, -22.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 2, 2, 0, 28.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + + /* 401-410 */ + {-2, 0, 2, 3, 2, 15.0, 0.0, 0.0, -7.0, 0.0, 0.0}, + { 1, 0, 0, 2, 2, 23.0, 0.0, 0.0, -10.0, 0.0, 0.0}, + { 0,-1, 2, 1, 2, 12.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + { 3,-1, 0, 0, 0, 29.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 2, 0, 0, 1, 0, -25.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 1,-1, 2, 0, 0, 22.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0, 2, 1, 0, -18.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 2, 0, 3, 15.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 3, 1, 0, 0, 0, -23.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 3,-1, 2,-2, 2, 12.0, 0.0, 0.0, -5.0, 0.0, 0.0}, + + /* 411-420 */ + { 2, 0, 2,-1, 1, -8.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 1, 1, 2, 0, 0, -19.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0, 4,-1, 2, -10.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 1, 2, 2, 0, 2, 21.0, 0.0, 0.0, -9.0, 0.0, 0.0}, + {-2, 0, 0, 6, 0, 23.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0,-1, 0, 4, 1, -16.0, 0.0, 0.0, 8.0, 0.0, 0.0}, + {-2,-1, 2, 4, 1, -19.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + { 0,-2, 2, 2, 1, -22.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + { 0,-1, 2, 2, 0, 27.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-1, 0, 2, 3, 1, 16.0, 0.0, 0.0, -8.0, 0.0, 0.0}, + + /* 421-430 */ + {-2, 1, 2, 4, 2, 19.0, 0.0, 0.0, -8.0, 0.0, 0.0}, + { 2, 0, 0, 2, 2, 9.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 2,-2, 2, 0, 2, -9.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + {-1, 1, 2, 3, 2, -9.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 3, 0, 2,-1, 2, -8.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 4, 0, 2,-2, 1, 18.0, 0.0, 0.0, -9.0, 0.0, 0.0}, + {-1, 0, 0, 6, 0, 16.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-1,-2, 2, 4, 2, -10.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + {-3, 0, 2, 6, 2, -23.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + {-1, 0, 2, 4, 0, 16.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + + /* 431-440 */ + { 3, 0, 0, 2, 1, -12.0, 0.0, 0.0, 6.0, 0.0, 0.0}, + { 3,-1, 2, 0, 1, -8.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 3, 0, 2, 0, 0, 30.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 1, 0, 4, 0, 2, 24.0, 0.0, 0.0, -10.0, 0.0, 0.0}, + { 5, 0, 2,-2, 2, 10.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 0,-1, 2, 4, 1, -16.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + { 2,-1, 2, 2, 1, -16.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + { 0, 1, 2, 4, 2, 17.0, 0.0, 0.0, -7.0, 0.0, 0.0}, + { 1,-1, 2, 4, 2, -24.0, 0.0, 0.0, 10.0, 0.0, 0.0}, + { 3,-1, 2, 2, 2, -12.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + + /* 441-450 */ + { 3, 0, 2, 2, 1, -24.0, 0.0, 0.0, 11.0, 0.0, 0.0}, + { 5, 0, 2, 0, 2, -23.0, 0.0, 0.0, 9.0, 0.0, 0.0}, + { 0, 0, 2, 6, 2, -13.0, 0.0, 0.0, 5.0, 0.0, 0.0}, + { 4, 0, 2, 2, 2, -15.0, 0.0, 0.0, 7.0, 0.0, 0.0}, + { 0,-1, 1,-1, 1, 0.0, 0.0,-1988.0, 0.0, 0.0,-1679.0}, + {-1, 0, 1, 0, 3, 0.0, 0.0, -63.0, 0.0, 0.0, -27.0}, + { 0,-2, 2,-2, 3, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0,-1, 0, 1, 0.0, 0.0, 5.0, 0.0, 0.0, 4.0}, + { 2,-2, 0,-2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-1, 0, 1, 0, 2, 0.0, 0.0, 364.0, 0.0, 0.0, 176.0}, + + /* 451-460 */ + {-1, 0, 1, 0, 1, 0.0, 0.0,-1044.0, 0.0, 0.0, -891.0}, + {-1,-1, 2,-1, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-2, 2, 0, 2, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 0, 1, 0, 0, 0.0, 0.0, 330.0, 0.0, 0.0, 0.0}, + {-4, 1, 2, 2, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-3, 0, 2, 1, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-2,-1, 2, 0, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 1, 0,-2, 1, 1, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2,-1,-2, 0, 1, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-4, 0, 2, 2, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 461-470 */ + {-3, 1, 0, 3, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 0,-1, 2, 0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0}, + { 0,-2, 0, 0, 2, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 0,-2, 0, 0, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-3, 0, 0, 3, 0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2,-1, 0, 2, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 0,-2, 3, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-4, 0, 0, 4, 0, -12.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 1,-2, 0, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 2,-1, 0,-2, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + + /* 471-480 */ + { 0, 0, 1,-1, 0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 2, 0, 1, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 1, 2, 0, 2, -7.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 1, 1, 0,-1, 1, 7.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 1, 0, 1,-2, 1, 0.0, 0.0, -12.0, 0.0, 0.0, -10.0}, + { 0, 2, 0, 0, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 1,-1, 2,-3, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 1, 2,-1, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2, 0, 4,-2, 2, -7.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-2, 0, 4,-2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + + /* 481-490 */ + {-2,-2, 0, 2, 1, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-2, 0,-2, 4, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 2, 2,-4, 1, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 1, 1, 2,-4, 2, 7.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-1, 2, 2,-2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2, 0, 0,-3, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 2, 0, 0, 1, -5.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 0, 0, 0,-2, 0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 2,-2, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 1, 0, 0, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 491-500 */ + { 0, 0, 0,-1, 2, -8.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-2, 1, 0, 1, 0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1,-2, 0,-2, 1, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 1, 0,-2, 0, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-3, 1, 0, 2, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 1,-2, 2, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 0, 0, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-3, 0, 0, 2, 0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3,-1, 0, 2, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 0, 2,-6, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + + /* 501-510 */ + { 0, 1, 2,-4, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 0, 0,-4, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-2, 1, 2,-2, 1, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0,-1, 2,-4, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 0, 1, 0,-2, 2, 9.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-1, 0, 0,-2, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 0,-2,-2, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-4, 0, 2, 0, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1,-1, 0,-1, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0,-2, 0, 2, 9.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + + /* 511-520 */ + {-3, 0, 0, 1, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 0,-2, 1, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 0,-2, 2, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 0, 0,-4, 2, 0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2,-1,-2, 2, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 2,-6, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 0, 2,-4, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 1, 0, 0,-4, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 2, 1, 2,-4, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 2, 1, 2,-4, 1, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + + /* 521-530 */ + { 0, 1, 4,-4, 4, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 4,-4, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-1,-1,-2, 4, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-3, 0, 2, 0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 0,-2, 4, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2,-1, 0, 3, 0, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0,-2, 3, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 0, 0, 3, 1, -5.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 0,-1, 0, 1, 0, -13.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3, 0, 2, 2, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 531-540 */ + { 1, 1,-2, 2, 0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 1, 0, 2, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 1,-2, 2,-2, 1, 10.0, 0.0, 13.0, 6.0, 0.0, -5.0}, + { 0, 0, 1, 0, 2, 0.0, 0.0, 30.0, 0.0, 0.0, 14.0}, + { 0, 0, 1, 0, 1, 0.0, 0.0, -162.0, 0.0, 0.0, -138.0}, + { 0, 0, 1, 0, 0, 0.0, 0.0, 75.0, 0.0, 0.0, 0.0}, + {-1, 2, 0, 2, 1, -7.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + { 0, 0, 2, 0, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2, 0, 2, 0, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 0, 0,-1, 1, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 541-550 */ + { 3, 0, 0,-2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 1, 0, 2,-2, 3, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 2, 0, 0, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2, 0, 2,-3, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 1, 4,-2, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2,-2, 0, 4, 0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0,-3, 0, 2, 0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0,-2, 4, 0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 0, 3, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 0, 0, 4, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + + /* 551-560 */ + {-1, 0, 0, 3, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2,-2, 0, 0, 0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1,-1, 0, 1, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 0, 0, 2, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0,-2, 2, 0, 1, -6.0, 0.0, -3.0, 3.0, 0.0, 1.0}, + {-1, 0, 1, 2, 1, 0.0, 0.0, -3.0, 0.0, 0.0, -2.0}, + {-1, 1, 0, 3, 0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-1, 2, 1, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0,-1, 2, 0, 0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 1, 2, 2, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + + /* 561-570 */ + { 2,-2, 2,-2, 2, -1.0, 0.0, 3.0, 3.0, 0.0, -1.0}, + { 1, 1, 0, 1, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 1, 0, 1, 0, 1, 0.0, 0.0, -13.0, 0.0, 0.0, -11.0}, + { 1, 0, 1, 0, 0, 3.0, 0.0, 6.0, 0.0, 0.0, 0.0}, + { 0, 2, 0, 2, 0, -7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2,-1, 2,-2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 0,-1, 4,-2, 1, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 0, 0, 4,-2, 3, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 4,-2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 4, 0, 2,-4, 2, -7.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + + /* 571-580 */ + { 2, 2, 2,-2, 2, 8.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 2, 0, 4,-4, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1,-2, 0, 4, 0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1,-3, 2, 2, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-3, 0, 2, 4, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-3, 0, 2,-2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1,-1, 0,-2, 1, 8.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + {-3, 0, 0, 0, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-3, 0,-2, 2, 0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 0,-4, 1, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + + /* 581-590 */ + {-2, 1, 0,-2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-4, 0, 0, 0, 1, -8.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + {-1, 0, 0,-4, 1, -7.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-3, 0, 0,-2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 0, 3, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-1, 1, 0, 4, 1, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 1,-2, 2, 0, 1, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 0, 1, 0, 3, 0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-1, 0, 2, 2, 3, 6.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 0, 0, 2, 2, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 591-600 */ + {-2, 0, 2, 2, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 1, 2, 2, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 3, 0, 0, 0, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2, 1, 0, 1, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2,-1, 2,-1, 2, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 0, 0, 2, 0, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 3, 0, 3, 0.0, 0.0, -26.0, 0.0, 0.0, -11.0}, + { 0, 0, 3, 0, 2, 0.0, 0.0, -10.0, 0.0, 0.0, -5.0}, + {-1, 2, 2, 2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-1, 0, 4, 0, 0, -13.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 601-610 */ + { 1, 2, 2, 0, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 3, 1, 2,-2, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 1, 1, 4,-2, 2, 7.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-2,-1, 0, 6, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0,-2, 0, 4, 0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-2, 0, 0, 6, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2,-2, 2, 4, 2, -6.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0,-3, 2, 2, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 0, 4, 2, -7.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-1,-1, 2, 3, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 611-620 */ + {-2, 0, 2, 4, 0, 13.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2,-1, 0, 2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 1, 0, 0, 3, 0, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 0, 4, 1, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 0, 1, 0, 4, 0, -11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1,-1, 2, 1, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 0, 0, 2, 2, 3, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 2, 2, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-1, 0, 2, 2, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-2, 0, 4, 2, 1, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + + /* 621-630 */ + { 2, 1, 0, 2, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 1, 0, 2, 0, -12.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2,-1, 2, 0, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 2, 1, 0, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 1, 2, 2, 0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 0, 2, 0, 3, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 3, 0, 2, 0, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 1, 0, 2, 0, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 1, 0, 3, 0, 3, 0.0, 0.0, -5.0, 0.0, 0.0, -2.0}, + { 1, 1, 2, 1, 1, -7.0, 0.0, 0.0, 4.0, 0.0, 0.0}, + + /* 631-640 */ + { 0, 2, 2, 2, 2, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 2, 1, 2, 0, 0, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 0, 4,-2, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 4, 1, 2,-2, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + {-1,-1, 0, 6, 0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {-3,-1, 2, 6, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + {-1, 0, 0, 6, 1, -5.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-3, 0, 2, 6, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 1,-1, 0, 4, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 1,-1, 0, 4, 0, 12.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 641-650 */ + {-2, 0, 2, 5, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 1,-2, 2, 2, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 3,-1, 0, 2, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1,-1, 2, 2, 0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0, 2, 3, 1, 5.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + {-1, 1, 2, 4, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 0, 1, 2, 3, 2, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-1, 0, 4, 2, 1, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 0, 2, 1, 1, 6.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 5, 0, 0, 0, 0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 651-660 */ + { 2, 1, 2, 1, 2, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 1, 0, 4, 0, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 3, 1, 2, 0, 1, 7.0, 0.0, 0.0, -4.0, 0.0, 0.0}, + { 3, 0, 4,-2, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + {-2,-1, 2, 6, 2, -5.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 0, 6, 0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0,-2, 2, 4, 2, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + {-2, 0, 2, 6, 1, -6.0, 0.0, 0.0, 3.0, 0.0, 0.0}, + { 2, 0, 0, 4, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 2, 0, 0, 4, 0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + + /* 661-670 */ + { 2,-2, 2, 2, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 0, 0, 2, 4, 0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 1, 0, 2, 3, 2, 7.0, 0.0, 0.0, -3.0, 0.0, 0.0}, + { 4, 0, 0, 2, 0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 2, 0, 2, 2, 0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0, 0, 4, 2, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 4,-1, 2, 0, 2, -6.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 3, 0, 2, 1, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 2, 1, 2, 2, 1, 3.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 4, 1, 2, 0, 2, 5.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + + /* 671-678 */ + {-1,-1, 2, 6, 2, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + {-1, 0, 2, 6, 1, -4.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 1,-1, 2, 4, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0}, + { 1, 1, 2, 4, 2, 4.0, 0.0, 0.0, -2.0, 0.0, 0.0}, + { 3, 1, 2, 2, 2, 3.0, 0.0, 0.0, -1.0, 0.0, 0.0}, + { 5, 0, 2, 0, 1, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 2,-1, 2, 4, 2, -3.0, 0.0, 0.0, 1.0, 0.0, 0.0}, + { 2, 0, 2, 4, 1, -3.0, 0.0, 0.0, 2.0, 0.0, 0.0} + }; + +/* Number of terms in the luni-solar nutation model */ + const int NLS = (int) (sizeof xls / sizeof xls[0]); + +/* ------------------------ */ +/* Planetary nutation model */ +/* ------------------------ */ + +/* The units for the sine and cosine coefficients are */ +/* 0.1 microarcsecond */ + + static const struct { + int nl, /* coefficients of l, F, D and Omega */ + nf, + nd, + nom, + nme, /* coefficients of planetary longitudes */ + nve, + nea, + nma, + nju, + nsa, + nur, + nne, + npa; /* coefficient of general precession */ + int sp,cp; /* longitude sin, cos coefficients */ + int se,ce; /* obliquity sin, cos coefficients */ + } xpl[] = { + + /* 1-10 */ + { 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 0, 1440, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, -8, 16,-4,-5, 0, 0, 2, 56,-117, -42, -40}, + { 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 2, 125, -43, 0, -54}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 2, 2, 0, 5, 0, 0}, + { 0, 0, 0, 0, 0, 0, -4, 8,-1,-5, 0, 0, 2, 3, -7, -3, 0}, + { 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 1, 3, 0, 0, -2}, + { 0, 1,-1, 1, 0, 0, 3, -8, 3, 0, 0, 0, 0, -114, 0, 0, 61}, + {-1, 0, 0, 0, 0, 10, -3, 0, 0, 0, 0, 0, 0, -219, 89, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0,-2, 6,-3, 0, 2, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, -462,1604, 0, 0}, + + /* 11-20 */ + { 0, 1,-1, 1, 0, 0, -5, 8,-3, 0, 0, 0, 0, 99, 0, 0, -53}, + { 0, 0, 0, 0, 0, 0, -4, 8,-3, 0, 0, 0, 1, -3, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 4, -8, 1, 5, 0, 0, 2, 0, 6, 2, 0}, + { 0, 0, 0, 0, 0, -5, 6, 4, 0, 0, 0, 0, 2, 3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2,-5, 0, 0, 2, -12, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2,-5, 0, 0, 1, 14,-218, 117, 8}, + { 0, 1,-1, 1, 0, 0, -1, 0, 2,-5, 0, 0, 0, 31,-481, -257, -17}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2,-5, 0, 0, 0, -491, 128, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0,-2, 5, 0, 0, 0,-3084,5123, 2735,1647}, + { 0, 0, 0, 0, 0, 0, 0, 0,-2, 5, 0, 0, 1,-1444,2409,-1286,-771}, + + /* 21-30 */ + { 0, 0, 0, 0, 0, 0, 0, 0,-2, 5, 0, 0, 2, 11, -24, -11, -9}, + { 2,-1,-1, 0, 0, 0, 3, -7, 0, 0, 0, 0, 0, 26, -9, 0, 0}, + { 1, 0,-2, 0, 0, 19,-21, 3, 0, 0, 0, 0, 0, 103, -60, 0, 0}, + { 0, 1,-1, 1, 0, 2, -4, 0,-3, 0, 0, 0, 0, 0, -13, -7, 0}, + { 1, 0,-1, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0, -26, -29, -16, 14}, + { 0, 1,-1, 1, 0, 0, -1, 0,-4,10, 0, 0, 0, 9, -27, -14, -5}, + {-2, 0, 2, 1, 0, 0, 2, 0, 0,-5, 0, 0, 0, 12, 0, 0, -6}, + { 0, 0, 0, 0, 0, 3, -7, 4, 0, 0, 0, 0, 0, -7, 0, 0, 0}, + { 0,-1, 1, 0, 0, 0, 1, 0, 1,-1, 0, 0, 0, 0, 24, 0, 0}, + {-2, 0, 2, 1, 0, 0, 2, 0,-2, 0, 0, 0, 0, 284, 0, 0,-151}, + + /* 31-40 */ + {-1, 0, 0, 0, 0, 18,-16, 0, 0, 0, 0, 0, 0, 226, 101, 0, 0}, + {-2, 1, 1, 2, 0, 0, 1, 0,-2, 0, 0, 0, 0, 0, -8, -2, 0}, + {-1, 1,-1, 1, 0, 18,-17, 0, 0, 0, 0, 0, 0, 0, -6, -3, 0}, + {-1, 0, 1, 1, 0, 0, 2, -2, 0, 0, 0, 0, 0, 5, 0, 0, -3}, + { 0, 0, 0, 0, 0, -8, 13, 0, 0, 0, 0, 0, 2, -41, 175, 76, 17}, + { 0, 2,-2, 2, 0, -8, 11, 0, 0, 0, 0, 0, 0, 0, 15, 6, 0}, + { 0, 0, 0, 0, 0, -8, 13, 0, 0, 0, 0, 0, 1, 425, 212, -133, 269}, + { 0, 1,-1, 1, 0, -8, 12, 0, 0, 0, 0, 0, 0, 1200, 598, 319,-641}, + { 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, 0, 235, 334, 0, 0}, + { 0, 1,-1, 1, 0, 8,-14, 0, 0, 0, 0, 0, 0, 11, -12, -7, -6}, + + /* 41-50 */ + { 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, 1, 5, -6, 3, 3}, + {-2, 0, 2, 1, 0, 0, 2, 0,-4, 5, 0, 0, 0, -5, 0, 0, 3}, + {-2, 0, 2, 2, 0, 3, -3, 0, 0, 0, 0, 0, 0, 6, 0, 0, -3}, + {-2, 0, 2, 0, 0, 0, 2, 0,-3, 1, 0, 0, 0, 15, 0, 0, 0}, + { 0, 0, 0, 1, 0, 3, -5, 0, 2, 0, 0, 0, 0, 13, 0, 0, -7}, + {-2, 0, 2, 0, 0, 0, 2, 0,-4, 3, 0, 0, 0, -6, -9, 0, 0}, + { 0,-1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 266, -78, 0, 0}, + { 0, 0, 0, 1, 0, 0, -1, 2, 0, 0, 0, 0, 0, -460,-435, -232, 246}, + { 0, 1,-1, 2, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0, 15, 7, 0}, + {-1, 1, 0, 1, 0, 3, -5, 0, 0, 0, 0, 0, 0, -3, 0, 0, 2}, + + /* 51-60 */ + {-1, 0, 1, 0, 0, 3, -4, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0}, + {-2, 0, 2, 0, 0, 0, 2, 0,-2,-2, 0, 0, 0, 4, 0, 0, 0}, + {-2, 2, 0, 2, 0, 0, -5, 9, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 0,-1, 0, 0, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 0, 0, 2, 0, -17, -19, -10, 9}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, -9, -11, 6, -5}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, -6, 0, 0, 3}, + {-1, 0, 1, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, -16, 8, 0, 0}, + { 0,-1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0}, + + /* 61-70 */ + { 0, 1,-1, 2, 0, 0, -1, 0, 0, 2, 0, 0, 0, 11, 24, 11, -5}, + { 0, 0, 0, 1, 0, 0, -9, 17, 0, 0, 0, 0, 0, -3, -4, -2, 1}, + { 0, 0, 0, 2, 0, -3, 5, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 1,-1, 1, 0, 0, -1, 0,-1, 2, 0, 0, 0, 0, -8, -4, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 1,-2, 0, 0, 0, 0, 3, 0, 0}, + { 1, 0,-2, 0, 0, 17,-16, 0,-2, 0, 0, 0, 0, 0, 5, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0, 1,-3, 0, 0, 0, 0, 3, 2, 0}, + {-2, 0, 2, 1, 0, 0, 5, -6, 0, 0, 0, 0, 0, -6, 4, 2, 3}, + { 0,-2, 2, 0, 0, 0, 9,-13, 0, 0, 0, 0, 0, -3, -5, 0, 0}, + { 0, 1,-1, 2, 0, 0, -1, 0, 0, 1, 0, 0, 0, -5, 0, 0, 2}, + + /* 71-80 */ + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 24, 13, -2}, + { 0,-1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, -42, 20, 0, 0}, + { 0,-2, 2, 0, 0, 5, -6, 0, 0, 0, 0, 0, 0, -10, 233, 0, 0}, + { 0,-1, 1, 1, 0, 5, -7, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + {-2, 0, 2, 0, 0, 6, -8, 0, 0, 0, 0, 0, 0, 78, -18, 0, 0}, + { 2, 1,-3, 1, 0, -6, 7, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -3, -1, 0}, + { 0,-1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -4, -2, 1}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 0, 2, 0, 0, 0, -8, -4, -1}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, -5, 3, 0}, + + /* 81-90 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, -7, 0, 0, 3}, + { 0, 0, 0, 0, 0, 0, -8, 15, 0, 0, 0, 0, 2, -14, 8, 3, 6}, + { 0, 0, 0, 0, 0, 0, -8, 15, 0, 0, 0, 0, 1, 0, 8, -4, 0}, + { 0, 1,-1, 1, 0, 0, -9, 15, 0, 0, 0, 0, 0, 0, 19, 10, 0}, + { 0, 0, 0, 0, 0, 0, 8,-15, 0, 0, 0, 0, 0, 45, -22, 0, 0}, + { 1,-1,-1, 0, 0, 0, 8,-15, 0, 0, 0, 0, 0, -3, 0, 0, 0}, + { 2, 0,-2, 0, 0, 2, -5, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0}, + {-2, 0, 2, 0, 0, 0, 2, 0,-5, 5, 0, 0, 0, 0, 3, 0, 0}, + { 2, 0,-2, 1, 0, 0, -6, 8, 0, 0, 0, 0, 0, 3, 5, 3, -2}, + { 2, 0,-2, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0, 89, -16, -9, -48}, + + /* 91-100 */ + {-2, 1, 1, 0, 0, 0, 1, 0,-3, 0, 0, 0, 0, 0, 3, 0, 0}, + {-2, 1, 1, 1, 0, 0, 1, 0,-3, 0, 0, 0, 0, -3, 7, 4, 2}, + {-2, 0, 2, 0, 0, 0, 2, 0,-3, 0, 0, 0, 0, -349, -62, 0, 0}, + {-2, 0, 2, 0, 0, 0, 6, -8, 0, 0, 0, 0, 0, -15, 22, 0, 0}, + {-2, 0, 2, 0, 0, 0, 2, 0,-1,-5, 0, 0, 0, -3, 0, 0, 0}, + {-1, 0, 1, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, -53, 0, 0, 0}, + {-1, 1, 1, 1, 0,-20, 20, 0, 0, 0, 0, 0, 0, 5, 0, 0, -3}, + { 1, 0,-2, 0, 0, 20,-21, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0}, + { 0, 0, 0, 1, 0, 0, 8,-15, 0, 0, 0, 0, 0, 15, -7, -4, -8}, + { 0, 2,-2, 1, 0, 0,-10, 15, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + + /* 101-110 */ + { 0,-1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, -21, -78, 0, 0}, + { 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 20, -70, -37, -11}, + { 0, 1,-1, 2, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 6, 3, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0,-2, 4, 0, 0, 0, 5, 3, 2, -2}, + { 2, 0,-2, 1, 0, -6, 8, 0, 0, 0, 0, 0, 0, -17, -4, -2, 9}, + { 0,-2, 2, 1, 0, 5, -6, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0, 0, 1, 32, 15, -8, 17}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0,-1, 0, 0, 0, 174, 84, 45, -93}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 56, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 1, 0, 0, 0, -66, -12, -6, 35}, + + /* 111-120 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 47, 8, 4, -25}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 8, 4, 0}, + { 0, 2,-2, 1, 0, 0, -9, 13, 0, 0, 0, 0, 0, 10, -22, -12, -5}, + { 0, 0, 0, 1, 0, 0, 7,-13, 0, 0, 0, 0, 0, -3, 0, 0, 2}, + {-2, 0, 2, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, -24, 12, 0, 0}, + { 0, 0, 0, 0, 0, 0, 9,-17, 0, 0, 0, 0, 0, 5, -6, 0, 0}, + { 0, 0, 0, 0, 0, 0, -9, 17, 0, 0, 0, 0, 2, 3, 0, 0, -2}, + { 1, 0,-1, 1, 0, 0, -3, 4, 0, 0, 0, 0, 0, 4, 3, 1, -2}, + { 1, 0,-1, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0, 0, 29, 15, 0}, + { 0, 0, 0, 2, 0, 0, -1, 2, 0, 0, 0, 0, 0, -5, -4, -2, 2}, + + /* 121-130 */ + { 0,-1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 8, -3, -1, -5}, + { 0,-2, 2, 0, 1, 0, -2, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0}, + { 0, 0, 0, 0, 0, 3, -5, 0, 2, 0, 0, 0, 0, 10, 0, 0, 0}, + {-2, 0, 2, 1, 0, 0, 2, 0,-3, 1, 0, 0, 0, 3, 0, 0, -2}, + {-2, 0, 2, 1, 0, 3, -3, 0, 0, 0, 0, 0, 0, -5, 0, 0, 3}, + { 0, 0, 0, 1, 0, 8,-13, 0, 0, 0, 0, 0, 0, 46, 66, 35, -25}, + { 0,-1, 1, 0, 0, 8,-12, 0, 0, 0, 0, 0, 0, -14, 7, 0, 0}, + { 0, 2,-2, 1, 0, -8, 11, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0}, + {-1, 0, 1, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, -5, 0, 0, 0}, + {-1, 0, 0, 1, 0, 18,-16, 0, 0, 0, 0, 0, 0, -68, -34, -18, 36}, + + /* 131-140 */ + { 0, 1,-1, 1, 0, 0, -1, 0,-1, 1, 0, 0, 0, 0, 14, 7, 0}, + { 0, 0, 0, 1, 0, 3, -7, 4, 0, 0, 0, 0, 0, 10, -6, -3, -5}, + {-2, 1, 1, 1, 0, 0, -3, 7, 0, 0, 0, 0, 0, -5, -4, -2, 3}, + { 0, 1,-1, 2, 0, 0, -1, 0,-2, 5, 0, 0, 0, -3, 5, 2, 1}, + { 0, 0, 0, 1, 0, 0, 0, 0,-2, 5, 0, 0, 0, 76, 17, 9, -41}, + { 0, 0, 0, 1, 0, 0, -4, 8,-3, 0, 0, 0, 0, 84, 298, 159, -45}, + { 1, 0, 0, 1, 0,-10, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 2,-2, 1, 0, 0, -2, 0, 0, 0, 0, 0, 0, -3, 0, 0, 2}, + {-1, 0, 0, 1, 0, 10, -3, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + { 0, 0, 0, 1, 0, 0, 4, -8, 3, 0, 0, 0, 0, -82, 292, 156, 44}, + + /* 141-150 */ + { 0, 0, 0, 1, 0, 0, 0, 0, 2,-5, 0, 0, 0, -73, 17, 9, 39}, + { 0,-1, 1, 0, 0, 0, 1, 0, 2,-5, 0, 0, 0, -9, -16, 0, 0}, + { 2,-1,-1, 1, 0, 0, 3, -7, 0, 0, 0, 0, 0, 3, 0, -1, -2}, + {-2, 0, 2, 0, 0, 0, 2, 0, 0,-5, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 1, 0, -3, 7, -4, 0, 0, 0, 0, 0, -9, -5, -3, 5}, + {-2, 0, 2, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, -439, 0, 0, 0}, + { 1, 0, 0, 1, 0,-18, 16, 0, 0, 0, 0, 0, 0, 57, -28, -15, -30}, + {-2, 1, 1, 1, 0, 0, 1, 0,-2, 0, 0, 0, 0, 0, -6, -3, 0}, + { 0, 1,-1, 2, 0, -8, 12, 0, 0, 0, 0, 0, 0, -4, 0, 0, 2}, + { 0, 0, 0, 1, 0, -8, 13, 0, 0, 0, 0, 0, 0, -40, 57, 30, 21}, + + /* 151-160 */ + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 1, 23, 7, 3, -13}, + { 0, 1,-1, 1, 0, 0, 0, -2, 0, 0, 0, 0, 0, 273, 80, 43,-146}, + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, -449, 430, 0, 0}, + { 0, 1,-1, 1, 0, 0, -2, 2, 0, 0, 0, 0, 0, -8, -47, -25, 4}, + { 0, 0, 0, 0, 0, 0, -1, 2, 0, 0, 0, 0, 1, 6, 47, 25, -3}, + {-1, 0, 1, 1, 0, 3, -4, 0, 0, 0, 0, 0, 0, 0, 23, 13, 0}, + {-1, 0, 1, 1, 0, 0, 3, -4, 0, 0, 0, 0, 0, -3, 0, 0, 2}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0,-2, 0, 0, 0, 3, -4, -2, -2}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 2, 0, 0, 0, -48,-110, -59, 26}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 51, 114, 61, -27}, + + /* 161-170 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, -133, 0, 0, 57}, + { 0, 1,-1, 0, 0, 3, -6, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + { 0, 0, 0, 1, 0, -3, 5, 0, 0, 0, 0, 0, 0, -21, -6, -3, 11}, + { 0, 1,-1, 2, 0, -3, 4, 0, 0, 0, 0, 0, 0, 0, -3, -1, 0}, + { 0, 0, 0, 1, 0, 0, -2, 4, 0, 0, 0, 0, 0, -11, -21, -11, 6}, + { 0, 2,-2, 1, 0, -5, 6, 0, 0, 0, 0, 0, 0, -18,-436, -233, 9}, + { 0,-1, 1, 0, 0, 5, -7, 0, 0, 0, 0, 0, 0, 35, -7, 0, 0}, + { 0, 0, 0, 1, 0, 5, -8, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0}, + {-2, 0, 2, 1, 0, 6, -8, 0, 0, 0, 0, 0, 0, 11, -3, -1, -6}, + { 0, 0, 0, 1, 0, 0, -8, 15, 0, 0, 0, 0, 0, -5, -3, -1, 3}, + + /* 171-180 */ + {-2, 0, 2, 1, 0, 0, 2, 0,-3, 0, 0, 0, 0, -53, -9, -5, 28}, + {-2, 0, 2, 1, 0, 0, 6, -8, 0, 0, 0, 0, 0, 0, 3, 2, 1}, + { 1, 0,-1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 4, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 0, 0, 3,-5, 0, 0, 0, 0, -4, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0,-1, 0, 0, 0, 0, -50, 194, 103, 27}, + { 0, 0, 0, 0, 0, 0, 0, 0,-1, 0, 0, 0, 1, -13, 52, 28, 7}, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -91, 248, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 6, 49, 26, -3}, + { 0, 1,-1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, -6, -47, -25, 3}, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, 3, 0}, + + /* 181-190 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 52, 23, 10, -23}, + { 0, 1,-1, 2, 0, 0, -1, 0, 0,-1, 0, 0, 0, -3, 0, 0, 1}, + { 0, 0, 0, 1, 0, 0, 0, 0, 0,-1, 0, 0, 0, 0, 5, 3, 0}, + { 0,-1, 1, 0, 0, 0, 1, 0, 0,-1, 0, 0, 0, -4, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, -7, 13, 0, 0, 0, 0, 2, -4, 8, 3, 2}, + { 0, 0, 0, 0, 0, 0, 7,-13, 0, 0, 0, 0, 0, 10, 0, 0, 0}, + { 2, 0,-2, 1, 0, 0, -5, 6, 0, 0, 0, 0, 0, 3, 0, 0, -2}, + { 0, 2,-2, 1, 0, 0, -8, 11, 0, 0, 0, 0, 0, 0, 8, 4, 0}, + { 0, 2,-2, 1,-1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 8, 4, 1}, + {-2, 0, 2, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, -4, 0, 0, 0}, + + /* 191-200 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, -4, 0, 0, 0}, + { 0, 1,-1, 1, 0, 0, -1, 0, 0, 3, 0, 0, 0, -8, 4, 2, 4}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 8, -4, -2, -4}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 15, 7, 0}, + {-2, 0, 2, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0, -138, 0, 0, 0}, + { 0, 0, 0, 2, 0, 0, -4, 8,-3, 0, 0, 0, 0, 0, -7, -3, 0}, + { 0, 0, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, -7, -3, 0}, + { 2, 0,-2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0, 54, 0, 0, -29}, + { 0, 1,-1, 2, 0, 0, -1, 0, 2, 0, 0, 0, 0, 0, 10, 4, 0}, + { 0, 1,-1, 2, 0, 0, 0, -2, 0, 0, 0, 0, 0, -7, 0, 0, 3}, + + /* 201-210 */ + { 0, 0, 0, 1, 0, 0, 1, -2, 0, 0, 0, 0, 0, -37, 35, 19, 20}, + { 0,-1, 1, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + { 0,-1, 1, 0, 0, 0, 1, 0, 0,-2, 0, 0, 0, -4, 9, 0, 0}, + { 0, 2,-2, 1, 0, 0, -2, 0, 0, 2, 0, 0, 0, 8, 0, 0, -4}, + { 0, 1,-1, 1, 0, 3, -6, 0, 0, 0, 0, 0, 0, -9, -14, -8, 5}, + { 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, 1, -3, -9, -5, 3}, + { 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, 0, -145, 47, 0, 0}, + { 0, 1,-1, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0, -10, 40, 21, 5}, + { 0, 0, 0, 0, 0, -3, 5, 0, 0, 0, 0, 0, 1, 11, -49, -26, -7}, + { 0, 0, 0, 0, 0, -3, 5, 0, 0, 0, 0, 0, 2,-2150, 0, 0, 932}, + + /* 211-220 */ + { 0, 2,-2, 2, 0, -3, 3, 0, 0, 0, 0, 0, 0, -12, 0, 0, 5}, + { 0, 0, 0, 0, 0, -3, 5, 0, 0, 0, 0, 0, 2, 85, 0, 0, -37}, + { 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 1, 4, 0, 0, -2}, + { 0, 1,-1, 1, 0, 0, 1, -4, 0, 0, 0, 0, 0, 3, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0, -86, 153, 0, 0}, + { 0, 0, 0, 0, 0, 0, -2, 4, 0, 0, 0, 0, 1, -6, 9, 5, 3}, + { 0, 1,-1, 1, 0, 0, -3, 4, 0, 0, 0, 0, 0, 9, -13, -7, -5}, + { 0, 0, 0, 0, 0, 0, -2, 4, 0, 0, 0, 0, 1, -8, 12, 6, 4}, + { 0, 0, 0, 0, 0, 0, -2, 4, 0, 0, 0, 0, 2, -51, 0, 0, 22}, + { 0, 0, 0, 0, 0, -5, 8, 0, 0, 0, 0, 0, 2, -11,-268, -116, 5}, + + /* 221-230 */ + { 0, 2,-2, 2, 0, -5, 6, 0, 0, 0, 0, 0, 0, 0, 12, 5, 0}, + { 0, 0, 0, 0, 0, -5, 8, 0, 0, 0, 0, 0, 2, 0, 7, 3, 0}, + { 0, 0, 0, 0, 0, -5, 8, 0, 0, 0, 0, 0, 1, 31, 6, 3, -17}, + { 0, 1,-1, 1, 0, -5, 7, 0, 0, 0, 0, 0, 0, 140, 27, 14, -75}, + { 0, 0, 0, 0, 0, -5, 8, 0, 0, 0, 0, 0, 1, 57, 11, 6, -30}, + { 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0, 0, -14, -39, 0, 0}, + { 0, 1,-1, 2, 0, 0, -1, 0,-1, 0, 0, 0, 0, 0, -6, -2, 0}, + { 0, 0, 0, 1, 0, 0, 0, 0,-1, 0, 0, 0, 0, 4, 15, 8, -2}, + { 0,-1, 1, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 0, 4, 0, 0}, + { 0, 2,-2, 1, 0, 0, -2, 0, 1, 0, 0, 0, 0, -3, 0, 0, 1}, + + /* 231-240 */ + { 0, 0, 0, 0, 0, 0, -6, 11, 0, 0, 0, 0, 2, 0, 11, 5, 0}, + { 0, 0, 0, 0, 0, 0, 6,-11, 0, 0, 0, 0, 0, 9, 6, 0, 0}, + { 0, 0, 0, 0,-1, 0, 4, 0, 0, 0, 0, 0, 2, -4, 10, 4, 2}, + { 0, 0, 0, 0, 1, 0, -4, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0}, + { 2, 0,-2, 1, 0, -3, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, -9}, + {-2, 0, 2, 0, 0, 0, 2, 0, 0,-2, 0, 0, 0, -3, 0, 0, 0}, + { 0, 2,-2, 1, 0, 0, -7, 9, 0, 0, 0, 0, 0, 0, 3, 2, -1}, + { 0, 0, 0, 0, 0, 0, 0, 0, 4,-5, 0, 0, 2, 7, 0, 0, -3}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, -25, 22, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 42, 223, 119, -22}, + + /* 241-250 */ + { 0, 1,-1, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0, -27,-143, -77, 14}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 9, 49, 26, -5}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2,-1166, 0, 0, 505}, + { 0, 2,-2, 2, 0, 0, -2, 0, 2, 0, 0, 0, 0, -5, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2, -6, 0, 0, 3}, + { 0, 0, 0, 1, 0, 3, -5, 0, 0, 0, 0, 0, 0, -8, 0, 1, 4}, + { 0,-1, 1, 0, 0, 3, -4, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0}, + { 0, 2,-2, 1, 0, -3, 3, 0, 0, 0, 0, 0, 0, 117, 0, 0, -63}, + { 0, 0, 0, 1, 0, 0, 2, -4, 0, 0, 0, 0, 0, -4, 8, 4, 2}, + { 0, 2,-2, 1, 0, 0, -4, 4, 0, 0, 0, 0, 0, 3, 0, 0, -2}, + + /* 251-260 */ + { 0, 1,-1, 2, 0, -5, 7, 0, 0, 0, 0, 0, 0, -5, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0, 0, 31, 0, 0}, + { 0, 0, 0, 0, 0, 0, -3, 6, 0, 0, 0, 0, 1, -5, 0, 1, 3}, + { 0, 1,-1, 1, 0, 0, -4, 6, 0, 0, 0, 0, 0, 4, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, -3, 6, 0, 0, 0, 0, 1, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, -3, 6, 0, 0, 0, 0, 2, -24, -13, -6, 10}, + { 0,-1, 1, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0}, + { 0, 0, 0, 1, 0, 2, -3, 0, 0, 0, 0, 0, 0, 0, -32, -17, 0}, + { 0, 0, 0, 0, 0, 0, -5, 9, 0, 0, 0, 0, 2, 8, 12, 5, -3}, + { 0, 0, 0, 0, 0, 0, -5, 9, 0, 0, 0, 0, 1, 3, 0, 0, -1}, + + /* 261-270 */ + { 0, 0, 0, 0, 0, 0, 5, -9, 0, 0, 0, 0, 0, 7, 13, 0, 0}, + { 0,-1, 1, 0, 0, 0, 1, 0,-2, 0, 0, 0, 0, -3, 16, 0, 0}, + { 0, 2,-2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0, 50, 0, 0, -27}, + {-2, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -5, -3, 0}, + { 0,-2, 2, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0}, + { 0, 0, 0, 0, 0, -6, 10, 0, 0, 0, 0, 0, 1, 0, 5, 3, 1}, + { 0, 0, 0, 0, 0, -6, 10, 0, 0, 0, 0, 0, 2, 24, 5, 2, -11}, + { 0, 0, 0, 0, 0, -2, 3, 0, 0, 0, 0, 0, 2, 5, -11, -5, -2}, + { 0, 0, 0, 0, 0, -2, 3, 0, 0, 0, 0, 0, 1, 30, -3, -2, -16}, + { 0, 1,-1, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0, 18, 0, 0, -9}, + + /* 271-280 */ + { 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, 0, 8, 614, 0, 0}, + { 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, 1, 3, -3, -1, -2}, + { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 6, 17, 9, -3}, + { 0, 1,-1, 1, 0, 0, -1, 0, 3, 0, 0, 0, 0, -3, -9, -5, 2}, + { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 6, 3, -1}, + { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, -127, 21, 9, 55}, + { 0, 0, 0, 0, 0, 0, 4, -8, 0, 0, 0, 0, 0, 3, 5, 0, 0}, + { 0, 0, 0, 0, 0, 0, -4, 8, 0, 0, 0, 0, 2, -6, -10, -4, 3}, + { 0,-2, 2, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 5, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, -4, 7, 0, 0, 0, 0, 2, 16, 9, 4, -7}, + + /* 281-290 */ + { 0, 0, 0, 0, 0, 0, -4, 7, 0, 0, 0, 0, 1, 3, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, 0, 0, 22, 0, 0}, + { 0, 0, 0, 1, 0, -2, 3, 0, 0, 0, 0, 0, 0, 0, 19, 10, 0}, + { 0, 2,-2, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0, 7, 0, 0, -4}, + { 0, 0, 0, 0, 0, 0, -5, 10, 0, 0, 0, 0, 2, 0, -5, -2, 0}, + { 0, 0, 0, 1, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, -9, 3, 1, 4}, + { 0, 0, 0, 0, 0, 0, -3, 5, 0, 0, 0, 0, 2, 17, 0, 0, -7}, + { 0, 0, 0, 0, 0, 0, -3, 5, 0, 0, 0, 0, 1, 0, -3, -2, -1}, + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, -20, 34, 0, 0}, + + /* 291-300 */ + { 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, 1, -10, 0, 1, 5}, + { 0, 1,-1, 1, 0, 1, -3, 0, 0, 0, 0, 0, 0, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, 0, 22, -87, 0, 0}, + { 0, 0, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 1, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 2, -3, -6, -2, 1}, + { 0, 0, 0, 0, 0, -7, 11, 0, 0, 0, 0, 0, 2, -16, -3, -1, 7}, + { 0, 0, 0, 0, 0, -7, 11, 0, 0, 0, 0, 0, 1, 0, -3, -2, 0}, + { 0,-2, 2, 0, 0, 4, -4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, -68, 39, 0, 0}, + { 0, 2,-2, 1, 0, -4, 4, 0, 0, 0, 0, 0, 0, 27, 0, 0, -14}, + + /* 301-310 */ + { 0,-1, 1, 0, 0, 4, -5, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, -25, 0, 0, 0}, + { 0, 0, 0, 0, 0, -4, 7, 0, 0, 0, 0, 0, 1, -12, -3, -2, 6}, + { 0, 1,-1, 1, 0, -4, 6, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, -4, 7, 0, 0, 0, 0, 0, 2, 3, 66, 29, -1}, + { 0, 0, 0, 0, 0, -4, 6, 0, 0, 0, 0, 0, 2, 490, 0, 0,-213}, + { 0, 0, 0, 0, 0, -4, 6, 0, 0, 0, 0, 0, 1, -22, 93, 49, 12}, + { 0, 1,-1, 1, 0, -4, 5, 0, 0, 0, 0, 0, 0, -7, 28, 15, 4}, + { 0, 0, 0, 0, 0, -4, 6, 0, 0, 0, 0, 0, 1, -3, 13, 7, 2}, + { 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0, 0, -46, 14, 0, 0}, + + /* 311-320 */ + {-2, 0, 2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0}, + { 0,-1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0}, + { 0, 0, 0, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0, -28, 0, 0, 15}, + { 0, 0, 0, 0, 0, 0, -1, 0, 5, 0, 0, 0, 2, 5, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + { 0, 0, 0, 0, 0, 0, -1, 3, 0, 0, 0, 0, 2, -11, 0, 0, 5}, + { 0, 0, 0, 0, 0, 0, -7, 12, 0, 0, 0, 0, 2, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 25, 106, 57, -13}, + + /* 321-330 */ + { 0, 1,-1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 5, 21, 11, -3}, + { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1485, 0, 0, 0}, + { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, -7, -32, -17, 4}, + { 0, 1,-1, 1, 0, 1, -2, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0}, + { 0, 0, 0, 0, 0, 0, -2, 5, 0, 0, 0, 0, 2, -6, -3, -2, 3}, + { 0, 0, 0, 0, 0, 0, -1, 0, 4, 0, 0, 0, 2, 30, -6, -2, -13}, + { 0, 0, 0, 0, 0, 0, 1, 0,-4, 0, 0, 0, 0, -4, 4, 0, 0}, + { 0, 0, 0, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, -19, 0, 0, 10}, + { 0, 0, 0, 0, 0, 0, -6, 10, 0, 0, 0, 0, 2, 0, 4, 2, -1}, + { 0, 0, 0, 0, 0, 0, -6, 10, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + + /* 331-340 */ + { 0, 2,-2, 1, 0, 0, -3, 0, 3, 0, 0, 0, 0, 4, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, -3, 7, 0, 0, 0, 0, 2, 0, -3, -1, 0}, + {-2, 0, 2, 0, 0, 4, -4, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, -5, 8, 0, 0, 0, 0, 2, 5, 3, 1, -2}, + { 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0, 0, 11, 0, 0}, + { 0, 0, 0, 0, 0, 0, -1, 0, 3, 0, 0, 0, 2, 118, 0, 0, -52}, + { 0, 0, 0, 0, 0, 0, -1, 0, 3, 0, 0, 0, 1, 0, -5, -3, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0,-3, 0, 0, 0, 0, -28, 36, 0, 0}, + { 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0, 0, 5, -5, 0, 0}, + { 0, 0, 0, 0, 0, -2, 4, 0, 0, 0, 0, 0, 1, 14, -59, -31, -8}, + + /* 341-350 */ + { 0, 1,-1, 1, 0, -2, 3, 0, 0, 0, 0, 0, 0, 0, 9, 5, 1}, + { 0, 0, 0, 0, 0, -2, 4, 0, 0, 0, 0, 0, 2, -458, 0, 0, 198}, + { 0, 0, 0, 0, 0, -6, 9, 0, 0, 0, 0, 0, 2, 0, -45, -20, 0}, + { 0, 0, 0, 0, 0, -6, 9, 0, 0, 0, 0, 0, 1, 9, 0, 0, -5}, + { 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0}, + { 0, 0, 0, 1, 0, 0, 1, 0,-2, 0, 0, 0, 0, 0, -4, -2, -1}, + { 0, 2,-2, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0, 11, 0, 0, -6}, + { 0, 0, 0, 0, 0, 0, -4, 6, 0, 0, 0, 0, 2, 6, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0, -16, 23, 0, 0}, + { 0, 0, 0, 1, 0, 3, -4, 0, 0, 0, 0, 0, 0, 0, -4, -2, 0}, + + /* 351-360 */ + { 0, 0, 0, 0, 0, 0, -1, 0, 2, 0, 0, 0, 2, -5, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 1, 0,-2, 0, 0, 0, 0, -166, 269, 0, 0}, + { 0, 0, 0, 1, 0, 0, 1, 0,-1, 0, 0, 0, 0, 15, 0, 0, -8}, + { 0, 0, 0, 0, 0, -5, 9, 0, 0, 0, 0, 0, 2, 10, 0, 0, -4}, + { 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, -78, 45, 0, 0}, + { 0, 0, 0, 0, 0, -3, 4, 0, 0, 0, 0, 0, 2, 0, -5, -2, 0}, + { 0, 0, 0, 0, 0, -3, 4, 0, 0, 0, 0, 0, 1, 7, 0, 0, -4}, + { 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, 0, -5, 328, 0, 0}, + { 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, 1, 3, 0, 0, -2}, + { 0, 0, 0, 1, 0, 0, 2, -2, 0, 0, 0, 0, 0, 5, 0, 0, -2}, + + /* 361-370 */ + { 0, 0, 0, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 0,-3, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 1,-5, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, -4, -2, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0,-1223, -26, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0,-1, 0, 0, 0, 1, 0, 7, 3, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0,-3, 5, 0, 0, 0, 3, 0, 0, 0}, + { 0, 0, 0, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 0,-2, 0, 0, 0, -6, 20, 0, 0}, + { 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, -368, 0, 0, 0}, + + /* 371-380 */ + { 0, 0, 0, 0, 0, 0, 1, 0, 0,-1, 0, 0, 0, -75, 0, 0, 0}, + { 0, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 11, 0, 0, -6}, + { 0, 0, 0, 1, 0, 0, -2, 2, 0, 0, 0, 0, 0, 3, 0, 0, -2}, + { 0, 0, 0, 0, 0, -8, 14, 0, 0, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, 0, 1, 0, 2,-5, 0, 0, 0, -13, -30, 0, 0}, + { 0, 0, 0, 0, 0, 0, 5, -8, 3, 0, 0, 0, 0, 21, 3, 0, 0}, + { 0, 0, 0, 0, 0, 0, 5, -8, 3, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 8, -27, 0, 0}, + { 0, 0, 0, 0, 0, 0, 3, -8, 3, 0, 0, 0, 0, -19, -11, 0, 0}, + + /* 381-390 */ + { 0, 0, 0, 0, 0, 0, -3, 8,-3, 0, 0, 0, 2, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 1, 0,-2, 5, 0, 0, 2, 0, 5, 2, 0}, + { 0, 0, 0, 0, 0, -8, 12, 0, 0, 0, 0, 0, 2, -6, 0, 0, 2}, + { 0, 0, 0, 0, 0, -8, 12, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 1,-2, 0, 0, 0, -1, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, -14, 0, 0, 6}, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, -74, 0, 0, 32}, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 2, 0, -3, -1, 0}, + { 0, 2,-2, 1, 0, -5, 5, 0, 0, 0, 0, 0, 0, 4, 0, 0, -2}, + + /* 391-400 */ + { 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 8, 11, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 3, 2, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, -262, 0, 0, 114}, + { 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0}, + { 0, 0, 0, 0, 0, -3, 6, 0, 0, 0, 0, 0, 1, -7, 0, 0, 4}, + { 0, 0, 0, 0, 0, -3, 6, 0, 0, 0, 0, 0, 2, 0, -27, -12, 0}, + { 0, 0, 0, 0, 0, 0, -1, 4, 0, 0, 0, 0, 2, -19, -8, -4, 8}, + { 0, 0, 0, 0, 0, -5, 7, 0, 0, 0, 0, 0, 2, 202, 0, 0, -87}, + { 0, 0, 0, 0, 0, -5, 7, 0, 0, 0, 0, 0, 1, -8, 35, 19, 5}, + { 0, 1,-1, 1, 0, -5, 6, 0, 0, 0, 0, 0, 0, 0, 4, 2, 0}, + + /* 401-410 */ + { 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0, 0, 16, -5, 0, 0}, + { 0, 2,-2, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 5, 0, 0, -3}, + { 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, -3, 0, 0}, + { 0, 0, 0, 0,-1, 0, 3, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, -35, -48, -21, 15}, + { 0, 0, 0, 0, 0, 0, -2, 6, 0, 0, 0, 0, 2, -3, -5, -2, 1}, + { 0, 0, 0, 1, 0, 2, -2, 0, 0, 0, 0, 0, 0, 6, 0, 0, -3}, + { 0, 0, 0, 0, 0, 0, -6, 9, 0, 0, 0, 0, 2, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0, 0, -5, 0, 0}, + { 0, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0, 1, 12, 55, 29, -6}, + + /* 411-420 */ + { 0, 1,-1, 1, 0, -2, 1, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0}, + { 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, -598, 0, 0, 0}, + { 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, 1, -3, -13, -7, 1}, + { 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 2, -5, -7, -3, 2}, + { 0, 0, 0, 0, 0, 0, -5, 7, 0, 0, 0, 0, 2, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0, 5, -7, 0, 0}, + { 0, 0, 0, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0, 16, -6, 0, 0}, + { 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0, 0, 8, -3, 0, 0}, + { 0, 0, 0, 0, 0, -1, 3, 0, 0, 0, 0, 0, 1, 8, -31, -16, -4}, + + /* 421-430 */ + { 0, 1,-1, 1, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, -1, 3, 0, 0, 0, 0, 0, 2, 113, 0, 0, -49}, + { 0, 0, 0, 0, 0, -7, 10, 0, 0, 0, 0, 0, 2, 0, -24, -10, 0}, + { 0, 0, 0, 0, 0, -7, 10, 0, 0, 0, 0, 0, 1, 4, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 27, 0, 0, 0}, + { 0, 0, 0, 0, 0, -4, 8, 0, 0, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, -4, 5, 0, 0, 0, 0, 0, 2, 0, -4, -2, 0}, + { 0, 0, 0, 0, 0, -4, 5, 0, 0, 0, 0, 0, 1, 5, 0, 0, -2}, + { 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0}, + { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, -13, 0, 0, 6}, + + /* 431-440 */ + { 0, 0, 0, 0, 0, 0, -2, 0, 5, 0, 0, 0, 2, 5, 0, 0, -2}, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 2, -18, -10, -4, 8}, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -4, -28, 0, 0}, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, -5, 6, 3, 2}, + { 0, 0, 0, 0, 0, -9, 13, 0, 0, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, 0, -1, 5, 0, 0, 0, 0, 2, -5, -9, -4, 2}, + { 0, 0, 0, 0, 0, 0, -2, 0, 4, 0, 0, 0, 2, 17, 0, 0, -7}, + { 0, 0, 0, 0, 0, 0, 2, 0,-4, 0, 0, 0, 0, 11, 4, 0, 0}, + { 0, 0, 0, 0, 0, 0, -2, 7, 0, 0, 0, 0, 2, 0, -6, -2, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0,-3, 0, 0, 0, 0, 83, 15, 0, 0}, + + /* 441-450 */ + { 0, 0, 0, 0, 0, -2, 5, 0, 0, 0, 0, 0, 1, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, -2, 5, 0, 0, 0, 0, 0, 2, 0,-114, -49, 0}, + { 0, 0, 0, 0, 0, -6, 8, 0, 0, 0, 0, 0, 2, 117, 0, 0, -51}, + { 0, 0, 0, 0, 0, -6, 8, 0, 0, 0, 0, 0, 1, -5, 19, 10, 2}, + { 0, 0, 0, 0, 0, 6, -8, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 1, 0, 0, 2, 0,-2, 0, 0, 0, 0, -3, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, -3, 9, 0, 0, 0, 0, 2, 0, -3, -1, 0}, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, 3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 2, 0, -6, -2, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 393, 3, 0, 0}, + + /* 451-460 */ + { 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 1, -4, 21, 11, 2}, + { 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 2, -6, 0, -1, 3}, + { 0, 0, 0, 0, 0, -5, 10, 0, 0, 0, 0, 0, 2, -3, 8, 4, 1}, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 8, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 2, 18, -29, -13, -8}, + { 0, 0, 0, 0, 0, -3, 3, 0, 0, 0, 0, 0, 1, 8, 34, 18, -4}, + { 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0}, + { 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 1, 3, 12, 6, -1}, + { 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 2, 54, -15, -7, -24}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0,-3, 0, 0, 0, 0, 3, 0, 0}, + + /* 461-470 */ + { 0, 0, 0, 0, 0, 0, -5, 13, 0, 0, 0, 0, 2, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 0, 2, 0,-1, 0, 0, 0, 0, 0, 35, 0, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0,-1, 0, 0, 0, 2, -154, -30, -13, 67}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0,-2, 0, 0, 0, 15, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0,-2, 0, 0, 1, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 0, 0, 9, 0, 0}, + { 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 2, 80, -71, -31, -35}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0,-1, 0, 0, 2, 0, -20, -9, 0}, + { 0, 0, 0, 0, 0, 0, -6, 15, 0, 0, 0, 0, 2, 11, 5, 2, -5}, + { 0, 0, 0, 0, 0, -8, 15, 0, 0, 0, 0, 0, 2, 61, -96, -42, -27}, + + /* 471-480 */ + { 0, 0, 0, 0, 0, -3, 9, -4, 0, 0, 0, 0, 2, 14, 9, 4, -6}, + { 0, 0, 0, 0, 0, 0, 2, 0, 2,-5, 0, 0, 2, -11, -6, -3, 5}, + { 0, 0, 0, 0, 0, 0, -2, 8,-1,-5, 0, 0, 2, 0, -3, -1, 0}, + { 0, 0, 0, 0, 0, 0, 6, -8, 3, 0, 0, 0, 2, 123,-415, -180, -53}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 7, -32, -17, -4}, + { 0, 1,-1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -9, -5, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, -4, 2, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, -89, 0, 0, 38}, + + /* 481-490 */ + { 0, 0, 0, 0, 0, 0, -6, 16,-4,-5, 0, 0, 2, 0, -86, -19, -6}, + { 0, 0, 0, 0, 0, 0, -2, 8,-3, 0, 0, 0, 2, 0, 0, -19, 6}, + { 0, 0, 0, 0, 0, 0, -2, 8,-3, 0, 0, 0, 2, -123,-416, -180, 53}, + { 0, 0, 0, 0, 0, 0, 6, -8, 1, 5, 0, 0, 2, 0, -3, -1, 0}, + { 0, 0, 0, 0, 0, 0, 2, 0,-2, 5, 0, 0, 2, 12, -6, -3, -5}, + { 0, 0, 0, 0, 0, 3, -5, 4, 0, 0, 0, 0, 2, -13, 9, 4, 6}, + { 0, 0, 0, 0, 0, -8, 11, 0, 0, 0, 0, 0, 2, 0, -15, -7, 0}, + { 0, 0, 0, 0, 0, -8, 11, 0, 0, 0, 0, 0, 1, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, -8, 11, 0, 0, 0, 0, 0, 2, -62, -97, -42, 27}, + { 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 2, -11, 5, 2, 5}, + + /* 491-500 */ + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, -19, -8, 0}, + { 0, 0, 0, 0, 0, 3, -3, 0, 2, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 2,-2, 1, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, 4, 2, 0}, + { 0, 1,-1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + { 0, 2,-2, 1, 0, 0, -4, 8,-3, 0, 0, 0, 0, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 2, -85, -70, -31, 37}, + { 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 2, 163, -12, -5, -72}, + { 0, 0, 0, 0, 0, -3, 7, 0, 0, 0, 0, 0, 2, -63, -16, -7, 28}, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 2, -21, -32, -14, 9}, + { 0, 0, 0, 0, 0, -5, 6, 0, 0, 0, 0, 0, 2, 0, -3, -1, 0}, + + /* 501-510 */ + { 0, 0, 0, 0, 0, -5, 6, 0, 0, 0, 0, 0, 1, 3, 0, 0, -2}, + { 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0}, + { 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, 2, 3, 10, 4, -1}, + { 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 0, -1, 6, 0, 0, 0, 0, 2, 0, -7, -3, 0}, + { 0, 0, 0, 0, 0, 0, 7, -9, 0, 0, 0, 0, 2, 0, -4, -2, 0}, + { 0, 0, 0, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0, 6, 19, 0, 0}, + { 0, 0, 0, 0, 0, 2, -1, 0, 0, 0, 0, 0, 2, 5,-173, -75, -2}, + { 0, 0, 0, 0, 0, 0, 6, -7, 0, 0, 0, 0, 2, 0, -7, -3, 0}, + { 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 2, 7, -12, -5, -3}, + + /* 511-520 */ + { 0, 0, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, -3, 0, 0, 2}, + { 0, 0, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 2, 3, -4, -2, -1}, + { 0, 0, 0, 0, 0, -7, 9, 0, 0, 0, 0, 0, 2, 74, 0, 0, -32}, + { 0, 0, 0, 0, 0, -7, 9, 0, 0, 0, 0, 0, 1, -3, 12, 6, 2}, + { 0, 0, 0, 0, 0, 0, 4, -3, 0, 0, 0, 0, 2, 26, -14, -6, -11}, + { 0, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 2, 19, 0, 0, -8}, + { 0, 0, 0, 0, 0, -4, 4, 0, 0, 0, 0, 0, 1, 6, 24, 13, -3}, + { 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0}, + { 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 1, 0, -10, -5, 0}, + { 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 2, 11, -3, -1, -5}, + + /* 521-530 */ + { 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 2, 3, 0, 1, -1}, + { 0, 0, 0, 0, 0, 0, -3, 0, 5, 0, 0, 0, 2, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0}, + { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 5, -23, -12, -3}, + { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 2, -339, 0, 0, 147}, + { 0, 0, 0, 0, 0, -9, 12, 0, 0, 0, 0, 0, 2, 0, -10, -5, 0}, + { 0, 0, 0, 0, 0, 0, 3, 0,-4, 0, 0, 0, 0, 5, 0, 0, 0}, + { 0, 2,-2, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 0, 7, -8, 0, 0, 0, 0, 2, 0, -4, -2, 0}, + { 0, 0, 0, 0, 0, 0, 3, 0,-3, 0, 0, 0, 0, 18, -3, 0, 0}, + + /* 531-540 */ + { 0, 0, 0, 0, 0, 0, 3, 0,-3, 0, 0, 0, 2, 9, -11, -5, -4}, + { 0, 0, 0, 0, 0, -2, 6, 0, 0, 0, 0, 0, 2, -8, 0, 0, 4}, + { 0, 0, 0, 0, 0, -6, 7, 0, 0, 0, 0, 0, 1, 3, 0, 0, -1}, + { 0, 0, 0, 0, 0, 6, -7, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0}, + { 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 2, 6, -9, -4, -2}, + { 0, 0, 0, 0, 0, 0, 3, 0,-2, 0, 0, 0, 0, -4, -12, 0, 0}, + { 0, 0, 0, 0, 0, 0, 3, 0,-2, 0, 0, 0, 2, 67, -91, -39, -29}, + { 0, 0, 0, 0, 0, 0, 5, -4, 0, 0, 0, 0, 2, 30, -18, -8, -13}, + { 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 0, 2, 0,-114, -50, 0}, + + /* 541-550 */ + { 0, 0, 0, 0, 0, 0, 3, 0,-1, 0, 0, 0, 2, 0, 0, 0, 23}, + { 0, 0, 0, 0, 0, 0, 3, 0,-1, 0, 0, 0, 2, 517, 16, 7,-224}, + { 0, 0, 0, 0, 0, 0, 3, 0, 0,-2, 0, 0, 2, 0, -7, -3, 0}, + { 0, 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 2, 143, -3, -1, -62}, + { 0, 0, 0, 0, 0, 0, 3, 0, 0,-1, 0, 0, 2, 29, 0, 0, -13}, + { 0, 2,-2, 1, 0, 0, 1, 0,-1, 0, 0, 0, 0, -4, 0, 0, 2}, + { 0, 0, 0, 0, 0, -8, 16, 0, 0, 0, 0, 0, 2, -6, 0, 0, 3}, + { 0, 0, 0, 0, 0, 0, 3, 0, 2,-5, 0, 0, 2, 5, 12, 5, -2}, + { 0, 0, 0, 0, 0, 0, 7, -8, 3, 0, 0, 0, 2, -25, 0, 0, 11}, + { 0, 0, 0, 0, 0, 0, -5, 16,-4,-5, 0, 0, 2, -3, 0, 0, 1}, + + /* 551-560 */ + { 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 2, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, 0, -1, 8,-3, 0, 0, 0, 2, -22, 12, 5, 10}, + { 0, 0, 0, 0, 0, -8, 10, 0, 0, 0, 0, 0, 2, 50, 0, 0, -22}, + { 0, 0, 0, 0, 0, -8, 10, 0, 0, 0, 0, 0, 1, 0, 7, 4, 0}, + { 0, 0, 0, 0, 0, -8, 10, 0, 0, 0, 0, 0, 2, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, -4, 4, 2, 2}, + { 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 2, -5, -11, -5, 2}, + { 0, 0, 0, 0, 0, -3, 8, 0, 0, 0, 0, 0, 2, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, -5, 5, 0, 0, 0, 0, 0, 1, 4, 17, 9, -2}, + { 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0}, + + /* 561-570 */ + { 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 1, 0, -4, -2, 0}, + { 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 2, -8, 0, 0, 4}, + { 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 4, -15, -8, -2}, + { 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 370, -8, 0,-160}, + { 0, 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 2, 0, 0, -3, 0}, + { 0, 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 2, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, 0, 6, -5, 0, 0, 0, 0, 2, -6, 3, 1, 3}, + { 0, 0, 0, 0, 0, 7, -8, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0}, + { 0, 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 2, -10, 0, 0, 4}, + + /* 571-580 */ + { 0, 0, 0, 0, 0, 4, -3, 0, 0, 0, 0, 0, 2, 0, 9, 4, 0}, + { 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 4, 17, 7, -2}, + { 0, 0, 0, 0, 0, -9, 11, 0, 0, 0, 0, 0, 2, 34, 0, 0, -15}, + { 0, 0, 0, 0, 0, -9, 11, 0, 0, 0, 0, 0, 1, 0, 5, 3, 0}, + { 0, 0, 0, 0, 0, 0, 4, 0,-4, 0, 0, 0, 2, -5, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 4, 0,-3, 0, 0, 0, 2, -37, -7, -3, 16}, + { 0, 0, 0, 0, 0, -6, 6, 0, 0, 0, 0, 0, 1, 3, 13, 7, -2}, + { 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}, + { 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, 1, 0, -3, -2, 0}, + { 0, 0, 0, 0, 0, 0, 4, 0,-2, 0, 0, 0, 2, -184, -3, -1, 80}, + + /* 581-590 */ + { 0, 0, 0, 0, 0, 0, 6, -4, 0, 0, 0, 0, 2, -3, 0, 0, 1}, + { 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0}, + { 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 1, 0, -10, -6, -1}, + { 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 2, 31, -6, 0, -13}, + { 0, 0, 0, 0, 0, 0, 4, 0,-1, 0, 0, 0, 2, -3, -32, -14, 1}, + { 0, 0, 0, 0, 0, 0, 4, 0, 0,-2, 0, 0, 2, -7, 0, 0, 3}, + { 0, 0, 0, 0, 0, 0, 5, -2, 0, 0, 0, 0, 2, 0, -8, -4, 0}, + { 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 3, -4, 0, 0}, + { 0, 0, 0, 0, 0, 8, -9, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + { 0, 0, 0, 0, 0, 5, -4, 0, 0, 0, 0, 0, 2, 0, 3, 1, 0}, + + /* 591-600 */ + { 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 2, 19, -23, -10, 2}, + { 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, -10}, + { 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 3, 2, 0}, + { 0, 0, 0, 0, 0, -7, 7, 0, 0, 0, 0, 0, 1, 0, 9, 5, -1}, + { 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0}, + { 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 1, 0, -7, -4, 0}, + { 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 2, 8, -4, 0, -4}, + { 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0}, + { 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + { 0, 0, 0, 0, 0, 0, 5, 0,-4, 0, 0, 0, 2, -3, 0, 0, 1}, + + /* 601-610 */ + { 0, 0, 0, 0, 0, 0, 5, 0,-3, 0, 0, 0, 2, -9, 0, 1, 4}, + { 0, 0, 0, 0, 0, 0, 5, 0,-2, 0, 0, 0, 2, 3, 12, 5, -1}, + { 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 17, -3, -1, 0}, + { 0, 0, 0, 0, 0, -8, 8, 0, 0, 0, 0, 0, 1, 0, 7, 4, 0}, + { 0, 0, 0, 0, 0, 8, -8, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0}, + { 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 0, 1, 0, -5, -3, 0}, + { 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 0, 2, 14, -3, 0, -1}, + { 0, 0, 0, 0, 0, -9, 9, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0}, + { 0, 0, 0, 0, 0, -9, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, -5}, + { 0, 0, 0, 0, 0, -9, 9, 0, 0, 0, 0, 0, 1, 0, 5, 3, 0}, + + /* 611-620 */ + { 0, 0, 0, 0, 0, 9, -9, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0}, + { 0, 0, 0, 0, 0, 6, -4, 0, 0, 0, 0, 0, 1, 0, -3, -2, 0}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 2, 9, 4, 3}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 4, 2, 0}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 6, 0, 0, -3}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 3, 1, 0}, + { 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 5, 0, 0, -2}, + + /* 621-630 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, -1}, + { 1, 0,-2, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, -3, 0, 0, 0}, + { 1, 0,-2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0}, + { 1, 0,-2, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 7, 0, 0, 0}, + { 1, 0,-2, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0}, + {-1, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0}, + {-1, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 6, 0, 0, 0}, + {-1, 0, 2, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, -4, 0, 0}, + { 1, 0,-2, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, -4, 0, 0}, + {-2, 0, 2, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, 5, 0, 0, 0}, + + /* 631-640 */ + {-1, 0, 0, 0, 0, 0, 2, 0,-3, 0, 0, 0, 0, -3, 0, 0, 0}, + {-1, 0, 0, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 4, 0, 0, 0}, + {-1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0}, + {-1, 0, 2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0}, + { 1,-1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0}, + {-1, 0, 2, 0, 0, 0, 2, 0,-3, 0, 0, 0, 0, 13, 0, 0, 0}, + {-2, 0, 0, 0, 0, 0, 2, 0,-3, 0, 0, 0, 0, 21, 11, 0, 0}, + { 1, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, -5, 0, 0}, + {-1, 1,-1, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -5, -2, 0}, + { 1, 1,-1, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 5, 3, 0}, + + /* 641-650 */ + {-1, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, -5, 0, 0}, + {-1, 0, 2, 1, 0, 0, 2, 0,-2, 0, 0, 0, 0, -3, 0, 0, 2}, + { 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 20, 10, 0, 0}, + {-1, 0, 2, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, -34, 0, 0, 0}, + {-1, 0, 2, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0}, + { 1, 0,-2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0, 3, 0, 0, -2}, + { 1, 2,-2, 2, 0, -3, 3, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + { 1, 2,-2, 2, 0, 0, -2, 0, 2, 0, 0, 0, 0, -6, 0, 0, 3}, + { 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0}, + { 1, 0, 0, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 3, 0, 0, 0}, + + /* 651-660 */ + { 0, 0,-2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0}, + { 0, 0,-2, 0, 0, 0, 1, 0,-1, 0, 0, 0, 0, 4, 0, 0, 0}, + { 0, 2, 0, 2, 0, -2, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 2, 0, 2, 0, 0, -1, 0, 1, 0, 0, 0, 0, 6, 0, 0, -3}, + { 0, 2, 0, 2, 0, -1, 1, 0, 0, 0, 0, 0, 0, -8, 0, 0, 3}, + { 0, 2, 0, 2, 0, -2, 3, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 0, 2, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, -3, 0, 0, 0}, + { 0, 1, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -3, -2, 0}, + { 1, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 126, -63, -27, -55}, + {-1, 2, 0, 2, 0, 10, -3, 0, 0, 0, 0, 0, 0, -5, 0, 1, 2}, + + /* 661-670 */ + { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, -3, 28, 15, 2}, + { 1, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0, 1, -2}, + { 0, 2, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, 9, 4, 1}, + { 0, 2, 0, 2, 0, 0, -4, 8,-3, 0, 0, 0, 0, 0, 9, 4, -1}, + {-1, 2, 0, 2, 0, 0, -4, 8,-3, 0, 0, 0, 0, -126, -63, -27, 55}, + { 2, 2,-2, 2, 0, 0, -2, 0, 3, 0, 0, 0, 0, 3, 0, 0, -1}, + { 1, 2, 0, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0, 21, -11, -6, -11}, + { 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0}, + {-1, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, -21, -11, -6, 11}, + {-2, 2, 2, 2, 0, 0, 2, 0,-2, 0, 0, 0, 0, -3, 0, 0, 1}, + + /* 671-680 */ + { 0, 2, 0, 2, 0, 2, -3, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0}, + { 0, 2, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, 0, 8, 0, 0, -4}, + { 0, 2, 0, 2, 0, 0, 1, 0,-1, 0, 0, 0, 0, -6, 0, 0, 3}, + { 0, 2, 0, 2, 0, 2, -2, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + {-1, 2, 2, 2, 0, 0, -1, 0, 1, 0, 0, 0, 0, 3, 0, 0, -1}, + { 1, 2, 0, 2, 0, -1, 1, 0, 0, 0, 0, 0, 0, -3, 0, 0, 1}, + {-1, 2, 2, 2, 0, 0, 2, 0,-3, 0, 0, 0, 0, -5, 0, 0, 2}, + { 2, 2, 0, 2, 0, 0, 2, 0,-3, 0, 0, 0, 0, 24, -12, -5, -11}, + { 1, 2, 0, 2, 0, 0, -4, 8,-3, 0, 0, 0, 0, 0, 3, 1, 0}, + { 1, 2, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0, 0, 3, 1, 0}, + + /* 681-687 */ + { 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0}, + { 0, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, -24, -12, -5, 10}, + { 2, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 4, 0, -1, -2}, + {-1, 2, 2, 2, 0, 0, 2, 0,-2, 0, 0, 0, 0, 13, 0, 0, -6}, + {-1, 2, 2, 2, 0, 3, -3, 0, 0, 0, 0, 0, 0, 7, 0, 0, -3}, + { 1, 2, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1}, + { 0, 2, 2, 2, 0, 0, 2, 0,-2, 0, 0, 0, 0, 3, 0, 0, -1} + }; + +/* Number of terms in the planetary nutation model */ + const int NPL = (int) (sizeof xpl / sizeof xpl[0]); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* ------------------- */ +/* LUNI-SOLAR NUTATION */ +/* ------------------- */ + +/* Fundamental (Delaunay) arguments */ + +/* Mean anomaly of the Moon (IERS 2003). */ + el = eraFal03(t); + +/* Mean anomaly of the Sun (MHB2000). */ + elp = fmod(1287104.79305 + + t * (129596581.0481 + + t * (-0.5532 + + t * (0.000136 + + t * (-0.00001149)))), ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean longitude of the Moon minus that of the ascending node */ +/* (IERS 2003. */ + f = eraFaf03(t); + +/* Mean elongation of the Moon from the Sun (MHB2000). */ + d = fmod(1072260.70369 + + t * (1602961601.2090 + + t * (-6.3706 + + t * (0.006593 + + t * (-0.00003169)))), ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean longitude of the ascending node of the Moon (IERS 2003). */ + om = eraFaom03(t); + +/* Initialize the nutation values. */ + dp = 0.0; + de = 0.0; + +/* Summation of luni-solar nutation series (in reverse order). */ + for (i = NLS-1; i >= 0; i--) { + + /* Argument and functions. */ + arg = fmod((double)xls[i].nl * el + + (double)xls[i].nlp * elp + + (double)xls[i].nf * f + + (double)xls[i].nd * d + + (double)xls[i].nom * om, ERFA_D2PI); + sarg = sin(arg); + carg = cos(arg); + + /* Term. */ + dp += (xls[i].sp + xls[i].spt * t) * sarg + xls[i].cp * carg; + de += (xls[i].ce + xls[i].cet * t) * carg + xls[i].se * sarg; + } + +/* Convert from 0.1 microarcsec units to radians. */ + dpsils = dp * U2R; + depsls = de * U2R; + +/* ------------------ */ +/* PLANETARY NUTATION */ +/* ------------------ */ + +/* n.b. The MHB2000 code computes the luni-solar and planetary nutation */ +/* in different functions, using slightly different Delaunay */ +/* arguments in the two cases. This behaviour is faithfully */ +/* reproduced here. Use of the IERS 2003 expressions for both */ +/* cases leads to negligible changes, well below */ +/* 0.1 microarcsecond. */ + +/* Mean anomaly of the Moon (MHB2000). */ + al = fmod(2.35555598 + 8328.6914269554 * t, ERFA_D2PI); + +/* Mean longitude of the Moon minus that of the ascending node */ +/*(MHB2000). */ + af = fmod(1.627905234 + 8433.466158131 * t, ERFA_D2PI); + +/* Mean elongation of the Moon from the Sun (MHB2000). */ + ad = fmod(5.198466741 + 7771.3771468121 * t, ERFA_D2PI); + +/* Mean longitude of the ascending node of the Moon (MHB2000). */ + aom = fmod(2.18243920 - 33.757045 * t, ERFA_D2PI); + +/* General accumulated precession in longitude (IERS 2003). */ + apa = eraFapa03(t); + +/* Planetary longitudes, Mercury through Uranus (IERS 2003). */ + alme = eraFame03(t); + alve = eraFave03(t); + alea = eraFae03(t); + alma = eraFama03(t); + alju = eraFaju03(t); + alsa = eraFasa03(t); + alur = eraFaur03(t); + +/* Neptune longitude (MHB2000). */ + alne = fmod(5.321159000 + 3.8127774000 * t, ERFA_D2PI); + +/* Initialize the nutation values. */ + dp = 0.0; + de = 0.0; + +/* Summation of planetary nutation series (in reverse order). */ + for (i = NPL-1; i >= 0; i--) { + + /* Argument and functions. */ + arg = fmod((double)xpl[i].nl * al + + (double)xpl[i].nf * af + + (double)xpl[i].nd * ad + + (double)xpl[i].nom * aom + + (double)xpl[i].nme * alme + + (double)xpl[i].nve * alve + + (double)xpl[i].nea * alea + + (double)xpl[i].nma * alma + + (double)xpl[i].nju * alju + + (double)xpl[i].nsa * alsa + + (double)xpl[i].nur * alur + + (double)xpl[i].nne * alne + + (double)xpl[i].npa * apa, ERFA_D2PI); + sarg = sin(arg); + carg = cos(arg); + + /* Term. */ + dp += (double)xpl[i].sp * sarg + (double)xpl[i].cp * carg; + de += (double)xpl[i].se * sarg + (double)xpl[i].ce * carg; + + } + +/* Convert from 0.1 microarcsec units to radians. */ + dpsipl = dp * U2R; + depspl = de * U2R; + +/* ------- */ +/* RESULTS */ +/* ------- */ + +/* Add luni-solar and planetary components. */ + *dpsi = dpsils + dpsipl; + *deps = depsls + depspl; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/nut00b.c b/testbed/astropy__astropy/cextern/erfa/nut00b.c new file mode 100644 index 0000000000000000000000000000000000000000..5da51586e77535ec4008f7791628b43b87169980 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/nut00b.c @@ -0,0 +1,381 @@ +#include "erfa.h" + +void eraNut00b(double date1, double date2, double *dpsi, double *deps) +/* +** - - - - - - - - - - +** e r a N u t 0 0 b +** - - - - - - - - - - +** +** Nutation, IAU 2000B model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation, luni-solar + planetary (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components in longitude and obliquity are in radians +** and with respect to the equinox and ecliptic of date. The +** obliquity at J2000.0 is assumed to be the Lieske et al. (1977) +** value of 84381.448 arcsec. (The errors that result from using +** this function with the IAU 2006 value of 84381.406 arcsec can be +** neglected.) +** +** The nutation model consists only of luni-solar terms, but +** includes also a fixed offset which compensates for certain long- +** period planetary terms (Note 7). +** +** 3) This function is an implementation of the IAU 2000B abridged +** nutation model formally adopted by the IAU General Assembly in +** 2000. The function computes the MHB_2000_SHORT luni-solar +** nutation series (Luzum 2001), but without the associated +** corrections for the precession rate adjustments and the offset +** between the GCRS and J2000.0 mean poles. +** +** 4) The full IAU 2000A (MHB2000) nutation model contains nearly 1400 +** terms. The IAU 2000B model (McCarthy & Luzum 2003) contains only +** 77 terms, plus additional simplifications, yet still delivers +** results of 1 mas accuracy at present epochs. This combination of +** accuracy and size makes the IAU 2000B abridged nutation model +** suitable for most practical applications. +** +** The function delivers a pole accurate to 1 mas from 1900 to 2100 +** (usually better than 1 mas, very occasionally just outside +** 1 mas). The full IAU 2000A model, which is implemented in the +** function eraNut00a (q.v.), delivers considerably greater accuracy +** at current dates; however, to realize this improved accuracy, +** corrections for the essentially unpredictable free-core-nutation +** (FCN) must also be included. +** +** 5) The present function provides classical nutation. The +** MHB_2000_SHORT algorithm, from which it is adapted, deals also +** with (i) the offsets between the GCRS and mean poles and (ii) the +** adjustments in longitude and obliquity due to the changed +** precession rates. These additional functions, namely frame bias +** and precession adjustments, are supported by the ERFA functions +** eraBi00 and eraPr00. +** +** 6) The MHB_2000_SHORT algorithm also provides "total" nutations, +** comprising the arithmetic sum of the frame bias, precession +** adjustments, and nutation (luni-solar + planetary). These total +** nutations can be used in combination with an existing IAU 1976 +** precession implementation, such as eraPmat76, to deliver GCRS- +** to-true predictions of mas accuracy at current epochs. However, +** for symmetry with the eraNut00a function (q.v. for the reasons), +** the ERFA functions do not generate the "total nutations" +** directly. Should they be required, they could of course easily +** be generated by calling eraBi00, eraPr00 and the present function +** and adding the results. +** +** 7) The IAU 2000B model includes "planetary bias" terms that are +** fixed in size but compensate for long-period nutations. The +** amplitudes quoted in McCarthy & Luzum (2003), namely +** Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for +** the "total nutations" method described in Note 6. The Luzum +** (2001) values used in this ERFA implementation, namely -0.135 mas +** and +0.388 mas, are optimized for the "rigorous" method, where +** frame bias, precession and nutation are applied separately and in +** that order. During the interval 1995-2050, the ERFA +** implementation delivers a maximum error of 1.001 mas (not +** including FCN). +** +** References: +** +** Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions +** for the precession quantities based upon the IAU /1976/ system of +** astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977) +** +** Luzum, B., private communication, 2001 (Fortran code +** MHB_2000_SHORT) +** +** McCarthy, D.D. & Luzum, B.J., "An abridged model of the +** precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron. +** 85, 37-49 (2003) +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, el, elp, f, d, om, arg, dp, de, sarg, carg, + dpsils, depsls, dpsipl, depspl; + int i; + +/* Units of 0.1 microarcsecond to radians */ + static const double U2R = ERFA_DAS2R / 1e7; + +/* ---------------------------------------- */ +/* Fixed offsets in lieu of planetary terms */ +/* ---------------------------------------- */ + + static const double DPPLAN = -0.135 * ERFA_DMAS2R; + static const double DEPLAN = 0.388 * ERFA_DMAS2R; + +/* --------------------------------------------------- */ +/* Luni-solar nutation: argument and term coefficients */ +/* --------------------------------------------------- */ + +/* The units for the sine and cosine coefficients are */ +/* 0.1 microarcsec and the same per Julian century */ + + static const struct { + int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */ + double ps,pst,pc; /* longitude sin, t*sin, cos coefficients */ + double ec,ect,es; /* obliquity cos, t*cos, sin coefficients */ + + } x[] = { + + /* 1-10 */ + { 0, 0, 0, 0,1, + -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0}, + { 0, 0, 2,-2,2, + -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0}, + { 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0}, + { 0, 0, 0, 0,2,2074554.0, 207.0, -698.0,-897492.0, 470.0,-291.0}, + { 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0}, + { 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0}, + { 1, 0, 0, 0,0, 711159.0, 73.0, -872.0, -6750.0, 0.0, 358.0}, + { 0, 0, 2, 0,1,-387298.0, -367.0, 380.0, 200728.0, 18.0, 318.0}, + { 1, 0, 2, 0,2,-301461.0, -36.0, 816.0, 129025.0, -63.0, 367.0}, + { 0,-1, 2,-2,2, 215829.0, -494.0, 111.0, -95929.0, 299.0, 132.0}, + + /* 11-20 */ + { 0, 0, 2,-2,1, 128227.0, 137.0, 181.0, -68982.0, -9.0, 39.0}, + {-1, 0, 2, 0,2, 123457.0, 11.0, 19.0, -53311.0, 32.0, -4.0}, + {-1, 0, 0, 2,0, 156994.0, 10.0, -168.0, -1235.0, 0.0, 82.0}, + { 1, 0, 0, 0,1, 63110.0, 63.0, 27.0, -33228.0, 0.0, -9.0}, + {-1, 0, 0, 0,1, -57976.0, -63.0, -189.0, 31429.0, 0.0, -75.0}, + {-1, 0, 2, 2,2, -59641.0, -11.0, 149.0, 25543.0, -11.0, 66.0}, + { 1, 0, 2, 0,1, -51613.0, -42.0, 129.0, 26366.0, 0.0, 78.0}, + {-2, 0, 2, 0,1, 45893.0, 50.0, 31.0, -24236.0, -10.0, 20.0}, + { 0, 0, 0, 2,0, 63384.0, 11.0, -150.0, -1220.0, 0.0, 29.0}, + { 0, 0, 2, 2,2, -38571.0, -1.0, 158.0, 16452.0, -11.0, 68.0}, + + /* 21-30 */ + { 0,-2, 2,-2,2, 32481.0, 0.0, 0.0, -13870.0, 0.0, 0.0}, + {-2, 0, 0, 2,0, -47722.0, 0.0, -18.0, 477.0, 0.0, -25.0}, + { 2, 0, 2, 0,2, -31046.0, -1.0, 131.0, 13238.0, -11.0, 59.0}, + { 1, 0, 2,-2,2, 28593.0, 0.0, -1.0, -12338.0, 10.0, -3.0}, + {-1, 0, 2, 0,1, 20441.0, 21.0, 10.0, -10758.0, 0.0, -3.0}, + { 2, 0, 0, 0,0, 29243.0, 0.0, -74.0, -609.0, 0.0, 13.0}, + { 0, 0, 2, 0,0, 25887.0, 0.0, -66.0, -550.0, 0.0, 11.0}, + { 0, 1, 0, 0,1, -14053.0, -25.0, 79.0, 8551.0, -2.0, -45.0}, + {-1, 0, 0, 2,1, 15164.0, 10.0, 11.0, -8001.0, 0.0, -1.0}, + { 0, 2, 2,-2,2, -15794.0, 72.0, -16.0, 6850.0, -42.0, -5.0}, + + /* 31-40 */ + { 0, 0,-2, 2,0, 21783.0, 0.0, 13.0, -167.0, 0.0, 13.0}, + { 1, 0, 0,-2,1, -12873.0, -10.0, -37.0, 6953.0, 0.0, -14.0}, + { 0,-1, 0, 0,1, -12654.0, 11.0, 63.0, 6415.0, 0.0, 26.0}, + {-1, 0, 2, 2,1, -10204.0, 0.0, 25.0, 5222.0, 0.0, 15.0}, + { 0, 2, 0, 0,0, 16707.0, -85.0, -10.0, 168.0, -1.0, 10.0}, + { 1, 0, 2, 2,2, -7691.0, 0.0, 44.0, 3268.0, 0.0, 19.0}, + {-2, 0, 2, 0,0, -11024.0, 0.0, -14.0, 104.0, 0.0, 2.0}, + { 0, 1, 2, 0,2, 7566.0, -21.0, -11.0, -3250.0, 0.0, -5.0}, + { 0, 0, 2, 2,1, -6637.0, -11.0, 25.0, 3353.0, 0.0, 14.0}, + { 0,-1, 2, 0,2, -7141.0, 21.0, 8.0, 3070.0, 0.0, 4.0}, + + /* 41-50 */ + { 0, 0, 0, 2,1, -6302.0, -11.0, 2.0, 3272.0, 0.0, 4.0}, + { 1, 0, 2,-2,1, 5800.0, 10.0, 2.0, -3045.0, 0.0, -1.0}, + { 2, 0, 2,-2,2, 6443.0, 0.0, -7.0, -2768.0, 0.0, -4.0}, + {-2, 0, 0, 2,1, -5774.0, -11.0, -15.0, 3041.0, 0.0, -5.0}, + { 2, 0, 2, 0,1, -5350.0, 0.0, 21.0, 2695.0, 0.0, 12.0}, + { 0,-1, 2,-2,1, -4752.0, -11.0, -3.0, 2719.0, 0.0, -3.0}, + { 0, 0, 0,-2,1, -4940.0, -11.0, -21.0, 2720.0, 0.0, -9.0}, + {-1,-1, 0, 2,0, 7350.0, 0.0, -8.0, -51.0, 0.0, 4.0}, + { 2, 0, 0,-2,1, 4065.0, 0.0, 6.0, -2206.0, 0.0, 1.0}, + { 1, 0, 0, 2,0, 6579.0, 0.0, -24.0, -199.0, 0.0, 2.0}, + + /* 51-60 */ + { 0, 1, 2,-2,1, 3579.0, 0.0, 5.0, -1900.0, 0.0, 1.0}, + { 1,-1, 0, 0,0, 4725.0, 0.0, -6.0, -41.0, 0.0, 3.0}, + {-2, 0, 2, 0,2, -3075.0, 0.0, -2.0, 1313.0, 0.0, -1.0}, + { 3, 0, 2, 0,2, -2904.0, 0.0, 15.0, 1233.0, 0.0, 7.0}, + { 0,-1, 0, 2,0, 4348.0, 0.0, -10.0, -81.0, 0.0, 2.0}, + { 1,-1, 2, 0,2, -2878.0, 0.0, 8.0, 1232.0, 0.0, 4.0}, + { 0, 0, 0, 1,0, -4230.0, 0.0, 5.0, -20.0, 0.0, -2.0}, + {-1,-1, 2, 2,2, -2819.0, 0.0, 7.0, 1207.0, 0.0, 3.0}, + {-1, 0, 2, 0,0, -4056.0, 0.0, 5.0, 40.0, 0.0, -2.0}, + { 0,-1, 2, 2,2, -2647.0, 0.0, 11.0, 1129.0, 0.0, 5.0}, + + /* 61-70 */ + {-2, 0, 0, 0,1, -2294.0, 0.0, -10.0, 1266.0, 0.0, -4.0}, + { 1, 1, 2, 0,2, 2481.0, 0.0, -7.0, -1062.0, 0.0, -3.0}, + { 2, 0, 0, 0,1, 2179.0, 0.0, -2.0, -1129.0, 0.0, -2.0}, + {-1, 1, 0, 1,0, 3276.0, 0.0, 1.0, -9.0, 0.0, 0.0}, + { 1, 1, 0, 0,0, -3389.0, 0.0, 5.0, 35.0, 0.0, -2.0}, + { 1, 0, 2, 0,0, 3339.0, 0.0, -13.0, -107.0, 0.0, 1.0}, + {-1, 0, 2,-2,1, -1987.0, 0.0, -6.0, 1073.0, 0.0, -2.0}, + { 1, 0, 0, 0,2, -1981.0, 0.0, 0.0, 854.0, 0.0, 0.0}, + {-1, 0, 0, 1,0, 4026.0, 0.0, -353.0, -553.0, 0.0,-139.0}, + { 0, 0, 2, 1,2, 1660.0, 0.0, -5.0, -710.0, 0.0, -2.0}, + + /* 71-77 */ + {-1, 0, 2, 4,2, -1521.0, 0.0, 9.0, 647.0, 0.0, 4.0}, + {-1, 1, 0, 1,1, 1314.0, 0.0, 0.0, -700.0, 0.0, 0.0}, + { 0,-2, 2,-2,1, -1283.0, 0.0, 0.0, 672.0, 0.0, 0.0}, + { 1, 0, 2, 2,1, -1331.0, 0.0, 8.0, 663.0, 0.0, 4.0}, + {-2, 0, 2, 2,2, 1383.0, 0.0, -2.0, -594.0, 0.0, -2.0}, + {-1, 0, 0, 0,2, 1405.0, 0.0, 4.0, -610.0, 0.0, 2.0}, + { 1, 1, 2,-2,2, 1290.0, 0.0, 0.0, -556.0, 0.0, 0.0} + }; + +/* Number of terms in the series */ + const int NLS = (int) (sizeof x / sizeof x[0]); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental epoch J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* --------------------*/ +/* LUNI-SOLAR NUTATION */ +/* --------------------*/ + +/* Fundamental (Delaunay) arguments from Simon et al. (1994) */ + +/* Mean anomaly of the Moon. */ + el = fmod(485868.249036 + (1717915923.2178) * t, ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean anomaly of the Sun. */ + elp = fmod(1287104.79305 + (129596581.0481) * t, ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean argument of the latitude of the Moon. */ + f = fmod(335779.526232 + (1739527262.8478) * t, ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean elongation of the Moon from the Sun. */ + d = fmod(1072260.70369 + (1602961601.2090) * t, ERFA_TURNAS) * ERFA_DAS2R; + +/* Mean longitude of the ascending node of the Moon. */ + om = fmod(450160.398036 + (-6962890.5431) * t, ERFA_TURNAS) * ERFA_DAS2R; + +/* Initialize the nutation values. */ + dp = 0.0; + de = 0.0; + +/* Summation of luni-solar nutation series (smallest terms first). */ + for (i = NLS-1; i >= 0; i--) { + + /* Argument and functions. */ + arg = fmod( (double)x[i].nl * el + + (double)x[i].nlp * elp + + (double)x[i].nf * f + + (double)x[i].nd * d + + (double)x[i].nom * om, ERFA_D2PI ); + sarg = sin(arg); + carg = cos(arg); + + /* Term. */ + dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg; + de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg; + } + +/* Convert from 0.1 microarcsec units to radians. */ + dpsils = dp * U2R; + depsls = de * U2R; + +/* ------------------------------*/ +/* IN LIEU OF PLANETARY NUTATION */ +/* ------------------------------*/ + +/* Fixed offset to correct for missing terms in truncated series. */ + dpsipl = DPPLAN; + depspl = DEPLAN; + +/* --------*/ +/* RESULTS */ +/* --------*/ + +/* Add luni-solar and planetary components. */ + *dpsi = dpsils + dpsipl; + *deps = depsls + depspl; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/nut06a.c b/testbed/astropy__astropy/cextern/erfa/nut06a.c new file mode 100644 index 0000000000000000000000000000000000000000..2b94f83bd8f7262a822b794bd7b95159f4bdc1ec --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/nut06a.c @@ -0,0 +1,162 @@ +#include "erfa.h" + +void eraNut06a(double date1, double date2, double *dpsi, double *deps) +/* +** - - - - - - - - - - +** e r a N u t 0 6 a +** - - - - - - - - - - +** +** IAU 2000A nutation with adjustments to match the IAU 2006 +** precession. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation, luni-solar + planetary (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components in longitude and obliquity are in radians +** and with respect to the mean equinox and ecliptic of date, +** IAU 2006 precession model (Hilton et al. 2006, Capitaine et al. +** 2005). +** +** 3) The function first computes the IAU 2000A nutation, then applies +** adjustments for (i) the consequences of the change in obliquity +** from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the +** secular variation in the Earth's dynamical form factor J2. +** +** 4) The present function provides classical nutation, complementing +** the IAU 2000 frame bias and IAU 2006 precession. It delivers a +** pole which is at current epochs accurate to a few tens of +** microarcseconds, apart from the free core nutation. +** +** Called: +** eraNut00a nutation, IAU 2000A +** +** References: +** +** Chapront, J., Chapront-Touze, M. & Francou, G. 2002, +** Astron.Astrophys. 387, 700 +** +** Lieske, J.H., Lederle, T., Fricke, W. & Morando, B. 1977, +** Astron.Astrophys. 58, 1-16 +** +** Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res. +** 107, B4. The MHB_2000 code itself was obtained on 9th September +** 2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A. +** +** Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Wallace, P.T., "Software for Implementing the IAU 2000 +** Resolutions", in IERS Workshop 5.1 (2002) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, fj2, dp, de; + + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Factor correcting for secular variation of J2. */ + fj2 = -2.7774e-6 * t; + +/* Obtain IAU 2000A nutation. */ + eraNut00a(date1, date2, &dp, &de); + +/* Apply P03 adjustments (Wallace & Capitaine, 2006, Eqs.5). */ + *dpsi = dp + dp * (0.4697e-6 + fj2); + *deps = de + de * fj2; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/nut80.c b/testbed/astropy__astropy/cextern/erfa/nut80.c new file mode 100644 index 0000000000000000000000000000000000000000..633a6d116f17035113b41fc3719b90c648c8f8d4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/nut80.c @@ -0,0 +1,334 @@ +#include "erfa.h" + +void eraNut80(double date1, double date2, double *dpsi, double *deps) +/* +** - - - - - - - - - +** e r a N u t 8 0 +** - - - - - - - - - +** +** Nutation, IAU 1980 model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi double nutation in longitude (radians) +** deps double nutation in obliquity (radians) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components are with respect to the ecliptic of +** date. +** +** Called: +** eraAnpm normalize angle into range +/- pi +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.222 (p111). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, el, elp, f, d, om, dp, de, arg, s, c; + int j; + +/* Units of 0.1 milliarcsecond to radians */ + const double U2R = ERFA_DAS2R / 1e4; + +/* ------------------------------------------------ */ +/* Table of multiples of arguments and coefficients */ +/* ------------------------------------------------ */ + +/* The units for the sine and cosine coefficients are 0.1 mas and */ +/* the same per Julian century */ + + static const struct { + int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */ + double sp,spt; /* longitude sine, 1 and t coefficients */ + double ce,cet; /* obliquity cosine, 1 and t coefficients */ + } x[] = { + + /* 1-10 */ + { 0, 0, 0, 0, 1, -171996.0, -174.2, 92025.0, 8.9 }, + { 0, 0, 0, 0, 2, 2062.0, 0.2, -895.0, 0.5 }, + { -2, 0, 2, 0, 1, 46.0, 0.0, -24.0, 0.0 }, + { 2, 0, -2, 0, 0, 11.0, 0.0, 0.0, 0.0 }, + { -2, 0, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 }, + { 1, -1, 0, -1, 0, -3.0, 0.0, 0.0, 0.0 }, + { 0, -2, 2, -2, 1, -2.0, 0.0, 1.0, 0.0 }, + { 2, 0, -2, 0, 1, 1.0, 0.0, 0.0, 0.0 }, + { 0, 0, 2, -2, 2, -13187.0, -1.6, 5736.0, -3.1 }, + { 0, 1, 0, 0, 0, 1426.0, -3.4, 54.0, -0.1 }, + + /* 11-20 */ + { 0, 1, 2, -2, 2, -517.0, 1.2, 224.0, -0.6 }, + { 0, -1, 2, -2, 2, 217.0, -0.5, -95.0, 0.3 }, + { 0, 0, 2, -2, 1, 129.0, 0.1, -70.0, 0.0 }, + { 2, 0, 0, -2, 0, 48.0, 0.0, 1.0, 0.0 }, + { 0, 0, 2, -2, 0, -22.0, 0.0, 0.0, 0.0 }, + { 0, 2, 0, 0, 0, 17.0, -0.1, 0.0, 0.0 }, + { 0, 1, 0, 0, 1, -15.0, 0.0, 9.0, 0.0 }, + { 0, 2, 2, -2, 2, -16.0, 0.1, 7.0, 0.0 }, + { 0, -1, 0, 0, 1, -12.0, 0.0, 6.0, 0.0 }, + { -2, 0, 0, 2, 1, -6.0, 0.0, 3.0, 0.0 }, + + /* 21-30 */ + { 0, -1, 2, -2, 1, -5.0, 0.0, 3.0, 0.0 }, + { 2, 0, 0, -2, 1, 4.0, 0.0, -2.0, 0.0 }, + { 0, 1, 2, -2, 1, 4.0, 0.0, -2.0, 0.0 }, + { 1, 0, 0, -1, 0, -4.0, 0.0, 0.0, 0.0 }, + { 2, 1, 0, -2, 0, 1.0, 0.0, 0.0, 0.0 }, + { 0, 0, -2, 2, 1, 1.0, 0.0, 0.0, 0.0 }, + { 0, 1, -2, 2, 0, -1.0, 0.0, 0.0, 0.0 }, + { 0, 1, 0, 0, 2, 1.0, 0.0, 0.0, 0.0 }, + { -1, 0, 0, 1, 1, 1.0, 0.0, 0.0, 0.0 }, + { 0, 1, 2, -2, 0, -1.0, 0.0, 0.0, 0.0 }, + + /* 31-40 */ + { 0, 0, 2, 0, 2, -2274.0, -0.2, 977.0, -0.5 }, + { 1, 0, 0, 0, 0, 712.0, 0.1, -7.0, 0.0 }, + { 0, 0, 2, 0, 1, -386.0, -0.4, 200.0, 0.0 }, + { 1, 0, 2, 0, 2, -301.0, 0.0, 129.0, -0.1 }, + { 1, 0, 0, -2, 0, -158.0, 0.0, -1.0, 0.0 }, + { -1, 0, 2, 0, 2, 123.0, 0.0, -53.0, 0.0 }, + { 0, 0, 0, 2, 0, 63.0, 0.0, -2.0, 0.0 }, + { 1, 0, 0, 0, 1, 63.0, 0.1, -33.0, 0.0 }, + { -1, 0, 0, 0, 1, -58.0, -0.1, 32.0, 0.0 }, + { -1, 0, 2, 2, 2, -59.0, 0.0, 26.0, 0.0 }, + + /* 41-50 */ + { 1, 0, 2, 0, 1, -51.0, 0.0, 27.0, 0.0 }, + { 0, 0, 2, 2, 2, -38.0, 0.0, 16.0, 0.0 }, + { 2, 0, 0, 0, 0, 29.0, 0.0, -1.0, 0.0 }, + { 1, 0, 2, -2, 2, 29.0, 0.0, -12.0, 0.0 }, + { 2, 0, 2, 0, 2, -31.0, 0.0, 13.0, 0.0 }, + { 0, 0, 2, 0, 0, 26.0, 0.0, -1.0, 0.0 }, + { -1, 0, 2, 0, 1, 21.0, 0.0, -10.0, 0.0 }, + { -1, 0, 0, 2, 1, 16.0, 0.0, -8.0, 0.0 }, + { 1, 0, 0, -2, 1, -13.0, 0.0, 7.0, 0.0 }, + { -1, 0, 2, 2, 1, -10.0, 0.0, 5.0, 0.0 }, + + /* 51-60 */ + { 1, 1, 0, -2, 0, -7.0, 0.0, 0.0, 0.0 }, + { 0, 1, 2, 0, 2, 7.0, 0.0, -3.0, 0.0 }, + { 0, -1, 2, 0, 2, -7.0, 0.0, 3.0, 0.0 }, + { 1, 0, 2, 2, 2, -8.0, 0.0, 3.0, 0.0 }, + { 1, 0, 0, 2, 0, 6.0, 0.0, 0.0, 0.0 }, + { 2, 0, 2, -2, 2, 6.0, 0.0, -3.0, 0.0 }, + { 0, 0, 0, 2, 1, -6.0, 0.0, 3.0, 0.0 }, + { 0, 0, 2, 2, 1, -7.0, 0.0, 3.0, 0.0 }, + { 1, 0, 2, -2, 1, 6.0, 0.0, -3.0, 0.0 }, + { 0, 0, 0, -2, 1, -5.0, 0.0, 3.0, 0.0 }, + + /* 61-70 */ + { 1, -1, 0, 0, 0, 5.0, 0.0, 0.0, 0.0 }, + { 2, 0, 2, 0, 1, -5.0, 0.0, 3.0, 0.0 }, + { 0, 1, 0, -2, 0, -4.0, 0.0, 0.0, 0.0 }, + { 1, 0, -2, 0, 0, 4.0, 0.0, 0.0, 0.0 }, + { 0, 0, 0, 1, 0, -4.0, 0.0, 0.0, 0.0 }, + { 1, 1, 0, 0, 0, -3.0, 0.0, 0.0, 0.0 }, + { 1, 0, 2, 0, 0, 3.0, 0.0, 0.0, 0.0 }, + { 1, -1, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 }, + { -1, -1, 2, 2, 2, -3.0, 0.0, 1.0, 0.0 }, + { -2, 0, 0, 0, 1, -2.0, 0.0, 1.0, 0.0 }, + + /* 71-80 */ + { 3, 0, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 }, + { 0, -1, 2, 2, 2, -3.0, 0.0, 1.0, 0.0 }, + { 1, 1, 2, 0, 2, 2.0, 0.0, -1.0, 0.0 }, + { -1, 0, 2, -2, 1, -2.0, 0.0, 1.0, 0.0 }, + { 2, 0, 0, 0, 1, 2.0, 0.0, -1.0, 0.0 }, + { 1, 0, 0, 0, 2, -2.0, 0.0, 1.0, 0.0 }, + { 3, 0, 0, 0, 0, 2.0, 0.0, 0.0, 0.0 }, + { 0, 0, 2, 1, 2, 2.0, 0.0, -1.0, 0.0 }, + { -1, 0, 0, 0, 2, 1.0, 0.0, -1.0, 0.0 }, + { 1, 0, 0, -4, 0, -1.0, 0.0, 0.0, 0.0 }, + + /* 81-90 */ + { -2, 0, 2, 2, 2, 1.0, 0.0, -1.0, 0.0 }, + { -1, 0, 2, 4, 2, -2.0, 0.0, 1.0, 0.0 }, + { 2, 0, 0, -4, 0, -1.0, 0.0, 0.0, 0.0 }, + { 1, 1, 2, -2, 2, 1.0, 0.0, -1.0, 0.0 }, + { 1, 0, 2, 2, 1, -1.0, 0.0, 1.0, 0.0 }, + { -2, 0, 2, 4, 2, -1.0, 0.0, 1.0, 0.0 }, + { -1, 0, 4, 0, 2, 1.0, 0.0, 0.0, 0.0 }, + { 1, -1, 0, -2, 0, 1.0, 0.0, 0.0, 0.0 }, + { 2, 0, 2, -2, 1, 1.0, 0.0, -1.0, 0.0 }, + { 2, 0, 2, 2, 2, -1.0, 0.0, 0.0, 0.0 }, + + /* 91-100 */ + { 1, 0, 0, 2, 1, -1.0, 0.0, 0.0, 0.0 }, + { 0, 0, 4, -2, 2, 1.0, 0.0, 0.0, 0.0 }, + { 3, 0, 2, -2, 2, 1.0, 0.0, 0.0, 0.0 }, + { 1, 0, 2, -2, 0, -1.0, 0.0, 0.0, 0.0 }, + { 0, 1, 2, 0, 1, 1.0, 0.0, 0.0, 0.0 }, + { -1, -1, 0, 2, 1, 1.0, 0.0, 0.0, 0.0 }, + { 0, 0, -2, 0, 1, -1.0, 0.0, 0.0, 0.0 }, + { 0, 0, 2, -1, 2, -1.0, 0.0, 0.0, 0.0 }, + { 0, 1, 0, 2, 0, -1.0, 0.0, 0.0, 0.0 }, + { 1, 0, -2, -2, 0, -1.0, 0.0, 0.0, 0.0 }, + + /* 101-106 */ + { 0, -1, 2, 0, 1, -1.0, 0.0, 0.0, 0.0 }, + { 1, 1, 0, -2, 1, -1.0, 0.0, 0.0, 0.0 }, + { 1, 0, -2, 2, 0, -1.0, 0.0, 0.0, 0.0 }, + { 2, 0, 0, 2, 0, 1.0, 0.0, 0.0, 0.0 }, + { 0, 0, 2, 4, 2, -1.0, 0.0, 0.0, 0.0 }, + { 0, 1, 0, 1, 0, 1.0, 0.0, 0.0, 0.0 } + }; + +/* Number of terms in the series */ + const int NT = (int) (sizeof x / sizeof x[0]); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental epoch J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* --------------------- */ +/* Fundamental arguments */ +/* --------------------- */ + +/* Mean longitude of Moon minus mean longitude of Moon's perigee. */ + el = eraAnpm( + (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t) + * ERFA_DAS2R + fmod(1325.0 * t, 1.0) * ERFA_D2PI); + +/* Mean longitude of Sun minus mean longitude of Sun's perigee. */ + elp = eraAnpm( + (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t) + * ERFA_DAS2R + fmod(99.0 * t, 1.0) * ERFA_D2PI); + +/* Mean longitude of Moon minus mean longitude of Moon's node. */ + f = eraAnpm( + (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t) + * ERFA_DAS2R + fmod(1342.0 * t, 1.0) * ERFA_D2PI); + +/* Mean elongation of Moon from Sun. */ + d = eraAnpm( + (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t) + * ERFA_DAS2R + fmod(1236.0 * t, 1.0) * ERFA_D2PI); + +/* Longitude of the mean ascending node of the lunar orbit on the */ +/* ecliptic, measured from the mean equinox of date. */ + om = eraAnpm( + (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t) + * ERFA_DAS2R + fmod(-5.0 * t, 1.0) * ERFA_D2PI); + +/* --------------- */ +/* Nutation series */ +/* --------------- */ + +/* Initialize nutation components. */ + dp = 0.0; + de = 0.0; + +/* Sum the nutation terms, ending with the biggest. */ + for (j = NT-1; j >= 0; j--) { + + /* Form argument for current term. */ + arg = (double)x[j].nl * el + + (double)x[j].nlp * elp + + (double)x[j].nf * f + + (double)x[j].nd * d + + (double)x[j].nom * om; + + /* Accumulate current nutation term. */ + s = x[j].sp + x[j].spt * t; + c = x[j].ce + x[j].cet * t; + if (s != 0.0) dp += s * sin(arg); + if (c != 0.0) de += c * cos(arg); + } + +/* Convert results from 0.1 mas units to radians. */ + *dpsi = dp * U2R; + *deps = de * U2R; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/nutm80.c b/testbed/astropy__astropy/cextern/erfa/nutm80.c new file mode 100644 index 0000000000000000000000000000000000000000..7905cfc4213154aa40babb147afb5e91f41f2f06 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/nutm80.c @@ -0,0 +1,126 @@ +#include "erfa.h" + +void eraNutm80(double date1, double date2, double rmatn[3][3]) +/* +** - - - - - - - - - - +** e r a N u t m 8 0 +** - - - - - - - - - - +** +** Form the matrix of nutation for a given date, IAU 1980 model. +** +** Given: +** date1,date2 double TDB date (Note 1) +** +** Returned: +** rmatn double[3][3] nutation matrix +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(true) = rmatn * V(mean), +** where the p-vector V(true) is with respect to the true +** equatorial triad of date and the p-vector V(mean) is with +** respect to the mean equatorial triad of date. +** +** Called: +** eraNut80 nutation, IAU 1980 +** eraObl80 mean obliquity, IAU 1980 +** eraNumat form nutation matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsi, deps, epsa; + + +/* Nutation components and mean obliquity. */ + eraNut80(date1, date2, &dpsi, &deps); + epsa = eraObl80(date1, date2); + +/* Build the rotation matrix. */ + eraNumat(epsa, dpsi, deps, rmatn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/obl06.c b/testbed/astropy__astropy/cextern/erfa/obl06.c new file mode 100644 index 0000000000000000000000000000000000000000..7755ea7633d75d21fc61dbae0fd818ad39e6d3b5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/obl06.c @@ -0,0 +1,127 @@ +#include "erfa.h" + +double eraObl06(double date1, double date2) +/* +** - - - - - - - - - +** e r a O b l 0 6 +** - - - - - - - - - +** +** Mean obliquity of the ecliptic, IAU 2006 precession model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double obliquity of the ecliptic (radians, Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result is the angle between the ecliptic and mean equator of +** date date1+date2. +** +** Reference: +** +** Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, eps0; + + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Mean obliquity. */ + eps0 = (84381.406 + + (-46.836769 + + ( -0.0001831 + + ( 0.00200340 + + ( -0.000000576 + + ( -0.0000000434) * t) * t) * t) * t) * t) * ERFA_DAS2R; + + return eps0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/obl80.c b/testbed/astropy__astropy/cextern/erfa/obl80.c new file mode 100644 index 0000000000000000000000000000000000000000..06d0312ec660068d0a52464da33c5e8772bd5f27 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/obl80.c @@ -0,0 +1,127 @@ +#include "erfa.h" + +double eraObl80(double date1, double date2) +/* +** - - - - - - - - - +** e r a O b l 8 0 +** - - - - - - - - - +** +** Mean obliquity of the ecliptic, IAU 1980 model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double obliquity of the ecliptic (radians, Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The result is the angle between the ecliptic and mean equator of +** date date1+date2. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Expression 3.222-1 (p114). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, eps0; + + +/* Interval between fundamental epoch J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Mean obliquity of date. */ + eps0 = ERFA_DAS2R * (84381.448 + + (-46.8150 + + (-0.00059 + + ( 0.001813) * t) * t) * t); + + return eps0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/p06e.c b/testbed/astropy__astropy/cextern/erfa/p06e.c new file mode 100644 index 0000000000000000000000000000000000000000..28833c85c3e6ac0042135ba8142852b3c86588c5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/p06e.c @@ -0,0 +1,330 @@ +#include "erfa.h" + +void eraP06e(double date1, double date2, + double *eps0, double *psia, double *oma, double *bpa, + double *bqa, double *pia, double *bpia, + double *epsa, double *chia, double *za, double *zetaa, + double *thetaa, double *pa, + double *gam, double *phi, double *psi) +/* +** - - - - - - - - +** e r a P 0 6 e +** - - - - - - - - +** +** Precession angles, IAU 2006, equinox based. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (see Note 2): +** eps0 double epsilon_0 +** psia double psi_A +** oma double omega_A +** bpa double P_A +** bqa double Q_A +** pia double pi_A +** bpia double Pi_A +** epsa double obliquity epsilon_A +** chia double chi_A +** za double z_A +** zetaa double zeta_A +** thetaa double theta_A +** pa double p_A +** gam double F-W angle gamma_J2000 +** phi double F-W angle phi_J2000 +** psi double F-W angle psi_J2000 +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) This function returns the set of equinox based angles for the +** Capitaine et al. "P03" precession theory, adopted by the IAU in +** 2006. The angles are set out in Table 1 of Hilton et al. (2006): +** +** eps0 epsilon_0 obliquity at J2000.0 +** psia psi_A luni-solar precession +** oma omega_A inclination of equator wrt J2000.0 ecliptic +** bpa P_A ecliptic pole x, J2000.0 ecliptic triad +** bqa Q_A ecliptic pole -y, J2000.0 ecliptic triad +** pia pi_A angle between moving and J2000.0 ecliptics +** bpia Pi_A longitude of ascending node of the ecliptic +** epsa epsilon_A obliquity of the ecliptic +** chia chi_A planetary precession +** za z_A equatorial precession: -3rd 323 Euler angle +** zetaa zeta_A equatorial precession: -1st 323 Euler angle +** thetaa theta_A equatorial precession: 2nd 323 Euler angle +** pa p_A general precession +** gam gamma_J2000 J2000.0 RA difference of ecliptic poles +** phi phi_J2000 J2000.0 codeclination of ecliptic pole +** psi psi_J2000 longitude difference of equator poles, J2000.0 +** +** The returned values are all radians. +** +** 3) Hilton et al. (2006) Table 1 also contains angles that depend on +** models distinct from the P03 precession theory itself, namely the +** IAU 2000A frame bias and nutation. The quoted polynomials are +** used in other ERFA functions: +** +** . eraXy06 contains the polynomial parts of the X and Y series. +** +** . eraS06 contains the polynomial part of the s+XY/2 series. +** +** . eraPfw06 implements the series for the Fukushima-Williams +** angles that are with respect to the GCRS pole (i.e. the variants +** that include frame bias). +** +** 4) The IAU resolution stipulated that the choice of parameterization +** was left to the user, and so an IAU compliant precession +** implementation can be constructed using various combinations of +** the angles returned by the present function. +** +** 5) The parameterization used by ERFA is the version of the Fukushima- +** Williams angles that refers directly to the GCRS pole. These +** angles may be calculated by calling the function eraPfw06. ERFA +** also supports the direct computation of the CIP GCRS X,Y by +** series, available by calling eraXy06. +** +** 6) The agreement between the different parameterizations is at the +** 1 microarcsecond level in the present era. +** +** 7) When constructing a precession formulation that refers to the GCRS +** pole rather than the dynamical pole, it may (depending on the +** choice of angles) be necessary to introduce the frame bias +** explicitly. +** +** 8) It is permissible to re-use the same variable in the returned +** arguments. The quantities are stored in the stated order. +** +** Reference: +** +** Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 +** +** Called: +** eraObl06 mean obliquity, IAU 2006 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t; + + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Obliquity at J2000.0. */ + + *eps0 = 84381.406 * ERFA_DAS2R; + +/* Luni-solar precession. */ + + *psia = ( 5038.481507 + + ( -1.0790069 + + ( -0.00114045 + + ( 0.000132851 + + ( -0.0000000951 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Inclination of mean equator with respect to the J2000.0 ecliptic. */ + + *oma = *eps0 + ( -0.025754 + + ( 0.0512623 + + ( -0.00772503 + + ( -0.000000467 + + ( 0.0000003337 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Ecliptic pole x, J2000.0 ecliptic triad. */ + + *bpa = ( 4.199094 + + ( 0.1939873 + + ( -0.00022466 + + ( -0.000000912 + + ( 0.0000000120 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Ecliptic pole -y, J2000.0 ecliptic triad. */ + + *bqa = ( -46.811015 + + ( 0.0510283 + + ( 0.00052413 + + ( -0.000000646 + + ( -0.0000000172 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Angle between moving and J2000.0 ecliptics. */ + + *pia = ( 46.998973 + + ( -0.0334926 + + ( -0.00012559 + + ( 0.000000113 + + ( -0.0000000022 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Longitude of ascending node of the moving ecliptic. */ + + *bpia = ( 629546.7936 + + ( -867.95758 + + ( 0.157992 + + ( -0.0005371 + + ( -0.00004797 + + ( 0.000000072 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + +/* Mean obliquity of the ecliptic. */ + + *epsa = eraObl06(date1, date2); + +/* Planetary precession. */ + + *chia = ( 10.556403 + + ( -2.3814292 + + ( -0.00121197 + + ( 0.000170663 + + ( -0.0000000560 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Equatorial precession: minus the third of the 323 Euler angles. */ + + *za = ( -2.650545 + + ( 2306.077181 + + ( 1.0927348 + + ( 0.01826837 + + ( -0.000028596 + + ( -0.0000002904 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + +/* Equatorial precession: minus the first of the 323 Euler angles. */ + + *zetaa = ( 2.650545 + + ( 2306.083227 + + ( 0.2988499 + + ( 0.01801828 + + ( -0.000005971 + + ( -0.0000003173 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + +/* Equatorial precession: second of the 323 Euler angles. */ + + *thetaa = ( 2004.191903 + + ( -0.4294934 + + ( -0.04182264 + + ( -0.000007089 + + ( -0.0000001274 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* General precession. */ + + *pa = ( 5028.796195 + + ( 1.1054348 + + ( 0.00007964 + + ( -0.000023857 + + ( 0.0000000383 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + +/* Fukushima-Williams angles for precession. */ + + *gam = ( 10.556403 + + ( 0.4932044 + + ( -0.00031238 + + ( -0.000002788 + + ( 0.0000000260 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + + *phi = *eps0 + ( -46.811015 + + ( 0.0511269 + + ( 0.00053289 + + ( -0.000000440 + + ( -0.0000000176 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + + *psi = ( 5038.481507 + + ( 1.5584176 + + ( -0.00018522 + + ( -0.000026452 + + ( -0.0000000148 ) + * t) * t) * t) * t) * t * ERFA_DAS2R; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/p2pv.c b/testbed/astropy__astropy/cextern/erfa/p2pv.c new file mode 100644 index 0000000000000000000000000000000000000000..e87509e689ed5f3e643263e5574161a48060b265 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/p2pv.c @@ -0,0 +1,92 @@ +#include "erfa.h" + +void eraP2pv(double p[3], double pv[2][3]) +/* +** - - - - - - - - +** e r a P 2 p v +** - - - - - - - - +** +** Extend a p-vector to a pv-vector by appending a zero velocity. +** +** Given: +** p double[3] p-vector +** +** Returned: +** pv double[2][3] pv-vector +** +** Called: +** eraCp copy p-vector +** eraZp zero p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(p, pv[0]); + eraZp(pv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/p2s.c b/testbed/astropy__astropy/cextern/erfa/p2s.c new file mode 100644 index 0000000000000000000000000000000000000000..148edc3717a8e1aa2d890113819ad3606624c04d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/p2s.c @@ -0,0 +1,100 @@ +#include "erfa.h" + +void eraP2s(double p[3], double *theta, double *phi, double *r) +/* +** - - - - - - - +** e r a P 2 s +** - - - - - - - +** +** P-vector to spherical polar coordinates. +** +** Given: +** p double[3] p-vector +** +** Returned: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** r double radial distance +** +** Notes: +** +** 1) If P is null, zero theta, phi and r are returned. +** +** 2) At either pole, zero theta is returned. +** +** Called: +** eraC2s p-vector to spherical +** eraPm modulus of p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraC2s(p, theta, phi); + *r = eraPm(p); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pap.c b/testbed/astropy__astropy/cextern/erfa/pap.c new file mode 100644 index 0000000000000000000000000000000000000000..989e2d731345c8e52f9e6e0f546307ba9e0bcd95 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pap.c @@ -0,0 +1,148 @@ +#include "erfa.h" + +double eraPap(double a[3], double b[3]) +/* +** - - - - - - - +** e r a P a p +** - - - - - - - +** +** Position-angle from two p-vectors. +** +** Given: +** a double[3] direction of reference point +** b double[3] direction of point whose PA is required +** +** Returned (function value): +** double position angle of b with respect to a (radians) +** +** Notes: +** +** 1) The result is the position angle, in radians, of direction b with +** respect to direction a. It is in the range -pi to +pi. The +** sense is such that if b is a small distance "north" of a the +** position angle is approximately zero, and if b is a small +** distance "east" of a the position angle is approximately +pi/2. +** +** 2) The vectors a and b need not be of unit length. +** +** 3) Zero is returned if the two directions are the same or if either +** vector is null. +** +** 4) If vector a is at a pole, the result is ill-defined. +** +** Called: +** eraPn decompose p-vector into modulus and direction +** eraPm modulus of p-vector +** eraPxp vector product of two p-vectors +** eraPmp p-vector minus p-vector +** eraPdp scalar product of two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double am, au[3], bm, st, ct, xa, ya, za, eta[3], xi[3], a2b[3], pa; + + +/* Modulus and direction of the a vector. */ + eraPn(a, &am, au); + +/* Modulus of the b vector. */ + bm = eraPm(b); + +/* Deal with the case of a null vector. */ + if ((am == 0.0) || (bm == 0.0)) { + st = 0.0; + ct = 1.0; + } else { + + /* The "north" axis tangential from a (arbitrary length). */ + xa = a[0]; + ya = a[1]; + za = a[2]; + eta[0] = -xa * za; + eta[1] = -ya * za; + eta[2] = xa*xa + ya*ya; + + /* The "east" axis tangential from a (same length). */ + eraPxp(eta, au, xi); + + /* The vector from a to b. */ + eraPmp(b, a, a2b); + + /* Resolve into components along the north and east axes. */ + st = eraPdp(a2b, xi); + ct = eraPdp(a2b, eta); + + /* Deal with degenerate cases. */ + if ((st == 0.0) && (ct == 0.0)) ct = 1.0; + } + +/* Position angle. */ + pa = atan2(st, ct); + + return pa; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pas.c b/testbed/astropy__astropy/cextern/erfa/pas.c new file mode 100644 index 0000000000000000000000000000000000000000..d16e539ddab3b9d95608b17db5fe40508c3a417b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pas.c @@ -0,0 +1,105 @@ +#include "erfa.h" + +double eraPas(double al, double ap, double bl, double bp) +/* +** - - - - - - - +** e r a P a s +** - - - - - - - +** +** Position-angle from spherical coordinates. +** +** Given: +** al double longitude of point A (e.g. RA) in radians +** ap double latitude of point A (e.g. Dec) in radians +** bl double longitude of point B +** bp double latitude of point B +** +** Returned (function value): +** double position angle of B with respect to A +** +** Notes: +** +** 1) The result is the bearing (position angle), in radians, of point +** B with respect to point A. It is in the range -pi to +pi. The +** sense is such that if B is a small distance "east" of point A, +** the bearing is approximately +pi/2. +** +** 2) Zero is returned if the two points are coincident. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dl, x, y, pa; + + + dl = bl - al; + y = sin(dl) * cos(bp); + x = sin(bp) * cos(ap) - cos(bp) * sin(ap) * cos(dl); + pa = ((x != 0.0) || (y != 0.0)) ? atan2(y, x) : 0.0; + + return pa; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pb06.c b/testbed/astropy__astropy/cextern/erfa/pb06.c new file mode 100644 index 0000000000000000000000000000000000000000..13691ad672e403b628e4ae543b3a53b5ba45b83d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pb06.c @@ -0,0 +1,153 @@ +#include "erfa.h" + +void eraPb06(double date1, double date2, + double *bzeta, double *bz, double *btheta) +/* +** - - - - - - - - +** e r a P b 0 6 +** - - - - - - - - +** +** This function forms three Euler angles which implement general +** precession from epoch J2000.0, using the IAU 2006 model. Frame +** bias (the offset between ICRS and mean J2000.0) is included. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** bzeta double 1st rotation: radians cw around z +** bz double 3rd rotation: radians cw around z +** btheta double 2nd rotation: radians ccw around y +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The traditional accumulated precession angles zeta_A, z_A, +** theta_A cannot be obtained in the usual way, namely through +** polynomial expressions, because of the frame bias. The latter +** means that two of the angles undergo rapid changes near this +** date. They are instead the results of decomposing the +** precession-bias matrix obtained by using the Fukushima-Williams +** method, which does not suffer from the problem. The +** decomposition returns values which can be used in the +** conventional formulation and which include frame bias. +** +** 3) The three angles are returned in the conventional order, which +** is not the same as the order of the corresponding Euler +** rotations. The precession-bias matrix is +** R_3(-z) x R_2(+theta) x R_3(-zeta). +** +** 4) Should zeta_A, z_A, theta_A angles be required that do not +** contain frame bias, they are available by calling the ERFA +** function eraP06e. +** +** Called: +** eraPmat06 PB matrix, IAU 2006 +** eraRz rotate around Z-axis +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r[3][3], r31, r32; + + +/* Precession matrix via Fukushima-Williams angles. */ + eraPmat06(date1, date2, r); + +/* Solve for z. */ + *bz = atan2(r[1][2], r[0][2]); + +/* Remove it from the matrix. */ + eraRz(*bz, r); + +/* Solve for the remaining two angles. */ + *bzeta = atan2 (r[1][0], r[1][1]); + r31 = r[2][0]; + r32 = r[2][1]; + *btheta = atan2(-ERFA_DSIGN(sqrt(r31 * r31 + r32 * r32), r[0][2]), + r[2][2]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pdp.c b/testbed/astropy__astropy/cextern/erfa/pdp.c new file mode 100644 index 0000000000000000000000000000000000000000..fb28d170ec52b4b1481acb13c49f149ab055a642 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pdp.c @@ -0,0 +1,93 @@ +#include "erfa.h" + +double eraPdp(double a[3], double b[3]) +/* +** - - - - - - - +** e r a P d p +** - - - - - - - +** +** p-vector inner (=scalar=dot) product. +** +** Given: +** a double[3] first p-vector +** b double[3] second p-vector +** +** Returned (function value): +** double a . b +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double w; + + + w = a[0] * b[0] + + a[1] * b[1] + + a[2] * b[2]; + + return w; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pfw06.c b/testbed/astropy__astropy/cextern/erfa/pfw06.c new file mode 100644 index 0000000000000000000000000000000000000000..d520e673c235d655c5ef60cc4ba81e204b867707 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pfw06.c @@ -0,0 +1,174 @@ +#include "erfa.h" + +void eraPfw06(double date1, double date2, + double *gamb, double *phib, double *psib, double *epsa) +/* +** - - - - - - - - - +** e r a P f w 0 6 +** - - - - - - - - - +** +** Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation). +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** gamb double F-W angle gamma_bar (radians) +** phib double F-W angle phi_bar (radians) +** psib double F-W angle psi_bar (radians) +** epsa double F-W angle epsilon_A (radians) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) Naming the following points: +** +** e = J2000.0 ecliptic pole, +** p = GCRS pole, +** E = mean ecliptic pole of date, +** and P = mean pole of date, +** +** the four Fukushima-Williams angles are as follows: +** +** gamb = gamma_bar = epE +** phib = phi_bar = pE +** psib = psi_bar = pEP +** epsa = epsilon_A = EP +** +** 3) The matrix representing the combined effects of frame bias and +** precession is: +** +** PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb) +** +** 4) The matrix representing the combined effects of frame bias, +** precession and nutation is simply: +** +** NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb) +** +** where dP and dE are the nutation components with respect to the +** ecliptic of date. +** +** Reference: +** +** Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351 +** +** Called: +** eraObl06 mean obliquity, IAU 2006 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t; + + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* P03 bias+precession angles. */ + *gamb = ( -0.052928 + + ( 10.556378 + + ( 0.4932044 + + ( -0.00031238 + + ( -0.000002788 + + ( 0.0000000260 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + *phib = ( 84381.412819 + + ( -46.811016 + + ( 0.0511268 + + ( 0.00053289 + + ( -0.000000440 + + ( -0.0000000176 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + *psib = ( -0.041775 + + ( 5038.481484 + + ( 1.5584175 + + ( -0.00018522 + + ( -0.000026452 + + ( -0.0000000148 ) + * t) * t) * t) * t) * t) * ERFA_DAS2R; + *epsa = eraObl06(date1, date2); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/plan94.c b/testbed/astropy__astropy/cextern/erfa/plan94.c new file mode 100644 index 0000000000000000000000000000000000000000..22b9a1a62ee7fd6edc99c6a44556aca22d5387ba --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/plan94.c @@ -0,0 +1,523 @@ +#include "erfa.h" + +int eraPlan94(double date1, double date2, int np, double pv[2][3]) +/* +** - - - - - - - - - - +** e r a P l a n 9 4 +** - - - - - - - - - - +** +** Approximate heliocentric position and velocity of a nominated major +** planet: Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or +** Neptune (but not the Earth itself). +** +** Given: +** date1 double TDB date part A (Note 1) +** date2 double TDB date part B (Note 1) +** np int planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars, +** 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune) +** +** Returned (argument): +** pv double[2][3] planet p,v (heliocentric, J2000.0, au,au/d) +** +** Returned (function value): +** int status: -1 = illegal NP (outside 1-8) +** 0 = OK +** +1 = warning: year outside 1000-3000 +** +2 = warning: failed to converge +** +** Notes: +** +** 1) The date date1+date2 is in the TDB time scale (in practice TT can +** be used) and is a Julian Date, apportioned in any convenient way +** between the two arguments. For example, JD(TDB)=2450123.7 could +** be expressed in any of these ways, among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. The limited +** accuracy of the present algorithm is such that any of the methods +** is satisfactory. +** +** 2) If an np value outside the range 1-8 is supplied, an error status +** (function value -1) is returned and the pv vector set to zeroes. +** +** 3) For np=3 the result is for the Earth-Moon Barycenter. To obtain +** the heliocentric position and velocity of the Earth, use instead +** the ERFA function eraEpv00. +** +** 4) On successful return, the array pv contains the following: +** +** pv[0][0] x } +** pv[0][1] y } heliocentric position, au +** pv[0][2] z } +** +** pv[1][0] xdot } +** pv[1][1] ydot } heliocentric velocity, au/d +** pv[1][2] zdot } +** +** The reference frame is equatorial and is with respect to the +** mean equator and equinox of epoch J2000.0. +** +** 5) The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront, +** M. Chapront-Touze, G. Francou and J. Laskar (Bureau des +** Longitudes, Paris, France). From comparisons with JPL +** ephemeris DE102, they quote the following maximum errors +** over the interval 1800-2050: +** +** L (arcsec) B (arcsec) R (km) +** +** Mercury 4 1 300 +** Venus 5 1 800 +** EMB 6 1 1000 +** Mars 17 1 7700 +** Jupiter 71 5 76000 +** Saturn 81 13 267000 +** Uranus 86 7 712000 +** Neptune 11 1 253000 +** +** Over the interval 1000-3000, they report that the accuracy is no +** worse than 1.5 times that over 1800-2050. Outside 1000-3000 the +** accuracy declines. +** +** Comparisons of the present function with the JPL DE200 ephemeris +** give the following RMS errors over the interval 1960-2025: +** +** position (km) velocity (m/s) +** +** Mercury 334 0.437 +** Venus 1060 0.855 +** EMB 2010 0.815 +** Mars 7690 1.98 +** Jupiter 71700 7.70 +** Saturn 199000 19.4 +** Uranus 564000 16.4 +** Neptune 158000 14.4 +** +** Comparisons against DE200 over the interval 1800-2100 gave the +** following maximum absolute differences. (The results using +** DE406 were essentially the same.) +** +** L (arcsec) B (arcsec) R (km) Rdot (m/s) +** +** Mercury 7 1 500 0.7 +** Venus 7 1 1100 0.9 +** EMB 9 1 1300 1.0 +** Mars 26 1 9000 2.5 +** Jupiter 78 6 82000 8.2 +** Saturn 87 14 263000 24.6 +** Uranus 86 7 661000 27.4 +** Neptune 11 2 248000 21.4 +** +** 6) The present ERFA re-implementation of the original Simon et al. +** Fortran code differs from the original in the following respects: +** +** * C instead of Fortran. +** +** * The date is supplied in two parts. +** +** * The result is returned only in equatorial Cartesian form; +** the ecliptic longitude, latitude and radius vector are not +** returned. +** +** * The result is in the J2000.0 equatorial frame, not ecliptic. +** +** * More is done in-line: there are fewer calls to subroutines. +** +** * Different error/warning status values are used. +** +** * A different Kepler's-equation-solver is used (avoiding +** use of double precision complex). +** +** * Polynomials in t are nested to minimize rounding errors. +** +** * Explicit double constants are used to avoid mixed-mode +** expressions. +** +** None of the above changes affects the result significantly. +** +** 7) The returned status indicates the most serious condition +** encountered during execution of the function. Illegal np is +** considered the most serious, overriding failure to converge, +** which in turn takes precedence over the remote date warning. +** +** Called: +** eraAnp normalize angle into range 0 to 2pi +** +** Reference: Simon, J.L, Bretagnon, P., Chapront, J., +** Chapront-Touze, M., Francou, G., and Laskar, J., +** Astron. Astrophys. 282, 663 (1994). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Gaussian constant */ + static const double GK = 0.017202098950; + +/* Sin and cos of J2000.0 mean obliquity (IAU 1976) */ + static const double SINEPS = 0.3977771559319137; + static const double COSEPS = 0.9174820620691818; + +/* Maximum number of iterations allowed to solve Kepler's equation */ + static const int KMAX = 10; + + int jstat, i, k; + double t, da, dl, de, dp, di, dom, dmu, arga, argl, am, + ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw, + xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z; + +/* Planetary inverse masses */ + static const double amas[] = { 6023600.0, /* Mercury */ + 408523.5, /* Venus */ + 328900.5, /* EMB */ + 3098710.0, /* Mars */ + 1047.355, /* Jupiter */ + 3498.5, /* Saturn */ + 22869.0, /* Uranus */ + 19314.0 }; /* Neptune */ + +/* +** Tables giving the mean Keplerian elements, limited to t^2 terms: +** +** a semi-major axis (au) +** dlm mean longitude (degree and arcsecond) +** e eccentricity +** pi longitude of the perihelion (degree and arcsecond) +** dinc inclination (degree and arcsecond) +** omega longitude of the ascending node (degree and arcsecond) +*/ + + static const double a[][3] = { + { 0.3870983098, 0.0, 0.0 }, /* Mercury */ + { 0.7233298200, 0.0, 0.0 }, /* Venus */ + { 1.0000010178, 0.0, 0.0 }, /* EMB */ + { 1.5236793419, 3e-10, 0.0 }, /* Mars */ + { 5.2026032092, 19132e-10, -39e-10 }, /* Jupiter */ + { 9.5549091915, -0.0000213896, 444e-10 }, /* Saturn */ + { 19.2184460618, -3716e-10, 979e-10 }, /* Uranus */ + { 30.1103868694, -16635e-10, 686e-10 } /* Neptune */ + }; + + static const double dlm[][3] = { + { 252.25090552, 5381016286.88982, -1.92789 }, + { 181.97980085, 2106641364.33548, 0.59381 }, + { 100.46645683, 1295977422.83429, -2.04411 }, + { 355.43299958, 689050774.93988, 0.94264 }, + { 34.35151874, 109256603.77991, -30.60378 }, + { 50.07744430, 43996098.55732, 75.61614 }, + { 314.05500511, 15424811.93933, -1.75083 }, + { 304.34866548, 7865503.20744, 0.21103 } + }; + + static const double e[][3] = { + { 0.2056317526, 0.0002040653, -28349e-10 }, + { 0.0067719164, -0.0004776521, 98127e-10 }, + { 0.0167086342, -0.0004203654, -0.0000126734 }, + { 0.0934006477, 0.0009048438, -80641e-10 }, + { 0.0484979255, 0.0016322542, -0.0000471366 }, + { 0.0555481426, -0.0034664062, -0.0000643639 }, + { 0.0463812221, -0.0002729293, 0.0000078913 }, + { 0.0094557470, 0.0000603263, 0.0 } + }; + + static const double pi[][3] = { + { 77.45611904, 5719.11590, -4.83016 }, + { 131.56370300, 175.48640, -498.48184 }, + { 102.93734808, 11612.35290, 53.27577 }, + { 336.06023395, 15980.45908, -62.32800 }, + { 14.33120687, 7758.75163, 259.95938 }, + { 93.05723748, 20395.49439, 190.25952 }, + { 173.00529106, 3215.56238, -34.09288 }, + { 48.12027554, 1050.71912, 27.39717 } + }; + + static const double dinc[][3] = { + { 7.00498625, -214.25629, 0.28977 }, + { 3.39466189, -30.84437, -11.67836 }, + { 0.0, 469.97289, -3.35053 }, + { 1.84972648, -293.31722, -8.11830 }, + { 1.30326698, -71.55890, 11.95297 }, + { 2.48887878, 91.85195, -17.66225 }, + { 0.77319689, -60.72723, 1.25759 }, + { 1.76995259, 8.12333, 0.08135 } + }; + + static const double omega[][3] = { + { 48.33089304, -4515.21727, -31.79892 }, + { 76.67992019, -10008.48154, -51.32614 }, + { 174.87317577, -8679.27034, 15.34191 }, + { 49.55809321, -10620.90088, -230.57416 }, + { 100.46440702, 6362.03561, 326.52178 }, + { 113.66550252, -9240.19942, -66.23743 }, + { 74.00595701, 2669.15033, 145.93964 }, + { 131.78405702, -221.94322, -0.78728 } + }; + +/* Tables for trigonometric terms to be added to the mean elements of */ +/* the semi-major axes */ + + static const double kp[][9] = { + { 69613, 75645, 88306, 59899, 15746, 71087, 142173, 3086, 0 }, + { 21863, 32794, 26934, 10931, 26250, 43725, 53867, 28939, 0 }, + { 16002, 21863, 32004, 10931, 14529, 16368, 15318, 32794, 0 }, + { 6345, 7818, 15636, 7077, 8184, 14163, 1107, 4872, 0 }, + { 1760, 1454, 1167, 880, 287, 2640, 19, 2047, 1454 }, + { 574, 0, 880, 287, 19, 1760, 1167, 306, 574 }, + { 204, 0, 177, 1265, 4, 385, 200, 208, 204 }, + { 0, 102, 106, 4, 98, 1367, 487, 204, 0 } + }; + + static const double ca[][9] = { + { 4, -13, 11, -9, -9, -3, -1, 4, 0 }, + { -156, 59, -42, 6, 19, -20, -10, -12, 0 }, + { 64, -152, 62, -8, 32, -41, 19, -11, 0 }, + { 124, 621, -145, 208, 54, -57, 30, 15, 0 }, + { -23437, -2634, 6601, 6259, -1507,-1821, 2620, -2115, -1489 }, + { 62911,-119919, 79336,17814,-24241,12068, 8306, -4893, 8902 }, + { 389061,-262125,-44088, 8387,-22976,-2093, -615, -9720, 6633 }, + { -412235,-157046,-31430,37817, -9740, -13, -7449, 9644, 0 } + }; + + static const double sa[][9] = { + { -29, -1, 9, 6, -6, 5, 4, 0, 0 }, + { -48, -125, -26, -37, 18, -13, -20, -2, 0 }, + { -150, -46, 68, 54, 14, 24, -28, 22, 0 }, + { -621, 532, -694, -20, 192, -94, 71, -73, 0 }, + { -14614,-19828, -5869, 1881, -4372, -2255, 782, 930, 913 }, + { 139737, 0, 24667, 51123, -5102, 7429, -4095, -1976, -9566 }, + { -138081, 0, 37205,-49039,-41901,-33872,-27037,-12474, 18797 }, + { 0, 28492,133236, 69654, 52322,-49577,-26430, -3593, 0 } + }; + +/* Tables giving the trigonometric terms to be added to the mean */ +/* elements of the mean longitudes */ + + static const double kq[][10] = { + { 3086,15746,69613,59899,75645,88306, 12661, 2658, 0, 0 }, + { 21863,32794,10931, 73, 4387,26934, 1473, 2157, 0, 0 }, + { 10,16002,21863,10931, 1473,32004, 4387, 73, 0, 0 }, + { 10, 6345, 7818, 1107,15636, 7077, 8184, 532, 10, 0 }, + { 19, 1760, 1454, 287, 1167, 880, 574, 2640, 19, 1454 }, + { 19, 574, 287, 306, 1760, 12, 31, 38, 19, 574 }, + { 4, 204, 177, 8, 31, 200, 1265, 102, 4, 204 }, + { 4, 102, 106, 8, 98, 1367, 487, 204, 4, 102 } + }; + + static const double cl[][10] = { + { 21, -95, -157, 41, -5, 42, 23, 30, 0, 0 }, + { -160, -313, -235, 60, -74, -76, -27, 34, 0, 0 }, + { -325, -322, -79, 232, -52, 97, 55, -41, 0, 0 }, + { 2268, -979, 802, 602, -668, -33, 345, 201, -55, 0 }, + { 7610, -4997,-7689,-5841,-2617, 1115,-748,-607, 6074, 354 }, + { -18549, 30125,20012, -730, 824, 23,1289,-352, -14767, -2062 }, + { -135245,-14594, 4197,-4030,-5630,-2898,2540,-306, 2939, 1986 }, + { 89948, 2103, 8963, 2695, 3682, 1648, 866,-154, -1963, -283 } + }; + + static const double sl[][10] = { + { -342, 136, -23, 62, 66, -52, -33, 17, 0, 0 }, + { 524, -149, -35, 117, 151, 122, -71, -62, 0, 0 }, + { -105, -137, 258, 35, -116, -88,-112, -80, 0, 0 }, + { 854, -205, -936, -240, 140, -341, -97, -232, 536, 0 }, + { -56980, 8016, 1012, 1448,-3024,-3710, 318, 503, 3767, 577 }, + { 138606,-13478,-4964, 1441,-1319,-1482, 427, 1236, -9167, -1918 }, + { 71234,-41116, 5334,-4935,-1848, 66, 434, -1748, 3780, -701 }, + { -47645, 11647, 2166, 3194, 679, 0,-244, -419, -2531, 48 } + }; + +/*--------------------------------------------------------------------*/ + +/* Validate the planet number. */ + if ((np < 1) || (np > 8)) { + jstat = -1; + + /* Reset the result in case of failure. */ + for (k = 0; k < 2; k++) { + for (i = 0; i < 3; i++) { + pv[k][i] = 0.0; + } + } + + } else { + + /* Decrement the planet number to start at zero. */ + np--; + + /* Time: Julian millennia since J2000.0. */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJM; + + /* OK status unless remote date. */ + jstat = fabs(t) <= 1.0 ? 0 : 1; + + /* Compute the mean elements. */ + da = a[np][0] + + (a[np][1] + + a[np][2] * t) * t; + dl = (3600.0 * dlm[np][0] + + (dlm[np][1] + + dlm[np][2] * t) * t) * ERFA_DAS2R; + de = e[np][0] + + ( e[np][1] + + e[np][2] * t) * t; + dp = eraAnpm((3600.0 * pi[np][0] + + (pi[np][1] + + pi[np][2] * t) * t) * ERFA_DAS2R); + di = (3600.0 * dinc[np][0] + + (dinc[np][1] + + dinc[np][2] * t) * t) * ERFA_DAS2R; + dom = eraAnpm((3600.0 * omega[np][0] + + (omega[np][1] + + omega[np][2] * t) * t) * ERFA_DAS2R); + + /* Apply the trigonometric terms. */ + dmu = 0.35953620 * t; + for (k = 0; k < 8; k++) { + arga = kp[np][k] * dmu; + argl = kq[np][k] * dmu; + da += (ca[np][k] * cos(arga) + + sa[np][k] * sin(arga)) * 1e-7; + dl += (cl[np][k] * cos(argl) + + sl[np][k] * sin(argl)) * 1e-7; + } + arga = kp[np][8] * dmu; + da += t * (ca[np][8] * cos(arga) + + sa[np][8] * sin(arga)) * 1e-7; + for (k = 8; k < 10; k++) { + argl = kq[np][k] * dmu; + dl += t * (cl[np][k] * cos(argl) + + sl[np][k] * sin(argl)) * 1e-7; + } + dl = fmod(dl, ERFA_D2PI); + + /* Iterative soln. of Kepler's equation to get eccentric anomaly. */ + am = dl - dp; + ae = am + de * sin(am); + k = 0; + dae = 1.0; + while (k < KMAX && fabs(dae) > 1e-12) { + dae = (am - ae + de * sin(ae)) / (1.0 - de * cos(ae)); + ae += dae; + k++; + if (k == KMAX-1) jstat = 2; + } + + /* True anomaly. */ + ae2 = ae / 2.0; + at = 2.0 * atan2(sqrt((1.0 + de) / (1.0 - de)) * sin(ae2), + cos(ae2)); + + /* Distance (au) and speed (radians per day). */ + r = da * (1.0 - de * cos(ae)); + v = GK * sqrt((1.0 + 1.0 / amas[np]) / (da * da * da)); + + si2 = sin(di / 2.0); + xq = si2 * cos(dom); + xp = si2 * sin(dom); + tl = at + dp; + xsw = sin(tl); + xcw = cos(tl); + xm2 = 2.0 * (xp * xcw - xq * xsw); + xf = da / sqrt(1 - de * de); + ci2 = cos(di / 2.0); + xms = (de * sin(dp) + xsw) * xf; + xmc = (de * cos(dp) + xcw) * xf; + xpxq2 = 2 * xp * xq; + + /* Position (J2000.0 ecliptic x,y,z in au). */ + x = r * (xcw - xm2 * xp); + y = r * (xsw + xm2 * xq); + z = r * (-xm2 * ci2); + + /* Rotate to equatorial. */ + pv[0][0] = x; + pv[0][1] = y * COSEPS - z * SINEPS; + pv[0][2] = y * SINEPS + z * COSEPS; + + /* Velocity (J2000.0 ecliptic xdot,ydot,zdot in au/d). */ + x = v * (( -1.0 + 2.0 * xp * xp) * xms + xpxq2 * xmc); + y = v * (( 1.0 - 2.0 * xq * xq) * xmc - xpxq2 * xms); + z = v * (2.0 * ci2 * (xp * xms + xq * xmc)); + + /* Rotate to equatorial. */ + pv[1][0] = x; + pv[1][1] = y * COSEPS - z * SINEPS; + pv[1][2] = y * SINEPS + z * COSEPS; + + } + +/* Return the status. */ + return jstat; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pm.c b/testbed/astropy__astropy/cextern/erfa/pm.c new file mode 100644 index 0000000000000000000000000000000000000000..da0b12c8d8a08be4b92f580f94b296b99000a972 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pm.c @@ -0,0 +1,85 @@ +#include "erfa.h" + +double eraPm(double p[3]) +/* +** - - - - - - +** e r a P m +** - - - - - - +** +** Modulus of p-vector. +** +** Given: +** p double[3] p-vector +** +** Returned (function value): +** double modulus +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + return sqrt( p[0]*p[0] + p[1]*p[1] + p[2]*p[2] ); + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmat00.c b/testbed/astropy__astropy/cextern/erfa/pmat00.c new file mode 100644 index 0000000000000000000000000000000000000000..5ebd3a0d57fd8284c6b00fb8ae77e12bfd918ca2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmat00.c @@ -0,0 +1,127 @@ +#include "erfa.h" + +void eraPmat00(double date1, double date2, double rbp[3][3]) +/* +** - - - - - - - - - - +** e r a P m a t 0 0 +** - - - - - - - - - - +** +** Precession matrix (including frame bias) from GCRS to a specified +** date, IAU 2000 model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rbp double[3][3] bias-precession matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rbp * V(GCRS), where +** the p-vector V(GCRS) is with respect to the Geocentric Celestial +** Reference System (IAU, 2000) and the p-vector V(date) is with +** respect to the mean equatorial triad of the given date. +** +** Called: +** eraBp00 frame bias and precession matrices, IAU 2000 +** +** Reference: +** +** IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. +** 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. +** (2000) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rb[3][3], rp[3][3]; + + +/* Obtain the required matrix (discarding others). */ + eraBp00(date1, date2, rb, rp, rbp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmat06.c b/testbed/astropy__astropy/cextern/erfa/pmat06.c new file mode 100644 index 0000000000000000000000000000000000000000..62945e91a9028e062a7b1b23dff321b5ccdcfe83 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmat06.c @@ -0,0 +1,131 @@ +#include "erfa.h" + +void eraPmat06(double date1, double date2, double rbp[3][3]) +/* +** - - - - - - - - - - +** e r a P m a t 0 6 +** - - - - - - - - - - +** +** Precession matrix (including frame bias) from GCRS to a specified +** date, IAU 2006 model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rbp double[3][3] bias-precession matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rbp * V(GCRS), where +** the p-vector V(GCRS) is with respect to the Geocentric Celestial +** Reference System (IAU, 2000) and the p-vector V(date) is with +** respect to the mean equatorial triad of the given date. +** +** Called: +** eraPfw06 bias-precession F-W angles, IAU 2006 +** eraFw2m F-W angles to r-matrix +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gamb, phib, psib, epsa; + + +/* Bias-precession Fukushima-Williams angles. */ + eraPfw06(date1, date2, &gamb, &phib, &psib, &epsa); + +/* Form the matrix. */ + eraFw2m(gamb, phib, psib, epsa, rbp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmat76.c b/testbed/astropy__astropy/cextern/erfa/pmat76.c new file mode 100644 index 0000000000000000000000000000000000000000..35d6793f47a60993cbbc2518c9e26fde60c97199 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmat76.c @@ -0,0 +1,150 @@ +#include "erfa.h" + +void eraPmat76(double date1, double date2, double rmatp[3][3]) +/* +** - - - - - - - - - - +** e r a P m a t 7 6 +** - - - - - - - - - - +** +** Precession matrix from J2000.0 to a specified date, IAU 1976 model. +** +** Given: +** date1,date2 double ending date, TT (Note 1) +** +** Returned: +** rmatp double[3][3] precession matrix, J2000.0 -> date1+date2 +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = RMATP * V(J2000), +** where the p-vector V(J2000) is with respect to the mean +** equatorial triad of epoch J2000.0 and the p-vector V(date) +** is with respect to the mean equatorial triad of the given +** date. +** +** 3) Though the matrix method itself is rigorous, the precession +** angles are expressed through canonical polynomials which are +** valid only for a limited time span. In addition, the IAU 1976 +** precession rate is known to be imperfect. The absolute accuracy +** of the present formulation is better than 0.1 arcsec from +** 1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD, +** and remains below 3 arcsec for the whole of the period +** 500BC to 3000AD. The errors exceed 10 arcsec outside the +** range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to +** 5600AD and exceed 1000 arcsec outside 6800BC to 8200AD. +** +** Called: +** eraPrec76 accumulated precession angles, IAU 1976 +** eraIr initialize r-matrix to identity +** eraRz rotate around Z-axis +** eraRy rotate around Y-axis +** eraCr copy r-matrix +** +** References: +** +** Lieske, J.H., 1979, Astron.Astrophys. 73, 282. +** equations (6) & (7), p283. +** +** Kaplan,G.H., 1981. USNO circular no. 163, pA2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double zeta, z, theta, wmat[3][3]; + + +/* Precession Euler angles, J2000.0 to specified date. */ + eraPrec76(ERFA_DJ00, 0.0, date1, date2, &zeta, &z, &theta); + +/* Form the rotation matrix. */ + eraIr( wmat); + eraRz( -zeta, wmat); + eraRy( theta, wmat); + eraRz( -z, wmat); + eraCr( wmat, rmatp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmp.c b/testbed/astropy__astropy/cextern/erfa/pmp.c new file mode 100644 index 0000000000000000000000000000000000000000..782ecae9c60bc7972f067bb9f2acc7bdf19aba85 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmp.c @@ -0,0 +1,94 @@ +#include "erfa.h" + +void eraPmp(double a[3], double b[3], double amb[3]) +/* +** - - - - - - - +** e r a P m p +** - - - - - - - +** +** P-vector subtraction. +** +** Given: +** a double[3] first p-vector +** b double[3] second p-vector +** +** Returned: +** amb double[3] a - b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + amb[0] = a[0] - b[0]; + amb[1] = a[1] - b[1]; + amb[2] = a[2] - b[2]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmpx.c b/testbed/astropy__astropy/cextern/erfa/pmpx.c new file mode 100644 index 0000000000000000000000000000000000000000..bd01312bbc68b0298874778da284249497e95996 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmpx.c @@ -0,0 +1,153 @@ +#include "erfa.h" + +void eraPmpx(double rc, double dc, double pr, double pd, + double px, double rv, double pmt, double pob[3], + double pco[3]) +/* +** - - - - - - - - +** e r a P m p x +** - - - - - - - - +** +** Proper motion and parallax. +** +** Given: +** rc,dc double ICRS RA,Dec at catalog epoch (radians) +** pr double RA proper motion (radians/year; Note 1) +** pd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, +ve if receding) +** pmt double proper motion time interval (SSB, Julian years) +** pob double[3] SSB to observer vector (au) +** +** Returned: +** pco double[3] coordinate direction (BCRS unit vector) +** +** Notes: +** +** 1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt. +** +** 2) The proper motion time interval is for when the starlight +** reaches the solar system barycenter. +** +** 3) To avoid the need for iteration, the Roemer effect (i.e. the +** small annual modulation of the proper motion coming from the +** changing light time) is applied approximately, using the +** direction of the star at the catalog epoch. +** +** References: +** +** 1984 Astronomical Almanac, pp B39-B41. +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013), Section 7.2. +** +** Called: +** eraPdp scalar product of two p-vectors +** eraPn decompose p-vector into modulus and direction +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Km/s to au/year */ + const double VF = ERFA_DAYSEC*ERFA_DJM/ERFA_DAU; + +/* Light time for 1 au, Julian years */ + const double AULTY = ERFA_AULT/ERFA_DAYSEC/ERFA_DJY; + + int i; + double sr, cr, sd, cd, x, y, z, p[3], dt, pxr, w, pdz, pm[3]; + + +/* Spherical coordinates to unit vector (and useful functions). */ + sr = sin(rc); + cr = cos(rc); + sd = sin(dc); + cd = cos(dc); + p[0] = x = cr*cd; + p[1] = y = sr*cd; + p[2] = z = sd; + +/* Proper motion time interval (y) including Roemer effect. */ + dt = pmt + eraPdp(p,pob)*AULTY; + +/* Space motion (radians per year). */ + pxr = px * ERFA_DAS2R; + w = VF * rv * pxr; + pdz = pd * z; + pm[0] = - pr*y - pdz*cr + w*x; + pm[1] = pr*x - pdz*sr + w*y; + pm[2] = pd*cd + w*z; + +/* Coordinate direction of star (unit vector, BCRS). */ + for (i = 0; i < 3; i++) { + p[i] += dt*pm[i] - pxr*pob[i]; + } + eraPn(p, &w, pco); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pmsafe.c b/testbed/astropy__astropy/cextern/erfa/pmsafe.c new file mode 100644 index 0000000000000000000000000000000000000000..3c7822e7d3827eb1fca61ca67f9d70959f57e752 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pmsafe.c @@ -0,0 +1,206 @@ +#include "erfa.h" + +int eraPmsafe(double ra1, double dec1, double pmr1, double pmd1, + double px1, double rv1, + double ep1a, double ep1b, double ep2a, double ep2b, + double *ra2, double *dec2, double *pmr2, double *pmd2, + double *px2, double *rv2) +/* +** - - - - - - - - - - +** e r a P m s a f e +** - - - - - - - - - - +** +** Star proper motion: update star catalog data for space motion, with +** special handling to handle the zero parallax case. +** +** Given: +** ra1 double right ascension (radians), before +** dec1 double declination (radians), before +** pmr1 double RA proper motion (radians/year), before +** pmd1 double Dec proper motion (radians/year), before +** px1 double parallax (arcseconds), before +** rv1 double radial velocity (km/s, +ve = receding), before +** ep1a double "before" epoch, part A (Note 1) +** ep1b double "before" epoch, part B (Note 1) +** ep2a double "after" epoch, part A (Note 1) +** ep2b double "after" epoch, part B (Note 1) +** +** Returned: +** ra2 double right ascension (radians), after +** dec2 double declination (radians), after +** pmr2 double RA proper motion (radians/year), after +** pmd2 double Dec proper motion (radians/year), after +** px2 double parallax (arcseconds), after +** rv2 double radial velocity (km/s, +ve = receding), after +** +** Returned (function value): +** int status: +** -1 = system error (should not occur) +** 0 = no warnings or errors +** 1 = distance overridden (Note 6) +** 2 = excessive velocity (Note 7) +** 4 = solution didn't converge (Note 8) +** else = binary logical OR of the above warnings +** +** Notes: +** +** 1) The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are +** Julian Dates, apportioned in any convenient way between the two +** parts (A and B). For example, JD(TDB)=2450123.7 could be +** expressed in any of these ways, among others: +** +** epNa epNb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** resolution. The MJD method and the date & time methods are both +** good compromises between resolution and convenience. +** +** 2) In accordance with normal star-catalog conventions, the object's +** right ascension and declination are freed from the effects of +** secular aberration. The frame, which is aligned to the catalog +** equator and equinox, is Lorentzian and centered on the SSB. +** +** The proper motions are the rate of change of the right ascension +** and declination at the catalog epoch and are in radians per TDB +** Julian year. +** +** The parallax and radial velocity are in the same frame. +** +** 3) Care is needed with units. The star coordinates are in radians +** and the proper motions in radians per Julian year, but the +** parallax is in arcseconds. +** +** 4) The RA proper motion is in terms of coordinate angle, not true +** angle. If the catalog uses arcseconds for both RA and Dec proper +** motions, the RA proper motion will need to be divided by cos(Dec) +** before use. +** +** 5) Straight-line motion at constant speed, in the inertial frame, is +** assumed. +** +** 6) An extremely small (or zero or negative) parallax is overridden +** to ensure that the object is at a finite but very large distance, +** but not so large that the proper motion is equivalent to a large +** but safe speed (about 0.1c using the chosen constant). A warning +** status of 1 is added to the status if this action has been taken. +** +** 7) If the space velocity is a significant fraction of c (see the +** constant VMAX in the function eraStarpv), it is arbitrarily set +** to zero. When this action occurs, 2 is added to the status. +** +** 8) The relativistic adjustment carried out in the eraStarpv function +** involves an iterative calculation. If the process fails to +** converge within a set number of iterations, 4 is added to the +** status. +** +** Called: +** eraSeps angle between two points +** eraStarpm update star catalog data for space motion +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Minimum allowed parallax (arcsec) */ + const double PXMIN = 5e-7; + +/* Factor giving maximum allowed transverse speed of about 1% c */ + const double F = 326.0; + + int jpx, j; + double pm, px1a; + + +/* Proper motion in one year (radians). */ + pm = eraSeps(ra1, dec1, ra1+pmr1, dec1+pmd1); + +/* Override the parallax to reduce the chances of a warning status. */ + jpx = 0; + px1a = px1; + pm *= F; + if (px1a < pm) {jpx = 1; px1a = pm;} + if (px1a < PXMIN) {jpx = 1; px1a = PXMIN;} + +/* Carry out the transformation using the modified parallax. */ + j = eraStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1, + ep1a, ep1b, ep2a, ep2b, + ra2, dec2, pmr2, pmd2, px2, rv2); + +/* Revise and return the status. */ + if ( !(j%2) ) j += jpx; + return j; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn.c b/testbed/astropy__astropy/cextern/erfa/pn.c new file mode 100644 index 0000000000000000000000000000000000000000..8876b555cb7f4f73b51a591f88f8fe26b54b6376 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn.c @@ -0,0 +1,118 @@ +#include "erfa.h" + +void eraPn(double p[3], double *r, double u[3]) +/* +** - - - - - - +** e r a P n +** - - - - - - +** +** Convert a p-vector into modulus and unit vector. +** +** Given: +** p double[3] p-vector +** +** Returned: +** r double modulus +** u double[3] unit vector +** +** Notes: +** +** 1) If p is null, the result is null. Otherwise the result is a unit +** vector. +** +** 2) It is permissible to re-use the same array for any of the +** arguments. +** +** Called: +** eraPm modulus of p-vector +** eraZp zero p-vector +** eraSxp multiply p-vector by scalar +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double w; + + +/* Obtain the modulus and test for zero. */ + w = eraPm(p); + if (w == 0.0) { + + /* Null vector. */ + eraZp(u); + + } else { + + /* Unit vector. */ + eraSxp(1.0/w, p, u); + } + +/* Return the modulus. */ + *r = w; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn00.c b/testbed/astropy__astropy/cextern/erfa/pn00.c new file mode 100644 index 0000000000000000000000000000000000000000..d2bd051658729f06be508ca2bf5b43c72391d475 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn00.c @@ -0,0 +1,186 @@ +#include "erfa.h" + +void eraPn00(double date1, double date2, double dpsi, double deps, + double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]) +/* +** - - - - - - - - +** e r a P n 0 0 +** - - - - - - - - +** +** Precession-nutation, IAU 2000 model: a multi-purpose function, +** supporting classical (equinox-based) use directly and CIO-based +** use indirectly. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** dpsi,deps double nutation (Note 2) +** +** Returned: +** epsa double mean obliquity (Note 3) +** rb double[3][3] frame bias matrix (Note 4) +** rp double[3][3] precession matrix (Note 5) +** rbp double[3][3] bias-precession matrix (Note 6) +** rn double[3][3] nutation matrix (Note 7) +** rbpn double[3][3] GCRS-to-true matrix (Note 8) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The caller is responsible for providing the nutation components; +** they are in longitude and obliquity, in radians and are with +** respect to the equinox and ecliptic of date. For high-accuracy +** applications, free core nutation should be included as well as +** any other relevant corrections to the position of the CIP. +** +** 3) The returned mean obliquity is consistent with the IAU 2000 +** precession-nutation models. +** +** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean +** equator and equinox by applying frame bias. +** +** 5) The matrix rp transforms vectors from J2000.0 mean equator and +** equinox to mean equator and equinox of date by applying +** precession. +** +** 6) The matrix rbp transforms vectors from GCRS to mean equator and +** equinox of date by applying frame bias then precession. It is +** the product rp x rb. +** +** 7) The matrix rn transforms vectors from mean equator and equinox of +** date to true equator and equinox of date by applying the nutation +** (luni-solar + planetary). +** +** 8) The matrix rbpn transforms vectors from GCRS to true equator and +** equinox of date. It is the product rn x rbp, applying frame +** bias, precession and nutation in that order. +** +** 9) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the order given. +** +** Called: +** eraPr00 IAU 2000 precession adjustments +** eraObl80 mean obliquity, IAU 1980 +** eraBp00 frame bias and precession matrices, IAU 2000 +** eraCr copy r-matrix +** eraNumat form nutation matrix +** eraRxr product of two r-matrices +** +** Reference: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsipr, depspr, rbpw[3][3], rnw[3][3]; + + +/* IAU 2000 precession-rate adjustments. */ + eraPr00(date1, date2, &dpsipr, &depspr); + +/* Mean obliquity, consistent with IAU 2000 precession-nutation. */ + *epsa = eraObl80(date1, date2) + depspr; + +/* Frame bias and precession matrices and their product. */ + eraBp00(date1, date2, rb, rp, rbpw); + eraCr(rbpw, rbp); + +/* Nutation matrix. */ + eraNumat(*epsa, dpsi, deps, rnw); + eraCr(rnw, rn); + +/* Bias-precession-nutation matrix (classical). */ + eraRxr(rnw, rbpw, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn00a.c b/testbed/astropy__astropy/cextern/erfa/pn00a.c new file mode 100644 index 0000000000000000000000000000000000000000..132a9272f8d94f6b1482ce161a93f3664a45b08c --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn00a.c @@ -0,0 +1,172 @@ +#include "erfa.h" + +void eraPn00a(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]) +/* +** - - - - - - - - - +** e r a P n 0 0 a +** - - - - - - - - - +** +** Precession-nutation, IAU 2000A model: a multi-purpose function, +** supporting classical (equinox-based) use directly and CIO-based +** use indirectly. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation (Note 2) +** epsa double mean obliquity (Note 3) +** rb double[3][3] frame bias matrix (Note 4) +** rp double[3][3] precession matrix (Note 5) +** rbp double[3][3] bias-precession matrix (Note 6) +** rn double[3][3] nutation matrix (Note 7) +** rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components (luni-solar + planetary, IAU 2000A) in +** longitude and obliquity are in radians and with respect to the +** equinox and ecliptic of date. Free core nutation is omitted; +** for the utmost accuracy, use the eraPn00 function, where the +** nutation components are caller-specified. For faster but +** slightly less accurate results, use the eraPn00b function. +** +** 3) The mean obliquity is consistent with the IAU 2000 precession. +** +** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean +** equator and equinox by applying frame bias. +** +** 5) The matrix rp transforms vectors from J2000.0 mean equator and +** equinox to mean equator and equinox of date by applying +** precession. +** +** 6) The matrix rbp transforms vectors from GCRS to mean equator and +** equinox of date by applying frame bias then precession. It is +** the product rp x rb. +** +** 7) The matrix rn transforms vectors from mean equator and equinox +** of date to true equator and equinox of date by applying the +** nutation (luni-solar + planetary). +** +** 8) The matrix rbpn transforms vectors from GCRS to true equator and +** equinox of date. It is the product rn x rbp, applying frame +** bias, precession and nutation in that order. +** +** 9) The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate +** Pole are elements (3,1-3) of the GCRS-to-true matrix, +** i.e. rbpn[2][0-2]. +** +** 10) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the order given. +** +** Called: +** eraNut00a nutation, IAU 2000A +** eraPn00 bias/precession/nutation results, IAU 2000 +** +** Reference: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Nutation. */ + eraNut00a(date1, date2, dpsi, deps); + +/* Remaining results. */ + eraPn00(date1, date2, *dpsi, *deps, epsa, rb, rp, rbp, rn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn00b.c b/testbed/astropy__astropy/cextern/erfa/pn00b.c new file mode 100644 index 0000000000000000000000000000000000000000..47ec64a7a5663f2ff5abef16fad5168b68c0873f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn00b.c @@ -0,0 +1,172 @@ +#include "erfa.h" + +void eraPn00b(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]) +/* +** - - - - - - - - - +** e r a P n 0 0 b +** - - - - - - - - - +** +** Precession-nutation, IAU 2000B model: a multi-purpose function, +** supporting classical (equinox-based) use directly and CIO-based +** use indirectly. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation (Note 2) +** epsa double mean obliquity (Note 3) +** rb double[3][3] frame bias matrix (Note 4) +** rp double[3][3] precession matrix (Note 5) +** rbp double[3][3] bias-precession matrix (Note 6) +** rn double[3][3] nutation matrix (Note 7) +** rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components (luni-solar + planetary, IAU 2000B) in +** longitude and obliquity are in radians and with respect to the +** equinox and ecliptic of date. For more accurate results, but +** at the cost of increased computation, use the eraPn00a function. +** For the utmost accuracy, use the eraPn00 function, where the +** nutation components are caller-specified. +** +** 3) The mean obliquity is consistent with the IAU 2000 precession. +** +** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean +** equator and equinox by applying frame bias. +** +** 5) The matrix rp transforms vectors from J2000.0 mean equator and +** equinox to mean equator and equinox of date by applying +** precession. +** +** 6) The matrix rbp transforms vectors from GCRS to mean equator and +** equinox of date by applying frame bias then precession. It is +** the product rp x rb. +** +** 7) The matrix rn transforms vectors from mean equator and equinox +** of date to true equator and equinox of date by applying the +** nutation (luni-solar + planetary). +** +** 8) The matrix rbpn transforms vectors from GCRS to true equator and +** equinox of date. It is the product rn x rbp, applying frame +** bias, precession and nutation in that order. +** +** 9) The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate +** Pole are elements (3,1-3) of the GCRS-to-true matrix, +** i.e. rbpn[2][0-2]. +** +** 10) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the stated order. +** +** Called: +** eraNut00b nutation, IAU 2000B +** eraPn00 bias/precession/nutation results, IAU 2000 +** +** Reference: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003). +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Nutation. */ + eraNut00b(date1, date2, dpsi, deps); + +/* Remaining results. */ + eraPn00(date1, date2, *dpsi, *deps, epsa, rb, rp, rbp, rn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn06.c b/testbed/astropy__astropy/cextern/erfa/pn06.c new file mode 100644 index 0000000000000000000000000000000000000000..e07ff295cb5d851cc8b8cf3b2ff9d4213046e967 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn06.c @@ -0,0 +1,196 @@ +#include "erfa.h" + +void eraPn06(double date1, double date2, double dpsi, double deps, + double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]) +/* +** - - - - - - - - +** e r a P n 0 6 +** - - - - - - - - +** +** Precession-nutation, IAU 2006 model: a multi-purpose function, +** supporting classical (equinox-based) use directly and CIO-based use +** indirectly. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** dpsi,deps double nutation (Note 2) +** +** Returned: +** epsa double mean obliquity (Note 3) +** rb double[3][3] frame bias matrix (Note 4) +** rp double[3][3] precession matrix (Note 5) +** rbp double[3][3] bias-precession matrix (Note 6) +** rn double[3][3] nutation matrix (Note 7) +** rbpn double[3][3] GCRS-to-true matrix (Note 8) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The caller is responsible for providing the nutation components; +** they are in longitude and obliquity, in radians and are with +** respect to the equinox and ecliptic of date. For high-accuracy +** applications, free core nutation should be included as well as +** any other relevant corrections to the position of the CIP. +** +** 3) The returned mean obliquity is consistent with the IAU 2006 +** precession. +** +** 4) The matrix rb transforms vectors from GCRS to J2000.0 mean +** equator and equinox by applying frame bias. +** +** 5) The matrix rp transforms vectors from J2000.0 mean equator and +** equinox to mean equator and equinox of date by applying +** precession. +** +** 6) The matrix rbp transforms vectors from GCRS to mean equator and +** equinox of date by applying frame bias then precession. It is +** the product rp x rb. +** +** 7) The matrix rn transforms vectors from mean equator and equinox +** of date to true equator and equinox of date by applying the +** nutation (luni-solar + planetary). +** +** 8) The matrix rbpn transforms vectors from GCRS to true equator and +** equinox of date. It is the product rn x rbp, applying frame +** bias, precession and nutation in that order. +** +** 9) The X,Y,Z coordinates of the Celestial Intermediate Pole are +** elements (3,1-3) of the GCRS-to-true matrix, i.e. rbpn[2][0-2]. +** +** 10) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the stated order. +** +** Called: +** eraPfw06 bias-precession F-W angles, IAU 2006 +** eraFw2m F-W angles to r-matrix +** eraCr copy r-matrix +** eraTr transpose r-matrix +** eraRxr product of two r-matrices +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gamb, phib, psib, eps, r1[3][3], r2[3][3], rt[3][3]; + + +/* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */ + eraPfw06(ERFA_DJM0, ERFA_DJM00, &gamb, &phib, &psib, &eps); + +/* B matrix. */ + eraFw2m(gamb, phib, psib, eps, r1); + eraCr(r1, rb); + +/* Bias-precession Fukushima-Williams angles of date. */ + eraPfw06(date1, date2, &gamb, &phib, &psib, &eps); + +/* Bias-precession matrix. */ + eraFw2m(gamb, phib, psib, eps, r2); + eraCr(r2, rbp); + +/* Solve for precession matrix. */ + eraTr(r1, rt); + eraRxr(r2, rt, rp); + +/* Equinox-based bias-precession-nutation matrix. */ + eraFw2m(gamb, phib, psib + dpsi, eps + deps, r1); + eraCr(r1, rbpn); + +/* Solve for nutation matrix. */ + eraTr(r2, rt); + eraRxr(r1, rt, rn); + +/* Obliquity, mean of date. */ + *epsa = eps; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pn06a.c b/testbed/astropy__astropy/cextern/erfa/pn06a.c new file mode 100644 index 0000000000000000000000000000000000000000..7325eb15622fbc27d625518b3de6eab2dbbeb5b0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pn06a.c @@ -0,0 +1,162 @@ +#include "erfa.h" + +void eraPn06a(double date1, double date2, + double *dpsi, double *deps, double *epsa, + double rb[3][3], double rp[3][3], double rbp[3][3], + double rn[3][3], double rbpn[3][3]) +/* +** - - - - - - - - - +** e r a P n 0 6 a +** - - - - - - - - - +** +** Precession-nutation, IAU 2006/2000A models: a multi-purpose function, +** supporting classical (equinox-based) use directly and CIO-based use +** indirectly. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsi,deps double nutation (Note 2) +** epsa double mean obliquity (Note 3) +** rb double[3][3] frame bias matrix (Note 4) +** rp double[3][3] precession matrix (Note 5) +** rbp double[3][3] bias-precession matrix (Note 6) +** rn double[3][3] nutation matrix (Note 7) +** rbpn double[3][3] GCRS-to-true matrix (Notes 8,9) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The nutation components (luni-solar + planetary, IAU 2000A) in +** longitude and obliquity are in radians and with respect to the +** equinox and ecliptic of date. Free core nutation is omitted; +** for the utmost accuracy, use the eraPn06 function, where the +** nutation components are caller-specified. +** +** 3) The mean obliquity is consistent with the IAU 2006 precession. +** +** 4) The matrix rb transforms vectors from GCRS to mean J2000.0 by +** applying frame bias. +** +** 5) The matrix rp transforms vectors from mean J2000.0 to mean of +** date by applying precession. +** +** 6) The matrix rbp transforms vectors from GCRS to mean of date by +** applying frame bias then precession. It is the product rp x rb. +** +** 7) The matrix rn transforms vectors from mean of date to true of +** date by applying the nutation (luni-solar + planetary). +** +** 8) The matrix rbpn transforms vectors from GCRS to true of date +** (CIP/equinox). It is the product rn x rbp, applying frame bias, +** precession and nutation in that order. +** +** 9) The X,Y,Z coordinates of the IAU 2006/2000A Celestial +** Intermediate Pole are elements (3,1-3) of the GCRS-to-true +** matrix, i.e. rbpn[2][0-2]. +** +** 10) It is permissible to re-use the same array in the returned +** arguments. The arrays are filled in the stated order. +** +** Called: +** eraNut06a nutation, IAU 2006/2000A +** eraPn06 bias/precession/nutation results, IAU 2006 +** +** Reference: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Nutation. */ + eraNut06a(date1, date2, dpsi, deps); + +/* Remaining results. */ + eraPn06(date1, date2, *dpsi, *deps, epsa, rb, rp, rbp, rn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pnm00a.c b/testbed/astropy__astropy/cextern/erfa/pnm00a.c new file mode 100644 index 0000000000000000000000000000000000000000..7e3016c5f4ce5fc166cffadc673c9b7ca32a8f88 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pnm00a.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +void eraPnm00a(double date1, double date2, double rbpn[3][3]) +/* +** - - - - - - - - - - +** e r a P n m 0 0 a +** - - - - - - - - - - +** +** Form the matrix of precession-nutation for a given date (including +** frame bias), equinox-based, IAU 2000A model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rbpn double[3][3] classical NPB matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rbpn * V(GCRS), where +** the p-vector V(date) is with respect to the true equatorial triad +** of date date1+date2 and the p-vector V(GCRS) is with respect to +** the Geocentric Celestial Reference System (IAU, 2000). +** +** 3) A faster, but slightly less accurate result (about 1 mas), can be +** obtained by using instead the eraPnm00b function. +** +** Called: +** eraPn00a bias/precession/nutation, IAU 2000A +** +** Reference: +** +** IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. +** 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. +** (2000) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3]; + + +/* Obtain the required matrix (discarding other results). */ + eraPn00a(date1, date2, &dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pnm00b.c b/testbed/astropy__astropy/cextern/erfa/pnm00b.c new file mode 100644 index 0000000000000000000000000000000000000000..1cde8de9acf26a0d938989bd5739f0981449aedd --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pnm00b.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +void eraPnm00b(double date1, double date2, double rbpn[3][3]) +/* +** - - - - - - - - - - +** e r a P n m 0 0 b +** - - - - - - - - - - +** +** Form the matrix of precession-nutation for a given date (including +** frame bias), equinox-based, IAU 2000B model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rbpn double[3][3] bias-precession-nutation matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rbpn * V(GCRS), where +** the p-vector V(date) is with respect to the true equatorial triad +** of date date1+date2 and the p-vector V(GCRS) is with respect to +** the Geocentric Celestial Reference System (IAU, 2000). +** +** 3) The present function is faster, but slightly less accurate (about +** 1 mas), than the eraPnm00a function. +** +** Called: +** eraPn00b bias/precession/nutation, IAU 2000B +** +** Reference: +** +** IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc. +** 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6. +** (2000) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3]; + + +/* Obtain the required matrix (discarding other results). */ + eraPn00b(date1, date2, &dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pnm06a.c b/testbed/astropy__astropy/cextern/erfa/pnm06a.c new file mode 100644 index 0000000000000000000000000000000000000000..05cbb56bf3e533670de58d1df36279d62f3bed88 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pnm06a.c @@ -0,0 +1,133 @@ +#include "erfa.h" + +void eraPnm06a(double date1, double date2, double rnpb[3][3]) +/* +** - - - - - - - - - - +** e r a P n m 0 6 a +** - - - - - - - - - - +** +** Form the matrix of precession-nutation for a given date (including +** frame bias), IAU 2006 precession and IAU 2000A nutation models. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** rnpb double[3][3] bias-precession-nutation matrix (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rnpb * V(GCRS), where +** the p-vector V(date) is with respect to the true equatorial triad +** of date date1+date2 and the p-vector V(GCRS) is with respect to +** the Geocentric Celestial Reference System (IAU, 2000). +** +** Called: +** eraPfw06 bias-precession F-W angles, IAU 2006 +** eraNut06a nutation, IAU 2006/2000A +** eraFw2m F-W angles to r-matrix +** +** Reference: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double gamb, phib, psib, epsa, dp, de; + + +/* Fukushima-Williams angles for frame bias and precession. */ + eraPfw06(date1, date2, &gamb, &phib, &psib, &epsa); + +/* Nutation components. */ + eraNut06a(date1, date2, &dp, &de); + +/* Equinox based nutation x precession x bias matrix. */ + eraFw2m(gamb, phib, psib + dp, epsa + de, rnpb); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pnm80.c b/testbed/astropy__astropy/cextern/erfa/pnm80.c new file mode 100644 index 0000000000000000000000000000000000000000..f48273ba51e821c833d38bfc36b2a14cc3c300f3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pnm80.c @@ -0,0 +1,135 @@ +#include "erfa.h" + +void eraPnm80(double date1, double date2, double rmatpn[3][3]) +/* +** - - - - - - - - - +** e r a P n m 8 0 +** - - - - - - - - - +** +** Form the matrix of precession/nutation for a given date, IAU 1976 +** precession model, IAU 1980 nutation model. +** +** Given: +** date1,date2 double TDB date (Note 1) +** +** Returned: +** rmatpn double[3][3] combined precession/nutation matrix +** +** Notes: +** +** 1) The TDB date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TDB)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The matrix operates in the sense V(date) = rmatpn * V(J2000), +** where the p-vector V(date) is with respect to the true equatorial +** triad of date date1+date2 and the p-vector V(J2000) is with +** respect to the mean equatorial triad of epoch J2000.0. +** +** Called: +** eraPmat76 precession matrix, IAU 1976 +** eraNutm80 nutation matrix, IAU 1980 +** eraRxr product of two r-matrices +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992), +** Section 3.3 (p145). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rmatp[3][3], rmatn[3][3]; + + +/* Precession matrix, J2000.0 to date. */ + eraPmat76(date1, date2, rmatp); + +/* Nutation matrix. */ + eraNutm80(date1, date2, rmatn); + +/* Combine the matrices: PN = N x P. */ + eraRxr(rmatn, rmatp, rmatpn); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pom00.c b/testbed/astropy__astropy/cextern/erfa/pom00.c new file mode 100644 index 0000000000000000000000000000000000000000..e904432c023a224477b7b80e8680fcb26505dae4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pom00.c @@ -0,0 +1,124 @@ +#include "erfa.h" + +void eraPom00(double xp, double yp, double sp, double rpom[3][3]) +/* +** - - - - - - - - - - +** e r a P o m 0 0 +** - - - - - - - - - - +** +** Form the matrix of polar motion for a given date, IAU 2000. +** +** Given: +** xp,yp double coordinates of the pole (radians, Note 1) +** sp double the TIO locator s' (radians, Note 2) +** +** Returned: +** rpom double[3][3] polar-motion matrix (Note 3) +** +** Notes: +** +** 1) The arguments xp and yp are the coordinates (in radians) of the +** Celestial Intermediate Pole with respect to the International +** Terrestrial Reference System (see IERS Conventions 2003), +** measured along the meridians to 0 and 90 deg west respectively. +** +** 2) The argument sp is the TIO locator s', in radians, which +** positions the Terrestrial Intermediate Origin on the equator. It +** is obtained from polar motion observations by numerical +** integration, and so is in essence unpredictable. However, it is +** dominated by a secular drift of about 47 microarcseconds per +** century, and so can be taken into account by using s' = -47*t, +** where t is centuries since J2000.0. The function eraSp00 +** implements this approximation. +** +** 3) The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning +** that it is the final rotation when computing the pointing +** direction to a celestial source. +** +** Called: +** eraIr initialize r-matrix to identity +** eraRz rotate around Z-axis +** eraRy rotate around Y-axis +** eraRx rotate around X-axis +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Construct the matrix. */ + eraIr(rpom); + eraRz(sp, rpom); + eraRy(-xp, rpom); + eraRx(-yp, rpom); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ppp.c b/testbed/astropy__astropy/cextern/erfa/ppp.c new file mode 100644 index 0000000000000000000000000000000000000000..6e225ac3eac00fa23566b9514ec035168a49478a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ppp.c @@ -0,0 +1,94 @@ +#include "erfa.h" + +void eraPpp(double a[3], double b[3], double apb[3]) +/* +** - - - - - - - +** e r a P p p +** - - - - - - - +** +** P-vector addition. +** +** Given: +** a double[3] first p-vector +** b double[3] second p-vector +** +** Returned: +** apb double[3] a + b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + apb[0] = a[0] + b[0]; + apb[1] = a[1] + b[1]; + apb[2] = a[2] + b[2]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ppsp.c b/testbed/astropy__astropy/cextern/erfa/ppsp.c new file mode 100644 index 0000000000000000000000000000000000000000..5c97e8c9ddd707a8ae7c74f9d9dc3ff79203090d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ppsp.c @@ -0,0 +1,103 @@ +#include "erfa.h" + +void eraPpsp(double a[3], double s, double b[3], double apsb[3]) +/* +** - - - - - - - - +** e r a P p s p +** - - - - - - - - +** +** P-vector plus scaled p-vector. +** +** Given: +** a double[3] first p-vector +** s double scalar (multiplier for b) +** b double[3] second p-vector +** +** Returned: +** apsb double[3] a + s*b +** +** Note: +** It is permissible for any of a, b and apsb to be the same array. +** +** Called: +** eraSxp multiply p-vector by scalar +** eraPpp p-vector plus p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double sb[3]; + + +/* s*b. */ + eraSxp(s, b, sb); + +/* a + s*b. */ + eraPpp(a, sb, apsb); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pr00.c b/testbed/astropy__astropy/cextern/erfa/pr00.c new file mode 100644 index 0000000000000000000000000000000000000000..539e6d8cc659582628658f90f355d83db8d69bfe --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pr00.c @@ -0,0 +1,151 @@ +#include "erfa.h" + +void eraPr00(double date1, double date2, double *dpsipr, double *depspr) +/* +** - - - - - - - - +** e r a P r 0 0 +** - - - - - - - - +** +** Precession-rate part of the IAU 2000 precession-nutation models +** (part of MHB2000). +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** dpsipr,depspr double precession corrections (Notes 2,3) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The precession adjustments are expressed as "nutation +** components", corrections in longitude and obliquity with respect +** to the J2000.0 equinox and ecliptic. +** +** 3) Although the precession adjustments are stated to be with respect +** to Lieske et al. (1977), the MHB2000 model does not specify which +** set of Euler angles are to be used and how the adjustments are to +** be applied. The most literal and straightforward procedure is to +** adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and +** to add dpsipr to psi_A and depspr to both omega_A and eps_A. +** +** 4) This is an implementation of one aspect of the IAU 2000A nutation +** model, formally adopted by the IAU General Assembly in 2000, +** namely MHB2000 (Mathews et al. 2002). +** +** References: +** +** Lieske, J.H., Lederle, T., Fricke, W. & Morando, B., "Expressions +** for the precession quantities based upon the IAU (1976) System of +** Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977) +** +** Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation +** and precession New nutation series for nonrigid Earth and +** insights into the Earth's interior", J.Geophys.Res., 107, B4, +** 2002. The MHB2000 code itself was obtained on 9th September 2002 +** from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A. +** +** Wallace, P.T., "Software for Implementing the IAU 2000 +** Resolutions", in IERS Workshop 5.1 (2002). +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t; + +/* Precession and obliquity corrections (radians per century) */ + static const double PRECOR = -0.29965 * ERFA_DAS2R, + OBLCOR = -0.02524 * ERFA_DAS2R; + + +/* Interval between fundamental epoch J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Precession rate contributions with respect to IAU 1976/80. */ + *dpsipr = PRECOR * t; + *depspr = OBLCOR * t; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/prec76.c b/testbed/astropy__astropy/cextern/erfa/prec76.c new file mode 100644 index 0000000000000000000000000000000000000000..a13b928e6d8c6ae84357d493cb53ccf125c78220 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/prec76.c @@ -0,0 +1,157 @@ +#include "erfa.h" + +void eraPrec76(double date01, double date02, double date11, double date12, + double *zeta, double *z, double *theta) +/* +** - - - - - - - - - - +** e r a P r e c 7 6 +** - - - - - - - - - - +** +** IAU 1976 precession model. +** +** This function forms the three Euler angles which implement general +** precession between two dates, using the IAU 1976 model (as for the +** FK5 catalog). +** +** Given: +** date01,date02 double TDB starting date (Note 1) +** date11,date12 double TDB ending date (Note 1) +** +** Returned: +** zeta double 1st rotation: radians cw around z +** z double 3rd rotation: radians cw around z +** theta double 2nd rotation: radians ccw around y +** +** Notes: +** +** 1) The dates date01+date02 and date11+date12 are Julian Dates, +** apportioned in any convenient way between the arguments daten1 +** and daten2. For example, JD(TDB)=2450123.7 could be expressed in +** any of these ways, among others: +** +** daten1 daten2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in cases +** where the loss of several decimal digits of resolution is +** acceptable. The J2000 method is best matched to the way the +** argument is handled internally and will deliver the optimum +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** The two dates may be expressed using different methods, but at +** the risk of losing some resolution. +** +** 2) The accumulated precession angles zeta, z, theta are expressed +** through canonical polynomials which are valid only for a limited +** time span. In addition, the IAU 1976 precession rate is known to +** be imperfect. The absolute accuracy of the present formulation +** is better than 0.1 arcsec from 1960AD to 2040AD, better than +** 1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for +** the whole of the period 500BC to 3000AD. The errors exceed +** 10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec +** outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to +** 8200AD. +** +** 3) The three angles are returned in the conventional order, which +** is not the same as the order of the corresponding Euler +** rotations. The precession matrix is +** R_3(-z) x R_2(+theta) x R_3(-zeta). +** +** Reference: +** +** Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations +** (6) & (7), p283. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t0, t, tas2r, w; + + +/* Interval between fundamental epoch J2000.0 and start date (JC). */ + t0 = ((date01 - ERFA_DJ00) + date02) / ERFA_DJC; + +/* Interval over which precession required (JC). */ + t = ((date11 - date01) + (date12 - date02)) / ERFA_DJC; + +/* Euler angles. */ + tas2r = t * ERFA_DAS2R; + w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0; + + *zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r; + + *z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r; + + *theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0) + + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pv2p.c b/testbed/astropy__astropy/cextern/erfa/pv2p.c new file mode 100644 index 0000000000000000000000000000000000000000..f81ba42421c30e87bbadad8a2a343cdb59e376e6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pv2p.c @@ -0,0 +1,90 @@ +#include "erfa.h" + +void eraPv2p(double pv[2][3], double p[3]) +/* +** - - - - - - - - +** e r a P v 2 p +** - - - - - - - - +** +** Discard velocity component of a pv-vector. +** +** Given: +** pv double[2][3] pv-vector +** +** Returned: +** p double[3] p-vector +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraCp(pv[0], p); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pv2s.c b/testbed/astropy__astropy/cextern/erfa/pv2s.c new file mode 100644 index 0000000000000000000000000000000000000000..d53b4b4dcd6bf3e56e88625b0fbb01cd1e964e66 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pv2s.c @@ -0,0 +1,153 @@ +#include "erfa.h" + +void eraPv2s(double pv[2][3], + double *theta, double *phi, double *r, + double *td, double *pd, double *rd) +/* +** - - - - - - - - +** e r a P v 2 s +** - - - - - - - - +** +** Convert position/velocity from Cartesian to spherical coordinates. +** +** Given: +** pv double[2][3] pv-vector +** +** Returned: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** r double radial distance +** td double rate of change of theta +** pd double rate of change of phi +** rd double rate of change of r +** +** Notes: +** +** 1) If the position part of pv is null, theta, phi, td and pd +** are indeterminate. This is handled by extrapolating the +** position through unit time by using the velocity part of +** pv. This moves the origin without changing the direction +** of the velocity component. If the position and velocity +** components of pv are both null, zeroes are returned for all +** six results. +** +** 2) If the position is a pole, theta, td and pd are indeterminate. +** In such cases zeroes are returned for all three. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp; + + +/* Components of position/velocity vector. */ + x = pv[0][0]; + y = pv[0][1]; + z = pv[0][2]; + xd = pv[1][0]; + yd = pv[1][1]; + zd = pv[1][2]; + +/* Component of r in XY plane squared. */ + rxy2 = x*x + y*y; + +/* Modulus squared. */ + r2 = rxy2 + z*z; + +/* Modulus. */ + rtrue = sqrt(r2); + +/* If null vector, move the origin along the direction of movement. */ + rw = rtrue; + if (rtrue == 0.0) { + x = xd; + y = yd; + z = zd; + rxy2 = x*x + y*y; + r2 = rxy2 + z*z; + rw = sqrt(r2); + } + +/* Position and velocity in spherical coordinates. */ + rxy = sqrt(rxy2); + xyp = x*xd + y*yd; + if (rxy2 != 0.0) { + *theta = atan2(y, x); + *phi = atan2(z, rxy); + *td = (x*yd - y*xd) / rxy2; + *pd = (zd*rxy2 - z*xyp) / (r2*rxy); + } else { + *theta = 0.0; + *phi = (z != 0.0) ? atan2(z, rxy) : 0.0; + *td = 0.0; + *pd = 0.0; + } + *r = rtrue; + *rd = (rw != 0.0) ? (xyp + z*zd) / rw : 0.0; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvdpv.c b/testbed/astropy__astropy/cextern/erfa/pvdpv.c new file mode 100644 index 0000000000000000000000000000000000000000..93c3041625c6fb91dea107ab12be32d3eb1a7977 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvdpv.c @@ -0,0 +1,111 @@ +#include "erfa.h" + +void eraPvdpv(double a[2][3], double b[2][3], double adb[2]) +/* +** - - - - - - - - - +** e r a P v d p v +** - - - - - - - - - +** +** Inner (=scalar=dot) product of two pv-vectors. +** +** Given: +** a double[2][3] first pv-vector +** b double[2][3] second pv-vector +** +** Returned: +** adb double[2] a . b (see note) +** +** Note: +** +** If the position and velocity components of the two pv-vectors are +** ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of +** numbers ( ap . bp , ap . bv + av . bp ). The two numbers are the +** dot-product of the two p-vectors and its derivative. +** +** Called: +** eraPdp scalar product of two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double adbd, addb; + + +/* a . b = constant part of result. */ + adb[0] = eraPdp(a[0], b[0]); + +/* a . bdot */ + adbd = eraPdp(a[0], b[1]); + +/* adot . b */ + addb = eraPdp(a[1], b[0]); + +/* Velocity part of result. */ + adb[1] = adbd + addb; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvm.c b/testbed/astropy__astropy/cextern/erfa/pvm.c new file mode 100644 index 0000000000000000000000000000000000000000..13ba20299deb2d1cc631301bde8dc43d174f8f61 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvm.c @@ -0,0 +1,95 @@ +#include "erfa.h" + +void eraPvm(double pv[2][3], double *r, double *s) +/* +** - - - - - - - +** e r a P v m +** - - - - - - - +** +** Modulus of pv-vector. +** +** Given: +** pv double[2][3] pv-vector +** +** Returned: +** r double modulus of position component +** s double modulus of velocity component +** +** Called: +** eraPm modulus of p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Distance. */ + *r = eraPm(pv[0]); + +/* Speed. */ + *s = eraPm(pv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvmpv.c b/testbed/astropy__astropy/cextern/erfa/pvmpv.c new file mode 100644 index 0000000000000000000000000000000000000000..fbdb06f139c20ae854d123c2fa208ec4720a72e4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvmpv.c @@ -0,0 +1,96 @@ +#include "erfa.h" + +void eraPvmpv(double a[2][3], double b[2][3], double amb[2][3]) +/* +** - - - - - - - - - +** e r a P v m p v +** - - - - - - - - - +** +** Subtract one pv-vector from another. +** +** Given: +** a double[2][3] first pv-vector +** b double[2][3] second pv-vector +** +** Returned: +** amb double[2][3] a - b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Called: +** eraPmp p-vector minus p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraPmp(a[0], b[0], amb[0]); + eraPmp(a[1], b[1], amb[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvppv.c b/testbed/astropy__astropy/cextern/erfa/pvppv.c new file mode 100644 index 0000000000000000000000000000000000000000..7804ebab5a009826ecf5e80deb2be1d14879e717 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvppv.c @@ -0,0 +1,96 @@ +#include "erfa.h" + +void eraPvppv(double a[2][3], double b[2][3], double apb[2][3]) +/* +** - - - - - - - - - +** e r a P v p p v +** - - - - - - - - - +** +** Add one pv-vector to another. +** +** Given: +** a double[2][3] first pv-vector +** b double[2][3] second pv-vector +** +** Returned: +** apb double[2][3] a + b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Called: +** eraPpp p-vector plus p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraPpp(a[0], b[0], apb[0]); + eraPpp(a[1], b[1], apb[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvstar.c b/testbed/astropy__astropy/cextern/erfa/pvstar.c new file mode 100644 index 0000000000000000000000000000000000000000..2e6050b84227f0d6c42d014fe3cf42fe5767097f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvstar.c @@ -0,0 +1,216 @@ +#include "erfa.h" + +int eraPvstar(double pv[2][3], double *ra, double *dec, + double *pmr, double *pmd, double *px, double *rv) +/* +** - - - - - - - - - - +** e r a P v s t a r +** - - - - - - - - - - +** +** Convert star position+velocity vector to catalog coordinates. +** +** Given (Note 1): +** pv double[2][3] pv-vector (au, au/day) +** +** Returned (Note 2): +** ra double right ascension (radians) +** dec double declination (radians) +** pmr double RA proper motion (radians/year) +** pmd double Dec proper motion (radians/year) +** px double parallax (arcsec) +** rv double radial velocity (km/s, positive = receding) +** +** Returned (function value): +** int status: +** 0 = OK +** -1 = superluminal speed (Note 5) +** -2 = null position vector +** +** Notes: +** +** 1) The specified pv-vector is the coordinate direction (and its rate +** of change) for the date at which the light leaving the star +** reached the solar-system barycenter. +** +** 2) The star data returned by this function are "observables" for an +** imaginary observer at the solar-system barycenter. Proper motion +** and radial velocity are, strictly, in terms of barycentric +** coordinate time, TCB. For most practical applications, it is +** permissible to neglect the distinction between TCB and ordinary +** "proper" time on Earth (TT/TAI). The result will, as a rule, be +** limited by the intrinsic accuracy of the proper-motion and +** radial-velocity data; moreover, the supplied pv-vector is likely +** to be merely an intermediate result (for example generated by the +** function eraStarpv), so that a change of time unit will cancel +** out overall. +** +** In accordance with normal star-catalog conventions, the object's +** right ascension and declination are freed from the effects of +** secular aberration. The frame, which is aligned to the catalog +** equator and equinox, is Lorentzian and centered on the SSB. +** +** Summarizing, the specified pv-vector is for most stars almost +** identical to the result of applying the standard geometrical +** "space motion" transformation to the catalog data. The +** differences, which are the subject of the Stumpff paper cited +** below, are: +** +** (i) In stars with significant radial velocity and proper motion, +** the constantly changing light-time distorts the apparent proper +** motion. Note that this is a classical, not a relativistic, +** effect. +** +** (ii) The transformation complies with special relativity. +** +** 3) Care is needed with units. The star coordinates are in radians +** and the proper motions in radians per Julian year, but the +** parallax is in arcseconds; the radial velocity is in km/s, but +** the pv-vector result is in au and au/day. +** +** 4) The proper motions are the rate of change of the right ascension +** and declination at the catalog epoch and are in radians per Julian +** year. The RA proper motion is in terms of coordinate angle, not +** true angle, and will thus be numerically larger at high +** declinations. +** +** 5) Straight-line motion at constant speed in the inertial frame is +** assumed. If the speed is greater than or equal to the speed of +** light, the function aborts with an error status. +** +** 6) The inverse transformation is performed by the function eraStarpv. +** +** Called: +** eraPn decompose p-vector into modulus and direction +** eraPdp scalar product of two p-vectors +** eraSxp multiply p-vector by scalar +** eraPmp p-vector minus p-vector +** eraPm modulus of p-vector +** eraPpp p-vector plus p-vector +** eraPv2s pv-vector to spherical +** eraAnp normalize angle into range 0 to 2pi +** +** Reference: +** +** Stumpff, P., 1985, Astron.Astrophys. 144, 232-240. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double r, x[3], vr, ur[3], vt, ut[3], bett, betr, d, w, del, + usr[3], ust[3], a, rad, decd, rd; + + +/* Isolate the radial component of the velocity (au/day, inertial). */ + eraPn(pv[0], &r, x); + vr = eraPdp(x, pv[1]); + eraSxp(vr, x, ur); + +/* Isolate the transverse component of the velocity (au/day, inertial). */ + eraPmp(pv[1], ur, ut); + vt = eraPm(ut); + +/* Special-relativity dimensionless parameters. */ + bett = vt / ERFA_DC; + betr = vr / ERFA_DC; + +/* The inertial-to-observed correction terms. */ + d = 1.0 + betr; + w = betr*betr + bett*bett; + if (d == 0.0 || w > 1.0) return -1; + del = - w / (sqrt(1.0-w) + 1.0); + +/* Apply relativistic correction factor to radial velocity component. */ + w = (betr != 0) ? (betr - del) / (betr * d) : 1.0; + eraSxp(w, ur, usr); + +/* Apply relativistic correction factor to tangential velocity */ +/* component. */ + eraSxp(1.0/d, ut, ust); + +/* Combine the two to obtain the observed velocity vector (au/day). */ + eraPpp(usr, ust, pv[1]); + +/* Cartesian to spherical. */ + eraPv2s(pv, &a, dec, &r, &rad, &decd, &rd); + if (r == 0.0) return -2; + +/* Return RA in range 0 to 2pi. */ + *ra = eraAnp(a); + +/* Return proper motions in radians per year. */ + *pmr = rad * ERFA_DJY; + *pmd = decd * ERFA_DJY; + +/* Return parallax in arcsec. */ + *px = ERFA_DR2AS / r; + +/* Return radial velocity in km/s. */ + *rv = 1e-3 * rd * ERFA_DAU / ERFA_DAYSEC; + +/* OK status. */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvtob.c b/testbed/astropy__astropy/cextern/erfa/pvtob.c new file mode 100644 index 0000000000000000000000000000000000000000..b38b72c9cfce39ca570605af3dbf267ae9dc18d4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvtob.c @@ -0,0 +1,162 @@ +#include "erfa.h" + +void eraPvtob(double elong, double phi, double hm, + double xp, double yp, double sp, double theta, + double pv[2][3]) +/* +** - - - - - - - - - +** e r a P v t o b +** - - - - - - - - - +** +** Position and velocity of a terrestrial observing station. +** +** Given: +** elong double longitude (radians, east +ve, Note 1) +** phi double latitude (geodetic, radians, Note 1) +** hm double height above ref. ellipsoid (geodetic, m) +** xp,yp double coordinates of the pole (radians, Note 2) +** sp double the TIO locator s' (radians, Note 2) +** theta double Earth rotation angle (radians, Note 3) +** +** Returned: +** pv double[2][3] position/velocity vector (m, m/s, CIRS) +** +** Notes: +** +** 1) The terrestrial coordinates are with respect to the ERFA_WGS84 +** reference ellipsoid. +** +** 2) xp and yp are the coordinates (in radians) of the Celestial +** Intermediate Pole with respect to the International Terrestrial +** Reference System (see IERS Conventions), measured along the +** meridians 0 and 90 deg west respectively. sp is the TIO locator +** s', in radians, which positions the Terrestrial Intermediate +** Origin on the equator. For many applications, xp, yp and +** (especially) sp can be set to zero. +** +** 3) If theta is Greenwich apparent sidereal time instead of Earth +** rotation angle, the result is with respect to the true equator +** and equinox of date, i.e. with the x-axis at the equinox rather +** than the celestial intermediate origin. +** +** 4) The velocity units are meters per UT1 second, not per SI second. +** This is unlikely to have any practical consequences in the modern +** era. +** +** 5) No validation is performed on the arguments. Error cases that +** could lead to arithmetic exceptions are trapped by the eraGd2gc +** function, and the result set to zeros. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to +** the Astronomical Almanac, 3rd ed., University Science Books +** (2013), Section 7.4.3.3. +** +** Called: +** eraGd2gc geodetic to geocentric transformation +** eraPom00 polar motion matrix +** eraTrxp product of transpose of r-matrix and p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Earth rotation rate in radians per UT1 second */ + const double OM = 1.00273781191135448 * ERFA_D2PI / ERFA_DAYSEC; + + double xyzm[3], rpm[3][3], xyz[3], x, y, z, s, c; + + +/* Geodetic to geocentric transformation (ERFA_WGS84). */ + (void) eraGd2gc(1, elong, phi, hm, xyzm); + +/* Polar motion and TIO position. */ + eraPom00(xp, yp, sp, rpm); + eraTrxp(rpm, xyzm, xyz); + x = xyz[0]; + y = xyz[1]; + z = xyz[2]; + +/* Functions of ERA. */ + s = sin(theta); + c = cos(theta); + +/* Position. */ + pv[0][0] = c*x - s*y; + pv[0][1] = s*x + c*y; + pv[0][2] = z; + +/* Velocity. */ + pv[1][0] = OM * ( -s*x - c*y ); + pv[1][1] = OM * ( c*x - s*y ); + pv[1][2] = 0.0; + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvu.c b/testbed/astropy__astropy/cextern/erfa/pvu.c new file mode 100644 index 0000000000000000000000000000000000000000..8660956049cf4ba2b700db4ca5c6b58453927e01 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvu.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +void eraPvu(double dt, double pv[2][3], double upv[2][3]) +/* +** - - - - - - - +** e r a P v u +** - - - - - - - +** +** Update a pv-vector. +** +** Given: +** dt double time interval +** pv double[2][3] pv-vector +** +** Returned: +** upv double[2][3] p updated, v unchanged +** +** Notes: +** +** 1) "Update" means "refer the position component of the vector +** to a new date dt time units from the existing date". +** +** 2) The time units of dt must match those of the velocity. +** +** 3) It is permissible for pv and upv to be the same array. +** +** Called: +** eraPpsp p-vector plus scaled p-vector +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraPpsp(pv[0], dt, pv[1], upv[0]); + eraCp(pv[1], upv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvup.c b/testbed/astropy__astropy/cextern/erfa/pvup.c new file mode 100644 index 0000000000000000000000000000000000000000..426a739af7bf9c740b7bfdf157f221b03cb65fce --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvup.c @@ -0,0 +1,97 @@ +#include "erfa.h" + +void eraPvup(double dt, double pv[2][3], double p[3]) +/* +** - - - - - - - - +** e r a P v u p +** - - - - - - - - +** +** Update a pv-vector, discarding the velocity component. +** +** Given: +** dt double time interval +** pv double[2][3] pv-vector +** +** Returned: +** p double[3] p-vector +** +** Notes: +** +** 1) "Update" means "refer the position component of the vector to a +** new date dt time units from the existing date". +** +** 2) The time units of dt must match those of the velocity. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + p[0] = pv[0][0] + dt * pv[1][0]; + p[1] = pv[0][1] + dt * pv[1][1]; + p[2] = pv[0][2] + dt * pv[1][2]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pvxpv.c b/testbed/astropy__astropy/cextern/erfa/pvxpv.c new file mode 100644 index 0000000000000000000000000000000000000000..3b66f003e6f0a964f60533c2f826be56681a8d61 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pvxpv.c @@ -0,0 +1,116 @@ +#include "erfa.h" + +void eraPvxpv(double a[2][3], double b[2][3], double axb[2][3]) +/* +** - - - - - - - - - +** e r a P v x p v +** - - - - - - - - - +** +** Outer (=vector=cross) product of two pv-vectors. +** +** Given: +** a double[2][3] first pv-vector +** b double[2][3] second pv-vector +** +** Returned: +** axb double[2][3] a x b +** +** Notes: +** +** 1) If the position and velocity components of the two pv-vectors are +** ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of +** vectors ( ap x bp, ap x bv + av x bp ). The two vectors are the +** cross-product of the two p-vectors and its derivative. +** +** 2) It is permissible to re-use the same array for any of the +** arguments. +** +** Called: +** eraCpv copy pv-vector +** eraPxp vector product of two p-vectors +** eraPpp p-vector plus p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double wa[2][3], wb[2][3], axbd[3], adxb[3]; + + +/* Make copies of the inputs. */ + eraCpv(a, wa); + eraCpv(b, wb); + +/* a x b = position part of result. */ + eraPxp(wa[0], wb[0], axb[0]); + +/* a x bdot + adot x b = velocity part of result. */ + eraPxp(wa[0], wb[1], axbd); + eraPxp(wa[1], wb[0], adxb); + eraPpp(axbd, adxb, axb[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/pxp.c b/testbed/astropy__astropy/cextern/erfa/pxp.c new file mode 100644 index 0000000000000000000000000000000000000000..34f06afec0f593a6b2275c3037cf660e2522fd13 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/pxp.c @@ -0,0 +1,103 @@ +#include "erfa.h" + +void eraPxp(double a[3], double b[3], double axb[3]) +/* +** - - - - - - - +** e r a P x p +** - - - - - - - +** +** p-vector outer (=vector=cross) product. +** +** Given: +** a double[3] first p-vector +** b double[3] second p-vector +** +** Returned: +** axb double[3] a x b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double xa, ya, za, xb, yb, zb; + + + xa = a[0]; + ya = a[1]; + za = a[2]; + xb = b[0]; + yb = b[1]; + zb = b[2]; + axb[0] = ya*zb - za*yb; + axb[1] = za*xb - xa*zb; + axb[2] = xa*yb - ya*xb; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/refco.c b/testbed/astropy__astropy/cextern/erfa/refco.c new file mode 100644 index 0000000000000000000000000000000000000000..9f6a2ca863d04aefcf04ef4f907a7c30ef8dde89 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/refco.c @@ -0,0 +1,262 @@ +#include "erfa.h" + +void eraRefco(double phpa, double tc, double rh, double wl, + double *refa, double *refb) +/* +** - - - - - - - - - +** e r a R e f c o +** - - - - - - - - - +** +** Determine the constants A and B in the atmospheric refraction model +** dZ = A tan Z + B tan^3 Z. +** +** Z is the "observed" zenith distance (i.e. affected by refraction) +** and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo) +** zenith distance. +** +** Given: +** phpa double pressure at the observer (hPa = millibar) +** tc double ambient temperature at the observer (deg C) +** rh double relative humidity at the observer (range 0-1) +** wl double wavelength (micrometers) +** +** Returned: +** refa double* tan Z coefficient (radians) +** refb double* tan^3 Z coefficient (radians) +** +** Notes: +** +** 1) The model balances speed and accuracy to give good results in +** applications where performance at low altitudes is not paramount. +** Performance is maintained across a range of conditions, and +** applies to both optical/IR and radio. +** +** 2) The model omits the effects of (i) height above sea level (apart +** from the reduced pressure itself), (ii) latitude (i.e. the +** flattening of the Earth), (iii) variations in tropospheric lapse +** rate and (iv) dispersive effects in the radio. +** +** The model was tested using the following range of conditions: +** +** lapse rates 0.0055, 0.0065, 0.0075 deg/meter +** latitudes 0, 25, 50, 75 degrees +** heights 0, 2500, 5000 meters ASL +** pressures mean for height -10% to +5% in steps of 5% +** temperatures -10 deg to +20 deg with respect to 280 deg at SL +** relative humidity 0, 0.5, 1 +** wavelengths 0.4, 0.6, ... 2 micron, + radio +** zenith distances 15, 45, 75 degrees +** +** The accuracy with respect to raytracing through a model +** atmosphere was as follows: +** +** worst RMS +** +** optical/IR 62 mas 8 mas +** radio 319 mas 49 mas +** +** For this particular set of conditions: +** +** lapse rate 0.0065 K/meter +** latitude 50 degrees +** sea level +** pressure 1005 mb +** temperature 280.15 K +** humidity 80% +** wavelength 5740 Angstroms +** +** the results were as follows: +** +** ZD raytrace eraRefco Saastamoinen +** +** 10 10.27 10.27 10.27 +** 20 21.19 21.20 21.19 +** 30 33.61 33.61 33.60 +** 40 48.82 48.83 48.81 +** 45 58.16 58.18 58.16 +** 50 69.28 69.30 69.27 +** 55 82.97 82.99 82.95 +** 60 100.51 100.54 100.50 +** 65 124.23 124.26 124.20 +** 70 158.63 158.68 158.61 +** 72 177.32 177.37 177.31 +** 74 200.35 200.38 200.32 +** 76 229.45 229.43 229.42 +** 78 267.44 267.29 267.41 +** 80 319.13 318.55 319.10 +** +** deg arcsec arcsec arcsec +** +** The values for Saastamoinen's formula (which includes terms +** up to tan^5) are taken from Hohenkerk and Sinclair (1985). +** +** 3) A wl value in the range 0-100 selects the optical/IR case and is +** wavelength in micrometers. Any value outside this range selects +** the radio case. +** +** 4) Outlandish input parameters are silently limited to +** mathematically safe values. Zero pressure is permissible, and +** causes zeroes to be returned. +** +** 5) The algorithm draws on several sources, as follows: +** +** a) The formula for the saturation vapour pressure of water as +** a function of temperature and temperature is taken from +** Equations (A4.5-A4.7) of Gill (1982). +** +** b) The formula for the water vapour pressure, given the +** saturation pressure and the relative humidity, is from +** Crane (1976), Equation (2.5.5). +** +** c) The refractivity of air is a function of temperature, +** total pressure, water-vapour pressure and, in the case +** of optical/IR, wavelength. The formulae for the two cases are +** developed from Hohenkerk & Sinclair (1985) and Rueger (2002). +** +** d) The formula for beta, the ratio of the scale height of the +** atmosphere to the geocentric distance of the observer, is +** an adaption of Equation (9) from Stone (1996). The +** adaptations, arrived at empirically, consist of (i) a small +** adjustment to the coefficient and (ii) a humidity term for the +** radio case only. +** +** e) The formulae for the refraction constants as a function of +** n-1 and beta are from Green (1987), Equation (4.31). +** +** References: +** +** Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral +** Atmosphere", Methods of Experimental Physics: Astrophysics 12B, +** Academic Press, 1976. +** +** Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press, +** 1982. +** +** Green, R.M., "Spherical Astronomy", Cambridge University Press, +** 1987. +** +** Hohenkerk, C.Y., & Sinclair, A.T., NAO Technical Note No. 63, +** 1985. +** +** Rueger, J.M., "Refractive Index Formulae for Electronic Distance +** Measurement with Radio and Millimetre Waves", in Unisurv Report +** S-68, School of Surveying and Spatial Information Systems, +** University of New South Wales, Sydney, Australia, 2002. +** +** Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int optic; + double p, t, r, w, ps, pw, tk, wlsq, gamma, beta; + + +/* Decide whether optical/IR or radio case: switch at 100 microns. */ + optic = ( wl <= 100.0 ); + +/* Restrict parameters to safe values. */ + t = ERFA_GMAX ( tc, -150.0 ); + t = ERFA_GMIN ( t, 200.0 ); + p = ERFA_GMAX ( phpa, 0.0 ); + p = ERFA_GMIN ( p, 10000.0 ); + r = ERFA_GMAX ( rh, 0.0 ); + r = ERFA_GMIN ( r, 1.0 ); + w = ERFA_GMAX ( wl, 0.1 ); + w = ERFA_GMIN ( w, 1e6 ); + +/* Water vapour pressure at the observer. */ + if ( p > 0.0 ) { + ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) / + ( 1.0 + 0.00412*t ) ) * + ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t ) ); + pw = r * ps / ( 1.0 - (1.0-r)*ps/p ); + } else { + pw = 0.0; + } + +/* Refractive index minus 1 at the observer. */ + tk = t + 273.15; + if ( optic ) { + wlsq = w * w; + gamma = ( ( 77.53484e-6 + + ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p + - 11.2684e-6*pw ) / tk; + } else { + gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk; + } + +/* Formula for beta from Stone, with empirical adjustments. */ + beta = 4.4474e-6 * tk; + if ( ! optic ) beta -= 0.0074 * pw * beta; + +/* Refraction constants from Green. */ + *refa = gamma * ( 1.0 - beta ); + *refb = - gamma * ( beta - gamma / 2.0 ); + +/* Finished. */ + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rm2v.c b/testbed/astropy__astropy/cextern/erfa/rm2v.c new file mode 100644 index 0000000000000000000000000000000000000000..aba4a0514516fb4ea0f8063906f33990284605c8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rm2v.c @@ -0,0 +1,120 @@ +#include "erfa.h" + +void eraRm2v(double r[3][3], double w[3]) +/* +** - - - - - - - - +** e r a R m 2 v +** - - - - - - - - +** +** Express an r-matrix as an r-vector. +** +** Given: +** r double[3][3] rotation matrix +** +** Returned: +** w double[3] rotation vector (Note 1) +** +** Notes: +** +** 1) A rotation matrix describes a rotation through some angle about +** some arbitrary axis called the Euler axis. The "rotation vector" +** returned by this function has the same direction as the Euler axis, +** and its magnitude is the angle in radians. (The magnitude and +** direction can be separated by means of the function eraPn.) +** +** 2) If r is null, so is the result. If r is not a rotation matrix +** the result is undefined; r must be proper (i.e. have a positive +** determinant) and real orthogonal (inverse = transpose). +** +** 3) The reference frame rotates clockwise as seen looking along +** the rotation vector from the origin. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y, z, s2, c2, phi, f; + + + x = r[1][2] - r[2][1]; + y = r[2][0] - r[0][2]; + z = r[0][1] - r[1][0]; + s2 = sqrt(x*x + y*y + z*z); + if (s2 > 0) { + c2 = r[0][0] + r[1][1] + r[2][2] - 1.0; + phi = atan2(s2, c2); + f = phi / s2; + w[0] = x * f; + w[1] = y * f; + w[2] = z * f; + } else { + w[0] = 0.0; + w[1] = 0.0; + w[2] = 0.0; + } + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rv2m.c b/testbed/astropy__astropy/cextern/erfa/rv2m.c new file mode 100644 index 0000000000000000000000000000000000000000..b6b66f7e497de47897ebdd4681d1ddbbff41e463 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rv2m.c @@ -0,0 +1,127 @@ +#include "erfa.h" + +void eraRv2m(double w[3], double r[3][3]) +/* +** - - - - - - - - +** e r a R v 2 m +** - - - - - - - - +** +** Form the r-matrix corresponding to a given r-vector. +** +** Given: +** w double[3] rotation vector (Note 1) +** +** Returned: +** r double[3][3] rotation matrix +** +** Notes: +** +** 1) A rotation matrix describes a rotation through some angle about +** some arbitrary axis called the Euler axis. The "rotation vector" +** supplied to This function has the same direction as the Euler +** axis, and its magnitude is the angle in radians. +** +** 2) If w is null, the unit matrix is returned. +** +** 3) The reference frame rotates clockwise as seen looking along the +** rotation vector from the origin. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double x, y, z, phi, s, c, f; + + +/* Euler angle (magnitude of rotation vector) and functions. */ + x = w[0]; + y = w[1]; + z = w[2]; + phi = sqrt(x*x + y*y + z*z); + s = sin(phi); + c = cos(phi); + f = 1.0 - c; + +/* Euler axis (direction of rotation vector), perhaps null. */ + if (phi > 0.0) { + x /= phi; + y /= phi; + z /= phi; + } + +/* Form the rotation matrix. */ + r[0][0] = x*x*f + c; + r[0][1] = x*y*f + z*s; + r[0][2] = x*z*f - y*s; + r[1][0] = y*x*f - z*s; + r[1][1] = y*y*f + c; + r[1][2] = y*z*f + x*s; + r[2][0] = z*x*f + y*s; + r[2][1] = z*y*f - x*s; + r[2][2] = z*z*f + c; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rx.c b/testbed/astropy__astropy/cextern/erfa/rx.c new file mode 100644 index 0000000000000000000000000000000000000000..1c84badcdd0357fb2b4b280d50d889dd9220fe75 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rx.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +void eraRx(double phi, double r[3][3]) +/* +** - - - - - - +** e r a R x +** - - - - - - +** +** Rotate an r-matrix about the x-axis. +** +** Given: +** phi double angle (radians) +** +** Given and returned: +** r double[3][3] r-matrix, rotated +** +** Notes: +** +** 1) Calling this function with positive phi incorporates in the +** supplied r-matrix r an additional rotation, about the x-axis, +** anticlockwise as seen looking towards the origin from positive x. +** +** 2) The additional rotation can be represented by this matrix: +** +** ( 1 0 0 ) +** ( ) +** ( 0 + cos(phi) + sin(phi) ) +** ( ) +** ( 0 - sin(phi) + cos(phi) ) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double s, c, a10, a11, a12, a20, a21, a22; + + + s = sin(phi); + c = cos(phi); + + a10 = c*r[1][0] + s*r[2][0]; + a11 = c*r[1][1] + s*r[2][1]; + a12 = c*r[1][2] + s*r[2][2]; + a20 = - s*r[1][0] + c*r[2][0]; + a21 = - s*r[1][1] + c*r[2][1]; + a22 = - s*r[1][2] + c*r[2][2]; + + r[1][0] = a10; + r[1][1] = a11; + r[1][2] = a12; + r[2][0] = a20; + r[2][1] = a21; + r[2][2] = a22; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rxp.c b/testbed/astropy__astropy/cextern/erfa/rxp.c new file mode 100644 index 0000000000000000000000000000000000000000..13292e1c6d1e1db4d08797ffbd5aa7421499ce2d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rxp.c @@ -0,0 +1,108 @@ +#include "erfa.h" + +void eraRxp(double r[3][3], double p[3], double rp[3]) +/* +** - - - - - - - +** e r a R x p +** - - - - - - - +** +** Multiply a p-vector by an r-matrix. +** +** Given: +** r double[3][3] r-matrix +** p double[3] p-vector +** +** Returned: +** rp double[3] r * p +** +** Note: +** It is permissible for p and rp to be the same array. +** +** Called: +** eraCp copy p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double w, wrp[3]; + int i, j; + + +/* Matrix r * vector p. */ + for (j = 0; j < 3; j++) { + w = 0.0; + for (i = 0; i < 3; i++) { + w += r[j][i] * p[i]; + } + wrp[j] = w; + } + +/* Return the result. */ + eraCp(wrp, rp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rxpv.c b/testbed/astropy__astropy/cextern/erfa/rxpv.c new file mode 100644 index 0000000000000000000000000000000000000000..6977452e42c9bf3766b08a69ec9e793a1f453d70 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rxpv.c @@ -0,0 +1,95 @@ +#include "erfa.h" + +void eraRxpv(double r[3][3], double pv[2][3], double rpv[2][3]) +/* +** - - - - - - - - +** e r a R x p v +** - - - - - - - - +** +** Multiply a pv-vector by an r-matrix. +** +** Given: +** r double[3][3] r-matrix +** pv double[2][3] pv-vector +** +** Returned: +** rpv double[2][3] r * pv +** +** Note: +** It is permissible for pv and rpv to be the same array. +** +** Called: +** eraRxp product of r-matrix and p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraRxp(r, pv[0], rpv[0]); + eraRxp(r, pv[1], rpv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rxr.c b/testbed/astropy__astropy/cextern/erfa/rxr.c new file mode 100644 index 0000000000000000000000000000000000000000..319dcc64c48c68e0a09d6f3b9a5a9d8af92dfc75 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rxr.c @@ -0,0 +1,108 @@ +#include "erfa.h" + +void eraRxr(double a[3][3], double b[3][3], double atb[3][3]) +/* +** - - - - - - - +** e r a R x r +** - - - - - - - +** +** Multiply two r-matrices. +** +** Given: +** a double[3][3] first r-matrix +** b double[3][3] second r-matrix +** +** Returned: +** atb double[3][3] a * b +** +** Note: +** It is permissible to re-use the same array for any of the +** arguments. +** +** Called: +** eraCr copy r-matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int i, j, k; + double w, wm[3][3]; + + + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + w = 0.0; + for (k = 0; k < 3; k++) { + w += a[i][k] * b[k][j]; + } + wm[i][j] = w; + } + } + eraCr(wm, atb); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ry.c b/testbed/astropy__astropy/cextern/erfa/ry.c new file mode 100644 index 0000000000000000000000000000000000000000..3ece0d754e013f4a1ff70b6e451b835dc02b0c19 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ry.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +void eraRy(double theta, double r[3][3]) +/* +** - - - - - - +** e r a R y +** - - - - - - +** +** Rotate an r-matrix about the y-axis. +** +** Given: +** theta double angle (radians) +** +** Given and returned: +** r double[3][3] r-matrix, rotated +** +** Notes: +** +** 1) Calling this function with positive theta incorporates in the +** supplied r-matrix r an additional rotation, about the y-axis, +** anticlockwise as seen looking towards the origin from positive y. +** +** 2) The additional rotation can be represented by this matrix: +** +** ( + cos(theta) 0 - sin(theta) ) +** ( ) +** ( 0 1 0 ) +** ( ) +** ( + sin(theta) 0 + cos(theta) ) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double s, c, a00, a01, a02, a20, a21, a22; + + + s = sin(theta); + c = cos(theta); + + a00 = c*r[0][0] - s*r[2][0]; + a01 = c*r[0][1] - s*r[2][1]; + a02 = c*r[0][2] - s*r[2][2]; + a20 = s*r[0][0] + c*r[2][0]; + a21 = s*r[0][1] + c*r[2][1]; + a22 = s*r[0][2] + c*r[2][2]; + + r[0][0] = a00; + r[0][1] = a01; + r[0][2] = a02; + r[2][0] = a20; + r[2][1] = a21; + r[2][2] = a22; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/rz.c b/testbed/astropy__astropy/cextern/erfa/rz.c new file mode 100644 index 0000000000000000000000000000000000000000..3cb3544e3a48e6ced4deb8da495fa7e13ee49658 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/rz.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +void eraRz(double psi, double r[3][3]) +/* +** - - - - - - +** e r a R z +** - - - - - - +** +** Rotate an r-matrix about the z-axis. +** +** Given: +** psi double angle (radians) +** +** Given and returned: +** r double[3][3] r-matrix, rotated +** +** Notes: +** +** 1) Calling this function with positive psi incorporates in the +** supplied r-matrix r an additional rotation, about the z-axis, +** anticlockwise as seen looking towards the origin from positive z. +** +** 2) The additional rotation can be represented by this matrix: +** +** ( + cos(psi) + sin(psi) 0 ) +** ( ) +** ( - sin(psi) + cos(psi) 0 ) +** ( ) +** ( 0 0 1 ) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double s, c, a00, a01, a02, a10, a11, a12; + + + s = sin(psi); + c = cos(psi); + + a00 = c*r[0][0] + s*r[1][0]; + a01 = c*r[0][1] + s*r[1][1]; + a02 = c*r[0][2] + s*r[1][2]; + a10 = - s*r[0][0] + c*r[1][0]; + a11 = - s*r[0][1] + c*r[1][1]; + a12 = - s*r[0][2] + c*r[1][2]; + + r[0][0] = a00; + r[0][1] = a01; + r[0][2] = a02; + r[1][0] = a10; + r[1][1] = a11; + r[1][2] = a12; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s00.c b/testbed/astropy__astropy/cextern/erfa/s00.c new file mode 100644 index 0000000000000000000000000000000000000000..2f55a13374e7e548c543f3f4b01ca04e178698ab --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s00.c @@ -0,0 +1,380 @@ +#include "erfa.h" + +double eraS00(double date1, double date2, double x, double y) +/* +** - - - - - - - +** e r a S 0 0 +** - - - - - - - +** +** The CIO locator s, positioning the Celestial Intermediate Origin on +** the equator of the Celestial Intermediate Pole, given the CIP's X,Y +** coordinates. Compatible with IAU 2000A precession-nutation. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** x,y double CIP coordinates (Note 3) +** +** Returned (function value): +** double the CIO locator s in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The CIO locator s is the difference between the right ascensions +** of the same point in two systems: the two systems are the GCRS +** and the CIP,CIO, and the point is the ascending node of the +** CIP equator. The quantity s remains below 0.1 arcsecond +** throughout 1900-2100. +** +** 3) The series used to compute s is in fact for s+XY/2, where X and Y +** are the x and y components of the CIP unit vector; this series +** is more compact than a direct series for s would be. This +** function requires X,Y to be supplied by the caller, who is +** responsible for providing values that are consistent with the +** supplied date. +** +** 4) The model is consistent with the IAU 2000A precession-nutation. +** +** Called: +** eraFal03 mean anomaly of the Moon +** eraFalp03 mean anomaly of the Sun +** eraFaf03 mean argument of the latitude of the Moon +** eraFad03 mean elongation of the Moon from the Sun +** eraFaom03 mean longitude of the Moon's ascending node +** eraFave03 mean longitude of Venus +** eraFae03 mean longitude of Earth +** eraFapa03 general accumulated precession in longitude +** +** References: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Time since J2000.0, in Julian centuries */ + double t; + +/* Miscellaneous */ + int i, j; + double a, w0, w1, w2, w3, w4, w5; + +/* Fundamental arguments */ + double fa[8]; + +/* Returned value */ + double s; + +/* --------------------- */ +/* The series for s+XY/2 */ +/* --------------------- */ + + typedef struct { + int nfa[8]; /* coefficients of l,l',F,D,Om,LVe,LE,pA */ + double s, c; /* sine and cosine coefficients */ + } TERM; + +/* Polynomial coefficients */ + static const double sp[] = { + + /* 1-6 */ + 94.00e-6, + 3808.35e-6, + -119.94e-6, + -72574.09e-6, + 27.70e-6, + 15.61e-6 + }; + +/* Terms of order t^0 */ + static const TERM s0[] = { + + /* 1-10 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, -2640.73e-6, 0.39e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -63.53e-6, 0.02e-6 }, + {{ 0, 0, 2, -2, 3, 0, 0, 0}, -11.75e-6, -0.01e-6 }, + {{ 0, 0, 2, -2, 1, 0, 0, 0}, -11.21e-6, -0.01e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, 4.57e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 3, 0, 0, 0}, -2.02e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 1, 0, 0, 0}, -1.98e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 3, 0, 0, 0}, 1.72e-6, 0.00e-6 }, + {{ 0, 1, 0, 0, 1, 0, 0, 0}, 1.41e-6, 0.01e-6 }, + {{ 0, 1, 0, 0, -1, 0, 0, 0}, 1.26e-6, 0.01e-6 }, + + /* 11-20 */ + {{ 1, 0, 0, 0, -1, 0, 0, 0}, 0.63e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, 1, 0, 0, 0}, 0.63e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 3, 0, 0, 0}, -0.46e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 1, 0, 0, 0}, -0.45e-6, 0.00e-6 }, + {{ 0, 0, 4, -4, 4, 0, 0, 0}, -0.36e-6, 0.00e-6 }, + {{ 0, 0, 1, -1, 1, -8, 12, 0}, 0.24e-6, 0.12e-6 }, + {{ 0, 0, 2, 0, 0, 0, 0, 0}, -0.32e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, -0.28e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 3, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 1, 0, 0, 0}, -0.26e-6, 0.00e-6 }, + + /* 21-30 */ + {{ 0, 0, 2, -2, 0, 0, 0, 0}, 0.21e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -3, 0, 0, 0}, -0.19e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -1, 0, 0, 0}, -0.18e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 0, 8,-13, -1}, 0.10e-6, -0.05e-6 }, + {{ 0, 0, 0, 2, 0, 0, 0, 0}, -0.15e-6, 0.00e-6 }, + {{ 2, 0, -2, 0, -1, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 2, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, 1, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, -1, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 0, 0, 4, -2, 4, 0, 0, 0}, -0.13e-6, 0.00e-6 }, + + /* 31-33 */ + {{ 0, 0, 2, -2, 4, 0, 0, 0}, 0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -3, 0, 0, 0}, -0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -1, 0, 0, 0}, -0.11e-6, 0.00e-6 } + }; + +/* Terms of order t^1 */ + static const TERM s1[] ={ + + /* 1-3 */ + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -0.07e-6, 3.57e-6 }, + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 1.71e-6, -0.03e-6 }, + {{ 0, 0, 2, -2, 3, 0, 0, 0}, 0.00e-6, 0.48e-6 } + }; + +/* Terms of order t^2 */ + static const TERM s2[] ={ + + /* 1-10 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 743.53e-6, -0.17e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, 56.91e-6, 0.06e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, 9.84e-6, -0.01e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -8.85e-6, 0.01e-6 }, + {{ 0, 1, 0, 0, 0, 0, 0, 0}, -6.38e-6, -0.05e-6 }, + {{ 1, 0, 0, 0, 0, 0, 0, 0}, -3.07e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 2, 0, 0, 0}, 2.23e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 1, 0, 0, 0}, 1.67e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 2, 0, 0, 0}, 1.30e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -2, 0, 0, 0}, 0.93e-6, 0.00e-6 }, + + /* 11-20 */ + {{ 1, 0, 0, -2, 0, 0, 0, 0}, 0.68e-6, 0.00e-6 }, + {{ 0, 0, 2, -2, 1, 0, 0, 0}, -0.55e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -2, 0, 0, 0}, 0.53e-6, 0.00e-6 }, + {{ 0, 0, 0, 2, 0, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, 1, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, -2, -2, -2, 0, 0, 0}, -0.26e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, -1, 0, 0, 0}, -0.25e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 1, 0, 0, 0}, 0.22e-6, 0.00e-6 }, + {{ 2, 0, 0, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6 }, + {{ 2, 0, -2, 0, -1, 0, 0, 0}, 0.20e-6, 0.00e-6 }, + + /* 21-25 */ + {{ 0, 0, 2, 2, 2, 0, 0, 0}, 0.17e-6, 0.00e-6 }, + {{ 2, 0, 2, 0, 2, 0, 0, 0}, 0.13e-6, 0.00e-6 }, + {{ 2, 0, 0, 0, 0, 0, 0, 0}, -0.13e-6, 0.00e-6 }, + {{ 1, 0, 2, -2, 2, 0, 0, 0}, -0.12e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 0, 0, 0, 0}, -0.11e-6, 0.00e-6 } + }; + +/* Terms of order t^3 */ + static const TERM s3[] ={ + + /* 1-4 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 0.30e-6, -23.51e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, -0.03e-6, -1.39e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, -0.01e-6, -0.24e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, 0.00e-6, 0.22e-6 } + }; + +/* Terms of order t^4 */ + static const TERM s4[] ={ + + /* 1-1 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, -0.26e-6, -0.01e-6 } + }; + +/* Number of terms in the series */ + const int NS0 = (int) (sizeof s0 / sizeof (TERM)); + const int NS1 = (int) (sizeof s1 / sizeof (TERM)); + const int NS2 = (int) (sizeof s2 / sizeof (TERM)); + const int NS3 = (int) (sizeof s3 / sizeof (TERM)); + const int NS4 = (int) (sizeof s4 / sizeof (TERM)); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental epoch J2000.0 and current date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Fundamental Arguments (from IERS Conventions 2003) */ + +/* Mean anomaly of the Moon. */ + fa[0] = eraFal03(t); + +/* Mean anomaly of the Sun. */ + fa[1] = eraFalp03(t); + +/* Mean longitude of the Moon minus that of the ascending node. */ + fa[2] = eraFaf03(t); + +/* Mean elongation of the Moon from the Sun. */ + fa[3] = eraFad03(t); + +/* Mean longitude of the ascending node of the Moon. */ + fa[4] = eraFaom03(t); + +/* Mean longitude of Venus. */ + fa[5] = eraFave03(t); + +/* Mean longitude of Earth. */ + fa[6] = eraFae03(t); + +/* General precession in longitude. */ + fa[7] = eraFapa03(t); + +/* Evaluate s. */ + w0 = sp[0]; + w1 = sp[1]; + w2 = sp[2]; + w3 = sp[3]; + w4 = sp[4]; + w5 = sp[5]; + + for (i = NS0-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s0[i].nfa[j] * fa[j]; + } + w0 += s0[i].s * sin(a) + s0[i].c * cos(a); + } + + for (i = NS1-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s1[i].nfa[j] * fa[j]; + } + w1 += s1[i].s * sin(a) + s1[i].c * cos(a); + } + + for (i = NS2-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s2[i].nfa[j] * fa[j]; + } + w2 += s2[i].s * sin(a) + s2[i].c * cos(a); + } + + for (i = NS3-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s3[i].nfa[j] * fa[j]; + } + w3 += s3[i].s * sin(a) + s3[i].c * cos(a); + } + + for (i = NS4-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s4[i].nfa[j] * fa[j]; + } + w4 += s4[i].s * sin(a) + s4[i].c * cos(a); + } + + s = (w0 + + (w1 + + (w2 + + (w3 + + (w4 + + w5 * t) * t) * t) * t) * t) * ERFA_DAS2R - x*y/2.0; + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s00a.c b/testbed/astropy__astropy/cextern/erfa/s00a.c new file mode 100644 index 0000000000000000000000000000000000000000..7c0d4e8ad4c505a63434dbda3d069c9106529893 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s00a.c @@ -0,0 +1,152 @@ +#include "erfa.h" + +double eraS00a(double date1, double date2) +/* +** - - - - - - - - +** e r a S 0 0 a +** - - - - - - - - +** +** The CIO locator s, positioning the Celestial Intermediate Origin on +** the equator of the Celestial Intermediate Pole, using the IAU 2000A +** precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double the CIO locator s in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The CIO locator s is the difference between the right ascensions +** of the same point in two systems. The two systems are the GCRS +** and the CIP,CIO, and the point is the ascending node of the +** CIP equator. The CIO locator s remains a small fraction of +** 1 arcsecond throughout 1900-2100. +** +** 3) The series used to compute s is in fact for s+XY/2, where X and Y +** are the x and y components of the CIP unit vector; this series +** is more compact than a direct series for s would be. The present +** function uses the full IAU 2000A nutation model when predicting +** the CIP position. Faster results, with no significant loss of +** accuracy, can be obtained via the function eraS00b, which uses +** instead the IAU 2000B truncated model. +** +** Called: +** eraPnm00a classical NPB matrix, IAU 2000A +** eraBnp2xy extract CIP X,Y from the BPN matrix +** eraS00 the CIO locator s, given X,Y, IAU 2000A +** +** References: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3], x, y, s; + + +/* Bias-precession-nutation-matrix, IAU 2000A. */ + eraPnm00a(date1, date2, rbpn); + +/* Extract the CIP coordinates. */ + eraBpn2xy(rbpn, &x, &y); + +/* Compute the CIO locator s, given the CIP coordinates. */ + s = eraS00(date1, date2, x, y); + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s00b.c b/testbed/astropy__astropy/cextern/erfa/s00b.c new file mode 100644 index 0000000000000000000000000000000000000000..353d9172b6723f3073a1f624fc20904353997d42 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s00b.c @@ -0,0 +1,152 @@ +#include "erfa.h" + +double eraS00b(double date1, double date2) +/* +** - - - - - - - - +** e r a S 0 0 b +** - - - - - - - - +** +** The CIO locator s, positioning the Celestial Intermediate Origin on +** the equator of the Celestial Intermediate Pole, using the IAU 2000B +** precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double the CIO locator s in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The CIO locator s is the difference between the right ascensions +** of the same point in two systems. The two systems are the GCRS +** and the CIP,CIO, and the point is the ascending node of the +** CIP equator. The CIO locator s remains a small fraction of +** 1 arcsecond throughout 1900-2100. +** +** 3) The series used to compute s is in fact for s+XY/2, where X and Y +** are the x and y components of the CIP unit vector; this series +** is more compact than a direct series for s would be. The present +** function uses the IAU 2000B truncated nutation model when +** predicting the CIP position. The function eraS00a uses instead +** the full IAU 2000A model, but with no significant increase in +** accuracy and at some cost in speed. +** +** Called: +** eraPnm00b classical NPB matrix, IAU 2000B +** eraBnp2xy extract CIP X,Y from the BPN matrix +** eraS00 the CIO locator s, given X,Y, IAU 2000A +** +** References: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3], x, y, s; + + +/* Bias-precession-nutation-matrix, IAU 2000B. */ + eraPnm00b(date1, date2, rbpn); + +/* Extract the CIP coordinates. */ + eraBpn2xy(rbpn, &x, &y); + +/* Compute the CIO locator s, given the CIP coordinates. */ + s = eraS00(date1, date2, x, y); + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s06.c b/testbed/astropy__astropy/cextern/erfa/s06.c new file mode 100644 index 0000000000000000000000000000000000000000..69545e0983ee5cd317a9dcb382e60f13522d6ff0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s06.c @@ -0,0 +1,377 @@ +#include "erfa.h" + +double eraS06(double date1, double date2, double x, double y) +/* +** - - - - - - - +** e r a S 0 6 +** - - - - - - - +** +** The CIO locator s, positioning the Celestial Intermediate Origin on +** the equator of the Celestial Intermediate Pole, given the CIP's X,Y +** coordinates. Compatible with IAU 2006/2000A precession-nutation. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** x,y double CIP coordinates (Note 3) +** +** Returned (function value): +** double the CIO locator s in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The CIO locator s is the difference between the right ascensions +** of the same point in two systems: the two systems are the GCRS +** and the CIP,CIO, and the point is the ascending node of the +** CIP equator. The quantity s remains below 0.1 arcsecond +** throughout 1900-2100. +** +** 3) The series used to compute s is in fact for s+XY/2, where X and Y +** are the x and y components of the CIP unit vector; this series +** is more compact than a direct series for s would be. This +** function requires X,Y to be supplied by the caller, who is +** responsible for providing values that are consistent with the +** supplied date. +** +** 4) The model is consistent with the "P03" precession (Capitaine et +** al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the +** IAU 2000A nutation (with P03 adjustments). +** +** Called: +** eraFal03 mean anomaly of the Moon +** eraFalp03 mean anomaly of the Sun +** eraFaf03 mean argument of the latitude of the Moon +** eraFad03 mean elongation of the Moon from the Sun +** eraFaom03 mean longitude of the Moon's ascending node +** eraFave03 mean longitude of Venus +** eraFae03 mean longitude of Earth +** eraFapa03 general accumulated precession in longitude +** +** References: +** +** Capitaine, N., Wallace, P.T. & Chapront, J., 2003, Astron. +** Astrophys. 432, 355 +** +** McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Time since J2000.0, in Julian centuries */ + double t; + +/* Miscellaneous */ + int i, j; + double a, w0, w1, w2, w3, w4, w5; + +/* Fundamental arguments */ + double fa[8]; + +/* Returned value */ + double s; + +/* --------------------- */ +/* The series for s+XY/2 */ +/* --------------------- */ + + typedef struct { + int nfa[8]; /* coefficients of l,l',F,D,Om,LVe,LE,pA */ + double s, c; /* sine and cosine coefficients */ + } TERM; + +/* Polynomial coefficients */ + static const double sp[] = { + + /* 1-6 */ + 94.00e-6, + 3808.65e-6, + -122.68e-6, + -72574.11e-6, + 27.98e-6, + 15.62e-6 + }; + +/* Terms of order t^0 */ + static const TERM s0[] = { + + /* 1-10 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, -2640.73e-6, 0.39e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -63.53e-6, 0.02e-6 }, + {{ 0, 0, 2, -2, 3, 0, 0, 0}, -11.75e-6, -0.01e-6 }, + {{ 0, 0, 2, -2, 1, 0, 0, 0}, -11.21e-6, -0.01e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, 4.57e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 3, 0, 0, 0}, -2.02e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 1, 0, 0, 0}, -1.98e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 3, 0, 0, 0}, 1.72e-6, 0.00e-6 }, + {{ 0, 1, 0, 0, 1, 0, 0, 0}, 1.41e-6, 0.01e-6 }, + {{ 0, 1, 0, 0, -1, 0, 0, 0}, 1.26e-6, 0.01e-6 }, + + /* 11-20 */ + {{ 1, 0, 0, 0, -1, 0, 0, 0}, 0.63e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, 1, 0, 0, 0}, 0.63e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 3, 0, 0, 0}, -0.46e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 1, 0, 0, 0}, -0.45e-6, 0.00e-6 }, + {{ 0, 0, 4, -4, 4, 0, 0, 0}, -0.36e-6, 0.00e-6 }, + {{ 0, 0, 1, -1, 1, -8, 12, 0}, 0.24e-6, 0.12e-6 }, + {{ 0, 0, 2, 0, 0, 0, 0, 0}, -0.32e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, -0.28e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 3, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 1, 0, 0, 0}, -0.26e-6, 0.00e-6 }, + + /* 21-30 */ + {{ 0, 0, 2, -2, 0, 0, 0, 0}, 0.21e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -3, 0, 0, 0}, -0.19e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -1, 0, 0, 0}, -0.18e-6, 0.00e-6 }, + {{ 0, 0, 0, 0, 0, 8,-13, -1}, 0.10e-6, -0.05e-6 }, + {{ 0, 0, 0, 2, 0, 0, 0, 0}, -0.15e-6, 0.00e-6 }, + {{ 2, 0, -2, 0, -1, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 2, 0, 0, 0}, 0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, 1, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 1, 0, 0, -2, -1, 0, 0, 0}, -0.14e-6, 0.00e-6 }, + {{ 0, 0, 4, -2, 4, 0, 0, 0}, -0.13e-6, 0.00e-6 }, + + /* 31-33 */ + {{ 0, 0, 2, -2, 4, 0, 0, 0}, 0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -3, 0, 0, 0}, -0.11e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -1, 0, 0, 0}, -0.11e-6, 0.00e-6 } + }; + +/* Terms of order t^1 */ + static const TERM s1[] = { + + /* 1 - 3 */ + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -0.07e-6, 3.57e-6 }, + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 1.73e-6, -0.03e-6 }, + {{ 0, 0, 2, -2, 3, 0, 0, 0}, 0.00e-6, 0.48e-6 } + }; + +/* Terms of order t^2 */ + static const TERM s2[] = { + + /* 1-10 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 743.52e-6, -0.17e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, 56.91e-6, 0.06e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, 9.84e-6, -0.01e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, -8.85e-6, 0.01e-6 }, + {{ 0, 1, 0, 0, 0, 0, 0, 0}, -6.38e-6, -0.05e-6 }, + {{ 1, 0, 0, 0, 0, 0, 0, 0}, -3.07e-6, 0.00e-6 }, + {{ 0, 1, 2, -2, 2, 0, 0, 0}, 2.23e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 1, 0, 0, 0}, 1.67e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 2, 0, 0, 0}, 1.30e-6, 0.00e-6 }, + {{ 0, 1, -2, 2, -2, 0, 0, 0}, 0.93e-6, 0.00e-6 }, + + /* 11-20 */ + {{ 1, 0, 0, -2, 0, 0, 0, 0}, 0.68e-6, 0.00e-6 }, + {{ 0, 0, 2, -2, 1, 0, 0, 0}, -0.55e-6, 0.00e-6 }, + {{ 1, 0, -2, 0, -2, 0, 0, 0}, 0.53e-6, 0.00e-6 }, + {{ 0, 0, 0, 2, 0, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, 1, 0, 0, 0}, -0.27e-6, 0.00e-6 }, + {{ 1, 0, -2, -2, -2, 0, 0, 0}, -0.26e-6, 0.00e-6 }, + {{ 1, 0, 0, 0, -1, 0, 0, 0}, -0.25e-6, 0.00e-6 }, + {{ 1, 0, 2, 0, 1, 0, 0, 0}, 0.22e-6, 0.00e-6 }, + {{ 2, 0, 0, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6 }, + {{ 2, 0, -2, 0, -1, 0, 0, 0}, 0.20e-6, 0.00e-6 }, + + /* 21-25 */ + {{ 0, 0, 2, 2, 2, 0, 0, 0}, 0.17e-6, 0.00e-6 }, + {{ 2, 0, 2, 0, 2, 0, 0, 0}, 0.13e-6, 0.00e-6 }, + {{ 2, 0, 0, 0, 0, 0, 0, 0}, -0.13e-6, 0.00e-6 }, + {{ 1, 0, 2, -2, 2, 0, 0, 0}, -0.12e-6, 0.00e-6 }, + {{ 0, 0, 2, 0, 0, 0, 0, 0}, -0.11e-6, 0.00e-6 } + }; + +/* Terms of order t^3 */ + static const TERM s3[] = { + + /* 1-4 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, 0.30e-6, -23.42e-6 }, + {{ 0, 0, 2, -2, 2, 0, 0, 0}, -0.03e-6, -1.46e-6 }, + {{ 0, 0, 2, 0, 2, 0, 0, 0}, -0.01e-6, -0.25e-6 }, + {{ 0, 0, 0, 0, 2, 0, 0, 0}, 0.00e-6, 0.23e-6 } + }; + +/* Terms of order t^4 */ + static const TERM s4[] = { + + /* 1-1 */ + {{ 0, 0, 0, 0, 1, 0, 0, 0}, -0.26e-6, -0.01e-6 } + }; + +/* Number of terms in the series */ + static const int NS0 = (int) (sizeof s0 / sizeof (TERM)); + static const int NS1 = (int) (sizeof s1 / sizeof (TERM)); + static const int NS2 = (int) (sizeof s2 / sizeof (TERM)); + static const int NS3 = (int) (sizeof s3 / sizeof (TERM)); + static const int NS4 = (int) (sizeof s4 / sizeof (TERM)); + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental epoch J2000.0 and current date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Fundamental Arguments (from IERS Conventions 2003) */ + +/* Mean anomaly of the Moon. */ + fa[0] = eraFal03(t); + +/* Mean anomaly of the Sun. */ + fa[1] = eraFalp03(t); + +/* Mean longitude of the Moon minus that of the ascending node. */ + fa[2] = eraFaf03(t); + +/* Mean elongation of the Moon from the Sun. */ + fa[3] = eraFad03(t); + +/* Mean longitude of the ascending node of the Moon. */ + fa[4] = eraFaom03(t); + +/* Mean longitude of Venus. */ + fa[5] = eraFave03(t); + +/* Mean longitude of Earth. */ + fa[6] = eraFae03(t); + +/* General precession in longitude. */ + fa[7] = eraFapa03(t); + +/* Evaluate s. */ + w0 = sp[0]; + w1 = sp[1]; + w2 = sp[2]; + w3 = sp[3]; + w4 = sp[4]; + w5 = sp[5]; + + for (i = NS0-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s0[i].nfa[j] * fa[j]; + } + w0 += s0[i].s * sin(a) + s0[i].c * cos(a); + } + + for (i = NS1-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s1[i].nfa[j] * fa[j]; + } + w1 += s1[i].s * sin(a) + s1[i].c * cos(a); + } + + for (i = NS2-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s2[i].nfa[j] * fa[j]; + } + w2 += s2[i].s * sin(a) + s2[i].c * cos(a); + } + + for (i = NS3-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s3[i].nfa[j] * fa[j]; + } + w3 += s3[i].s * sin(a) + s3[i].c * cos(a); + } + + for (i = NS4-1; i >= 0; i--) { + a = 0.0; + for (j = 0; j < 8; j++) { + a += (double)s4[i].nfa[j] * fa[j]; + } + w4 += s4[i].s * sin(a) + s4[i].c * cos(a); + } + + s = (w0 + + (w1 + + (w2 + + (w3 + + (w4 + + w5 * t) * t) * t) * t) * t) * ERFA_DAS2R - x*y/2.0; + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s06a.c b/testbed/astropy__astropy/cextern/erfa/s06a.c new file mode 100644 index 0000000000000000000000000000000000000000..6890ff7ed55e966a4fbf73796893459a93c43b62 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s06a.c @@ -0,0 +1,154 @@ +#include "erfa.h" + +double eraS06a(double date1, double date2) +/* +** - - - - - - - - +** e r a S 0 6 a +** - - - - - - - - +** +** The CIO locator s, positioning the Celestial Intermediate Origin on +** the equator of the Celestial Intermediate Pole, using the IAU 2006 +** precession and IAU 2000A nutation models. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double the CIO locator s in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The CIO locator s is the difference between the right ascensions +** of the same point in two systems. The two systems are the GCRS +** and the CIP,CIO, and the point is the ascending node of the +** CIP equator. The CIO locator s remains a small fraction of +** 1 arcsecond throughout 1900-2100. +** +** 3) The series used to compute s is in fact for s+XY/2, where X and Y +** are the x and y components of the CIP unit vector; this series is +** more compact than a direct series for s would be. The present +** function uses the full IAU 2000A nutation model when predicting +** the CIP position. +** +** Called: +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** +** References: +** +** Capitaine, N., Chapront, J., Lambert, S. and Wallace, P., +** "Expressions for the Celestial Intermediate Pole and Celestial +** Ephemeris Origin consistent with the IAU 2000A precession- +** nutation model", Astron.Astrophys. 400, 1145-1154 (2003) +** +** n.b. The celestial ephemeris origin (CEO) was renamed "celestial +** intermediate origin" (CIO) by IAU 2006 Resolution 2. +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rnpb[3][3], x, y, s; + + +/* Bias-precession-nutation-matrix, IAU 20006/2000A. */ + eraPnm06a(date1, date2, rnpb); + +/* Extract the CIP coordinates. */ + eraBpn2xy(rnpb, &x, &y); + +/* Compute the CIO locator s, given the CIP coordinates. */ + s = eraS06(date1, date2, x, y); + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s2c.c b/testbed/astropy__astropy/cextern/erfa/s2c.c new file mode 100644 index 0000000000000000000000000000000000000000..35d935f1b2f54000c4bc109f86a683e6058b0172 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s2c.c @@ -0,0 +1,94 @@ +#include "erfa.h" + +void eraS2c(double theta, double phi, double c[3]) +/* +** - - - - - - - +** e r a S 2 c +** - - - - - - - +** +** Convert spherical coordinates to Cartesian. +** +** Given: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** +** Returned: +** c double[3] direction cosines +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double cp; + + + cp = cos(phi); + c[0] = cos(theta) * cp; + c[1] = sin(theta) * cp; + c[2] = sin(phi); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s2p.c b/testbed/astropy__astropy/cextern/erfa/s2p.c new file mode 100644 index 0000000000000000000000000000000000000000..fc787fa79af43c242c8f000502afbcc131eec5e2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s2p.c @@ -0,0 +1,97 @@ +#include "erfa.h" + +void eraS2p(double theta, double phi, double r, double p[3]) +/* +** - - - - - - - +** e r a S 2 p +** - - - - - - - +** +** Convert spherical polar coordinates to p-vector. +** +** Given: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** r double radial distance +** +** Returned: +** p double[3] Cartesian coordinates +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraSxp multiply p-vector by scalar +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double u[3]; + + + eraS2c(theta, phi, u); + eraSxp(r, u, p); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s2pv.c b/testbed/astropy__astropy/cextern/erfa/s2pv.c new file mode 100644 index 0000000000000000000000000000000000000000..9d5439f3b186c5750f94e213264cb0a06064b56f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s2pv.c @@ -0,0 +1,112 @@ +#include "erfa.h" + +void eraS2pv(double theta, double phi, double r, + double td, double pd, double rd, + double pv[2][3]) +/* +** - - - - - - - - +** e r a S 2 p v +** - - - - - - - - +** +** Convert position/velocity from spherical to Cartesian coordinates. +** +** Given: +** theta double longitude angle (radians) +** phi double latitude angle (radians) +** r double radial distance +** td double rate of change of theta +** pd double rate of change of phi +** rd double rate of change of r +** +** Returned: +** pv double[2][3] pv-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double st, ct, sp, cp, rcp, x, y, rpd, w; + + + st = sin(theta); + ct = cos(theta); + sp = sin(phi); + cp = cos(phi); + rcp = r * cp; + x = rcp * ct; + y = rcp * st; + rpd = r * pd; + w = rpd*sp - cp*rd; + + pv[0][0] = x; + pv[0][1] = y; + pv[0][2] = r * sp; + pv[1][0] = -y*td - w*ct; + pv[1][1] = x*td - w*st; + pv[1][2] = rpd*cp + sp*rd; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/s2xpv.c b/testbed/astropy__astropy/cextern/erfa/s2xpv.c new file mode 100644 index 0000000000000000000000000000000000000000..272c116f798ae0f1476a4b77d9fdc37162e7153b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/s2xpv.c @@ -0,0 +1,96 @@ +#include "erfa.h" + +void eraS2xpv(double s1, double s2, double pv[2][3], double spv[2][3]) +/* +** - - - - - - - - - +** e r a S 2 x p v +** - - - - - - - - - +** +** Multiply a pv-vector by two scalars. +** +** Given: +** s1 double scalar to multiply position component by +** s2 double scalar to multiply velocity component by +** pv double[2][3] pv-vector +** +** Returned: +** spv double[2][3] pv-vector: p scaled by s1, v scaled by s2 +** +** Note: +** It is permissible for pv and spv to be the same array. +** +** Called: +** eraSxp multiply p-vector by scalar +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraSxp(s1, pv[0], spv[0]); + eraSxp(s2, pv[1], spv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/sepp.c b/testbed/astropy__astropy/cextern/erfa/sepp.c new file mode 100644 index 0000000000000000000000000000000000000000..6144e52cd41fae8a0530ea2a839901d07b86339d --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/sepp.c @@ -0,0 +1,114 @@ +#include "erfa.h" + +double eraSepp(double a[3], double b[3]) +/* +** - - - - - - - - +** e r a S e p p +** - - - - - - - - +** +** Angular separation between two p-vectors. +** +** Given: +** a double[3] first p-vector (not necessarily unit length) +** b double[3] second p-vector (not necessarily unit length) +** +** Returned (function value): +** double angular separation (radians, always positive) +** +** Notes: +** +** 1) If either vector is null, a zero result is returned. +** +** 2) The angular separation is most simply formulated in terms of +** scalar product. However, this gives poor accuracy for angles +** near zero and pi. The present algorithm uses both cross product +** and dot product, to deliver full accuracy whatever the size of +** the angle. +** +** Called: +** eraPxp vector product of two p-vectors +** eraPm modulus of p-vector +** eraPdp scalar product of two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double axb[3], ss, cs, s; + + +/* Sine of angle between the vectors, multiplied by the two moduli. */ + eraPxp(a, b, axb); + ss = eraPm(axb); + +/* Cosine of the angle, multiplied by the two moduli. */ + cs = eraPdp(a, b); + +/* The angle. */ + s = ((ss != 0.0) || (cs != 0.0)) ? atan2(ss, cs) : 0.0; + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/seps.c b/testbed/astropy__astropy/cextern/erfa/seps.c new file mode 100644 index 0000000000000000000000000000000000000000..49795feec20f9768d45585c372ea190ba8cece25 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/seps.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +double eraSeps(double al, double ap, double bl, double bp) +/* +** - - - - - - - - +** e r a S e p s +** - - - - - - - - +** +** Angular separation between two sets of spherical coordinates. +** +** Given: +** al double first longitude (radians) +** ap double first latitude (radians) +** bl double second longitude (radians) +** bp double second latitude (radians) +** +** Returned (function value): +** double angular separation (radians) +** +** Called: +** eraS2c spherical coordinates to unit vector +** eraSepp angular separation between two p-vectors +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double ac[3], bc[3], s; + + +/* Spherical to Cartesian. */ + eraS2c(al, ap, ac); + eraS2c(bl, bp, bc); + +/* Angle between the vectors. */ + s = eraSepp(ac, bc); + + return s; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/sp00.c b/testbed/astropy__astropy/cextern/erfa/sp00.c new file mode 100644 index 0000000000000000000000000000000000000000..2fed268b55e2e9a1431ec1dc04c928d245a6e9a3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/sp00.c @@ -0,0 +1,127 @@ +#include "erfa.h" + +double eraSp00(double date1, double date2) +/* +** - - - - - - - - +** e r a S p 0 0 +** - - - - - - - - +** +** The TIO locator s', positioning the Terrestrial Intermediate Origin +** on the equator of the Celestial Intermediate Pole. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned (function value): +** double the TIO locator s' in radians (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The TIO locator s' is obtained from polar motion observations by +** numerical integration, and so is in essence unpredictable. +** However, it is dominated by a secular drift of about +** 47 microarcseconds per century, which is the approximation +** evaluated by the present function. +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double t, sp; + + +/* Interval between fundamental epoch J2000.0 and current date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Approximate s'. */ + sp = -47e-6 * t * ERFA_DAS2R; + + return sp; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/starpm.c b/testbed/astropy__astropy/cextern/erfa/starpm.c new file mode 100644 index 0000000000000000000000000000000000000000..c852eaab57227572fc801dd19cc7eefde0591aa7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/starpm.c @@ -0,0 +1,214 @@ +#include "erfa.h" + +int eraStarpm(double ra1, double dec1, + double pmr1, double pmd1, double px1, double rv1, + double ep1a, double ep1b, double ep2a, double ep2b, + double *ra2, double *dec2, + double *pmr2, double *pmd2, double *px2, double *rv2) +/* +** - - - - - - - - - - +** e r a S t a r p m +** - - - - - - - - - - +** +** Star proper motion: update star catalog data for space motion. +** +** Given: +** ra1 double right ascension (radians), before +** dec1 double declination (radians), before +** pmr1 double RA proper motion (radians/year), before +** pmd1 double Dec proper motion (radians/year), before +** px1 double parallax (arcseconds), before +** rv1 double radial velocity (km/s, +ve = receding), before +** ep1a double "before" epoch, part A (Note 1) +** ep1b double "before" epoch, part B (Note 1) +** ep2a double "after" epoch, part A (Note 1) +** ep2b double "after" epoch, part B (Note 1) +** +** Returned: +** ra2 double right ascension (radians), after +** dec2 double declination (radians), after +** pmr2 double RA proper motion (radians/year), after +** pmd2 double Dec proper motion (radians/year), after +** px2 double parallax (arcseconds), after +** rv2 double radial velocity (km/s, +ve = receding), after +** +** Returned (function value): +** int status: +** -1 = system error (should not occur) +** 0 = no warnings or errors +** 1 = distance overridden (Note 6) +** 2 = excessive velocity (Note 7) +** 4 = solution didn't converge (Note 8) +** else = binary logical OR of the above warnings +** +** Notes: +** +** 1) The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are +** Julian Dates, apportioned in any convenient way between the two +** parts (A and B). For example, JD(TDB)=2450123.7 could be +** expressed in any of these ways, among others: +** +** epna epnb +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) In accordance with normal star-catalog conventions, the object's +** right ascension and declination are freed from the effects of +** secular aberration. The frame, which is aligned to the catalog +** equator and equinox, is Lorentzian and centered on the SSB. +** +** The proper motions are the rate of change of the right ascension +** and declination at the catalog epoch and are in radians per TDB +** Julian year. +** +** The parallax and radial velocity are in the same frame. +** +** 3) Care is needed with units. The star coordinates are in radians +** and the proper motions in radians per Julian year, but the +** parallax is in arcseconds. +** +** 4) The RA proper motion is in terms of coordinate angle, not true +** angle. If the catalog uses arcseconds for both RA and Dec proper +** motions, the RA proper motion will need to be divided by cos(Dec) +** before use. +** +** 5) Straight-line motion at constant speed, in the inertial frame, +** is assumed. +** +** 6) An extremely small (or zero or negative) parallax is interpreted +** to mean that the object is on the "celestial sphere", the radius +** of which is an arbitrary (large) value (see the eraStarpv +** function for the value used). When the distance is overridden in +** this way, the status, initially zero, has 1 added to it. +** +** 7) If the space velocity is a significant fraction of c (see the +** constant VMAX in the function eraStarpv), it is arbitrarily set +** to zero. When this action occurs, 2 is added to the status. +** +** 8) The relativistic adjustment carried out in the eraStarpv function +** involves an iterative calculation. If the process fails to +** converge within a set number of iterations, 4 is added to the +** status. +** +** Called: +** eraStarpv star catalog data to space motion pv-vector +** eraPvu update a pv-vector +** eraPdp scalar product of two p-vectors +** eraPvstar space motion pv-vector to star catalog data +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double pv1[2][3], tl1, dt, pv[2][3], r2, rdv, v2, c2mv2, tl2, + pv2[2][3]; + int j1, j2, j; + + +/* RA,Dec etc. at the "before" epoch to space motion pv-vector. */ + j1 = eraStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1); + +/* Light time when observed (days). */ + tl1 = eraPm(pv1[0]) / ERFA_DC; + +/* Time interval, "before" to "after" (days). */ + dt = (ep2a - ep1a) + (ep2b - ep1b); + +/* Move star along track from the "before" observed position to the */ +/* "after" geometric position. */ + eraPvu(dt + tl1, pv1, pv); + +/* From this geometric position, deduce the observed light time (days) */ +/* at the "after" epoch (with theoretically unneccessary error check). */ + r2 = eraPdp(pv[0], pv[0]); + rdv = eraPdp(pv[0], pv[1]); + v2 = eraPdp(pv[1], pv[1]); + c2mv2 = ERFA_DC*ERFA_DC - v2; + if (c2mv2 <= 0) return -1; + tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2; + +/* Move the position along track from the observed place at the */ +/* "before" epoch to the observed place at the "after" epoch. */ + eraPvu(dt + (tl1 - tl2), pv1, pv2); + +/* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */ + j2 = eraPvstar(pv2, ra2, dec2, pmr2, pmd2, px2, rv2); + +/* Final status. */ + j = (j2 == 0) ? j1 : -1; + + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/starpv.c b/testbed/astropy__astropy/cextern/erfa/starpv.c new file mode 100644 index 0000000000000000000000000000000000000000..19b66e9cd05ee16cc01b9fc1e0f0152b3f9d7dd7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/starpv.c @@ -0,0 +1,274 @@ +#include "erfa.h" + +int eraStarpv(double ra, double dec, + double pmr, double pmd, double px, double rv, + double pv[2][3]) +/* +** - - - - - - - - - - +** e r a S t a r p v +** - - - - - - - - - - +** +** Convert star catalog coordinates to position+velocity vector. +** +** Given (Note 1): +** ra double right ascension (radians) +** dec double declination (radians) +** pmr double RA proper motion (radians/year) +** pmd double Dec proper motion (radians/year) +** px double parallax (arcseconds) +** rv double radial velocity (km/s, positive = receding) +** +** Returned (Note 2): +** pv double[2][3] pv-vector (au, au/day) +** +** Returned (function value): +** int status: +** 0 = no warnings +** 1 = distance overridden (Note 6) +** 2 = excessive speed (Note 7) +** 4 = solution didn't converge (Note 8) +** else = binary logical OR of the above +** +** Notes: +** +** 1) The star data accepted by this function are "observables" for an +** imaginary observer at the solar-system barycenter. Proper motion +** and radial velocity are, strictly, in terms of barycentric +** coordinate time, TCB. For most practical applications, it is +** permissible to neglect the distinction between TCB and ordinary +** "proper" time on Earth (TT/TAI). The result will, as a rule, be +** limited by the intrinsic accuracy of the proper-motion and +** radial-velocity data; moreover, the pv-vector is likely to be +** merely an intermediate result, so that a change of time unit +** would cancel out overall. +** +** In accordance with normal star-catalog conventions, the object's +** right ascension and declination are freed from the effects of +** secular aberration. The frame, which is aligned to the catalog +** equator and equinox, is Lorentzian and centered on the SSB. +** +** 2) The resulting position and velocity pv-vector is with respect to +** the same frame and, like the catalog coordinates, is freed from +** the effects of secular aberration. Should the "coordinate +** direction", where the object was located at the catalog epoch, be +** required, it may be obtained by calculating the magnitude of the +** position vector pv[0][0-2] dividing by the speed of light in +** au/day to give the light-time, and then multiplying the space +** velocity pv[1][0-2] by this light-time and adding the result to +** pv[0][0-2]. +** +** Summarizing, the pv-vector returned is for most stars almost +** identical to the result of applying the standard geometrical +** "space motion" transformation. The differences, which are the +** subject of the Stumpff paper referenced below, are: +** +** (i) In stars with significant radial velocity and proper motion, +** the constantly changing light-time distorts the apparent proper +** motion. Note that this is a classical, not a relativistic, +** effect. +** +** (ii) The transformation complies with special relativity. +** +** 3) Care is needed with units. The star coordinates are in radians +** and the proper motions in radians per Julian year, but the +** parallax is in arcseconds; the radial velocity is in km/s, but +** the pv-vector result is in au and au/day. +** +** 4) The RA proper motion is in terms of coordinate angle, not true +** angle. If the catalog uses arcseconds for both RA and Dec proper +** motions, the RA proper motion will need to be divided by cos(Dec) +** before use. +** +** 5) Straight-line motion at constant speed, in the inertial frame, +** is assumed. +** +** 6) An extremely small (or zero or negative) parallax is interpreted +** to mean that the object is on the "celestial sphere", the radius +** of which is an arbitrary (large) value (see the constant PXMIN). +** When the distance is overridden in this way, the status, +** initially zero, has 1 added to it. +** +** 7) If the space velocity is a significant fraction of c (see the +** constant VMAX), it is arbitrarily set to zero. When this action +** occurs, 2 is added to the status. +** +** 8) The relativistic adjustment involves an iterative calculation. +** If the process fails to converge within a set number (IMAX) of +** iterations, 4 is added to the status. +** +** 9) The inverse transformation is performed by the function +** eraPvstar. +** +** Called: +** eraS2pv spherical coordinates to pv-vector +** eraPm modulus of p-vector +** eraZp zero p-vector +** eraPn decompose p-vector into modulus and direction +** eraPdp scalar product of two p-vectors +** eraSxp multiply p-vector by scalar +** eraPmp p-vector minus p-vector +** eraPpp p-vector plus p-vector +** +** Reference: +** +** Stumpff, P., 1985, Astron.Astrophys. 144, 232-240. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ +/* Smallest allowed parallax */ + static const double PXMIN = 1e-7; + +/* Largest allowed speed (fraction of c) */ + static const double VMAX = 0.5; + +/* Maximum number of iterations for relativistic solution */ + static const int IMAX = 100; + + int i, iwarn; + double w, r, rd, rad, decd, v, x[3], usr[3], ust[3], + vsr, vst, betst, betsr, bett, betr, + dd, ddel, ur[3], ut[3], + d = 0.0, del = 0.0, /* to prevent */ + odd = 0.0, oddel = 0.0, /* compiler */ + od = 0.0, odel = 0.0; /* warnings */ + + +/* Distance (au). */ + if (px >= PXMIN) { + w = px; + iwarn = 0; + } else { + w = PXMIN; + iwarn = 1; + } + r = ERFA_DR2AS / w; + +/* Radial velocity (au/day). */ + rd = ERFA_DAYSEC * rv * 1e3 / ERFA_DAU; + +/* Proper motion (radian/day). */ + rad = pmr / ERFA_DJY; + decd = pmd / ERFA_DJY; + +/* To pv-vector (au,au/day). */ + eraS2pv(ra, dec, r, rad, decd, rd, pv); + +/* If excessive velocity, arbitrarily set it to zero. */ + v = eraPm(pv[1]); + if (v / ERFA_DC > VMAX) { + eraZp(pv[1]); + iwarn += 2; + } + +/* Isolate the radial component of the velocity (au/day). */ + eraPn(pv[0], &w, x); + vsr = eraPdp(x, pv[1]); + eraSxp(vsr, x, usr); + +/* Isolate the transverse component of the velocity (au/day). */ + eraPmp(pv[1], usr, ust); + vst = eraPm(ust); + +/* Special-relativity dimensionless parameters. */ + betsr = vsr / ERFA_DC; + betst = vst / ERFA_DC; + +/* Determine the inertial-to-observed relativistic correction terms. */ + bett = betst; + betr = betsr; + for (i = 0; i < IMAX; i++) { + d = 1.0 + betr; + w = betr*betr + bett*bett; + del = - w / (sqrt(1.0 - w) + 1.0); + betr = d * betsr + del; + bett = d * betst; + if (i > 0) { + dd = fabs(d - od); + ddel = fabs(del - odel); + if ((i > 1) && (dd >= odd) && (ddel >= oddel)) break; + odd = dd; + oddel = ddel; + } + od = d; + odel = del; + } + if (i >= IMAX) iwarn += 4; + +/* Replace observed radial velocity with inertial value. */ + w = (betsr != 0.0) ? d + del / betsr : 1.0; + eraSxp(w, usr, ur); + +/* Replace observed tangential velocity with inertial value. */ + eraSxp(d, ust, ut); + +/* Combine the two to obtain the inertial space velocity. */ + eraPpp(ur, ut, pv[1]); + +/* Return the status. */ + return iwarn; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/sxp.c b/testbed/astropy__astropy/cextern/erfa/sxp.c new file mode 100644 index 0000000000000000000000000000000000000000..4bcfe59a776574b8ef101daf72026ff960c45915 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/sxp.c @@ -0,0 +1,93 @@ +#include "erfa.h" + +void eraSxp(double s, double p[3], double sp[3]) +/* +** - - - - - - - +** e r a S x p +** - - - - - - - +** +** Multiply a p-vector by a scalar. +** +** Given: +** s double scalar +** p double[3] p-vector +** +** Returned: +** sp double[3] s * p +** +** Note: +** It is permissible for p and sp to be the same array. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + sp[0] = s * p[0]; + sp[1] = s * p[1]; + sp[2] = s * p[2]; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/sxpv.c b/testbed/astropy__astropy/cextern/erfa/sxpv.c new file mode 100644 index 0000000000000000000000000000000000000000..bb99969aeb7ab551bb4b141f4ed15200bc86f3a0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/sxpv.c @@ -0,0 +1,94 @@ +#include "erfa.h" + +void eraSxpv(double s, double pv[2][3], double spv[2][3]) +/* +** - - - - - - - - +** e r a S x p v +** - - - - - - - - +** +** Multiply a pv-vector by a scalar. +** +** Given: +** s double scalar +** pv double[2][3] pv-vector +** +** Returned: +** spv double[2][3] s * pv +** +** Note: +** It is permissible for pv and spv to be the same array +** +** Called: +** eraS2xpv multiply pv-vector by two scalars +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraS2xpv(s, s, pv, spv); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/taitt.c b/testbed/astropy__astropy/cextern/erfa/taitt.c new file mode 100644 index 0000000000000000000000000000000000000000..3dee64cb5f7bb78755afb247d78ce51814d8ae34 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/taitt.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +int eraTaitt(double tai1, double tai2, double *tt1, double *tt2) +/* +** - - - - - - - - - +** e r a T a i t t +** - - - - - - - - - +** +** Time scale transformation: International Atomic Time, TAI, to +** Terrestrial Time, TT. +** +** Given: +** tai1,tai2 double TAI as a 2-part Julian Date +** +** Returned: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Note: +** +** tai1+tai2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tai1 is the Julian +** Day Number and tai2 is the fraction of a day. The returned +** tt1,tt2 follow suit. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* TT minus TAI (days). */ + static const double dtat = ERFA_TTMTAI/ERFA_DAYSEC; + + +/* Result, safeguarding precision. */ + if ( tai1 > tai2 ) { + *tt1 = tai1; + *tt2 = tai2 + dtat; + } else { + *tt1 = tai1 + dtat; + *tt2 = tai2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/taiut1.c b/testbed/astropy__astropy/cextern/erfa/taiut1.c new file mode 100644 index 0000000000000000000000000000000000000000..fa0a38155c8de2b9eed13f55ccf71ef055ddfdd0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/taiut1.c @@ -0,0 +1,120 @@ +#include "erfa.h" + +int eraTaiut1(double tai1, double tai2, double dta, + double *ut11, double *ut12) +/* +** - - - - - - - - - - +** e r a T a i u t 1 +** - - - - - - - - - - +** +** Time scale transformation: International Atomic Time, TAI, to +** Universal Time, UT1. +** +** Given: +** tai1,tai2 double TAI as a 2-part Julian Date +** dta double UT1-TAI in seconds +** +** Returned: +** ut11,ut12 double UT1 as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tai1+tai2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tai1 is the Julian +** Day Number and tai2 is the fraction of a day. The returned +** UT11,UT12 follow suit. +** +** 2) The argument dta, i.e. UT1-TAI, is an observed quantity, and is +** available from IERS tabulations. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtad; + + +/* Result, safeguarding precision. */ + dtad = dta / ERFA_DAYSEC; + if ( tai1 > tai2 ) { + *ut11 = tai1; + *ut12 = tai2 + dtad; + } else { + *ut11 = tai1 + dtad; + *ut12 = tai2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/taiutc.c b/testbed/astropy__astropy/cextern/erfa/taiutc.c new file mode 100644 index 0000000000000000000000000000000000000000..9429c4c2cfb9fc1b4444a2dacf8bae3cfacfef55 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/taiutc.c @@ -0,0 +1,168 @@ +#include "erfa.h" + +int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2) +/* +** - - - - - - - - - - +** e r a T a i u t c +** - - - - - - - - - - +** +** Time scale transformation: International Atomic Time, TAI, to +** Coordinated Universal Time, UTC. +** +** Given: +** tai1,tai2 double TAI as a 2-part Julian Date (Note 1) +** +** Returned: +** utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-3) +** +** Returned (function value): +** int status: +1 = dubious year (Note 4) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) tai1+tai2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tai1 is the Julian +** Day Number and tai2 is the fraction of a day. The returned utc1 +** and utc2 form an analogous pair, except that a special convention +** is used, to deal with the problem of leap seconds - see the next +** note. +** +** 2) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The convention in the present +** function is that the JD day represents UTC days whether the +** length is 86399, 86400 or 86401 SI seconds. In the 1960-1972 era +** there were smaller jumps (in either direction) each time the +** linear UTC(TAI) expression was changed, and these "mini-leaps" +** are also included in the ERFA convention. +** +** 3) The function eraD2dtf can be used to transform the UTC quasi-JD +** into calendar date and clock time, including UTC leap second +** handling. +** +** 4) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** Called: +** eraUtctai UTC to TAI +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int big1; + int i, j; + double a1, a2, u1, u2, g1, g2; + + +/* Put the two parts of the TAI into big-first order. */ + big1 = ( tai1 >= tai2 ); + if ( big1 ) { + a1 = tai1; + a2 = tai2; + } else { + a1 = tai2; + a2 = tai1; + } + +/* Initial guess for UTC. */ + u1 = a1; + u2 = a2; + +/* Iterate (though in most cases just once is enough). */ + for ( i = 0; i < 3; i++ ) { + + /* Guessed UTC to TAI. */ + j = eraUtctai(u1, u2, &g1, &g2); + if ( j < 0 ) return j; + + /* Adjust guessed UTC. */ + u2 += a1 - g1; + u2 += a2 - g2; + } + +/* Return the UTC result, preserving the TAI order. */ + if ( big1 ) { + *utc1 = u1; + *utc2 = u2; + } else { + *utc1 = u2; + *utc2 = u1; + } + +/* Status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tcbtdb.c b/testbed/astropy__astropy/cextern/erfa/tcbtdb.c new file mode 100644 index 0000000000000000000000000000000000000000..63f312dc3385ee1af8d1f98af63bdf01b8a30a73 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tcbtdb.c @@ -0,0 +1,141 @@ +#include "erfa.h" + +int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2) +/* +** - - - - - - - - - - +** e r a T c b t d b +** - - - - - - - - - - +** +** Time scale transformation: Barycentric Coordinate Time, TCB, to +** Barycentric Dynamical Time, TDB. +** +** Given: +** tcb1,tcb2 double TCB as a 2-part Julian Date +** +** Returned: +** tdb1,tdb2 double TDB as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tcb1+tcb2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tcb1 is the Julian +** Day Number and tcb2 is the fraction of a day. The returned +** tdb1,tdb2 follow suit. +** +** 2) The 2006 IAU General Assembly introduced a conventional linear +** transformation between TDB and TCB. This transformation +** compensates for the drift between TCB and terrestrial time TT, +** and keeps TDB approximately centered on TT. Because the +** relationship between TT and TCB depends on the adopted solar +** system ephemeris, the degree of alignment between TDB and TT over +** long intervals will vary according to which ephemeris is used. +** Former definitions of TDB attempted to avoid this problem by +** stipulating that TDB and TT should differ only by periodic +** effects. This is a good description of the nature of the +** relationship but eluded precise mathematical formulation. The +** conventional linear relationship adopted in 2006 sidestepped +** these difficulties whilst delivering a TDB that in practice was +** consistent with values before that date. +** +** 3) TDB is essentially the same as Teph, the time argument for the +** JPL solar system ephemerides. +** +** Reference: +** +** IAU 2006 Resolution B3 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* 1977 Jan 1 00:00:32.184 TT, as two-part JD */ + static const double t77td = ERFA_DJM0 + ERFA_DJM77; + static const double t77tf = ERFA_TTMTAI/ERFA_DAYSEC; + +/* TDB (days) at TAI 1977 Jan 1.0 */ + static const double tdb0 = ERFA_TDB0/ERFA_DAYSEC; + + double d; + + +/* Result, safeguarding precision. */ + if ( tcb1 > tcb2 ) { + d = tcb1 - t77td; + *tdb1 = tcb1; + *tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ERFA_ELB; + } else { + d = tcb2 - t77td; + *tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ERFA_ELB; + *tdb2 = tcb2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tcgtt.c b/testbed/astropy__astropy/cextern/erfa/tcgtt.c new file mode 100644 index 0000000000000000000000000000000000000000..92ee47f7c529b0acfccf42d720594a620aafb6f9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tcgtt.c @@ -0,0 +1,118 @@ +#include "erfa.h" + +int eraTcgtt(double tcg1, double tcg2, double *tt1, double *tt2) +/* +** - - - - - - - - - +** e r a T c g t t +** - - - - - - - - - +** +** Time scale transformation: Geocentric Coordinate Time, TCG, to +** Terrestrial Time, TT. +** +** Given: +** tcg1,tcg2 double TCG as a 2-part Julian Date +** +** Returned: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Note: +** +** tcg1+tcg2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tcg1 is the Julian +** Day Number and tcg22 is the fraction of a day. The returned +** tt1,tt2 follow suit. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),. +** IERS Technical Note No. 32, BKG (2004) +** +** IAU 2000 Resolution B1.9 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* 1977 Jan 1 00:00:32.184 TT, as MJD */ + static const double t77t = ERFA_DJM77 + ERFA_TTMTAI/ERFA_DAYSEC; + + +/* Result, safeguarding precision. */ + if ( tcg1 > tcg2 ) { + *tt1 = tcg1; + *tt2 = tcg2 - ( ( tcg1 - ERFA_DJM0 ) + ( tcg2 - t77t ) ) * ERFA_ELG; + } else { + *tt1 = tcg1 - ( ( tcg2 - ERFA_DJM0 ) + ( tcg1 - t77t ) ) * ERFA_ELG; + *tt2 = tcg2; + } + +/* OK status. */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tdbtcb.c b/testbed/astropy__astropy/cextern/erfa/tdbtcb.c new file mode 100644 index 0000000000000000000000000000000000000000..3e9edf5e6168f6c804ad47568f9d4a3f2d8e3d99 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tdbtcb.c @@ -0,0 +1,146 @@ +#include "erfa.h" + +int eraTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2) +/* +** - - - - - - - - - - +** e r a T d b t c b +** - - - - - - - - - - +** +** Time scale transformation: Barycentric Dynamical Time, TDB, to +** Barycentric Coordinate Time, TCB. +** +** Given: +** tdb1,tdb2 double TDB as a 2-part Julian Date +** +** Returned: +** tcb1,tcb2 double TCB as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tdb1+tdb2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tdb1 is the Julian +** Day Number and tdb2 is the fraction of a day. The returned +** tcb1,tcb2 follow suit. +** +** 2) The 2006 IAU General Assembly introduced a conventional linear +** transformation between TDB and TCB. This transformation +** compensates for the drift between TCB and terrestrial time TT, +** and keeps TDB approximately centered on TT. Because the +** relationship between TT and TCB depends on the adopted solar +** system ephemeris, the degree of alignment between TDB and TT over +** long intervals will vary according to which ephemeris is used. +** Former definitions of TDB attempted to avoid this problem by +** stipulating that TDB and TT should differ only by periodic +** effects. This is a good description of the nature of the +** relationship but eluded precise mathematical formulation. The +** conventional linear relationship adopted in 2006 sidestepped +** these difficulties whilst delivering a TDB that in practice was +** consistent with values before that date. +** +** 3) TDB is essentially the same as Teph, the time argument for the +** JPL solar system ephemerides. +** +** Reference: +** +** IAU 2006 Resolution B3 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* 1977 Jan 1 00:00:32.184 TT, as two-part JD */ + static const double t77td = ERFA_DJM0 + ERFA_DJM77; + static const double t77tf = ERFA_TTMTAI/ERFA_DAYSEC; + +/* TDB (days) at TAI 1977 Jan 1.0 */ + static const double tdb0 = ERFA_TDB0/ERFA_DAYSEC; + +/* TDB to TCB rate */ + static const double elbb = ERFA_ELB/(1.0-ERFA_ELB); + + double d, f; + + +/* Result, preserving date format but safeguarding precision. */ + if ( tdb1 > tdb2 ) { + d = t77td - tdb1; + f = tdb2 - tdb0; + *tcb1 = tdb1; + *tcb2 = f - ( d - ( f - t77tf ) ) * elbb; + } else { + d = t77td - tdb2; + f = tdb1 - tdb0; + *tcb1 = f + ( d - ( f - t77tf ) ) * elbb; + *tcb2 = tdb2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tdbtt.c b/testbed/astropy__astropy/cextern/erfa/tdbtt.c new file mode 100644 index 0000000000000000000000000000000000000000..6abf2cd15539a8213fb1f20c237b73bc0f47ae5e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tdbtt.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +int eraTdbtt(double tdb1, double tdb2, double dtr, + double *tt1, double *tt2 ) +/* +** - - - - - - - - - +** e r a T d b t t +** - - - - - - - - - +** +** Time scale transformation: Barycentric Dynamical Time, TDB, to +** Terrestrial Time, TT. +** +** Given: +** tdb1,tdb2 double TDB as a 2-part Julian Date +** dtr double TDB-TT in seconds +** +** Returned: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tdb1+tdb2 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where tdb1 is the Julian +** Day Number and tdb2 is the fraction of a day. The returned +** tt1,tt2 follow suit. +** +** 2) The argument dtr represents the quasi-periodic component of the +** GR transformation between TT and TCB. It is dependent upon the +** adopted solar-system ephemeris, and can be obtained by numerical +** integration, by interrogating a precomputed time ephemeris or by +** evaluating a model such as that implemented in the ERFA function +** eraDtdb. The quantity is dominated by an annual term of 1.7 ms +** amplitude. +** +** 3) TDB is essentially the same as Teph, the time argument for the +** JPL solar system ephemerides. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** IAU 2006 Resolution 3 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtrd; + + +/* Result, safeguarding precision. */ + dtrd = dtr / ERFA_DAYSEC; + if ( tdb1 > tdb2 ) { + *tt1 = tdb1; + *tt2 = tdb2 - dtrd; + } else { + *tt1 = tdb1 - dtrd; + *tt2 = tdb2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tf2a.c b/testbed/astropy__astropy/cextern/erfa/tf2a.c new file mode 100644 index 0000000000000000000000000000000000000000..92bfc5d338a9cb9d1dc010ac3625deb963a6880f --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tf2a.c @@ -0,0 +1,116 @@ +#include "erfa.h" +#include + +int eraTf2a(char s, int ihour, int imin, double sec, double *rad) +/* +** - - - - - - - - +** e r a T f 2 a +** - - - - - - - - +** +** Convert hours, minutes, seconds to radians. +** +** Given: +** s char sign: '-' = negative, otherwise positive +** ihour int hours +** imin int minutes +** sec double seconds +** +** Returned: +** rad double angle in radians +** +** Returned (function value): +** int status: 0 = OK +** 1 = ihour outside range 0-23 +** 2 = imin outside range 0-59 +** 3 = sec outside range 0-59.999... +** +** Notes: +** +** 1) The result is computed even if any of the range checks fail. +** +** 2) Negative ihour, imin and/or sec produce a warning status, but +** the absolute value is used in the conversion. +** +** 3) If there are multiple errors, the status value reflects only the +** first, the smallest taking precedence. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Compute the interval. */ + *rad = ( s == '-' ? -1.0 : 1.0 ) * + ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) + + ( (double) abs(imin) ) ) + + fabs(sec) ) * ERFA_DS2R; + +/* Validate arguments and return status. */ + if ( ihour < 0 || ihour > 23 ) return 1; + if ( imin < 0 || imin > 59 ) return 2; + if ( sec < 0.0 || sec >= 60.0 ) return 3; + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tf2d.c b/testbed/astropy__astropy/cextern/erfa/tf2d.c new file mode 100644 index 0000000000000000000000000000000000000000..c8bb0559bb108ddcd1d0aeb8e1d9b22a03ca0b90 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tf2d.c @@ -0,0 +1,116 @@ +#include "erfa.h" +#include + +int eraTf2d(char s, int ihour, int imin, double sec, double *days) +/* +** - - - - - - - - +** e r a T f 2 d +** - - - - - - - - +** +** Convert hours, minutes, seconds to days. +** +** Given: +** s char sign: '-' = negative, otherwise positive +** ihour int hours +** imin int minutes +** sec double seconds +** +** Returned: +** days double interval in days +** +** Returned (function value): +** int status: 0 = OK +** 1 = ihour outside range 0-23 +** 2 = imin outside range 0-59 +** 3 = sec outside range 0-59.999... +** +** Notes: +** +** 1) The result is computed even if any of the range checks fail. +** +** 2) Negative ihour, imin and/or sec produce a warning status, but +** the absolute value is used in the conversion. +** +** 3) If there are multiple errors, the status value reflects only the +** first, the smallest taking precedence. +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Compute the interval. */ + *days = ( s == '-' ? -1.0 : 1.0 ) * + ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) + + ( (double) abs(imin) ) ) + + fabs(sec) ) / ERFA_DAYSEC; + +/* Validate arguments and return status. */ + if ( ihour < 0 || ihour > 23 ) return 1; + if ( imin < 0 || imin > 59 ) return 2; + if ( sec < 0.0 || sec >= 60.0 ) return 3; + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tr.c b/testbed/astropy__astropy/cextern/erfa/tr.c new file mode 100644 index 0000000000000000000000000000000000000000..7def6030eb698462e45e1f133dceeef04ef4ddd4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tr.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +void eraTr(double r[3][3], double rt[3][3]) +/* +** - - - - - - +** e r a T r +** - - - - - - +** +** Transpose an r-matrix. +** +** Given: +** r double[3][3] r-matrix +** +** Returned: +** rt double[3][3] transpose +** +** Note: +** It is permissible for r and rt to be the same array. +** +** Called: +** eraCr copy r-matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double wm[3][3]; + int i, j; + + + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + wm[i][j] = r[j][i]; + } + } + eraCr(wm, rt); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/trxp.c b/testbed/astropy__astropy/cextern/erfa/trxp.c new file mode 100644 index 0000000000000000000000000000000000000000..1aa723cc7255f50139ea87ad0549af38c17d94de --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/trxp.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +void eraTrxp(double r[3][3], double p[3], double trp[3]) +/* +** - - - - - - - - +** e r a T r x p +** - - - - - - - - +** +** Multiply a p-vector by the transpose of an r-matrix. +** +** Given: +** r double[3][3] r-matrix +** p double[3] p-vector +** +** Returned: +** trp double[3] r * p +** +** Note: +** It is permissible for p and trp to be the same array. +** +** Called: +** eraTr transpose r-matrix +** eraRxp product of r-matrix and p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double tr[3][3]; + + +/* Transpose of matrix r. */ + eraTr(r, tr); + +/* Matrix tr * vector p -> vector trp. */ + eraRxp(tr, p, trp); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/trxpv.c b/testbed/astropy__astropy/cextern/erfa/trxpv.c new file mode 100644 index 0000000000000000000000000000000000000000..9b4f5ea1cbec2846b63ddcbf4c2e80b642817724 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/trxpv.c @@ -0,0 +1,102 @@ +#include "erfa.h" + +void eraTrxpv(double r[3][3], double pv[2][3], double trpv[2][3]) +/* +** - - - - - - - - - +** e r a T r x p v +** - - - - - - - - - +** +** Multiply a pv-vector by the transpose of an r-matrix. +** +** Given: +** r double[3][3] r-matrix +** pv double[2][3] pv-vector +** +** Returned: +** trpv double[2][3] r * pv +** +** Note: +** It is permissible for pv and trpv to be the same array. +** +** Called: +** eraTr transpose r-matrix +** eraRxpv product of r-matrix and pv-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double tr[3][3]; + + +/* Transpose of matrix r. */ + eraTr(r, tr); + +/* Matrix tr * vector pv -> vector trpv. */ + eraRxpv(tr, pv, trpv); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tttai.c b/testbed/astropy__astropy/cextern/erfa/tttai.c new file mode 100644 index 0000000000000000000000000000000000000000..fa1471797c7b5f5a73dafc4266ac73947102b31b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tttai.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +int eraTttai(double tt1, double tt2, double *tai1, double *tai2) +/* +** - - - - - - - - - +** e r a T t t a i +** - - - - - - - - - +** +** Time scale transformation: Terrestrial Time, TT, to International +** Atomic Time, TAI. +** +** Given: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned: +** tai1,tai2 double TAI as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Note: +** +** tt1+tt2 is Julian Date, apportioned in any convenient way between +** the two arguments, for example where tt1 is the Julian Day Number +** and tt2 is the fraction of a day. The returned tai1,tai2 follow +** suit. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* TT minus TAI (days). */ + static const double dtat = ERFA_TTMTAI/ERFA_DAYSEC; + + +/* Result, safeguarding precision. */ + if ( tt1 > tt2 ) { + *tai1 = tt1; + *tai2 = tt2 - dtat; + } else { + *tai1 = tt1 - dtat; + *tai2 = tt2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tttcg.c b/testbed/astropy__astropy/cextern/erfa/tttcg.c new file mode 100644 index 0000000000000000000000000000000000000000..aa69d3edf29818c775b33d9f9b75e093a237893b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tttcg.c @@ -0,0 +1,121 @@ +#include "erfa.h" + +int eraTttcg(double tt1, double tt2, double *tcg1, double *tcg2) +/* +** - - - - - - - - - +** e r a T t t c g +** - - - - - - - - - +** +** Time scale transformation: Terrestrial Time, TT, to Geocentric +** Coordinate Time, TCG. +** +** Given: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned: +** tcg1,tcg2 double TCG as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Note: +** +** tt1+tt2 is Julian Date, apportioned in any convenient way between +** the two arguments, for example where tt1 is the Julian Day Number +** and tt2 is the fraction of a day. The returned tcg1,tcg2 follow +** suit. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** IAU 2000 Resolution B1.9 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* 1977 Jan 1 00:00:32.184 TT, as MJD */ + static const double t77t = ERFA_DJM77 + ERFA_TTMTAI/ERFA_DAYSEC; + +/* TT to TCG rate */ + static const double elgg = ERFA_ELG/(1.0-ERFA_ELG); + + +/* Result, safeguarding precision. */ + if ( tt1 > tt2 ) { + *tcg1 = tt1; + *tcg2 = tt2 + ( ( tt1 - ERFA_DJM0 ) + ( tt2 - t77t ) ) * elgg; + } else { + *tcg1 = tt1 + ( ( tt2 - ERFA_DJM0 ) + ( tt1 - t77t ) ) * elgg; + *tcg2 = tt2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/tttdb.c b/testbed/astropy__astropy/cextern/erfa/tttdb.c new file mode 100644 index 0000000000000000000000000000000000000000..a260c0dd45ff79b805469d127d800a7a9bfb3e44 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/tttdb.c @@ -0,0 +1,130 @@ +#include "erfa.h" + +int eraTttdb(double tt1, double tt2, double dtr, + double *tdb1, double *tdb2) +/* +** - - - - - - - - - +** e r a T t t d b +** - - - - - - - - - +** +** Time scale transformation: Terrestrial Time, TT, to Barycentric +** Dynamical Time, TDB. +** +** Given: +** tt1,tt2 double TT as a 2-part Julian Date +** dtr double TDB-TT in seconds +** +** Returned: +** tdb1,tdb2 double TDB as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tt1+tt2 is Julian Date, apportioned in any convenient way between +** the two arguments, for example where tt1 is the Julian Day Number +** and tt2 is the fraction of a day. The returned tdb1,tdb2 follow +** suit. +** +** 2) The argument dtr represents the quasi-periodic component of the +** GR transformation between TT and TCB. It is dependent upon the +** adopted solar-system ephemeris, and can be obtained by numerical +** integration, by interrogating a precomputed time ephemeris or by +** evaluating a model such as that implemented in the ERFA function +** eraDtdb. The quantity is dominated by an annual term of 1.7 ms +** amplitude. +** +** 3) TDB is essentially the same as Teph, the time argument for the JPL +** solar system ephemerides. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** IAU 2006 Resolution 3 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtrd; + + +/* Result, safeguarding precision. */ + dtrd = dtr / ERFA_DAYSEC; + if ( tt1 > tt2 ) { + *tdb1 = tt1; + *tdb2 = tt2 + dtrd; + } else { + *tdb1 = tt1 + dtrd; + *tdb2 = tt2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ttut1.c b/testbed/astropy__astropy/cextern/erfa/ttut1.c new file mode 100644 index 0000000000000000000000000000000000000000..8b02053e95dce0dee305ae0fcd3169bf96f0f7a8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ttut1.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +int eraTtut1(double tt1, double tt2, double dt, + double *ut11, double *ut12) +/* +** - - - - - - - - - +** e r a T t u t 1 +** - - - - - - - - - +** +** Time scale transformation: Terrestrial Time, TT, to Universal Time, +** UT1. +** +** Given: +** tt1,tt2 double TT as a 2-part Julian Date +** dt double TT-UT1 in seconds +** +** Returned: +** ut11,ut12 double UT1 as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) tt1+tt2 is Julian Date, apportioned in any convenient way between +** the two arguments, for example where tt1 is the Julian Day Number +** and tt2 is the fraction of a day. The returned ut11,ut12 follow +** suit. +** +** 2) The argument dt is classical Delta T. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtd; + + +/* Result, safeguarding precision. */ + dtd = dt / ERFA_DAYSEC; + if ( tt1 > tt2 ) { + *ut11 = tt1; + *ut12 = tt2 - dtd; + } else { + *ut11 = tt1 - dtd; + *ut12 = tt2; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ut1tai.c b/testbed/astropy__astropy/cextern/erfa/ut1tai.c new file mode 100644 index 0000000000000000000000000000000000000000..f230d270e4acf90e3ac4d41909a39fd2a15609b8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ut1tai.c @@ -0,0 +1,120 @@ +#include "erfa.h" + +int eraUt1tai(double ut11, double ut12, double dta, + double *tai1, double *tai2) +/* +** - - - - - - - - - - +** e r a U t 1 t a i +** - - - - - - - - - - +** +** Time scale transformation: Universal Time, UT1, to International +** Atomic Time, TAI. +** +** Given: +** ut11,ut12 double UT1 as a 2-part Julian Date +** dta double UT1-TAI in seconds +** +** Returned: +** tai1,tai2 double TAI as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) ut11+ut12 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where ut11 is the Julian +** Day Number and ut12 is the fraction of a day. The returned +** tai1,tai2 follow suit. +** +** 2) The argument dta, i.e. UT1-TAI, is an observed quantity, and is +** available from IERS tabulations. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtad; + + +/* Result, safeguarding precision. */ + dtad = dta / ERFA_DAYSEC; + if ( ut11 > ut12 ) { + *tai1 = ut11; + *tai2 = ut12 - dtad; + } else { + *tai1 = ut11 - dtad; + *tai2 = ut12; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ut1tt.c b/testbed/astropy__astropy/cextern/erfa/ut1tt.c new file mode 100644 index 0000000000000000000000000000000000000000..52eb616b14304eb7dd4d20bf605cdac104485ba2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ut1tt.c @@ -0,0 +1,119 @@ +#include "erfa.h" + +int eraUt1tt(double ut11, double ut12, double dt, + double *tt1, double *tt2) +/* +** - - - - - - - - - +** e r a U t 1 t t +** - - - - - - - - - +** +** Time scale transformation: Universal Time, UT1, to Terrestrial +** Time, TT. +** +** Given: +** ut11,ut12 double UT1 as a 2-part Julian Date +** dt double TT-UT1 in seconds +** +** Returned: +** tt1,tt2 double TT as a 2-part Julian Date +** +** Returned (function value): +** int status: 0 = OK +** +** Notes: +** +** 1) ut11+ut12 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where ut11 is the Julian +** Day Number and ut12 is the fraction of a day. The returned +** tt1,tt2 follow suit. +** +** 2) The argument dt is classical Delta T. +** +** Reference: +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double dtd; + + +/* Result, safeguarding precision. */ + dtd = dt / ERFA_DAYSEC; + if ( ut11 > ut12 ) { + *tt1 = ut11; + *tt2 = ut12 + dtd; + } else { + *tt1 = ut11 + dtd; + *tt2 = ut12; + } + +/* Status (always OK). */ + return 0; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/ut1utc.c b/testbed/astropy__astropy/cextern/erfa/ut1utc.c new file mode 100644 index 0000000000000000000000000000000000000000..bda5299f093efd57013cd2d39022619033a5f811 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/ut1utc.c @@ -0,0 +1,202 @@ +#include "erfa.h" + +int eraUt1utc(double ut11, double ut12, double dut1, + double *utc1, double *utc2) +/* +** - - - - - - - - - - +** e r a U t 1 u t c +** - - - - - - - - - - +** +** Time scale transformation: Universal Time, UT1, to Coordinated +** Universal Time, UTC. +** +** Given: +** ut11,ut12 double UT1 as a 2-part Julian Date (Note 1) +** dut1 double Delta UT1: UT1-UTC in seconds (Note 2) +** +** Returned: +** utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 3,4) +** +** Returned (function value): +** int status: +1 = dubious year (Note 5) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) ut11+ut12 is Julian Date, apportioned in any convenient way +** between the two arguments, for example where ut11 is the Julian +** Day Number and ut12 is the fraction of a day. The returned utc1 +** and utc2 form an analogous pair, except that a special convention +** is used, to deal with the problem of leap seconds - see Note 3. +** +** 2) Delta UT1 can be obtained from tabulations provided by the +** International Earth Rotation and Reference Systems Service. The +** value changes abruptly by 1s at a leap second; however, close to +** a leap second the algorithm used here is tolerant of the "wrong" +** choice of value being made. +** +** 3) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The convention in the present +** function is that the returned quasi JD day UTC1+UTC2 represents +** UTC days whether the length is 86399, 86400 or 86401 SI seconds. +** +** 4) The function eraD2dtf can be used to transform the UTC quasi-JD +** into calendar date and clock time, including UTC leap second +** handling. +** +** 5) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** Called: +** eraJd2cal JD to Gregorian calendar +** eraDat delta(AT) = TAI-UTC +** eraCal2jd Gregorian calendar to JD +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int big1; + int i, iy, im, id, js; + double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du; + + +/* UT1-UTC in seconds. */ + duts = dut1; + +/* Put the two parts of the UT1 into big-first order. */ + big1 = ( ut11 >= ut12 ); + if ( big1 ) { + u1 = ut11; + u2 = ut12; + } else { + u1 = ut12; + u2 = ut11; + } + +/* See if the UT1 can possibly be in a leap-second day. */ + d1 = u1; + dats1 = 0; + for ( i = -1; i <= 3; i++ ) { + d2 = u2 + (double) i; + if ( eraJd2cal(d1, d2, &iy, &im, &id, &fd) ) return -1; + js = eraDat(iy, im, id, 0.0, &dats2); + if ( js < 0 ) return -1; + if ( i == - 1 ) dats1 = dats2; + ddats = dats2 - dats1; + if ( fabs(ddats) >= 0.5 ) { + + /* Yes, leap second nearby: ensure UT1-UTC is "before" value. */ + if ( ddats * duts >= 0 ) duts -= ddats; + + /* UT1 for the start of the UTC day that ends in a leap. */ + if ( eraCal2jd(iy, im, id, &d1, &d2) ) return -1; + us1 = d1; + us2 = d2 - 1.0 + duts/ERFA_DAYSEC; + + /* Is the UT1 after this point? */ + du = u1 - us1; + du += u2 - us2; + if ( du > 0 ) { + + /* Yes: fraction of the current UTC day that has elapsed. */ + fd = du * ERFA_DAYSEC / ( ERFA_DAYSEC + ddats ); + + /* Ramp UT1-UTC to bring about ERFA's JD(UTC) convention. */ + duts += ddats * ( fd <= 1.0 ? fd : 1.0 ); + } + + /* Done. */ + break; + } + dats1 = dats2; + } + +/* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */ + u2 -= duts / ERFA_DAYSEC; + +/* Result, safeguarding precision. */ + if ( big1 ) { + *utc1 = u1; + *utc2 = u2; + } else { + *utc1 = u2; + *utc2 = u1; + } + +/* Status. */ + return js; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/utctai.c b/testbed/astropy__astropy/cextern/erfa/utctai.c new file mode 100644 index 0000000000000000000000000000000000000000..b51f6308656b49b14fc8850db311baf9aa0dd0c7 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/utctai.c @@ -0,0 +1,186 @@ +#include "erfa.h" + +int eraUtctai(double utc1, double utc2, double *tai1, double *tai2) +/* +** - - - - - - - - - - +** e r a U t c t a i +** - - - - - - - - - - +** +** Time scale transformation: Coordinated Universal Time, UTC, to +** International Atomic Time, TAI. +** +** Given: +** utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-4) +** +** Returned: +** tai1,tai2 double TAI as a 2-part Julian Date (Note 5) +** +** Returned (function value): +** int status: +1 = dubious year (Note 3) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** 2) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The convention in the present +** function is that the JD day represents UTC days whether the +** length is 86399, 86400 or 86401 SI seconds. In the 1960-1972 era +** there were smaller jumps (in either direction) each time the +** linear UTC(TAI) expression was changed, and these "mini-leaps" +** are also included in the ERFA convention. +** +** 3) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** 4) The function eraDtf2d converts from calendar date and time of day +** into 2-part Julian Date, and in the case of UTC implements the +** leap-second-ambiguity convention described above. +** +** 5) The returned TAI1,TAI2 are such that their sum is the TAI Julian +** Date. +** +** Called: +** eraJd2cal JD to Gregorian calendar +** eraDat delta(AT) = TAI-UTC +** eraCal2jd Gregorian calendar to JD +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int big1; + int iy, im, id, j, iyt, imt, idt; + double u1, u2, fd, dat0, dat12, w, dat24, dlod, dleap, z1, z2, a2; + + +/* Put the two parts of the UTC into big-first order. */ + big1 = ( utc1 >= utc2 ); + if ( big1 ) { + u1 = utc1; + u2 = utc2; + } else { + u1 = utc2; + u2 = utc1; + } + +/* Get TAI-UTC at 0h today. */ + j = eraJd2cal(u1, u2, &iy, &im, &id, &fd); + if ( j ) return j; + j = eraDat(iy, im, id, 0.0, &dat0); + if ( j < 0 ) return j; + +/* Get TAI-UTC at 12h today (to detect drift). */ + j = eraDat(iy, im, id, 0.5, &dat12); + if ( j < 0 ) return j; + +/* Get TAI-UTC at 0h tomorrow (to detect jumps). */ + j = eraJd2cal(u1+1.5, u2-fd, &iyt, &imt, &idt, &w); + if ( j ) return j; + j = eraDat(iyt, imt, idt, 0.0, &dat24); + if ( j < 0 ) return j; + +/* Separate TAI-UTC change into per-day (DLOD) and any jump (DLEAP). */ + dlod = 2.0 * (dat12 - dat0); + dleap = dat24 - (dat0 + dlod); + +/* Remove any scaling applied to spread leap into preceding day. */ + fd *= (ERFA_DAYSEC+dleap)/ERFA_DAYSEC; + +/* Scale from (pre-1972) UTC seconds to SI seconds. */ + fd *= (ERFA_DAYSEC+dlod)/ERFA_DAYSEC; + +/* Today's calendar date to 2-part JD. */ + if ( eraCal2jd(iy, im, id, &z1, &z2) ) return -1; + +/* Assemble the TAI result, preserving the UTC split and order. */ + a2 = z1 - u1; + a2 += z2; + a2 += fd + dat0/ERFA_DAYSEC; + if ( big1 ) { + *tai1 = u1; + *tai2 = a2; + } else { + *tai1 = a2; + *tai2 = u1; + } + +/* Status. */ + return j; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/utcut1.c b/testbed/astropy__astropy/cextern/erfa/utcut1.c new file mode 100644 index 0000000000000000000000000000000000000000..f83a408a09199a73ffb6d0cc312c34a40aa6a8ba --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/utcut1.c @@ -0,0 +1,156 @@ +#include "erfa.h" + +int eraUtcut1(double utc1, double utc2, double dut1, + double *ut11, double *ut12) +/* +** - - - - - - - - - - +** e r a U t c u t 1 +** - - - - - - - - - - +** +** Time scale transformation: Coordinated Universal Time, UTC, to +** Universal Time, UT1. +** +** Given: +** utc1,utc2 double UTC as a 2-part quasi Julian Date (Notes 1-4) +** dut1 double Delta UT1 = UT1-UTC in seconds (Note 5) +** +** Returned: +** ut11,ut12 double UT1 as a 2-part Julian Date (Note 6) +** +** Returned (function value): +** int status: +1 = dubious year (Note 3) +** 0 = OK +** -1 = unacceptable date +** +** Notes: +** +** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any +** convenient way between the two arguments, for example where utc1 +** is the Julian Day Number and utc2 is the fraction of a day. +** +** 2) JD cannot unambiguously represent UTC during a leap second unless +** special measures are taken. The convention in the present +** function is that the JD day represents UTC days whether the +** length is 86399, 86400 or 86401 SI seconds. +** +** 3) The warning status "dubious year" flags UTCs that predate the +** introduction of the time scale or that are too far in the future +** to be trusted. See eraDat for further details. +** +** 4) The function eraDtf2d converts from calendar date and time of +** day into 2-part Julian Date, and in the case of UTC implements +** the leap-second-ambiguity convention described above. +** +** 5) Delta UT1 can be obtained from tabulations provided by the +** International Earth Rotation and Reference Systems Service. +** It is the caller's responsibility to supply a dut1 argument +** containing the UT1-UTC value that matches the given UTC. +** +** 6) The returned ut11,ut12 are such that their sum is the UT1 Julian +** Date. +** +** References: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Explanatory Supplement to the Astronomical Almanac, +** P. Kenneth Seidelmann (ed), University Science Books (1992) +** +** Called: +** eraJd2cal JD to Gregorian calendar +** eraDat delta(AT) = TAI-UTC +** eraUtctai UTC to TAI +** eraTaiut1 TAI to UT1 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + int iy, im, id, js, jw; + double w, dat, dta, tai1, tai2; + + +/* Look up TAI-UTC. */ + if ( eraJd2cal(utc1, utc2, &iy, &im, &id, &w) ) return -1; + js = eraDat ( iy, im, id, 0.0, &dat); + if ( js < 0 ) return -1; + +/* Form UT1-TAI. */ + dta = dut1 - dat; + +/* UTC to TAI to UT1. */ + jw = eraUtctai(utc1, utc2, &tai1, &tai2); + if ( jw < 0 ) { + return -1; + } else if ( jw > 0 ) { + js = jw; + } + if ( eraTaiut1(tai1, tai2, dta, ut11, ut12) ) return -1; + +/* Status. */ + return js; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/xy06.c b/testbed/astropy__astropy/cextern/erfa/xy06.c new file mode 100644 index 0000000000000000000000000000000000000000..14220b2d1c9f8cd17d4ad7d4835f1e59ea04f8b4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/xy06.c @@ -0,0 +1,2767 @@ +#include "erfa.h" + +void eraXy06(double date1, double date2, double *x, double *y) +/* +** - - - - - - - - +** e r a X y 0 6 +** - - - - - - - - +** +** X,Y coordinates of celestial intermediate pole from series based +** on IAU 2006 precession and IAU 2000A nutation. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** x,y double CIP X,Y coordinates (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The X,Y coordinates are those of the unit vector towards the +** celestial intermediate pole. They represent the combined effects +** of frame bias, precession and nutation. +** +** 3) The fundamental arguments used are as adopted in IERS Conventions +** (2003) and are from Simon et al. (1994) and Souchay et al. +** (1999). +** +** 4) This is an alternative to the angles-based method, via the ERFA +** function eraFw2xy and as used in eraXys06a for example. The two +** methods agree at the 1 microarcsecond level (at present), a +** negligible amount compared with the intrinsic accuracy of the +** models. However, it would be unwise to mix the two methods +** (angles-based and series-based) in a single application. +** +** Called: +** eraFal03 mean anomaly of the Moon +** eraFalp03 mean anomaly of the Sun +** eraFaf03 mean argument of the latitude of the Moon +** eraFad03 mean elongation of the Moon from the Sun +** eraFaom03 mean longitude of the Moon's ascending node +** eraFame03 mean longitude of Mercury +** eraFave03 mean longitude of Venus +** eraFae03 mean longitude of Earth +** eraFama03 mean longitude of Mars +** eraFaju03 mean longitude of Jupiter +** eraFasa03 mean longitude of Saturn +** eraFaur03 mean longitude of Uranus +** eraFane03 mean longitude of Neptune +** eraFapa03 general accumulated precession in longitude +** +** References: +** +** Capitaine, N., Wallace, P.T. & Chapront, J., 2003, +** Astron.Astrophys., 412, 567 +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003), +** IERS Technical Note No. 32, BKG +** +** Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M., +** Francou, G. & Laskar, J., Astron.Astrophys., 1994, 282, 663 +** +** Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999, +** Astron.Astrophys.Supp.Ser. 135, 111 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + +/* Maximum power of T in the polynomials for X and Y */ + enum { MAXPT = 5 }; + +/* Polynomial coefficients (arcsec, X then Y). */ + static const double xyp[2][MAXPT+1] = { + + { -0.016617, + 2004.191898, + -0.4297829, + -0.19861834, + 0.000007578, + 0.0000059285 + }, + { -0.006951, + -0.025896, + -22.4072747, + 0.00190059, + 0.001112526, + 0.0000001358 + } + }; + +/* Fundamental-argument multipliers: luni-solar terms */ + static const int mfals[][5] = { + + /* 1-10 */ + { 0, 0, 0, 0, 1 }, + { 0, 0, 2, -2, 2 }, + { 0, 0, 2, 0, 2 }, + { 0, 0, 0, 0, 2 }, + { 0, 1, 0, 0, 0 }, + { 0, 1, 2, -2, 2 }, + { 1, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 1 }, + { 1, 0, 2, 0, 2 }, + { 0, 1, -2, 2, -2 }, + + /* 11-20 */ + { 0, 0, 2, -2, 1 }, + { 1, 0, -2, 0, -2 }, + { 1, 0, 0, -2, 0 }, + { 1, 0, 0, 0, 1 }, + { 1, 0, 0, 0, -1 }, + { 1, 0, -2, -2, -2 }, + { 1, 0, 2, 0, 1 }, + { 2, 0, -2, 0, -1 }, + { 0, 0, 0, 2, 0 }, + { 0, 0, 2, 2, 2 }, + + /* 21-30 */ + { 2, 0, 0, -2, 0 }, + { 0, 2, -2, 2, -2 }, + { 2, 0, 2, 0, 2 }, + { 1, 0, 2, -2, 2 }, + { 1, 0, -2, 0, -1 }, + { 2, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 0 }, + { 0, 1, 0, 0, 1 }, + { 1, 0, 0, -2, -1 }, + { 0, 2, 2, -2, 2 }, + + /* 31-40 */ + { 0, 0, 2, -2, 0 }, + { 1, 0, 0, -2, 1 }, + { 0, 1, 0, 0, -1 }, + { 0, 2, 0, 0, 0 }, + { 1, 0, -2, -2, -1 }, + { 1, 0, 2, 2, 2 }, + { 0, 1, 2, 0, 2 }, + { 2, 0, -2, 0, 0 }, + { 0, 0, 2, 2, 1 }, + { 0, 1, -2, 0, -2 }, + + /* 41-50 */ + { 0, 0, 0, 2, 1 }, + { 1, 0, 2, -2, 1 }, + { 2, 0, 0, -2, -1 }, + { 2, 0, 2, -2, 2 }, + { 2, 0, 2, 0, 1 }, + { 0, 0, 0, 2, -1 }, + { 0, 1, -2, 2, -1 }, + { 1, 1, 0, -2, 0 }, + { 2, 0, 0, -2, 1 }, + { 1, 0, 0, 2, 0 }, + + /* 51-60 */ + { 0, 1, 2, -2, 1 }, + { 1, -1, 0, 0, 0 }, + { 0, 1, -1, 1, -1 }, + { 2, 0, -2, 0, -2 }, + { 0, 1, 0, -2, 0 }, + { 1, 0, 0, -1, 0 }, + { 3, 0, 2, 0, 2 }, + { 0, 0, 0, 1, 0 }, + { 1, -1, 2, 0, 2 }, + { 1, 1, -2, -2, -2 }, + + /* 61-70 */ + { 1, 0, -2, 0, 0 }, + { 2, 0, 0, 0, -1 }, + { 0, 1, -2, -2, -2 }, + { 1, 1, 2, 0, 2 }, + { 2, 0, 0, 0, 1 }, + { 1, 1, 0, 0, 0 }, + { 1, 0, -2, 2, -1 }, + { 1, 0, 2, 0, 0 }, + { 1, -1, 0, -1, 0 }, + { 1, 0, 0, 0, 2 }, + + /* 71-80 */ + { 1, 0, -1, 0, -1 }, + { 0, 0, 2, 1, 2 }, + { 1, 0, -2, -4, -2 }, + { 1, -1, 0, -1, -1 }, + { 1, 0, 2, 2, 1 }, + { 0, 2, -2, 2, -1 }, + { 1, 0, 0, 0, -2 }, + { 2, 0, -2, -2, -2 }, + { 1, 1, 2, -2, 2 }, + { 2, 0, -2, -4, -2 }, + + /* 81-90 */ + { 1, 0, -4, 0, -2 }, + { 2, 0, 2, -2, 1 }, + { 1, 0, 0, -1, -1 }, + { 2, 0, 2, 2, 2 }, + { 3, 0, 0, 0, 0 }, + { 1, 0, 0, 2, 1 }, + { 0, 0, 2, -2, -1 }, + { 3, 0, 2, -2, 2 }, + { 0, 0, 4, -2, 2 }, + { 1, 0, 0, -4, 0 }, + + /* 91-100 */ + { 0, 1, 2, 0, 1 }, + { 2, 0, 0, -4, 0 }, + { 1, 1, 0, -2, -1 }, + { 2, 0, -2, 0, 1 }, + { 0, 0, 2, 0, -1 }, + { 0, 1, -2, 0, -1 }, + { 0, 1, 0, 0, 2 }, + { 0, 0, 2, -1, 2 }, + { 0, 0, 2, 4, 2 }, + { 2, 1, 0, -2, 0 }, + + /* 101-110 */ + { 1, 1, 0, -2, 1 }, + { 1, -1, 0, -2, 0 }, + { 1, -1, 0, -1, -2 }, + { 1, -1, 0, 0, 1 }, + { 0, 1, -2, 2, 0 }, + { 0, 1, 0, 0, -2 }, + { 1, -1, 2, 2, 2 }, + { 1, 0, 0, 2, -1 }, + { 1, -1, -2, -2, -2 }, + { 3, 0, 2, 0, 1 }, + + /* 111-120 */ + { 0, 1, 2, 2, 2 }, + { 1, 0, 2, -2, 0 }, + { 1, 1, -2, -2, -1 }, + { 1, 0, 2, -4, 1 }, + { 0, 1, -2, -2, -1 }, + { 2, -1, 2, 0, 2 }, + { 0, 0, 0, 2, 2 }, + { 1, -1, 2, 0, 1 }, + { 1, -1, -2, 0, -2 }, + { 0, 1, 0, 2, 0 }, + + /* 121-130 */ + { 0, 1, 2, -2, 0 }, + { 0, 0, 0, 1, 1 }, + { 1, 0, -2, -2, 0 }, + { 0, 3, 2, -2, 2 }, + { 2, 1, 2, 0, 2 }, + { 1, 1, 0, 0, 1 }, + { 2, 0, 0, 2, 0 }, + { 1, 1, 2, 0, 1 }, + { 1, 0, 0, -2, -2 }, + { 1, 0, -2, 2, 0 }, + + /* 131-140 */ + { 1, 0, -1, 0, -2 }, + { 0, 1, 0, -2, 1 }, + { 0, 1, 0, 1, 0 }, + { 0, 0, 0, 1, -1 }, + { 1, 0, -2, 2, -2 }, + { 1, -1, 0, 0, -1 }, + { 0, 0, 0, 4, 0 }, + { 1, -1, 0, 2, 0 }, + { 1, 0, 2, 1, 2 }, + { 1, 0, 2, -1, 2 }, + + /* 141-150 */ + { 0, 0, 2, 1, 1 }, + { 1, 0, 0, -2, 2 }, + { 1, 0, -2, 0, 1 }, + { 1, 0, -2, -4, -1 }, + { 0, 0, 2, 2, 0 }, + { 1, 1, 2, -2, 1 }, + { 1, 0, -2, 1, -1 }, + { 0, 0, 1, 0, 1 }, + { 2, 0, -2, -2, -1 }, + { 4, 0, 2, 0, 2 }, + + /* 151-160 */ + { 2, -1, 0, 0, 0 }, + { 2, 1, 2, -2, 2 }, + { 0, 1, 2, 1, 2 }, + { 1, 0, 4, -2, 2 }, + { 1, 1, 0, 0, -1 }, + { 2, 0, 2, 0, 0 }, + { 2, 0, -2, -4, -1 }, + { 1, 0, -1, 0, 0 }, + { 1, 0, 0, 1, 0 }, + { 0, 1, 0, 2, 1 }, + + /* 161-170 */ + { 1, 0, -4, 0, -1 }, + { 1, 0, 0, -4, -1 }, + { 2, 0, 2, 2, 1 }, + { 2, 1, 0, 0, 0 }, + { 0, 0, 2, -3, 2 }, + { 1, 2, 0, -2, 0 }, + { 0, 3, 0, 0, 0 }, + { 0, 0, 4, 0, 2 }, + { 0, 0, 2, -4, 1 }, + { 2, 0, 0, -2, -2 }, + + /* 171-180 */ + { 1, 1, -2, -4, -2 }, + { 0, 1, 0, -2, -1 }, + { 0, 0, 0, 4, 1 }, + { 3, 0, 2, -2, 1 }, + { 1, 0, 2, 4, 2 }, + { 1, 1, -2, 0, -2 }, + { 0, 0, 4, -2, 1 }, + { 2, -2, 0, -2, 0 }, + { 2, 1, 0, -2, -1 }, + { 0, 2, 0, -2, 0 }, + + /* 181-190 */ + { 1, 0, 0, -1, 1 }, + { 1, 1, 2, 2, 2 }, + { 3, 0, 0, 0, -1 }, + { 2, 0, 0, -4, -1 }, + { 3, 0, 2, 2, 2 }, + { 0, 0, 2, 4, 1 }, + { 0, 2, -2, -2, -2 }, + { 1, -1, 0, -2, -1 }, + { 0, 0, 2, -1, 1 }, + { 2, 0, 0, 2, 1 }, + + /* 191-200 */ + { 1, -1, -2, 2, -1 }, + { 0, 0, 0, 2, -2 }, + { 2, 0, 0, -4, 1 }, + { 1, 0, 0, -4, 1 }, + { 2, 0, 2, -4, 1 }, + { 4, 0, 2, -2, 2 }, + { 2, 1, -2, 0, -1 }, + { 2, 1, -2, -4, -2 }, + { 3, 0, 0, -4, 0 }, + { 1, -1, 2, 2, 1 }, + + /* 201-210 */ + { 1, -1, -2, 0, -1 }, + { 0, 2, 0, 0, 1 }, + { 1, 2, -2, -2, -2 }, + { 1, 1, 0, -4, 0 }, + { 2, 0, 0, -2, 2 }, + { 0, 2, 2, -2, 1 }, + { 1, 0, 2, 0, -1 }, + { 2, 1, 0, -2, 1 }, + { 2, -1, -2, 0, -1 }, + { 1, -1, -2, -2, -1 }, + + /* 211-220 */ + { 0, 1, -2, 1, -2 }, + { 1, 0, -4, 2, -2 }, + { 0, 1, 2, 2, 1 }, + { 3, 0, 0, 0, 1 }, + { 2, -1, 2, 2, 2 }, + { 0, 1, -2, -4, -2 }, + { 1, 0, -2, -3, -2 }, + { 2, 0, 0, 0, 2 }, + { 1, -1, 0, -2, -2 }, + { 2, 0, -2, 2, -1 }, + + /* 221-230 */ + { 0, 2, -2, 0, -2 }, + { 3, 0, -2, 0, -1 }, + { 2, -1, 2, 0, 1 }, + { 1, 0, -2, -1, -2 }, + { 0, 0, 2, 0, 3 }, + { 2, 0, -4, 0, -2 }, + { 2, 1, 0, -4, 0 }, + { 1, 1, -2, 1, -1 }, + { 0, 2, 2, 0, 2 }, + { 1, -1, 2, -2, 2 }, + + /* 231-240 */ + { 1, -1, 0, -2, 1 }, + { 2, 1, 2, 0, 1 }, + { 1, 0, 2, -4, 2 }, + { 1, 1, -2, 0, -1 }, + { 1, 1, 0, 2, 0 }, + { 1, 0, 0, -3, 0 }, + { 2, 0, 2, -1, 2 }, + { 0, 2, 0, 0, -1 }, + { 2, -1, 0, -2, 0 }, + { 4, 0, 0, 0, 0 }, + + /* 241-250 */ + { 2, 1, -2, -2, -2 }, + { 0, 2, -2, 2, 0 }, + { 1, 0, 2, 1, 1 }, + { 1, 0, -1, 0, -3 }, + { 3, -1, 2, 0, 2 }, + { 2, 0, 2, -2, 0 }, + { 1, -2, 0, 0, 0 }, + { 2, 0, 0, 0, -2 }, + { 1, 0, 0, 4, 0 }, + { 0, 1, 0, 1, 1 }, + + /* 251-260 */ + { 1, 0, 2, 2, 0 }, + { 0, 1, 0, 2, -1 }, + { 0, 1, 0, 1, -1 }, + { 0, 0, 2, -2, 3 }, + { 3, 1, 2, 0, 2 }, + { 1, 1, 2, 1, 2 }, + { 1, 1, -2, 2, -1 }, + { 2, -1, 2, -2, 2 }, + { 1, -2, 2, 0, 2 }, + { 1, 0, 2, -4, 0 }, + + /* 261-270 */ + { 0, 0, 1, 0, 0 }, + { 1, 0, 2, -3, 1 }, + { 1, -2, 0, -2, 0 }, + { 2, 0, 0, 2, -1 }, + { 1, 1, 2, -4, 1 }, + { 4, 0, 2, 0, 1 }, + { 0, 1, 2, 1, 1 }, + { 1, 2, 2, -2, 2 }, + { 2, 0, 2, 1, 2 }, + { 2, 1, 2, -2, 1 }, + + /* 271-280 */ + { 1, 0, 2, -1, 1 }, + { 1, 0, 4, -2, 1 }, + { 1, -1, 2, -2, 1 }, + { 0, 1, 0, -4, 0 }, + { 3, 0, -2, -2, -2 }, + { 0, 0, 4, -4, 2 }, + { 2, 0, -4, -2, -2 }, + { 2, -2, 0, -2, -1 }, + { 1, 0, 2, -2, -1 }, + { 2, 0, -2, -6, -2 }, + + /* 281-290 */ + { 1, 0, -2, 1, -2 }, + { 1, 0, -2, 2, 1 }, + { 1, -1, 0, 2, -1 }, + { 1, 0, -2, 1, 0 }, + { 2, -1, 0, -2, 1 }, + { 1, -1, 0, 2, 1 }, + { 2, 0, -2, -2, 0 }, + { 1, 0, 2, -3, 2 }, + { 0, 0, 0, 4, -1 }, + { 2, -1, 0, 0, 1 }, + + /* 291-300 */ + { 2, 0, 4, -2, 2 }, + { 0, 0, 2, 3, 2 }, + { 0, 1, 4, -2, 2 }, + { 0, 1, -2, 2, 1 }, + { 1, 1, 0, 2, 1 }, + { 1, 0, 0, 4, 1 }, + { 0, 0, 4, 0, 1 }, + { 2, 0, 0, -3, 0 }, + { 1, 0, 0, -1, -2 }, + { 1, -2, -2, -2, -2 }, + + /* 301-310 */ + { 3, 0, 0, 2, 0 }, + { 2, 0, 2, -4, 2 }, + { 1, 1, -2, -4, -1 }, + { 1, 0, -2, -6, -2 }, + { 2, -1, 0, 0, -1 }, + { 2, -1, 0, 2, 0 }, + { 0, 1, 2, -2, -1 }, + { 1, 1, 0, 1, 0 }, + { 1, 2, 0, -2, -1 }, + { 1, 0, 0, 1, -1 }, + + /* 311-320 */ + { 0, 0, 1, 0, 2 }, + { 3, 1, 2, -2, 2 }, + { 1, 0, -4, -2, -2 }, + { 1, 0, 2, 4, 1 }, + { 1, -2, 2, 2, 2 }, + { 1, -1, -2, -4, -2 }, + { 0, 0, 2, -4, 2 }, + { 0, 0, 2, -3, 1 }, + { 2, 1, -2, 0, 0 }, + { 3, 0, -2, -2, -1 }, + + /* 321-330 */ + { 2, 0, 2, 4, 2 }, + { 0, 0, 0, 0, 3 }, + { 2, -1, -2, -2, -2 }, + { 2, 0, 0, -1, 0 }, + { 3, 0, 2, -4, 2 }, + { 2, 1, 2, 2, 2 }, + { 0, 0, 3, 0, 3 }, + { 1, 1, 2, 2, 1 }, + { 2, 1, 0, 0, -1 }, + { 1, 2, 0, -2, 1 }, + + /* 331-340 */ + { 3, 0, 2, 2, 1 }, + { 1, -1, -2, 2, -2 }, + { 1, 1, 0, -1, 0 }, + { 1, 2, 0, 0, 0 }, + { 1, 0, 4, 0, 2 }, + { 1, -1, 2, 4, 2 }, + { 2, 1, 0, 0, 1 }, + { 1, 0, 0, 2, 2 }, + { 1, -1, -2, 2, 0 }, + { 0, 2, -2, -2, -1 }, + + /* 341-350 */ + { 2, 0, -2, 0, 2 }, + { 5, 0, 2, 0, 2 }, + { 3, 0, -2, -6, -2 }, + { 1, -1, 2, -1, 2 }, + { 3, 0, 0, -4, -1 }, + { 1, 0, 0, 1, 1 }, + { 1, 0, -4, 2, -1 }, + { 0, 1, 2, -4, 1 }, + { 1, 2, 2, 0, 2 }, + { 0, 1, 0, -2, -2 }, + + /* 351-360 */ + { 0, 0, 2, -1, 0 }, + { 1, 0, 1, 0, 1 }, + { 0, 2, 0, -2, 1 }, + { 3, 0, 2, 0, 0 }, + { 1, 1, -2, 1, 0 }, + { 2, 1, -2, -4, -1 }, + { 3, -1, 0, 0, 0 }, + { 2, -1, -2, 0, 0 }, + { 4, 0, 2, -2, 1 }, + { 2, 0, -2, 2, 0 }, + + /* 361-370 */ + { 1, 1, 2, -2, 0 }, + { 1, 0, -2, 4, -1 }, + { 1, 0, -2, -2, 1 }, + { 2, 0, 2, -4, 0 }, + { 1, 1, 0, -2, -2 }, + { 1, 1, -2, -2, 0 }, + { 1, 0, 1, -2, 1 }, + { 2, -1, -2, -4, -2 }, + { 3, 0, -2, 0, -2 }, + { 0, 1, -2, -2, 0 }, + + /* 371-380 */ + { 3, 0, 0, -2, -1 }, + { 1, 0, -2, -3, -1 }, + { 0, 1, 0, -4, -1 }, + { 1, -2, 2, -2, 1 }, + { 0, 1, -2, 1, -1 }, + { 1, -1, 0, 0, 2 }, + { 2, 0, 0, 1, 0 }, + { 1, -2, 0, 2, 0 }, + { 1, 2, -2, -2, -1 }, + { 0, 0, 4, -4, 1 }, + + /* 381-390 */ + { 0, 1, 2, 4, 2 }, + { 0, 1, -4, 2, -2 }, + { 3, 0, -2, 0, 0 }, + { 2, -1, 2, 2, 1 }, + { 0, 1, -2, -4, -1 }, + { 4, 0, 2, 2, 2 }, + { 2, 0, -2, -3, -2 }, + { 2, 0, 0, -6, 0 }, + { 1, 0, 2, 0, 3 }, + { 3, 1, 0, 0, 0 }, + + /* 391-400 */ + { 3, 0, 0, -4, 1 }, + { 1, -1, 2, 0, 0 }, + { 1, -1, 0, -4, 0 }, + { 2, 0, -2, 2, -2 }, + { 1, 1, 0, -2, 2 }, + { 4, 0, 0, -2, 0 }, + { 2, 2, 0, -2, 0 }, + { 0, 1, 2, 0, 0 }, + { 1, 1, 0, -4, 1 }, + { 1, 0, 0, -4, -2 }, + + /* 401-410 */ + { 0, 0, 0, 1, 2 }, + { 3, 0, 0, 2, 1 }, + { 1, 1, 0, -4, -1 }, + { 0, 0, 2, 2, -1 }, + { 1, 1, 2, 0, 0 }, + { 1, -1, 2, -4, 1 }, + { 1, 1, 0, 0, 2 }, + { 0, 0, 2, 6, 2 }, + { 4, 0, -2, -2, -1 }, + { 2, 1, 0, -4, -1 }, + + /* 411-420 */ + { 0, 0, 0, 3, 1 }, + { 1, -1, -2, 0, 0 }, + { 0, 0, 2, 1, 0 }, + { 1, 0, 0, 2, -2 }, + { 3, -1, 2, 2, 2 }, + { 3, -1, 2, -2, 2 }, + { 1, 0, 0, -1, 2 }, + { 1, -2, 2, -2, 2 }, + { 0, 1, 0, 2, 2 }, + { 0, 1, -2, -1, -2 }, + + /* 421-430 */ + { 1, 1, -2, 0, 0 }, + { 0, 2, 2, -2, 0 }, + { 3, -1, -2, -1, -2 }, + { 1, 0, 0, -6, 0 }, + { 1, 0, -2, -4, 0 }, + { 2, 1, 0, -4, 1 }, + { 2, 0, 2, 0, -1 }, + { 2, 0, -4, 0, -1 }, + { 0, 0, 3, 0, 2 }, + { 2, 1, -2, -2, -1 }, + + /* 431-440 */ + { 1, -2, 0, 0, 1 }, + { 2, -1, 0, -4, 0 }, + { 0, 0, 0, 3, 0 }, + { 5, 0, 2, -2, 2 }, + { 1, 2, -2, -4, -2 }, + { 1, 0, 4, -4, 2 }, + { 0, 0, 4, -1, 2 }, + { 3, 1, 0, -4, 0 }, + { 3, 0, 0, -6, 0 }, + { 2, 0, 0, 2, 2 }, + + /* 441-450 */ + { 2, -2, 2, 0, 2 }, + { 1, 0, 0, -3, 1 }, + { 1, -2, -2, 0, -2 }, + { 1, -1, -2, -3, -2 }, + { 0, 0, 2, -2, -2 }, + { 2, 0, -2, -4, 0 }, + { 1, 0, -4, 0, 0 }, + { 0, 1, 0, -1, 0 }, + { 4, 0, 0, 0, -1 }, + { 3, 0, 2, -1, 2 }, + + /* 451-460 */ + { 3, -1, 2, 0, 1 }, + { 2, 0, 2, -1, 1 }, + { 1, 2, 2, -2, 1 }, + { 1, 1, 0, 2, -1 }, + { 0, 2, 2, 0, 1 }, + { 3, 1, 2, 0, 1 }, + { 1, 1, 2, 1, 1 }, + { 1, 1, 0, -1, 1 }, + { 1, -2, 0, -2, -1 }, + { 4, 0, 0, -4, 0 }, + + /* 461-470 */ + { 2, 1, 0, 2, 0 }, + { 1, -1, 0, 4, 0 }, + { 0, 1, 0, -2, 2 }, + { 0, 0, 2, 0, -2 }, + { 1, 0, -1, 0, 1 }, + { 3, 0, 2, -2, 0 }, + { 2, 0, 2, 2, 0 }, + { 1, 2, 0, -4, 0 }, + { 1, -1, 0, -3, 0 }, + { 0, 1, 0, 4, 0 }, + + /* 471 - 480 */ + { 0, 1, -2, 0, 0 }, + { 2, 2, 2, -2, 2 }, + { 0, 0, 0, 1, -2 }, + { 0, 2, -2, 0, -1 }, + { 4, 0, 2, -4, 2 }, + { 2, 0, -4, 2, -2 }, + { 2, -1, -2, 0, -2 }, + { 1, 1, 4, -2, 2 }, + { 1, 1, 2, -4, 2 }, + { 1, 0, 2, 3, 2 }, + + /* 481-490 */ + { 1, 0, 0, 4, -1 }, + { 0, 0, 0, 4, 2 }, + { 2, 0, 0, 4, 0 }, + { 1, 1, -2, 2, 0 }, + { 2, 1, 2, 1, 2 }, + { 2, 1, 2, -4, 1 }, + { 2, 0, 2, 1, 1 }, + { 2, 0, -4, -2, -1 }, + { 2, 0, -2, -6, -1 }, + { 2, -1, 2, -1, 2 }, + + /* 491-500 */ + { 1, -2, 2, 0, 1 }, + { 1, -2, 0, -2, 1 }, + { 1, -1, 0, -4, -1 }, + { 0, 2, 2, 2, 2 }, + { 0, 2, -2, -4, -2 }, + { 0, 1, 2, 3, 2 }, + { 0, 1, 0, -4, 1 }, + { 3, 0, 0, -2, 1 }, + { 2, 1, -2, 0, 1 }, + { 2, 0, 4, -2, 1 }, + + /* 501-510 */ + { 2, 0, 0, -3, -1 }, + { 2, -2, 0, -2, 1 }, + { 2, -1, 2, -2, 1 }, + { 1, 0, 0, -6, -1 }, + { 1, -2, 0, 0, -1 }, + { 1, -2, -2, -2, -1 }, + { 0, 1, 4, -2, 1 }, + { 0, 0, 2, 3, 1 }, + { 2, -1, 0, -1, 0 }, + { 1, 3, 0, -2, 0 }, + + /* 511-520 */ + { 0, 3, 0, -2, 0 }, + { 2, -2, 2, -2, 2 }, + { 0, 0, 4, -2, 0 }, + { 4, -1, 2, 0, 2 }, + { 2, 2, -2, -4, -2 }, + { 4, 1, 2, 0, 2 }, + { 4, -1, -2, -2, -2 }, + { 2, 1, 0, -2, -2 }, + { 2, 1, -2, -6, -2 }, + { 2, 0, 0, -1, 1 }, + + /* 521-530 */ + { 2, -1, -2, 2, -1 }, + { 1, 1, -2, 2, -2 }, + { 1, 1, -2, -3, -2 }, + { 1, 0, 3, 0, 3 }, + { 1, 0, -2, 1, 1 }, + { 1, 0, -2, 0, 2 }, + { 1, -1, 2, 1, 2 }, + { 1, -1, 0, 0, -2 }, + { 1, -1, -4, 2, -2 }, + { 0, 3, -2, -2, -2 }, + + /* 531-540 */ + { 0, 1, 0, 4, 1 }, + { 0, 0, 4, 2, 2 }, + { 3, 0, -2, -2, 0 }, + { 2, -2, 0, 0, 0 }, + { 1, 1, 2, -4, 0 }, + { 1, 1, 0, -3, 0 }, + { 1, 0, 2, -3, 0 }, + { 1, -1, 2, -2, 0 }, + { 0, 2, 0, 2, 0 }, + { 0, 0, 2, 4, 0 }, + + /* 541-550 */ + { 1, 0, 1, 0, 0 }, + { 3, 1, 2, -2, 1 }, + { 3, 0, 4, -2, 2 }, + { 3, 0, 2, 1, 2 }, + { 3, 0, 0, 2, -1 }, + { 3, 0, 0, 0, 2 }, + { 3, 0, -2, 2, -1 }, + { 2, 0, 4, -4, 2 }, + { 2, 0, 2, -3, 2 }, + { 2, 0, 0, 4, 1 }, + + /* 551-560 */ + { 2, 0, 0, -3, 1 }, + { 2, 0, -4, 2, -1 }, + { 2, 0, -2, -2, 1 }, + { 2, -2, 2, 2, 2 }, + { 2, -2, 0, -2, -2 }, + { 2, -1, 0, 2, 1 }, + { 2, -1, 0, 2, -1 }, + { 1, 1, 2, 4, 2 }, + { 1, 1, 0, 1, 1 }, + { 1, 1, 0, 1, -1 }, + + /* 561-570 */ + { 1, 1, -2, -6, -2 }, + { 1, 0, 0, -3, -1 }, + { 1, 0, -4, -2, -1 }, + { 1, 0, -2, -6, -1 }, + { 1, -2, 2, 2, 1 }, + { 1, -2, -2, 2, -1 }, + { 1, -1, -2, -4, -1 }, + { 0, 2, 0, 0, 2 }, + { 0, 1, 2, -4, 2 }, + { 0, 1, -2, 4, -1 }, + + /* 571-580 */ + { 5, 0, 0, 0, 0 }, + { 3, 0, 0, -3, 0 }, + { 2, 2, 0, -4, 0 }, + { 1, -1, 2, 2, 0 }, + { 0, 1, 0, 3, 0 }, + { 4, 0, -2, 0, -1 }, + { 3, 0, -2, -6, -1 }, + { 3, 0, -2, -1, -1 }, + { 2, 1, 2, 2, 1 }, + { 2, 1, 0, 2, 1 }, + + /* 581-590 */ + { 2, 0, 2, 4, 1 }, + { 2, 0, 2, -6, 1 }, + { 2, 0, 2, -2, -1 }, + { 2, 0, 0, -6, -1 }, + { 2, -1, -2, -2, -1 }, + { 1, 2, 2, 0, 1 }, + { 1, 2, 0, 0, 1 }, + { 1, 0, 4, 0, 1 }, + { 1, 0, 2, -6, 1 }, + { 1, 0, 2, -4, -1 }, + + /* 591-600 */ + { 1, 0, -1, -2, -1 }, + { 1, -1, 2, 4, 1 }, + { 1, -1, 2, -3, 1 }, + { 1, -1, 0, 4, 1 }, + { 1, -1, -2, 1, -1 }, + { 0, 1, 2, -2, 3 }, + { 3, 0, 0, -2, 0 }, + { 1, 0, 1, -2, 0 }, + { 0, 2, 0, -4, 0 }, + { 0, 0, 2, -4, 0 }, + + /* 601-610 */ + { 0, 0, 1, -1, 0 }, + { 0, 0, 0, 6, 0 }, + { 0, 2, 0, 0, -2 }, + { 0, 1, -2, 2, -3 }, + { 4, 0, 0, 2, 0 }, + { 3, 0, 0, -1, 0 }, + { 3, -1, 0, 2, 0 }, + { 2, 1, 0, 1, 0 }, + { 2, 1, 0, -6, 0 }, + { 2, -1, 2, 0, 0 }, + + /* 611-620 */ + { 1, 0, 2, -1, 0 }, + { 1, -1, 0, 1, 0 }, + { 1, -1, -2, -2, 0 }, + { 0, 1, 2, 2, 0 }, + { 0, 0, 2, -3, 0 }, + { 2, 2, 0, -2, -1 }, + { 2, -1, -2, 0, 1 }, + { 1, 2, 2, -4, 1 }, + { 0, 1, 4, -4, 2 }, + { 0, 0, 0, 3, 2 }, + + /* 621-630 */ + { 5, 0, 2, 0, 1 }, + { 4, 1, 2, -2, 2 }, + { 4, 0, -2, -2, 0 }, + { 3, 1, 2, 2, 2 }, + { 3, 1, 0, -2, 0 }, + { 3, 1, -2, -6, -2 }, + { 3, 0, 0, 0, -2 }, + { 3, 0, -2, -4, -2 }, + { 3, -1, 0, -3, 0 }, + { 3, -1, 0, -2, 0 }, + + /* 631-640 */ + { 2, 1, 2, 0, 0 }, + { 2, 1, 2, -4, 2 }, + { 2, 1, 2, -2, 0 }, + { 2, 1, 0, -3, 0 }, + { 2, 1, -2, 0, -2 }, + { 2, 0, 0, -4, 2 }, + { 2, 0, 0, -4, -2 }, + { 2, 0, -2, -5, -2 }, + { 2, -1, 2, 4, 2 }, + { 2, -1, 0, -2, 2 }, + + /* 641-650 */ + { 1, 3, -2, -2, -2 }, + { 1, 1, 0, 0, -2 }, + { 1, 1, 0, -6, 0 }, + { 1, 1, -2, 1, -2 }, + { 1, 1, -2, -1, -2 }, + { 1, 0, 2, 1, 0 }, + { 1, 0, 0, 3, 0 }, + { 1, 0, 0, -4, 2 }, + { 1, 0, -2, 4, -2 }, + { 1, -2, 0, -1, 0 }, + + /* 651-NFLS */ + { 0, 1, -4, 2, -1 }, + { 1, 0, -2, 0, -3 }, + { 0, 0, 4, -4, 4 } + }; + +/* Number of frequencies: luni-solar */ + static const int NFLS = (int) (sizeof mfals / sizeof (int) / 5); + +/* Fundamental-argument multipliers: planetary terms */ + static const int mfapl[][14] = { + + /* 1-10 */ + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -2, 5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, -8, 12, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -1, 2, 0, 0, 0, 0, 0 }, + + /* 11-20 */ + { 0, 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 2, -5, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, -5, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -1, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -8, 3, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 6, -8, 3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, 0 }, + + /* 21-30 */ + { 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 1, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 1, -1, 1, 0, 0, 0, -2, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, -1, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + + /* 31-40 */ + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 1 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, -1, 0, 0, 0 }, + + /* 41-50 */ + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, -2, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, -1, 0, 0, 0, 0, 0, 2 }, + { 1, 0, 0, 0, 0, 0,-18, 16, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 2 }, + + /* 51-60 */ + { 0, 0, 1, -1, 1, 0, -5, 7, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0,-10, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, 0, -5, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -1, 0, 0, 0, 2 }, + { 1, 0, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1 }, + { 1, 0, -2, 0, -2, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 2, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + + /* 61-70 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, 0, 3, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-11, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -3, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0 }, + + /* 71-80 */ + { 0, 0, 0, 0, 0, 0, 6, -8, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 8,-15, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -2, 0, 0, 0, 2 }, + { 0, 0, 1, -1, 1, 0, 0, -5, 8, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, 0 }, + + /* 81-90 */ + { 2, 0, 0, -2, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0, -1 }, + { 2, 0, 0, -2, 0, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 8,-13, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, -2, 5, 0, 0, 0 }, + { 1, 0, 0, -1, 0, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2 }, + { 1, 0, 0, 0, -1, 0,-18, 16, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, -5, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + + /* 91-100 */ + { 1, 0, 0, -2, 0, 0, 19,-21, 3, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -8, 13, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7, -9, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2 }, + { 1, 0, 0, 0, 1, 0,-18, 16, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-16, 4, 5, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 3, -7, 0, 0, 0, 0, 0, -2 }, + + /* 101-110 */ + { 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 }, + { 2, 0, 0, -2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, -1, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2 }, + + /* 111-120 */ + { 0, 0, 0, 0, 1, 0, 0, 1, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2 }, + { 0, 0, 2, -2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, -6, 8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + + /* 121-130 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-10, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0, -2 }, + { 1, 0, 0, -1, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + + /* 131-140 */ + { 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, -3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 1, 0, 2, -3, 0, 0, 0, 0, 0, 0 }, + + /* 141-150 */ + { 1, 0, 0, -1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -4, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 9,-11, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 8,-15, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -4, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, -1, 0, 0, 0, 2 }, + + /* 151-160 */ + { 1, 0, 0, -1, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -4, 10, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -4, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, -2 }, + { 0, 0, 2, -2, 1, 0, -4, 4, 0, 0, 0, 0, 0, 0 }, + + /* 161-170 */ + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -1, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -3, 0, 0, 0, 0, 2 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, 0, 2, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -9, 13, 0, 0, 0, 0, 0 }, + { 2, 0, 2, 0, 2, 0, 0, 2, 0, -3, 0, 0, 0, 0 }, + + /* 171-180 */ + { 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, 0, 2, 0, 0, 0 }, + { 1, 0, 0, -1, -1, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1 }, + { 1, 0, 2, 0, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 1, 0, -2, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -2, 4, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0 }, + + /* 181-190 */ + { 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -8, 3, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 6,-10, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 7, -8, 3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 1, 0, -3, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, -5, 7, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 0, 0, 1 }, + + /* 191-200 */ + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7,-10, 0, 0, 0, 0, 0, -2 }, + { 1, 0, 0, -2, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, -5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6, -8, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, 1, 0, 0, -9, 15, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -2, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0 }, + + /* 201-210 */ + { 0, 0, 0, 0, 0, 0, 0, 1, -4, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -1, 0, 0, 2 }, + { 2, 0, 0, -2, 1, 0, -6, 8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, 1, 0, 3, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 8,-14, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + + /* 211-220 */ + { 0, 0, 0, 0, 1, 0, 0, 8,-15, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 1, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 2 }, + { 2, 0, -1, -1, 0, 0, 0, 3, -7, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -3, 4, 0, 0, 0, 0, 0 }, + + /* 221-230 */ + { 2, 0, 0, -2, 0, 0, 0, -6, 8, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -5, 6, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 1, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -9, 4, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, -2 }, + + /* 231-240 */ + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -4, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1 }, + { 0, 0, 0, 0, 0, 0, 7,-11, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 3, -5, 4, 0, 0, 0, 0, 2 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, -1, 1, 0, 0, 0 }, + { 2, 0, 0, 0, 0, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 8,-15, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 2, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, -1 }, + + /* 241-250 */ + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -1, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 2, -4, 0, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 3, -5, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -3, 0, 0, 0, 2 }, + { 0, 0, 2, -2, 2, 0, -8, 11, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -2, 0, 0, 0 }, + + /* 251-260 */ + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -9, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 7, -9, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, -2, -2, -2, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -2, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 0, 0, 0, 0, 1 }, + + /* 261-270 */ + { 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, -5, 0, 0, 2 }, + { 2, 0, 0, -2, -1, 0, 0, -2, 0, 0, 5, 0, 0, 0 }, + { 2, 0, 0, -2, -1, 0, -6, 8, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8, -8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, -5, 0, 0, 2 }, + { 0, 0, 0, 0, 1, 0, 3, -7, 4, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + + /* 271-280 */ + { 0, 0, 1, -1, 0, 0, 0, -1, 0, -2, 5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-15, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 2 }, + { 1, 0, 0, -1, 0, 0, 0, -3, 4, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -3, 7, -4, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, 0, -2, 0, 0, 0, 2 }, + + /* 281-290 */ + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 2, -2, 2, 0, -5, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 2, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-11, 0, 0, 0, 0, -2 }, + + /* 291-300 */ + { 0, 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 9,-12, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 1, -1, 0, 0, -8, 12, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -2, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, -1 }, + + /* 301-310 */ + { 0, 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 1, 0, -4, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, -1, 0, 0, 0, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -5, 0, 0, 0, 0, -2 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 3, -1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -9, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, 2 }, + + /* 311-320 */ + { 0, 0, 0, 0, 0, 0, 9, -9, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 3, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 2, -4, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -9, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2 }, + { 0, 0, 2, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + + /* 321-330 */ + { 0, 0, 2, 0, 2, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, 0, -3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0 }, + { 2, 0, -1, -1, -1, 0, 0, -1, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -3, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 5,-10, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 8,-13, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 2, -2, 1, -1, 0, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, 2, 0, 0 }, + + /* 331-340 */ + { 0, 0, 0, 0, 1, 0, 3, -5, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 9, -9, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -8, 11, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -2, 0, 0, 2, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -1, 2, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 2, -6, 0, 0, 0, 0, 0, -2 }, + + /* 341-350 */ + { 0, 0, 0, 0, 0, 0, 0, 8,-15, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -2, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 7,-13, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 2 }, + { 0, 0, 2, -2, 1, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8, -8, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 8,-10, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 1 }, + + /* 351-360 */ + { 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -4, 0, 0, 0, 0 }, + { 2, 0, 0, -2, -1, 0, 0, -5, 6, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 0, 0, -2 }, + { 2, 0, -1, -1, -1, 0, 0, 3, -7, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, -1, 1, 0, 0, 0, 0, 0, 0 }, + + /* 361-370 */ + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 4, -3, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-11, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 1, 0, 0, -6, 8, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 1, 5, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 6, -5, 0, 0, 0, 0, 2 }, + { 1, 0, -2, -2, -2, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, 0, 0, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 2, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1 }, + + /* 371-380 */ + { 0, 0, 0, 0, 0, 0, 0, 6, -7, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, -2, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -2, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, -6, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 3, -5, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 7,-13, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -2, 0, 0, 0, 2 }, + + /* 381-390 */ + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 0, 2, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -8, 15, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, -2, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 2, 0, -1, -1, -1, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 1, 0, 2, -2, 2, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 1, 0, -1, 1, -1, 0,-18, 17, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 2, -2, -1, 0, -5, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + + /* 391-400 */ + { 0, 0, 0, 0, 1, 0, 2, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-16, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2 }, + { 0, 0, 0, 0, 2, 0, 0, -1, 2, 0, 0, 0, 0, 0 }, + { 2, 0, -1, -1, -2, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6,-10, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, -2, 4, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2 }, + { 2, 0, 0, -2, -1, 0, 0, -2, 0, 4, -5, 0, 0, 0 }, + + /* 401-410 */ + { 2, 0, 0, -2, -1, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 2, 0, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -1, -1, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + { 1, 0, -1, -1, -1, 0, 20,-20, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 1, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -2, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 5, -8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0 }, + + /* 411-420 */ + { 0, 0, 0, 0, 0, 0, 9,-11, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 5, -3, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -3, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 6, -7, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, -2, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, -2, 5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, 0 }, + + /* 421-430 */ + { 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -8, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -6, 0, 0, 0, 0, -2 }, + { 1, 0, 0, -2, 0, 0, 20,-21, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-12, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -4, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 8,-12, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 9,-17, 0, 0, 0, 0, 0 }, + + /* 431-440 */ + { 0, 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 1, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -6, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -7, 0, 0, 0, 0, -2 }, + { 1, 0, 0, -1, 1, 0, 0, -3, 4, 0, 0, 0, 0, 0 }, + { 1, 0, -2, 0, -2, 0,-10, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -9, 17, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -4, 0, 0, 0, 0, 0, -2 }, + { 1, 0, -2, -2, -2, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 1, 0, -1, 1, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + + /* 441-450 */ + { 0, 0, 2, -2, 2, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, 0, -1, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, -5, 7, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 2, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5,-10, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, -4, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, -5, 0, 0, 0, -2 }, + + /* 451-460 */ + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -5, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -2, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -2, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -3, 0, 0, 0, 0, 0, 1 }, + { 1, 0, 0, -2, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -7, 4, 0, 0, 0, 0, 0 }, + { 2, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, -1, 0, 0, -1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 1, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-10, 0, 0, 0, 0, -2 }, + + /* 461-470 */ + { 1, 0, 0, -1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -3, 0, 3, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, -5, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 1, -3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -4, 6, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -5, 6, 0, 0, 0, 0, 0, 0 }, + + /* 471-480 */ + { 0, 0, 0, 0, 1, 0, 3, -4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7,-10, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 3, -8, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 7, -9, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 7, -8, 0, 0, 0, 0, 2 }, + + /* 481-490 */ + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -8, 3, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -4, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1 }, + { 2, 0, 0, -2, -1, 0, 0, -6, 8, 0, 0, 0, 0, 0 }, + { 2, 0, -1, -1, 1, 0, 0, 3, -7, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -7, 9, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0, 0, -1 }, + + /* 491-500 */ + { 0, 0, 1, -1, 2, 0, -8, 12, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7, -8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 1, 0, 0, -5, 6, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, -1, 0, 0, -2, 0, 3, -1, 0, 0, 0 }, + { 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 1, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 1, 0, 0, -2, -1, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + + /* 501-510 */ + { 1, 0, 0, -1, -1, 0, 0, -3, 4, 0, 0, 0, 0, 0 }, + { 1, 0, -1, 0, -1, 0, -3, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -4, 4, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, -8, 11, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, 0, 0, -9, 13, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, 1, -4, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, 0, -1, 0, 1, -3, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 7,-13, 0, 0, 0, 0, 0 }, + + /* 511-520 */ + { 0, 0, 0, 0, 1, 0, 0, 2, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 1, 0, -4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 7,-11, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 6, -4, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 4, -2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -4, 0, 0, 0, 0, 0, 1 }, + + /* 521-530 */ + { 0, 0, 0, 0, 0, 0, 1, -4, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 9,-17, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 7, -7, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -8, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, -7, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -4, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + + /* 531-540 */ + { 2, 0, 0, -2, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 17,-16, 0, -2, 0, 0, 0, 0 }, + { 1, 0, 0, -1, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -4, 0, 0, 0, 0 }, + + /* 541-550 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 2 }, + { 2, 0, 0, -2, 0, 0, 0, -4, 4, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 2, 2, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + + /* 551-560 */ + { 1, 0, 0, -2, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, 0, -4, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 3, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, -4, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 2, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0 }, + + /* 561-570 */ + { 0, 0, 0, 0, 0, 0, 8, -9, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0 }, + { 2, 0, -2, -2, -2, 0, 0, -2, 0, 2, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 1, 0,-10, 3, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, -1, 0,-10, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, 2, -3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, 2, -2, 0, 0, 0, 0, 0, 0 }, + + /* 571-580 */ + { 0, 0, 2, 0, 2, 0, -2, 3, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 0, 2, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, -1, 0, 2, 0, 0, 0, 0 }, + { 2, 0, 2, -2, 2, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 2, 0, 1, -3, 1, 0, -6, 7, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 2, -5, 0, 0, 0, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 5, -5, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 1, 5, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 5, 0, 0, 0 }, + + /* 581-590 */ + { 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 2, 0, 0, 0 }, + { 2, 0, 0, -2, 0, 0, -4, 4, 0, 0, 0, 0, 0, 0 }, + { 2, 0, -2, 0, -2, 0, 0, 5, -9, 0, 0, 0, 0, 0 }, + { 2, 0, -1, -1, 0, 0, 0, -1, 0, 3, 0, 0, 0, 0 }, + { 1, 0, 2, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, 0, 2, 0, 0, 4, -8, 3, 0, 0, 0, 0 }, + { 1, 0, 2, 0, 2, 0, 0, -4, 8, -3, 0, 0, 0, 0 }, + { 1, 0, 2, 0, 2, 0, -1, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 2, -2, 2, 0, -3, 3, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + + /* 591-600 */ + { 1, 0, 0, 0, 0, 0, 0, -2, 0, 3, 0, 0, 0, 0 }, + { 1, 0, 0, -2, 0, 0, 0, 2, 0, -2, 0, 0, 0, 0 }, + { 1, 0, -2, -2, -2, 0, 0, 1, 0, -1, 0, 0, 0, 0 }, + { 1, 0, -1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, -1, -1, 0, 0, 0, 8,-15, 0, 0, 0, 0, 0 }, + { 0, 0, 2, 2, 2, 0, 0, 2, 0, -2, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0, -2, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 1, 0, 0,-10, 15, 0, 0, 0, 0, 0 }, + { 0, 0, 2, -2, 0, -1, 0, 2, 0, 0, 0, 0, 0, 0 }, + + /* 601-610 */ + { 0, 0, 1, -1, 2, 0, 0, -1, 0, 0, -1, 0, 0, 0 }, + { 0, 0, 1, -1, 2, 0, -3, 4, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -4, 6, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 1, 0, -1, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, 0, -1, 0, 0, -2, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 1, -1, -1, 0, -5, 7, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 2, 0, 0, 0, 2, 0, -2, 0, 0, 0, 0 }, + + /* 611-620 */ + { 0, 0, 0, 2, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 2, 0, -3, 5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, -1, 2, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 9,-13, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 8,-14, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 8,-11, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6, -8, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 6, -7, 0, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0, -2 }, + + /* 621-630 */ + { 0, 0, 0, 0, 0, 0, 5, -6, -4, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 5, -4, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 4, -8, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 4, -5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 3, -3, 0, 2, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 7,-12, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 6, -9, 0, 0, 0, 0, -2 }, + + /* 631-640 */ + { 0, 0, 0, 0, 0, 0, 0, 6, -8, 1, 5, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 6, -4, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 6,-10, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5, 0, -4, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -9, 0, 0, 0, 0, -1 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -8, 3, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -7, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 5, -6, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 5,-16, 4, 5, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 5,-13, 0, 0, 0, 0, -2 }, + + /* 641-650 */ + { 0, 0, 0, 0, 0, 0, 0, 3, 0, -5, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -9, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 3, -7, 0, 0, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -3, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 2, -8, 1, 5, 0, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, -5, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -3, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 0, -3, 5, 0, 0, 0 }, + + /* 651-NFPL */ + { 0, 0, 0, 0, 0, 0, 0, 1, -3, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -6, 3, 0, -2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 } + }; + +/* Number of frequencies: planetary */ + static const int NFPL = (int) (sizeof mfapl / sizeof (int) / 14); + +/* Pointers into amplitudes array, one pointer per frequency */ + static const int nc[] = { + + /* 1-100 */ + 1, 21, 37, 51, 65, 79, 91, 103, 115, 127, + 139, 151, 163, 172, 184, 196, 207, 219, 231, 240, + 252, 261, 273, 285, 297, 309, 318, 327, 339, 351, + 363, 372, 384, 396, 405, 415, 423, 435, 444, 452, + 460, 467, 474, 482, 490, 498, 506, 513, 521, 528, + 536, 543, 551, 559, 566, 574, 582, 590, 597, 605, + 613, 620, 628, 636, 644, 651, 658, 666, 674, 680, + 687, 695, 702, 710, 717, 725, 732, 739, 746, 753, + 760, 767, 774, 782, 790, 798, 805, 812, 819, 826, + 833, 840, 846, 853, 860, 867, 874, 881, 888, 895, + + /* 101-200 */ + 901, 908, 914, 921, 928, 934, 941, 948, 955, 962, + 969, 976, 982, 989, 996, 1003, 1010, 1017, 1024, 1031, + 1037, 1043, 1050, 1057, 1064, 1071, 1078, 1084, 1091, 1098, + 1104, 1112, 1118, 1124, 1131, 1138, 1145, 1151, 1157, 1164, + 1171, 1178, 1185, 1192, 1199, 1205, 1212, 1218, 1226, 1232, + 1239, 1245, 1252, 1259, 1266, 1272, 1278, 1284, 1292, 1298, + 1304, 1310, 1316, 1323, 1329, 1335, 1341, 1347, 1353, 1359, + 1365, 1371, 1377, 1383, 1389, 1396, 1402, 1408, 1414, 1420, + 1426, 1434, 1440, 1446, 1452, 1459, 1465, 1471, 1477, 1482, + 1488, 1493, 1499, 1504, 1509, 1514, 1520, 1527, 1532, 1538, + + /* 201-300 */ + 1543, 1548, 1553, 1558, 1564, 1569, 1574, 1579, 1584, 1589, + 1594, 1596, 1598, 1600, 1602, 1605, 1608, 1610, 1612, 1617, + 1619, 1623, 1625, 1627, 1629, 1632, 1634, 1640, 1642, 1644, + 1646, 1648, 1650, 1652, 1654, 1658, 1660, 1662, 1664, 1668, + 1670, 1672, 1673, 1675, 1679, 1681, 1683, 1684, 1686, 1688, + 1690, 1693, 1695, 1697, 1701, 1703, 1705, 1707, 1709, 1711, + 1712, 1715, 1717, 1721, 1723, 1725, 1727, 1729, 1731, 1733, + 1735, 1737, 1739, 1741, 1743, 1745, 1747, 1749, 1751, 1753, + 1755, 1757, 1759, 1761, 1762, 1764, 1766, 1768, 1769, 1771, + 1773, 1775, 1777, 1779, 1781, 1783, 1785, 1787, 1788, 1790, + + /* 301-400 */ + 1792, 1794, 1796, 1798, 1800, 1802, 1804, 1806, 1807, 1809, + 1811, 1815, 1817, 1819, 1821, 1823, 1825, 1827, 1829, 1831, + 1833, 1835, 1837, 1839, 1840, 1842, 1844, 1848, 1850, 1852, + 1854, 1856, 1858, 1859, 1860, 1862, 1864, 1866, 1868, 1869, + 1871, 1873, 1875, 1877, 1879, 1881, 1883, 1885, 1887, 1889, + 1891, 1892, 1896, 1898, 1900, 1901, 1903, 1905, 1907, 1909, + 1910, 1911, 1913, 1915, 1919, 1921, 1923, 1927, 1929, 1931, + 1933, 1935, 1937, 1939, 1943, 1945, 1947, 1948, 1949, 1951, + 1953, 1955, 1957, 1958, 1960, 1962, 1964, 1966, 1968, 1970, + 1971, 1973, 1974, 1975, 1977, 1979, 1980, 1981, 1982, 1984, + + /* 401-500 */ + 1986, 1988, 1990, 1992, 1994, 1995, 1997, 1999, 2001, 2003, + 2005, 2007, 2008, 2009, 2011, 2013, 2015, 2017, 2019, 2021, + 2023, 2024, 2025, 2027, 2029, 2031, 2033, 2035, 2037, 2041, + 2043, 2045, 2046, 2047, 2049, 2051, 2053, 2055, 2056, 2057, + 2059, 2061, 2063, 2065, 2067, 2069, 2070, 2071, 2072, 2074, + 2076, 2078, 2080, 2082, 2084, 2086, 2088, 2090, 2092, 2094, + 2095, 2096, 2097, 2099, 2101, 2105, 2106, 2107, 2108, 2109, + 2110, 2111, 2113, 2115, 2119, 2121, 2123, 2125, 2127, 2129, + 2131, 2133, 2135, 2136, 2137, 2139, 2141, 2143, 2145, 2147, + 2149, 2151, 2153, 2155, 2157, 2159, 2161, 2163, 2165, 2167, + + /* 501-600 */ + 2169, 2171, 2173, 2175, 2177, 2179, 2181, 2183, 2185, 2186, + 2187, 2188, 2192, 2193, 2195, 2197, 2199, 2201, 2203, 2205, + 2207, 2209, 2211, 2213, 2217, 2219, 2221, 2223, 2225, 2227, + 2229, 2231, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, + 2241, 2244, 2246, 2248, 2250, 2252, 2254, 2256, 2258, 2260, + 2262, 2264, 2266, 2268, 2270, 2272, 2274, 2276, 2278, 2280, + 2282, 2284, 2286, 2288, 2290, 2292, 2294, 2296, 2298, 2300, + 2302, 2303, 2304, 2305, 2306, 2307, 2309, 2311, 2313, 2315, + 2317, 2319, 2321, 2323, 2325, 2327, 2329, 2331, 2333, 2335, + 2337, 2341, 2343, 2345, 2347, 2349, 2351, 2352, 2355, 2356, + + /* 601-700 */ + 2357, 2358, 2359, 2361, 2363, 2364, 2365, 2366, 2367, 2368, + 2369, 2370, 2371, 2372, 2373, 2374, 2376, 2378, 2380, 2382, + 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, + 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, + 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, + 2414, 2415, 2417, 2418, 2430, 2438, 2445, 2453, 2460, 2468, + 2474, 2480, 2488, 2496, 2504, 2512, 2520, 2527, 2535, 2543, + 2550, 2558, 2566, 2574, 2580, 2588, 2596, 2604, 2612, 2619, + 2627, 2634, 2642, 2648, 2656, 2664, 2671, 2679, 2685, 2693, + 2701, 2709, 2717, 2725, 2733, 2739, 2747, 2753, 2761, 2769, + + /* 701-800 */ + 2777, 2785, 2793, 2801, 2809, 2817, 2825, 2833, 2841, 2848, + 2856, 2864, 2872, 2878, 2884, 2892, 2898, 2906, 2914, 2922, + 2930, 2938, 2944, 2952, 2958, 2966, 2974, 2982, 2988, 2996, + 3001, 3009, 3017, 3025, 3032, 3039, 3045, 3052, 3059, 3067, + 3069, 3076, 3083, 3090, 3098, 3105, 3109, 3111, 3113, 3120, + 3124, 3128, 3132, 3136, 3140, 3144, 3146, 3150, 3158, 3161, + 3165, 3166, 3168, 3172, 3176, 3180, 3182, 3185, 3189, 3193, + 3194, 3197, 3200, 3204, 3208, 3212, 3216, 3219, 3221, 3222, + 3226, 3230, 3234, 3238, 3242, 3243, 3247, 3251, 3254, 3258, + 3262, 3266, 3270, 3274, 3275, 3279, 3283, 3287, 3289, 3293, + + /* 801-900 */ + 3296, 3300, 3303, 3307, 3311, 3315, 3319, 3321, 3324, 3327, + 3330, 3334, 3338, 3340, 3342, 3346, 3350, 3354, 3358, 3361, + 3365, 3369, 3373, 3377, 3381, 3385, 3389, 3393, 3394, 3398, + 3402, 3406, 3410, 3413, 3417, 3421, 3425, 3429, 3433, 3435, + 3439, 3443, 3446, 3450, 3453, 3457, 3458, 3461, 3464, 3468, + 3472, 3476, 3478, 3481, 3485, 3489, 3493, 3497, 3501, 3505, + 3507, 3511, 3514, 3517, 3521, 3524, 3525, 3527, 3529, 3533, + 3536, 3540, 3541, 3545, 3548, 3551, 3555, 3559, 3563, 3567, + 3569, 3570, 3574, 3576, 3578, 3582, 3586, 3590, 3593, 3596, + 3600, 3604, 3608, 3612, 3616, 3620, 3623, 3626, 3630, 3632, + + /* 901-1000 */ + 3636, 3640, 3643, 3646, 3648, 3652, 3656, 3660, 3664, 3667, + 3669, 3671, 3675, 3679, 3683, 3687, 3689, 3693, 3694, 3695, + 3699, 3703, 3705, 3707, 3710, 3713, 3717, 3721, 3725, 3729, + 3733, 3736, 3740, 3744, 3748, 3752, 3754, 3757, 3759, 3763, + 3767, 3770, 3773, 3777, 3779, 3783, 3786, 3790, 3794, 3798, + 3801, 3805, 3809, 3813, 3817, 3821, 3825, 3827, 3831, 3835, + 3836, 3837, 3840, 3844, 3848, 3852, 3856, 3859, 3863, 3867, + 3869, 3871, 3875, 3879, 3883, 3887, 3890, 3894, 3898, 3901, + 3905, 3909, 3913, 3917, 3921, 3922, 3923, 3924, 3926, 3930, + 3932, 3936, 3938, 3940, 3944, 3948, 3952, 3956, 3959, 3963, + + /* 1001-1100 */ + 3965, 3969, 3973, 3977, 3979, 3981, 3982, 3986, 3989, 3993, + 3997, 4001, 4004, 4006, 4009, 4012, 4016, 4020, 4024, 4026, + 4028, 4032, 4036, 4040, 4044, 4046, 4050, 4054, 4058, 4060, + 4062, 4063, 4064, 4068, 4071, 4075, 4077, 4081, 4083, 4087, + 4089, 4091, 4095, 4099, 4101, 4103, 4105, 4107, 4111, 4115, + 4119, 4123, 4127, 4129, 4131, 4135, 4139, 4141, 4143, 4145, + 4149, 4153, 4157, 4161, 4165, 4169, 4173, 4177, 4180, 4183, + 4187, 4191, 4195, 4198, 4201, 4205, 4209, 4212, 4213, 4216, + 4217, 4221, 4223, 4226, 4230, 4234, 4236, 4240, 4244, 4248, + 4252, 4256, 4258, 4262, 4264, 4266, 4268, 4270, 4272, 4276, + + /* 1101-1200 */ + 4279, 4283, 4285, 4287, 4289, 4293, 4295, 4299, 4300, 4301, + 4305, 4309, 4313, 4317, 4319, 4323, 4325, 4329, 4331, 4333, + 4335, 4337, 4341, 4345, 4349, 4351, 4353, 4357, 4361, 4365, + 4367, 4369, 4373, 4377, 4381, 4383, 4387, 4389, 4391, 4395, + 4399, 4403, 4407, 4411, 4413, 4414, 4415, 4418, 4419, 4421, + 4423, 4427, 4429, 4431, 4433, 4435, 4437, 4439, 4443, 4446, + 4450, 4452, 4456, 4458, 4460, 4462, 4466, 4469, 4473, 4477, + 4481, 4483, 4487, 4489, 4491, 4493, 4497, 4499, 4501, 4504, + 4506, 4510, 4513, 4514, 4515, 4518, 4521, 4522, 4525, 4526, + 4527, 4530, 4533, 4534, 4537, 4541, 4542, 4543, 4544, 4545, + + /* 1201-1300 */ + 4546, 4547, 4550, 4553, 4554, 4555, 4558, 4561, 4564, 4567, + 4568, 4571, 4574, 4575, 4578, 4581, 4582, 4585, 4586, 4588, + 4590, 4592, 4596, 4598, 4602, 4604, 4608, 4612, 4613, 4616, + 4619, 4622, 4623, 4624, 4625, 4626, 4629, 4632, 4633, 4636, + 4639, 4640, 4641, 4642, 4643, 4644, 4645, 4648, 4649, 4650, + 4651, 4652, 4653, 4656, 4657, 4660, 4661, 4664, 4667, 4670, + 4671, 4674, 4675, 4676, 4677, 4678, 4681, 4682, 4683, 4684, + 4687, 4688, 4689, 4692, 4693, 4696, 4697, 4700, 4701, 4702, + 4703, 4704, 4707, 4708, 4711, 4712, 4715, 4716, 4717, 4718, + 4719, 4720, 4721, 4722, 4723, 4726, 4729, 4730, 4733, 4736, + + /* 1301-(NFLS+NFPL) */ + 4737, 4740, 4741, 4742, 4745, 4746, 4749, 4752, 4753 + }; + +/* Amplitude coefficients (microarcsec); indexed using the nc array. */ + static const double a[] = { + + /* 1-105 */ + -6844318.44, 9205236.26,1328.67,1538.18, 205833.11, + 153041.79, -3309.73, 853.32,2037.98, -2301.27, + 81.46, 120.56, -20.39, -15.22, 1.73, -1.61, -0.10, 0.11, + -0.02, -0.02, -523908.04, 573033.42,-544.75,-458.66, + 12814.01, 11714.49, 198.97,-290.91, 155.74,-143.27, + -2.75, -1.03, -1.27, -1.16, 0.00, -0.01, -90552.22, + 97846.69, 111.23, 137.41,2187.91,2024.68, 41.44, -51.26, + 26.92, -24.46, -0.46, -0.28, -0.22, -0.20, 82168.76, + -89618.24, -27.64, -29.05, -2004.36, -1837.32, + -36.07, 48.00, -24.43, 22.41, 0.47, 0.24, 0.20, 0.18, + 58707.02,7387.02, 470.05,-192.40, 164.33, -1312.21, + -179.73, -28.93, -17.36, -1.83, -0.50, 3.57, 0.00, 0.13, + -20557.78, 22438.42, -20.84, -17.40, 501.82, 459.68, + 59.20, -67.30, 6.08, -5.61, -1.36, -1.19, 28288.28, + -674.99, -34.69, 35.80, -15.07,-632.54, -11.19, 0.78, -8.41, + 0.17, 0.01, 0.07, -15406.85, 20069.50, 15.12, + + /* 106-219 */ + 31.80, 448.76, 344.50, -5.77, 1.41, 4.59, -5.02, 0.17, + 0.24, -11991.74, 12902.66, 32.46, 36.70, 288.49, + 268.14, 5.70, -7.06, 3.57, -3.23, -0.06, -0.04, + -8584.95, -9592.72, 4.42, -13.20,-214.50, 192.06, + 23.87, 29.83, 2.54, 2.40, 0.60, -0.48,5095.50, + -6918.22, 7.19, 3.92,-154.91,-113.94, 2.86, -1.04, + -1.52, 1.73, -0.07, -0.10, -4910.93, -5331.13, + 0.76, 0.40,-119.21, 109.81, 2.16, 3.20, 1.46, 1.33, + 0.04, -0.02, -6245.02,-123.48, -6.68, -8.20, -2.76, + 139.64, 2.71, 0.15, 1.86,2511.85, -3323.89, 1.07, + -0.90, -74.33, -56.17, 1.16, -0.01, -0.75, 0.83, -0.02, + -0.04,2307.58,3143.98, -7.52, 7.50, 70.31, -51.60, 1.46, + 0.16, -0.69, -0.79, 0.02, -0.05,2372.58,2554.51, 5.93, + -6.60, 57.12, -53.05, -0.96, -1.24, -0.71, -0.64, -0.01, + -2053.16,2636.13, 5.13, 7.80, 58.94, 45.91, -0.42, + -0.12, 0.61, -0.66, 0.02, 0.03, -1825.49, + + /* 220-339 */ + -2423.59, 1.23, -2.00, -54.19, 40.82, -1.07, -1.02, + 0.54, 0.61, -0.04, 0.04,2521.07,-122.28, -5.97, 2.90, + -2.73, -56.37, -0.82, 0.13, -0.75, -1534.09,1645.01, + 6.29, 6.80, 36.78, 34.30, 0.92, -1.25, 0.46, -0.41, + -0.02, -0.01,1898.27, 47.70, -0.72, 2.50, 1.07, -42.45, + -0.94, 0.02, -0.56, -1292.02, -1387.00, 0.00, + 0.00, -31.01, 28.89, 0.68, 0.00, 0.38, 0.35, -0.01, + -0.01, -1234.96,1323.81, 5.21, 5.90, 29.60, 27.61, + 0.74, -1.22, 0.37, -0.33, -0.02, -0.01,1137.48, + -1233.89, -0.04, -0.30, -27.59, -25.43, -0.61, 1.00, + -0.34, 0.31, 0.01, 0.01,-813.13, -1075.60, 0.40, + 0.30, -24.05, 18.18, -0.40, -0.01, 0.24, 0.27, -0.01, + 0.01,1163.22, -60.90, -2.94, 1.30, -1.36, -26.01, -0.58, + 0.07, -0.35,1029.70, -55.55, -2.63, 1.10, -1.25, -23.02, + -0.52, 0.06, -0.31,-556.26, 852.85, 3.16, -4.48, 19.06, + 12.44, -0.81, -0.27, 0.17, -0.21, 0.00, 0.02,-603.52, + + /* 340-467 */ + -800.34, 0.44, 0.10, -17.90, 13.49, -0.08, -0.01, 0.18, + 0.20, -0.01, 0.01,-628.24, 684.99, -0.64, -0.50, 15.32, + 14.05, 3.18, -4.19, 0.19, -0.17, -0.09, -0.07,-866.48, + -16.26, 0.52, -1.30, -0.36, 19.37, 0.43, -0.01, 0.26, + -512.37, 695.54, -1.47, -1.40, 15.55, 11.46, -0.16, 0.03, + 0.15, -0.17, 0.01, 0.01, 506.65, 643.75, 2.54, -2.62, + 14.40, -11.33, -0.77, -0.06, -0.15, -0.16, 0.00, 0.01, + 664.57, 16.81, -0.40, 1.00, 0.38, -14.86, -3.71, -0.09, + -0.20, 405.91, 522.11, 0.99, -1.50, 11.67, -9.08, -0.25, + -0.02, -0.12, -0.13,-305.78, 326.60, 1.75, 1.90, 7.30, + 6.84, 0.20, -0.04, 300.99,-325.03, -0.44, -0.50, -7.27, + -6.73, -1.01, 0.01, 0.00, 0.08, 0.00, 0.02, 438.51, + 10.47, -0.56, -0.20, 0.24, -9.81, -0.24, 0.01, -0.13, + -264.02, 335.24, 0.99, 1.40, 7.49, 5.90, -0.27, -0.02, + 284.09, 307.03, 0.32, -0.40, 6.87, -6.35, -0.99, -0.01, + -250.54, 327.11, 0.08, 0.40, 7.31, 5.60, -0.30, 230.72, + + /* 468-595 */ + -304.46, 0.08, -0.10, -6.81, -5.16, 0.27, 229.78, 304.17, + -0.60, 0.50, 6.80, -5.14, 0.33, 0.01, 256.30,-276.81, + -0.28, -0.40, -6.19, -5.73, -0.14, 0.01,-212.82, 269.45, + 0.84, 1.20, 6.02, 4.76, 0.14, -0.02, 196.64, 272.05, + -0.84, 0.90, 6.08, -4.40, 0.35, 0.02, 188.95, 272.22, + -0.12, 0.30, 6.09, -4.22, 0.34,-292.37, -5.10, -0.32, + -0.40, -0.11, 6.54, 0.14, 0.01, 161.79,-220.67, 0.24, + 0.10, -4.93, -3.62, -0.08, 261.54, -19.94, -0.95, 0.20, + -0.45, -5.85, -0.13, 0.02, 142.16,-190.79, 0.20, 0.10, + -4.27, -3.18, -0.07, 187.95, -4.11, -0.24, 0.30, -0.09, + -4.20, -0.09, 0.01, 0.00, 0.00, -79.08, 167.90, 0.04, + 0.00, 3.75, 1.77, 121.98, 131.04, -0.08, 0.10, 2.93, + -2.73, -0.06,-172.95, -8.11, -0.40, -0.20, -0.18, 3.87, + 0.09, 0.01,-160.15, -55.30, -14.04, 13.90, -1.23, 3.58, + 0.40, 0.31,-115.40, 123.20, 0.60, 0.70, 2.75, 2.58, + 0.08, -0.01,-168.26, -2.00, 0.20, -0.20, -0.04, 3.76, + + /* 596-723 */ + 0.08,-114.49, 123.20, 0.32, 0.40, 2.75, 2.56, 0.07, + -0.01, 112.14, 120.70, 0.28, -0.30, 2.70, -2.51, -0.07, + -0.01, 161.34, 4.03, 0.20, 0.20, 0.09, -3.61, -0.08, + 91.31, 126.64, -0.40, 0.40, 2.83, -2.04, -0.04, 0.01, + 105.29, 112.90, 0.44, -0.50, 2.52, -2.35, -0.07, -0.01, + 98.69,-106.20, -0.28, -0.30, -2.37, -2.21, -0.06, 0.01, + 86.74,-112.94, -0.08, -0.20, -2.53, -1.94, -0.05,-134.81, + 3.51, 0.20, -0.20, 0.08, 3.01, 0.07, 79.03, 107.31, + -0.24, 0.20, 2.40, -1.77, -0.04, 0.01, 132.81, -10.77, + -0.52, 0.10, -0.24, -2.97, -0.07, 0.01,-130.31, -0.90, + 0.04, 0.00, 0.00, 2.91, -78.56, 85.32, 0.00, 0.00, + 1.91, 1.76, 0.04, 0.00, 0.00, -41.53, 89.10, 0.02, + 0.00, 1.99, 0.93, 66.03, -71.00, -0.20, -0.20, -1.59, + -1.48, -0.04, 60.50, 64.70, 0.36, -0.40, 1.45, -1.35, + -0.04, -0.01, -52.27, -70.01, 0.00, 0.00, -1.57, 1.17, + 0.03, -52.95, 66.29, 0.32, 0.40, 1.48, 1.18, 0.04, + + /* 724-851 */ + -0.01, 51.02, 67.25, 0.00, 0.00, 1.50, -1.14, -0.03, + -55.66, -60.92, 0.16, -0.20, -1.36, 1.24, 0.03, -54.81, + -59.20, -0.08, 0.20, -1.32, 1.23, 0.03, 51.32, -55.60, + 0.00, 0.00, -1.24, -1.15, -0.03, 48.29, 51.80, 0.20, + -0.20, 1.16, -1.08, -0.03, -45.59, -49.00, -0.12, 0.10, + -1.10, 1.02, 0.03, 40.54, -52.69, -0.04, -0.10, -1.18, + -0.91, -0.02, -40.58, -49.51, -1.00, 1.00, -1.11, 0.91, + 0.04, 0.02, -43.76, 46.50, 0.36, 0.40, 1.04, 0.98, + 0.03, -0.01, 62.65, -5.00, -0.24, 0.00, -0.11, -1.40, + -0.03, 0.01, -38.57, 49.59, 0.08, 0.10, 1.11, 0.86, + 0.02, -33.22, -44.04, 0.08, -0.10, -0.98, 0.74, 0.02, + 37.15, -39.90, -0.12, -0.10, -0.89, -0.83, -0.02, 36.68, + -39.50, -0.04, -0.10, -0.88, -0.82, -0.02, -53.22, -3.91, + -0.20, 0.00, -0.09, 1.19, 0.03, 32.43, -42.19, -0.04, + -0.10, -0.94, -0.73, -0.02, -51.00, -2.30, -0.12, -0.10, + 0.00, 1.14, -29.53, -39.11, 0.04, 0.00, -0.87, 0.66, + + /* 852-979 */ + 0.02, 28.50, -38.92, -0.08, -0.10, -0.87, -0.64, -0.02, + 26.54, 36.95, -0.12, 0.10, 0.83, -0.59, -0.01, 26.54, + 34.59, 0.04, -0.10, 0.77, -0.59, -0.02, 28.35, -32.55, + -0.16, 0.20, -0.73, -0.63, -0.01, -28.00, 30.40, 0.00, + 0.00, 0.68, 0.63, 0.01, -27.61, 29.40, 0.20, 0.20, + 0.66, 0.62, 0.02, 40.33, 0.40, -0.04, 0.10, 0.00, + -0.90, -23.28, 31.61, -0.08, -0.10, 0.71, 0.52, 0.01, + 37.75, 0.80, 0.04, 0.10, 0.00, -0.84, 23.66, 25.80, + 0.00, 0.00, 0.58, -0.53, -0.01, 21.01, -27.91, 0.00, + 0.00, -0.62, -0.47, -0.01, -34.81, 2.89, 0.04, 0.00, + 0.00, 0.78, -23.49, -25.31, 0.00, 0.00, -0.57, 0.53, + 0.01, -23.47, 25.20, 0.16, 0.20, 0.56, 0.52, 0.02, + 19.58, 27.50, -0.12, 0.10, 0.62, -0.44, -0.01, -22.67, + -24.40, -0.08, 0.10, -0.55, 0.51, 0.01, -19.97, 25.00, + 0.12, 0.20, 0.56, 0.45, 0.01, 21.28, -22.80, -0.08, + -0.10, -0.51, -0.48, -0.01, -30.47, 0.91, 0.04, 0.00, + + /* 980-1107 */ + 0.00, 0.68, 18.58, 24.00, 0.04, -0.10, 0.54, -0.42, + -0.01, -18.02, 24.40, -0.04, -0.10, 0.55, 0.40, 0.01, + 17.74, 22.50, 0.08, -0.10, 0.50, -0.40, -0.01, -19.41, + 20.70, 0.08, 0.10, 0.46, 0.43, 0.01, -18.64, 20.11, + 0.00, 0.00, 0.45, 0.42, 0.01, -16.75, 21.60, 0.04, + 0.10, 0.48, 0.37, 0.01, -18.42, -20.00, 0.00, 0.00, + -0.45, 0.41, 0.01, -26.77, 1.41, 0.08, 0.00, 0.00, + 0.60, -26.17, -0.19, 0.00, 0.00, 0.00, 0.59, -15.52, + 20.51, 0.00, 0.00, 0.46, 0.35, 0.01, -25.42, -1.91, + -0.08, 0.00, -0.04, 0.57, 0.45, -17.42, 18.10, 0.00, + 0.00, 0.40, 0.39, 0.01, 16.39, -17.60, -0.08, -0.10, + -0.39, -0.37, -0.01, -14.37, 18.91, 0.00, 0.00, 0.42, + 0.32, 0.01, 23.39, -2.40, -0.12, 0.00, 0.00, -0.52, + 14.32, -18.50, -0.04, -0.10, -0.41, -0.32, -0.01, 15.69, + 17.08, 0.00, 0.00, 0.38, -0.35, -0.01, -22.99, 0.50, + 0.04, 0.00, 0.00, 0.51, 0.00, 0.00, 14.47, -17.60, + + /* 1108-1235 */ + -0.01, 0.00, -0.39, -0.32, -13.33, 18.40, -0.04, -0.10, + 0.41, 0.30, 22.47, -0.60, -0.04, 0.00, 0.00, -0.50, + -12.78, -17.41, 0.04, 0.00, -0.39, 0.29, 0.01, -14.10, + -15.31, 0.04, 0.00, -0.34, 0.32, 0.01, 11.98, 16.21, + -0.04, 0.00, 0.36, -0.27, -0.01, 19.65, -1.90, -0.08, + 0.00, 0.00, -0.44, 19.61, -1.50, -0.08, 0.00, 0.00, + -0.44, 13.41, -14.30, -0.04, -0.10, -0.32, -0.30, -0.01, + -13.29, 14.40, 0.00, 0.00, 0.32, 0.30, 0.01, 11.14, + -14.40, -0.04, 0.00, -0.32, -0.25, -0.01, 12.24, -13.38, + 0.04, 0.00, -0.30, -0.27, -0.01, 10.07, -13.81, 0.04, + 0.00, -0.31, -0.23, -0.01, 10.46, 13.10, 0.08, -0.10, + 0.29, -0.23, -0.01, 16.55, -1.71, -0.08, 0.00, 0.00, + -0.37, 9.75, -12.80, 0.00, 0.00, -0.29, -0.22, -0.01, + 9.11, 12.80, 0.00, 0.00, 0.29, -0.20, 0.00, 0.00, + -6.44, -13.80, 0.00, 0.00, -0.31, 0.14, -9.19, -12.00, + 0.00, 0.00, -0.27, 0.21, -10.30, 10.90, 0.08, 0.10, + + /* 1236-1363 */ + 0.24, 0.23, 0.01, 14.92, -0.80, -0.04, 0.00, 0.00, + -0.33, 10.02, -10.80, 0.00, 0.00, -0.24, -0.22, -0.01, + -9.75, 10.40, 0.04, 0.00, 0.23, 0.22, 0.01, 9.67, + -10.40, -0.04, 0.00, -0.23, -0.22, -0.01, -8.28, -11.20, + 0.04, 0.00, -0.25, 0.19, 13.32, -1.41, -0.08, 0.00, + 0.00, -0.30, 8.27, 10.50, 0.04, 0.00, 0.23, -0.19, + 0.00, 0.00, 13.13, 0.00, 0.00, 0.00, 0.00, -0.29, + -12.93, 0.70, 0.04, 0.00, 0.00, 0.29, 7.91, -10.20, + 0.00, 0.00, -0.23, -0.18, -7.84, -10.00, -0.04, 0.00, + -0.22, 0.18, 7.44, 9.60, 0.00, 0.00, 0.21, -0.17, + -7.64, 9.40, 0.08, 0.10, 0.21, 0.17, 0.01, -11.38, + 0.60, 0.04, 0.00, 0.00, 0.25, -7.48, 8.30, 0.00, + 0.00, 0.19, 0.17, -10.98, -0.20, 0.00, 0.00, 0.00, + 0.25, 10.98, 0.20, 0.00, 0.00, 0.00, -0.25, 7.40, + -7.90, -0.04, 0.00, -0.18, -0.17, -6.09, 8.40, -0.04, + 0.00, 0.19, 0.14, -6.94, -7.49, 0.00, 0.00, -0.17, + + /* 1364-1491 */ + 0.16, 6.92, 7.50, 0.04, 0.00, 0.17, -0.15, 6.20, + 8.09, 0.00, 0.00, 0.18, -0.14, -6.12, 7.80, 0.04, + 0.00, 0.17, 0.14, 5.85, -7.50, 0.00, 0.00, -0.17, + -0.13, -6.48, 6.90, 0.08, 0.10, 0.15, 0.14, 0.01, + 6.32, 6.90, 0.00, 0.00, 0.15, -0.14, 5.61, -7.20, + 0.00, 0.00, -0.16, -0.13, 9.07, 0.00, 0.00, 0.00, + 0.00, -0.20, 5.25, 6.90, 0.00, 0.00, 0.15, -0.12, + -8.47, -0.40, 0.00, 0.00, 0.00, 0.19, 6.32, -5.39, + -1.11, 1.10, -0.12, -0.14, 0.02, 0.02, 5.73, -6.10, + -0.04, 0.00, -0.14, -0.13, 4.70, 6.60, -0.04, 0.00, + 0.15, -0.11, -4.90, -6.40, 0.00, 0.00, -0.14, 0.11, + -5.33, 5.60, 0.04, 0.10, 0.13, 0.12, 0.01, -4.81, + 6.00, 0.04, 0.00, 0.13, 0.11, 5.13, 5.50, 0.04, + 0.00, 0.12, -0.11, 4.50, 5.90, 0.00, 0.00, 0.13, + -0.10, -4.22, 6.10, 0.00, 0.00, 0.14, -4.53, 5.70, + 0.00, 0.00, 0.13, 0.10, 4.18, 5.70, 0.00, 0.00, + + /* 1492-1619 */ + 0.13, -4.75, -5.19, 0.00, 0.00, -0.12, 0.11, -4.06, + 5.60, 0.00, 0.00, 0.13, -3.98, 5.60, -0.04, 0.00, + 0.13, 4.02, -5.40, 0.00, 0.00, -0.12, 4.49, -4.90, + -0.04, 0.00, -0.11, -0.10, -3.62, -5.40, -0.16, 0.20, + -0.12, 0.00, 0.01, 4.38, 4.80, 0.00, 0.00, 0.11, + -6.40, -0.10, 0.00, 0.00, 0.00, 0.14, -3.98, 5.00, + 0.04, 0.00, 0.11, -3.82, -5.00, 0.00, 0.00, -0.11, + -3.71, 5.07, 0.00, 0.00, 0.11, 4.14, 4.40, 0.00, + 0.00, 0.10, -6.01, -0.50, -0.04, 0.00, 0.00, 0.13, + -4.04, 4.39, 0.00, 0.00, 0.10, 3.45, -4.72, 0.00, + 0.00, -0.11, 3.31, 4.71, 0.00, 0.00, 0.11, 3.26, + -4.50, 0.00, 0.00, -0.10, -3.26, -4.50, 0.00, 0.00, + -0.10, -3.34, -4.40, 0.00, 0.00, -0.10, -3.74, -4.00, + 3.70, 4.00, 3.34, -4.30, 3.30, -4.30, -3.66, 3.90, + 0.04, 3.66, 3.90, 0.04, -3.62, -3.90, -3.61, 3.90, + -0.20, 5.30, 0.00, 0.00, 0.12, 3.06, 4.30, 3.30, + + /* 1620-1747 */ + 4.00, 0.40, 0.20, 3.10, 4.10, -3.06, 3.90, -3.30, + -3.60, -3.30, 3.36, 0.01, 3.14, 3.40, -4.57, -0.20, + 0.00, 0.00, 0.00, 0.10, -2.70, -3.60, 2.94, -3.20, + -2.90, 3.20, 2.47, -3.40, 2.55, -3.30, 2.80, -3.08, + 2.51, 3.30, -4.10, 0.30, -0.12, -0.10, 4.10, 0.20, + -2.74, 3.00, 2.46, 3.23, -3.66, 1.20, -0.20, 0.20, + 3.74, -0.40, -2.51, -2.80, -3.74, 2.27, -2.90, 0.00, + 0.00, -2.50, 2.70, -2.51, 2.60, -3.50, 0.20, 3.38, + -2.22, -2.50, 3.26, -0.40, 1.95, -2.60, 3.22, -0.40, + -0.04, -1.79, -2.60, 1.91, 2.50, 0.74, 3.05, -0.04, + 0.08, 2.11, -2.30, -2.11, 2.20, -1.87, -2.40, 2.03, + -2.20, -2.03, 2.20, 2.98, 0.00, 0.00, 2.98, -1.71, + 2.40, 2.94, -0.10, -0.12, 0.10, 1.67, 2.40, -1.79, + 2.30, -1.79, 2.20, -1.67, 2.20, 1.79, -2.00, 1.87, + -1.90, 1.63, -2.10, -1.59, 2.10, 1.55, -2.10, -1.55, + 2.10, -2.59, -0.20, -1.75, -1.90, -1.75, 1.90, -1.83, + + /* 1748-1875 */ + -1.80, 1.51, 2.00, -1.51, -2.00, 1.71, 1.80, 1.31, + 2.10, -1.43, 2.00, 1.43, 2.00, -2.43, -1.51, 1.90, + -1.47, 1.90, 2.39, 0.20, -2.39, 1.39, 1.90, 1.39, + -1.80, 1.47, -1.60, 1.47, -1.60, 1.43, -1.50, -1.31, + 1.60, 1.27, -1.60, -1.27, 1.60, 1.27, -1.60, 2.03, + 1.35, 1.50, -1.39, -1.40, 1.95, -0.20, -1.27, 1.49, + 1.19, 1.50, 1.27, 1.40, 1.15, 1.50, 1.87, -0.10, + -1.12, -1.50, 1.87, -1.11, -1.50, -1.11, -1.50, 0.00, + 0.00, 1.19, 1.40, 1.27, -1.30, -1.27, -1.30, -1.15, + 1.40, -1.23, 1.30, -1.23, -1.30, 1.22, -1.29, 1.07, + -1.40, 1.75, -0.20, -1.03, -1.40, -1.07, 1.20, -1.03, + 1.15, 1.07, 1.10, 1.51, -1.03, 1.10, 1.03, -1.10, + 0.00, 0.00, -1.03, -1.10, 0.91, -1.20, -0.88, -1.20, + -0.88, 1.20, -0.95, 1.10, -0.95, -1.10, 1.43, -1.39, + 0.95, -1.00, -0.95, 1.00, -0.80, 1.10, 0.91, -1.00, + -1.35, 0.88, 1.00, -0.83, 1.00, -0.91, 0.90, 0.91, + + /* 1876-2003 */ + 0.90, 0.88, -0.90, -0.76, -1.00, -0.76, 1.00, 0.76, + 1.00, -0.72, 1.00, 0.84, -0.90, 0.84, 0.90, 1.23, + 0.00, 0.00, -0.52, -1.10, -0.68, 1.00, 1.19, -0.20, + 1.19, 0.76, 0.90, 1.15, -0.10, 1.15, -0.10, 0.72, + -0.90, -1.15, -1.15, 0.68, 0.90, -0.68, 0.90, -1.11, + 0.00, 0.00, 0.20, 0.79, 0.80, -1.11, -0.10, 0.00, + 0.00, -0.48, -1.00, -0.76, -0.80, -0.72, -0.80, -1.07, + -0.10, 0.64, 0.80, -0.64, -0.80, 0.64, 0.80, 0.40, + 0.60, 0.52, -0.50, -0.60, -0.80, -0.71, 0.70, -0.99, + 0.99, 0.56, 0.80, -0.56, 0.80, 0.68, -0.70, 0.68, + 0.70, -0.95, -0.64, 0.70, 0.64, 0.70, -0.60, 0.70, + -0.60, -0.70, -0.91, -0.10, -0.51, 0.76, -0.91, -0.56, + 0.70, 0.88, 0.88, -0.63, -0.60, 0.55, -0.60, -0.80, + 0.80, -0.80, -0.52, 0.60, 0.52, 0.60, 0.52, -0.60, + -0.48, 0.60, 0.48, 0.60, 0.48, 0.60, -0.76, 0.44, + -0.60, 0.52, -0.50, -0.52, 0.50, 0.40, 0.60, -0.40, + + /* 2004-2131 */ + -0.60, 0.40, -0.60, 0.72, -0.72, -0.51, -0.50, -0.48, + 0.50, 0.48, -0.50, -0.48, 0.50, -0.48, 0.50, 0.48, + -0.50, -0.48, -0.50, -0.68, -0.68, 0.44, 0.50, -0.64, + -0.10, -0.64, -0.10, -0.40, 0.50, 0.40, 0.50, 0.40, + 0.50, 0.00, 0.00, -0.40, -0.50, -0.36, -0.50, 0.36, + -0.50, 0.60, -0.60, 0.40, -0.40, 0.40, 0.40, -0.40, + 0.40, -0.40, 0.40, -0.56, -0.56, 0.36, -0.40, -0.36, + 0.40, 0.36, -0.40, -0.36, -0.40, 0.36, 0.40, 0.36, + 0.40, -0.52, 0.52, 0.52, 0.32, 0.40, -0.32, 0.40, + -0.32, 0.40, -0.32, 0.40, 0.32, -0.40, -0.32, -0.40, + 0.32, -0.40, 0.28, -0.40, -0.28, 0.40, 0.28, -0.40, + 0.28, 0.40, 0.48, -0.48, 0.48, 0.36, -0.30, -0.36, + -0.30, 0.00, 0.00, 0.20, 0.40, -0.44, 0.44, -0.44, + -0.44, -0.44, -0.44, 0.32, -0.30, 0.32, 0.30, 0.24, + 0.30, -0.12, -0.10, -0.28, 0.30, 0.28, 0.30, 0.28, + 0.30, 0.28, -0.30, 0.28, -0.30, 0.28, -0.30, 0.28, + + /* 2132-2259 */ + 0.30, -0.28, 0.30, 0.40, 0.40, -0.24, 0.30, 0.24, + -0.30, 0.24, -0.30, -0.24, -0.30, 0.24, 0.30, 0.24, + -0.30, -0.24, 0.30, 0.24, -0.30, -0.24, -0.30, 0.24, + -0.30, 0.24, 0.30, -0.24, 0.30, -0.24, 0.30, 0.20, + -0.30, 0.20, -0.30, 0.20, -0.30, 0.20, 0.30, 0.20, + -0.30, 0.20, -0.30, 0.20, 0.30, 0.20, 0.30, -0.20, + -0.30, 0.20, -0.30, 0.20, -0.30, -0.36, -0.36, -0.36, + -0.04, 0.30, 0.12, -0.10, -0.32, -0.24, 0.20, 0.24, + 0.20, 0.20, -0.20, -0.20, -0.20, -0.20, -0.20, 0.20, + 0.20, 0.20, -0.20, 0.20, 0.20, 0.20, 0.20, -0.20, + -0.20, 0.00, 0.00, -0.20, -0.20, -0.20, 0.20, -0.20, + 0.20, 0.20, -0.20, -0.20, -0.20, 0.20, 0.20, 0.20, + 0.20, 0.20, -0.20, 0.20, -0.20, 0.28, 0.28, 0.28, + 0.28, 0.28, 0.28, -0.28, 0.28, 0.12, 0.00, 0.24, + 0.16, -0.20, 0.16, -0.20, 0.16, -0.20, 0.16, 0.20, + -0.16, 0.20, 0.16, 0.20, -0.16, 0.20, -0.16, 0.20, + + /* 2260-2387 */ + -0.16, 0.20, 0.16, -0.20, 0.16, 0.20, 0.16, -0.20, + -0.16, 0.20, -0.16, -0.20, -0.16, 0.20, 0.16, 0.20, + 0.16, -0.20, 0.16, -0.20, 0.16, 0.20, 0.16, 0.20, + 0.16, 0.20, -0.16, -0.20, 0.16, 0.20, -0.16, 0.20, + 0.16, 0.20, -0.16, -0.20, 0.16, -0.20, 0.16, -0.20, + -0.16, -0.20, 0.24, -0.24, -0.24, 0.24, 0.24, 0.12, + 0.20, 0.12, 0.20, -0.12, -0.20, 0.12, -0.20, 0.12, + -0.20, -0.12, 0.20, -0.12, 0.20, -0.12, -0.20, 0.12, + 0.20, 0.12, 0.20, 0.12, -0.20, -0.12, 0.20, 0.12, + -0.20, -0.12, 0.20, 0.12, 0.20, 0.00, 0.00, -0.12, + 0.20, -0.12, 0.20, 0.12, -0.20, -0.12, 0.20, 0.12, + 0.20, 0.00, -0.21, -0.20, 0.00, 0.00, 0.20, -0.20, + -0.20, -0.20, 0.20, -0.16, -0.10, 0.00, 0.17, 0.16, + 0.16, 0.16, 0.16, -0.16, 0.16, 0.16, -0.16, 0.16, + -0.16, 0.16, 0.12, 0.10, 0.12, -0.10, -0.12, 0.10, + -0.12, 0.10, 0.12, -0.10, -0.12, 0.12, -0.12, 0.12, + + /* 2388-2515 */ + -0.12, 0.12, -0.12, -0.12, -0.12, -0.12, -0.12, -0.12, + -0.12, 0.12, 0.12, 0.12, 0.12, -0.12, -0.12, 0.12, + 0.12, 0.12, -0.12, 0.12, -0.12, -0.12, -0.12, 0.12, + -0.12, -0.12, 0.12, 0.00, 0.11, 0.11,-122.67, 164.70, + 203.78, 273.50, 3.58, 2.74, 6.18, -4.56, 0.00, -0.04, + 0.00, -0.07, 57.44, -77.10, 95.82, 128.60, -1.77, -1.28, + 2.85, -2.14, 82.14, 89.50, 0.00, 0.00, 2.00, -1.84, + -0.04, 47.73, -64.10, 23.79, 31.90, -1.45, -1.07, 0.69, + -0.53, -46.38, 50.50, 0.00, 0.00, 1.13, 1.04, 0.02, + -18.38, 0.00, 63.80, 0.00, 0.00, 0.41, 0.00, -1.43, + 59.07, 0.00, 0.00, 0.00, 0.00, -1.32, 57.28, 0.00, + 0.00, 0.00, 0.00, -1.28, -48.65, 0.00, -1.15, 0.00, + 0.00, 1.09, 0.00, 0.03, -18.30, 24.60, -17.30, -23.20, + 0.56, 0.41, -0.51, 0.39, -16.91, 26.90, 8.43, 13.30, + 0.60, 0.38, 0.31, -0.19, 1.23, -1.70, -19.13, -25.70, + -0.03, -0.03, -0.58, 0.43, -0.72, 0.90, -17.34, -23.30, + + /* 2516-2643 */ + 0.03, 0.02, -0.52, 0.39, -19.49, -21.30, 0.00, 0.00, + -0.48, 0.44, 0.01, 20.57, -20.10, 0.64, 0.70, -0.45, + -0.46, 0.00, -0.01, 4.89, 5.90, -16.55, 19.90, 0.14, + -0.11, 0.44, 0.37, 18.22, 19.80, 0.00, 0.00, 0.44, + -0.41, -0.01, 4.89, -5.30, -16.51, -18.00, -0.11, -0.11, + -0.41, 0.37, -17.86, 0.00, 17.10, 0.00, 0.00, 0.40, + 0.00, -0.38, 0.32, 0.00, 24.42, 0.00, 0.00, -0.01, + 0.00, -0.55, -23.79, 0.00, 0.00, 0.00, 0.00, 0.53, + 14.72, -16.00, -0.32, 0.00, -0.36, -0.33, -0.01, 0.01, + 3.34, -4.50, 11.86, 15.90, -0.11, -0.07, 0.35, -0.27, + -3.26, 4.40, 11.62, 15.60, 0.09, 0.07, 0.35, -0.26, + -19.53, 0.00, 5.09, 0.00, 0.00, 0.44, 0.00, -0.11, + -13.48, 14.70, 0.00, 0.00, 0.33, 0.30, 0.01, 10.86, + -14.60, 3.18, 4.30, -0.33, -0.24, 0.09, -0.07, -11.30, + -15.10, 0.00, 0.00, -0.34, 0.25, 0.01, 2.03, -2.70, + 10.82, 14.50, -0.07, -0.05, 0.32, -0.24, 17.46, 0.00, + + /* 2644-2771 */ + 0.00, 0.00, 0.00, -0.39, 16.43, 0.00, 0.52, 0.00, + 0.00, -0.37, 0.00, -0.01, 9.35, 0.00, 13.29, 0.00, + 0.00, -0.21, 0.00, -0.30, -10.42, 11.40, 0.00, 0.00, + 0.25, 0.23, 0.01, 0.44, 0.50, -10.38, 11.30, 0.02, + -0.01, 0.25, 0.23, -14.64, 0.00, 0.00, 0.00, 0.00, + 0.33, 0.56, 0.80, -8.67, 11.70, 0.02, -0.01, 0.26, + 0.19, 13.88, 0.00, -2.47, 0.00, 0.00, -0.31, 0.00, + 0.06, -1.99, 2.70, 7.72, 10.30, 0.06, 0.04, 0.23, + -0.17, -0.20, 0.00, 13.05, 0.00, 0.00, 0.00, 0.00, + -0.29, 6.92, -9.30, 3.34, 4.50, -0.21, -0.15, 0.10, + -0.07, -6.60, 0.00, 10.70, 0.00, 0.00, 0.15, 0.00, + -0.24, -8.04, -8.70, 0.00, 0.00, -0.19, 0.18, -10.58, + 0.00, -3.10, 0.00, 0.00, 0.24, 0.00, 0.07, -7.32, + 8.00, -0.12, -0.10, 0.18, 0.16, 1.63, 1.70, 6.96, + -7.60, 0.03, -0.04, -0.17, -0.16, -3.62, 0.00, 9.86, + 0.00, 0.00, 0.08, 0.00, -0.22, 0.20, -0.20, -6.88, + + /* 2772-2899 */ + -7.50, 0.00, 0.00, -0.17, 0.15, -8.99, 0.00, 4.02, + 0.00, 0.00, 0.20, 0.00, -0.09, -1.07, 1.40, -5.69, + -7.70, 0.03, 0.02, -0.17, 0.13, 6.48, -7.20, -0.48, + -0.50, -0.16, -0.14, -0.01, 0.01, 5.57, -7.50, 1.07, + 1.40, -0.17, -0.12, 0.03, -0.02, 8.71, 0.00, 3.54, + 0.00, 0.00, -0.19, 0.00, -0.08, 0.40, 0.00, 9.27, + 0.00, 0.00, -0.01, 0.00, -0.21, -6.13, 6.70, -1.19, + -1.30, 0.15, 0.14, -0.03, 0.03, 5.21, -5.70, -2.51, + -2.60, -0.13, -0.12, -0.06, 0.06, 5.69, -6.20, -0.12, + -0.10, -0.14, -0.13, -0.01, 2.03, -2.70, 4.53, 6.10, + -0.06, -0.05, 0.14, -0.10, 5.01, 5.50, -2.51, 2.70, + 0.12, -0.11, 0.06, 0.06, -1.91, 2.60, -4.38, -5.90, + 0.06, 0.04, -0.13, 0.10, 4.65, -6.30, 0.00, 0.00, + -0.14, -0.10, -5.29, 5.70, 0.00, 0.00, 0.13, 0.12, + -2.23, -4.00, -4.65, 4.20, -0.09, 0.05, 0.10, 0.10, + -4.53, 6.10, 0.00, 0.00, 0.14, 0.10, 2.47, 2.70, + + /* 2900-3027 */ + -4.46, 4.90, 0.06, -0.06, 0.11, 0.10, -5.05, 5.50, + 0.84, 0.90, 0.12, 0.11, 0.02, -0.02, 4.97, -5.40, + -1.71, 0.00, -0.12, -0.11, 0.00, 0.04, -0.99, -1.30, + 4.22, -5.70, -0.03, 0.02, -0.13, -0.09, 0.99, 1.40, + 4.22, -5.60, 0.03, -0.02, -0.13, -0.09, -4.69, -5.20, + 0.00, 0.00, -0.12, 0.10, -3.42, 0.00, 6.09, 0.00, + 0.00, 0.08, 0.00, -0.14, -4.65, -5.10, 0.00, 0.00, + -0.11, 0.10, 0.00, 0.00, -4.53, -5.00, 0.00, 0.00, + -0.11, 0.10, -2.43, -2.70, -3.82, 4.20, -0.06, 0.05, + 0.10, 0.09, 0.00, 0.00, -4.53, 4.90, 0.00, 0.00, + 0.11, 0.10, -4.49, -4.90, 0.00, 0.00, -0.11, 0.10, + 2.67, -2.90, -3.62, -3.90, -0.06, -0.06, -0.09, 0.08, + 3.94, -5.30, 0.00, 0.00, -0.12, -3.38, 3.70, -2.78, + -3.10, 0.08, 0.08, -0.07, 0.06, 3.18, -3.50, -2.82, + -3.10, -0.08, -0.07, -0.07, 0.06, -5.77, 0.00, 1.87, + 0.00, 0.00, 0.13, 0.00, -0.04, 3.54, -4.80, -0.64, + + /* 3028-3155 */ + -0.90, -0.11, 0.00, -0.02, -3.50, -4.70, 0.68, -0.90, + -0.11, 0.00, -0.02, 5.49, 0.00, 0.00, 0.00, 0.00, + -0.12, 1.83, -2.50, 2.63, 3.50, -0.06, 0.00, 0.08, + 3.02, -4.10, 0.68, 0.90, -0.09, 0.00, 0.02, 0.00, + 0.00, 5.21, 0.00, 0.00, 0.00, 0.00, -0.12, -3.54, + 3.80, 2.70, 3.60, -1.35, 1.80, 0.08, 0.00, 0.04, + -2.90, 3.90, 0.68, 0.90, 0.09, 0.00, 0.02, 0.80, + -1.10, -2.78, -3.70, -0.02, 0.00, -0.08, 4.10, 0.00, + -2.39, 0.00, 0.00, -0.09, 0.00, 0.05, -1.59, 2.10, + 2.27, 3.00, 0.05, 0.00, 0.07, -2.63, 3.50, -0.48, + -0.60, -2.94, -3.20, -2.94, 3.20, 2.27, -3.00, -1.11, + -1.50, -0.07, 0.00, -0.03, -0.56, -0.80, -2.35, 3.10, + 0.00, -0.60, -3.42, 1.90, -0.12, -0.10, 2.63, -2.90, + 2.51, 2.80, -0.64, 0.70, -0.48, -0.60, 2.19, -2.90, + 0.24, -0.30, 2.15, 2.90, 2.15, -2.90, 0.52, 0.70, + 2.07, -2.80, -3.10, 0.00, 1.79, 0.00, 0.00, 0.07, + + /* 3156-3283 */ + 0.00, -0.04, 0.88, 0.00, -3.46, 2.11, 2.80, -0.36, + 0.50, 3.54, -0.20, -3.50, -1.39, 1.50, -1.91, -2.10, + -1.47, 2.00, 1.39, 1.90, 2.07, -2.30, 0.91, 1.00, + 1.99, -2.70, 3.30, 0.00, 0.60, -0.44, -0.70, -1.95, + 2.60, 2.15, -2.40, -0.60, -0.70, 3.30, 0.84, 0.00, + -3.10, -3.10, 0.00, -0.72, -0.32, 0.40, -1.87, -2.50, + 1.87, -2.50, 0.32, 0.40, -0.24, 0.30, -1.87, -2.50, + -0.24, -0.30, 1.87, -2.50, -2.70, 0.00, 1.55, 2.03, + 2.20, -2.98, -1.99, -2.20, 0.12, -0.10, -0.40, 0.50, + 1.59, 2.10, 0.00, 0.00, -1.79, 2.00, -1.03, 1.40, + -1.15, -1.60, 0.32, 0.50, 1.39, -1.90, 2.35, -1.27, + 1.70, 0.60, 0.80, -0.32, -0.40, 1.35, -1.80, 0.44, + 0.00, 2.23, -0.84, 0.90, -1.27, -1.40, -1.47, 1.60, + -0.28, -0.30, -0.28, 0.40, -1.27, -1.70, 0.28, -0.40, + -1.43, -1.50, 0.00, 0.00, -1.27, -1.70, 2.11, -0.32, + -0.40, -1.23, 1.60, 1.19, -1.30, -0.72, -0.80, 0.72, + + /* 3284-3411 */ + -0.80, -1.15, -1.30, -1.35, -1.50, -1.19, -1.60, -0.12, + 0.20, 1.79, 0.00, -0.88, -0.28, 0.40, 1.11, 1.50, + -1.83, 0.00, 0.56, -0.12, 0.10, -1.27, -1.40, 0.00, + 0.00, 1.15, 1.50, -0.12, 0.20, 1.11, 1.50, 0.36, + -0.50, -1.07, -1.40, -1.11, 1.50, 1.67, 0.00, 0.80, + -1.11, 0.00, 1.43, 1.23, -1.30, -0.24, -1.19, -1.30, + -0.24, 0.20, -0.44, -0.90, -0.95, 1.10, 1.07, -1.40, + 1.15, -1.30, 1.03, -1.10, -0.56, -0.60, -0.68, 0.90, + -0.76, -1.00, -0.24, -0.30, 0.95, -1.30, 0.56, 0.70, + 0.84, -1.10, -0.56, 0.00, -1.55, 0.91, -1.30, 0.28, + 0.30, 0.16, -0.20, 0.95, 1.30, 0.40, -0.50, -0.88, + -1.20, 0.95, -1.10, -0.48, -0.50, 0.00, 0.00, -1.07, + 1.20, 0.44, -0.50, 0.95, 1.10, 0.00, 0.00, 0.92, + -1.30, 0.95, 1.00, -0.52, 0.60, 1.59, 0.24, -0.40, + 0.91, 1.20, 0.84, -1.10, -0.44, -0.60, 0.84, 1.10, + -0.44, 0.60, -0.44, 0.60, -0.84, -1.10, -0.80, 0.00, + + /* 3412-3539 */ + 1.35, 0.76, 0.20, -0.91, -1.00, 0.20, -0.30, -0.91, + -1.20, -0.95, 1.00, -0.48, -0.50, 0.88, 1.00, 0.48, + -0.50, -0.95, -1.10, 0.20, -0.20, -0.99, 1.10, -0.84, + 1.10, -0.24, -0.30, 0.20, -0.30, 0.84, 1.10, -1.39, + 0.00, -0.28, -0.16, 0.20, 0.84, 1.10, 0.00, 0.00, + 1.39, 0.00, 0.00, -0.95, 1.00, 1.35, -0.99, 0.00, + 0.88, -0.52, 0.00, -1.19, 0.20, 0.20, 0.76, -1.00, + 0.00, 0.00, 0.76, 1.00, 0.00, 0.00, 0.76, 1.00, + -0.76, 1.00, 0.00, 0.00, 1.23, 0.76, 0.80, -0.32, + 0.40, -0.72, 0.80, -0.40, -0.40, 0.00, 0.00, -0.80, + -0.90, -0.68, 0.90, -0.16, -0.20, -0.16, -0.20, 0.68, + -0.90, -0.36, 0.50, -0.56, -0.80, 0.72, -0.90, 0.44, + -0.60, -0.48, -0.70, -0.16, 0.00, -1.11, 0.32, 0.00, + -1.07, 0.60, -0.80, -0.28, -0.40, -0.64, 0.00, 0.91, + 1.11, 0.64, -0.90, 0.76, -0.80, 0.00, 0.00, -0.76, + -0.80, 1.03, 0.00, -0.36, -0.64, -0.70, 0.36, -0.40, + + /* 3540-3667 */ + 1.07, 0.36, -0.50, -0.52, -0.70, 0.60, 0.00, 0.88, + 0.95, 0.00, 0.48, 0.16, -0.20, 0.60, 0.80, 0.16, + -0.20, -0.60, -0.80, 0.00, -1.00, 0.12, 0.20, 0.16, + -0.20, 0.68, 0.70, 0.59, -0.80, -0.99, -0.56, -0.60, + 0.36, -0.40, -0.68, -0.70, -0.68, -0.70, -0.36, -0.50, + -0.44, 0.60, 0.64, 0.70, -0.12, 0.10, -0.52, 0.60, + 0.36, 0.40, 0.00, 0.00, 0.95, -0.84, 0.00, 0.44, + 0.56, 0.60, 0.32, -0.30, 0.00, 0.00, 0.60, 0.70, + 0.00, 0.00, 0.60, 0.70, -0.12, -0.20, 0.52, -0.70, + 0.00, 0.00, 0.56, 0.70, -0.12, 0.10, -0.52, -0.70, + 0.00, 0.00, 0.88, -0.76, 0.00, -0.44, 0.00, 0.00, + -0.52, -0.70, 0.52, -0.70, 0.36, -0.40, -0.44, -0.50, + 0.00, 0.00, 0.60, 0.60, 0.84, 0.00, 0.12, -0.24, + 0.00, 0.80, -0.56, 0.60, -0.32, -0.30, 0.48, -0.50, + 0.28, -0.30, -0.48, -0.50, 0.12, 0.20, 0.48, -0.60, + 0.48, 0.60, -0.12, 0.20, 0.24, 0.00, 0.76, -0.52, + + /* 3668-3795 */ + -0.60, -0.52, 0.60, 0.48, -0.50, -0.24, -0.30, 0.12, + -0.10, 0.48, 0.60, 0.52, -0.20, 0.36, 0.40, -0.44, + 0.50, -0.24, -0.30, -0.48, -0.60, -0.44, -0.60, -0.12, + 0.10, 0.76, 0.76, 0.20, -0.20, 0.48, 0.50, 0.40, + -0.50, -0.24, -0.30, 0.44, -0.60, 0.44, -0.60, 0.36, + 0.00, -0.64, 0.72, 0.00, -0.12, 0.00, -0.10, -0.40, + -0.60, -0.20, -0.20, -0.44, 0.50, -0.44, 0.50, 0.20, + 0.20, -0.44, -0.50, 0.20, -0.20, -0.20, 0.20, -0.44, + -0.50, 0.64, 0.00, 0.32, -0.36, 0.50, -0.20, -0.30, + 0.12, -0.10, 0.48, 0.50, -0.12, 0.30, -0.36, -0.50, + 0.00, 0.00, 0.48, 0.50, -0.48, 0.50, 0.68, 0.00, + -0.12, 0.56, -0.40, 0.44, -0.50, -0.12, -0.10, 0.24, + 0.30, -0.40, 0.40, 0.64, 0.00, -0.24, 0.64, 0.00, + -0.20, 0.00, 0.00, 0.44, -0.50, 0.44, 0.50, -0.12, + 0.20, -0.36, -0.50, 0.12, 0.00, 0.64, -0.40, 0.50, + 0.00, 0.10, 0.00, 0.00, -0.40, 0.50, 0.00, 0.00, + + /* 3796-3923 */ + -0.40, -0.50, 0.56, 0.00, 0.28, 0.00, 0.10, 0.36, + 0.50, 0.00, -0.10, 0.36, -0.50, 0.36, 0.50, 0.00, + -0.10, 0.24, -0.20, -0.36, -0.40, 0.16, 0.20, 0.40, + -0.40, 0.00, 0.00, -0.36, -0.50, -0.36, -0.50, -0.32, + -0.50, -0.12, 0.10, 0.20, 0.20, -0.36, 0.40, -0.60, + 0.60, 0.28, 0.00, 0.52, 0.12, -0.10, 0.40, 0.40, + 0.00, -0.50, 0.20, -0.20, -0.32, 0.40, 0.16, 0.20, + -0.16, 0.20, 0.32, 0.40, 0.56, 0.00, -0.12, 0.32, + -0.40, -0.16, -0.20, 0.00, 0.00, 0.40, 0.40, -0.40, + -0.40, -0.40, 0.40, -0.36, 0.40, 0.12, 0.10, 0.00, + 0.10, 0.36, 0.40, 0.00, -0.10, 0.36, 0.40, -0.36, + 0.40, 0.00, 0.10, 0.32, 0.00, 0.44, 0.12, 0.20, + 0.28, -0.40, 0.00, 0.00, 0.36, 0.40, 0.32, -0.40, + -0.16, 0.12, 0.10, 0.32, -0.40, 0.20, 0.30, -0.24, + 0.30, 0.00, 0.10, 0.32, 0.40, 0.00, -0.10, -0.32, + -0.40, -0.32, 0.40, 0.00, 0.10, -0.52, -0.52, 0.52, + + /* 3924-4051 */ + 0.32, -0.40, 0.00, 0.00, 0.32, 0.40, 0.32, -0.40, + 0.00, 0.00, -0.32, -0.40, -0.32, 0.40, 0.32, 0.40, + 0.00, 0.00, 0.32, 0.40, 0.00, 0.00, -0.32, -0.40, + 0.00, 0.00, 0.32, 0.40, 0.16, 0.20, 0.32, -0.30, + -0.16, 0.00, -0.48, -0.20, 0.20, -0.28, -0.30, 0.28, + -0.40, 0.00, 0.00, 0.28, -0.40, 0.00, 0.00, 0.28, + -0.40, 0.00, 0.00, -0.28, -0.40, 0.28, 0.40, -0.28, + -0.40, -0.48, -0.20, 0.20, 0.24, 0.30, 0.44, 0.00, + 0.16, 0.24, 0.30, 0.16, -0.20, 0.24, 0.30, -0.12, + 0.20, 0.20, 0.30, -0.16, 0.20, 0.00, 0.00, 0.44, + -0.32, 0.30, 0.24, 0.00, -0.36, 0.36, 0.00, 0.24, + 0.12, -0.20, 0.20, 0.30, -0.12, 0.00, -0.28, 0.30, + -0.24, 0.30, 0.12, 0.10, -0.28, -0.30, -0.28, 0.30, + 0.00, 0.00, -0.28, -0.30, 0.00, 0.00, -0.28, -0.30, + 0.00, 0.00, 0.28, 0.30, 0.00, 0.00, -0.28, -0.30, + -0.28, 0.30, 0.00, 0.00, -0.28, -0.30, 0.00, 0.00, + + /* 4052-4179 */ + 0.28, 0.30, 0.00, 0.00, -0.28, 0.30, 0.28, -0.30, + -0.28, 0.30, 0.40, 0.40, -0.24, 0.30, 0.00, -0.10, + 0.16, 0.00, 0.36, -0.20, 0.30, -0.12, -0.10, -0.24, + -0.30, 0.00, 0.00, -0.24, 0.30, -0.24, 0.30, 0.00, + 0.00, -0.24, 0.30, -0.24, 0.30, 0.24, -0.30, 0.00, + 0.00, 0.24, -0.30, 0.00, 0.00, 0.24, 0.30, 0.24, + -0.30, 0.24, 0.30, -0.24, 0.30, -0.24, 0.30, -0.20, + 0.20, -0.16, -0.20, 0.00, 0.00, -0.32, 0.20, 0.00, + 0.10, 0.20, -0.30, 0.20, -0.20, 0.12, 0.20, -0.16, + 0.20, 0.16, 0.20, 0.20, 0.30, 0.20, 0.30, 0.00, + 0.00, -0.20, 0.30, 0.00, 0.00, 0.20, 0.30, -0.20, + -0.30, -0.20, -0.30, 0.20, -0.30, 0.00, 0.00, 0.20, + 0.30, 0.00, 0.00, 0.20, 0.30, 0.00, 0.00, 0.20, + 0.30, 0.00, 0.00, 0.20, 0.30, 0.00, 0.00, 0.20, + -0.30, 0.00, 0.00, -0.20, -0.30, 0.00, 0.00, -0.20, + 0.30, 0.00, 0.00, -0.20, 0.30, 0.00, 0.00, 0.36, + + /* 4180-4307 */ + 0.00, 0.00, 0.36, 0.12, 0.10, -0.24, 0.20, 0.12, + -0.20, -0.16, -0.20, -0.13, 0.10, 0.22, 0.21, 0.20, + 0.00, -0.28, 0.32, 0.00, -0.12, -0.20, -0.20, 0.12, + -0.10, 0.12, 0.10, -0.20, 0.20, 0.00, 0.00, -0.32, + 0.32, 0.00, 0.00, 0.32, 0.32, 0.00, 0.00, -0.24, + -0.20, 0.24, 0.20, 0.20, 0.00, -0.24, 0.00, 0.00, + -0.24, -0.20, 0.00, 0.00, 0.24, 0.20, -0.24, -0.20, + 0.00, 0.00, -0.24, 0.20, 0.16, -0.20, 0.12, 0.10, + 0.20, 0.20, 0.00, -0.10, -0.12, 0.10, -0.16, -0.20, + -0.12, -0.10, -0.16, 0.20, 0.20, 0.20, 0.00, 0.00, + -0.20, 0.20, -0.20, 0.20, -0.20, 0.20, -0.20, 0.20, + 0.20, -0.20, -0.20, -0.20, 0.00, 0.00, -0.20, 0.20, + 0.20, 0.00, -0.20, 0.00, 0.00, -0.20, 0.20, -0.20, + 0.20, -0.20, -0.20, -0.20, -0.20, 0.00, 0.00, 0.20, + 0.20, 0.20, 0.20, 0.12, -0.20, -0.12, -0.10, 0.28, + -0.28, 0.16, -0.20, 0.00, -0.10, 0.00, 0.10, -0.16, + + /* 4308-4435 */ + 0.20, 0.00, -0.10, -0.16, -0.20, 0.00, -0.10, 0.16, + -0.20, 0.16, -0.20, 0.00, 0.00, 0.16, 0.20, -0.16, + 0.20, 0.00, 0.00, 0.16, 0.20, 0.16, -0.20, 0.16, + -0.20, -0.16, 0.20, 0.16, -0.20, 0.00, 0.00, 0.16, + 0.20, 0.00, 0.00, 0.16, 0.20, 0.00, 0.00, -0.16, + -0.20, 0.16, -0.20, -0.16, -0.20, 0.00, 0.00, -0.16, + -0.20, 0.00, 0.00, -0.16, 0.20, 0.00, 0.00, 0.16, + -0.20, 0.16, 0.20, 0.16, 0.20, 0.00, 0.00, -0.16, + -0.20, 0.00, 0.00, -0.16, -0.20, 0.00, 0.00, 0.16, + 0.20, 0.16, 0.20, 0.00, 0.00, 0.16, 0.20, 0.16, + -0.20, 0.16, 0.20, 0.00, 0.00, -0.16, 0.20, 0.00, + 0.10, 0.12, -0.20, 0.12, -0.20, 0.00, -0.10, 0.00, + -0.10, 0.12, 0.20, 0.00, -0.10, -0.12, 0.20, -0.15, + 0.20, -0.24, 0.24, 0.00, 0.00, 0.24, 0.24, 0.12, + -0.20, -0.12, -0.20, 0.00, 0.00, 0.12, 0.20, 0.12, + -0.20, 0.12, 0.20, 0.12, 0.20, 0.12, 0.20, 0.12, + + /* 4436-4563 */ + -0.20, -0.12, 0.20, 0.00, 0.00, 0.12, 0.20, 0.12, + 0.00, -0.20, 0.00, 0.00, -0.12, -0.20, 0.12, -0.20, + 0.00, 0.00, 0.12, 0.20, -0.12, 0.20, -0.12, 0.20, + 0.12, -0.20, 0.00, 0.00, 0.12, 0.20, 0.20, 0.00, + 0.12, 0.00, 0.00, -0.12, 0.20, 0.00, 0.00, -0.12, + -0.20, 0.00, 0.00, -0.12, -0.20, -0.12, -0.20, 0.00, + 0.00, 0.12, -0.20, 0.12, -0.20, 0.12, 0.20, -0.12, + -0.20, 0.00, 0.00, 0.12, -0.20, 0.12, -0.20, 0.12, + 0.20, 0.12, 0.00, 0.20, -0.12, -0.20, 0.00, 0.00, + 0.12, 0.20, -0.16, 0.00, 0.16, -0.20, 0.20, 0.00, + 0.00, -0.20, 0.00, 0.00, -0.20, 0.20, 0.00, 0.00, + 0.20, 0.20, -0.20, 0.00, 0.00, -0.20, 0.12, 0.00, + -0.16, 0.20, 0.00, 0.00, 0.20, 0.12, -0.10, 0.00, + 0.10, 0.16, -0.16, -0.16, -0.16, -0.16, -0.16, 0.00, + 0.00, -0.16, 0.00, 0.00, -0.16, -0.16, -0.16, 0.00, + 0.00, -0.16, 0.00, 0.00, 0.16, 0.00, 0.00, 0.16, + + /* 4564-4691 */ + 0.00, 0.00, 0.16, 0.16, 0.00, 0.00, -0.16, 0.00, + 0.00, -0.16, -0.16, 0.00, 0.00, 0.16, 0.00, 0.00, + -0.16, -0.16, 0.00, 0.00, -0.16, -0.16, 0.12, 0.10, + 0.12, -0.10, 0.12, 0.10, 0.00, 0.00, 0.12, 0.10, + -0.12, 0.10, 0.00, 0.00, 0.12, 0.10, 0.12, -0.10, + 0.00, 0.00, -0.12, -0.10, 0.00, 0.00, 0.12, 0.10, + 0.12, 0.00, 0.00, 0.12, 0.00, 0.00, -0.12, 0.00, + 0.00, 0.12, 0.12, 0.12, 0.12, 0.12, 0.00, 0.00, + 0.12, 0.00, 0.00, 0.12, 0.12, 0.00, 0.00, 0.12, + 0.00, 0.00, 0.12, -0.12, -0.12, 0.12, 0.12, -0.12, + -0.12, 0.00, 0.00, 0.12, -0.12, 0.12, 0.12, -0.12, + -0.12, 0.00, 0.00, -0.12, -0.12, 0.00, 0.00, -0.12, + 0.12, 0.00, 0.00, 0.12, 0.00, 0.00, 0.12, 0.00, + 0.00, 0.12, -0.12, 0.00, 0.00, -0.12, 0.12, -0.12, + -0.12, 0.12, 0.00, 0.00, 0.12, 0.12, 0.12, -0.12, + 0.00, 0.00, -0.12, -0.12, -0.12, 0.00, 0.00, -0.12, + + /* 4692-NA */ + -0.12, 0.00, 0.00, 0.12, 0.12, 0.00, 0.00, -0.12, + -0.12, -0.12, -0.12, 0.12, 0.00, 0.00, 0.12, -0.12, + 0.00, 0.00, -0.12, -0.12, 0.00, 0.00, 0.12, -0.12, + -0.12, -0.12, -0.12, 0.12, 0.12, -0.12, -0.12, 0.00, + 0.00, -0.12, 0.00, 0.00, -0.12, 0.12, 0.00, 0.00, + 0.12, 0.00, 0.00, -0.12, -0.12, 0.00, 0.00, -0.12, + -0.12, 0.12, 0.00, 0.00, 0.12, 0.12, 0.00, 0.00, + 0.12, 0.00, 0.00, 0.12, 0.12, 0.08, 0.00, 0.04 + }; + +/* Number of amplitude coefficients */ + static const int NA = (int) (sizeof a / sizeof (double)); + +/* Amplitude usage: X or Y, sin or cos, power of T. */ + static const int jaxy[] = {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}; + static const int jasc[] = {0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0}; + static const int japt[] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4}; + +/* Miscellaneous */ + double t, w, pt[MAXPT+1], fa[14], xypr[2], xypl[2], xyls[2], arg, + sc[2]; + int jpt, i, j, jxy, ialast, ifreq, m, ia, jsc; + +/*--------------------------------------------------------------------*/ + +/* Interval between fundamental date J2000.0 and given date (JC). */ + t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; + +/* Powers of T. */ + w = 1.0; + for (jpt = 0; jpt <= MAXPT; jpt++) { + pt[jpt] = w; + w *= t; + } + +/* Initialize totals in X and Y: polynomial, luni-solar, planetary. */ + for (jxy = 0; jxy < 2; jxy++) { + xypr[jxy] = 0.0; + xyls[jxy] = 0.0; + xypl[jxy] = 0.0; + } + +/* --------------------------------- */ +/* Fundamental arguments (IERS 2003) */ +/* --------------------------------- */ + +/* Mean anomaly of the Moon. */ + fa[0] = eraFal03(t); + +/* Mean anomaly of the Sun. */ + fa[1] = eraFalp03(t); + +/* Mean argument of the latitude of the Moon. */ + fa[2] = eraFaf03(t); + +/* Mean elongation of the Moon from the Sun. */ + fa[3] = eraFad03(t); + +/* Mean longitude of the ascending node of the Moon. */ + fa[4] = eraFaom03(t); + +/* Planetary longitudes, Mercury through Neptune. */ + fa[5] = eraFame03(t); + fa[6] = eraFave03(t); + fa[7] = eraFae03(t); + fa[8] = eraFama03(t); + fa[9] = eraFaju03(t); + fa[10] = eraFasa03(t); + fa[11] = eraFaur03(t); + fa[12] = eraFane03(t); + +/* General accumulated precession in longitude. */ + fa[13] = eraFapa03(t); + +/* -------------------------------------- */ +/* Polynomial part of precession-nutation */ +/* -------------------------------------- */ + + for (jxy = 0; jxy < 2; jxy++) { + for (j = MAXPT; j >= 0; j--) { + xypr[jxy] += xyp[jxy][j] * pt[j]; + } + } + +/* ---------------------------------- */ +/* Nutation periodic terms, planetary */ +/* ---------------------------------- */ + +/* Work backwards through the coefficients per frequency list. */ + ialast = NA; + for (ifreq = NFPL-1; ifreq >= 0; ifreq--) { + + /* Obtain the argument functions. */ + arg = 0.0; + for (i = 0; i < 14; i++) { + m = mfapl[ifreq][i]; + if (m != 0) arg += (double)m * fa[i]; + } + sc[0] = sin(arg); + sc[1] = cos(arg); + + /* Work backwards through the amplitudes at this frequency. */ + ia = nc[ifreq+NFLS]; + for (i = ialast; i >= ia; i--) { + + /* Coefficient number (0 = 1st). */ + j = i-ia; + + /* X or Y. */ + jxy = jaxy[j]; + + /* Sin or cos. */ + jsc = jasc[j]; + + /* Power of T. */ + jpt = japt[j]; + + /* Accumulate the component. */ + xypl[jxy] += a[i-1] * sc[jsc] * pt[jpt]; + } + ialast = ia-1; + } + +/* ----------------------------------- */ +/* Nutation periodic terms, luni-solar */ +/* ----------------------------------- */ + +/* Continue working backwards through the number of coefficients list. */ + for (ifreq = NFLS-1; ifreq >= 0; ifreq--) { + + /* Obtain the argument functions. */ + arg = 0.0; + for (i = 0; i < 5; i++) { + m = mfals[ifreq][i]; + if (m != 0) arg += (double)m * fa[i]; + } + sc[0] = sin(arg); + sc[1] = cos(arg); + + /* Work backwards through the amplitudes at this frequency. */ + ia = nc[ifreq]; + for (i = ialast; i >= ia; i--) { + + /* Coefficient number (0 = 1st). */ + j = i-ia; + + /* X or Y. */ + jxy = jaxy[j]; + + /* Sin or cos. */ + jsc = jasc[j]; + + /* Power of T. */ + jpt = japt[j]; + + /* Accumulate the component. */ + xyls[jxy] += a[i-1] * sc[jsc] * pt[jpt]; + } + ialast = ia-1; + } + +/* ------------------------------------ */ +/* Results: CIP unit vector components */ +/* ------------------------------------ */ + + *x = ERFA_DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6); + *y = ERFA_DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/xys00a.c b/testbed/astropy__astropy/cextern/erfa/xys00a.c new file mode 100644 index 0000000000000000000000000000000000000000..a7b4483795b8152d27c12ad90a45df9ea1677c25 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/xys00a.c @@ -0,0 +1,142 @@ +#include "erfa.h" + +void eraXys00a(double date1, double date2, + double *x, double *y, double *s) +/* +** - - - - - - - - - - +** e r a X y s 0 0 a +** - - - - - - - - - - +** +** For a given TT date, compute the X,Y coordinates of the Celestial +** Intermediate Pole and the CIO locator s, using the IAU 2000A +** precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** x,y double Celestial Intermediate Pole (Note 2) +** s double the CIO locator s (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The Celestial Intermediate Pole coordinates are the x,y +** components of the unit vector in the Geocentric Celestial +** Reference System. +** +** 3) The CIO locator s (in radians) positions the Celestial +** Intermediate Origin on the equator of the CIP. +** +** 4) A faster, but slightly less accurate result (about 1 mas for +** X,Y), can be obtained by using instead the eraXys00b function. +** +** Called: +** eraPnm00a classical NPB matrix, IAU 2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS00 the CIO locator s, given X,Y, IAU 2000A +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3]; + + +/* Form the bias-precession-nutation matrix, IAU 2000A. */ + eraPnm00a(date1, date2, rbpn); + +/* Extract X,Y. */ + eraBpn2xy(rbpn, x, y); + +/* Obtain s. */ + *s = eraS00(date1, date2, *x, *y); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/xys00b.c b/testbed/astropy__astropy/cextern/erfa/xys00b.c new file mode 100644 index 0000000000000000000000000000000000000000..fce4ee7ae9e417ca8d9729e5d6bb5d14bcd3c15a --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/xys00b.c @@ -0,0 +1,142 @@ +#include "erfa.h" + +void eraXys00b(double date1, double date2, + double *x, double *y, double *s) +/* +** - - - - - - - - - - +** e r a X y s 0 0 b +** - - - - - - - - - - +** +** For a given TT date, compute the X,Y coordinates of the Celestial +** Intermediate Pole and the CIO locator s, using the IAU 2000B +** precession-nutation model. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** x,y double Celestial Intermediate Pole (Note 2) +** s double the CIO locator s (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The Celestial Intermediate Pole coordinates are the x,y +** components of the unit vector in the Geocentric Celestial +** Reference System. +** +** 3) The CIO locator s (in radians) positions the Celestial +** Intermediate Origin on the equator of the CIP. +** +** 4) The present function is faster, but slightly less accurate (about +** 1 mas in X,Y), than the eraXys00a function. +** +** Called: +** eraPnm00b classical NPB matrix, IAU 2000B +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS00 the CIO locator s, given X,Y, IAU 2000A +** +** Reference: +** +** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), +** IERS Technical Note No. 32, BKG (2004) +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3]; + + +/* Form the bias-precession-nutation matrix, IAU 2000A. */ + eraPnm00b(date1, date2, rbpn); + +/* Extract X,Y. */ + eraBpn2xy(rbpn, x, y); + +/* Obtain s. */ + *s = eraS00(date1, date2, *x, *y); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/xys06a.c b/testbed/astropy__astropy/cextern/erfa/xys06a.c new file mode 100644 index 0000000000000000000000000000000000000000..93893bb45137a59c0db8ff353683675935aea66b --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/xys06a.c @@ -0,0 +1,142 @@ +#include "erfa.h" + +void eraXys06a(double date1, double date2, + double *x, double *y, double *s) +/* +** - - - - - - - - - - +** e r a X y s 0 6 a +** - - - - - - - - - - +** +** For a given TT date, compute the X,Y coordinates of the Celestial +** Intermediate Pole and the CIO locator s, using the IAU 2006 +** precession and IAU 2000A nutation models. +** +** Given: +** date1,date2 double TT as a 2-part Julian Date (Note 1) +** +** Returned: +** x,y double Celestial Intermediate Pole (Note 2) +** s double the CIO locator s (Note 2) +** +** Notes: +** +** 1) The TT date date1+date2 is a Julian Date, apportioned in any +** convenient way between the two arguments. For example, +** JD(TT)=2450123.7 could be expressed in any of these ways, +** among others: +** +** date1 date2 +** +** 2450123.7 0.0 (JD method) +** 2451545.0 -1421.3 (J2000 method) +** 2400000.5 50123.2 (MJD method) +** 2450123.5 0.2 (date & time method) +** +** The JD method is the most natural and convenient to use in +** cases where the loss of several decimal digits of resolution +** is acceptable. The J2000 method is best matched to the way +** the argument is handled internally and will deliver the +** optimum resolution. The MJD method and the date & time methods +** are both good compromises between resolution and convenience. +** +** 2) The Celestial Intermediate Pole coordinates are the x,y components +** of the unit vector in the Geocentric Celestial Reference System. +** +** 3) The CIO locator s (in radians) positions the Celestial +** Intermediate Origin on the equator of the CIP. +** +** 4) Series-based solutions for generating X and Y are also available: +** see Capitaine & Wallace (2006) and eraXy06. +** +** Called: +** eraPnm06a classical NPB matrix, IAU 2006/2000A +** eraBpn2xy extract CIP X,Y coordinates from NPB matrix +** eraS06 the CIO locator s, given X,Y, IAU 2006 +** +** References: +** +** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855 +** +** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981 +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + double rbpn[3][3]; + + +/* Form the bias-precession-nutation matrix, IAU 2006/2000A. */ + eraPnm06a(date1, date2, rbpn); + +/* Extract X,Y. */ + eraBpn2xy(rbpn, x, y); + +/* Obtain s. */ + *s = eraS06(date1, date2, *x, *y); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/zp.c b/testbed/astropy__astropy/cextern/erfa/zp.c new file mode 100644 index 0000000000000000000000000000000000000000..e19589ca231b747cc11b6d0abe46239108134be9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/zp.c @@ -0,0 +1,86 @@ +#include "erfa.h" + +void eraZp(double p[3]) +/* +** - - - - - - +** e r a Z p +** - - - - - - +** +** Zero a p-vector. +** +** Returned: +** p double[3] p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + p[0] = 0.0; + p[1] = 0.0; + p[2] = 0.0; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/zpv.c b/testbed/astropy__astropy/cextern/erfa/zpv.c new file mode 100644 index 0000000000000000000000000000000000000000..809fc82ec0a5a08a9fbb4c69a9847beb7d05776e --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/zpv.c @@ -0,0 +1,88 @@ +#include "erfa.h" + +void eraZpv(double pv[2][3]) +/* +** - - - - - - - +** e r a Z p v +** - - - - - - - +** +** Zero a pv-vector. +** +** Returned: +** pv double[2][3] pv-vector +** +** Called: +** eraZp zero p-vector +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + eraZp(pv[0]); + eraZp(pv[1]); + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/erfa/zr.c b/testbed/astropy__astropy/cextern/erfa/zr.c new file mode 100644 index 0000000000000000000000000000000000000000..08e996fbb08185169e0baf99e8c968c0752abfc1 --- /dev/null +++ b/testbed/astropy__astropy/cextern/erfa/zr.c @@ -0,0 +1,92 @@ +#include "erfa.h" + +void eraZr(double r[3][3]) +/* +** - - - - - - +** e r a Z r +** - - - - - - +** +** Initialize an r-matrix to the null matrix. +** +** Returned: +** r double[3][3] r-matrix +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** Derived, with permission, from the SOFA library. See notes at end of file. +*/ +{ + r[0][0] = 0.0; + r[0][1] = 0.0; + r[0][2] = 0.0; + r[1][0] = 0.0; + r[1][1] = 0.0; + r[1][2] = 0.0; + r[2][0] = 0.0; + r[2][1] = 0.0; + r[2][2] = 0.0; + + return; + +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2017, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/ diff --git a/testbed/astropy__astropy/cextern/expat/AUTHORS b/testbed/astropy__astropy/cextern/expat/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..99475bb1b2efae732a3d5da2ad6fe53f81434989 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/AUTHORS @@ -0,0 +1,10 @@ +Expat is brought to you by: + +Clark Cooper +Fred L. Drake, Jr. +Greg Stein +James Clark +Karl Waclawek +Rhodri James +Sebastian Pipping +Steven Solie diff --git a/testbed/astropy__astropy/cextern/expat/COPYING b/testbed/astropy__astropy/cextern/expat/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..8d288f0f28fddd7bb86d3b224de2bff642298d9c --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/COPYING @@ -0,0 +1,21 @@ +Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper +Copyright (c) 2001-2017 Expat maintainers + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/testbed/astropy__astropy/cextern/expat/Changes b/testbed/astropy__astropy/cextern/expat/Changes new file mode 100644 index 0000000000000000000000000000000000000000..b0ee42cd36cf7392f34a1c05304221f2a875b329 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/Changes @@ -0,0 +1,600 @@ +NOTE: We are looking for help with a few things: + https://github.com/libexpat/libexpat/labels/help%20wanted + If you can help, please get in touch. Thanks! + +Release 2.2.6 Sun August 12 2018 + Bug fixes: + #170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer + #204 #205 Fix 2.2.5 regression with suspend-resume while parsing + a document like '' + + Other changes: + #165 #168 Autotools: Fix docbook-related configure syntax error + #166 Autotools: Avoid grep option `-q` for Solaris + #167 Autotools: Support + ./configure DOCBOOK_TO_MAN="xmlto man --skip-validation" + #159 #167 Autotools: Support DOCBOOK_TO_MAN command which produces + xmlwf.1 rather than XMLWF.1; also covers case insensitive + file systems + #181 Autotools: Drop -rpath option passed to libtool + #188 Autotools: Detect and deny SGML docbook2man as ours is XML + #188 Autotools/CMake: Support command db2x_docbook2man as well + #174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF + #184 #185 CMake: Introduce option MSVC_USE_STATIC_CRT, defaults to OFF + #207 #208 CMake: Introduce option XML_UNICODE and XML_UNICODE_WCHAR_T, + both defaulting to OFF + #175 CMake: Prefer check_symbol_exists over check_function_exists + #176 CMake: Create the same pkg-config file as with GNU Autotools + #178 #179 CMake: Use GNUInstallDirs module to set proper defaults for + install directories + #208 CMake: Utilize expat_config.h.cmake for XML_DEV_URANDOM + #180 Windows: Fix compilation of test suite for Visual Studio 2008 + #131 #173 #202 Address compiler warnings + #187 #190 #200 Fix miscellaneous typos + Version info bumped from 7:7:6 to 7:8:6 + + Special thanks to: + Anton Maklakov + Benjamin Peterson + Brad King + Franek Korta + Frank Rast + Joe Orton + luzpaz + Pedro Vicente + Rainer Jung + Rhodri James + Rolf Ade + Rolf Eike Beer + Thomas Beutlich + Tomasz Kłoczko + +Release 2.2.5 Tue October 31 2017 + Bug fixes: + #8 If the parser runs out of memory, make sure its internal + state reflects the memory it actually has, not the memory + it wanted to have. + #11 The default handler wasn't being called when it should for + a SYSTEM or PUBLIC doctype if an entity declaration handler + was registered. + #137 #138 Fix a case of mistakenly reported parsing success where + XML_StopParser was called from an element handler + #162 Function XML_ErrorString was returning NULL rather than + a message for code XML_ERROR_INVALID_ARGUMENT + introduced with release 2.2.1 + + Other changes: + #106 xmlwf: Add argument -N adding notation declarations + #75 #106 Test suite: Resolve expected failure cases where xmlwf + output was incomplete + #127 Windows: Fix test suite compilation + #126 #127 Windows: Fix compilation for Visual Studio 2012 + Windows: Upgrade shipped project files to Visual Studio 2017 + #33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T + #129 examples: Fix compilation for XML_UNICODE_WCHAR_T + #130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T + #144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs + Windows or MinGW for 2-byte wchar_t + #9 Address two Clang Static Analyzer false positives + #59 Resolve troublesome macros hiding parser struct membership + and dereferencing that pointer + #6 Resolve superfluous internal malloc/realloc switch + #153 #155 Improve docbook2x-man detection + #160 Undefine NDEBUG in the test suite (rather than rejecting it) + #161 Address compiler warnings + Version info bumped from 7:6:6 to 7:7:6 + + Special thanks to: + Benbuck Nason + Hans Wennborg + José Gutiérrez de la Concha + Pedro Monreal Gonzalez + Rhodri James + Rolf Ade + Stephen Groat + and + Core Infrastructure Initiative + +Release 2.2.4 Sat August 19 2017 + Bug fixes: + #115 Fix copying of partial characters for UTF-8 input + + Other changes: + #109 Fix "make check" for non-x86 architectures that default + to unsigned type char (-128..127 rather than 0..255) + #109 coverage.sh: Cover -funsigned-char + Autotools: Introduce --without-xmlwf argument + #65 Autotools: Replace handwritten Makefile with GNU Automake + #43 CMake: Auto-detect high quality entropy extractors, add new + option USE_libbsd=ON to use arc4random_buf of libbsd + #74 CMake: Add -fno-strict-aliasing only where supported + #114 CMake: Always honor manually set BUILD_* options + #114 CMake: Compile man page if docbook2x-man is available, only + #117 Include file tests/xmltest.log.expected in source tarball + (required for "make run-xmltest") + #117 Include (existing) Visual Studio 2013 files in source tarball + Improve test suite error output + #111 Fix some typos in documentation + Version info bumped from 7:5:6 to 7:6:6 + + Special thanks to: + Jakub Wilk + Joe Orton + Lin Tian + Rolf Eike Beer + +Release 2.2.3 Wed August 2 2017 + Security fixes: + #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability + using Steve Holme's LoadLibrary wrapper for/of cURL + + Bug fixes: + #85 Fix a dangling pointer issue related to realloc + + Other changes: + Increase code coverage + #91 Linux: Allow getrandom to fail if nonblocking pool has not + yet been initialized and read /dev/urandom then, instead. + This is in line with what recent Python does. + #81 Pre-10.7/Lion macOS: Support entropy from arc4random + #86 Check that a UTF-16 encoding in an XML declaration has the + right endianness + #4 #5 #7 Recover correctly when some reallocations fail + Repair "./configure && make" for systems without any + provider of high quality entropy + and try reading /dev/urandom on those + Ensure that user-defined character encodings have converter + functions when they are needed + Fix mis-leading description of argument -c in xmlwf.1 + Rely on macro HAVE_ARC4RANDOM_BUF (rather than __CloudABI__) + for CloudABI + #100 Fix use of SIPHASH_MAIN in siphash.h + #23 Test suite: Fix memory leaks + Version info bumped from 7:4:6 to 7:5:6 + + Special thanks to: + Chanho Park + Joe Orton + Pascal Cuoq + Rhodri James + Simon McVittie + Vadim Zeitlin + Viktor Szakats + and + Core Infrastructure Initiative + +Release 2.2.2 Wed July 12 2017 + Security fixes: + #43 Protect against compilation without any source of high + quality entropy enabled, e.g. with CMake build system; + commit ff0207e6076e9828e536b8d9cd45c9c92069b895 + #60 Windows with _UNICODE: + Unintended use of LoadLibraryW with a non-wide string + resulted in failure to load advapi32.dll and degradation + in quality of used entropy when compiled with _UNICODE for + Windows; you can launch existing binaries with + EXPAT_ENTROPY_DEBUG=1 in the environment to inspect the + quality of entropy used during runtime; commits + * 95b95032f907ef1cd17ee7a9a1768010a825d61d + * 73a5a2e9c081f49f2d775cf7ced864158b68dc80 + [MOX-006] Fix non-NULL parser parameter validation in XML_Parse; + resulted in NULL dereference, previously; + commit ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe + + Bug fixes: + #69 Fix improper use of unsigned long long integer literals + + Other changes: + #73 Start requiring a C99 compiler + #49 Fix "==" Bashism in configure script + #50 Fix too eager getrandom detection for Debian GNU/kFreeBSD + #52 and macOS + #51 Address lack of stdint.h in Visual Studio 2003 to 2008 + #58 Address compile warnings + #68 Fix "./buildconf.sh && ./configure" for some versions + of Dash for /bin/sh + #72 CMake: Ease use of Expat in context of a parent project + with multiple CMakeLists.txt files + #72 CMake: Resolve mistaken executable permissions + #76 Address compile warning with -DNDEBUG (not recommended!) + #77 Address compile warning about macro redefinition + + Special thanks to: + Alexander Bluhm + Ben Boeckel + Cătălin Răceanu + Kerin Millar + László Böszörményi + S. P. Zeidler + Segev Finer + Václav Slavík + Victor Stinner + Viktor Szakats + and + Radically Open Security + +Release 2.2.1 Sat June 17 2017 + Security fixes: + CVE-2017-9233 -- External entity infinite loop DoS + Details: https://libexpat.github.io/doc/cve-2017-9233/ + Commit c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f + [MOX-002] CVE-2016-9063 -- Detect integer overflow; commit + d4f735b88d9932bd5039df2335eefdd0723dbe20 + (Fixed version of existing downstream patches!) + (SF.net) #539 Fix regression from fix to CVE-2016-0718 cutting off + longer tag names; commits + * 896b6c1fd3b842f377d1b62135dccf0a579cf65d + * af507cef2c93cb8d40062a0abe43a4f4e9158fb2 + #16 * 0dbbf43fdb20f593ddf4fa1ff67288000dd4a7fd + #25 More integer overflow detection (function poolGrow); commits + * 810b74e4703dcfdd8f404e3cb177d44684775143 + * 44178553f3539ce69d34abee77a05e879a7982ac + [MOX-002] Detect overflow from len=INT_MAX call to XML_Parse; commits + * 4be2cb5afcc018d996f34bbbce6374b7befad47f + * 7e5b71b748491b6e459e5c9a1d090820f94544d8 + [MOX-005] #30 Use high quality entropy for hash initialization: + * arc4random_buf on BSD, systems with libbsd + (when configured with --with-libbsd), CloudABI + * RtlGenRandom on Windows XP / Server 2003 and later + * getrandom on Linux 3.17+ + In a way, that's still part of CVE-2016-5300. + https://github.com/libexpat/libexpat/pull/30/commits + [MOX-005] For the low quality entropy extraction fallback code, + the parser instance address can no longer leak, commit + 04ad658bd3079dd15cb60fc67087900f0ff4b083 + [MOX-003] Prevent use of uninitialised variable; commit + [MOX-004] a4dc944f37b664a3ca7199c624a98ee37babdb4b + Add missing parameter validation to public API functions + and dedicated error code XML_ERROR_INVALID_ARGUMENT: + [MOX-006] * NULL checks; commits + * d37f74b2b7149a3a95a680c4c4cd2a451a51d60a (merge/many) + * 9ed727064b675b7180c98cb3d4f75efba6966681 + * 6a747c837c50114dfa413994e07c0ba477be4534 + * Negative length (XML_Parse); commit + [MOX-002] 70db8d2538a10f4c022655d6895e4c3e78692e7f + [MOX-001] #35 Change hash algorithm to William Ahern's version of SipHash + to go further with fixing CVE-2012-0876. + https://github.com/libexpat/libexpat/pull/39/commits + + Bug fixes: + #32 Fix sharing of hash salt across parsers; + relevant where XML_ExternalEntityParserCreate is called + prior to XML_Parse, in particular (e.g. FBReader) + #28 xmlwf: Auto-disable use of memory-mapping (and parsing + as a single chunk) for files larger than ~1 GB (2^30 bytes) + rather than failing with error "out of memory" + #3 Fix double free after malloc failure in DTD code; commit + 7ae9c3d3af433cd4defe95234eae7dc8ed15637f + #17 Fix memory leak on parser error for unbound XML attribute + prefix with new namespaces defined in the same tag; + found by Google's OSS-Fuzz; commits + * 16f87daae5a16132e479e4f71862128c7a915c73 + * b47dbc9745932c160893d433220e462bd605f8cd + xmlwf on Windows: Add missing calls to CloseHandle + + New features: + #30 Introduced environment switch EXPAT_ENTROPY_DEBUG=1 + for runtime debugging of entropy extraction + + Other changes: + Increase code coverage + #33 Reject use of XML_UNICODE_WCHAR_T with sizeof(wchar_t) != 2; + XML_UNICODE_WCHAR_T was never meant to be used outside + of Windows; 4-byte wchar_t is common on Linux + (SF.net) #538 Start using -fno-strict-aliasing + (SF.net) #540 Support compilation against cloudlibc of CloudABI + Allow MinGW cross-compilation + (SF.net) #534 CMake: Introduce option "BUILD_doc" (enabled by default) + to bypass compilation of the xmlwf.1 man page + (SF.net) pr2 CMake: Introduce option "INSTALL" (enabled by default) + to bypass installation of expat files + CMake: Fix ninja support + Autotools: Add parameters --enable-xml-context [COUNT] + and --disable-xml-context; default of context of 1024 + bytes enabled unchanged + #14 Drop AmigaOS 4.x code and includes + #14 Drop ancient build systems: + * Borland C++ Builder + * OpenVMS + * Open Watcom + * Visual Studio 6.0 + * Pre-X Mac OS (MPW Makefile) + If you happen to rely on some of these, please get in + touch for joining with maintenance. + #10 Move from WIN32 to _WIN32 + #13 Fix "make run-xmltest" order instability + Address compile warnings + Bump version info from 7:2:6 to 7:3:6 + Add AUTHORS file + + Infrastructure: + #1 Migrate from SourceForge to GitHub (except downloads): + https://github.com/libexpat/ + #1 Re-create http://libexpat.org/ project website + Start utilizing Travis CI + + Special thanks to: + Andy Wang + Don Lewis + Ed Schouten + Karl Waclawek + Pascal Cuoq + Rhodri James + Sergei Nikulov + Tobias Taschner + Viktor Szakats + and + Core Infrastructure Initiative + Mozilla Foundation (MOSS Track 3: Secure Open Source) + Radically Open Security + +Release 2.2.0 Tue June 21 2016 + Security fixes: + #537 CVE-2016-0718 -- Fix crash on malformed input + CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 / + CVE-2015-2716 introduced with Expat 2.1.1 + #499 CVE-2016-5300 -- Use more entropy for hash initialization + than the original fix to CVE-2012-0876 + #519 CVE-2012-6702 -- Resolve troublesome internal call to srand + that was introduced with Expat 2.1.0 + when addressing CVE-2012-0876 (issue #496) + + Bug fixes: + Fix uninitialized reads of size 1 + (e.g. in little2_updatePosition) + Fix detection of UTF-8 character boundaries + + Other changes: + #532 Fix compilation for Visual Studio 2010 (keyword "C99") + Autotools: Resolve use of "$<" to better support bmake + Autotools: Add QA script "qa.sh" (and make target "qa") + Autotools: Respect CXXFLAGS if given + Autotools: Fix "make run-xmltest" + Autotools: Have "make run-xmltest" check for expected output + p90 CMake: Fix static build (BUILD_shared=OFF) on Windows + #536 CMake: Add soversion, support -DNO_SONAME=yes to bypass + #323 CMake: Add suffix "d" to differentiate debug from release + CMake: Define WIN32 with CMake on Windows + Annotate memory allocators for GCC + Address all currently known compile warnings + Make sure that API symbols remain visible despite + -fvisibility=hidden + Remove executable flag from source files + Resolve COMPILED_FROM_DSP in favor of WIN32 + + Special thanks to: + Björn Lindahl + Christian Heimes + Cristian Rodríguez + Daniel Krügler + Gustavo Grieco + Karl Waclawek + László Böszörményi + Marco Grassi + Pascal Cuoq + Sergei Nikulov + Thomas Beutlich + Warren Young + Yann Droneaud + +Release 2.1.1 Sat March 12 2016 + Security fixes: + #582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer + + Bug fixes: + #502: Fix potential null pointer dereference + #520: Symbol XML_SetHashSalt was not exported + Output of "xmlwf -h" was incomplete + + Other changes: + #503: Document behavior of calling XML_SetHashSalt with salt 0 + Minor improvements to man page xmlwf(1) + Improvements to the experimental CMake build system + libtool now invoked with --verbose + +Release 2.1.0 Sat March 24 2012 + - Security fixes: + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #3496608: CVE-2012-0876 - Hash DOS attack. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. + - Bug Fixes: + #1742315: Harmful XML_ParserCreateNS suggestion. + #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. + #1983953, 2517952, 2517962, 2649838: + Build modifications using autoreconf instead of buildconf.sh. + #2815947, #2884086: OBJEXT and EXEEXT support while building. + #2517938: xmlwf should return non-zero exit status if not well-formed. + #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. + #2855609: Dangling positionPtr after error. + #2990652: CMake support. + #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. + #3206497: Uninitialized memory returned from XML_Parse. + #3287849: make check fails on mingw-w64. + - Patches: + #1749198: pkg-config support. + #3010222: Fix for bug #3010819. + #3312568: CMake support. + #3446384: Report byte offsets for attr names and values. + - New Features / API changes: + Added new API member XML_SetHashSalt() that allows setting an initial + value (salt) for hash calculations. This is part of the fix for + bug #3496608 to randomize hash parameters. + When compiled with XML_ATTR_INFO defined, adds new API member + XML_GetAttributeInfo() that allows retrieving the byte + offsets for attribute names and values (patch #3446384). + Added CMake build system. + See bug #2990652 and patch #3312568. + Added run-benchmark target to Makefile.in - relies on testdata module + present in the same relative location as in the repository. + +Release 2.0.1 Tue June 5 2007 + - Fixed bugs #1515266, #1515600: The character data handler's calling + of XML_StopParser() was not handled properly; if the parser was + stopped and the handler set to NULL, the parser would segfault. + - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed + some character constants to be ASCII encoded. + - Minor cleanups of the test harness. + - Fixed xmlwf bug #1513566: "out of memory" error on file size zero. + - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call. + - Fixes and improvements for Windows platform: + bugs #1409451, #1476160, #1548182, #1602769, #1717322. + - Build fixes for various platforms: + HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180. + All Unix: #1554618 (refreshed config.sub/config.guess). + #1490371, #1613457: support both, DESTDIR and INSTALL_ROOT, + without relying on GNU-Make specific features. + #1647805: Patched configure.in to work better with Intel compiler. + - Fixes to Makefile.in to have make check work correctly: + bugs #1408143, #1535603, #1536684. + - Added Open Watcom support: patch #1523242. + +Release 2.0.0 Wed Jan 11 2006 + - We no longer use the "check" library for C unit testing; we + always use the (partial) internal implementation of the API. + - Report XML_NS setting via XML_GetFeatureList(). + - Fixed headers for use from C++. + - XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber() + now return unsigned integers. + - Added XML_LARGE_SIZE switch to enable 64-bit integers for + byte indexes and line/column numbers. + - Updated to use libtool 1.5.22 (the most recent). + - Added support for AmigaOS. + - Some mostly minor bug fixes. SF issues include: #1006708, + #1021776, #1023646, #1114960, #1156398, #1221160, #1271642. + +Release 1.95.8 Fri Jul 23 2004 + - Major new feature: suspend/resume. Handlers can now request + that a parse be suspended for later resumption or aborted + altogether. See "Temporarily Stopping Parsing" in the + documentation for more details. + - Some mostly minor bug fixes, but compilation should no + longer generate warnings on most platforms. SF issues + include: #827319, #840173, #846309, #888329, #896188, #923913, + #928113, #961698, #985192. + +Release 1.95.7 Mon Oct 20 2003 + - Fixed enum XML_Status issue (reported on SourceForge many + times), so compilers that are properly picky will be happy. + - Introduced an XMLCALL macro to control the calling + convention used by the Expat API; this macro should be used + to annotate prototypes and definitions of callback + implementations in code compiled with a calling convention + other than the default convention for the host platform. + - Improved ability to build without the configure-generated + expat_config.h header. This is useful for applications + which embed Expat rather than linking in the library. + - Fixed a variety of bugs: see SF issues #458907, #609603, + #676844, #679754, #692878, #692964, #695401, #699323, #699487, + #820946. + - Improved hash table lookups. + - Added more regression tests and improved documentation. + +Release 1.95.6 Tue Jan 28 2003 + - Added XML_FreeContentModel(). + - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). + - Fixed a variety of bugs: see SF issues #615606, #616863, + #618199, #653180, #673791. + - Enhanced the regression test suite. + - Man page improvements: includes SF issue #632146. + +Release 1.95.5 Fri Sep 6 2002 + - Added XML_UseForeignDTD() for improved SAX2 support. + - Added XML_GetFeatureList(). + - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. + - Use an incomplete struct instead of a void* for the parser + (may not retain). + - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. + - Finally fixed bug where default handler would report DTD + events that were already handled by another handler. + Initial patch contributed by Darryl Miles. + - Removed unnecessary DllMain() function that caused static + linking into a DLL to be difficult. + - Added VC++ projects for building static libraries. + - Reduced line-length for all source code and headers to be + no longer than 80 characters, to help with AS/400 support. + - Reduced memory copying during parsing (SF patch #600964). + - Fixed a variety of bugs: see SF issues #580793, #434664, + #483514, #580503, #581069, #584041, #584183, #584832, #585537, + #596555, #596678, #598352, #598944, #599715, #600479, #600971. + +Release 1.95.4 Fri Jul 12 2002 + - Added support for VMS, contributed by Craig Berry. See + vms/README.vms for more information. + - Added Mac OS (classic) support, with a makefile for MPW, + contributed by Thomas Wegner and Daryle Walker. + - Added Borland C++ Builder 5 / BCC 5.5 support, contributed + by Patrick McConnell (SF patch #538032). + - Fixed a variety of bugs: see SF issues #441449, #563184, + #564342, #566334, #566901, #569461, #570263, #575168, #579196. + - Made skippedEntityHandler conform to SAX2 (see source comment) + - Re-implemented WFC: Entity Declared from XML 1.0 spec and + added a new error "entity declared in parameter entity": + see SF bug report #569461 and SF patch #578161 + - Re-implemented section 5.1 from XML 1.0 spec: + see SF bug report #570263 and SF patch #578161 + +Release 1.95.3 Mon Jun 3 2002 + - Added a project to the MSVC workspace to create a wchar_t + version of the library; the DLLs are named libexpatw.dll. + - Changed the name of the Windows DLLs from expat.dll to + libexpat.dll; this fixes SF bug #432456. + - Added the XML_ParserReset() API function. + - Fixed XML_SetReturnNSTriplet() to work for element names. + - Made the XML_UNICODE builds usable (thanks, Karl!). + - Allow xmlwf to read from standard input. + - Install a man page for xmlwf on Unix systems. + - Fixed many bugs; see SF bug reports #231864, #461380, #464837, + #466885, #469226, #477667, #484419, #487840, #494749, #496505, + #547350. Other bugs which we can't test as easily may also + have been fixed, especially in the area of build support. + +Release 1.95.2 Fri Jul 27 2001 + - More changes to make MSVC happy with the build; add a single + workspace to support both the library and xmlwf application. + - Added a Windows installer for Windows users; includes + xmlwf.exe. + - Added compile-time constants that can be used to determine the + Expat version + - Removed a lot of GNU-specific dependencies to aide portability + among the various Unix flavors. + - Fix the UTF-8 BOM bug. + - Cleaned up warning messages for several compilers. + - Added the -Wall, -Wstrict-prototypes options for GCC. + +Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 + - Changes to get expat to build under Microsoft compiler + - Removed all aborts and instead return an UNEXPECTED_STATE error. + - Fixed a bug where a stray '%' in an entity value would cause an + abort. + - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for + finding this oversight. + - Changed default patterns in lib/Makefile.in to fit non-GNU makes + Thanks to robin@unrated.net for reporting and providing an + account to test on. + - The reference had the wrong label for XML_SetStartNamespaceDecl. + Reported by an anonymous user. + +Release 1.95.0 Fri Sep 29 2000 + - XML_ParserCreate_MM + Allows you to set a memory management suite to replace the + standard malloc,realloc, and free. + - XML_SetReturnNSTriplet + If you turn this feature on when namespace processing is in + effect, then qualified, prefixed element and attribute names + are returned as "uri|name|prefix" where '|' is whatever + separator character is used in namespace processing. + - Merged in features from perl-expat + o XML_SetElementDeclHandler + o XML_SetAttlistDeclHandler + o XML_SetXmlDeclHandler + o XML_SetEntityDeclHandler + o StartDoctypeDeclHandler takes 3 additional parameters: + sysid, pubid, has_internal_subset + o Many paired handler setters (like XML_SetElementHandler) + now have corresponding individual handler setters + o XML_GetInputContext for getting the input context of + the current parse position. + - Added reference material + - Packaged into a distribution that builds a sharable library diff --git a/testbed/astropy__astropy/cextern/expat/README.md b/testbed/astropy__astropy/cextern/expat/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2c7e6ac40506590305b9cdb2ee17de5d7c1ee414 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/README.md @@ -0,0 +1,126 @@ +[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) + + +# Expat, Release 2.2.6 + +This is Expat, a C library for parsing XML, started by +[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. +Expat is a stream-oriented XML parser. This means that you register +handlers with the parser before starting the parse. These handlers +are called when the parser discovers the associated structures in the +document being parsed. A start tag is an example of the kind of +structures for which you may register handlers. + +Windows users should use the +[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), +which includes both precompiled libraries and executables, and source code for +developers. + +Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html). +You may copy, distribute, and modify it under the terms of the License +contained in the file +[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING) +distributed with this package. +This license is the same as the MIT/X Consortium license. + +If you are building Expat from a check-out from the +[Git repository](https://github.com/libexpat/libexpat/), +you need to run a script that generates the configure script using the +GNU autoconf and libtool tools. To do this, you need to have +autoconf 2.58 or newer. Run the script like this: + +```console +./buildconf.sh +``` + +Once this has been done, follow the same instructions as for building +from a source distribution. + +To build Expat from a source distribution, you first run the +configuration shell script in the top level distribution directory: + +```console +./configure +``` + +There are many options which you may provide to configure (which you +can discover by running configure with the `--help` option). But the +one of most interest is the one that sets the installation directory. +By default, the configure script will set things up to install +libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and +`xmlwf` into `/usr/local/bin`. If, for example, you'd prefer to install +into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and +`/home/me/mystuff/bin`, you can tell `configure` about that with: + +```console +./configure --prefix=/home/me/mystuff +``` + +Another interesting option is to enable 64-bit integer support for +line and column numbers and the over-all byte index: + +```console +./configure CPPFLAGS=-DXML_LARGE_SIZE +``` + +However, such a modification would be a breaking change to the ABI +and is therefore not recommended for general use — e.g. as part of +a Linux distribution — but rather for builds with special requirements. + +After running the configure script, the `make` command will build +things and `make install` will install things into their proper +location. Have a look at the `Makefile` to learn about additional +`make` options. Note that you need to have write permission into +the directories into which things will be installed. + +If you are interested in building Expat to provide document +information in UTF-16 encoding rather than the default UTF-8, follow +these instructions (after having run `make distclean`). +Please note that we configure with `--without-xmlwf` as xmlwf does not +support this mode of compilation (yet): + +1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name: +
+ `find -name Makefile.am -exec sed + -e 's,libexpat\.la,libexpatw.la,' + -e 's,libexpat_la,libexpatw_la,' + -i {} +` + +1. Run `automake` to re-write `Makefile.in` files:
+ `automake` + +1. For UTF-16 output as unsigned short (and version/error strings as char), + run:
+ `./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`
+ For UTF-16 output as `wchar_t` (incl. version/error strings), run:
+ `./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T + --without-xmlwf` +
Note: The latter requires libc compiled with `-fshort-wchar`, as well. + +1. Run `make` (which excludes xmlwf). + +1. Run `make install` (again, excludes xmlwf). + +Using `DESTDIR` is supported. It works as follows: + +```console +make install DESTDIR=/path/to/image +``` + +overrides the in-makefile set `DESTDIR`, because variable-setting priority is + +1. commandline +1. in-makefile +1. environment + +Note: This only applies to the Expat library itself, building UTF-16 versions +of xmlwf and the tests is currently not supported. + +When using Expat with a project using autoconf for configuration, you +can use the probing macro in `conftools/expat.m4` to determine how to +include Expat. See the comments at the top of that file for more +information. + +A reference manual is available in the file `doc/reference.html` in this +distribution. diff --git a/testbed/astropy__astropy/cextern/expat/README.txt b/testbed/astropy__astropy/cextern/expat/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..78f9e2aa901141140dee4fd6373d0cd367910d36 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/README.txt @@ -0,0 +1,2 @@ +Note: astropy only requires the expat library, and hence in this bundled version, +we removed all other files except the required license and changelog. diff --git a/testbed/astropy__astropy/cextern/expat/expat_config.h b/testbed/astropy__astropy/cextern/expat/expat_config.h new file mode 100644 index 0000000000000000000000000000000000000000..cebfdc9fe730fa591cfbac78364e093ef30a6616 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/expat_config.h @@ -0,0 +1,123 @@ +/* expat_config.h. Generated from expat_config.h.in by configure. */ +/* expat_config.h.in. Generated from configure.ac by autoheader. */ + +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#define BYTEORDER 1234 + +/* Define to 1 if you have the `arc4random' function. */ +/* #undef HAVE_ARC4RANDOM */ + +/* Define to 1 if you have the `arc4random_buf' function. */ +/* #undef HAVE_ARC4RANDOM_BUF */ + +/* Define to 1 if you have the `bcopy' function. */ +#define HAVE_BCOPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrandom' function. */ +#define HAVE_GETRANDOM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `bsd' library (-lbsd). */ +/* #undef HAVE_LIBBSD */ + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have `syscall' and `SYS_getrandom'. */ +/* #undef HAVE_SYSCALL_GETRANDOM */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "expat" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "expat" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "expat 2.2.6" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "expat" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.2.6" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.2.6" + +/* whether byteorder is bigendian */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to specify how much context to retain around the current parse + point. */ +#define XML_CONTEXT_BYTES 1024 + +/* Define to include code reading entropy from `/dev/urandom'. */ +#define XML_DEV_URANDOM 1 + +/* Define to make parameter entity parsing functionality available. */ +#define XML_DTD 1 + +/* Define to make XML Namespaces functionality available. */ +#define XML_NS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/testbed/astropy__astropy/cextern/expat/expat_config.h.in b/testbed/astropy__astropy/cextern/expat/expat_config.h.in new file mode 100644 index 0000000000000000000000000000000000000000..63c0d03eb83ded135175b98a8105f78d46562d36 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/expat_config.h.in @@ -0,0 +1,122 @@ +/* expat_config.h.in. Generated from configure.ac by autoheader. */ + +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#undef BYTEORDER + +/* Define to 1 if you have the `arc4random' function. */ +#undef HAVE_ARC4RANDOM + +/* Define to 1 if you have the `arc4random_buf' function. */ +#undef HAVE_ARC4RANDOM_BUF + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getrandom' function. */ +#undef HAVE_GETRANDOM + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have `syscall' and `SYS_getrandom'. */ +#undef HAVE_SYSCALL_GETRANDOM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* whether byteorder is bigendian */ +#undef WORDS_BIGENDIAN + +/* Define to specify how much context to retain around the current parse + point. */ +#undef XML_CONTEXT_BYTES + +/* Define to include code reading entropy from `/dev/urandom'. */ +#undef XML_DEV_URANDOM + +/* Define to make parameter entity parsing functionality available. */ +#undef XML_DTD + +/* Define to make XML Namespaces functionality available. */ +#undef XML_NS + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/testbed/astropy__astropy/cextern/expat/lib/Makefile.am b/testbed/astropy__astropy/cextern/expat/lib/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..534369e8af20ffb1352085bc74a7ea1b4d4bf5c4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/Makefile.am @@ -0,0 +1,76 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. + +include_HEADERS = \ + ../expat_config.h \ + expat.h \ + expat_external.h + +lib_LTLIBRARIES = libexpat.la + +libexpat_la_LDFLAGS = \ + -no-undefined \ + -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ + +libexpat_la_SOURCES = \ + loadlibrary.c \ + xmlparse.c \ + xmltok.c \ + xmlrole.c + +doc_DATA = \ + ../AUTHORS \ + ../Changes + +install-data-hook: + cd "$(DESTDIR)$(docdir)" && $(am__mv) Changes changelog + +uninstall-local: + $(RM) "$(DESTDIR)$(docdir)/changelog" + +EXTRA_DIST = \ + ascii.h \ + asciitab.h \ + expat_external.h \ + expat.h \ + iasciitab.h \ + internal.h \ + latin1tab.h \ + libexpat.def \ + libexpatw.def \ + nametab.h \ + siphash.h \ + utf8tab.h \ + winconfig.h \ + xmlrole.h \ + xmltok.h \ + xmltok_impl.c \ + xmltok_impl.h \ + xmltok_ns.c diff --git a/testbed/astropy__astropy/cextern/expat/lib/iasciitab.h b/testbed/astropy__astropy/cextern/expat/lib/iasciitab.h new file mode 100644 index 0000000000000000000000000000000000000000..ce4a4bf7edef533e5944fec5d932f374555cb89f --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/iasciitab.h @@ -0,0 +1,65 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ +/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, +/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, +/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, +/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, +/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, +/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, +/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, +/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, +/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, +/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, +/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/testbed/astropy__astropy/cextern/expat/lib/internal.h b/testbed/astropy__astropy/cextern/expat/lib/internal.h new file mode 100644 index 0000000000000000000000000000000000000000..e33fdcb0238d727c0c5097481a0548d906dca072 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/internal.h @@ -0,0 +1,124 @@ +/* internal.h + + Internal definitions used by Expat. This is not needed to compile + client code. + + The following calling convention macros are defined for frequently + called functions: + + FASTCALL - Used for those internal functions that have a simple + body and a low number of arguments and local variables. + + PTRCALL - Used for functions called though function pointers. + + PTRFASTCALL - Like PTRCALL, but for low number of arguments. + + inline - Used for selected internal functions for which inlining + may improve performance on some platforms. + + Note: Use of these macros is based on judgement, not hard rules, + and therefore subject to change. + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) +/* We'll use this version by default only where we know it helps. + + regparm() generates warnings on Solaris boxes. See SF bug #692878. + + Instability reported with egcs on a RedHat Linux 7.3. + Let's comment out: + #define FASTCALL __attribute__((stdcall, regparm(3))) + and let's try this: +*/ +#define FASTCALL __attribute__((regparm(3))) +#define PTRFASTCALL __attribute__((regparm(3))) +#endif + +/* Using __fastcall seems to have an unexpected negative effect under + MS VC++, especially for function pointers, so we won't use it for + now on that platform. It may be reconsidered for a future release + if it can be made more effective. + Likely reason: __fastcall on Windows is like stdcall, therefore + the compiler cannot perform stack optimizations for call clusters. +*/ + +/* Make sure all of these are defined if they aren't already. */ + +#ifndef FASTCALL +#define FASTCALL +#endif + +#ifndef PTRCALL +#define PTRCALL +#endif + +#ifndef PTRFASTCALL +#define PTRFASTCALL +#endif + +#ifndef XML_MIN_SIZE +#if !defined(__cplusplus) && !defined(inline) +#ifdef __GNUC__ +#define inline __inline +#endif /* __GNUC__ */ +#endif +#endif /* XML_MIN_SIZE */ + +#ifdef __cplusplus +#define inline inline +#else +#ifndef inline +#define inline +#endif +#endif + +#ifndef UNUSED_P +# ifdef __GNUC__ +# define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__)) +# else +# define UNUSED_P(p) UNUSED_ ## p +# endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +void +_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef); + + +#ifdef __cplusplus +} +#endif diff --git a/testbed/astropy__astropy/cextern/expat/lib/latin1tab.h b/testbed/astropy__astropy/cextern/expat/lib/latin1tab.h new file mode 100644 index 0000000000000000000000000000000000000000..95dfa52b1fbebba89611157548985a8feab873a6 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/latin1tab.h @@ -0,0 +1,64 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, +/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, diff --git a/testbed/astropy__astropy/cextern/expat/lib/libexpatw.def b/testbed/astropy__astropy/cextern/expat/lib/libexpatw.def new file mode 100644 index 0000000000000000000000000000000000000000..928e01b19c9be4570c894ff6710669e56e1b6d3b --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/libexpatw.def @@ -0,0 +1,78 @@ +; DEF file for MS VC++ + +LIBRARY +EXPORTS + XML_DefaultCurrent @1 + XML_ErrorString @2 + XML_ExpatVersion @3 + XML_ExpatVersionInfo @4 + XML_ExternalEntityParserCreate @5 + XML_GetBase @6 + XML_GetBuffer @7 + XML_GetCurrentByteCount @8 + XML_GetCurrentByteIndex @9 + XML_GetCurrentColumnNumber @10 + XML_GetCurrentLineNumber @11 + XML_GetErrorCode @12 + XML_GetIdAttributeIndex @13 + XML_GetInputContext @14 + XML_GetSpecifiedAttributeCount @15 + XML_Parse @16 + XML_ParseBuffer @17 + XML_ParserCreate @18 + XML_ParserCreateNS @19 + XML_ParserCreate_MM @20 + XML_ParserFree @21 + XML_SetAttlistDeclHandler @22 + XML_SetBase @23 + XML_SetCdataSectionHandler @24 + XML_SetCharacterDataHandler @25 + XML_SetCommentHandler @26 + XML_SetDefaultHandler @27 + XML_SetDefaultHandlerExpand @28 + XML_SetDoctypeDeclHandler @29 + XML_SetElementDeclHandler @30 + XML_SetElementHandler @31 + XML_SetEncoding @32 + XML_SetEndCdataSectionHandler @33 + XML_SetEndDoctypeDeclHandler @34 + XML_SetEndElementHandler @35 + XML_SetEndNamespaceDeclHandler @36 + XML_SetEntityDeclHandler @37 + XML_SetExternalEntityRefHandler @38 + XML_SetExternalEntityRefHandlerArg @39 + XML_SetNamespaceDeclHandler @40 + XML_SetNotStandaloneHandler @41 + XML_SetNotationDeclHandler @42 + XML_SetParamEntityParsing @43 + XML_SetProcessingInstructionHandler @44 + XML_SetReturnNSTriplet @45 + XML_SetStartCdataSectionHandler @46 + XML_SetStartDoctypeDeclHandler @47 + XML_SetStartElementHandler @48 + XML_SetStartNamespaceDeclHandler @49 + XML_SetUnknownEncodingHandler @50 + XML_SetUnparsedEntityDeclHandler @51 + XML_SetUserData @52 + XML_SetXmlDeclHandler @53 + XML_UseParserAsHandlerArg @54 +; added with version 1.95.3 + XML_ParserReset @55 + XML_SetSkippedEntityHandler @56 +; added with version 1.95.5 + XML_GetFeatureList @57 + XML_UseForeignDTD @58 +; added with version 1.95.6 + XML_FreeContentModel @59 + XML_MemMalloc @60 + XML_MemRealloc @61 + XML_MemFree @62 +; added with version 1.95.8 + XML_StopParser @63 + XML_ResumeParser @64 + XML_GetParsingStatus @65 +; added with version 2.1.1 +; XML_GetAttributeInfo @66 + XML_SetHashSalt @67@ +; added with version 2.2.5 + _INTERNAL_trim_to_complete_utf8_characters @68@ diff --git a/testbed/astropy__astropy/cextern/expat/lib/siphash.h b/testbed/astropy__astropy/cextern/expat/lib/siphash.h new file mode 100644 index 0000000000000000000000000000000000000000..4d6786d7839a2c1a99989930afec3dbe8789a2bc --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/siphash.h @@ -0,0 +1,391 @@ +/* ========================================================================== + * siphash.h - SipHash-2-4 in a single header file + * -------------------------------------------------------------------------- + * Derived by William Ahern from the reference implementation[1] published[2] + * by Jean-Philippe Aumasson and Daniel J. Berstein. + * Minimal changes by Sebastian Pipping and Victor Stinner on top, see below. + * Licensed under the CC0 Public Domain Dedication license. + * + * 1. https://www.131002.net/siphash/siphash24.c + * 2. https://www.131002.net/siphash/ + * -------------------------------------------------------------------------- + * HISTORY: + * + * 2018-07-08 (Anton Maklakov) + * - Add "fall through" markers for GCC's -Wimplicit-fallthrough + * + * 2017-11-03 (Sebastian Pipping) + * - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined + * + * 2017-07-25 (Vadim Zeitlin) + * - Fix use of SIPHASH_MAIN macro + * + * 2017-07-05 (Sebastian Pipping) + * - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++ + * - Add const qualifiers at two places + * - Ensure <=80 characters line length (assuming tab width 4) + * + * 2017-06-23 (Victor Stinner) + * - Address Win64 compile warnings + * + * 2017-06-18 (Sebastian Pipping) + * - Clarify license note in the header + * - Address C89 issues: + * - Stop using inline keyword (and let compiler decide) + * - Replace _Bool by int + * - Turn macro siphash24 into a function + * - Address invalid conversion (void pointer) by explicit cast + * - Address lack of stdint.h for Visual Studio 2003 to 2008 + * - Always expose sip24_valid (for self-tests) + * + * 2012-11-04 - Born. (William Ahern) + * -------------------------------------------------------------------------- + * USAGE: + * + * SipHash-2-4 takes as input two 64-bit words as the key, some number of + * message bytes, and outputs a 64-bit word as the message digest. This + * implementation employs two data structures: a struct sipkey for + * representing the key, and a struct siphash for representing the hash + * state. + * + * For converting a 16-byte unsigned char array to a key, use either the + * macro sip_keyof or the routine sip_tokey. The former instantiates a + * compound literal key, while the latter requires a key object as a + * parameter. + * + * unsigned char secret[16]; + * arc4random_buf(secret, sizeof secret); + * struct sipkey *key = sip_keyof(secret); + * + * For hashing a message, use either the convenience macro siphash24 or the + * routines sip24_init, sip24_update, and sip24_final. + * + * struct siphash state; + * void *msg; + * size_t len; + * uint64_t hash; + * + * sip24_init(&state, key); + * sip24_update(&state, msg, len); + * hash = sip24_final(&state); + * + * or + * + * hash = siphash24(msg, len, key); + * + * To convert the 64-bit hash value to a canonical 8-byte little-endian + * binary representation, use either the macro sip_binof or the routine + * sip_tobin. The former instantiates and returns a compound literal array, + * while the latter requires an array object as a parameter. + * -------------------------------------------------------------------------- + * NOTES: + * + * o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers + * lacking compound literal support. Instead, you must use the lower-level + * interfaces which take as parameters the temporary state objects. + * + * o Uppercase macros may evaluate parameters more than once. Lowercase + * macros should not exhibit any such side effects. + * ========================================================================== + */ +#ifndef SIPHASH_H +#define SIPHASH_H + +#include /* size_t */ + +#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600) + /* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */ + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; +#else + #include /* uint64_t uint32_t uint8_t */ +#endif + + +/* + * Workaround to not require a C++11 compiler for using ULL suffix + * if this code is included and compiled as C++; related GCC warning is: + * warning: use of C++11 long long integer constant [-Wlong-long] + */ +#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low) + + +#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b)))) + +#define SIP_U32TO8_LE(p, v) \ + (p)[0] = (uint8_t)((v) >> 0); (p)[1] = (uint8_t)((v) >> 8); \ + (p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24); + +#define SIP_U64TO8_LE(p, v) \ + SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \ + SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32)); + +#define SIP_U8TO64_LE(p) \ + (((uint64_t)((p)[0]) << 0) | \ + ((uint64_t)((p)[1]) << 8) | \ + ((uint64_t)((p)[2]) << 16) | \ + ((uint64_t)((p)[3]) << 24) | \ + ((uint64_t)((p)[4]) << 32) | \ + ((uint64_t)((p)[5]) << 40) | \ + ((uint64_t)((p)[6]) << 48) | \ + ((uint64_t)((p)[7]) << 56)) + + +#define SIPHASH_INITIALIZER { 0, 0, 0, 0, { 0 }, 0, 0 } + +struct siphash { + uint64_t v0, v1, v2, v3; + + unsigned char buf[8], *p; + uint64_t c; +}; /* struct siphash */ + + +#define SIP_KEYLEN 16 + +struct sipkey { + uint64_t k[2]; +}; /* struct sipkey */ + +#define sip_keyof(k) sip_tokey(&(struct sipkey){ { 0 } }, (k)) + +static struct sipkey *sip_tokey(struct sipkey *key, const void *src) { + key->k[0] = SIP_U8TO64_LE((const unsigned char *)src); + key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8); + return key; +} /* sip_tokey() */ + + +#ifdef SIPHASH_TOBIN + +#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v)) + +static void *sip_tobin(void *dst, uint64_t u64) { + SIP_U64TO8_LE((unsigned char *)dst, u64); + return dst; +} /* sip_tobin() */ + +#endif /* SIPHASH_TOBIN */ + + +static void sip_round(struct siphash *H, const int rounds) { + int i; + + for (i = 0; i < rounds; i++) { + H->v0 += H->v1; + H->v1 = SIP_ROTL(H->v1, 13); + H->v1 ^= H->v0; + H->v0 = SIP_ROTL(H->v0, 32); + + H->v2 += H->v3; + H->v3 = SIP_ROTL(H->v3, 16); + H->v3 ^= H->v2; + + H->v0 += H->v3; + H->v3 = SIP_ROTL(H->v3, 21); + H->v3 ^= H->v0; + + H->v2 += H->v1; + H->v1 = SIP_ROTL(H->v1, 17); + H->v1 ^= H->v2; + H->v2 = SIP_ROTL(H->v2, 32); + } +} /* sip_round() */ + + +static struct siphash *sip24_init(struct siphash *H, + const struct sipkey *key) { + H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; + H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; + H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; + H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; + + H->p = H->buf; + H->c = 0; + + return H; +} /* sip24_init() */ + + +#define sip_endof(a) (&(a)[sizeof (a) / sizeof *(a)]) + +static struct siphash *sip24_update(struct siphash *H, const void *src, + size_t len) { + const unsigned char *p = (const unsigned char *)src, *pe = p + len; + uint64_t m; + + do { + while (p < pe && H->p < sip_endof(H->buf)) + *H->p++ = *p++; + + if (H->p < sip_endof(H->buf)) + break; + + m = SIP_U8TO64_LE(H->buf); + H->v3 ^= m; + sip_round(H, 2); + H->v0 ^= m; + + H->p = H->buf; + H->c += 8; + } while (p < pe); + + return H; +} /* sip24_update() */ + + +static uint64_t sip24_final(struct siphash *H) { + const char left = (char)(H->p - H->buf); + uint64_t b = (H->c + left) << 56; + + switch (left) { + case 7: b |= (uint64_t)H->buf[6] << 48; + /* fall through */ + case 6: b |= (uint64_t)H->buf[5] << 40; + /* fall through */ + case 5: b |= (uint64_t)H->buf[4] << 32; + /* fall through */ + case 4: b |= (uint64_t)H->buf[3] << 24; + /* fall through */ + case 3: b |= (uint64_t)H->buf[2] << 16; + /* fall through */ + case 2: b |= (uint64_t)H->buf[1] << 8; + /* fall through */ + case 1: b |= (uint64_t)H->buf[0] << 0; + /* fall through */ + case 0: break; + } + + H->v3 ^= b; + sip_round(H, 2); + H->v0 ^= b; + H->v2 ^= 0xff; + sip_round(H, 4); + + return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; +} /* sip24_final() */ + + +static uint64_t siphash24(const void *src, size_t len, + const struct sipkey *key) { + struct siphash state = SIPHASH_INITIALIZER; + return sip24_final(sip24_update(sip24_init(&state, key), src, len)); +} /* siphash24() */ + + +/* + * SipHash-2-4 output with + * k = 00 01 02 ... + * and + * in = (empty string) + * in = 00 (1 byte) + * in = 00 01 (2 bytes) + * in = 00 01 02 (3 bytes) + * ... + * in = 00 01 02 ... 3e (63 bytes) + */ +static int sip24_valid(void) { + static const unsigned char vectors[64][8] = { + { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, }, + { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, }, + { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, }, + { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, }, + { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, }, + { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, }, + { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, }, + { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, }, + { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, }, + { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, }, + { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, }, + { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, }, + { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, }, + { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, }, + { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, }, + { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, }, + { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, }, + { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, }, + { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, }, + { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, }, + { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, }, + { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, }, + { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, }, + { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, }, + { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, }, + { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, }, + { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, }, + { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, }, + { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, }, + { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, }, + { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, }, + { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, }, + { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, }, + { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, }, + { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, }, + { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, }, + { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, }, + { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, }, + { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, }, + { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, }, + { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, }, + { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, }, + { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, }, + { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, }, + { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, }, + { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, }, + { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, }, + { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, }, + { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, }, + { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, }, + { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, }, + { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, }, + { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, }, + { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, }, + { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, }, + { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, }, + { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, }, + { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, }, + { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, }, + { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, }, + { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, }, + { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, }, + { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, }, + { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, } + }; + unsigned char in[64]; + struct sipkey k; + size_t i; + + sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011" + "\012\013\014\015\016\017"); + + for (i = 0; i < sizeof in; ++i) { + in[i] = (unsigned char)i; + + if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i])) + return 0; + } + + return 1; +} /* sip24_valid() */ + + +#ifdef SIPHASH_MAIN + +#include + +int main(void) { + const int ok = sip24_valid(); + + if (ok) + puts("OK"); + else + puts("FAIL"); + + return !ok; +} /* main() */ + +#endif /* SIPHASH_MAIN */ + + +#endif /* SIPHASH_H */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/utf8tab.h b/testbed/astropy__astropy/cextern/expat/lib/utf8tab.h new file mode 100644 index 0000000000000000000000000000000000000000..fa0bed6f5d751d070144e47efb4af938e90dc7cc --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/utf8tab.h @@ -0,0 +1,64 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, +/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, diff --git a/testbed/astropy__astropy/cextern/expat/lib/winconfig.h b/testbed/astropy__astropy/cextern/expat/lib/winconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..17fea4689001f4daaf9523ffb657c706ba1e329c --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/winconfig.h @@ -0,0 +1,63 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef WINCONFIG_H +#define WINCONFIG_H + +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN + +#include +#include + + +#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */ +# include +#else /* !defined(HAVE_EXPAT_CONFIG_H) */ + + +#define XML_NS 1 +#define XML_DTD 1 +#define XML_CONTEXT_BYTES 1024 + +/* we will assume all Windows platforms are little endian */ +#define BYTEORDER 1234 + +/* Windows has memmove() available. */ +#define HAVE_MEMMOVE + + +#endif /* !defined(HAVE_EXPAT_CONFIG_H) */ + + +#endif /* ndef WINCONFIG_H */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmlrole.h b/testbed/astropy__astropy/cextern/expat/lib/xmlrole.h new file mode 100644 index 0000000000000000000000000000000000000000..e5f048eab55c6e47c87dbe95f35132a98f3ee1c2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmlrole.h @@ -0,0 +1,142 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef XmlRole_INCLUDED +#define XmlRole_INCLUDED 1 + +#ifdef __VMS +/* 0 1 2 3 0 1 2 3 + 1234567890123456789012345678901 1234567890123456789012345678901 */ +#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt +#endif + +#include "xmltok.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + XML_ROLE_ERROR = -1, + XML_ROLE_NONE = 0, + XML_ROLE_XML_DECL, + XML_ROLE_INSTANCE_START, + XML_ROLE_DOCTYPE_NONE, + XML_ROLE_DOCTYPE_NAME, + XML_ROLE_DOCTYPE_SYSTEM_ID, + XML_ROLE_DOCTYPE_PUBLIC_ID, + XML_ROLE_DOCTYPE_INTERNAL_SUBSET, + XML_ROLE_DOCTYPE_CLOSE, + XML_ROLE_GENERAL_ENTITY_NAME, + XML_ROLE_PARAM_ENTITY_NAME, + XML_ROLE_ENTITY_NONE, + XML_ROLE_ENTITY_VALUE, + XML_ROLE_ENTITY_SYSTEM_ID, + XML_ROLE_ENTITY_PUBLIC_ID, + XML_ROLE_ENTITY_COMPLETE, + XML_ROLE_ENTITY_NOTATION_NAME, + XML_ROLE_NOTATION_NONE, + XML_ROLE_NOTATION_NAME, + XML_ROLE_NOTATION_SYSTEM_ID, + XML_ROLE_NOTATION_NO_SYSTEM_ID, + XML_ROLE_NOTATION_PUBLIC_ID, + XML_ROLE_ATTRIBUTE_NAME, + XML_ROLE_ATTRIBUTE_TYPE_CDATA, + XML_ROLE_ATTRIBUTE_TYPE_ID, + XML_ROLE_ATTRIBUTE_TYPE_IDREF, + XML_ROLE_ATTRIBUTE_TYPE_IDREFS, + XML_ROLE_ATTRIBUTE_TYPE_ENTITY, + XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, + XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, + XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, + XML_ROLE_ATTRIBUTE_ENUM_VALUE, + XML_ROLE_ATTRIBUTE_NOTATION_VALUE, + XML_ROLE_ATTLIST_NONE, + XML_ROLE_ATTLIST_ELEMENT_NAME, + XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, + XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, + XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, + XML_ROLE_FIXED_ATTRIBUTE_VALUE, + XML_ROLE_ELEMENT_NONE, + XML_ROLE_ELEMENT_NAME, + XML_ROLE_CONTENT_ANY, + XML_ROLE_CONTENT_EMPTY, + XML_ROLE_CONTENT_PCDATA, + XML_ROLE_GROUP_OPEN, + XML_ROLE_GROUP_CLOSE, + XML_ROLE_GROUP_CLOSE_REP, + XML_ROLE_GROUP_CLOSE_OPT, + XML_ROLE_GROUP_CLOSE_PLUS, + XML_ROLE_GROUP_CHOICE, + XML_ROLE_GROUP_SEQUENCE, + XML_ROLE_CONTENT_ELEMENT, + XML_ROLE_CONTENT_ELEMENT_REP, + XML_ROLE_CONTENT_ELEMENT_OPT, + XML_ROLE_CONTENT_ELEMENT_PLUS, + XML_ROLE_PI, + XML_ROLE_COMMENT, +#ifdef XML_DTD + XML_ROLE_TEXT_DECL, + XML_ROLE_IGNORE_SECT, + XML_ROLE_INNER_PARAM_ENTITY_REF, +#endif /* XML_DTD */ + XML_ROLE_PARAM_ENTITY_REF +}; + +typedef struct prolog_state { + int (PTRCALL *handler) (struct prolog_state *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc); + unsigned level; + int role_none; +#ifdef XML_DTD + unsigned includeLevel; + int documentEntity; + int inEntityValue; +#endif /* XML_DTD */ +} PROLOG_STATE; + +void XmlPrologStateInit(PROLOG_STATE *); +#ifdef XML_DTD +void XmlPrologStateInitExternalEntity(PROLOG_STATE *); +#endif /* XML_DTD */ + +#define XmlTokenRole(state, tok, ptr, end, enc) \ + (((state)->handler)(state, tok, ptr, end, enc)) + +#ifdef __cplusplus +} +#endif + +#endif /* not XmlRole_INCLUDED */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmltok.c b/testbed/astropy__astropy/cextern/expat/lib/xmltok.c new file mode 100644 index 0000000000000000000000000000000000000000..6b415d83972ca605a97c27eb36f75cdab37165c1 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmltok.c @@ -0,0 +1,1806 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include /* memcpy */ + +#if defined(_MSC_VER) && (_MSC_VER <= 1700) + /* for vs2012/11.0/1700 and earlier Visual Studio compilers */ +# define bool int +# define false 0 +# define true 1 +#else +# include +#endif + + +#ifdef _WIN32 +#include "winconfig.h" +#else +#ifdef HAVE_EXPAT_CONFIG_H +#include +#endif +#endif /* ndef _WIN32 */ + +#include "expat_external.h" +#include "internal.h" +#include "xmltok.h" +#include "nametab.h" + +#ifdef XML_DTD +#define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok) +#else +#define IGNORE_SECTION_TOK_VTABLE /* as nothing */ +#endif + +#define VTABLE1 \ + { PREFIX(prologTok), PREFIX(contentTok), \ + PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \ + { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ + PREFIX(nameMatchesAscii), \ + PREFIX(nameLength), \ + PREFIX(skipS), \ + PREFIX(getAtts), \ + PREFIX(charRefNumber), \ + PREFIX(predefinedEntityName), \ + PREFIX(updatePosition), \ + PREFIX(isPublicId) + +#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) + +#define UCS2_GET_NAMING(pages, hi, lo) \ + (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1u << ((lo) & 0x1F))) + +/* A 2 byte UTF-8 representation splits the characters 11 bits between + the bottom 5 and 6 bits of the bytes. We need 8 bits to index into + pages, 3 bits to add to that index and 5 bits to generate the mask. +*/ +#define UTF8_GET_NAMING2(pages, byte) \ + (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ + + ((((byte)[0]) & 3) << 1) \ + + ((((byte)[1]) >> 5) & 1)] \ + & (1u << (((byte)[1]) & 0x1F))) + +/* A 3 byte UTF-8 representation splits the characters 16 bits between + the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index + into pages, 3 bits to add to that index and 5 bits to generate the + mask. +*/ +#define UTF8_GET_NAMING3(pages, byte) \ + (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ + + ((((byte)[1]) >> 2) & 0xF)] \ + << 3) \ + + ((((byte)[1]) & 3) << 1) \ + + ((((byte)[2]) >> 5) & 1)] \ + & (1u << (((byte)[2]) & 0x1F))) + +#define UTF8_GET_NAMING(pages, p, n) \ + ((n) == 2 \ + ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ + : ((n) == 3 \ + ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ + : 0)) + +/* Detection of invalid UTF-8 sequences is based on Table 3.1B + of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/ + with the additional restriction of not allowing the Unicode + code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE). + Implementation details: + (A & 0x80) == 0 means A < 0x80 + and + (A & 0xC0) == 0xC0 means A > 0xBF +*/ + +#define UTF8_INVALID2(p) \ + ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0) + +#define UTF8_INVALID3(p) \ + (((p)[2] & 0x80) == 0 \ + || \ + ((*p) == 0xEF && (p)[1] == 0xBF \ + ? \ + (p)[2] > 0xBD \ + : \ + ((p)[2] & 0xC0) == 0xC0) \ + || \ + ((*p) == 0xE0 \ + ? \ + (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \ + : \ + ((p)[1] & 0x80) == 0 \ + || \ + ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0))) + +#define UTF8_INVALID4(p) \ + (((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 \ + || \ + ((p)[2] & 0x80) == 0 || ((p)[2] & 0xC0) == 0xC0 \ + || \ + ((*p) == 0xF0 \ + ? \ + (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \ + : \ + ((p)[1] & 0x80) == 0 \ + || \ + ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0))) + +static int PTRFASTCALL +isNever(const ENCODING *UNUSED_P(enc), const char *UNUSED_P(p)) +{ + return 0; +} + +static int PTRFASTCALL +utf8_isName2(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); +} + +static int PTRFASTCALL +utf8_isName3(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); +} + +#define utf8_isName4 isNever + +static int PTRFASTCALL +utf8_isNmstrt2(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); +} + +static int PTRFASTCALL +utf8_isNmstrt3(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); +} + +#define utf8_isNmstrt4 isNever + +static int PTRFASTCALL +utf8_isInvalid2(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_INVALID2((const unsigned char *)p); +} + +static int PTRFASTCALL +utf8_isInvalid3(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_INVALID3((const unsigned char *)p); +} + +static int PTRFASTCALL +utf8_isInvalid4(const ENCODING *UNUSED_P(enc), const char *p) +{ + return UTF8_INVALID4((const unsigned char *)p); +} + +struct normal_encoding { + ENCODING enc; + unsigned char type[256]; +#ifdef XML_MIN_SIZE + int (PTRFASTCALL *byteType)(const ENCODING *, const char *); + int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *); + int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *); + int (PTRCALL *charMatches)(const ENCODING *, const char *, int); +#endif /* XML_MIN_SIZE */ + int (PTRFASTCALL *isName2)(const ENCODING *, const char *); + int (PTRFASTCALL *isName3)(const ENCODING *, const char *); + int (PTRFASTCALL *isName4)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *); + int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *); + int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *); +}; + +#define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc)) + +#ifdef XML_MIN_SIZE + +#define STANDARD_VTABLE(E) \ + E ## byteType, \ + E ## isNameMin, \ + E ## isNmstrtMin, \ + E ## byteToAscii, \ + E ## charMatches, + +#else + +#define STANDARD_VTABLE(E) /* as nothing */ + +#endif + +#define NORMAL_VTABLE(E) \ + E ## isName2, \ + E ## isName3, \ + E ## isName4, \ + E ## isNmstrt2, \ + E ## isNmstrt3, \ + E ## isNmstrt4, \ + E ## isInvalid2, \ + E ## isInvalid3, \ + E ## isInvalid4 + +#define NULL_VTABLE \ + /* isName2 */ NULL, \ + /* isName3 */ NULL, \ + /* isName4 */ NULL, \ + /* isNmstrt2 */ NULL, \ + /* isNmstrt3 */ NULL, \ + /* isNmstrt4 */ NULL, \ + /* isInvalid2 */ NULL, \ + /* isInvalid3 */ NULL, \ + /* isInvalid4 */ NULL + +static int FASTCALL checkCharRefNumber(int); + +#include "xmltok_impl.h" +#include "ascii.h" + +#ifdef XML_MIN_SIZE +#define sb_isNameMin isNever +#define sb_isNmstrtMin isNever +#endif + +#ifdef XML_MIN_SIZE +#define MINBPC(enc) ((enc)->minBytesPerChar) +#else +/* minimum bytes per character */ +#define MINBPC(enc) 1 +#endif + +#define SB_BYTE_TYPE(enc, p) \ + (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) + +#ifdef XML_MIN_SIZE +static int PTRFASTCALL +sb_byteType(const ENCODING *enc, const char *p) +{ + return SB_BYTE_TYPE(enc, p); +} +#define BYTE_TYPE(enc, p) \ + (AS_NORMAL_ENCODING(enc)->byteType(enc, p)) +#else +#define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) +#endif + +#ifdef XML_MIN_SIZE +#define BYTE_TO_ASCII(enc, p) \ + (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p)) +static int PTRFASTCALL +sb_byteToAscii(const ENCODING *enc, const char *p) +{ + return *p; +} +#else +#define BYTE_TO_ASCII(enc, p) (*(p)) +#endif + +#define IS_NAME_CHAR(enc, p, n) \ + (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p)) +#define IS_NMSTRT_CHAR(enc, p, n) \ + (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p)) +#define IS_INVALID_CHAR(enc, p, n) \ + (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p)) + +#ifdef XML_MIN_SIZE +#define IS_NAME_CHAR_MINBPC(enc, p) \ + (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p)) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ + (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p)) +#else +#define IS_NAME_CHAR_MINBPC(enc, p) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) +#endif + +#ifdef XML_MIN_SIZE +#define CHAR_MATCHES(enc, p, c) \ + (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c)) +static int PTRCALL +sb_charMatches(const ENCODING *enc, const char *p, int c) +{ + return *p == c; +} +#else +/* c is an ASCII character */ +#define CHAR_MATCHES(enc, p, c) (*(p) == c) +#endif + +#define PREFIX(ident) normal_ ## ident +#define XML_TOK_IMPL_C +#include "xmltok_impl.c" +#undef XML_TOK_IMPL_C + +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ + UTF8_cval1 = 0x00, + UTF8_cval2 = 0xc0, + UTF8_cval3 = 0xe0, + UTF8_cval4 = 0xf0 +}; + +void +_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef) +{ + const char * fromLim = *fromLimRef; + size_t walked = 0; + for (; fromLim > from; fromLim--, walked++) { + const unsigned char prev = (unsigned char)fromLim[-1]; + if ((prev & 0xf8u) == 0xf0u) { /* 4-byte character, lead by 0b11110xxx byte */ + if (walked + 1 >= 4) { + fromLim += 4 - 1; + break; + } else { + walked = 0; + } + } else if ((prev & 0xf0u) == 0xe0u) { /* 3-byte character, lead by 0b1110xxxx byte */ + if (walked + 1 >= 3) { + fromLim += 3 - 1; + break; + } else { + walked = 0; + } + } else if ((prev & 0xe0u) == 0xc0u) { /* 2-byte character, lead by 0b110xxxxx byte */ + if (walked + 1 >= 2) { + fromLim += 2 - 1; + break; + } else { + walked = 0; + } + } else if ((prev & 0x80u) == 0x00u) { /* 1-byte character, matching 0b0xxxxxxx */ + break; + } + } + *fromLimRef = fromLim; +} + +static enum XML_Convert_Result PTRCALL +utf8_toUtf8(const ENCODING *UNUSED_P(enc), + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + bool input_incomplete = false; + bool output_exhausted = false; + + /* Avoid copying partial characters (due to limited space). */ + const ptrdiff_t bytesAvailable = fromLim - *fromP; + const ptrdiff_t bytesStorable = toLim - *toP; + if (bytesAvailable > bytesStorable) { + fromLim = *fromP + bytesStorable; + output_exhausted = true; + } + + /* Avoid copying partial characters (from incomplete input). */ + { + const char * const fromLimBefore = fromLim; + _INTERNAL_trim_to_complete_utf8_characters(*fromP, &fromLim); + if (fromLim < fromLimBefore) { + input_incomplete = true; + } + } + + { + const ptrdiff_t bytesToCopy = fromLim - *fromP; + memcpy(*toP, *fromP, bytesToCopy); + *fromP += bytesToCopy; + *toP += bytesToCopy; + } + + if (output_exhausted) /* needs to go first */ + return XML_CONVERT_OUTPUT_EXHAUSTED; + else if (input_incomplete) + return XML_CONVERT_INPUT_INCOMPLETE; + else + return XML_CONVERT_COMPLETED; +} + +static enum XML_Convert_Result PTRCALL +utf8_toUtf16(const ENCODING *enc, + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + enum XML_Convert_Result res = XML_CONVERT_COMPLETED; + unsigned short *to = *toP; + const char *from = *fromP; + while (from < fromLim && to < toLim) { + switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { + case BT_LEAD2: + if (fromLim - from < 2) { + res = XML_CONVERT_INPUT_INCOMPLETE; + goto after; + } + *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f)); + from += 2; + break; + case BT_LEAD3: + if (fromLim - from < 3) { + res = XML_CONVERT_INPUT_INCOMPLETE; + goto after; + } + *to++ = (unsigned short)(((from[0] & 0xf) << 12) + | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); + from += 3; + break; + case BT_LEAD4: + { + unsigned long n; + if (toLim - to < 2) { + res = XML_CONVERT_OUTPUT_EXHAUSTED; + goto after; + } + if (fromLim - from < 4) { + res = XML_CONVERT_INPUT_INCOMPLETE; + goto after; + } + n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) + | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); + n -= 0x10000; + to[0] = (unsigned short)((n >> 10) | 0xD800); + to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); + to += 2; + from += 4; + } + break; + default: + *to++ = *from++; + break; + } + } + if (from < fromLim) + res = XML_CONVERT_OUTPUT_EXHAUSTED; +after: + *fromP = from; + *toP = to; + return res; +} + +#ifdef XML_NS +static const struct normal_encoding utf8_encoding_ns = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#include "asciitab.h" +#include "utf8tab.h" + }, + STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) +}; +#endif + +static const struct normal_encoding utf8_encoding = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#define BT_COLON BT_NMSTRT +#include "asciitab.h" +#undef BT_COLON +#include "utf8tab.h" + }, + STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) +}; + +#ifdef XML_NS + +static const struct normal_encoding internal_utf8_encoding_ns = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#include "iasciitab.h" +#include "utf8tab.h" + }, + STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) +}; + +#endif + +static const struct normal_encoding internal_utf8_encoding = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#define BT_COLON BT_NMSTRT +#include "iasciitab.h" +#undef BT_COLON +#include "utf8tab.h" + }, + STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) +}; + +static enum XML_Convert_Result PTRCALL +latin1_toUtf8(const ENCODING *UNUSED_P(enc), + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + for (;;) { + unsigned char c; + if (*fromP == fromLim) + return XML_CONVERT_COMPLETED; + c = (unsigned char)**fromP; + if (c & 0x80) { + if (toLim - *toP < 2) + return XML_CONVERT_OUTPUT_EXHAUSTED; + *(*toP)++ = (char)((c >> 6) | UTF8_cval2); + *(*toP)++ = (char)((c & 0x3f) | 0x80); + (*fromP)++; + } + else { + if (*toP == toLim) + return XML_CONVERT_OUTPUT_EXHAUSTED; + *(*toP)++ = *(*fromP)++; + } + } +} + +static enum XML_Convert_Result PTRCALL +latin1_toUtf16(const ENCODING *UNUSED_P(enc), + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + while (*fromP < fromLim && *toP < toLim) + *(*toP)++ = (unsigned char)*(*fromP)++; + + if ((*toP == toLim) && (*fromP < fromLim)) + return XML_CONVERT_OUTPUT_EXHAUSTED; + else + return XML_CONVERT_COMPLETED; +} + +#ifdef XML_NS + +static const struct normal_encoding latin1_encoding_ns = { + { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, + { +#include "asciitab.h" +#include "latin1tab.h" + }, + STANDARD_VTABLE(sb_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding latin1_encoding = { + { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, + { +#define BT_COLON BT_NMSTRT +#include "asciitab.h" +#undef BT_COLON +#include "latin1tab.h" + }, + STANDARD_VTABLE(sb_) NULL_VTABLE +}; + +static enum XML_Convert_Result PTRCALL +ascii_toUtf8(const ENCODING *UNUSED_P(enc), + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + while (*fromP < fromLim && *toP < toLim) + *(*toP)++ = *(*fromP)++; + + if ((*toP == toLim) && (*fromP < fromLim)) + return XML_CONVERT_OUTPUT_EXHAUSTED; + else + return XML_CONVERT_COMPLETED; +} + +#ifdef XML_NS + +static const struct normal_encoding ascii_encoding_ns = { + { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, + { +#include "asciitab.h" +/* BT_NONXML == 0 */ + }, + STANDARD_VTABLE(sb_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding ascii_encoding = { + { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, + { +#define BT_COLON BT_NMSTRT +#include "asciitab.h" +#undef BT_COLON +/* BT_NONXML == 0 */ + }, + STANDARD_VTABLE(sb_) NULL_VTABLE +}; + +static int PTRFASTCALL +unicode_byte_type(char hi, char lo) +{ + switch ((unsigned char)hi) { + case 0xD8: case 0xD9: case 0xDA: case 0xDB: + return BT_LEAD4; + case 0xDC: case 0xDD: case 0xDE: case 0xDF: + return BT_TRAIL; + case 0xFF: + switch ((unsigned char)lo) { + case 0xFF: + case 0xFE: + return BT_NONXML; + } + break; + } + return BT_NONASCII; +} + +#define DEFINE_UTF16_TO_UTF8(E) \ +static enum XML_Convert_Result PTRCALL \ +E ## toUtf8(const ENCODING *UNUSED_P(enc), \ + const char **fromP, const char *fromLim, \ + char **toP, const char *toLim) \ +{ \ + const char *from = *fromP; \ + fromLim = from + (((fromLim - from) >> 1) << 1); /* shrink to even */ \ + for (; from < fromLim; from += 2) { \ + int plane; \ + unsigned char lo2; \ + unsigned char lo = GET_LO(from); \ + unsigned char hi = GET_HI(from); \ + switch (hi) { \ + case 0: \ + if (lo < 0x80) { \ + if (*toP == toLim) { \ + *fromP = from; \ + return XML_CONVERT_OUTPUT_EXHAUSTED; \ + } \ + *(*toP)++ = lo; \ + break; \ + } \ + /* fall through */ \ + case 0x1: case 0x2: case 0x3: \ + case 0x4: case 0x5: case 0x6: case 0x7: \ + if (toLim - *toP < 2) { \ + *fromP = from; \ + return XML_CONVERT_OUTPUT_EXHAUSTED; \ + } \ + *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ + *(*toP)++ = ((lo & 0x3f) | 0x80); \ + break; \ + default: \ + if (toLim - *toP < 3) { \ + *fromP = from; \ + return XML_CONVERT_OUTPUT_EXHAUSTED; \ + } \ + /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ + *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ + *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ + *(*toP)++ = ((lo & 0x3f) | 0x80); \ + break; \ + case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ + if (toLim - *toP < 4) { \ + *fromP = from; \ + return XML_CONVERT_OUTPUT_EXHAUSTED; \ + } \ + if (fromLim - from < 4) { \ + *fromP = from; \ + return XML_CONVERT_INPUT_INCOMPLETE; \ + } \ + plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ + *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ + *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ + from += 2; \ + lo2 = GET_LO(from); \ + *(*toP)++ = (((lo & 0x3) << 4) \ + | ((GET_HI(from) & 0x3) << 2) \ + | (lo2 >> 6) \ + | 0x80); \ + *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ + break; \ + } \ + } \ + *fromP = from; \ + if (from < fromLim) \ + return XML_CONVERT_INPUT_INCOMPLETE; \ + else \ + return XML_CONVERT_COMPLETED; \ +} + +#define DEFINE_UTF16_TO_UTF16(E) \ +static enum XML_Convert_Result PTRCALL \ +E ## toUtf16(const ENCODING *UNUSED_P(enc), \ + const char **fromP, const char *fromLim, \ + unsigned short **toP, const unsigned short *toLim) \ +{ \ + enum XML_Convert_Result res = XML_CONVERT_COMPLETED; \ + fromLim = *fromP + (((fromLim - *fromP) >> 1) << 1); /* shrink to even */ \ + /* Avoid copying first half only of surrogate */ \ + if (fromLim - *fromP > ((toLim - *toP) << 1) \ + && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) { \ + fromLim -= 2; \ + res = XML_CONVERT_INPUT_INCOMPLETE; \ + } \ + for (; *fromP < fromLim && *toP < toLim; *fromP += 2) \ + *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ + if ((*toP == toLim) && (*fromP < fromLim)) \ + return XML_CONVERT_OUTPUT_EXHAUSTED; \ + else \ + return res; \ +} + +#define SET2(ptr, ch) \ + (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) +#define GET_LO(ptr) ((unsigned char)(ptr)[0]) +#define GET_HI(ptr) ((unsigned char)(ptr)[1]) + +DEFINE_UTF16_TO_UTF8(little2_) +DEFINE_UTF16_TO_UTF16(little2_) + +#undef SET2 +#undef GET_LO +#undef GET_HI + +#define SET2(ptr, ch) \ + (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) +#define GET_LO(ptr) ((unsigned char)(ptr)[1]) +#define GET_HI(ptr) ((unsigned char)(ptr)[0]) + +DEFINE_UTF16_TO_UTF8(big2_) +DEFINE_UTF16_TO_UTF16(big2_) + +#undef SET2 +#undef GET_LO +#undef GET_HI + +#define LITTLE2_BYTE_TYPE(enc, p) \ + ((p)[1] == 0 \ + ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ + : unicode_byte_type((p)[1], (p)[0])) +#define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) +#define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) +#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) +#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) + +#ifdef XML_MIN_SIZE + +static int PTRFASTCALL +little2_byteType(const ENCODING *enc, const char *p) +{ + return LITTLE2_BYTE_TYPE(enc, p); +} + +static int PTRFASTCALL +little2_byteToAscii(const ENCODING *enc, const char *p) +{ + return LITTLE2_BYTE_TO_ASCII(enc, p); +} + +static int PTRCALL +little2_charMatches(const ENCODING *enc, const char *p, int c) +{ + return LITTLE2_CHAR_MATCHES(enc, p, c); +} + +static int PTRFASTCALL +little2_isNameMin(const ENCODING *enc, const char *p) +{ + return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); +} + +static int PTRFASTCALL +little2_isNmstrtMin(const ENCODING *enc, const char *p) +{ + return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); +} + +#undef VTABLE +#define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 + +#else /* not XML_MIN_SIZE */ + +#undef PREFIX +#define PREFIX(ident) little2_ ## ident +#define MINBPC(enc) 2 +/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ +#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) +#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) +#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) +#define IS_NAME_CHAR(enc, p, n) 0 +#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) +#define IS_NMSTRT_CHAR(enc, p, n) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) + +#define XML_TOK_IMPL_C +#include "xmltok_impl.c" +#undef XML_TOK_IMPL_C + +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +#endif /* not XML_MIN_SIZE */ + +#ifdef XML_NS + +static const struct normal_encoding little2_encoding_ns = { + { VTABLE, 2, 0, +#if BYTEORDER == 1234 + 1 +#else + 0 +#endif + }, + { +#include "asciitab.h" +#include "latin1tab.h" + }, + STANDARD_VTABLE(little2_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding little2_encoding = { + { VTABLE, 2, 0, +#if BYTEORDER == 1234 + 1 +#else + 0 +#endif + }, + { +#define BT_COLON BT_NMSTRT +#include "asciitab.h" +#undef BT_COLON +#include "latin1tab.h" + }, + STANDARD_VTABLE(little2_) NULL_VTABLE +}; + +#if BYTEORDER != 4321 + +#ifdef XML_NS + +static const struct normal_encoding internal_little2_encoding_ns = { + { VTABLE, 2, 0, 1 }, + { +#include "iasciitab.h" +#include "latin1tab.h" + }, + STANDARD_VTABLE(little2_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding internal_little2_encoding = { + { VTABLE, 2, 0, 1 }, + { +#define BT_COLON BT_NMSTRT +#include "iasciitab.h" +#undef BT_COLON +#include "latin1tab.h" + }, + STANDARD_VTABLE(little2_) NULL_VTABLE +}; + +#endif + + +#define BIG2_BYTE_TYPE(enc, p) \ + ((p)[0] == 0 \ + ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ + : unicode_byte_type((p)[0], (p)[1])) +#define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) +#define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) +#define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) +#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) + +#ifdef XML_MIN_SIZE + +static int PTRFASTCALL +big2_byteType(const ENCODING *enc, const char *p) +{ + return BIG2_BYTE_TYPE(enc, p); +} + +static int PTRFASTCALL +big2_byteToAscii(const ENCODING *enc, const char *p) +{ + return BIG2_BYTE_TO_ASCII(enc, p); +} + +static int PTRCALL +big2_charMatches(const ENCODING *enc, const char *p, int c) +{ + return BIG2_CHAR_MATCHES(enc, p, c); +} + +static int PTRFASTCALL +big2_isNameMin(const ENCODING *enc, const char *p) +{ + return BIG2_IS_NAME_CHAR_MINBPC(enc, p); +} + +static int PTRFASTCALL +big2_isNmstrtMin(const ENCODING *enc, const char *p) +{ + return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); +} + +#undef VTABLE +#define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16 + +#else /* not XML_MIN_SIZE */ + +#undef PREFIX +#define PREFIX(ident) big2_ ## ident +#define MINBPC(enc) 2 +/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ +#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) +#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) +#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) +#define IS_NAME_CHAR(enc, p, n) 0 +#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) +#define IS_NMSTRT_CHAR(enc, p, n) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) + +#define XML_TOK_IMPL_C +#include "xmltok_impl.c" +#undef XML_TOK_IMPL_C + +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +#endif /* not XML_MIN_SIZE */ + +#ifdef XML_NS + +static const struct normal_encoding big2_encoding_ns = { + { VTABLE, 2, 0, +#if BYTEORDER == 4321 + 1 +#else + 0 +#endif + }, + { +#include "asciitab.h" +#include "latin1tab.h" + }, + STANDARD_VTABLE(big2_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding big2_encoding = { + { VTABLE, 2, 0, +#if BYTEORDER == 4321 + 1 +#else + 0 +#endif + }, + { +#define BT_COLON BT_NMSTRT +#include "asciitab.h" +#undef BT_COLON +#include "latin1tab.h" + }, + STANDARD_VTABLE(big2_) NULL_VTABLE +}; + +#if BYTEORDER != 1234 + +#ifdef XML_NS + +static const struct normal_encoding internal_big2_encoding_ns = { + { VTABLE, 2, 0, 1 }, + { +#include "iasciitab.h" +#include "latin1tab.h" + }, + STANDARD_VTABLE(big2_) NULL_VTABLE +}; + +#endif + +static const struct normal_encoding internal_big2_encoding = { + { VTABLE, 2, 0, 1 }, + { +#define BT_COLON BT_NMSTRT +#include "iasciitab.h" +#undef BT_COLON +#include "latin1tab.h" + }, + STANDARD_VTABLE(big2_) NULL_VTABLE +}; + +#endif + +#undef PREFIX + +static int FASTCALL +streqci(const char *s1, const char *s2) +{ + for (;;) { + char c1 = *s1++; + char c2 = *s2++; + if (ASCII_a <= c1 && c1 <= ASCII_z) + c1 += ASCII_A - ASCII_a; + if (ASCII_a <= c2 && c2 <= ASCII_z) + /* The following line will never get executed. streqci() is + * only called from two places, both of which guarantee to put + * upper-case strings into s2. + */ + c2 += ASCII_A - ASCII_a; /* LCOV_EXCL_LINE */ + if (c1 != c2) + return 0; + if (!c1) + break; + } + return 1; +} + +static void PTRCALL +initUpdatePosition(const ENCODING *UNUSED_P(enc), const char *ptr, + const char *end, POSITION *pos) +{ + normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); +} + +static int +toAscii(const ENCODING *enc, const char *ptr, const char *end) +{ + char buf[1]; + char *p = buf; + XmlUtf8Convert(enc, &ptr, end, &p, p + 1); + if (p == buf) + return -1; + else + return buf[0]; +} + +static int FASTCALL +isSpace(int c) +{ + switch (c) { + case 0x20: + case 0xD: + case 0xA: + case 0x9: + return 1; + } + return 0; +} + +/* Return 1 if there's just optional white space or there's an S + followed by name=val. +*/ +static int +parsePseudoAttribute(const ENCODING *enc, + const char *ptr, + const char *end, + const char **namePtr, + const char **nameEndPtr, + const char **valPtr, + const char **nextTokPtr) +{ + int c; + char open; + if (ptr == end) { + *namePtr = NULL; + return 1; + } + if (!isSpace(toAscii(enc, ptr, end))) { + *nextTokPtr = ptr; + return 0; + } + do { + ptr += enc->minBytesPerChar; + } while (isSpace(toAscii(enc, ptr, end))); + if (ptr == end) { + *namePtr = NULL; + return 1; + } + *namePtr = ptr; + for (;;) { + c = toAscii(enc, ptr, end); + if (c == -1) { + *nextTokPtr = ptr; + return 0; + } + if (c == ASCII_EQUALS) { + *nameEndPtr = ptr; + break; + } + if (isSpace(c)) { + *nameEndPtr = ptr; + do { + ptr += enc->minBytesPerChar; + } while (isSpace(c = toAscii(enc, ptr, end))); + if (c != ASCII_EQUALS) { + *nextTokPtr = ptr; + return 0; + } + break; + } + ptr += enc->minBytesPerChar; + } + if (ptr == *namePtr) { + *nextTokPtr = ptr; + return 0; + } + ptr += enc->minBytesPerChar; + c = toAscii(enc, ptr, end); + while (isSpace(c)) { + ptr += enc->minBytesPerChar; + c = toAscii(enc, ptr, end); + } + if (c != ASCII_QUOT && c != ASCII_APOS) { + *nextTokPtr = ptr; + return 0; + } + open = (char)c; + ptr += enc->minBytesPerChar; + *valPtr = ptr; + for (;; ptr += enc->minBytesPerChar) { + c = toAscii(enc, ptr, end); + if (c == open) + break; + if (!(ASCII_a <= c && c <= ASCII_z) + && !(ASCII_A <= c && c <= ASCII_Z) + && !(ASCII_0 <= c && c <= ASCII_9) + && c != ASCII_PERIOD + && c != ASCII_MINUS + && c != ASCII_UNDERSCORE) { + *nextTokPtr = ptr; + return 0; + } + } + *nextTokPtr = ptr + enc->minBytesPerChar; + return 1; +} + +static const char KW_version[] = { + ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0' +}; + +static const char KW_encoding[] = { + ASCII_e, ASCII_n, ASCII_c, ASCII_o, ASCII_d, ASCII_i, ASCII_n, ASCII_g, '\0' +}; + +static const char KW_standalone[] = { + ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, + ASCII_n, ASCII_e, '\0' +}; + +static const char KW_yes[] = { + ASCII_y, ASCII_e, ASCII_s, '\0' +}; + +static const char KW_no[] = { + ASCII_n, ASCII_o, '\0' +}; + +static int +doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, + const char *, + const char *), + int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingName, + const ENCODING **encoding, + int *standalone) +{ + const char *val = NULL; + const char *name = NULL; + const char *nameEnd = NULL; + ptr += 5 * enc->minBytesPerChar; + end -= 2 * enc->minBytesPerChar; + if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) + || !name) { + *badPtr = ptr; + return 0; + } + if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) { + if (!isGeneralTextEntity) { + *badPtr = name; + return 0; + } + } + else { + if (versionPtr) + *versionPtr = val; + if (versionEndPtr) + *versionEndPtr = ptr; + if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { + *badPtr = ptr; + return 0; + } + if (!name) { + if (isGeneralTextEntity) { + /* a TextDecl must have an EncodingDecl */ + *badPtr = ptr; + return 0; + } + return 1; + } + } + if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) { + int c = toAscii(enc, val, end); + if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z)) { + *badPtr = val; + return 0; + } + if (encodingName) + *encodingName = val; + if (encoding) + *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar); + if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { + *badPtr = ptr; + return 0; + } + if (!name) + return 1; + } + if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) + || isGeneralTextEntity) { + *badPtr = name; + return 0; + } + if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) { + if (standalone) + *standalone = 1; + } + else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) { + if (standalone) + *standalone = 0; + } + else { + *badPtr = val; + return 0; + } + while (isSpace(toAscii(enc, ptr, end))) + ptr += enc->minBytesPerChar; + if (ptr != end) { + *badPtr = ptr; + return 0; + } + return 1; +} + +static int FASTCALL +checkCharRefNumber(int result) +{ + switch (result >> 8) { + case 0xD8: case 0xD9: case 0xDA: case 0xDB: + case 0xDC: case 0xDD: case 0xDE: case 0xDF: + return -1; + case 0: + if (latin1_encoding.type[result] == BT_NONXML) + return -1; + break; + case 0xFF: + if (result == 0xFFFE || result == 0xFFFF) + return -1; + break; + } + return result; +} + +int FASTCALL +XmlUtf8Encode(int c, char *buf) +{ + enum { + /* minN is minimum legal resulting value for N byte sequence */ + min2 = 0x80, + min3 = 0x800, + min4 = 0x10000 + }; + + if (c < 0) + return 0; /* LCOV_EXCL_LINE: this case is always eliminated beforehand */ + if (c < min2) { + buf[0] = (char)(c | UTF8_cval1); + return 1; + } + if (c < min3) { + buf[0] = (char)((c >> 6) | UTF8_cval2); + buf[1] = (char)((c & 0x3f) | 0x80); + return 2; + } + if (c < min4) { + buf[0] = (char)((c >> 12) | UTF8_cval3); + buf[1] = (char)(((c >> 6) & 0x3f) | 0x80); + buf[2] = (char)((c & 0x3f) | 0x80); + return 3; + } + if (c < 0x110000) { + buf[0] = (char)((c >> 18) | UTF8_cval4); + buf[1] = (char)(((c >> 12) & 0x3f) | 0x80); + buf[2] = (char)(((c >> 6) & 0x3f) | 0x80); + buf[3] = (char)((c & 0x3f) | 0x80); + return 4; + } + return 0; /* LCOV_EXCL_LINE: this case too is eliminated before calling */ +} + +int FASTCALL +XmlUtf16Encode(int charNum, unsigned short *buf) +{ + if (charNum < 0) + return 0; + if (charNum < 0x10000) { + buf[0] = (unsigned short)charNum; + return 1; + } + if (charNum < 0x110000) { + charNum -= 0x10000; + buf[0] = (unsigned short)((charNum >> 10) + 0xD800); + buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00); + return 2; + } + return 0; +} + +struct unknown_encoding { + struct normal_encoding normal; + CONVERTER convert; + void *userData; + unsigned short utf16[256]; + char utf8[256][4]; +}; + +#define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc)) + +int +XmlSizeOfUnknownEncoding(void) +{ + return sizeof(struct unknown_encoding); +} + +static int PTRFASTCALL +unknown_isName(const ENCODING *enc, const char *p) +{ + const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); + int c = uenc->convert(uenc->userData, p); + if (c & ~0xFFFF) + return 0; + return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); +} + +static int PTRFASTCALL +unknown_isNmstrt(const ENCODING *enc, const char *p) +{ + const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); + int c = uenc->convert(uenc->userData, p); + if (c & ~0xFFFF) + return 0; + return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); +} + +static int PTRFASTCALL +unknown_isInvalid(const ENCODING *enc, const char *p) +{ + const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); + int c = uenc->convert(uenc->userData, p); + return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; +} + +static enum XML_Convert_Result PTRCALL +unknown_toUtf8(const ENCODING *enc, + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); + char buf[XML_UTF8_ENCODE_MAX]; + for (;;) { + const char *utf8; + int n; + if (*fromP == fromLim) + return XML_CONVERT_COMPLETED; + utf8 = uenc->utf8[(unsigned char)**fromP]; + n = *utf8++; + if (n == 0) { + int c = uenc->convert(uenc->userData, *fromP); + n = XmlUtf8Encode(c, buf); + if (n > toLim - *toP) + return XML_CONVERT_OUTPUT_EXHAUSTED; + utf8 = buf; + *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] + - (BT_LEAD2 - 2)); + } + else { + if (n > toLim - *toP) + return XML_CONVERT_OUTPUT_EXHAUSTED; + (*fromP)++; + } + memcpy(*toP, utf8, n); + *toP += n; + } +} + +static enum XML_Convert_Result PTRCALL +unknown_toUtf16(const ENCODING *enc, + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); + while (*fromP < fromLim && *toP < toLim) { + unsigned short c = uenc->utf16[(unsigned char)**fromP]; + if (c == 0) { + c = (unsigned short) + uenc->convert(uenc->userData, *fromP); + *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] + - (BT_LEAD2 - 2)); + } + else + (*fromP)++; + *(*toP)++ = c; + } + + if ((*toP == toLim) && (*fromP < fromLim)) + return XML_CONVERT_OUTPUT_EXHAUSTED; + else + return XML_CONVERT_COMPLETED; +} + +ENCODING * +XmlInitUnknownEncoding(void *mem, + int *table, + CONVERTER convert, + void *userData) +{ + int i; + struct unknown_encoding *e = (struct unknown_encoding *)mem; + for (i = 0; i < (int)sizeof(struct normal_encoding); i++) + ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; + for (i = 0; i < 128; i++) + if (latin1_encoding.type[i] != BT_OTHER + && latin1_encoding.type[i] != BT_NONXML + && table[i] != i) + return 0; + for (i = 0; i < 256; i++) { + int c = table[i]; + if (c == -1) { + e->normal.type[i] = BT_MALFORM; + /* This shouldn't really get used. */ + e->utf16[i] = 0xFFFF; + e->utf8[i][0] = 1; + e->utf8[i][1] = 0; + } + else if (c < 0) { + if (c < -4) + return 0; + /* Multi-byte sequences need a converter function */ + if (!convert) + return 0; + e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2)); + e->utf8[i][0] = 0; + e->utf16[i] = 0; + } + else if (c < 0x80) { + if (latin1_encoding.type[c] != BT_OTHER + && latin1_encoding.type[c] != BT_NONXML + && c != i) + return 0; + e->normal.type[i] = latin1_encoding.type[c]; + e->utf8[i][0] = 1; + e->utf8[i][1] = (char)c; + e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c); + } + else if (checkCharRefNumber(c) < 0) { + e->normal.type[i] = BT_NONXML; + /* This shouldn't really get used. */ + e->utf16[i] = 0xFFFF; + e->utf8[i][0] = 1; + e->utf8[i][1] = 0; + } + else { + if (c > 0xFFFF) + return 0; + if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) + e->normal.type[i] = BT_NMSTRT; + else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) + e->normal.type[i] = BT_NAME; + else + e->normal.type[i] = BT_OTHER; + e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); + e->utf16[i] = (unsigned short)c; + } + } + e->userData = userData; + e->convert = convert; + if (convert) { + e->normal.isName2 = unknown_isName; + e->normal.isName3 = unknown_isName; + e->normal.isName4 = unknown_isName; + e->normal.isNmstrt2 = unknown_isNmstrt; + e->normal.isNmstrt3 = unknown_isNmstrt; + e->normal.isNmstrt4 = unknown_isNmstrt; + e->normal.isInvalid2 = unknown_isInvalid; + e->normal.isInvalid3 = unknown_isInvalid; + e->normal.isInvalid4 = unknown_isInvalid; + } + e->normal.enc.utf8Convert = unknown_toUtf8; + e->normal.enc.utf16Convert = unknown_toUtf16; + return &(e->normal.enc); +} + +/* If this enumeration is changed, getEncodingIndex and encodings +must also be changed. */ +enum { + UNKNOWN_ENC = -1, + ISO_8859_1_ENC = 0, + US_ASCII_ENC, + UTF_8_ENC, + UTF_16_ENC, + UTF_16BE_ENC, + UTF_16LE_ENC, + /* must match encodingNames up to here */ + NO_ENC +}; + +static const char KW_ISO_8859_1[] = { + ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, + ASCII_MINUS, ASCII_1, '\0' +}; +static const char KW_US_ASCII[] = { + ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, + '\0' +}; +static const char KW_UTF_8[] = { + ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0' +}; +static const char KW_UTF_16[] = { + ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0' +}; +static const char KW_UTF_16BE[] = { + ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, + '\0' +}; +static const char KW_UTF_16LE[] = { + ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, + '\0' +}; + +static int FASTCALL +getEncodingIndex(const char *name) +{ + static const char * const encodingNames[] = { + KW_ISO_8859_1, + KW_US_ASCII, + KW_UTF_8, + KW_UTF_16, + KW_UTF_16BE, + KW_UTF_16LE, + }; + int i; + if (name == NULL) + return NO_ENC; + for (i = 0; i < (int)(sizeof(encodingNames)/sizeof(encodingNames[0])); i++) + if (streqci(name, encodingNames[i])) + return i; + return UNKNOWN_ENC; +} + +/* For binary compatibility, we store the index of the encoding + specified at initialization in the isUtf16 member. +*/ + +#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) +#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) + +/* This is what detects the encoding. encodingTable maps from + encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of + the external (protocol) specified encoding; state is + XML_CONTENT_STATE if we're parsing an external text entity, and + XML_PROLOG_STATE otherwise. +*/ + + +static int +initScan(const ENCODING * const *encodingTable, + const INIT_ENCODING *enc, + int state, + const char *ptr, + const char *end, + const char **nextTokPtr) +{ + const ENCODING **encPtr; + + if (ptr >= end) + return XML_TOK_NONE; + encPtr = enc->encPtr; + if (ptr + 1 == end) { + /* only a single byte available for auto-detection */ +#ifndef XML_DTD /* FIXME */ + /* a well-formed document entity must have more than one byte */ + if (state != XML_CONTENT_STATE) + return XML_TOK_PARTIAL; +#endif + /* so we're parsing an external text entity... */ + /* if UTF-16 was externally specified, then we need at least 2 bytes */ + switch (INIT_ENC_INDEX(enc)) { + case UTF_16_ENC: + case UTF_16LE_ENC: + case UTF_16BE_ENC: + return XML_TOK_PARTIAL; + } + switch ((unsigned char)*ptr) { + case 0xFE: + case 0xFF: + case 0xEF: /* possibly first byte of UTF-8 BOM */ + if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC + && state == XML_CONTENT_STATE) + break; + /* fall through */ + case 0x00: + case 0x3C: + return XML_TOK_PARTIAL; + } + } + else { + switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { + case 0xFEFF: + if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC + && state == XML_CONTENT_STATE) + break; + *nextTokPtr = ptr + 2; + *encPtr = encodingTable[UTF_16BE_ENC]; + return XML_TOK_BOM; + /* 00 3C is handled in the default case */ + case 0x3C00: + if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC + || INIT_ENC_INDEX(enc) == UTF_16_ENC) + && state == XML_CONTENT_STATE) + break; + *encPtr = encodingTable[UTF_16LE_ENC]; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); + case 0xFFFE: + if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC + && state == XML_CONTENT_STATE) + break; + *nextTokPtr = ptr + 2; + *encPtr = encodingTable[UTF_16LE_ENC]; + return XML_TOK_BOM; + case 0xEFBB: + /* Maybe a UTF-8 BOM (EF BB BF) */ + /* If there's an explicitly specified (external) encoding + of ISO-8859-1 or some flavour of UTF-16 + and this is an external text entity, + don't look for the BOM, + because it might be a legal data. + */ + if (state == XML_CONTENT_STATE) { + int e = INIT_ENC_INDEX(enc); + if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC + || e == UTF_16LE_ENC || e == UTF_16_ENC) + break; + } + if (ptr + 2 == end) + return XML_TOK_PARTIAL; + if ((unsigned char)ptr[2] == 0xBF) { + *nextTokPtr = ptr + 3; + *encPtr = encodingTable[UTF_8_ENC]; + return XML_TOK_BOM; + } + break; + default: + if (ptr[0] == '\0') { + /* 0 isn't a legal data character. Furthermore a document + entity can only start with ASCII characters. So the only + way this can fail to be big-endian UTF-16 if it it's an + external parsed general entity that's labelled as + UTF-16LE. + */ + if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) + break; + *encPtr = encodingTable[UTF_16BE_ENC]; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); + } + else if (ptr[1] == '\0') { + /* We could recover here in the case: + - parsing an external entity + - second byte is 0 + - no externally specified encoding + - no encoding declaration + by assuming UTF-16LE. But we don't, because this would mean when + presented just with a single byte, we couldn't reliably determine + whether we needed further bytes. + */ + if (state == XML_CONTENT_STATE) + break; + *encPtr = encodingTable[UTF_16LE_ENC]; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); + } + break; + } + } + *encPtr = encodingTable[INIT_ENC_INDEX(enc)]; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); +} + + +#define NS(x) x +#define ns(x) x +#define XML_TOK_NS_C +#include "xmltok_ns.c" +#undef XML_TOK_NS_C +#undef NS +#undef ns + +#ifdef XML_NS + +#define NS(x) x ## NS +#define ns(x) x ## _ns + +#define XML_TOK_NS_C +#include "xmltok_ns.c" +#undef XML_TOK_NS_C + +#undef NS +#undef ns + +ENCODING * +XmlInitUnknownEncodingNS(void *mem, + int *table, + CONVERTER convert, + void *userData) +{ + ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); + if (enc) + ((struct normal_encoding *)enc)->type[ASCII_COLON] = BT_COLON; + return enc; +} + +#endif /* XML_NS */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmltok.h b/testbed/astropy__astropy/cextern/expat/lib/xmltok.h new file mode 100644 index 0000000000000000000000000000000000000000..50926f38ab323ea24a6f6db451a0061bb743a062 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmltok.h @@ -0,0 +1,345 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef XmlTok_INCLUDED +#define XmlTok_INCLUDED 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* The following token may be returned by XmlContentTok */ +#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be + start of illegal ]]> sequence */ +/* The following tokens may be returned by both XmlPrologTok and + XmlContentTok. +*/ +#define XML_TOK_NONE -4 /* The string to be scanned is empty */ +#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; + might be part of CRLF sequence */ +#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ +#define XML_TOK_PARTIAL -1 /* only part of a token */ +#define XML_TOK_INVALID 0 + +/* The following tokens are returned by XmlContentTok; some are also + returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. +*/ +#define XML_TOK_START_TAG_WITH_ATTS 1 +#define XML_TOK_START_TAG_NO_ATTS 2 +#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ +#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 +#define XML_TOK_END_TAG 5 +#define XML_TOK_DATA_CHARS 6 +#define XML_TOK_DATA_NEWLINE 7 +#define XML_TOK_CDATA_SECT_OPEN 8 +#define XML_TOK_ENTITY_REF 9 +#define XML_TOK_CHAR_REF 10 /* numeric character reference */ + +/* The following tokens may be returned by both XmlPrologTok and + XmlContentTok. +*/ +#define XML_TOK_PI 11 /* processing instruction */ +#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ +#define XML_TOK_COMMENT 13 +#define XML_TOK_BOM 14 /* Byte order mark */ + +/* The following tokens are returned only by XmlPrologTok */ +#define XML_TOK_PROLOG_S 15 +#define XML_TOK_DECL_OPEN 16 /* */ +#define XML_TOK_NAME 18 +#define XML_TOK_NMTOKEN 19 +#define XML_TOK_POUND_NAME 20 /* #name */ +#define XML_TOK_OR 21 /* | */ +#define XML_TOK_PERCENT 22 +#define XML_TOK_OPEN_PAREN 23 +#define XML_TOK_CLOSE_PAREN 24 +#define XML_TOK_OPEN_BRACKET 25 +#define XML_TOK_CLOSE_BRACKET 26 +#define XML_TOK_LITERAL 27 +#define XML_TOK_PARAM_ENTITY_REF 28 +#define XML_TOK_INSTANCE_START 29 + +/* The following occur only in element type declarations */ +#define XML_TOK_NAME_QUESTION 30 /* name? */ +#define XML_TOK_NAME_ASTERISK 31 /* name* */ +#define XML_TOK_NAME_PLUS 32 /* name+ */ +#define XML_TOK_COND_SECT_OPEN 33 /* */ +#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ +#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ +#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ +#define XML_TOK_COMMA 38 + +/* The following token is returned only by XmlAttributeValueTok */ +#define XML_TOK_ATTRIBUTE_VALUE_S 39 + +/* The following token is returned only by XmlCdataSectionTok */ +#define XML_TOK_CDATA_SECT_CLOSE 40 + +/* With namespace processing this is returned by XmlPrologTok for a + name with a colon. +*/ +#define XML_TOK_PREFIXED_NAME 41 + +#ifdef XML_DTD +#define XML_TOK_IGNORE_SECT 42 +#endif /* XML_DTD */ + +#ifdef XML_DTD +#define XML_N_STATES 4 +#else /* not XML_DTD */ +#define XML_N_STATES 3 +#endif /* not XML_DTD */ + +#define XML_PROLOG_STATE 0 +#define XML_CONTENT_STATE 1 +#define XML_CDATA_SECTION_STATE 2 +#ifdef XML_DTD +#define XML_IGNORE_SECTION_STATE 3 +#endif /* XML_DTD */ + +#define XML_N_LITERAL_TYPES 2 +#define XML_ATTRIBUTE_VALUE_LITERAL 0 +#define XML_ENTITY_VALUE_LITERAL 1 + +/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ +#define XML_UTF8_ENCODE_MAX 4 +/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ +#define XML_UTF16_ENCODE_MAX 2 + +typedef struct position { + /* first line and first column are 0 not 1 */ + XML_Size lineNumber; + XML_Size columnNumber; +} POSITION; + +typedef struct { + const char *name; + const char *valuePtr; + const char *valueEnd; + char normalized; +} ATTRIBUTE; + +struct encoding; +typedef struct encoding ENCODING; + +typedef int (PTRCALL *SCANNER)(const ENCODING *, + const char *, + const char *, + const char **); + +enum XML_Convert_Result { + XML_CONVERT_COMPLETED = 0, + XML_CONVERT_INPUT_INCOMPLETE = 1, + XML_CONVERT_OUTPUT_EXHAUSTED = 2 /* and therefore potentially input remaining as well */ +}; + +struct encoding { + SCANNER scanners[XML_N_STATES]; + SCANNER literalScanners[XML_N_LITERAL_TYPES]; + int (PTRCALL *nameMatchesAscii)(const ENCODING *, + const char *, + const char *, + const char *); + int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); + const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); + int (PTRCALL *getAtts)(const ENCODING *enc, + const char *ptr, + int attsMax, + ATTRIBUTE *atts); + int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); + int (PTRCALL *predefinedEntityName)(const ENCODING *, + const char *, + const char *); + void (PTRCALL *updatePosition)(const ENCODING *, + const char *ptr, + const char *end, + POSITION *); + int (PTRCALL *isPublicId)(const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr); + enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + char **toP, + const char *toLim); + enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + unsigned short **toP, + const unsigned short *toLim); + int minBytesPerChar; + char isUtf8; + char isUtf16; +}; + +/* Scan the string starting at ptr until the end of the next complete + token, but do not scan past eptr. Return an integer giving the + type of token. + + Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. + + Return XML_TOK_PARTIAL when the string does not contain a complete + token; nextTokPtr will not be set. + + Return XML_TOK_INVALID when the string does not start a valid + token; nextTokPtr will be set to point to the character which made + the token invalid. + + Otherwise the string starts with a valid token; nextTokPtr will be + set to point to the character following the end of that token. + + Each data character counts as a single token, but adjacent data + characters may be returned together. Similarly for characters in + the prolog outside literals, comments and processing instructions. +*/ + + +#define XmlTok(enc, state, ptr, end, nextTokPtr) \ + (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) + +#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) + +#define XmlContentTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) + +#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) + +#ifdef XML_DTD + +#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) + +#endif /* XML_DTD */ + +/* This is used for performing a 2nd-level tokenization on the content + of a literal that has already been returned by XmlTok. +*/ +#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ + (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) + +#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) + +#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) + +#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ + (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) + +#define XmlNameLength(enc, ptr) \ + (((enc)->nameLength)(enc, ptr)) + +#define XmlSkipS(enc, ptr) \ + (((enc)->skipS)(enc, ptr)) + +#define XmlGetAttributes(enc, ptr, attsMax, atts) \ + (((enc)->getAtts)(enc, ptr, attsMax, atts)) + +#define XmlCharRefNumber(enc, ptr) \ + (((enc)->charRefNumber)(enc, ptr)) + +#define XmlPredefinedEntityName(enc, ptr, end) \ + (((enc)->predefinedEntityName)(enc, ptr, end)) + +#define XmlUpdatePosition(enc, ptr, end, pos) \ + (((enc)->updatePosition)(enc, ptr, end, pos)) + +#define XmlIsPublicId(enc, ptr, end, badPtr) \ + (((enc)->isPublicId)(enc, ptr, end, badPtr)) + +#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ + (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) + +#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ + (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) + +typedef struct { + ENCODING initEnc; + const ENCODING **encPtr; +} INIT_ENCODING; + +int XmlParseXmlDecl(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingNamePtr, + const ENCODING **namedEncodingPtr, + int *standalonePtr); + +int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); +const ENCODING *XmlGetUtf8InternalEncoding(void); +const ENCODING *XmlGetUtf16InternalEncoding(void); +int FASTCALL XmlUtf8Encode(int charNumber, char *buf); +int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); +int XmlSizeOfUnknownEncoding(void); + + +typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); + +ENCODING * +XmlInitUnknownEncoding(void *mem, + int *table, + CONVERTER convert, + void *userData); + +int XmlParseXmlDeclNS(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingNamePtr, + const ENCODING **namedEncodingPtr, + int *standalonePtr); + +int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); +const ENCODING *XmlGetUtf8InternalEncodingNS(void); +const ENCODING *XmlGetUtf16InternalEncodingNS(void); +ENCODING * +XmlInitUnknownEncodingNS(void *mem, + int *table, + CONVERTER convert, + void *userData); +#ifdef __cplusplus +} +#endif + +#endif /* not XmlTok_INCLUDED */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.c b/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.c new file mode 100644 index 0000000000000000000000000000000000000000..4d9ae7dc3896b8393f8b41eeb98becdcb3bcaa46 --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.c @@ -0,0 +1,1763 @@ +/* This file is included! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifdef XML_TOK_IMPL_C + +#ifndef IS_INVALID_CHAR +#define IS_INVALID_CHAR(enc, ptr, n) (0) +#endif + +#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (IS_INVALID_CHAR(enc, ptr, n)) { \ + *(nextTokPtr) = (ptr); \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define INVALID_CASES(ptr, nextTokPtr) \ + INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ + INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ + INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ + case BT_NONXML: \ + case BT_MALFORM: \ + case BT_TRAIL: \ + *(nextTokPtr) = (ptr); \ + return XML_TOK_INVALID; + +#define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (!IS_NAME_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ + case BT_NONASCII: \ + if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + /* fall through */ \ + case BT_NMSTRT: \ + case BT_HEX: \ + case BT_DIGIT: \ + case BT_NAME: \ + case BT_MINUS: \ + ptr += MINBPC(enc); \ + break; \ + CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ + CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ + CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) + +#define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ + case BT_NONASCII: \ + if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + /* fall through */ \ + case BT_NMSTRT: \ + case BT_HEX: \ + ptr += MINBPC(enc); \ + break; \ + CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ + CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ + CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) + +#ifndef PREFIX +#define PREFIX(ident) ident +#endif + + +#define HAS_CHARS(enc, ptr, end, count) \ + (end - ptr >= count * MINBPC(enc)) + +#define HAS_CHAR(enc, ptr, end) \ + HAS_CHARS(enc, ptr, end, 1) + +#define REQUIRE_CHARS(enc, ptr, end, count) \ + { \ + if (! HAS_CHARS(enc, ptr, end, count)) { \ + return XML_TOK_PARTIAL; \ + } \ + } + +#define REQUIRE_CHAR(enc, ptr, end) \ + REQUIRE_CHARS(enc, ptr, end, 1) + + +/* ptr points to character following " */ + switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { + case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + /* fall through */ + case BT_S: case BT_CR: case BT_LF: + *nextTokPtr = ptr; + return XML_TOK_DECL_OPEN; + case BT_NMSTRT: + case BT_HEX: + ptr += MINBPC(enc); + break; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static int PTRCALL +PREFIX(checkPiTarget)(const ENCODING *UNUSED_P(enc), const char *ptr, + const char *end, int *tokPtr) +{ + int upper = 0; + *tokPtr = XML_TOK_PI; + if (end - ptr != MINBPC(enc)*3) + return 1; + switch (BYTE_TO_ASCII(enc, ptr)) { + case ASCII_x: + break; + case ASCII_X: + upper = 1; + break; + default: + return 1; + } + ptr += MINBPC(enc); + switch (BYTE_TO_ASCII(enc, ptr)) { + case ASCII_m: + break; + case ASCII_M: + upper = 1; + break; + default: + return 1; + } + ptr += MINBPC(enc); + switch (BYTE_TO_ASCII(enc, ptr)) { + case ASCII_l: + break; + case ASCII_L: + upper = 1; + break; + default: + return 1; + } + if (upper) + return 0; + *tokPtr = XML_TOK_XML_DECL; + return 1; +} + +/* ptr points to character following "= end) + return XML_TOK_NONE; + if (MINBPC(enc) > 1) { + size_t n = end - ptr; + if (n & (MINBPC(enc) - 1)) { + n &= ~(MINBPC(enc) - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } + switch (BYTE_TYPE(enc, ptr)) { + case BT_RSQB: + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) + break; + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { + ptr -= MINBPC(enc); + break; + } + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_CDATA_SECT_CLOSE; + case BT_CR: + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC(enc); + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + case BT_LF: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_DATA_NEWLINE; + INVALID_CASES(ptr, nextTokPtr) + default: + ptr += MINBPC(enc); + break; + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_DATA_CHARS; \ + } \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONXML: + case BT_MALFORM: + case BT_TRAIL: + case BT_CR: + case BT_LF: + case BT_RSQB: + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC(enc); + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +/* ptr points to character following "= end) + return XML_TOK_NONE; + if (MINBPC(enc) > 1) { + size_t n = end - ptr; + if (n & (MINBPC(enc) - 1)) { + n &= ~(MINBPC(enc) - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } + switch (BYTE_TYPE(enc, ptr)) { + case BT_LT: + return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_AMP: + return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_CR: + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC(enc); + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + case BT_LF: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_DATA_NEWLINE; + case BT_RSQB: + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return XML_TOK_TRAILING_RSQB; + if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) + break; + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return XML_TOK_TRAILING_RSQB; + if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { + ptr -= MINBPC(enc); + break; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + INVALID_CASES(ptr, nextTokPtr) + default: + ptr += MINBPC(enc); + break; + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_DATA_CHARS; \ + } \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_RSQB: + if (HAS_CHARS(enc, ptr, end, 2)) { + if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { + ptr += MINBPC(enc); + break; + } + if (HAS_CHARS(enc, ptr, end, 3)) { + if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) { + ptr += MINBPC(enc); + break; + } + *nextTokPtr = ptr + 2*MINBPC(enc); + return XML_TOK_INVALID; + } + } + /* fall through */ + case BT_AMP: + case BT_LT: + case BT_NONXML: + case BT_MALFORM: + case BT_TRAIL: + case BT_CR: + case BT_LF: + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC(enc); + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +/* ptr points to character following "%" */ + +static int PTRCALL +PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + REQUIRE_CHAR(enc, ptr, end); + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: + *nextTokPtr = ptr; + return XML_TOK_PERCENT; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_SEMI: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_PARAM_ENTITY_REF; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static int PTRCALL +PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + REQUIRE_CHAR(enc, ptr, end); + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_CR: case BT_LF: case BT_S: + case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: + *nextTokPtr = ptr; + return XML_TOK_POUND_NAME; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return -XML_TOK_POUND_NAME; +} + +static int PTRCALL +PREFIX(scanLit)(int open, const ENCODING *enc, + const char *ptr, const char *end, + const char **nextTokPtr) +{ + while (HAS_CHAR(enc, ptr, end)) { + int t = BYTE_TYPE(enc, ptr); + switch (t) { + INVALID_CASES(ptr, nextTokPtr) + case BT_QUOT: + case BT_APOS: + ptr += MINBPC(enc); + if (t != open) + break; + if (! HAS_CHAR(enc, ptr, end)) + return -XML_TOK_LITERAL; + *nextTokPtr = ptr; + switch (BYTE_TYPE(enc, ptr)) { + case BT_S: case BT_CR: case BT_LF: + case BT_GT: case BT_PERCNT: case BT_LSQB: + return XML_TOK_LITERAL; + default: + return XML_TOK_INVALID; + } + default: + ptr += MINBPC(enc); + break; + } + } + return XML_TOK_PARTIAL; +} + +static int PTRCALL +PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + int tok; + if (ptr >= end) + return XML_TOK_NONE; + if (MINBPC(enc) > 1) { + size_t n = end - ptr; + if (n & (MINBPC(enc) - 1)) { + n &= ~(MINBPC(enc) - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } + switch (BYTE_TYPE(enc, ptr)) { + case BT_QUOT: + return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_APOS: + return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_LT: + { + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + switch (BYTE_TYPE(enc, ptr)) { + case BT_EXCL: + return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_QUEST: + return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_NMSTRT: + case BT_HEX: + case BT_NONASCII: + case BT_LEAD2: + case BT_LEAD3: + case BT_LEAD4: + *nextTokPtr = ptr - MINBPC(enc); + return XML_TOK_INSTANCE_START; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + case BT_CR: + if (ptr + MINBPC(enc) == end) { + *nextTokPtr = end; + /* indicate that this might be part of a CR/LF pair */ + return -XML_TOK_PROLOG_S; + } + /* fall through */ + case BT_S: case BT_LF: + for (;;) { + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + break; + switch (BYTE_TYPE(enc, ptr)) { + case BT_S: case BT_LF: + break; + case BT_CR: + /* don't split CR/LF pair */ + if (ptr + MINBPC(enc) != end) + break; + /* fall through */ + default: + *nextTokPtr = ptr; + return XML_TOK_PROLOG_S; + } + } + *nextTokPtr = ptr; + return XML_TOK_PROLOG_S; + case BT_PERCNT: + return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); + case BT_COMMA: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_COMMA; + case BT_LSQB: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_OPEN_BRACKET; + case BT_RSQB: + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return -XML_TOK_CLOSE_BRACKET; + if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { + REQUIRE_CHARS(enc, ptr, end, 2); + if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { + *nextTokPtr = ptr + 2*MINBPC(enc); + return XML_TOK_COND_SECT_CLOSE; + } + } + *nextTokPtr = ptr; + return XML_TOK_CLOSE_BRACKET; + case BT_LPAR: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_OPEN_PAREN; + case BT_RPAR: + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return -XML_TOK_CLOSE_PAREN; + switch (BYTE_TYPE(enc, ptr)) { + case BT_AST: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_CLOSE_PAREN_ASTERISK; + case BT_QUEST: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_CLOSE_PAREN_QUESTION; + case BT_PLUS: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_CLOSE_PAREN_PLUS; + case BT_CR: case BT_LF: case BT_S: + case BT_GT: case BT_COMMA: case BT_VERBAR: + case BT_RPAR: + *nextTokPtr = ptr; + return XML_TOK_CLOSE_PAREN; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + case BT_VERBAR: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_OR; + case BT_GT: + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_DECL_CLOSE; + case BT_NUM: + return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ + ptr += n; \ + tok = XML_TOK_NAME; \ + break; \ + } \ + if (IS_NAME_CHAR(enc, ptr, n)) { \ + ptr += n; \ + tok = XML_TOK_NMTOKEN; \ + break; \ + } \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NMSTRT: + case BT_HEX: + tok = XML_TOK_NAME; + ptr += MINBPC(enc); + break; + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: +#ifdef XML_NS + case BT_COLON: +#endif + tok = XML_TOK_NMTOKEN; + ptr += MINBPC(enc); + break; + case BT_NONASCII: + if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { + ptr += MINBPC(enc); + tok = XML_TOK_NAME; + break; + } + if (IS_NAME_CHAR_MINBPC(enc, ptr)) { + ptr += MINBPC(enc); + tok = XML_TOK_NMTOKEN; + break; + } + /* fall through */ + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_GT: case BT_RPAR: case BT_COMMA: + case BT_VERBAR: case BT_LSQB: case BT_PERCNT: + case BT_S: case BT_CR: case BT_LF: + *nextTokPtr = ptr; + return tok; +#ifdef XML_NS + case BT_COLON: + ptr += MINBPC(enc); + switch (tok) { + case XML_TOK_NAME: + REQUIRE_CHAR(enc, ptr, end); + tok = XML_TOK_PREFIXED_NAME; + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + default: + tok = XML_TOK_NMTOKEN; + break; + } + break; + case XML_TOK_PREFIXED_NAME: + tok = XML_TOK_NMTOKEN; + break; + } + break; +#endif + case BT_PLUS: + if (tok == XML_TOK_NMTOKEN) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_NAME_PLUS; + case BT_AST: + if (tok == XML_TOK_NMTOKEN) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_NAME_ASTERISK; + case BT_QUEST: + if (tok == XML_TOK_NMTOKEN) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_NAME_QUESTION; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return -tok; +} + +static int PTRCALL +PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, + const char *end, const char **nextTokPtr) +{ + const char *start; + if (ptr >= end) + return XML_TOK_NONE; + else if (! HAS_CHAR(enc, ptr, end)) { + /* This line cannot be executed. The incoming data has already + * been tokenized once, so incomplete characters like this have + * already been eliminated from the input. Retaining the paranoia + * check is still valuable, however. + */ + return XML_TOK_PARTIAL; /* LCOV_EXCL_LINE */ + } + start = ptr; + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_AMP: + if (ptr == start) + return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_LT: + /* this is for inside entity references */ + *nextTokPtr = ptr; + return XML_TOK_INVALID; + case BT_LF: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_CR: + if (ptr == start) { + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC(enc); + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_S: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_ATTRIBUTE_VALUE_S; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC(enc); + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +static int PTRCALL +PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, + const char *end, const char **nextTokPtr) +{ + const char *start; + if (ptr >= end) + return XML_TOK_NONE; + else if (! HAS_CHAR(enc, ptr, end)) { + /* This line cannot be executed. The incoming data has already + * been tokenized once, so incomplete characters like this have + * already been eliminated from the input. Retaining the paranoia + * check is still valuable, however. + */ + return XML_TOK_PARTIAL; /* LCOV_EXCL_LINE */ + } + start = ptr; + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_AMP: + if (ptr == start) + return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_PERCNT: + if (ptr == start) { + int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), + end, nextTokPtr); + return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_LF: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC(enc); + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_CR: + if (ptr == start) { + ptr += MINBPC(enc); + if (! HAS_CHAR(enc, ptr, end)) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC(enc); + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC(enc); + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +#ifdef XML_DTD + +static int PTRCALL +PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, + const char *end, const char **nextTokPtr) +{ + int level = 0; + if (MINBPC(enc) > 1) { + size_t n = end - ptr; + if (n & (MINBPC(enc) - 1)) { + n &= ~(MINBPC(enc) - 1); + end = ptr + n; + } + } + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { + INVALID_CASES(ptr, nextTokPtr) + case BT_LT: + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { + ++level; + ptr += MINBPC(enc); + } + } + break; + case BT_RSQB: + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { + ptr += MINBPC(enc); + REQUIRE_CHAR(enc, ptr, end); + if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { + ptr += MINBPC(enc); + if (level == 0) { + *nextTokPtr = ptr; + return XML_TOK_IGNORE_SECT; + } + --level; + } + } + break; + default: + ptr += MINBPC(enc); + break; + } + } + return XML_TOK_PARTIAL; +} + +#endif /* XML_DTD */ + +static int PTRCALL +PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, + const char **badPtr) +{ + ptr += MINBPC(enc); + end -= MINBPC(enc); + for (; HAS_CHAR(enc, ptr, end); ptr += MINBPC(enc)) { + switch (BYTE_TYPE(enc, ptr)) { + case BT_DIGIT: + case BT_HEX: + case BT_MINUS: + case BT_APOS: + case BT_LPAR: + case BT_RPAR: + case BT_PLUS: + case BT_COMMA: + case BT_SOL: + case BT_EQUALS: + case BT_QUEST: + case BT_CR: + case BT_LF: + case BT_SEMI: + case BT_EXCL: + case BT_AST: + case BT_PERCNT: + case BT_NUM: +#ifdef XML_NS + case BT_COLON: +#endif + break; + case BT_S: + if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { + *badPtr = ptr; + return 0; + } + break; + case BT_NAME: + case BT_NMSTRT: + if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) + break; + /* fall through */ + default: + switch (BYTE_TO_ASCII(enc, ptr)) { + case 0x24: /* $ */ + case 0x40: /* @ */ + break; + default: + *badPtr = ptr; + return 0; + } + break; + } + } + return 1; +} + +/* This must only be called for a well-formed start-tag or empty + element tag. Returns the number of attributes. Pointers to the + first attsMax attributes are stored in atts. +*/ + +static int PTRCALL +PREFIX(getAtts)(const ENCODING *enc, const char *ptr, + int attsMax, ATTRIBUTE *atts) +{ + enum { other, inName, inValue } state = inName; + int nAtts = 0; + int open = 0; /* defined when state == inValue; + initialization just to shut up compilers */ + + for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { + switch (BYTE_TYPE(enc, ptr)) { +#define START_NAME \ + if (state == other) { \ + if (nAtts < attsMax) { \ + atts[nAtts].name = ptr; \ + atts[nAtts].normalized = 1; \ + } \ + state = inName; \ + } +#define LEAD_CASE(n) \ + case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + START_NAME + break; +#undef START_NAME + case BT_QUOT: + if (state != inValue) { + if (nAtts < attsMax) + atts[nAtts].valuePtr = ptr + MINBPC(enc); + state = inValue; + open = BT_QUOT; + } + else if (open == BT_QUOT) { + state = other; + if (nAtts < attsMax) + atts[nAtts].valueEnd = ptr; + nAtts++; + } + break; + case BT_APOS: + if (state != inValue) { + if (nAtts < attsMax) + atts[nAtts].valuePtr = ptr + MINBPC(enc); + state = inValue; + open = BT_APOS; + } + else if (open == BT_APOS) { + state = other; + if (nAtts < attsMax) + atts[nAtts].valueEnd = ptr; + nAtts++; + } + break; + case BT_AMP: + if (nAtts < attsMax) + atts[nAtts].normalized = 0; + break; + case BT_S: + if (state == inName) + state = other; + else if (state == inValue + && nAtts < attsMax + && atts[nAtts].normalized + && (ptr == atts[nAtts].valuePtr + || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE + || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE + || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) + atts[nAtts].normalized = 0; + break; + case BT_CR: case BT_LF: + /* This case ensures that the first attribute name is counted + Apart from that we could just change state on the quote. */ + if (state == inName) + state = other; + else if (state == inValue && nAtts < attsMax) + atts[nAtts].normalized = 0; + break; + case BT_GT: + case BT_SOL: + if (state != inValue) + return nAtts; + break; + default: + break; + } + } + /* not reached */ +} + +static int PTRFASTCALL +PREFIX(charRefNumber)(const ENCODING *UNUSED_P(enc), const char *ptr) +{ + int result = 0; + /* skip &# */ + ptr += 2*MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_x)) { + for (ptr += MINBPC(enc); + !CHAR_MATCHES(enc, ptr, ASCII_SEMI); + ptr += MINBPC(enc)) { + int c = BYTE_TO_ASCII(enc, ptr); + switch (c) { + case ASCII_0: case ASCII_1: case ASCII_2: case ASCII_3: case ASCII_4: + case ASCII_5: case ASCII_6: case ASCII_7: case ASCII_8: case ASCII_9: + result <<= 4; + result |= (c - ASCII_0); + break; + case ASCII_A: case ASCII_B: case ASCII_C: + case ASCII_D: case ASCII_E: case ASCII_F: + result <<= 4; + result += 10 + (c - ASCII_A); + break; + case ASCII_a: case ASCII_b: case ASCII_c: + case ASCII_d: case ASCII_e: case ASCII_f: + result <<= 4; + result += 10 + (c - ASCII_a); + break; + } + if (result >= 0x110000) + return -1; + } + } + else { + for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { + int c = BYTE_TO_ASCII(enc, ptr); + result *= 10; + result += (c - ASCII_0); + if (result >= 0x110000) + return -1; + } + } + return checkCharRefNumber(result); +} + +static int PTRCALL +PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr, + const char *end) +{ + switch ((end - ptr)/MINBPC(enc)) { + case 2: + if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { + switch (BYTE_TO_ASCII(enc, ptr)) { + case ASCII_l: + return ASCII_LT; + case ASCII_g: + return ASCII_GT; + } + } + break; + case 3: + if (CHAR_MATCHES(enc, ptr, ASCII_a)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_m)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_p)) + return ASCII_AMP; + } + } + break; + case 4: + switch (BYTE_TO_ASCII(enc, ptr)) { + case ASCII_q: + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_u)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_o)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_t)) + return ASCII_QUOT; + } + } + break; + case ASCII_a: + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_p)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_o)) { + ptr += MINBPC(enc); + if (CHAR_MATCHES(enc, ptr, ASCII_s)) + return ASCII_APOS; + } + } + break; + } + } + return 0; +} + +static int PTRCALL +PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1, + const char *end1, const char *ptr2) +{ + for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) { + if (end1 - ptr1 < MINBPC(enc)) { + /* This line cannot be executed. The incoming data has already + * been tokenized once, so incomplete characters like this have + * already been eliminated from the input. Retaining the + * paranoia check is still valuable, however. + */ + return 0; /* LCOV_EXCL_LINE */ + } + if (!CHAR_MATCHES(enc, ptr1, *ptr2)) + return 0; + } + return ptr1 == end1; +} + +static int PTRFASTCALL +PREFIX(nameLength)(const ENCODING *enc, const char *ptr) +{ + const char *start = ptr; + for (;;) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONASCII: + case BT_NMSTRT: +#ifdef XML_NS + case BT_COLON: +#endif + case BT_HEX: + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + ptr += MINBPC(enc); + break; + default: + return (int)(ptr - start); + } + } +} + +static const char * PTRFASTCALL +PREFIX(skipS)(const ENCODING *enc, const char *ptr) +{ + for (;;) { + switch (BYTE_TYPE(enc, ptr)) { + case BT_LF: + case BT_CR: + case BT_S: + ptr += MINBPC(enc); + break; + default: + return ptr; + } + } +} + +static void PTRCALL +PREFIX(updatePosition)(const ENCODING *enc, + const char *ptr, + const char *end, + POSITION *pos) +{ + while (HAS_CHAR(enc, ptr, end)) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_LF: + pos->columnNumber = (XML_Size)-1; + pos->lineNumber++; + ptr += MINBPC(enc); + break; + case BT_CR: + pos->lineNumber++; + ptr += MINBPC(enc); + if (HAS_CHAR(enc, ptr, end) && BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC(enc); + pos->columnNumber = (XML_Size)-1; + break; + default: + ptr += MINBPC(enc); + break; + } + pos->columnNumber++; + } +} + +#undef DO_LEAD_CASE +#undef MULTIBYTE_CASES +#undef INVALID_CASES +#undef CHECK_NAME_CASE +#undef CHECK_NAME_CASES +#undef CHECK_NMSTRT_CASE +#undef CHECK_NMSTRT_CASES + +#endif /* XML_TOK_IMPL_C */ diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.h b/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.h new file mode 100644 index 0000000000000000000000000000000000000000..a6420f48eedc047c369d8ff608d31fe1166d629f --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmltok_impl.h @@ -0,0 +1,73 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +enum { + BT_NONXML, + BT_MALFORM, + BT_LT, + BT_AMP, + BT_RSQB, + BT_LEAD2, + BT_LEAD3, + BT_LEAD4, + BT_TRAIL, + BT_CR, + BT_LF, + BT_GT, + BT_QUOT, + BT_APOS, + BT_EQUALS, + BT_QUEST, + BT_EXCL, + BT_SOL, + BT_SEMI, + BT_NUM, + BT_LSQB, + BT_S, + BT_NMSTRT, + BT_COLON, + BT_HEX, + BT_DIGIT, + BT_NAME, + BT_MINUS, + BT_OTHER, /* known not to be a name or name start character */ + BT_NONASCII, /* might be a name or name start character */ + BT_PERCNT, + BT_LPAR, + BT_RPAR, + BT_AST, + BT_PLUS, + BT_COMMA, + BT_VERBAR +}; + +#include diff --git a/testbed/astropy__astropy/cextern/expat/lib/xmltok_ns.c b/testbed/astropy__astropy/cextern/expat/lib/xmltok_ns.c new file mode 100644 index 0000000000000000000000000000000000000000..23d31e8e424916f0bc7c5d26fd241aa35f21c3ed --- /dev/null +++ b/testbed/astropy__astropy/cextern/expat/lib/xmltok_ns.c @@ -0,0 +1,142 @@ +/* This file is included! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 1997-2000 Thai Open Source Software Center Ltd + Copyright (c) 2000-2017 Expat development team + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifdef XML_TOK_NS_C + +const ENCODING * +NS(XmlGetUtf8InternalEncoding)(void) +{ + return &ns(internal_utf8_encoding).enc; +} + +const ENCODING * +NS(XmlGetUtf16InternalEncoding)(void) +{ +#if BYTEORDER == 1234 + return &ns(internal_little2_encoding).enc; +#elif BYTEORDER == 4321 + return &ns(internal_big2_encoding).enc; +#else + const short n = 1; + return (*(const char *)&n + ? &ns(internal_little2_encoding).enc + : &ns(internal_big2_encoding).enc); +#endif +} + +static const ENCODING * const NS(encodings)[] = { + &ns(latin1_encoding).enc, + &ns(ascii_encoding).enc, + &ns(utf8_encoding).enc, + &ns(big2_encoding).enc, + &ns(big2_encoding).enc, + &ns(little2_encoding).enc, + &ns(utf8_encoding).enc /* NO_ENC */ +}; + +static int PTRCALL +NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + return initScan(NS(encodings), (const INIT_ENCODING *)enc, + XML_PROLOG_STATE, ptr, end, nextTokPtr); +} + +static int PTRCALL +NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + return initScan(NS(encodings), (const INIT_ENCODING *)enc, + XML_CONTENT_STATE, ptr, end, nextTokPtr); +} + +int +NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, + const char *name) +{ + int i = getEncodingIndex(name); + if (i == UNKNOWN_ENC) + return 0; + SET_INIT_ENC_INDEX(p, i); + p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); + p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); + p->initEnc.updatePosition = initUpdatePosition; + p->encPtr = encPtr; + *encPtr = &(p->initEnc); + return 1; +} + +static const ENCODING * +NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) +{ +#define ENCODING_MAX 128 + char buf[ENCODING_MAX]; + char *p = buf; + int i; + XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); + if (ptr != end) + return 0; + *p = 0; + if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) + return enc; + i = getEncodingIndex(buf); + if (i == UNKNOWN_ENC) + return 0; + return NS(encodings)[i]; +} + +int +NS(XmlParseXmlDecl)(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **versionEndPtr, + const char **encodingName, + const ENCODING **encoding, + int *standalone) +{ + return doParseXmlDecl(NS(findEncoding), + isGeneralTextEntity, + enc, + ptr, + end, + badPtr, + versionPtr, + versionEndPtr, + encodingName, + encoding, + standalone); +} + +#endif /* XML_TOK_NS_C */ diff --git a/testbed/astropy__astropy/cextern/trim_cfitsio.sh b/testbed/astropy__astropy/cextern/trim_cfitsio.sh new file mode 100644 index 0000000000000000000000000000000000000000..4d62634a23f368b93c433aa104b96bdb41752509 --- /dev/null +++ b/testbed/astropy__astropy/cextern/trim_cfitsio.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +set -euv + +# This script should be run every time cfitsio is updated. +# This moves all the code needed for the actual library to lib +# and deletes everything else (except License.txt and doc/changes.txt) + +# So, the standard update would be to execute, from this directory, +# rm -rf cfitsio +# tar xvf # (e.g., cfitsio3410.tar.gz) +# ./trim_cfitsio.sh + + +# This just gets CORE_SOURCES from Makefile.in, excluding anything beyond zlib +lib_files=`make -f cfitsio/Makefile.in cfitsioLibSrcs | sed 's/zlib\/.*//'` +# The include files cannot be directly inferred from Makefile.in +inc_files='fitsio.h fitsio2.h longnam.h drvrsmem.h eval_defs.h eval_tab.h region.h group.h simplerng.h grparser.h' + +if [ ! -d cfitsio/lib ]; then + mkdir cfitsio/lib +fi + +for fil in $lib_files $inc_files; do + if [ -f cfitsio/$fil ]; then + mv cfitsio/$fil cfitsio/lib/ + fi +done +rm -f cfitsio/docs/*.tex +rm -f cfitsio/docs/*.ps +rm -f cfitsio/docs/*.pdf +rm -f cfitsio/docs/*.doc +rm -f cfitsio/docs/*.toc +rm -f cfitsio/[^L]*.* +cat <cfitsio/README.txt +Note: astropy only requires the CFITSIO library, and hence in this bundled version, +we removed all other files except the required license (License.txt) and changelog +(docs/changes.txt, which has the version number). +EOF diff --git a/testbed/astropy__astropy/cextern/trim_expat.sh b/testbed/astropy__astropy/cextern/trim_expat.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c16da8f92f80e6607ed6b24928913cabd2345e1 --- /dev/null +++ b/testbed/astropy__astropy/cextern/trim_expat.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -euv + +# This script should be run every time expat is updated. + +# So, the standard update would be to execute, from this directory, +# rm -rf expat +# tar xvf # (e.g., expat-2.2.6.tar.bz2) +# ./trim_expat.sh + +rm -rf expat/{conftools,doc,examples,m4,test,win32,CMake*,configure*,Makefile*,lib/*vcxproj*,tests,*.cmake,aclocal.m4,run.sh.in,test-driver-wrapper.sh,expat.*,xmlwf} + +cat <expat/README.txt +Note: astropy only requires the expat library, and hence in this bundled version, +we removed all other files except the required license and changelog. +EOF diff --git a/testbed/astropy__astropy/cextern/trim_wcslib.sh b/testbed/astropy__astropy/cextern/trim_wcslib.sh new file mode 100644 index 0000000000000000000000000000000000000000..007e265be8f1c0292f6b6a87221951c5a551cc2a --- /dev/null +++ b/testbed/astropy__astropy/cextern/trim_wcslib.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# This script should be run every time wcslib is updated. + +# This removes extra large files from wcslib that aren't needed. + +rm -rf wcslib/C/test +rm -rf wcslib/doxygen +rm -rf wcslib/Fortran +rm -rf wcslib/html +rm -rf wcslib/pgsbox +rm -rf wcslib/utils +rm wcslib/*.pdf diff --git a/testbed/astropy__astropy/cextern/wcslib/C/GNUmakefile b/testbed/astropy__astropy/cextern/wcslib/C/GNUmakefile new file mode 100644 index 0000000000000000000000000000000000000000..8a0ebec0c7fdc0bdcad779691e3e02ef1c64608a --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/GNUmakefile @@ -0,0 +1,521 @@ +#----------------------------------------------------------------------------- +# GNU makefile for building WCSLIB 6.2 and its test suite. +# +# Summary of the main targets +# --------------------------- +# build: Build the library. +# +# clean: Delete intermediate object files. +# +# cleaner: clean, and also delete the test executables. +# +# cleanest (distclean or realclean): cleaner, and also delete the object +# library and the C source files generated by 'flex'. +# +# check (or test): Compile and run the test programs. By default they are +# executed in batch mode, and non-graphical tests only report +# "PASS" on success. Use +# +# make MODE=interactive check +# +# to run them interactively with full diagnostic output. To skip +# graphical tests even if PGPLOT is available, use +# +# make CHECK=nopgplot check +# +# tests: Compile the test programs (but don't run them). +# +# Notes: +# 1) If you need to make changes then preferably modify ../makedefs.in +# instead and re-run configure. +# +# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +# http://www.atnf.csiro.au/people/Mark.Calabretta +# $Id: GNUmakefile,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +#----------------------------------------------------------------------------- +# Get configure settings. +SUBDIR := C +include ../makedefs + +FLEXMODS := $(patsubst %.l,%.c,$(wildcard *.l)) +MODULES := $(sort \ + $(patsubst %.c,%.o, \ + $(filter-out getwcstab.c,$(wildcard *.c)) $(FLEXMODS))) + +ifeq "$(WCSTRIG)" "MACRO" + CPPFLAGS += -DWCSTRIG_MACRO + MODULES := $(filter-out wcstrig.o, $(MODULES)) +else + ifeq "$(WCSTRIG)" "NATIVE" + MODULES := $(filter-out wcstrig.o, $(MODULES)) + endif +endif + +LIBLOCK := lib.lock + +# For building the sharable library. +PICLIB := libwcs-PIC.a + +CPPFLAGS += -I. -I.. + +vpath %.c test +vpath %.h .. +vpath %.in .. + + +# For building and exercising the test suite +# ------------------------------------------ +# Test programs that don't require CFITSIO or PGPLOT... +TEST_N := tlin tdis1 tdis2 tlog tprj1 tsph tsphdpa tspx ttab1 twcs twcssub \ + tpih1 tbth1 tfitshdr tunits twcsfix twcscompare + +# ...and unofficial test programs. +TEST_n := tdisiter tspcaips tspcspxe tspctrne twcs_locale + +# Test programs that require CFITSIO (they don't need PGPLOT). +TEST_C := twcstab twcshdr tdis3 twcslint + +# Test programs that require PGPLOT but not PGSBOX. +TEST_P := tspc tprj2 tcel1 tcel2 ttab2 ttab3 twcsmix + +# Test programs that require PGPLOT and PGSBOX. +TEST_B := tpih2 + +# Test programs that aren't automatically exercised. +TEST_X := tsphdpa twcshdr + +TESTS := $(TEST_N) + +# Add test programs that require CFITSIO if we have it. +ifneq "$(CFITSIOINC)" "" +ifneq "$(CFITSIOLIB)" "" + TESTS += $(TEST_C) + CFITSIO_CFLAGS := $(filter-out -Wpadded,$(CFLAGS)) +endif +endif + +# Add test programs that require PGPLOT if we have it. +ifneq "$(CHECK)" "nopgplot" +ifneq "$(PGPLOTINC)" "" +ifneq "$(PGPLOTLIB)" "" + TESTS += $(TEST_P) $(TEST_B) +endif +endif +endif + +# Remove tests that aren't automatically exercised. +TESTS := $(filter-out $(TEST_X), $(TESTS)) + +PGSBOXLIB := ../pgsbox/libpgsbox-$(LIBVER).a + +ADDRE := 0x[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]* + +# Pattern rules +#-------------- + +ifeq "$(FLEX)" "flex" + %.c : %.l + -@ echo '' + -@ $(RM) $@ + $(FLEX) $(FLFLAGS) -t $< | sed -e 's/^[ ]*#/#/' > $@ +else + %.c : %.l + -@ echo '' + -@ $(RM) $@ + cp flexed/$@ . +endif + +$(WCSLIB)(%.o) : %.c + -@ echo '' + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< + @ if [ ! -f $(LIBLOCK) ] ; then \ + echo $(AR) r$(ARFLAGS) $(WCSLIB) $% ; \ + $(AR) r$(ARFLAGS) $(WCSLIB) $% ; \ + $(RM) $% ; \ + fi + +$(PICLIB)(%.o) : $(WCSLIB)(%.o) + -@ echo '' + $(CC) $(CPPFLAGS) $(CFLAGS) $(SHRFLAGS) -c $(%:.o=.c) + @ if [ ! -f $(LIBLOCK) ] ; then \ + echo $(AR) r$(ARFLAGS) $(PICLIB) $% ; \ + $(AR) r$(ARFLAGS) $(PICLIB) $% ; \ + $(RM) $% ; \ + fi + +# May need to create temporary symlinks to include file directories for +# CFITSIO, etc. for the following two rules. +%.i : %.c + -@ echo '' + -@ $(RM) $@ + $(CPP) $(CPPFLAGS) $(CFLAGS) $< > $@ + +# Print out include file dependencies. +%.d : %.c + -@ echo '' + -@ $(CPP) $(CPPFLAGS) $(CFLAGS) $< | \ + sed -n -e 's|^# 1 "\([^/].*\.h\)".*|\1|p' | \ + sed -e 's|.*/||' | \ + sort -u + +%.fits : test/%.keyrec tofits + ./tofits < $< > $@ + +# Use 'make VALGRIND=T run_%' to have VALGRIND defined (from flavours). +# Use 'make VALGRIND=T check < /dev/null |& tee check_valgrind.log' to run +# valgrind on the lot. +run_% : % + -@ echo '' + -@ $(TIMER) + @ if [ '$(MODE)' = interactive -o '$(VALGRIND)' ] ; then \ + printf 'Press to run $<: ' ; \ + read DUMMY ; \ + fi ; \ + if [ '$(VALGRIND)' ] ; then \ + if [ '$<' = tunits ] ; then \ + $(VALGRIND) ./$< < test/units_test ; \ + else \ + $(VALGRIND) ./$< ; \ + fi ; \ + else \ + if [ '$(filter $<, $(TEST_N) $(TEST_C))' ] ; then \ + if [ '$<' = tunits ] ; then \ + if [ '$(MODE)' = interactive ] ; then \ + ./$< < test/units_test 2>&1 | tee $<.out ; \ + else \ + ./$< < test/units_test > $<.out 2>&1 ; \ + fi ; \ + else \ + if [ '$(MODE)' = interactive ] ; then \ + ./$< < /dev/null 2>&1 | tee $<.out ; \ + else \ + ./$< < /dev/null > $<.out 2>&1 ; \ + fi ; \ + fi ; \ + if grep 'FAIL:' $<.out > /dev/null ; then \ + if [ '$(MODE)' != interactive ] ; then \ + head -2 $<.out ; \ + grep 'FAIL:' $<.out ; \ + fi ; \ + echo 'FAIL: C/$<' >> test_results ; \ + elif grep 'PASS:' $<.out > /dev/null ; then \ + if [ '$(MODE)' != interactive ] ; then \ + head -2 $<.out ; \ + grep 'PASS:' $<.out ; \ + fi ; \ + echo 'PASS: C/$<' >> test_results ; \ + elif [ -f 'test/$<.out' ] ; then \ + trap 'rm -f run_test.tmp' 0 1 2 3 15 ; \ + sed -e 's/$(ADDRE)/0x
/g' $<.out > \ + run_test.tmp ; \ + mv -f run_test.tmp $<.out ; \ + if cmp -s $<.out test/$<.out ; then \ + if [ '$(MODE)' != interactive ] ; then \ + head -2 $<.out ; \ + fi ; \ + echo 'PASS: Output agrees with C/test/$<.out' ; \ + echo 'PASS: C/$<' >> test_results ; \ + else \ + if [ '$(MODE)' != interactive ] ; then \ + cat $<.out ; \ + fi ; \ + echo '' ; \ + echo 'FAIL: Output disagrees with C/test/$<.out' ; \ + echo 'FAIL: C/$<' >> test_results ; \ + fi ; \ + elif [ '$(MODE)' != interactive ] ; then \ + cat $<.out ; \ + echo 'FAIL: C/$<' >> test_results ; \ + fi ; \ + elif [ '$(MODE)' = interactive ] ; then \ + ./$< ; \ + else \ + if [ '$<' = tcel2 ] ; then \ + echo N | ./$< ; \ + else \ + ./$< < /dev/null 2>&1 ; \ + fi ; \ + fi ; \ + fi + -@ echo '' + +# Static and static pattern rules +#-------------------------------- + +.PHONY : build check clean cleaner cleanest distclean install lib realclean \ + run_% test tests + +build : lib + +lib : $(FLEXMODS) + -@ echo '' + -@ echo 'Building WCSLIB C library...' + @ $(MAKE) --no-print-directory $(WCSLIB) + +$(WCSLIB) : $(LIBLOCK) $(MODULES:%=$(WCSLIB)(%)) + -@ echo '' + @ set *.o ; \ + if [ "$$1" != "*.o" ] ; then \ + echo $(AR) r$(ARFLAGS) $@ *.o ; \ + $(AR) r$(ARFLAGS) $@ *.o ; \ + echo $(RANLIB) $@ ; \ + $(RANLIB) $@ ; \ + $(RM) *.o ; \ + fi + -@ $(RM) $< + @ $(MAKE) --no-print-directory $(SHRLIB) + +$(SHRLIB) : $(PICLIB) + -@ echo '' + -@ $(RM) -r tmp + mkdir tmp && \ + cd tmp && \ + trap 'cd .. ; $(RM) -r tmp' 0 1 2 3 15 ; \ + $(AR) x ../$(PICLIB) && \ + $(SHRLD) -o $@ *.o $(LDFLAGS) $(LIBS) && \ + mv $@ .. + +$(PICLIB) : $(LIBLOCK) $(MODULES:%=$(PICLIB)(%)) + -@ echo '' + @ set *.o ; \ + if [ "$$1" != "*.o" ] ; then \ + echo $(AR) r$(ARFLAGS) $@ *.o ; \ + $(AR) r$(ARFLAGS) $@ *.o ; \ + $(RM) *.o ; \ + fi + -@ $(RM) $< + +$(LIBLOCK) : FORCE + @ $(RM) *.o + @ touch $@ + +install : build + - if [ ! -d "$(LIBDIR)" ] ; then \ + $(INSTALL) -d -m 775 $(LIBDIR) ; \ + fi + if [ "$(ARFLAGS)" = U ] ; then \ + $(RM) -r tmp ; \ + mkdir tmp && \ + cd tmp && \ + trap 'cd .. ; $(RM) -r tmp' 0 1 2 3 15 ; \ + $(AR) x ../$(WCSLIB) && \ + $(AR) rD $(WCSLIB) *.o && \ + $(INSTALL) -m 644 $(WCSLIB) $(LIBDIR) ; \ + cd .. ; \ + $(RM) -r tmp ; \ + else \ + $(INSTALL) -m 644 $(WCSLIB) $(LIBDIR) ; \ + fi + $(RANLIB) $(LIBDIR)/$(WCSLIB) + - if [ -h "$(LIBDIR)/libwcs.a" ] ; then \ + $(RM) $(LIBDIR)/libwcs.a ; \ + fi + $(LN_S) $(WCSLIB) $(LIBDIR)/libwcs.a + if [ "$(SHRLIB)" != "" ] ; then \ + $(INSTALL) -m 755 $(SHRLIB) $(LIBDIR) ; \ + if [ -h "$(LIBDIR)/$(SONAME)" ] ; then \ + $(RM) $(LIBDIR)/$(SONAME) ; \ + fi ; \ + $(LN_S) $(SHRLIB) $(LIBDIR)/$(SONAME) ; \ + if [ "$(SHRLN)" != "" ] ; then \ + if [ -h "$(LIBDIR)/$(SHRLN)" ] ; then \ + $(RM) $(LIBDIR)/$(SHRLN) ; \ + fi ; \ + $(LN_S) $(SONAME) $(LIBDIR)/$(SHRLN) ; \ + fi ; \ + fi + - if [ ! -d "$(INCDIR)" ] ; then \ + $(INSTALL) -d -m 775 $(INCDIR) ; \ + fi + $(INSTALL) -m 444 *.h $(INCDIR) + - $(RM) $(INCLINK) + $(LN_S) $(notdir $(INCDIR)) $(INCLINK) + +clean : + - $(RM) *.o $(LIBLOCK) *.i a.out t*.out core *.dSYM + - $(RM) -r $(EXTRA_CLEAN) + +cleaner : clean + - $(RM) .gdb_history + - $(RM) $(TEST_N) $(TEST_n) $(TEST_X) + - $(RM) $(TEST_P) tdis3 tpih2 twcshdr twcslint twcstab + - $(RM) tofits + - $(RM) bth.fits fitshdr.fits pih.fits wcslint.fits wcstab.fits + - $(RM) SIP.fits SIPTPV.fits TPV3.fits TPV5.fits TPV7.fits + - $(RM) DSS.fits TNX.fits ZPX.fits + - $(RM) t*_cfitsio test_results + +cleanest distclean realclean : cleaner + - $(RM) ../wcsconfig.h ../wcsconfig_tests.h + - $(RM) fitshdr.c wcsbth.c wcspih.c wcsulex.c wcsutrn.c + - $(RM) $(PICLIB) libwcs-*.a libwcs.so.* libwcs.*.dylib + +check test : tests $(TESTS:%=run_%) + +tests : $(TESTS) $(TEST_X) + +$(TEST_N) $(TEST_n) : % : test/%.c $(WCSLIB) + -@ echo '' + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(WCSLIB) $(LIBS) + -@ $(RM) $@.o + +$(TEST_P) : % : test/%.c $(WCSLIB) + -@ echo '' + $(CC) $(CPPFLAGS) $(PGPLOTINC) $(CFLAGS) -c -o $@.o $< + $(LD) -o $@ $@.o $(LDFLAGS) $(PGPLOTLIB) $(WCSLIB) $(FLIBS) $(LIBS) + -@ $(RM) $@.o + +tpih2 : test/tpih2.c $(PGSBOXLIB) $(WCSLIB) + -@ echo '' + $(CC) $(CPPFLAGS) -I../pgsbox $(PGPLOTINC) $(CFLAGS) -c -o $@.o $< + $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) $(WCSLIB) \ + $(FLIBS) $(LIBS) + -@ $(RM) $@.o + +tfitshdr_cfitsio tpih1_cfitsio tbth1_cfitsio : %_cfitsio : test/%.c $(WCSLIB) + -@ echo '' + $(CC) -DDO_CFITSIO $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) \ + -o $@ $< $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS) + -@ $(RM) $@.o + +tpih2_cfitsio : test/tpih2.c $(PGSBOXLIB) $(WCSLIB) + -@ echo '' + $(CC) -DDO_CFITSIO $(CPPFLAGS) -I../pgsbox $(PGPLOTINC) \ + $(CFITSIOINC) $(CFITSIO_CFLAGS) -c -o $@.o $< + $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) \ + $(CFITSIOLIB) $(WCSLIB) $(FLIBS) $(LIBS) + -@ $(RM) $@.o + +twcstab : test/twcstab.c $(GETWCSTAB) $(WCSLIB) + -@ echo '' + $(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \ + $(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS) + -@ $(RM) $@.o + +twcshdr : test/twcshdr.c $(GETWCSTAB) $(WCSLIB) + -@ echo '' + $(CC) $(CPPFLAGS) $(CFITSIOINC) $(CFITSIO_CFLAGS) -o $@ $< \ + $(GETWCSTAB) $(LDFLAGS) $(CFITSIOLIB) $(WCSLIB) $(LIBS) + -@ $(RM) $@.o + +tdis3 : test/tdis3 + -@ echo '' + cp $< . + -@ chmod a+x $@ + +twcslint : test/twcslint + -@ echo '' + cp $< . + -@ chmod a+x $@ + +getwcstab.o : getwcstab.c getwcstab.h + -@ echo '' + $(CC) $(CPPFLAGS) $(CFITSIO_CFLAGS) $(CFITSIOINC) -c $< + +$(PGSBOXLIB) : + -@ echo '' + $(MAKE) -C ../pgsbox $(notdir $@) + +tofits : test/tofits.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< + +GNUmakefile : ../makedefs ; + +../makedefs ../wcsconfig.h ../wcsconfig_tests.h : makedefs.in wcsconfig.h.in \ + wcsconfig_tests.h.in ../config.status + -@ $(RM) ../wcsconfig.h ../wcsconfig_tests.h + cd .. && ./config.status + +show :: + -@ -@ echo ' FLEXMODS := $(FLEXMODS)' + -@ -@ echo ' MODULES := $(MODULES)' + +# Dependencies (use the %.d pattern rule to list them) +#----------------------------------------------------- + +$(WCSLIB)(cel.o) : cel.h prj.h sph.h wcsconfig.h wcserr.h wcsmath.h \ + wcsprintf.h wcstrig.h +$(WCSLIB)(dis.o) : dis.h wcserr.h wcsprintf.h wcsutil.h +$(WCSLIB)(fitshdr.o) : fitshdr.h wcsconfig.h wcsutil.h +$(WCSLIB)(lin.o) : dis.h lin.h wcserr.h wcsprintf.h +$(WCSLIB)(log.o) : log.h +$(WCSLIB)(prj.o) : prj.h wcsconfig.h wcserr.h wcsmath.h wcsprintf.h \ + wcstrig.h wcsutil.h +$(WCSLIB)(spc.o) : spc.h spx.h wcsconfig.h wcserr.h wcsmath.h \ + wcsprintf.h wcstrig.h wcsutil.h +$(WCSLIB)(sph.o) : sph.h wcsconfig.h wcstrig.h +$(WCSLIB)(spx.o) : spx.h wcserr.h wcsmath.h +$(WCSLIB)(tab.o) : tab.h wcserr.h wcsmath.h wcsprintf.h wcsutil.h +$(WCSLIB)(wcs.o) : cel.h dis.h lin.h log.h prj.h spc.h sph.h spx.h \ + tab.h wcs.h wcsconfig.h wcserr.h wcsmath.h \ + wcsprintf.h wcstrig.h wcsunits.h wcsutil.h +$(WCSLIB)(wcsbth.o) : cel.h lin.h prj.h spc.h spx.h wcs.h wcshdr.h \ + wcsmath.h wcsprintf.h wcsutil.h +$(WCSLIB)(wcserr.o) : wcserr.h wcsprintf.h +$(WCSLIB)(wcsfix.o) : cel.h lin.h prj.h spc.h sph.h spx.h wcs.h wcserr.h \ + wcsfix.h wcsmath.h wcsunits.h wcsutil.h +$(WCSLIB)(wcshdr.o) : cel.h dis.h lin.h prj.h spc.h spx.h tab.h wcs.h \ + wcserr.h wcshdr.h wcsmath.h wcsutil.h +$(WCSLIB)(wcspih.o) : cel.h dis.h lin.h prj.h spc.h spx.h wcs.h wcshdr.h \ + wcsmath.h wcsprintf.h wcsutil.h +$(WCSLIB)(wcsprintf.o): wcsprintf.h +$(WCSLIB)(wcstrig.o) : wcsconfig.h wcsmath.h wcstrig.h +$(WCSLIB)(wcsulex.o) : wcserr.h wcsmath.h wcsunits.h wcsutil.h +$(WCSLIB)(wcsunits.o) : wcserr.h wcsunits.h +$(WCSLIB)(wcsutil.o) : wcsmath.h wcsutil.h +$(WCSLIB)(wcsutrn.o) : wcserr.h wcsunits.h + +tbth1 tbth1_cfitsio : cel.h lin.h prj.h spc.h spx.h wcs.h wcsconfig.h \ + wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h +tcel1 : cel.h prj.h +tcel2 : cel.h prj.h +tfitshdr tfitshdr_cfitsio : cel.h fitshdr.h lin.h prj.h spc.h spx.h wcs.h \ + wcsconfig.h wcsconfig_tests.h wcshdr.h +tlin : lin.h +tdis1 : cel.h dis.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h \ + wcsprintf.h +tdis2 : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h wcsprintf.h +tdisiter: cel.h dis.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h \ + wcsprintf.h +tlog : log.h +tpih1 tpih1_cfitsio : cel.h lin.h prj.h spc.h spx.h wcs.h wcsconfig.h \ + wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h wcsprintf.h +tpih2 tpih2_cfitsio : cel.h lin.h prj.h spc.h spx.h wcs.h wcsconfig.h \ + wcsconfig_tests.h wcshdr.h +tprj1 : prj.h wcsconfig.h wcstrig.h +tprj2 : prj.h +tspc : spc.h spx.h wcsconfig.h wcstrig.h +tspcaips: spc.h spx.h +tspctrne: spc.h spx.h wcserr.h +tsph : sph.h wcsconfig.h wcstrig.h +tsphdpa : sph.h +tspx : spx.h +ttab1 : tab.h +ttab2 : tab.h +ttab3 : prj.h tab.h +tunits : wcserr.h wcsunits.h +twcs : cel.h dis.h fitshdr.h lin.h log.h prj.h spc.h sph.h spx.h tab.h \ + wcs.h wcsconfig.h wcsconfig_tests.h wcserr.h wcsfix.h wcshdr.h \ + wcslib.h wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h +twcs_locale : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcshdr.h \ + wcsprintf.h +twcsfix : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h wcsfix.h \ + wcsprintf.h wcsunits.h +twcshdr : cel.h dis.h fitshdr.h getwcstab.h lin.h log.h prj.h spc.h sph.h \ + spx.h tab.h wcs.h wcsconfig.h wcserr.h wcsfix.h wcshdr.h wcslib.h \ + wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h +twcsmix : cel.h lin.h prj.h spc.h sph.h spx.h wcs.h +twcssub : cel.h lin.h prj.h spc.h spx.h wcs.h wcserr.h +twcstab : cel.h dis.h fitshdr.h getwcstab.h lin.h log.h prj.h spc.h sph.h \ + spx.h tab.h wcs.h wcsconfig.h wcserr.h wcsfix.h wcshdr.h wcslib.h \ + wcsmath.h wcsprintf.h wcstrig.h wcsunits.h wcsutil.h + +run_tdis1 : TPV3.fits TPV5.fits TPV7.fits +run_tdis2 : SIP.fits +run_tdis3 : DSS.fits SIPTPV.fits TNX.fits ZPX.fits +run_tbth1 run_tbth1_cfitsio : bth.fits +run_tfitshdr run_tfitshdr_cfitsio : fitshdr.fits +run_tpih1 run_tpih1_cfitsio : pih.fits +run_tpih2 run_tpih2_cfitsio : pih.fits +run_twcslint : wcslint.fits +run_twcs_locale : pih.fits diff --git a/testbed/astropy__astropy/cextern/wcslib/C/cel.c b/testbed/astropy__astropy/cextern/wcslib/C/cel.c new file mode 100644 index 0000000000000000000000000000000000000000..5454e73683f1aaf7a955d01826bde35d1dfa59a2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/cel.c @@ -0,0 +1,527 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: cel.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcstrig.h" +#include "sph.h" +#include "cel.h" + +const int CELSET = 137; + +/* Map status return value to message. */ +const char *cel_errmsg[] = { + "Success", + "Null celprm pointer passed", + "Invalid projection parameters", + "Invalid coordinate transformation parameters", + "Ill-conditioned coordinate transformation parameters", + "One or more of the (x,y) coordinates were invalid", + "One or more of the (lng,lat) coordinates were invalid"}; + +/* Map error returns for lower-level routines. */ +const int cel_prjerr[] = { + CELERR_SUCCESS, /* 0: PRJERR_SUCCESS */ + CELERR_NULL_POINTER, /* 1: PRJERR_NULL_POINTER */ + CELERR_BAD_PARAM, /* 2: PRJERR_BAD_PARAM */ + CELERR_BAD_PIX, /* 3: PRJERR_BAD_PIX */ + CELERR_BAD_WORLD /* 4: PRJERR_BAD_WORLD */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define CEL_ERRMSG(status) WCSERR_SET(status), cel_errmsg[status] + +/*--------------------------------------------------------------------------*/ + +int celini(cel) + +struct celprm *cel; + +{ + register int k; + + if (cel == 0x0) return CELERR_NULL_POINTER; + + cel->flag = 0; + + cel->offset = 0; + cel->phi0 = UNDEFINED; + cel->theta0 = UNDEFINED; + cel->ref[0] = 0.0; + cel->ref[1] = 0.0; + cel->ref[2] = UNDEFINED; + cel->ref[3] = +90.0; + + for (k = 0; k < 5; cel->euler[k++] = 0.0); + cel->latpreq = -1; + + cel->err = 0x0; + + return cel_prjerr[prjini(&(cel->prj))]; +} + +/*--------------------------------------------------------------------------*/ + +int celfree(cel) + +struct celprm *cel; + +{ + if (cel == 0x0) return CELERR_NULL_POINTER; + + if (cel->err) { + free(cel->err); + cel->err = 0x0; + } + + return cel_prjerr[prjfree(&(cel->prj))]; +} + +/*--------------------------------------------------------------------------*/ + +int celprt(cel) + +const struct celprm *cel; + +{ + int i; + + if (cel == 0x0) return CELERR_NULL_POINTER; + + wcsprintf(" flag: %d\n", cel->flag); + wcsprintf(" offset: %d\n", cel->offset); + if (undefined(cel->phi0)) { + wcsprintf(" phi0: UNDEFINED\n"); + } else { + wcsprintf(" phi0: %9f\n", cel->phi0); + } + if (undefined(cel->theta0)) { + wcsprintf(" theta0: UNDEFINED\n"); + } else { + wcsprintf(" theta0: %9f\n", cel->theta0); + } + wcsprintf(" ref:"); + for (i = 0; i < 4; i++) { + wcsprintf(" %#- 11.5g", cel->ref[i]); + } + wcsprintf("\n"); + wcsprintf(" prj: (see below)\n"); + + wcsprintf(" euler:"); + for (i = 0; i < 5; i++) { + wcsprintf(" %#- 11.5g", cel->euler[i]); + } + wcsprintf("\n"); + wcsprintf(" latpreq: %d", cel->latpreq); + if (cel->latpreq == 0) { + wcsprintf(" (not required)\n"); + } else if (cel->latpreq == 1) { + wcsprintf(" (disambiguation)\n"); + } else if (cel->latpreq == 2) { + wcsprintf(" (specification)\n"); + } else { + wcsprintf(" (UNDEFINED)\n"); + } + wcsprintf(" isolat: %d\n", cel->isolat); + + WCSPRINTF_PTR(" err: ", cel->err, "\n"); + if (cel->err) { + wcserr_prt(cel->err, " "); + } + + wcsprintf("\n"); + wcsprintf(" prj.*\n"); + prjprt(&(cel->prj)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int celperr(const struct celprm *cel, const char *prefix) + +{ + if (cel == 0x0) return CELERR_NULL_POINTER; + + if (cel->err && wcserr_prt(cel->err, prefix) == 0) { + wcserr_prt(cel->prj.err, prefix); + } + + return 0; +} + + +/*--------------------------------------------------------------------------*/ + +int celset(cel) + +struct celprm *cel; + +{ + static const char *function = "celset"; + + int status; + const double tol = 1.0e-10; + double clat0, cphip, cthe0, lat0, lng0, phip, slat0, slz, sphip, sthe0; + double latp, latp1, latp2, lngp; + double u, v, x, y, z; + struct prjprm *celprj; + struct wcserr **err; + + if (cel == 0x0) return CELERR_NULL_POINTER; + err = &(cel->err); + + /* Initialize the projection driver routines. */ + celprj = &(cel->prj); + if (cel->offset) { + celprj->phi0 = cel->phi0; + celprj->theta0 = cel->theta0; + } else { + /* Ensure that these are undefined - no fiducial offset. */ + celprj->phi0 = UNDEFINED; + celprj->theta0 = UNDEFINED; + } + + if ((status = prjset(celprj))) { + return wcserr_set(CEL_ERRMSG(cel_prjerr[status])); + } + + /* Defaults set by the projection routines. */ + if (undefined(cel->phi0)) { + cel->phi0 = celprj->phi0; + } + + if (undefined(cel->theta0)) { + cel->theta0 = celprj->theta0; + + } else if (fabs(cel->theta0) > 90.0) { + if (fabs(cel->theta0) > 90.0 + tol) { + return wcserr_set(WCSERR_SET(CELERR_BAD_COORD_TRANS), + "Invalid coordinate transformation parameters: theta0 > 90"); + } + + if (cel->theta0 > 90.0) { + cel->theta0 = 90.0; + } else { + cel->theta0 = -90.0; + } + } + + + lng0 = cel->ref[0]; + lat0 = cel->ref[1]; + phip = cel->ref[2]; + latp = cel->ref[3]; + + /* Set default for native longitude of the celestial pole? */ + if (undefined(phip) || phip == 999.0) { + phip = (lat0 < cel->theta0) ? 180.0 : 0.0; + phip += cel->phi0; + + if (phip < -180.0) { + phip += 360.0; + } else if (phip > 180.0) { + phip -= 360.0; + } + + cel->ref[2] = phip; + } + + + /* Compute celestial coordinates of the native pole. */ + cel->latpreq = 0; + if (cel->theta0 == 90.0) { + /* Fiducial point at the native pole. */ + lngp = lng0; + latp = lat0; + + } else { + /* Fiducial point away from the native pole. */ + sincosd(lat0, &slat0, &clat0); + sincosd(cel->theta0, &sthe0, &cthe0); + + if (phip == cel->phi0) { + sphip = 0.0; + cphip = 1.0; + + u = cel->theta0; + v = 90.0 - lat0; + + } else { + sincosd(phip - cel->phi0, &sphip, &cphip); + + x = cthe0*cphip; + y = sthe0; + z = sqrt(x*x + y*y); + if (z == 0.0) { + if (slat0 != 0.0) { + return wcserr_set(WCSERR_SET(CELERR_BAD_COORD_TRANS), + "Invalid coordinate description:\n" + "lat0 == 0 is required for |phip - phi0| = 90 and theta0 == 0"); + } + + /* latp determined solely by LATPOLEa in this case. */ + cel->latpreq = 2; + if (latp > 90.0) { + latp = 90.0; + } else if (latp < -90.0) { + latp = -90.0; + } + + } else { + slz = slat0/z; + if (fabs(slz) > 1.0) { + if ((fabs(slz) - 1.0) < tol) { + if (slz > 0.0) { + slz = 1.0; + } else { + slz = -1.0; + } + } else { + return wcserr_set(WCSERR_SET(CELERR_BAD_COORD_TRANS), + "Invalid coordinate description:\n|lat0| <= %.3f is required " + "for these values of phip, phi0, and theta0", asind(z)); + } + } + + u = atan2d(y,x); + v = acosd(slz); + } + } + + if (cel->latpreq == 0) { + latp1 = u + v; + if (latp1 > 180.0) { + latp1 -= 360.0; + } else if (latp1 < -180.0) { + latp1 += 360.0; + } + + latp2 = u - v; + if (latp2 > 180.0) { + latp2 -= 360.0; + } else if (latp2 < -180.0) { + latp2 += 360.0; + } + + if (fabs(latp1) < 90.0+tol && + fabs(latp2) < 90.0+tol) { + /* There are two valid solutions for latp. */ + cel->latpreq = 1; + } + + if (fabs(latp-latp1) < fabs(latp-latp2)) { + if (fabs(latp1) < 90.0+tol) { + latp = latp1; + } else { + latp = latp2; + } + } else { + if (fabs(latp2) < 90.0+tol) { + latp = latp2; + } else { + latp = latp1; + } + } + + /* Account for rounding error. */ + if (fabs(latp) < 90.0+tol) { + if (latp > 90.0) { + latp = 90.0; + } else if (latp < -90.0) { + latp = -90.0; + } + } + } + + z = cosd(latp)*clat0; + if (fabs(z) < tol) { + if (fabs(clat0) < tol) { + /* Celestial pole at the fiducial point. */ + lngp = lng0; + + } else if (latp > 0.0) { + /* Celestial north pole at the native pole.*/ + lngp = lng0 + phip - cel->phi0 - 180.0; + + } else { + /* Celestial south pole at the native pole. */ + lngp = lng0 - phip + cel->phi0; + } + + } else { + x = (sthe0 - sind(latp)*slat0)/z; + y = sphip*cthe0/clat0; + if (x == 0.0 && y == 0.0) { + /* Sanity check (shouldn't be possible). */ + return wcserr_set(WCSERR_SET(CELERR_BAD_COORD_TRANS), + "Invalid coordinate transformation parameters, internal error"); + } + lngp = lng0 - atan2d(y,x); + } + + /* Make celestial longitude of the native pole the same sign as at the + fiducial point. */ + if (lng0 >= 0.0) { + if (lngp < 0.0) { + lngp += 360.0; + } else if (lngp > 360.0) { + lngp -= 360.0; + } + } else { + if (lngp > 0.0) { + lngp -= 360.0; + } else if (lngp < -360.0) { + lngp += 360.0; + } + } + } + + /* Reset LATPOLEa. */ + cel->ref[3] = latp; + + /* Set the Euler angles. */ + cel->euler[0] = lngp; + cel->euler[1] = 90.0 - latp; + cel->euler[2] = phip; + sincosd(cel->euler[1], &cel->euler[4], &cel->euler[3]); + cel->isolat = (cel->euler[4] == 0.0); + cel->flag = CELSET; + + /* Check for ill-conditioned parameters. */ + if (fabs(latp) > 90.0+tol) { + return wcserr_set(WCSERR_SET(CELERR_ILL_COORD_TRANS), + "Ill-conditioned coordinate transformation parameters\nNo valid " + "solution for latp for these values of phip, phi0, and theta0"); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int celx2s(cel, nx, ny, sxy, sll, x, y, phi, theta, lng, lat, stat) + +struct celprm *cel; +int nx, ny, sxy, sll; +const double x[], y[]; +double phi[], theta[]; +double lng[], lat[]; +int stat[]; + +{ + static const char *function = "celx2s"; + + int istat, nphi, status = 0; + struct prjprm *celprj; + struct wcserr **err; + + /* Initialize. */ + if (cel == 0x0) return CELERR_NULL_POINTER; + err = &(cel->err); + + if (cel->flag != CELSET) { + if ((status = celset(cel))) return status; + } + + /* Apply spherical deprojection. */ + celprj = &(cel->prj); + if ((istat = celprj->prjx2s(celprj, nx, ny, sxy, 1, x, y, phi, theta, + stat))) { + if (istat) { + status = wcserr_set(CEL_ERRMSG(cel_prjerr[istat])); + if (status != CELERR_BAD_PIX) { + return status; + } + } + } + + nphi = (ny > 0) ? (nx*ny) : nx; + + /* Compute celestial coordinates. */ + sphx2s(cel->euler, nphi, 0, 1, sll, phi, theta, lng, lat); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cels2x(cel, nlng, nlat, sll, sxy, lng, lat, phi, theta, x, y, stat) + +struct celprm *cel; +int nlng, nlat, sll, sxy; +const double lng[], lat[]; +double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + static const char *function = "cels2x"; + + int istat, nphi, ntheta, status = 0; + struct prjprm *celprj; + struct wcserr **err; + + /* Initialize. */ + if (cel == 0x0) return CELERR_NULL_POINTER; + err = &(cel->err); + + if (cel->flag != CELSET) { + if ((status = celset(cel))) return status; + } + + /* Compute native coordinates. */ + sphs2x(cel->euler, nlng, nlat, sll, 1, lng, lat, phi, theta); + + if (cel->isolat) { + /* Constant celestial latitude -> constant native latitude. */ + nphi = nlng; + ntheta = nlat; + } else { + nphi = (nlat > 0) ? (nlng*nlat) : nlng; + ntheta = 0; + } + + /* Apply the spherical projection. */ + celprj = &(cel->prj); + if ((istat = celprj->prjs2x(celprj, nphi, ntheta, 1, sxy, phi, theta, x, y, + stat))) { + if (istat) { + status = wcserr_set(CEL_ERRMSG(cel_prjerr[istat])); + if (status != CELERR_BAD_WORLD) { + return status; + } + } + } + + return status; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/cel.h b/testbed/astropy__astropy/cextern/wcslib/C/cel.h new file mode 100644 index 0000000000000000000000000000000000000000..a423c36891e7ed4c2517dac8a4fc6fd3dd3986e3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/cel.h @@ -0,0 +1,459 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: cel.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the cel routines +* --------------------------- +* Routines in this suite implement the part of the FITS World Coordinate +* System (WCS) standard that deals with celestial coordinates, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) +* +* These routines define methods to be used for computing celestial world +* coordinates from intermediate world coordinates (a linear transformation +* of image pixel coordinates), and vice versa. They are based on the celprm +* struct which contains all information needed for the computations. This +* struct contains some elements that must be set by the user, and others that +* are maintained by these routines, somewhat like a C++ class but with no +* encapsulation. +* +* Routine celini() is provided to initialize the celprm struct with default +* values, celfree() reclaims any memory that may have been allocated to store +* an error message, and celprt() prints its contents. +* +* celperr() prints the error message(s), if any, stored in a celprm struct and +* the prjprm struct that it contains. +* +* A setup routine, celset(), computes intermediate values in the celprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by celset() but it need not be called explicitly - refer +* to the explanation of celprm::flag. +* +* celx2s() and cels2x() implement the WCS celestial coordinate +* transformations. In fact, they are high level driver routines for the lower +* level spherical coordinate rotation and projection routines described in +* sph.h and prj.h. +* +* +* celini() - Default constructor for the celprm struct +* ---------------------------------------------------- +* celini() sets all members of a celprm struct to default values. It should +* be used to initialize every celprm struct. +* +* Returned: +* cel struct celprm* +* Celestial transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* +* +* celfree() - Destructor for the celprm struct +* -------------------------------------------- +* celfree() frees any memory that may have been allocated to store an error +* message in the celprm struct. +* +* Given: +* cel struct celprm* +* Celestial transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* +* +* celprt() - Print routine for the celprm struct +* ---------------------------------------------- +* celprt() prints the contents of a celprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* cel const struct celprm* +* Celestial transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* +* +* celperr() - Print error messages from a celprm struct +* ----------------------------------------------------- +* celperr() prints the error message(s), if any, stored in a celprm struct and +* the prjprm struct that it contains. If there are no errors then nothing is +* printed. It uses wcserr_prt(), q.v. +* +* Given: +* cel const struct celprm* +* Coordinate transformation parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* +* +* celset() - Setup routine for the celprm struct +* ---------------------------------------------- +* celset() sets up a celprm struct according to information supplied within +* it. +* +* Note that this routine need not be called directly; it will be invoked by +* celx2s() and cels2x() if celprm::flag is anything other than a predefined +* magic value. +* +* Given and returned: +* cel struct celprm* +* Celestial transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* 2: Invalid projection parameters. +* 3: Invalid coordinate transformation parameters. +* 4: Ill-conditioned coordinate transformation +* parameters. +* +* For returns > 1, a detailed error message is set in +* celprm::err if enabled, see wcserr_enable(). +* +* +* celx2s() - Pixel-to-world celestial transformation +* -------------------------------------------------- +* celx2s() transforms (x,y) coordinates in the plane of projection to +* celestial coordinates (lng,lat). +* +* Given and returned: +* cel struct celprm* +* Celestial transformation parameters. +* +* Given: +* nx,ny int Vector lengths. +* +* sxy,sll int Vector strides. +* +* x,y const double[] +* Projected coordinates in pseudo "degrees". +* +* Returned: +* phi,theta double[] Longitude and latitude (phi,theta) in the native +* coordinate system of the projection [deg]. +* +* lng,lat double[] Celestial longitude and latitude (lng,lat) of the +* projected point [deg]. +* +* stat int[] Status return value for each vector element: +* 0: Success. +* 1: Invalid value of (x,y). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* 2: Invalid projection parameters. +* 3: Invalid coordinate transformation parameters. +* 4: Ill-conditioned coordinate transformation +* parameters. +* 5: One or more of the (x,y) coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* celprm::err if enabled, see wcserr_enable(). +* +* +* cels2x() - World-to-pixel celestial transformation +* -------------------------------------------------- +* cels2x() transforms celestial coordinates (lng,lat) to (x,y) coordinates in +* the plane of projection. +* +* Given and returned: +* cel struct celprm* +* Celestial transformation parameters. +* +* Given: +* nlng,nlat int Vector lengths. +* +* sll,sxy int Vector strides. +* +* lng,lat const double[] +* Celestial longitude and latitude (lng,lat) of the +* projected point [deg]. +* +* Returned: +* phi,theta double[] Longitude and latitude (phi,theta) in the native +* coordinate system of the projection [deg]. +* +* x,y double[] Projected coordinates in pseudo "degrees". +* +* stat int[] Status return value for each vector element: +* 0: Success. +* 1: Invalid value of (lng,lat). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null celprm pointer passed. +* 2: Invalid projection parameters. +* 3: Invalid coordinate transformation parameters. +* 4: Ill-conditioned coordinate transformation +* parameters. +* 6: One or more of the (lng,lat) coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* celprm::err if enabled, see wcserr_enable(). +* +* +* celprm struct - Celestial transformation parameters +* --------------------------------------------------- +* The celprm struct contains information required to transform celestial +* coordinates. It consists of certain members that must be set by the user +* ("given") and others that are set by the WCSLIB routines ("returned"). Some +* of the latter are supplied for informational purposes and others are for +* internal use only. +* +* Returned celprm struct members must not be modified by the user. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following celprm struct members are set or changed: +* +* - celprm::offset, +* - celprm::phi0, +* - celprm::theta0, +* - celprm::ref[4], +* - celprm::prj: +* - prjprm::code, +* - prjprm::r0, +* - prjprm::pv[], +* - prjprm::phi0, +* - prjprm::theta0. +* +* This signals the initialization routine, celset(), to recompute the +* returned members of the celprm struct. celset() will reset flag to +* indicate that this has been done. +* +* int offset +* (Given) If true (non-zero), an offset will be applied to (x,y) to +* force (x,y) = (0,0) at the fiducial point, (phi_0,theta_0). +* Default is 0 (false). +* +* double phi0 +* (Given) The native longitude, phi_0 [deg], and ... +* +* double theta0 +* (Given) ... the native latitude, theta_0 [deg], of the fiducial point, +* i.e. the point whose celestial coordinates are given in +* celprm::ref[1:2]. If undefined (set to a magic value by prjini()) the +* initialization routine, celset(), will set this to a projection-specific +* default. +* +* double ref[4] +* (Given) The first pair of values should be set to the celestial +* longitude and latitude of the fiducial point [deg] - typically right +* ascension and declination. These are given by the CRVALia keywords in +* FITS. +* +* (Given and returned) The second pair of values are the native longitude, +* phi_p [deg], and latitude, theta_p [deg], of the celestial pole (the +* latter is the same as the celestial latitude of the native pole, +* delta_p) and these are given by the FITS keywords LONPOLEa and LATPOLEa +* (or by PVi_2a and PVi_3a attached to the longitude axis which take +* precedence if defined). +* +* LONPOLEa defaults to phi_0 (see above) if the celestial latitude of the +* fiducial point of the projection is greater than or equal to the native +* latitude, otherwise phi_0 + 180 [deg]. (This is the condition for the +* celestial latitude to increase in the same direction as the native +* latitude at the fiducial point.) ref[2] may be set to UNDEFINED (from +* wcsmath.h) or 999.0 to indicate that the correct default should be +* substituted. +* +* theta_p, the native latitude of the celestial pole (or equally the +* celestial latitude of the native pole, delta_p) is often determined +* uniquely by CRVALia and LONPOLEa in which case LATPOLEa is ignored. +* However, in some circumstances there are two valid solutions for theta_p +* and LATPOLEa is used to choose between them. LATPOLEa is set in ref[3] +* and the solution closest to this value is used to reset ref[3]. It is +* therefore legitimate, for example, to set ref[3] to +90.0 to choose the +* more northerly solution - the default if the LATPOLEa keyword is omitted +* from the FITS header. For the special case where the fiducial point of +* the projection is at native latitude zero, its celestial latitude is +* zero, and LONPOLEa = +/- 90.0 then the celestial latitude of the native +* pole is not determined by the first three reference values and LATPOLEa +* specifies it completely. +* +* The returned value, celprm::latpreq, specifies how LATPOLEa was actually +* used. +* +* struct prjprm prj +* (Given and returned) Projection parameters described in the prologue to +* prj.h. +* +* double euler[5] +* (Returned) Euler angles and associated intermediaries derived from the +* coordinate reference values. The first three values are the Z-, X-, and +* Z'-Euler angles [deg], and the remaining two are the cosine and sine of +* the X-Euler angle. +* +* int latpreq +* (Returned) For informational purposes, this indicates how the LATPOLEa +* keyword was used +* - 0: Not required, theta_p (== delta_p) was determined uniquely by the +* CRVALia and LONPOLEa keywords. +* - 1: Required to select between two valid solutions of theta_p. +* - 2: theta_p was specified solely by LATPOLEa. +* +* int isolat +* (Returned) True if the spherical rotation preserves the magnitude of the +* latitude, which occurs iff the axes of the native and celestial +* coordinates are coincident. It signals an opportunity to cache +* intermediate calculations common to all elements in a vector +* computation. +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* void *padding +* (An unused variable inserted for alignment purposes only.) +* +* Global variable: const char *cel_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Status messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_CEL +#define WCSLIB_CEL + +#include "prj.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *cel_errmsg[]; + +enum cel_errmsg_enum { + CELERR_SUCCESS = 0, /* Success. */ + CELERR_NULL_POINTER = 1, /* Null celprm pointer passed. */ + CELERR_BAD_PARAM = 2, /* Invalid projection parameters. */ + CELERR_BAD_COORD_TRANS = 3, /* Invalid coordinate transformation + parameters. */ + CELERR_ILL_COORD_TRANS = 4, /* Ill-conditioned coordinated transformation + parameters. */ + CELERR_BAD_PIX = 5, /* One or more of the (x,y) coordinates were + invalid. */ + CELERR_BAD_WORLD = 6 /* One or more of the (lng,lat) coordinates + were invalid. */ +}; + +struct celprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int offset; /* Force (x,y) = (0,0) at (phi_0,theta_0). */ + double phi0, theta0; /* Native coordinates of fiducial point. */ + double ref[4]; /* Celestial coordinates of fiducial */ + /* point and native coordinates of */ + /* celestial pole. */ + + struct prjprm prj; /* Projection parameters (see prj.h). */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + double euler[5]; /* Euler angles and functions thereof. */ + int latpreq; /* LATPOLEa requirement. */ + int isolat; /* True if |latitude| is preserved. */ + + /* Error handling */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private */ + /*------------------------------------------------------------------------*/ + void *padding; /* (Dummy inserted for alignment purposes.) */ +}; + +/* Size of the celprm struct in int units, used by the Fortran wrappers. */ +#define CELLEN (sizeof(struct celprm)/sizeof(int)) + + +int celini(struct celprm *cel); + +int celfree(struct celprm *cel); + +int celprt(const struct celprm *cel); + +int celperr(const struct celprm *cel, const char *prefix); + +int celset(struct celprm *cel); + +int celx2s(struct celprm *cel, int nx, int ny, int sxy, int sll, + const double x[], const double y[], + double phi[], double theta[], double lng[], double lat[], + int stat[]); + +int cels2x(struct celprm *cel, int nlng, int nlat, int sll, int sxy, + const double lng[], const double lat[], + double phi[], double theta[], double x[], double y[], + int stat[]); + + +/* Deprecated. */ +#define celini_errmsg cel_errmsg +#define celprt_errmsg cel_errmsg +#define celset_errmsg cel_errmsg +#define celx2s_errmsg cel_errmsg +#define cels2x_errmsg cel_errmsg + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_CEL */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/dis.c b/testbed/astropy__astropy/cextern/wcslib/C/dis.c new file mode 100644 index 0000000000000000000000000000000000000000..d0813f5fa34bbb51071cbe86a1546fb420e90eee --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/dis.c @@ -0,0 +1,3625 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: dis.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsprintf.h" +#include "wcsutil.h" +#include "dis.h" + +const int DISSET = 137; + +const int DIS_TPD = 1; +const int DIS_POLYNOMIAL = 2; +const int DIS_DOTPD = 1024; + +/* Maximum number of DPja or DQia keywords. */ +int NDPMAX = 256; + +/* Map status return value to message. */ +const char *dis_errmsg[] = { + "Success", + "Null disprm pointer passed", + "Memory allocation failed", + "Invalid parameter value", + "Distort error", + "De-distort error"}; + +/* Convenience macro for invoking wcserr_set(). */ +#define DIS_ERRMSG(status) WCSERR_SET(status), dis_errmsg[status] + +/* Internal helper functions, not for general use. */ +static int polyset(int j, struct disprm *dis); +static int tpdset(int j, struct disprm *dis); + +static int pol2tpd(int j, struct disprm *dis); +static int tpvset(int j, struct disprm *dis); +static int sipset(int j, struct disprm *dis); +static int dssset(int j, struct disprm *dis); +static int watset(int j, struct disprm *dis); +static int cheleg(int type, int m, int n, double coeffm[], double coeffn[]); + +static int dispoly(DISP2X_ARGS); +static int tpd1(DISP2X_ARGS); +static int tpd2(DISP2X_ARGS); +static int tpd3(DISP2X_ARGS); +static int tpd4(DISP2X_ARGS); +static int tpd5(DISP2X_ARGS); +static int tpd6(DISP2X_ARGS); +static int tpd7(DISP2X_ARGS); +static int tpd8(DISP2X_ARGS); +static int tpd9(DISP2X_ARGS); + +/* The first four iparm indices have meanings common to all distortion */ +/* functions. They are used by disp2x(), disx2p(), disprt(), and dishdo(). */ +#define I_DTYPE 0 /* Distortion type code. */ +#define I_NIPARM 1 /* Full (allocated) length of iparm[]. */ +#define I_NDPARM 2 /* No. of parameters in dparm[], excl. work space. */ +#define I_DOCORR 3 /* True if distortion func computes a correction. */ + +/*--------------------------------------------------------------------------*/ + +int disndp(int ndpmax) { if (ndpmax >= 0) NDPMAX = ndpmax; return NDPMAX; } + +/*--------------------------------------------------------------------------*/ + +int dpfill( + struct dpkey *dp, + const char *keyword, + const char *field, + int j, + int type, + int i, + double f) + +{ + char axno[8], *cp; + + if (keyword) { + if (field) { + if (j && 2 <= strlen(keyword)) { + /* Fill in the axis number from the value given. */ + if (keyword[2] == '\0') { + sprintf(dp->field, "%s%d.%s", keyword, j, field); + } else { + /* Take care not to overwrite any alternate code. */ + sprintf(dp->field, "%s.%s", keyword, field); + sprintf(axno, "%d", j); + dp->field[2] = axno[0]; + } + + } else { + sprintf(dp->field, "%s.%s", keyword, field); + } + } else { + strcpy(dp->field, keyword); + } + } else if (field) { + strcpy(dp->field, field); + } + + if (j) { + dp->j = j; + } else { + /* The field name must either be given or preset. */ + if ((cp = strpbrk(dp->field, "0123456789")) != 0x0) { + sscanf(cp, "%d.", &(dp->j)); + } + } + + if ((dp->type = type)) { + dp->value.f = f; + } else { + dp->value.i = i; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int dpkeyi(const struct dpkey *dp) + +{ + if (dp->type != 0) { + return (int)dp->value.f; + } + + return dp->value.i; +} + +/*--------------------------------------------------------------------------*/ + +double dpkeyd(const struct dpkey *dp) + +{ + if (dp->type == 0) { + return (double)dp->value.i; + } + + return dp->value.f; +} + +/*--------------------------------------------------------------------------*/ + +int disini(int alloc, int naxis, struct disprm *dis) + +{ + return disinit(alloc, naxis, dis, -1); +} + +/*--------------------------------------------------------------------------*/ + +int disinit(int alloc, int naxis, struct disprm *dis, int ndpmax) + +{ + static const char *function = "disinit"; + + struct wcserr **err; + + /* Check inputs. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + + if (ndpmax < 0) ndpmax = disndp(-1); + + + /* Initialize error message handling. */ + err = &(dis->err); + if (dis->flag != -1) { + if (dis->err) free(dis->err); + } + dis->err = 0x0; + + + /* Initialize pointers. */ + if (dis->flag == -1 || dis->m_flag != DISSET) { + if (dis->flag == -1) { + dis->axmap = 0x0; + dis->Nhat = 0x0; + dis->offset = 0x0; + dis->scale = 0x0; + dis->iparm = 0x0; + dis->dparm = 0x0; + + dis->disp2x = 0x0; + dis->disx2p = 0x0; + dis->tmpmem = 0x0; + + dis->i_naxis = 0; + } + + /* Initialize memory management. */ + dis->m_flag = 0; + dis->m_naxis = 0; + dis->m_dtype = 0x0; + dis->m_dp = 0x0; + dis->m_maxdis = 0x0; + } + + if (naxis < 0) { + return wcserr_set(WCSERR_SET(DISERR_MEMORY), + "naxis must not be negative (got %d)", naxis); + } + + + /* Allocate memory for arrays if required. */ + if (alloc || + dis->dtype == 0x0 || + (ndpmax && dis->dp == 0x0) || + dis->maxdis == 0x0) { + + /* Was sufficient allocated previously? */ + if (dis->m_flag == DISSET && + (dis->m_naxis < naxis || + dis->ndpmax < ndpmax)) { + /* No, free it. */ + disfree(dis); + } + + if (alloc || dis->dtype == 0x0) { + if (dis->m_dtype) { + /* In case the caller fiddled with it. */ + dis->dtype = dis->m_dtype; + + } else { + if ((dis->dtype = calloc(naxis, sizeof(char [72]))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + dis->m_flag = DISSET; + dis->m_naxis = naxis; + dis->m_dtype = dis->dtype; + } + } + + if (alloc || dis->dp == 0x0) { + if (dis->m_dp) { + /* In case the caller fiddled with it. */ + dis->dp = dis->m_dp; + + } else { + if (ndpmax) { + if ((dis->dp = calloc(ndpmax, sizeof(struct dpkey))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + } else { + dis->dp = 0x0; + } + + dis->ndpmax = ndpmax; + + dis->m_flag = DISSET; + dis->m_naxis = naxis; + dis->m_dp = dis->dp; + } + } + + if (alloc || dis->maxdis == 0x0) { + if (dis->m_maxdis) { + /* In case the caller fiddled with it. */ + dis->maxdis = dis->m_maxdis; + + } else { + if ((dis->maxdis = calloc(naxis, sizeof(double))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + dis->m_flag = DISSET; + dis->m_naxis = naxis; + dis->m_maxdis = dis->maxdis; + } + } + } + + + /* Set defaults. */ + dis->flag = 0; + dis->naxis = naxis; + + memset(dis->dtype, 0, naxis*sizeof(char [72])); + dis->ndp = 0; + memset(dis->dp, 0, ndpmax*sizeof(struct dpkey)); + memset(dis->maxdis, 0, naxis*sizeof(double)); + dis->totdis = 0.0; + + return 0; +} + + +/*--------------------------------------------------------------------------*/ + +int discpy(int alloc, const struct disprm *dissrc, struct disprm *disdst) + +{ + static const char *function = "discpy"; + + int naxis, status; + struct wcserr **err; + + if (dissrc == 0x0) return DISERR_NULL_POINTER; + if (disdst == 0x0) return DISERR_NULL_POINTER; + err = &(disdst->err); + + naxis = dissrc->naxis; + if (naxis < 1) { + return wcserr_set(WCSERR_SET(DISERR_MEMORY), + "naxis must be positive (got %d)", naxis); + } + + if ((status = disinit(alloc, naxis, disdst, dissrc->ndpmax))) { + return status; + } + + memcpy(disdst->dtype, dissrc->dtype, naxis*sizeof(char [72])); + + disdst->ndp = dissrc->ndp; + memcpy(disdst->dp, dissrc->dp, dissrc->ndpmax*sizeof(struct dpkey)); + + memcpy(disdst->maxdis, dissrc->maxdis, naxis*sizeof(double)); + disdst->totdis = dissrc->totdis; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int disfree(struct disprm *dis) + +{ + int j; + + if (dis == 0x0) return DISERR_NULL_POINTER; + + if (dis->flag != -1) { + /* Optionally allocated by disinit() for given parameters. */ + if (dis->m_flag == DISSET) { + if (dis->dtype == dis->m_dtype) dis->dtype = 0x0; + if (dis->dp == dis->m_dp) dis->dp = 0x0; + if (dis->maxdis == dis->m_maxdis) dis->maxdis = 0x0; + + if (dis->m_dtype) free(dis->m_dtype); + if (dis->m_dp) free(dis->m_dp); + if (dis->m_maxdis) free(dis->m_maxdis); + } + + /* Recall that these were allocated in bulk by disset(). */ + if (dis->axmap && dis->axmap[0]) free(dis->axmap[0]); + if (dis->offset && dis->offset[0]) free(dis->offset[0]); + if (dis->scale && dis->scale[0]) free(dis->scale[0]); + + if (dis->axmap) free(dis->axmap); + if (dis->Nhat) free(dis->Nhat); + if (dis->offset) free(dis->offset); + if (dis->scale) free(dis->scale); + for (j = 0; j < dis->i_naxis; j++) { + if (dis->iparm[j]) free(dis->iparm[j]); + if (dis->dparm[j]) free(dis->dparm[j]); + } + if (dis->iparm) free(dis->iparm); + if (dis->dparm) free(dis->dparm); + + if (dis->disp2x) free(dis->disp2x); + if (dis->disx2p) free(dis->disx2p); + if (dis->tmpmem) free(dis->tmpmem); + + if (dis->err) free(dis->err); + } + + dis->m_flag = 0; + dis->m_naxis = 0; + dis->m_dtype = 0x0; + dis->m_dp = 0x0; + dis->m_maxdis = 0x0; + + dis->axmap = 0x0; + dis->Nhat = 0x0; + dis->offset = 0x0; + dis->scale = 0x0; + dis->iparm = 0x0; + dis->dparm = 0x0; + dis->disp2x = 0x0; + dis->disx2p = 0x0; + dis->tmpmem = 0x0; + + dis->err = 0x0; + + dis->flag = 0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int disprt(const struct disprm *dis) + +{ + char hext[32]; + int i, j, jhat, k, naxis; + + if (dis == 0x0) return DISERR_NULL_POINTER; + + if (dis->flag != DISSET) { + wcsprintf("The disprm struct is UNINITIALIZED.\n"); + return 0; + } + + naxis = dis->naxis; + + + wcsprintf(" flag: %d\n", dis->flag); + + /* Parameters supplied. */ + wcsprintf(" naxis: %d\n", naxis); + + WCSPRINTF_PTR(" dtype: ", dis->dtype, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" \"%s\"\n", dis->dtype[j]); + } + + wcsprintf(" ndp: %d\n", dis->ndp); + wcsprintf(" ndpmax: %d\n", dis->ndpmax); + WCSPRINTF_PTR(" dp: ", dis->dp, "\n"); + for (i = 0; i < dis->ndp; i++) { + if (dis->dp[i].type) { + wcsprintf(" %3d%3d %#- 11.5g %.32s\n", + dis->dp[i].j, dis->dp[i].type, dis->dp[i].value.f, dis->dp[i].field); + } else { + wcsprintf(" %3d%3d %11d %.32s\n", + dis->dp[i].j, dis->dp[i].type, dis->dp[i].value.i, dis->dp[i].field); + } + } + + WCSPRINTF_PTR(" maxdis: ", dis->maxdis, "\n"); + wcsprintf(" "); + for (j = 0; j < naxis; j++) { + wcsprintf(" %#- 11.5g", dis->maxdis[j]); + } + wcsprintf("\n"); + + wcsprintf(" totdis: %#- 11.5g\n", dis->totdis); + + /* Derived values. */ + WCSPRINTF_PTR(" axmap: ", dis->axmap, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" axmap[%d][]:", j); + for (jhat = 0; jhat < naxis; jhat++) { + wcsprintf("%6d", dis->axmap[j][jhat]); + } + wcsprintf("\n "); + for (jhat = naxis; jhat < 2*naxis; jhat++) { + wcsprintf("%6d", dis->axmap[j][jhat]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" Nhat: ", dis->Nhat, "\n"); + wcsprintf(" "); + for (j = 0; j < naxis; j++) { + wcsprintf("%6d", dis->Nhat[j]); + } + wcsprintf("\n"); + + WCSPRINTF_PTR(" offset: ", dis->offset, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf("offset[%d][]:", j); + for (jhat = 0; jhat < naxis; jhat++) { + wcsprintf(" %#- 11.5g", dis->offset[j][jhat]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" scale: ", dis->scale, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" scale[%d][]:", j); + for (jhat = 0; jhat < naxis; jhat++) { + wcsprintf(" %#- 11.5g", dis->scale[j][jhat]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" iparm: ", dis->iparm, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" iparm[%d] : ", j); + WCSPRINTF_PTR("", dis->iparm[j], "\n"); + + if (dis->iparm[j]) { + wcsprintf(" iparm[%d][]:", j); + for (k = 0; k < dis->iparm[j][I_NIPARM]; k++) { + if (k && k%5 == 0) { + wcsprintf("\n "); + } + wcsprintf(" %11d", dis->iparm[j][k]); + } + wcsprintf("\n"); + } + } + + WCSPRINTF_PTR(" dparm: ", dis->dparm, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" dparm[%d] : ", j); + WCSPRINTF_PTR("", dis->dparm[j], "\n"); + + if (dis->dparm[j]) { + wcsprintf(" dparm[%d][]:", j); + for (k = 0; k < dis->iparm[j][I_NDPARM]; k++) { + if (k && k%5 == 0) { + wcsprintf("\n "); + } + wcsprintf(" %#- 11.5g", dis->dparm[j][k]); + } + wcsprintf("\n"); + } + } + + wcsprintf(" i_naxis: %d\n", dis->i_naxis); + wcsprintf(" ndis: %d\n", dis->ndis); + + /* Error handling. */ + WCSPRINTF_PTR(" err: ", dis->err, "\n"); + if (dis->err) { + wcserr_prt(dis->err, " "); + } + + /* Work arrays. */ + WCSPRINTF_PTR(" disp2x: ", dis->disp2x, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" disp2x[%d]: %s", j, + wcsutil_fptr2str((void (*)(void))dis->disp2x[j], hext)); + if (dis->disp2x[j] == dispoly) { + wcsprintf(" (= dispoly)\n"); + } else if (dis->disp2x[j] == tpd1) { + wcsprintf(" (= tpd1)\n"); + } else if (dis->disp2x[j] == tpd2) { + wcsprintf(" (= tpd2)\n"); + } else if (dis->disp2x[j] == tpd3) { + wcsprintf(" (= tpd3)\n"); + } else if (dis->disp2x[j] == tpd4) { + wcsprintf(" (= tpd4)\n"); + } else if (dis->disp2x[j] == tpd5) { + wcsprintf(" (= tpd5)\n"); + } else if (dis->disp2x[j] == tpd6) { + wcsprintf(" (= tpd6)\n"); + } else if (dis->disp2x[j] == tpd7) { + wcsprintf(" (= tpd7)\n"); + } else if (dis->disp2x[j] == tpd8) { + wcsprintf(" (= tpd8)\n"); + } else if (dis->disp2x[j] == tpd9) { + wcsprintf(" (= tpd9)\n"); + } else { + wcsprintf("\n"); + } + } + WCSPRINTF_PTR(" disx2p: ", dis->disx2p, "\n"); + for (j = 0; j < naxis; j++) { + wcsprintf(" disx2p[%d]: %s\n", j, + wcsutil_fptr2str((void (*)(void))dis->disx2p[j], hext)); + } + WCSPRINTF_PTR(" tmpmem: ", dis->tmpmem, "\n"); + + /* Memory management. */ + wcsprintf(" m_flag: %d\n", dis->m_flag); + wcsprintf(" m_naxis: %d\n", dis->m_naxis); + WCSPRINTF_PTR(" m_dtype: ", dis->m_dtype, ""); + if (dis->m_dtype == dis->dtype) wcsprintf(" (= dtype)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_dp: ", dis->m_dp, ""); + if (dis->m_dp == dis->dp) wcsprintf(" (= dp)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_maxdis: ", dis->m_maxdis, ""); + if (dis->m_maxdis == dis->maxdis) wcsprintf(" (= maxdis)"); + wcsprintf("\n"); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int disperr(const struct disprm *dis, const char *prefix) + +{ + if (dis == 0x0) return DISERR_NULL_POINTER; + + if (dis->err) { + wcserr_prt(dis->err, prefix); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int dishdo(struct disprm *dis) + +{ + static const char *function = "dishdo"; + + int j, status; + struct wcserr **err; + + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + status = 0; + for (j = 0; j < dis->naxis; j++) { + if (dis->iparm[j][I_DTYPE]) { + if (dis->iparm[j][I_DTYPE] == DIS_TPD) { + /* Implemented as TPD... */ + if (strcmp(dis->dtype[j], "TPD") != 0) { + /* ... but isn't TPD. */ + dis->iparm[j][I_DTYPE] |= DIS_DOTPD; + } + } else { + /* Must be a Polynomial that can't be implemented as TPD. */ + status = wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Translation of %s to TPD is not possible", dis->dtype[j]); + } + } + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int disset(struct disprm *dis) + +{ + static const char *function = "disset"; + + char *dpq, *fp; + int idp, j, jhat, k, naxis, ndis, Nhat, status; + struct dpkey *keyp; + struct wcserr **err; + + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + naxis = dis->naxis; + + + /* Do basic checks. */ + if (dis->ndp < 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "disprm::ndp is negative (%d)", dis->ndp); + } + + ndis = 0; + for (j = 0; j < naxis; j++) { + if (strlen(dis->dtype[j])) { + ndis++; + break; + } + } + + if (dis->ndp) { + /* Is it prior or sequent? */ + if (dis->dp[0].field[1] == 'P') { + dpq = "DPja"; + } else if (dis->dp[0].field[1] == 'Q') { + dpq = "DQia"; + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "disprm::dp[0].field (%s) is invalid", dis->dp[0].field); + } + + } else { + if (ndis) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "No DPja or DQia keywords, NAXES at least is required for each " + "distortion"); + } + + /* A Clayton's distortion. Avert compiler warnings about possible use of + uninitialized variables. */ + dpq = 0x0; + } + + + /* Allocate memory for derived parameters and work arrays. */ + if (dis->i_naxis < naxis) { + if (dis->i_naxis) { + /* Recall that axmap, offset, and scale are allocated in bulk. */ + free(dis->axmap[0]); + free(dis->axmap); + free(dis->Nhat); + free(dis->offset[0]); + free(dis->offset); + free(dis->scale[0]); + free(dis->scale); + + for (j = 0; j < dis->i_naxis; j++) { + /* Memory allocated separately for each axis. */ + if (dis->iparm[j]) free(dis->iparm[j]); + if (dis->dparm[j]) free(dis->dparm[j]); + } + free(dis->iparm); + free(dis->dparm); + + free(dis->disp2x); + free(dis->disx2p); + + free(dis->tmpmem); + } + + if ((dis->axmap = calloc(naxis, sizeof(int *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* Allocate axmap[][] in bulk and then carve it up. */ + if ((dis->axmap[0] = calloc(2*naxis*naxis, sizeof(int))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + for (j = 1; j < naxis; j++) { + dis->axmap[j] = dis->axmap[j-1] + 2*naxis; + } + + if ((dis->Nhat = calloc(naxis, sizeof(int *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->offset = calloc(naxis, sizeof(double *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* Allocate offset[][] in bulk and then carve it up. */ + if ((dis->offset[0] = calloc(naxis*naxis, sizeof(double))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + for (j = 1; j < naxis; j++) { + dis->offset[j] = dis->offset[j-1] + naxis; + } + + if ((dis->scale = calloc(naxis, sizeof(double *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* Allocate scale[][] in bulk and then carve it up. */ + if ((dis->scale[0] = calloc(naxis*naxis, sizeof(double))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + for (j = 1; j < naxis; j++) { + dis->scale[j] = dis->scale[j-1] + naxis; + } + + if ((dis->iparm = calloc(naxis, sizeof(int *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->dparm = calloc(naxis, sizeof(double *))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->disp2x = calloc(naxis, sizeof(int (*)(DISP2X_ARGS)))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->disx2p = calloc(naxis, sizeof(int (*)(DISX2P_ARGS)))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->tmpmem = calloc(5*naxis, sizeof(double))) == 0x0) { + disfree(dis); + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + dis->i_naxis = naxis; + } + + /* Start with a clean slate. */ + for (jhat = 0; jhat < 2*naxis*naxis; jhat++) { + dis->axmap[0][jhat] = -1; + } + + memset(dis->Nhat, 0, naxis*sizeof(int)); + memset(dis->offset[0], 0, naxis*naxis*sizeof(double)); + + for (jhat = 0; jhat < naxis*naxis; jhat++) { + dis->scale[0][jhat] = 1.0; + } + + /* polyset() etc. must look after iparm[][] and dparm[][]. */ + + dis->i_naxis = naxis; + dis->ndis = 0; + + memset(dis->disp2x, 0, naxis*sizeof(int (*)(DISP2X_ARGS))); + memset(dis->disx2p, 0, naxis*sizeof(int (*)(DISX2P_ARGS))); + memset(dis->tmpmem, 0, naxis*sizeof(double)); + + + /* Handle DPja or DQia keywords common to all distortions. */ + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + /* Check that they're all one kind or the other. */ + if (keyp->field[1] != dpq[1]) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "disprm::dp appears to contain a mix of DPja and DQia keys"); + } + + j = keyp->j; + + if (j < 1 || naxis < j) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid axis number (%d) in %s", j, keyp->field); + } + + if ((fp = strchr(keyp->field, '.')) == 0x0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid record field name: %s", j, keyp->field); + } + fp++; + + j--; + if (strncmp(fp, "NAXES", 6) == 0) { + Nhat = dpkeyi(keyp); + if (Nhat < 0 || naxis < Nhat) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid value of Nhat for %s distortion in %s: %d", dis->dtype[j], + keyp->field, Nhat); + } + + dis->Nhat[j] = Nhat; + + } else if (strncmp(fp, "AXIS.", 5) == 0) { + sscanf(fp+5, "%d", &jhat); + if (jhat < 1 || naxis < jhat) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid axis in axis map for %s distortion in %s: %d", + dis->dtype[j], keyp->field, jhat); + } + + /* N.B. axis numbers in the map are 0-relative. */ + dis->axmap[j][jhat-1] = dpkeyi(keyp) - 1; + + } else if (strncmp(fp, "OFFSET.", 7) == 0) { + sscanf(fp+7, "%d", &jhat); + dis->offset[j][jhat-1] = dpkeyd(keyp); + + } else if (strncmp(fp, "SCALE.", 6) == 0) { + sscanf(fp+6, "%d", &jhat); + dis->scale[j][jhat-1] = dpkeyd(keyp); + } + + /* DOCORR should also be handled here but no space was provided for it + in disprm. */ + } + + /* Set defaults and do sanity checks on axmap[][]. */ + for (j = 0; j < naxis; j++) { + if (strlen(dis->dtype[j]) == 0) { + /* No distortion on this axis, check that there are no parameters. */ + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j == j+1) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "No distortion type, yet %s keyvalues are present for axis %d", + dpq, j+1); + } + } + + continue; + } + + /* N.B. NAXES (Nhat) has no default value. */ + if (dis->Nhat[j] <= 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "%s.NAXES was not set (or bad) for %s distortion on axis %d", + dpq, dis->dtype[j], j+1); + } + + /* Set defaults for axmap[][]. */ + Nhat = dis->Nhat[j]; + for (jhat = 0; jhat < Nhat; jhat++) { + if (dis->axmap[j][jhat] == -1) { + dis->axmap[j][jhat] = jhat; + } + } + + /* Sanity check on the length of the axis map. */ + Nhat = 0; + for (jhat = 0; jhat < naxis; jhat++) { + if (dis->axmap[j][jhat] != -1) Nhat = jhat+1; + } + + if (Nhat != dis->Nhat[j]) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Mismatch in length of axis map for %s distortion on axis %d", + dis->dtype[j], j+1); + } + + /* Check uniqueness of entries in the axis map. */ + for (jhat = 0; jhat < Nhat; jhat++) { + for (k = 0; k < jhat; k++) { + if (dis->axmap[j][jhat] == dis->axmap[j][k]) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Duplicated entry in axis map for %s distortion on axis %d", + dis->dtype[j], j+1); + } + } + } + + /* Construct the inverse axis map. */ + for (jhat = 0; jhat < Nhat; jhat++) { + k = naxis + dis->axmap[j][jhat]; + dis->axmap[j][k] = jhat; + } + } + + + /* Identify the distortion functions. */ + ndis = 0; + for (j = 0; j < naxis; j++) { + if (strlen(dis->dtype[j]) == 0) { + /* No distortion on this axis. */ + continue; + } + + if (dis->Nhat[j] == 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Empty axis map for %s distortion on axis %d", dis->dtype[j], j+1); + } + + /* Invoke the specific setup functions for each distortion. */ + if (strcmp(dis->dtype[j], "TPD") == 0) { + /* Template Polynomial Distortion. */ + if ((status = tpdset(j, dis))) { + /* (Preserve the error message set by tpdset().) */ + return status; + } + + } else if (strcmp(dis->dtype[j], "TPV") == 0) { + /* TPV "projection". */ + if ((status = tpvset(j, dis))) { + /* (Preserve the error message set by tpvset().) */ + return status; + } + + } else if (strcmp(dis->dtype[j], "SIP") == 0) { + /* Simple Imaging Polynomial (SIP). */ + if ((status = sipset(j, dis))) { + /* (Preserve the error message set by sipset().) */ + return status; + } + + } else if (strcmp(dis->dtype[j], "DSS") == 0) { + /* Digitized Sky Survey (DSS). */ + if ((status = dssset(j, dis))) { + /* (Preserve the error message set by dssset().) */ + return status; + } + + } else if (strncmp(dis->dtype[j], "WAT", 3) == 0) { + /* WAT (TNX or ZPX "projections"). */ + if ((status = watset(j, dis))) { + /* (Preserve the error message set by watset().) */ + return status; + } + + } else if (strcmp(dis->dtype[j], "Polynomial") == 0 || + strcmp(dis->dtype[j], "Polynomial*") == 0) { + /* General polynomial distortion. */ + if ((status = polyset(j, dis))) { + /* (Preserve the error message set by polyset().) */ + return status; + } + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized/unimplemented distortion function: %s", dis->dtype[j]); + } + + ndis++; + } + + dis->ndis = ndis; + dis->flag = DISSET; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int disp2x( + struct disprm *dis, + const double rawcrd[], + double discrd[]) + +{ + static const char *function = "disp2x"; + + int axisj, j, jhat, naxis, Nhat, status; + double dtmp, *offset, *scale, *tmpcrd; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + if (dis->flag != DISSET) { + if ((status = disset(dis))) return status; + } + + naxis = dis->naxis; + + + /* Invoke the distortion functions for each axis. */ + tmpcrd = dis->tmpmem; + for (j = 0; j < naxis; j++) { + if (dis->disp2x[j]) { + offset = dis->offset[j]; + scale = dis->scale[j]; + + Nhat = dis->Nhat[j]; + for (jhat = 0; jhat < Nhat; jhat++) { + axisj = dis->axmap[j][jhat]; + tmpcrd[jhat] = (rawcrd[axisj] - offset[jhat])*scale[jhat]; + } + + if ((status = (dis->disp2x[j])(0, dis->iparm[j], dis->dparm[j], Nhat, + tmpcrd, &dtmp))) { + return wcserr_set(DIS_ERRMSG(DISERR_DISTORT)); + } + + if (dis->iparm[j][I_DOCORR]) { + /* Distortion function computes a correction. */ + discrd[j] = rawcrd[j] + dtmp; + } else { + discrd[j] = dtmp; + } + + } else { + discrd[j] = rawcrd[j]; + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ +/* This function is intended for debugging purposes only. */ +/* No documentation or prototype is provided in dis.h. */ + +int disitermax(int itermax) + +{ + static int ITERMAX = 30; + + if (itermax >= 0) { + ITERMAX = itermax; + } + + return ITERMAX; +} + +/*--------------------------------------------------------------------------*/ + +int disx2p( + struct disprm *dis, + const double discrd[], + double rawcrd[]) + +{ + static const char *function = "disx2p"; + + const double TOL = 1.0e-13; + + int axisj, convergence, iter, itermax, j, jhat, naxis, Nhat, status; + double dd, *dcrd0, *dcrd1, *delta, *offset, residual, *rcrd1, rtmp, *scale, + *tmpcrd; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + naxis = dis->naxis; + + /* Carve up working memory, noting that disp2x() gets to it first. */ + dcrd0 = dis->tmpmem + naxis; + dcrd1 = dcrd0 + naxis; + rcrd1 = dcrd1 + naxis; + delta = rcrd1 + naxis; + + + /* Zeroth approximation. The assumption here and below is that the */ + /* distortion is small so that, to first order in the neighbourhood of */ + /* the solution, discrd[j] ~= a + b*rawcrd[j], i.e. independent of */ + /* rawcrd[i], where i != j. This is effectively equivalent to assuming */ + /* that the distortion functions are separable to first order. */ + /* Furthermore, a is assumed to be small, and b close to unity. */ + memcpy(rawcrd, discrd, naxis*sizeof(double)); + + /* If available, use disprm::disx2p to improve the zeroth approximation. */ + for (j = 0; j < naxis; j++) { + if (dis->disx2p[j]) { + offset = dis->offset[j]; + scale = dis->scale[j]; + tmpcrd = dis->tmpmem; + + Nhat = dis->Nhat[j]; + for (jhat = 0; jhat < Nhat; jhat++) { + axisj = dis->axmap[j][jhat]; + tmpcrd[jhat] = (discrd[axisj] - offset[jhat])*scale[jhat]; + } + + if ((status = (dis->disx2p[j])(1, dis->iparm[j], dis->dparm[j], Nhat, + tmpcrd, &rtmp))) { + return wcserr_set(DIS_ERRMSG(DISERR_DEDISTORT)); + } + + if (dis->iparm[j][I_DOCORR]) { + /* Inverse distortion function computes a correction. */ + rawcrd[j] = discrd[j] + rtmp; + } else { + rawcrd[j] = rtmp; + } + } + } + + /* Quick return debugging hook, assumes inverse functions were defined. */ + if ((itermax = disitermax(-1)) == 0) { + return 0; + } + + + /* Iteratively invert the (well-behaved!) distortion function. */ + for (iter = 0; iter < itermax; iter++) { + if ((status = disp2x(dis, rawcrd, dcrd0))) { + return wcserr_set(DIS_ERRMSG(status)); + } + + /* Check for convergence. */ + convergence = 1; + for (j = 0; j < naxis; j++) { + delta[j] = discrd[j] - dcrd0[j]; + + if (fabs(discrd[j]) < 1.0) { + dd = delta[j]; + } else { + /* TOL may be below the precision achievable from floating point */ + /* subtraction, so switch to a fractional tolerance. */ + dd = delta[j] / discrd[j]; + } + + if (TOL < fabs(dd)) { + /* No convergence yet on this axis. */ + convergence = 0; + } + } + + if (convergence) break; + + /* Determine a suitable test point for computing the gradient. */ + for (j = 0; j < naxis; j++) { + /* Constrain the displacement. */ + delta[j] /= 2.0; + if (fabs(delta[j]) < 1.0e-6) { + if (delta[j] < 0.0) { + delta[j] = -1.0e-6; + } else { + delta[j] = 1.0e-6; + } + } else if (1.0 < fabs(delta[j])) { + if (delta[j] < 0.0) { + delta[j] = -1.0; + } else { + delta[j] = 1.0; + } + } + } + + if (iter < itermax/2) { + /* With the assumption of small distortions (as above), the gradient */ + /* of discrd[j] should be dominated by the partial derivative with */ + /* respect to rawcrd[j], and we can neglect partials with respect */ + /* to rawcrd[i], where i != j. Thus only one test point is needed, */ + /* not one for each axis. */ + for (j = 0; j < naxis; j++) { + rcrd1[j] = rawcrd[j] + delta[j]; + } + + /* Compute discrd[] at the test point. */ + if ((status = disp2x(dis, rcrd1, dcrd1))) { + return wcserr_set(DIS_ERRMSG(status)); + } + + /* Compute the next approximation. */ + for (j = 0; j < naxis; j++) { + rawcrd[j] += (discrd[j] - dcrd0[j]) * + (delta[j]/(dcrd1[j] - dcrd0[j])); + } + + } else { + /* Convergence should not take more than seven or so iterations. As */ + /* it is slow, try computing the gradient in full. */ + memcpy(rcrd1, rawcrd, naxis*sizeof(double)); + + for (j = 0; j < naxis; j++) { + rcrd1[j] += delta[j]; + + /* Compute discrd[] at the test point. */ + if ((status = disp2x(dis, rcrd1, dcrd1))) { + return wcserr_set(DIS_ERRMSG(status)); + } + + /* Compute the next approximation. */ + rawcrd[j] += (discrd[j] - dcrd0[j]) * + (delta[j]/(dcrd1[j] - dcrd0[j])); + + rcrd1[j] -= delta[j]; + } + } + } + + + if (!convergence) { + residual = 0.0; + for (j = 0; j < naxis; j++) { + dd = discrd[j] - dcrd0[j] ; + residual += dd*dd; + } + residual = sqrt(residual); + + return wcserr_set(WCSERR_SET(DISERR_DEDISTORT), + "Convergence not achieved after %d iterations, residual %#7.2g", iter, + residual); + } + + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int diswarp( + struct disprm *dis, + const double pixblc[], + const double pixtrc[], + const double pixsamp[], + int *nsamp, + double maxdis[], + double *maxtot, + double avgdis[], + double *avgtot, + double rmsdis[], + double *rmstot) + +{ + static const char *function = "diswarp"; + + int carry, j, naxis, status = 0; + double dpix, dpx2, dssq, *pix0, *pix1, *pixend, *pixinc, pixspan, *ssqdis, + ssqtot, *sumdis, sumtot, totdis; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + naxis = dis->naxis; + + if (nsamp) *nsamp = 0; + for (j = 0; j < naxis; j++) { + if (maxdis) maxdis[j] = 0.0; + if (avgdis) avgdis[j] = 0.0; + if (rmsdis) rmsdis[j] = 0.0; + } + if (maxtot) *maxtot = 0.0; + if (avgtot) *avgtot = 0.0; + if (rmstot) *rmstot = 0.0; + + /* Quick return if no distortions. */ + if (dis->ndis == 0) return 0; + + /* Carve up working memory, noting that disp2x() gets to it first. */ + pixinc = dis->tmpmem + naxis; + pixend = pixinc + naxis; + sumdis = pixend + naxis; + ssqdis = sumdis + naxis; + + /* Work out increments on each axis. */ + for (j = 0; j < naxis; j++) { + pixspan = pixtrc[j] - (pixblc ? pixblc[j] : 1.0); + + if (pixsamp == 0x0) { + pixinc[j] = 1.0; + } else if (pixsamp[j] == 0.0) { + pixinc[j] = 1.0; + } else if (pixsamp[j] > 0.0) { + pixinc[j] = pixsamp[j]; + } else if (pixsamp[j] > -1.5) { + pixinc[j] = 2.0*pixspan; + } else { + pixinc[j] = pixspan / ((int)(-pixsamp[j] - 0.5)); + } + } + + /* Get some more memory for coordinate vectors. */ + if ((pix0 = calloc(2*naxis, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + pix1 = pix0 + naxis; + + + /* Set up the array of pixel coordinates. */ + for (j = 0; j < naxis; j++) { + pix0[j] = pixblc ? pixblc[j] : 1.0; + pixend[j] = pixtrc[j] + 0.5*pixinc[j]; + } + + /* Initialize accumulators. */ + for (j = 0; j < naxis; j++) { + sumdis[j] = 0.0; + ssqdis[j] = 0.0; + } + sumtot = 0.0; + ssqtot = 0.0; + + + /* Loop over N dimensions. */ + carry = 0; + while (carry == 0) { + if ((status = disp2x(dis, pix0, pix1))) { + /* (Preserve the error message set by disp2x().) */ + goto cleanup; + } + + /* Accumulate statistics. */ + (*nsamp)++; + + dssq = 0.0; + for (j = 0; j < naxis; j++) { + dpix = pix1[j] - pix0[j]; + dpx2 = dpix*dpix; + + sumdis[j] += dpix; + ssqdis[j] += dpx2; + + if (maxdis && (dpix = fabs(dpix)) > maxdis[j]) { + maxdis[j] = dpix; + } + + dssq += dpx2; + } + + totdis = sqrt(dssq); + sumtot += totdis; + ssqtot += totdis*totdis; + + if (maxtot && *maxtot < totdis) { + *maxtot = totdis; + } + + /* Next pixel. */ + for (j = 0; j < naxis; j++) { + pix0[j] += pixinc[j]; + if (pix0[j] < pixend[j]) { + carry = 0; + break; + } + + pix0[j] = pixblc ? pixblc[j] : 1.0; + carry = 1; + } + } + + + /* Compute the means and RMSs. */ + for (j = 0; j < naxis; j++) { + ssqdis[j] /= *nsamp; + sumdis[j] /= *nsamp; + if (avgdis) avgdis[j] = sumdis[j]; + if (rmsdis) rmsdis[j] = sqrt(ssqdis[j] - sumdis[j]*sumdis[j]); + } + + ssqtot /= *nsamp; + sumtot /= *nsamp; + if (avgtot) *avgtot = sumtot; + if (rmstot) *rmstot = sqrt(ssqtot - sumtot*sumtot); + + +cleanup: + free(pix0); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int polyset(int j, struct disprm *dis) + +{ + static const char *function = "polyset"; + + char *fp, id[32]; + int i, idp, *iparm, ipow, ivar, jhat, k, K, lendp, m, M, naxis, ndparm, + Nhat, niparm, nKparm, npow, nTparm, nVar, offset; + double *dparm, *dptr, power; + struct dpkey *keyp; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + naxis = dis->naxis; + sprintf(id, "Polynomial on axis %d", j+1); + + + /* Find the number of auxiliary variables and terms. */ + K = 0; + M = 0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + if ((fp = strchr(keyp->field, '.')) == 0x0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid field name for %s: %s", id, keyp->field); + } + fp++; + + if (strcmp(fp, "NAUX") == 0) { + K = dpkeyi(keyp); + } else if (strcmp(fp, "NTERMS") == 0) { + M = dpkeyi(keyp); + } + } + + if (K < 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid number of auxiliaries (%d) for %s", K, id); + } + + if (M <= 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid number of terms (%d) for %s", M, id); + } + + Nhat = dis->Nhat[j]; + nKparm = 2*(Nhat + 1); + nVar = Nhat + K; + nTparm = 1 + nVar; + ndparm = K*nKparm + M*nTparm; + +/* These iparm indices are specific to Polynomial. */ +#define I_NIDX 4 /* No. of indexes in iparm[]. */ +#define I_LENDP 5 /* Full (allocated) length of dparm[]. */ +#define I_K 6 /* No. of auxiliary variables. */ +#define I_M 7 /* No. of terms in the polynomial. */ +#define I_NKPARM 8 /* No. of parameters used to define each auxiliary. */ +#define I_NTPARM 9 /* No. of parameters used to define each term. */ +#define I_NVAR 10 /* No. of independent + auxiliary variables. */ +#define I_MNVAR 11 /* No. of powers (exponents) in the polynomial. */ +#define I_DPOLY 12 /* dparm offset for polynomial coefficients. */ +#define I_DAUX 13 /* dparm offset for auxiliary coefficients. */ +#define I_DVPOW 14 /* dparm offset for integral powers of variables. */ +#define I_MAXPOW 15 /* iparm offset for max powers. */ +#define I_DPOFF 16 /* iparm offset for dparm offsets. */ +#define I_FLAGS 17 /* iparm offset for flags. */ +#define I_IPOW 18 /* iparm offset for integral powers. */ +#define I_NPOLY 19 + + /* Add extra for handling integer exponents. See "Optimization" below. */ + niparm = I_NPOLY + (2 + 2*M)*nVar; + + /* Add extra memory for temporaries. */ + lendp = ndparm + K; + + /* Allocate memory for the indexes and parameter array. */ + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + if ((dis->dparm[j] = calloc(lendp, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* These help a bit to stop the code from turning into hieroglyphics. */ + iparm = dis->iparm[j]; + dparm = dis->dparm[j]; + + + /* Record the indexing parameters. The first four are more widely used. */ + iparm[I_DTYPE] = DIS_POLYNOMIAL; + iparm[I_NIPARM] = niparm; + iparm[I_NDPARM] = ndparm; + iparm[I_DOCORR] = 0; + + iparm[I_NIDX] = I_NPOLY; + iparm[I_LENDP] = lendp; + iparm[I_K] = K; + iparm[I_M] = M; + iparm[I_NKPARM] = nKparm; + iparm[I_NTPARM] = nTparm; + iparm[I_NVAR] = nVar; + iparm[I_MNVAR] = M*nVar; + iparm[I_DPOLY] = K*nKparm; + iparm[I_DAUX] = ndparm; + iparm[I_DVPOW] = ndparm + K; + iparm[I_MAXPOW] = iparm[I_NIDX]; + iparm[I_DPOFF] = iparm[I_MAXPOW] + nVar; + iparm[I_FLAGS] = iparm[I_DPOFF] + nVar; + iparm[I_IPOW] = iparm[I_FLAGS] + M*nVar; + + /* Set default values of POWER for the auxiliary variables. */ + dptr = dparm + (1 + Nhat); + for (k = 0; k < K; k++) { + for (jhat = 0; jhat <= Nhat; jhat++) { + dptr[jhat] = 1.0; + } + dptr += nKparm; + } + + /* Set default values of COEFF for the independent variables. */ + dptr = dparm + iparm[I_DPOLY]; + for (m = 0; m < M; m++) { + *dptr = 1.0; + dptr += nTparm; + } + + /* Extract parameter values from DPja or DQia. */ + k = m = 0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + /* N.B. keyp->j is 1-relative, but j is 0-relative. */ + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "DOCORR:", 7) == 0) { + fp += 7; + sscanf(fp, "%d", &k); + if (k) iparm[I_DOCORR] = 1; + + } else if (strncmp(fp, "AUX.", 4) == 0) { + /* N.B. k here is 1-relative. */ + fp += 4; + sscanf(fp, "%d", &k); + if (k < 1 || K < k) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Bad auxiliary variable (%d) for %s: %s", k, id, keyp->field); + } + + if ((fp = strchr(fp, '.')) == 0x0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid field name for %s: %s", id, keyp->field); + } + fp++; + + if (strncmp(fp, "COEFF.", 6) == 0) { + offset = 0; + + } else if (strncmp(fp, "POWER.", 6) == 0) { + offset = 1 + Nhat; + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + + fp += 6; + sscanf(fp, "%d", &jhat); + if (jhat < 0 || naxis < jhat) { + /* N.B. jhat == 0 is ok. */ + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid axis number (%d) for %s: %s", jhat, id, keyp->field); + } + + i = (k-1)*nKparm + offset + jhat; + dparm[i] = dpkeyd(keyp); + + } else if (strncmp(fp, "TERM.", 5) == 0) { + /* N.B. m here is 1-relative. */ + fp += 5; + sscanf(fp, "%d", &m); + if (m < 1 || M < m) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Bad term (%d) for %s: %s", m, id, keyp->field); + } + + if ((fp = strchr(fp, '.')) == 0x0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid field name for %s: %s", id, keyp->field); + } + fp++; + + if (strcmp(fp, "COEFF") == 0) { + i = iparm[I_DPOLY] + (m-1)*nTparm; + dparm[i] = dpkeyd(keyp); + + } else if (strncmp(fp, "VAR.", 4) == 0) { + /* N.B. jhat here is 1-relative. */ + fp += 4; + sscanf(fp, "%d", &jhat); + if (jhat < 1 || naxis < jhat) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid axis number (%d) for %s: %s", jhat, id, keyp->field); + } + + i = iparm[I_DPOLY] + (m-1)*nTparm + 1 + (jhat-1); + power = dpkeyd(keyp); + dparm[i] = power; + + } else if (strncmp(fp, "AUX.", 4) == 0) { + /* N.B. k here is 1-relative. */ + fp += 4; + sscanf(fp, "%d", &k); + if (k < 1 || K < k) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Bad auxiliary variable (%d) for %s: %s", k, id, keyp->field); + } + + i = iparm[I_DPOLY] + (m-1)*nTparm + 1 + Nhat + (k-1); + power = dpkeyd(keyp); + dparm[i] = power; + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6) && + strcmp(fp, "NAUX") && + strcmp(fp, "NTERMS")) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + + /* Optimization: when the power is integral, it is faster to multiply */ + /* ------------ repeatedly than call pow(). iparm[] is constructed as */ + /* follows: */ + /* I_NPOLY indexing parameters, as above, */ + /* nVar elements record the largest integral power for each variable, */ + /* nVar elements record offsets into dparm for each variable, */ + /* M*nVar flags to signal whether the power is integral, */ + /* M*nVar integral powers. */ + for (ivar = 0; ivar < nVar; ivar++) { + /* Want at least the first degree power for all variables. */ + i = iparm[I_MAXPOW] + ivar; + iparm[i] = 1; + } + + for (ivar = 0; ivar < nVar; ivar++) { + for (m = 0; m < M; m++) { + i = iparm[I_DPOLY] + m*nTparm + 1 + ivar; + power = dparm[i]; + + /* Is it integral? (Positive, negative, or zero.) */ + ipow = (int)power; + if (power == (double)ipow) { + /* Signal that the power is integral. */ + i = iparm[I_FLAGS] + m*nVar + ivar; + if (ipow == 0) { + iparm[i] = 3; + } else { + iparm[i] = 1; + } + + /* The integral power itself. */ + i = iparm[I_IPOW] + m*nVar + ivar; + iparm[i] = ipow; + } + + /* Record the largest integral power for each variable. */ + i = iparm[I_MAXPOW] + ivar; + if (iparm[i] < abs(ipow)) { + iparm[i] = abs(ipow); + } + } + } + + /* How many of all powers of each variable will there be? */ + npow = 0; + for (ivar = 0; ivar < nVar; ivar++) { + /* Offset into dparm. */ + i = iparm[I_DPOFF] + ivar; + iparm[i] = lendp + npow; + + i = iparm[I_MAXPOW] + ivar; + npow += iparm[i]; + } + + /* Expand dparm to store the extra powers. */ + if (npow) { + lendp += npow; + iparm[I_LENDP] = lendp; + if ((dis->dparm[j] = realloc(dparm, lendp*sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + } + + /* No specialist de-distortions. */ + dis->disp2x[j] = dispoly; + dis->disx2p[j] = 0x0; + + /* Translate Polynomial to TPD if possible, it's much faster. */ + /* However don't do it if the name was given as "Polynomial*". */ + if (strcmp(dis->dtype[j], "Polynomial") == 0) { + pol2tpd(j, dis); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpdset(int j, struct disprm *dis) + +{ + static const char *function = "tpdset"; + + char *fp, id[32]; + int doaux, docorr, doradial, idis, idp, k, m, ncoeff[2], ndparm, niparm; + struct dpkey *keyp; + struct wcserr **err; + int (*(distpd[2]))(DISP2X_ARGS); + + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + sprintf(id, "TPD on axis %d", j+1); + + + /* TPD distortion. */ + if (dis->Nhat[j] < 1 || 2 < dis->Nhat[j]) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Axis map for %s must contain 1 or 2 entries, not %d", id, + dis->Nhat[j]); + } + + /* Find the number of parameters. */ + ncoeff[0] = 0; + ncoeff[1] = 0; + doaux = 0; + doradial = 0; + docorr = 0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "TPD.", 4) == 0) { + fp += 4; + if (strncmp(fp, "FWD.", 4) == 0) { + idis = 0; + + } else if (strncmp(fp, "REV.", 4) == 0) { + /* TPD may provide a polynomial approximation for the inverse. */ + idis = 1; + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + + sscanf(fp+4, "%d", &k); + if (0 <= k && k <= 59) { + if (ncoeff[idis] < k+1) ncoeff[idis] = k+1; + + /* Any radial terms? */ + if (k == 3 || k == 11 || k == 23 || k == 39 || k == 59) { + doradial = 1; + } + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid parameter number (%d) for %s: %s", k, id, keyp->field); + } + + } else if (strncmp(fp, "AUX.", 4) == 0) { + /* Flag usage of auxiliary variables. */ + doaux = 1; + + } else if (strncmp(fp, "DOCORR:", 7) == 0) { + fp += 7; + sscanf(fp, "%d", &k); + if (k) docorr = 1; + + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6)) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + distpd[0] = 0x0; + distpd[1] = 0x0; + for (idis = 0; idis < 2; idis++) { + if (ncoeff[idis] <= 4) { + if (idis) { + /* No inverse polynomial. */ + break; + } + + /* First degree. */ + ncoeff[idis] = 4; + distpd[idis] = tpd1; + } else if (ncoeff[idis] <= 7) { + /* Second degree. */ + ncoeff[idis] = 7; + distpd[idis] = tpd2; + } else if (ncoeff[idis] <= 12) { + /* Third degree. */ + ncoeff[idis] = 12; + distpd[idis] = tpd3; + } else if (ncoeff[idis] <= 17) { + /* Fourth degree. */ + ncoeff[idis] = 17; + distpd[idis] = tpd4; + } else if (ncoeff[idis] <= 24) { + /* Fifth degree. */ + ncoeff[idis] = 24; + distpd[idis] = tpd5; + } else if (ncoeff[idis] <= 31) { + /* Sixth degree. */ + ncoeff[idis] = 31; + distpd[idis] = tpd6; + } else if (ncoeff[idis] <= 40) { + /* Seventh degree. */ + ncoeff[idis] = 40; + distpd[idis] = tpd7; + } else if (ncoeff[idis] <= 49) { + /* Eighth degree. */ + ncoeff[idis] = 49; + distpd[idis] = tpd8; + } else if (ncoeff[idis] <= 60) { + /* Ninth degree. */ + ncoeff[idis] = 60; + distpd[idis] = tpd9; + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid number of parameters (%d) for %s", ncoeff[idis], id); + } + } + + /* disx2p() only uses the inverse TPD, if present, to provide a better */ + /* zeroth approximation. */ + dis->disp2x[j] = distpd[0]; + dis->disx2p[j] = distpd[1]; + + +/* These iparm indices are specific to TPD. */ +#define I_TPDNCO 4 /* No. of TPD coefficients, forward... */ +#define I_TPDINV 5 /* ...and inverse. */ +#define I_TPDAUX 6 /* True if auxiliary variables are used. */ +#define I_TPDRAD 7 /* True if the radial variable is used. */ +#define I_NTPD 8 + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + ndparm = (doaux?6:0) + ncoeff[0] + ncoeff[1]; + + /* The first four are more widely used. */ + dis->iparm[j][I_DTYPE] = DIS_TPD; + dis->iparm[j][I_NIPARM] = niparm; + dis->iparm[j][I_NDPARM] = ndparm; + dis->iparm[j][I_DOCORR] = docorr; + + /* Number of TPD coefficients. */ + dis->iparm[j][I_TPDNCO] = ncoeff[0]; + dis->iparm[j][I_TPDINV] = ncoeff[1]; + + /* Flag for presence of auxiliary variables. */ + dis->iparm[j][I_TPDAUX] = doaux; + + /* Flag for presence of radial terms. */ + dis->iparm[j][I_TPDRAD] = doradial; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((dis->dparm[j] = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* Set default auxiliary coefficients. */ + if (doaux) { + dis->dparm[j][1] = 1.0; + dis->dparm[j][5] = 1.0; + } + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "AUX.", 4) == 0) { + /* Auxiliary variables. */ + fp += 4; + sscanf(fp, "%d", &k); + if (k < 1 || 2 < k) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Bad auxiliary variable (%d) for %s: %s", k, id, keyp->field); + } + + if ((fp = strchr(fp, '.')) == 0x0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid field name for %s: %s", id, keyp->field); + } + fp++; + + if (strncmp(fp, "COEFF.", 6) != 0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + + fp += 6; + sscanf(fp, "%d", &m); + if (m < 0 || 2 < m) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid coefficient number (%d) for %s: %s", m, id, keyp->field); + } + + idis = 3*(k-1) + m; + dis->dparm[j][idis] = dpkeyd(keyp); + + } else if (strncmp(fp, "TPD.", 4) == 0) { + fp += 4; + idis = (doaux?6:0); + if (strncmp(fp, "REV.", 4) == 0) { + idis += ncoeff[0]; + } + + sscanf(fp+4, "%d", &k); + dis->dparm[j][idis+k] = dpkeyd(keyp); + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int pol2tpd(int j, struct disprm *dis) + +{ + static const char *function = "pol2tpd"; + + static const int map[][10] = {{ 0, 2, 6, 10, 16, 22, 30, 38, 48, 58}, + { 1, 5, 9, 15, 21, 29, 37, 47, 57, -1}, + { 4, 8, 14, 20, 28, 36, 46, 56, -1, -1}, + { 7, 13, 19, 27, 35, 45, 55, -1, -1, -1}, + {12, 18, 26, 34, 44, 54, -1, -1, -1, -1}, + {17, 25, 33, 43, 53, -1, -1, -1, -1, -1}, + {24, 32, 42, 52, -1, -1, -1, -1, -1, -1}, + {31, 41, 51, -1, -1, -1, -1, -1, -1, -1}, + {40, 50, -1, -1, -1, -1, -1, -1, -1, -1}, + {49, -1, -1, -1, -1, -1, -1, -1, -1, -1}}; + + int deg, degree, *iflgp, *iparm, *ipowp, jhat, K, m, n, ndparm, Nhat, + niparm, p[2], *tpd_iparm; + double *dparm, *dpolp, *tpd_dparm; + struct wcserr **err; + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + iparm = dis->iparm[j]; + dparm = dis->dparm[j]; + + + /* Check the number of independent variables, no more than two. */ + Nhat = dis->Nhat[j]; + if (2 < Nhat) return -1; + + /* Check auxiliaries: only one is allowed... */ + K = iparm[I_K]; + if (1 < K) return -1; + if (K) { + /* ...and it must be radial. */ + if (dparm[0] != 0.0) return -1; + if (dparm[1] != 1.0) return -1; + if (dparm[2] != 1.0) return -1; + if (dparm[3] != 0.5) return -1; + if (dparm[4] != 2.0) return -1; + if (dparm[5] != 2.0) return -1; + } + + /* Check powers... */ + iflgp = iparm + iparm[I_FLAGS]; + ipowp = iparm + iparm[I_IPOW]; + degree = 0; + for (m = 0; m < iparm[I_M]; m++) { + deg = 0; + for (jhat = 0; jhat < Nhat; jhat++) { + /* ...they must be positive integral. */ + if (*iflgp == 0) return -1; + if (*ipowp < 0) return -1; + deg += *ipowp; + iflgp++; + ipowp++; + } + + /* The polynomial degree can't be greater than 9. */ + if (9 < deg) return -1; + + if (K) { + /* Likewise for the radial variable. */ + if (*iflgp == 0) return -1; + if (*ipowp) { + if (*ipowp < 0) return -1; + if (9 < *ipowp) return -1; + + /* Can't mix the radial and other terms. */ + if (deg) return -1; + + /* Can't have even powers of the radial variable. */ + deg = *ipowp; + if (!(deg%2)) return -1; + } + iflgp++; + ipowp++; + } + + if (degree < deg) degree = deg; + } + + + /* OK, it ticks all the boxes. Now translate it. */ + ndparm = 0; + if (degree == 1) { + ndparm = 4; + dis->disp2x[j] = tpd1; + } else if (degree == 2) { + ndparm = 7; + dis->disp2x[j] = tpd2; + } else if (degree == 3) { + ndparm = 12; + dis->disp2x[j] = tpd3; + } else if (degree == 4) { + ndparm = 17; + dis->disp2x[j] = tpd4; + } else if (degree == 5) { + ndparm = 24; + dis->disp2x[j] = tpd5; + } else if (degree == 6) { + ndparm = 31; + dis->disp2x[j] = tpd6; + } else if (degree == 7) { + ndparm = 40; + dis->disp2x[j] = tpd7; + } else if (degree == 8) { + ndparm = 49; + dis->disp2x[j] = tpd8; + } else if (degree == 9) { + ndparm = 60; + dis->disp2x[j] = tpd9; + } + + /* No specialist de-distortions. */ + dis->disx2p[j] = 0x0; + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((tpd_iparm = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* The first four are more widely used. */ + tpd_iparm[I_DTYPE] = DIS_TPD; + tpd_iparm[I_NIPARM] = niparm; + tpd_iparm[I_NDPARM] = ndparm; + tpd_iparm[I_DOCORR] = iparm[I_DOCORR]; + + /* Number of TPD coefficients. */ + tpd_iparm[I_TPDNCO] = ndparm; + tpd_iparm[I_TPDINV] = 0; + + /* No auxiliary variables yet. */ + tpd_iparm[I_TPDAUX] = 0; + + /* Flag for presence of radial terms. */ + tpd_iparm[I_TPDRAD] = K; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((tpd_dparm = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + ipowp = iparm + iparm[I_IPOW]; + dpolp = dparm + iparm[I_DPOLY]; + for (m = 0; m < iparm[I_M]; m++) { + if (K && ipowp[Nhat]) { + /* The radial variable. */ + switch (ipowp[Nhat]) { + case 1: + tpd_dparm[3] = *dpolp; + break; + case 3: + tpd_dparm[11] = *dpolp; + break; + case 5: + tpd_dparm[23] = *dpolp; + break; + case 7: + tpd_dparm[39] = *dpolp; + break; + case 9: + tpd_dparm[59] = *dpolp; + break; + } + + } else { + /* The independent variables. */ + p[0] = p[1] = 0; + for (jhat = 0; jhat < Nhat; jhat++) { + p[jhat] = ipowp[jhat]; + } + + n = map[p[0]][p[1]]; + tpd_dparm[n] = *dpolp; + } + + + ipowp += iparm[I_NVAR]; + dpolp += iparm[I_NVAR] + 1; + } + + + /* Switch from Polynomial to TPD. */ + free(iparm); + free(dparm); + dis->iparm[j] = tpd_iparm; + dis->dparm[j] = tpd_dparm; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpvset(int j, struct disprm *dis) + +{ + static const char *function = "tpvset"; + + char *fp, id[32]; + int doradial, idp, k, ndparm, niparm; + struct dpkey *keyp; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + /* TPV "projection". */ + sprintf(id, "TPV on axis %d", j+1); + + + if (dis->Nhat[j] != 2) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Axis map for %s must contain 2 entries, not %d", id, dis->Nhat[j]); + } + + /* Find the number of parameters. */ + ndparm = 0; + doradial = 0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "TPV.", 4) == 0) { + sscanf(fp+4, "%d", &k); + if (0 <= k && k <= 39) { + if (ndparm < k+1) ndparm = k+1; + + /* Any radial terms? */ + if (k == 3 || k == 11 || k == 23 || k == 39 || k == 59) { + doradial = 1; + } + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid parameter number (%d) for %s: %s", k, id, keyp->field); + } + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6)) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + /* TPD is going to do the dirty work. */ + if (ndparm <= 4) { + /* First degree. */ + ndparm = 4; + dis->disp2x[j] = tpd1; + } else if (ndparm <= 7) { + /* Second degree. */ + ndparm = 7; + dis->disp2x[j] = tpd2; + } else if (ndparm <= 12) { + /* Third degree. */ + ndparm = 12; + dis->disp2x[j] = tpd3; + } else if (ndparm <= 17) { + /* Fourth degree. */ + ndparm = 17; + dis->disp2x[j] = tpd4; + } else if (ndparm <= 24) { + /* Fifth degree. */ + ndparm = 24; + dis->disp2x[j] = tpd5; + } else if (ndparm <= 31) { + /* Sixth degree. */ + ndparm = 31; + dis->disp2x[j] = tpd6; + } else if (ndparm <= 40) { + /* Seventh degree. */ + ndparm = 40; + dis->disp2x[j] = tpd7; + } else { + /* Could go to ninth degree, but that wouldn't be legit. */ + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid number of parameters (%d) for %s", ndparm, id); + } + + /* No specialist de-distortions. */ + dis->disx2p[j] = 0x0; + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* The first four are more widely used. */ + dis->iparm[j][I_DTYPE] = DIS_TPD; + dis->iparm[j][I_NIPARM] = niparm; + dis->iparm[j][I_NDPARM] = ndparm; + dis->iparm[j][I_DOCORR] = 0; + + /* Number of TPD coefficients. */ + dis->iparm[j][I_TPDNCO] = ndparm; + dis->iparm[j][I_TPDINV] = 0; + + /* TPV never needs auxiliary variables. */ + dis->iparm[j][I_TPDAUX] = 0; + + /* Flag for presence of radial terms. */ + dis->iparm[j][I_TPDRAD] = doradial; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((dis->dparm[j] = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + /* One-to-one correspondence between TPV and TPD coefficients. */ + if (strncmp(fp, "TPV.", 4) == 0) { + sscanf(fp+4, "%d", &k); + dis->dparm[j][k] = dpkeyd(keyp); + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int sipset(int j, struct disprm *dis) + +{ + static const char *function = "sipset"; + + static const int map[][10] = {{ 0, 2, 6, 10, 16, 22, 30, 38, 48, 58}, + { 1, 5, 9, 15, 21, 29, 37, 47, 57, -1}, + { 4, 8, 14, 20, 28, 36, 46, 56, -1, -1}, + { 7, 13, 19, 27, 35, 45, 55, -1, -1, -1}, + {12, 18, 26, 34, 44, 54, -1, -1, -1, -1}, + {17, 25, 33, 43, 53, -1, -1, -1, -1, -1}, + {24, 32, 42, 52, -1, -1, -1, -1, -1, -1}, + {31, 41, 51, -1, -1, -1, -1, -1, -1, -1}, + {40, 50, -1, -1, -1, -1, -1, -1, -1, -1}, + {49, -1, -1, -1, -1, -1, -1, -1, -1, -1}}; + + char *fp, id[32]; + int deg, degree[2], idis, idp, jhat, naxis, ncoeff[2], ndparm, niparm, + p, q; + struct dpkey *keyp; + struct wcserr **err; + int (*(distpd[2]))(DISP2X_ARGS); + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + /* Simple Imaging Polynomial. */ + sprintf(id, "SIP on axis %d", j+1); + + + if (dis->Nhat[j] != 2) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Axis map for %s must contain 2 entries, not %d", id, dis->Nhat[j]); + } + + /* Find the polynomial degree, at least 1 for the forward function. */ + degree[0] = 1; + degree[1] = -1; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "SIP.", 4) == 0) { + fp += 4; + if (strncmp(fp, "FWD.", 4) == 0) { + idis = 0; + + } else if (strncmp(fp, "REV.", 4) == 0) { + /* SIP uses a polynomial approximation for the inverse. */ + idis = 1; + + } else { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + + fp += 4; + sscanf(fp, "%d_%d", &p, &q); + deg = p + q; + if (p < 0 || 9 < p || q < 0 || 9 < q || 9 < deg) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid powers (%d, %d) for %s: %s", p, q, id, keyp->field); + } + + if (degree[idis] < deg) degree[idis] = deg; + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6)) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + if (degree[1] == 0 ) degree[1] = 1; + + /* TPD is going to do the dirty work. */ + distpd[0] = 0x0; + distpd[1] = 0x0; + for (idis = 0; idis < 2; idis++) { + ncoeff[idis] = 0; + if (degree[idis] == 1) { + ncoeff[idis] = 4; + distpd[idis] = tpd1; + } else if (degree[idis] == 2) { + ncoeff[idis] = 7; + distpd[idis] = tpd2; + } else if (degree[idis] == 3) { + ncoeff[idis] = 12; + distpd[idis] = tpd3; + } else if (degree[idis] == 4) { + ncoeff[idis] = 17; + distpd[idis] = tpd4; + } else if (degree[idis] == 5) { + ncoeff[idis] = 24; + distpd[idis] = tpd5; + } else if (degree[idis] == 6) { + ncoeff[idis] = 31; + distpd[idis] = tpd6; + } else if (degree[idis] == 7) { + ncoeff[idis] = 40; + distpd[idis] = tpd7; + } else if (degree[idis] == 8) { + ncoeff[idis] = 49; + distpd[idis] = tpd8; + } else if (degree[idis] == 9) { + ncoeff[idis] = 60; + distpd[idis] = tpd9; + } + } + + /* SIP uses a polynomial approximation to the inverse. It's not very */ + /* accurate but may provide disx2p() with a better zeroth approximation. */ + dis->disp2x[j] = distpd[0]; + dis->disx2p[j] = distpd[1]; + + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + ndparm = ncoeff[0] + ncoeff[1]; + + /* The first four are more widely used. */ + dis->iparm[j][I_DTYPE] = DIS_TPD; + dis->iparm[j][I_NIPARM] = niparm; + dis->iparm[j][I_NDPARM] = ndparm; + dis->iparm[j][I_DOCORR] = 0; + + /* Number of TPD coefficients. */ + dis->iparm[j][I_TPDNCO] = ncoeff[0]; + dis->iparm[j][I_TPDINV] = ncoeff[1]; + + /* SIP never needs auxiliary variables. */ + dis->iparm[j][I_TPDAUX] = 0; + + /* SIP never needs the radial terms. */ + dis->iparm[j][I_TPDRAD] = 0; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((dis->dparm[j] = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "SIP.", 4) == 0) { + fp += 4; + if (strncmp(fp, "FWD.", 4) == 0) { + idis = 0; + } else { + idis = ncoeff[0]; + } + + sscanf(fp+4, "%d_%d", &p, &q); + + /* Map to TPD coefficient number. */ + idis += map[p][q]; + + dis->dparm[j][idis] = dpkeyd(keyp); + } + } + + /* Account for the fact that the SIP distortion provides an additive */ + /* correction to the offset of the pixel coordinate from CRPIX, whereas */ + /* we expect the distortion function to provide the actual value of the */ + /* distorted pixel coordinate. */ + naxis = dis->naxis; + jhat = dis->axmap[j][naxis+j]; + idis = jhat + 1; + dis->dparm[j][0] = dis->offset[j][jhat]; + dis->dparm[j][idis] += 1.0; + if (degree[1] > 0) { + dis->dparm[j][ncoeff[0]] = dis->offset[j][jhat]; + dis->dparm[j][ncoeff[0]+idis] += 1.0; + } + + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int dssset(int j, struct disprm *dis) + +{ + static const char *function = "dssset"; + + char *fp, id[32]; + int degree, idp, m, ncoeff, ndparm, niparm; + double A1, A2, A3, B1, B2, B3, coeff, *dparm, S, X0, Y0; + struct dpkey *keyp; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + /* Digitized Sky Survey. */ + sprintf(id, "DSS on axis %d", j+1); + + + if (dis->Nhat[j] != 2) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Axis map for %s must contain 2 entries, not %d", id, dis->Nhat[j]); + } + + /* Safe to assume the polynomial degree is 5 (or less). */ + ncoeff = 24; + dis->disp2x[j] = tpd5; + + /* No specialist de-distortions. */ + dis->disx2p[j] = 0x0; + + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + ndparm = 6 + ncoeff; + + /* The first four are more widely used. */ + dis->iparm[j][I_DTYPE] = DIS_TPD; + dis->iparm[j][I_NIPARM] = niparm; + dis->iparm[j][I_NDPARM] = ndparm; + dis->iparm[j][I_DOCORR] = 0; + + /* Number of TPD coefficients. */ + dis->iparm[j][I_TPDNCO] = ncoeff; + dis->iparm[j][I_TPDINV] = 0; + + /* DSS always needs auxiliary variables. */ + dis->iparm[j][I_TPDAUX] = 1; + + /* DSS never needs the radial terms. */ + dis->iparm[j][I_TPDRAD] = 0; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((dis->dparm[j] = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + /* This translation follows WCS Paper IV, Sect. 5.2 using the same */ + /* variable names. Find A1, A2, A3, B1, B2, and B3. */ + A1 = A2 = A3 = 0.0; + B1 = B2 = B3 = 0.0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + fp = strchr(keyp->field, '.') + 1; + if (strncmp(fp, "DSS.AMD.", 8) == 0) { + fp += 8; + sscanf(fp, "%d", &m); + + if (m == 1) { + if (keyp->j == 1) { + A1 = dpkeyd(keyp); + } else { + B1 = dpkeyd(keyp); + } + } else if (m == 2) { + if (keyp->j == 1) { + A2 = dpkeyd(keyp); + } else { + B2 = dpkeyd(keyp); + } + } else if (m == 3) { + if (keyp->j == 1) { + A3 = dpkeyd(keyp); + } else { + B3 = dpkeyd(keyp); + } + } + } + } + + X0 = (A2*B3 - A3*B1) / (A1*B1 - A2*B2); + Y0 = (A3*B2 - A1*B3) / (A1*B1 - A2*B2); + + S = sqrt(fabs(A1*B1 - A2*B2)); + if (S == 0.0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Coefficient scale for %s is zero.", id); + } + + /* Coefficients for the auxiliary variables. */ + dparm = dis->dparm[j]; + if (j == 0) { + dparm[0] = X0; + dparm[1] = -B1/S; + dparm[2] = -A2/S; + dparm[3] = Y0; + dparm[4] = B2/S; + dparm[5] = A1/S; + + /* Change the sign of S for scaling the A coefficients. */ + S *= -1.0; + + } else { + dparm[0] = Y0; + dparm[1] = B2/S; + dparm[2] = A1/S; + dparm[3] = X0; + dparm[4] = -B1/S; + dparm[5] = -A2/S; + } + + /* Translate DSS coefficients to TPD. */ + dparm += 6; + degree = 3; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "DSS.AMD.", 8) == 0) { + /* Skip zero coefficients. */ + if ((coeff = dpkeyd(keyp)) == 0.0) continue; + + fp += 8; + sscanf(fp, "%d", &m); + + /* Apply the coefficient scale factor. */ + coeff /= S; + + if (m == 1) { + dparm[1] = coeff; + } else if (m == 2) { + dparm[2] = coeff; + } else if (m == 3) { + dparm[0] = coeff; + } else if (m == 4) { + dparm[4] += coeff; + } else if (m == 5) { + dparm[5] = coeff; + } else if (m == 6) { + dparm[6] += coeff; + } else if (m == 7) { + dparm[4] += coeff; + dparm[6] += coeff; + } else if (m == 8) { + dparm[7] += coeff; + } else if (m == 9) { + dparm[8] = coeff; + } else if (m == 10) { + dparm[9] += coeff; + } else if (m == 11) { + dparm[10] = coeff; + } else if (m == 12) { + dparm[7] += coeff; + dparm[9] += coeff; + } else if (m == 13) { + dparm[17] = coeff; + dparm[19] = coeff * 2.0; + dparm[21] = coeff; + degree = 5; + } else if (coeff != 0.0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid parameter for %s: %s", m, id, keyp->field); + } + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6)) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + /* The DSS polynomial doesn't have 4th degree terms, and the 5th degree + coefficient is often zero. */ + if (degree == 3) { + dis->iparm[j][I_TPDNCO] = 12; + dis->disp2x[j] = tpd3; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +#define CHEBYSHEV 1 +#define LEGENDRE 2 +#define MONOMIAL 3 + +int watset(int j, struct disprm *dis) + +{ + static const char *function = "watset"; + + static const int map[][10] = {{ 0, 2, 6, 10, 16, 22, 30, 38, 48, 58}, + { 1, 5, 9, 15, 21, 29, 37, 47, 57, -1}, + { 4, 8, 14, 20, 28, 36, 46, 56, -1, -1}, + { 7, 13, 19, 27, 35, 45, 55, -1, -1, -1}, + {12, 18, 26, 34, 44, 54, -1, -1, -1, -1}, + {17, 25, 33, 43, 53, -1, -1, -1, -1, -1}, + {24, 32, 42, 52, -1, -1, -1, -1, -1, -1}, + {31, 41, 51, -1, -1, -1, -1, -1, -1, -1}, + {40, 50, -1, -1, -1, -1, -1, -1, -1, -1}, + {49, -1, -1, -1, -1, -1, -1, -1, -1, -1}}; + + char *fp, id[32]; + int deg, degree, doaux, idis, idp, im, in, *iparm, kind, m, n, ncoeff, + ndparm, niparm; + double coeff, coeffm[10], coeffn[10], *dparm, dx, dy, x0, xmax, xmin, + y0, ymax, ymin; + struct dpkey *keyp; + struct wcserr **err; + + + /* Initialize. */ + if (dis == 0x0) return DISERR_NULL_POINTER; + err = &(dis->err); + + /* WAT (TNX or ZPX) Polynomial. */ + sprintf(id, "WAT (%s) on axis %d", dis->dtype[0]+4, j+1); + + if (dis->Nhat[j] != 2) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Axis map for %s must contain 2 entries, not %d", id, dis->Nhat[j]); + } + + /* Find the polynomial degree (at least 1), kind, and domain. */ + degree = 1; + kind = 0; + xmin = xmax = 0.0; + ymin = ymax = 0.0; + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if (strncmp(fp, "WAT.", 4) == 0) { + fp += 4; + if (strncmp(fp, "CHBY.", 5) == 0 || + strncmp(fp, "LEGR.", 5) == 0 || + strncmp(fp, "MONO.", 5) == 0) { + + fp += 5; + sscanf(fp, "%d_%d", &m, &n); + deg = m + n; + if (m < 0 || 9 < m || n < 0 || 9 < n || 9 < deg) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Invalid powers (%d, %d) for %s: %s", m, n, id, keyp->field); + } + + if (degree < deg) degree = deg; + + } else if (strcmp(fp, "POLY") == 0) { + kind = dpkeyi(keyp); + + } else if (strcmp(fp, "XMIN") == 0) { + xmin = dpkeyd(keyp); + + } else if (strcmp(fp, "XMAX") == 0) { + xmax = dpkeyd(keyp); + + } else if (strcmp(fp, "YMIN") == 0) { + ymin = dpkeyd(keyp); + + } else if (strcmp(fp, "YMAX") == 0) { + ymax = dpkeyd(keyp); + } + + } else if (strcmp(fp, "NAXES") && + strncmp(fp, "AXIS.", 5) && + strncmp(fp, "OFFSET.", 7) && + strncmp(fp, "SCALE.", 6)) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Unrecognized field name for %s: %s", id, keyp->field); + } + } + + doaux = (kind == 1 || kind == 2); + + /* TPD is going to do the dirty work. */ + ncoeff = 0; + if (degree == 1) { + /* First degree. */ + ncoeff = 4; + dis->disp2x[j] = tpd1; + } else if (degree == 2) { + /* Second degree. */ + ncoeff = 7; + dis->disp2x[j] = tpd2; + } else if (degree == 3) { + /* Third degree. */ + ncoeff = 12; + dis->disp2x[j] = tpd3; + } else if (degree == 4) { + /* Fourth degree. */ + ncoeff = 17; + dis->disp2x[j] = tpd4; + } else if (degree == 5) { + /* Fifth degree. */ + ncoeff = 24; + dis->disp2x[j] = tpd5; + } else if (degree == 6) { + /* Sixth degree. */ + ncoeff = 31; + dis->disp2x[j] = tpd6; + } else if (degree == 7) { + /* Seventh degree. */ + ncoeff = 40; + dis->disp2x[j] = tpd7; + } else if (degree == 8) { + /* Eighth degree. */ + ncoeff = 49; + dis->disp2x[j] = tpd8; + } else if (degree == 9) { + /* Ninth degree. */ + ncoeff = 60; + dis->disp2x[j] = tpd9; + } + + /* No specialist de-distortions. */ + dis->disx2p[j] = 0x0; + + + /* Record indexing parameters. */ + niparm = I_NTPD; + if ((dis->iparm[j] = calloc(niparm, sizeof(int))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + iparm = dis->iparm[j]; + + ndparm = 6 + ncoeff; + + /* The first four are more widely used. */ + iparm[I_DTYPE] = DIS_TPD; + iparm[I_NIPARM] = niparm; + iparm[I_NDPARM] = ndparm; + iparm[I_DOCORR] = 1; + + /* Number of TPD coefficients. */ + iparm[I_TPDNCO] = ncoeff; + iparm[I_TPDINV] = 0; + + /* The Chebyshev and Legendre polynomials use auxiliary variables. */ + iparm[I_TPDAUX] = doaux; + + /* WAT never needs the radial terms. */ + iparm[I_TPDRAD] = 0; + + + /* Allocate memory for the polynomial coefficients and fill it. */ + if ((dis->dparm[j] = calloc(ndparm, sizeof(double))) == 0x0) { + return wcserr_set(DIS_ERRMSG(DISERR_MEMORY)); + } + + dparm = dis->dparm[j]; + + + /* Coefficients for the auxiliary variables. */ + if (doaux) { + x0 = (xmax + xmin)/2.0; + dx = (xmax - xmin)/2.0; + if (dx == 0.0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "X-span for %s is zero", id); + } + + dparm[0] = -x0/dx; + dparm[1] = 1.0/dx; + dparm[2] = 0.0; + + y0 = (ymax + ymin)/2.0; + dy = (ymax - ymin)/2.0; + if (dy == 0.0) { + return wcserr_set(WCSERR_SET(DISERR_BAD_PARAM), + "Y-span for %s is zero", id); + } + + dparm[3] = -y0/dy; + dparm[4] = 0.0; + dparm[5] = 1.0/dy; + + dparm += 6; + } + + + /* Unpack the polynomial coefficients. */ + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j-1 != j) continue; + + fp = strchr(keyp->field, '.') + 1; + + if ((kind == CHEBYSHEV && strncmp(fp, "WAT.CHBY.", 9) == 0) || + (kind == LEGENDRE && strncmp(fp, "WAT.LEGR.", 9) == 0) || + (kind == MONOMIAL && strncmp(fp, "WAT.MONO.", 9) == 0)) { + fp += 9; + + sscanf(fp, "%d_%d", &m, &n); + + if (kind == MONOMIAL) { + /* Monomial coefficient, maps simply to TPD coefficient number. */ + idis = map[m][n]; + dparm[idis] = dpkeyd(keyp); + + } else { + /* Coefficient of the product of two Chebyshev or two Legendre */ + /* polynomials. Find the corresponding monomial coefficients. */ + coeff = dpkeyd(keyp); + + cheleg(kind, m, n, coeffm, coeffn); + for (im = 0; im <= m; im++) { + if (coeffm[im] == 0.0) continue; + + for (in = 0; in <= n; in++) { + if (coeffn[in] == 0.0) continue; + + idis = map[im][in]; + dparm[idis] += coeff*coeffm[im]*coeffn[in]; + } + } + } + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ +/* Compute the coefficients of Chebyshev or Legendre polynomials of degree */ +/* m and n. */ + +int cheleg(int kind, int m, int n, double coeffm[], double coeffn[]) + +{ + int j, j0, j1, j2, k, N; + double *coeff[3], d; + + N = (m > n) ? m : n; + + /* Allocate work arrays. */ + coeff[0] = calloc(3*(N+1), sizeof(double)); + coeff[1] = coeff[0] + (N+1); + coeff[2] = coeff[1] + (N+1); + + for (j = 0; j <= N; j++) { + j0 = j%3; + + if (j == 0) { + coeff[0][0] = 1.0; + + } else if (j == 1) { + coeff[1][1] = 1.0; + + } else { + /* Cyclic buffer indices. */ + j1 = (j-1)%3; + j2 = (j-2)%3; + + memset(coeff[j0], 0, (N+1)*sizeof(double)); + + d = (double)j; + for (k = 0; k < N; k++) { + if (kind == CHEBYSHEV) { + coeff[j0][k+1] = 2.0 * coeff[j1][k]; + coeff[j0][k] -= coeff[j2][k]; + } else if (kind == LEGENDRE) { + coeff[j0][k+1] = ((2.0*d - 1.0) * coeff[j1][k]) / d; + coeff[j0][k] -= ((d - 1.0) * coeff[j2][k]) / d; + } + } + } + + if (j == m) memcpy(coeffm, coeff[j0], (m+1)*sizeof(double)); + if (j == n) memcpy(coeffn, coeff[j0], (n+1)*sizeof(double)); + } + + free(coeff[0]); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int dispoly( + int dummy, + const int iparm[], + const double dparm[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + const int *iflgp, *imaxp, *imaxpow, *ipowp; + int ip, ivar, jhat, k, m; + const double *cptr, *dpolp, *pptr; + double *aux, auxp0, *dvarpow, *dpowp, term, var; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + /* Check for zeroes. */ + for (jhat = 0; jhat < Nhat; jhat++) { + if (rawcrd[jhat] == 0.0) { + *discrd = 0.0; + return 0; + } + } + + /* Working memory for auxiliaries &c. was allocated at the end of p[]. */ + aux = (double *)(dparm + iparm[I_DAUX]); + + /* Compute the auxiliary variables. */ + for (k = 0; k < iparm[I_K]; k++) { + cptr = dparm + k*iparm[I_NKPARM]; + pptr = cptr + (1+Nhat); + + aux[k] = *(cptr++); + auxp0 = *(pptr++); + + for (jhat = 0; jhat < Nhat; jhat++) { + aux[k] += *(cptr++)*pow(rawcrd[jhat], *(pptr++)); + } + + aux[k] = pow(aux[k], auxp0); + + /* Check for zeroes. */ + if (aux[k] == 0.0) { + *discrd = 0.0; + return 0; + } + } + + + /* Compute all required integral powers of the variables. */ + imaxpow = iparm + iparm[I_MAXPOW]; + dvarpow = (double *)(dparm + iparm[I_DVPOW]); + + imaxp = imaxpow; + dpowp = dvarpow; + for (jhat = 0; jhat < Nhat; jhat++, imaxp++) { + var = 1.0; + for (ip = 0; ip < *imaxp; ip++, dpowp++) { + var *= rawcrd[jhat]; + *dpowp = var; + } + } + + for (k = 0; k < iparm[I_K]; k++, imaxp++) { + var = 1.0; + for (ip = 0; ip < *imaxp; ip++, dpowp++) { + var *= aux[k]; + *dpowp = var; + } + } + + /* Loop for each term of the polynomial. */ + *discrd = 0.0; + iflgp = iparm + iparm[I_FLAGS]; + ipowp = iparm + iparm[I_IPOW]; + dpolp = dparm + iparm[I_DPOLY]; + for (m = 0; m < iparm[I_M]; m++) { + term = *(dpolp++); + + /* Loop over all variables. */ + imaxp = imaxpow; + dpowp = dvarpow - 1; + for (ivar = 0; ivar < iparm[I_NVAR]; ivar++) { + if (*iflgp & 2) { + /* Nothing (zero power). */ + + } else if (*iflgp) { + /* Integral power. */ + if (*ipowp < 0) { + /* Negative. */ + term /= dpowp[*ipowp]; + } else { + /* Positive. */ + term *= dpowp[*ipowp]; + } + + } else { + /* Fractional power. */ + term *= pow(dpowp[0], *dpolp); + } + + iflgp++; + ipowp++; + dpolp++; + + dpowp += *imaxp; + imaxp++; + } + + *discrd += term; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd1( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 4 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* First degree. */ + *discrd = p[0] + u*p[1]; + + if (Nhat == 1) return 0; + + *discrd += v*p[2]; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*p[3]; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd2( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 7 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Second degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4])); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6])) + + u*(p[5])*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*p[3]; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd3( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 12 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Third degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7]))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10]))) + + u*(p[5] + v*(p[9]) + + u*(p[8]))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11])); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd4( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 17 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Fourth degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12])))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16])))) + + u*(p[5] + v*(p[9] + v*(p[15])) + + u*(p[8] + v*(p[14]) + + u*(p[13])))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11])); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd5( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 24 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Fifth degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12] + u*(p[17]))))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16] + v*(p[22]))))) + + u*(p[5] + v*(p[9] + v*(p[15] + v*(p[21]))) + + u*(p[8] + v*(p[14] + v*(p[20])) + + u*(p[13] + v*(p[19]) + + u*(p[18]))))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11] + s*(p[23]))); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd6( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 31 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Sixth degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12] + u*(p[17] + u*(p[24])))))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16] + v*(p[22] + v*(p[30])))))) + + u*(p[5] + v*(p[9] + v*(p[15] + v*(p[21] + v*(p[29])))) + + u*(p[8] + v*(p[14] + v*(p[20] + v*(p[28]))) + + u*(p[13] + v*(p[19] + v*(p[27])) + + u*(p[18] + v*(p[26]) + + u*(p[25])))))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11] + s*(p[23]))); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd7( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 40 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Seventh degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12] + u*(p[17] + u*(p[24] + u*(p[31]))))))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16] + v*(p[22] + v*(p[30] + v*(p[38]))))))) + + u*(p[5] + v*(p[9] + v*(p[15] + v*(p[21] + v*(p[29] + v*(p[37]))))) + + u*(p[8] + v*(p[14] + v*(p[20] + v*(p[28] + v*(p[36])))) + + u*(p[13] + v*(p[19] + v*(p[27] + v*(p[35]))) + + u*(p[18] + v*(p[26] + v*(p[34])) + + u*(p[25] + v*(p[33]) + + u*(p[32]))))))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11] + s*(p[23] + s*(p[39])))); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd8( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 49 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Eighth degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12] + u*(p[17] + u*(p[24] + u*(p[31] + u*(p[40])))))))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16] + v*(p[22] + v*(p[30] + v*(p[38] + v*(p[48])))))))) + + u*(p[5] + v*(p[9] + v*(p[15] + v*(p[21] + v*(p[29] + v*(p[37] + v*(p[47])))))) + + u*(p[8] + v*(p[14] + v*(p[20] + v*(p[28] + v*(p[36] + v*(p[46]))))) + + u*(p[13] + v*(p[19] + v*(p[27] + v*(p[35] + v*(p[45])))) + + u*(p[18] + v*(p[26] + v*(p[34] + v*(p[44]))) + + u*(p[25] + v*(p[33] + v*(p[43])) + + u*(p[32] + v*(p[42]) + + u*(p[41])))))))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11] + s*(p[23] + s*(p[39])))); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tpd9( + int inverse, + const int i[], + const double p[], + int Nhat, + const double rawcrd[], + double *discrd) + +{ + double r, s, u, v; + + if (i[I_TPDNCO+inverse] != 60 || 2 < Nhat) { + return 1; + } + + u = rawcrd[0]; + v = rawcrd[1]; + + /* Auxiliary variables? */ + if (i[I_TPDAUX]) { + r = p[0] + p[1]*u + p[2]*v; + v = p[3] + p[4]*u + p[5]*v; + u = r; + p += 6; + } + + if (inverse) p += i[I_TPDNCO]; + + /* Ninth degree. */ + *discrd = p[0] + u*(p[1] + u*(p[4] + u*(p[7] + u*(p[12] + u*(p[17] + u*(p[24] + u*(p[31] + u*(p[40] + u*(p[49]))))))))); + + if (Nhat == 1) return 0; + + *discrd += + v*(p[2] + v*(p[6] + v*(p[10] + v*(p[16] + v*(p[22] + v*(p[30] + v*(p[38] + v*(p[48] + v*(p[58]))))))))) + + u*(p[5] + v*(p[9] + v*(p[15] + v*(p[21] + v*(p[29] + v*(p[37] + v*(p[47] + v*(p[57]))))))) + + u*(p[8] + v*(p[14] + v*(p[20] + v*(p[28] + v*(p[36] + v*(p[46] + v*(p[56])))))) + + u*(p[13] + v*(p[19] + v*(p[27] + v*(p[35] + v*(p[45] + v*(p[55]))))) + + u*(p[18] + v*(p[26] + v*(p[34] + v*(p[44] + v*(p[54])))) + + u*(p[25] + v*(p[33] + v*(p[43] + v*(p[53]))) + + u*(p[32] + v*(p[42] + v*(p[52])) + + u*(p[41] + v*(p[51]) + + u*(p[50]))))))))*v; + + /* Radial terms? */ + if (i[I_TPDRAD]) { + s = u*u + v*v; + r = sqrt(s); + + *discrd += r*(p[3] + s*(p[11] + s*(p[23] + s*(p[39] + s*(p[59]))))); + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/dis.h b/testbed/astropy__astropy/cextern/wcslib/C/dis.h new file mode 100644 index 0000000000000000000000000000000000000000..74e96f4e32b44c3c5b7efe90e0c2ae2a53e30f3c --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/dis.h @@ -0,0 +1,1084 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: dis.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the dis routines +* --------------------------- +* Routines in this suite implement extensions to the FITS World Coordinate +* System (WCS) standard proposed by +* += "Representations of distortions in FITS world coordinate systems", += Calabretta, M.R. et al. (WCS Paper IV, draft dated 2004/04/22), += available from http://www.atnf.csiro.au/people/Mark.Calabretta +* +* In brief, a distortion function may occupy one of two positions in the WCS +* algorithm chain. Prior distortions precede the linear transformation +* matrix, whether it be PCi_ja or CDi_ja, and sequent distortions follow it. +* WCS Paper IV defines FITS keywords used to specify parameters for predefined +* distortion functions. The following are used for prior distortions: +* += CPDISja ...(string-valued, identifies the distortion function) += DPja ...(record-valued, parameters) += CPERRja ...(floating-valued, maximum value) +* +* Their counterparts for sequent distortions are CQDISia, DQia, and CQERRia. +* An additional floating-valued keyword, DVERRa, records the maximum value of +* the combined distortions. +* +* DPja and DQia are "record-valued". Syntactically, the keyvalues are +* standard FITS strings, but they are to be interpreted in a special way. +* The general form is +* += DPja = ': ' +* +* where the field-specifier consists of a sequence of fields separated by +* periods, and the ': ' between the field-specifier and the floating-point +* value is part of the record syntax. For example: +* += DP1 = 'AXIS.1: 1' +* +* Certain field-specifiers are defined for all distortion functions, while +* others are defined only for particular distortions. Refer to WCS Paper IV +* for further details. wcspih() parses all distortion keywords and loads them +* into a disprm struct for analysis by disset() which knows (or possibly does +* not know) how to interpret them. Of the Paper IV distortion functions, only +* the general Polynomial distortion is currently implemented here. +* +* TPV - the TPV "projection": +* --------------------------- +* The distortion function component of the TPV celestial "projection" is also +* supported. The TPV projection, originally proposed in a draft of WCS Paper +* II, consists of a TAN projection with sequent polynomial distortion, the +* coefficients of which are encoded in PVi_ma keyrecords. Full details may be +* found at the registry of FITS conventions: +* += http://fits.gsfc.nasa.gov/registry/tpvwcs/tpv.html +* +* Internally, wcsset() changes TPV to a TAN projection, translates the PVi_ma +* keywords to DQia and loads them into a disprm struct. These DQia keyrecords +* have the form +* += DQia = 'TPV.m: ' +* +* where i, a, m, and the value for each DQia match each PVi_ma. Consequently, +* WCSLIB would handle a FITS header containing these keywords, along with +* CQDISia = 'TPV' and the required DQia.NAXES and DQia.AXIS.ihat keywords. +* +* SIP - Simple Imaging Polynomial: +* -------------------------------- +* These routines also support the Simple Imaging Polynomial (SIP), whose +* design was influenced by early drafts of WCS Paper IV. It is described in +* detail in +* += http://fits.gsfc.nasa.gov/registry/sip.html +* +* SIP, which is defined only as a prior distortion for 2-D celestial images, +* has the interesting feature that it records an approximation to the inverse +* polynomial distortion function. This is used by disx2p() to provide an +* initial estimate for its more precise iterative inversion. The +* special-purpose keywords used by SIP are parsed and translated by wcspih() +* as follows: +* += A_p_q = -> DP1 = 'SIP.FWD.p_q: ' += AP_p_q = -> DP1 = 'SIP.REV.p_q: ' += B_p_q = -> DP2 = 'SIP.FWD.p_q: ' += BP_p_q = -> DP2 = 'SIP.REV.p_q: ' += A_DMAX = -> DPERR1 = += B_DMAX = -> DPERR2 = +* +* SIP's A_ORDER and B_ORDER keywords are not used. WCSLIB would recognise a +* FITS header containing the above keywords, along with CPDISja = 'SIP' and +* the required DPja.NAXES keywords. +* +* DSS - Digitized Sky Survey: +* --------------------------- +* The Digitized Sky Survey resulted from the production of the Guide Star +* Catalogue for the Hubble Space Telescope. Plate solutions based on a +* polynomial distortion function were encoded in FITS using non-standard +* keywords. Sect. 5.2 of WCS Paper IV describes how DSS coordinates may be +* translated to a sequent Polynomial distortion using two auxiliary variables. +* That translation is based on optimising the non-distortion component of the +* plate solution. +* +* Following Paper IV, wcspih() translates the non-distortion component of DSS +* coordinates to standard WCS keywords (CRPIXja, PCi_ja, CRVALia, etc), and +* fills a wcsprm struct with their values. It encodes the DSS polynomial +* coefficients as +* += AMDXm = -> DQ1 = 'AMD.m: ' += AMDYm = -> DQ2 = 'AMD.m: ' +* +* WCSLIB would recognise a FITS header containing the above keywords, along +* with CQDISia = 'DSS' and the required DQia.NAXES keywords. +* +* WAT - the TNX and ZPX "projections": +* ------------------------------------ +* The TNX and ZPX "projections" add a polynomial distortion function to the +* standard TAN and ZPN projections respectively. Unusually, the polynomial +* may be expressed as the sum of Chebyshev or Legendre polynomials, or as a +* simple sum of monomials, as described in +* += http://fits.gsfc.nasa.gov/registry/tnx/tnx-doc.html += http://fits.gsfc.nasa.gov/registry/zpxwcs/zpx.html +* +* The polynomial coefficients are encoded in special-purpose WATi_n keywords +* as a set of continued strings, thus providing the name for this distortion +* type. WATi_n are parsed and translated by wcspih() into the following set: +* += DQi = 'WAT.POLY: ' += DQi = 'WAT.XMIN: ' += DQi = 'WAT.XMAX: ' += DQi = 'WAT.YMIN: ' += DQi = 'WAT.YMAX: ' += DQi = 'WAT.CHBY.m_n: ' or += DQi = 'WAT.LEGR.m_n: ' or += DQi = 'WAT.MONO.m_n: ' +* +* along with CQDISia = 'WAT' and the required DPja.NAXES keywords. For ZPX, +* the ZPN projection parameters are also encoded in WATi_n, and wcspih() +* translates these to standard PVi_ma. +* +* TPD - Template Polynomial Distortion: +* ------------------------------------- +* The "Template Polynomial Distortion" (TPD) is a superset of the TPV, SIP, +* DSS, and WAT (TNX & ZPX) polynomial distortions that also supports 1-D usage +* and inversions. Like TPV, SIP, and DSS, the form of the polynomial is fixed +* (the "template") and only the coefficients for the required terms are set +* non-zero. TPD generalizes TPV in going to 9th degree, SIP by accomodating +* TPV's linear and radial terms, and DSS in both respects. While in theory +* the degree of the WAT polynomial distortion in unconstrained, in practice it +* is limited to values that can be handled by TPD. +* +* Within WCSLIB, TPV, SIP, DSS, and WAT are all implemented as special cases +* of TPD. Indeed, TPD was developed precisely for that purpose. WAT +* distortions expressed as the sum of Chebyshev or Legendre polynomials are +* expanded for TPD as a simple sum of monomials. Moreover, the general +* Polynomial distortion is translated and implemented internally as TPD +* whenever possible. +* +* However, WCSLIB also recognizes 'TPD' as a distortion function in its own +* right (i.e. a recognized value of CPDISja or CQDISia), for use as both prior +* and sequent distortions. Its DPja and DQia keyrecords have the form +* += DPja = 'TPD.FWD.m: ' += DPja = 'TPD.REV.m: ' +* +* for the forward and reverse distortion functions. Moreover, like the +* general Polynomial distortion, TPD supports auxiliary variables, though only +* as a linear transformation of pixel coordinates (p1,p2): +* += x = a0 + a1*p1 + a2*p2 += y = b0 + b1*p1 + b2*p2 +* +* where the coefficients of the auxiliary variables (x,y) are recorded as +* += DPja = 'AUX.1.COEFF.0: a0' ...default 0.0 += DPja = 'AUX.1.COEFF.1: a1' ...default 1.0 += DPja = 'AUX.1.COEFF.2: a2' ...default 0.0 += DPja = 'AUX.2.COEFF.0: b0' ...default 0.0 += DPja = 'AUX.2.COEFF.1: b1' ...default 0.0 += DPja = 'AUX.2.COEFF.2: b2' ...default 1.0 +* +* Though nowhere near as powerful, in typical applications TPD is considerably +* faster than the general Polynomial distortion. As TPD has a finite and not +* too large number of possible terms (60), the coefficients for each can be +* stored (by disset()) in a fixed location in the disprm::dparm[] array. A +* large part of the speedup then arises from evaluating the polynomial using +* Horner's scheme. +* +* Separate implementations for polynomials of each degree, and conditionals +* for 1-D polynomials and 2-D polynomials with and without the radial +* variable, ensure that unused terms mostly do not impose a significant +* computational overhead. +* +* The TPD terms are as follows +* += 0: 1 4: xx 12: xxxx 24: xxxxxx 40: xxxxxxxx += 5: xy 13: xxxy 25: xxxxxy 41: xxxxxxxy += 1: x 6: yy 14: xxyy 26: xxxxyy 42: xxxxxxyy += 2: y 15: xyyy 27: xxxyyy 43: xxxxxyyy += 3: r 7: xxx 16: yyyy 28: xxyyyy 44: xxxxyyyy += 8: xxy 29: xyyyyy 45: xxxyyyyy += 9: xyy 17: xxxxx 30: yyyyyy 46: xxyyyyyy += 10: yyy 18: xxxxy 47: xyyyyyyy += 11: rrr 19: xxxyy 31: xxxxxxx 48: yyyyyyyy += 20: xxyyy 32: xxxxxxy += 21: xyyyy 33: xxxxxyy 49: xxxxxxxxx += 22: yyyyy 34: xxxxyyy 50: xxxxxxxxy += 23: rrrrr 35: xxxyyyy 51: xxxxxxxyy += 36: xxyyyyy 52: xxxxxxyyy += 37: xyyyyyy 53: xxxxxyyyy += 38: yyyyyyy 54: xxxxyyyyy += 39: rrrrrrr 55: xxxyyyyyy += 56: xxyyyyyyy += 57: xyyyyyyyy += 58: yyyyyyyyy += 59: rrrrrrrrr +* +* where r = sqrt(xx + yy). Note that even powers of r are excluded since they +* can be accomodated by powers of (xx + yy). +* +* TPV uses all terms up to 39. The m in its PVi_ma keywords translates +* directly to the TPD coefficient number. +* +* SIP uses all terms except for 0, 3, 11, 23, 39, and 59, with terms 1 and 2 +* only used for the inverse. Its A_p_q, etc. keywords must be translated +* using a map. +* +* DSS uses terms 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 17, 19, and 21. The presence +* of a non-zero constant term arises through the use of auxiliary variables +* with origin offset from the reference point of the TAN projection. However, +* in the translation given by WCS Paper IV, the distortion polynomial is zero, +* or very close to zero, at the reference pixel itself. The mapping between +* DSS's AMDXm (or AMDYm) keyvalues and TPD coefficients, while still simple, +* is not quite as straightforward as for TPV and SIP. +* +* WAT uses all but the radial terms: 3, 11, 23, 39, and 59. While the mapping +* between WAT's monomial coefficients and TPD is fairly simple, for its +* expression in terms of a sum of Chebyshev or Legendre polynomials it is much +* less so. +* +* Summary of the dis routines +* --------------------------- +* These routines apply the distortion functions defined by the extension to +* the FITS WCS standard proposed in Paper IV. They are based on the disprm +* struct which contains all information needed for the computations. The +* struct contains some members that must be set by the user, and others that +* are maintained by these routines, somewhat like a C++ class but with no +* encapsulation. +* +* dpfill(), dpkeyi(), and dpkeyd() are provided to manage the dpkey struct. +* +* disndp(), disini(), disinit(), discpy(), and disfree() are provided to +* manage the disprm struct, and another, disprt(), prints its contents. +* +* disperr() prints the error message(s) (if any) stored in a disprm struct. +* +* wcshdo() normally writes SIP and TPV headers in their native form if at all +* possible. However, dishdo() may be used to set a flag that tells it to +* write the header in the form of the TPD translation used internally. +* +* A setup routine, disset(), computes intermediate values in the disprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by disset(), though disset() need not be called +* explicitly - refer to the explanation of disprm::flag. +* +* disp2x() and disx2p() implement the WCS distortion functions, disp2x() using +* separate functions, such as dispoly() and tpd7(), to do the computation. +* +* An auxiliary routine, diswarp(), computes various measures of the distortion +* over a specified range of coordinates. +* +* PLEASE NOTE: Distortions are not yet handled by wcsbth(), or wcscompare(). +* +* +* disndp() - Memory allocation for DPja and DQia +* ---------------------------------------------- +* disndp() sets or gets the value of NDPMAX (default 256). This global +* variable controls the maximum number of dpkey structs, for holding DPja or +* DQia keyvalues, that disini() should allocate space for. It is also used by +* disinit() as the default value of ndpmax. +* +* PLEASE NOTE: This function is not thread-safe. +* +* Given: +* n int Value of NDPMAX; ignored if < 0. Use a value less +* than zero to get the current value. +* +* Function return value: +* int Current value of NDPMAX. +* +* +* dpfill() - Fill the contents of a dpkey struct +* ---------------------------------------------- +* dpfill() is a utility routine to aid in filling the contents of the dpkey +* struct. No checks are done on the validity of the inputs. +* +* WCS Paper IV specifies the syntax of a record-valued keyword as +* += keyword = ': ' +* +* However, some DPja and DQia record values, such as those of DPja.NAXES and +* DPja.AXIS.j, are intrinsically integer-valued. While FITS header parsers +* are not expected to know in advance which of DPja and DQia are integral and +* which are floating point, if the record's value parses as an integer (i.e. +* without decimal point or exponent), then preferably enter it into the dpkey +* struct as an integer. Either way, it doesn't matter as disset() accepts +* either data type for all record values. +* +* Given and returned: +* dp struct dpkey* +* Store for DPja and DQia keyvalues. +* +* Given: +* keyword const char * +* field const char * +* These arguments are concatenated with an intervening +* "." to construct the full record field name, i.e. +* including the keyword name, DPja or DQia (but +* excluding the colon delimiter which is NOT part of the +* name). Either may be given as a NULL pointer. Set +* both NULL to omit setting this component of the +* struct. +* +* j int Axis number (1-relative), i.e. the j in DPja or +* i in DQia. Can be given as 0, in which case the axis +* number will be obtained from the keyword component of +* the field name which must either have been given or +* preset. +* +* If j is non-zero, and keyword was given, then the +* value of j will be used to fill in the axis number. +* +* type int Data type of the record's value +* 0: Integer, +* 1: Floating point. +* +* i int For type == 0, the integer value of the record. +* +* f double For type == 1, the floating point value of the record. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* +* dpkeyi() - Get the data value in a dpkey struct as int +* ------------------------------------------------------ +* dpkeyi() returns the data value in a dpkey struct as an integer value. +* +* Given and returned: +* dp const struct dpkey * +* Parsed contents of a DPja or DQia keyrecord. +* +* Function return value: +* int The record's value as int. +* +* +* dpkeyd() - Get the data value in a dpkey struct as double +* --------------------------------------------------------- +* dpkeyd() returns the data value in a dpkey struct as a floating point +* value. +* +* Given and returned: +* dp const struct dpkey * +* Parsed contents of a DPja or DQia keyrecord. +* +* Function return value: +* double The record's value as double. +* +* +* disini() - Default constructor for the disprm struct +* ---------------------------------------------------- +* disini() is a thin wrapper on disinit(). It invokes it with ndpmax set +* to -1 which causes it to use the value of the global variable NDPMAX. It +* is thereby potentially thread-unsafe if NDPMAX is altered dynamically via +* disndp(). Use disinit() for a thread-safe alternative in this case. +* +* +* disinit() - Default constructor for the disprm struct +* ---------------------------------------------------- +* disinit() allocates memory for arrays in a disprm struct and sets all +* members of the struct to default values. +* +* PLEASE NOTE: every disprm struct must be initialized by disinit(), possibly +* repeatedly. On the first invokation, and only the first invokation, +* disprm::flag must be set to -1 to initialize memory management, regardless +* of whether disinit() will actually be used to allocate memory. +* +* Given: +* alloc int If true, allocate memory unconditionally for arrays in +* the disprm struct. +* +* If false, it is assumed that pointers to these arrays +* have been set by the user except if they are null +* pointers in which case memory will be allocated for +* them regardless. (In other words, setting alloc true +* saves having to initalize these pointers to zero.) +* +* naxis int The number of world coordinate axes, used to determine +* array sizes. +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. Note that, in order +* to initialize memory management disprm::flag must be +* set to -1 when dis is initialized for the first time +* (memory leaks may result if it had already been +* initialized). +* +* Given: +* ndpmax int The number of DPja or DQia keywords to allocate space +* for. If set to -1, the value of the global variable +* NDPMAX will be used. This is potentially +* thread-unsafe if disndp() is being used dynamically to +* alter its value. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* disprm::err if enabled, see wcserr_enable(). +* +* +* discpy() - Copy routine for the disprm struct +* --------------------------------------------- +* discpy() does a deep copy of one disprm struct to another, using disinit() +* to allocate memory unconditionally for its arrays if required. Only the +* "information to be provided" part of the struct is copied; a call to +* disset() is required to initialize the remainder. +* +* Given: +* alloc int If true, allocate memory unconditionally for arrays in +* the destination. Otherwise, it is assumed that +* pointers to these arrays have been set by the user +* except if they are null pointers in which case memory +* will be allocated for them regardless. +* +* dissrc const struct disprm* +* Struct to copy from. +* +* Given and returned: +* disdst struct disprm* +* Struct to copy to. disprm::flag should be set to -1 +* if disdst was not previously initialized (memory leaks +* may result if it was previously initialized). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* disprm::err if enabled, see wcserr_enable(). +* +* +* disfree() - Destructor for the disprm struct +* -------------------------------------------- +* disfree() frees memory allocated for the disprm arrays by disinit(). +* disinit() keeps a record of the memory it allocates and disfree() will only +* attempt to free this. +* +* PLEASE NOTE: disfree() must not be invoked on a disprm struct that was not +* initialized by disinit(). +* +* Given: +* dis struct disprm* +* Distortion function parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* +* +* disprt() - Print routine for the disprm struct +* ---------------------------------------------- +* disprt() prints the contents of a disprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* dis const struct disprm* +* Distortion function parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* +* +* disperr() - Print error messages from a disprm struct +* ----------------------------------------------------- +* disperr() prints the error message(s) (if any) stored in a disprm struct. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* dis const struct disprm* +* Distortion function parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* +* +* dishdo() - write FITS headers using TPD +* --------------------------------------- +* dishdo() sets a flag that tells wcshdo() to write FITS headers in the form +* of the TPD translation used internally. Normally SIP and TPV would be +* written in their native form if at all possible. +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 3: No TPD translation. +* +* +* disset() - Setup routine for the disprm struct +* ---------------------------------------------- +* disset(), sets up the disprm struct according to information supplied within +* it - refer to the explanation of disprm::flag. +* +* Note that this routine need not be called directly; it will be invoked by +* disp2x() and disx2p() if the disprm::flag is anything other than a +* predefined magic value. +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid parameter. +* +* For returns > 1, a detailed error message is set in +* disprm::err if enabled, see wcserr_enable(). +* +* +* disp2x() - Apply distortion function +* ------------------------------------ +* disp2x() applies the distortion functions. By definition, the distortion +* is in the pixel-to-world direction. +* +* Depending on the point in the algorithm chain at which it is invoked, +* disp2x() may transform pixel coordinates to corrected pixel coordinates, or +* intermediate pixel coordinates to corrected intermediate pixel coordinates, +* or image coordinates to corrected image coordinates. +* +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. +* +* Given: +* rawcrd const double[naxis] +* Array of coordinates. +* +* Returned: +* discrd double[naxis] +* Array of coordinates to which the distortion functions +* have been applied. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid parameter. +* 4: Distort error. +* +* For returns > 1, a detailed error message is set in +* disprm::err if enabled, see wcserr_enable(). +* +* +* disx2p() - Apply de-distortion function +* --------------------------------------- +* disx2p() applies the inverse of the distortion functions. By definition, +* the de-distortion is in the world-to-pixel direction. +* +* Depending on the point in the algorithm chain at which it is invoked, +* disx2p() may transform corrected pixel coordinates to pixel coordinates, or +* corrected intermediate pixel coordinates to intermediate pixel coordinates, +* or corrected image coordinates to image coordinates. +* +* disx2p() iteratively solves for the inverse using disp2x(). It assumes +* that the distortion is small and the functions are well-behaved, being +* continuous and with continuous derivatives. Also that, to first order +* in the neighbourhood of the solution, discrd[j] ~= a + b*rawcrd[j], i.e. +* independent of rawcrd[i], where i != j. This is effectively equivalent to +* assuming that the distortion functions are separable to first order. +* Furthermore, a is assumed to be small, and b close to unity. +* +* If disprm::disx2p() is defined, then disx2p() uses it to provide an initial +* estimate for its more precise iterative inversion. +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. +* +* Given: +* discrd const double[naxis] +* Array of coordinates. +* +* Returned: +* rawcrd double[naxis] +* Array of coordinates to which the inverse distortion +* functions have been applied. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid parameter. +* 5: De-distort error. +* +* For returns > 1, a detailed error message is set in +* disprm::err if enabled, see wcserr_enable(). +* +* +* diswarp() - Compute measures of distortion +* ------------------------------------------ +* diswarp() computes various measures of the distortion over a specified range +* of coordinates. +* +* For prior distortions, the measures may be interpreted simply as an offset +* in pixel coordinates. For sequent distortions, the interpretation depends +* on the nature of the linear transformation matrix (PCi_ja or CDi_ja). If +* the latter introduces a scaling, then the measures will also be scaled. +* Note also that the image domain, which is rectangular in pixel coordinates, +* may be rotated, skewed, and/or stretched in intermediate pixel coordinates, +* and in general cannot be defined using pixblc[] and pixtrc[]. +* +* PLEASE NOTE: the measures of total distortion may be essentially meaningless +* if there are multiple sequent distortions with different scaling. +* +* See also linwarp(). +* +* Given and returned: +* dis struct disprm* +* Distortion function parameters. +* +* Given: +* pixblc const double[naxis] +* Start of the range of pixel coordinates (for prior +* distortions), or intermediate pixel coordinates (for +* sequent distortions). May be specified as a NULL +* pointer which is interpreted as (1,1,...). +* +* pixtrc const double[naxis] +* End of the range of pixel coordinates (prior) or +* intermediate pixel coordinates (sequent). +* +* pixsamp const double[naxis] +* If positive or zero, the increment on the particular +* axis, starting at pixblc[]. Zero is interpreted as a +* unit increment. pixsamp may also be specified as a +* NULL pointer which is interpreted as all zeroes, i.e. +* unit increments on all axes. +* +* If negative, the grid size on the particular axis (the +* absolute value being rounded to the nearest integer). +* For example, if pixsamp is (-128.0,-128.0,...) then +* each axis will be sampled at 128 points between +* pixblc[] and pixtrc[] inclusive. Use caution when +* using this option on non-square images. +* +* Returned: +* nsamp int* The number of pixel coordinates sampled. +* +* Can be specified as a NULL pointer if not required. +* +* maxdis double[naxis] +* For each individual distortion function, the +* maximum absolute value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* maxtot double* For the combination of all distortion functions, the +* maximum absolute value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* avgdis double[naxis] +* For each individual distortion function, the +* mean value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* avgtot double* For the combination of all distortion functions, the +* mean value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* rmsdis double[naxis] +* For each individual distortion function, the +* root mean square deviation of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* rmstot double* For the combination of all distortion functions, the +* root mean square deviation of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null disprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid parameter. +* 4: Distort error. +* +* +* disprm struct - Distortion parameters +* ------------------------------------- +* The disprm struct contains all of the information required to apply a set of +* distortion functions. It consists of certain members that must be set by +* the user ("given") and others that are set by the WCSLIB routines +* ("returned"). While the addresses of the arrays themselves may be set by +* disinit() if it (optionally) allocates memory, their contents must be set by +* the user. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following members of the disprm struct are set or modified: +* +* - disprm::naxis, +* - disprm::dtype, +* - disprm::ndp, +* - disprm::dp. +* +* This signals the initialization routine, disset(), to recompute the +* returned members of the disprm struct. disset() will reset flag to +* indicate that this has been done. +* +* PLEASE NOTE: flag must be set to -1 when disinit() is called for the +* first time for a particular disprm struct in order to initialize memory +* management. It must ONLY be used on the first initialization otherwise +* memory leaks may result. +* +* int naxis +* (Given or returned) Number of pixel and world coordinate elements. +* +* If disinit() is used to initialize the disprm struct (as would normally +* be the case) then it will set naxis from the value passed to it as a +* function argument. The user should not subsequently modify it. +* +* char (*dtype)[72] +* (Given) Pointer to the first element of an array of char[72] containing +* the name of the distortion function for each axis. +* +* int ndp +* (Given) The number of entries in the disprm::dp[] array. +* +* int ndpmax +* (Given) The length of the disprm::dp[] array. +* +* ndpmax will be set by disinit() if it allocates memory for disprm::dp[], +* otherwise it must be set by the user. See also disndp(). +* +* struct dpkey dp +* (Given) Address of the first element of an array of length ndpmax of +* dpkey structs. +* +* As a FITS header parser encounters each DPja or DQia keyword it should +* load it into a dpkey struct in the array and increment ndp. However, +* note that a single disprm struct must hold only DPja or DQia keyvalues, +* not both. disset() interprets them as required by the particular +* distortion function. +* +* double *maxdis +* (Given) Pointer to the first element of an array of double specifying +* the maximum absolute value of the distortion for each axis computed over +* the whole image. +* +* It is not necessary to reset the disprm struct (via disset()) when +* disprm::maxdis is changed. +* +* double totdis +* (Given) The maximum absolute value of the combination of all distortion +* functions specified as an offset in pixel coordinates computed over the +* whole image. +* +* It is not necessary to reset the disprm struct (via disset()) when +* disprm::totdis is changed. +* +* int **axmap +* (Returned) Pointer to the first element of an array of int* containing +* pointers to the first elements of the axis mapping arrays for each axis. +* +* An axis mapping associates the independent variables of a distortion +* function with the 0-relative image axis number. For example, consider +* an image with a spectrum on the first axis (axis 0), followed by RA +* (axis 1), Dec (axis2), and time (axis 3) axes. For a distortion in +* (RA,Dec) and no distortion on the spectral or time axes, the axis +* mapping arrays, axmap[j][], would be +* += j=0: [-1, -1, -1, -1] ...no distortion on spectral axis, += 1: [ 1, 2, -1, -1] ...RA distortion depends on RA and Dec, += 2: [ 2, 1, -1, -1] ...Dec distortion depends on Dec and RA, += 3: [-1, -1, -1, -1] ...no distortion on time axis, +* +* where -1 indicates that there is no corresponding independent +* variable. +* +* int *Nhat +* (Returned) Pointer to the first element of an array of int* containing +* the number of coordinate axes that form the independent variables of the +* distortion function. +* +* double **offset +* (Returned) Pointer to the first element of an array of double* +* containing an offset used to renormalize the independent variables of +* the distortion function for each axis. +* +* The offsets are subtracted from the independent variables before +* scaling. +* +* double **scale +* (Returned) Pointer to the first element of an array of double* +* containing a scale used to renormalize the independent variables of the +* distortion function for each axis. +* +* The scale is applied to the independent variables after the offsets are +* subtracted. +* +* int **iparm +* (Returned) Pointer to the first element of an array of int* +* containing pointers to the first elements of the arrays of integer +* distortion parameters for each axis. +* +* double **dparm +* (Returned) Pointer to the first element of an array of double* +* containing pointers to the first elements of the arrays of floating +* point distortion parameters for each axis. +* +* int i_naxis +* (Returned) Dimension of the internal arrays (normally equal to naxis). +* +* int ndis +* (Returned) The number of distortion functions. +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* int (**disp2x)(DISP2X_ARGS) +* (For internal use only.) +* int (**disx2p)(DISX2P_ARGS) +* (For internal use only.) +* double *tmpmem +* (For internal use only.) +* int m_flag +* (For internal use only.) +* int m_naxis +* (For internal use only.) +* char (*m_dtype)[72] +* (For internal use only.) +* double **m_dp +* (For internal use only.) +* double *m_maxdis +* (For internal use only.) +* +* +* dpkey struct - Store for DPja and DQia keyvalues +* ------------------------------------------------ +* The dpkey struct is used to pass the parsed contents of DPja or DQia +* keyrecords to disset() via the disprm struct. A disprm struct must hold +* only DPja or DQia keyvalues, not both. +* +* All members of this struct are to be set by the user. +* +* char field[72] +* (Given) The full field name of the record, including the keyword name. +* Note that the colon delimiter separating the field name and the value in +* record-valued keyvalues is not part of the field name. For example, in +* the following: +* += DP3A = 'AXIS.1: 2' +* +* the full record field name is "DP3A.AXIS.1", and the record's value +* is 2. +* +* int j +* (Given) Axis number (1-relative), i.e. the j in DPja or i in DQia. +* +* int type +* (Given) The data type of the record's value +* - 0: Integer (stored as an int), +* - 1: Floating point (stored as a double). +* +* union value +* (Given) A union comprised of +* - dpkey::i, +* - dpkey::f, +* +* the record's value. +* +* +* Global variable: const char *dis_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_DIS +#define WCSLIB_DIS + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *dis_errmsg[]; + +enum dis_errmsg_enum { + DISERR_SUCCESS = 0, /* Success. */ + DISERR_NULL_POINTER = 1, /* Null disprm pointer passed. */ + DISERR_MEMORY = 2, /* Memory allocation failed. */ + DISERR_BAD_PARAM = 3, /* Invalid parameter value. */ + DISERR_DISTORT = 4, /* Distortion error. */ + DISERR_DEDISTORT = 5 /* De-distortion error. */ +}; + +/* For use in declaring distortion function prototypes (= DISX2P_ARGS). */ +#define DISP2X_ARGS int inverse, const int iparm[], const double dparm[], \ +int ncrd, const double rawcrd[], double *discrd + +/* For use in declaring de-distortion function prototypes (= DISP2X_ARGS). */ +#define DISX2P_ARGS int inverse, const int iparm[], const double dparm[], \ +int ncrd, const double discrd[], double *rawcrd + + +/* Struct used for storing DPja and DQia keyvalues. */ +struct dpkey { + char field[72]; /* Full record field name (no colon). */ + int j; /* Axis number, as in DPja (1-relative). */ + int type; /* Data type of value. */ + union { + int i; /* Integer record value. */ + double f; /* Floating point record value. */ + } value; /* Record value. */ +}; + +/* Size of the dpkey struct in int units, used by the Fortran wrappers. */ +#define DPLEN (sizeof(struct dpkey)/sizeof(int)) + + +struct disprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int naxis; /* The number of pixel coordinate elements, */ + /* given by NAXIS. */ + char (*dtype)[72]; /* For each axis, the distortion type. */ + int ndp; /* Number of DPja or DQia keywords, and the */ + int ndpmax; /* number for which space was allocated. */ + struct dpkey *dp; /* DPja or DQia keyvalues (not both). */ + double *maxdis; /* For each axis, the maximum distortion. */ + double totdis; /* The maximum combined distortion. */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + int **axmap; /* For each axis, the axis mapping array. */ + int *Nhat; /* For each axis, the number of coordinate */ + /* axes that form the independent variables */ + /* of the distortion function. */ + double **offset; /* For each axis, renormalization offsets. */ + double **scale; /* For each axis, renormalization scales. */ + int **iparm; /* For each axis, the array of integer */ + /* distortion parameters. */ + double **dparm; /* For each axis, the array of floating */ + /* point distortion parameters. */ + int i_naxis; /* Dimension of the internal arrays. */ + int ndis; /* The number of distortion functions. */ + + /* Error handling, if enabled. */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private - the remainder are for internal use. */ + /*------------------------------------------------------------------------*/ + int (**disp2x)(DISP2X_ARGS); /* For each axis, pointers to the */ + int (**disx2p)(DISX2P_ARGS); /* distortion function and its inverse. */ + + double *tmpmem; + + int m_flag, m_naxis; /* The remainder are for memory management. */ + char (*m_dtype)[72]; + struct dpkey *m_dp; + double *m_maxdis; +}; + +/* Size of the disprm struct in int units, used by the Fortran wrappers. */ +#define DISLEN (sizeof(struct disprm)/sizeof(int)) + + +int disndp(int n); + +int dpfill(struct dpkey *dp, const char *keyword, const char *field, int j, + int type, int i, double f); + +int dpkeyi(const struct dpkey *dp); + +double dpkeyd(const struct dpkey *dp); + +int disini(int alloc, int naxis, struct disprm *dis); + +int disinit(int alloc, int naxis, struct disprm *dis, int ndpmax); + +int discpy(int alloc, const struct disprm *dissrc, struct disprm *disdst); + +int disfree(struct disprm *dis); + +int disprt(const struct disprm *dis); + +int disperr(const struct disprm *dis, const char *prefix); + +int dishdo(struct disprm *dis); + +int disset(struct disprm *dis); + +int disp2x(struct disprm *dis, const double rawcrd[], double discrd[]); + +int disx2p(struct disprm *dis, const double discrd[], double rawcrd[]); + +int diswarp(struct disprm *dis, const double pixblc[], const double pixtrc[], + const double pixsamp[], int *nsamp, + double maxdis[], double *maxtot, + double avgdis[], double *avgtot, + double rmsdis[], double *rmstot); + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_DIS */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.h b/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.h new file mode 100644 index 0000000000000000000000000000000000000000..89efed6119cab63bb8818de953814e9504513510 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.h @@ -0,0 +1,451 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: fitshdr.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the fitshdr routines +* ------------------------------- +* The Flexible Image Transport System (FITS), is a data format widely used in +* astronomy for data interchange and archive. It is described in +* += "Definition of the Flexible Image Transport System (FITS), version 3.0", += Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010, += A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362 +* +* See also http://fits.gsfc.nasa.gov +* +* fitshdr() is a generic FITS header parser provided to handle keyrecords that +* are ignored by the WCS header parsers, wcspih() and wcsbth(). Typically the +* latter may be set to remove WCS keyrecords from a header leaving fitshdr() +* to handle the remainder. +* +* +* fitshdr() - FITS header parser routine +* -------------------------------------- +* fitshdr() parses a character array containing a FITS header, extracting +* all keywords and their values into an array of fitskey structs. +* +* Given: +* header const char [] +* Character array containing the (entire) FITS header, +* for example, as might be obtained conveniently via the +* CFITSIO routine fits_hdr2str(). +* +* Each header "keyrecord" (formerly "card image") +* consists of exactly 80 7-bit ASCII printing characters +* in the range 0x20 to 0x7e (which excludes NUL, BS, +* TAB, LF, FF and CR) especially noting that the +* keyrecords are NOT null-terminated. +* +* nkeyrec int Number of keyrecords in header[]. +* +* nkeyids int Number of entries in keyids[]. +* +* Given and returned: +* keyids struct fitskeyid [] +* While all keywords are extracted from the header, +* keyids[] provides a convienient way of indexing them. +* The fitskeyid struct contains three members; +* fitskeyid::name must be set by the user while +* fitskeyid::count and fitskeyid::idx are returned by +* fitshdr(). All matched keywords will have their +* fitskey::keyno member negated. +* +* Returned: +* nreject int* Number of header keyrecords rejected for syntax +* errors. +* +* keys struct fitskey** +* Pointer to an array of nkeyrec fitskey structs +* containing all keywords and keyvalues extracted from +* the header. +* +* Memory for the array is allocated by fitshdr() and +* this must be freed by the user by invoking free() on +* the array. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null fitskey pointer passed. +* 2: Memory allocation failed. +* 3: Fatal error returned by Flex parser. +* +* Notes: +* 1: Keyword parsing is done in accordance with the syntax defined by +* NOST 100-2.0, noting the following points in particular: +* +* a: Sect. 5.1.2.1 specifies that keywords be left-justified in columns +* 1-8, blank-filled with no embedded spaces, composed only of the +* ASCII characters ABCDEFGHJKLMNOPQRSTUVWXYZ0123456789-_ +* +* fitshdr() accepts any characters in columns 1-8 but flags keywords +* that do not conform to standard syntax. +* +* b: Sect. 5.1.2.2 defines the "value indicator" as the characters "= " +* occurring in columns 9 and 10. If these are absent then the +* keyword has no value and columns 9-80 may contain any ASCII text +* (but see note 2 for CONTINUE keyrecords). This is copied to the +* comment member of the fitskey struct. +* +* c: Sect. 5.1.2.3 states that a keyword may have a null (undefined) +* value if the value/comment field, columns 11-80, consists entirely +* of spaces, possibly followed by a comment. +* +* d: Sect. 5.1.1 states that trailing blanks in a string keyvalue are +* not significant and the parser always removes them. A string +* containing nothing but blanks will be replaced with a single +* blank. +* +* Sect. 5.2.1 also states that a quote character (') in a string +* value is to be represented by two successive quote characters and +* the parser removes the repeated quote. +* +* e: The parser recognizes free-format character (NOST 100-2.0, +* Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values +* (Sect. 5.2.4) for all keywords. +* +* f: Sect. 5.2.3 offers no comment on the size of an integer keyvalue +* except indirectly in limiting it to 70 digits. The parser will +* translate an integer keyvalue to a 32-bit signed integer if it +* lies in the range -2147483648 to +2147483647, otherwise it +* interprets it as a 64-bit signed integer if possible, or else a +* "very long" integer (see fitskey::type). +* +* g: END not followed by 77 blanks is not considered to be a legitimate +* end keyrecord. +* +* 2: The parser supports a generalization of the OGIP Long String Keyvalue +* Convention (v1.0) whereby strings may be continued onto successive +* header keyrecords. A keyrecord contains a segment of a continued +* string if and only if +* +* a: it contains the pseudo-keyword CONTINUE, +* +* b: columns 9 and 10 are both blank, +* +* c: columns 11 to 80 contain what would be considered a valid string +* keyvalue, including optional keycomment, if column 9 had contained +* '=', +* +* d: the previous keyrecord contained either a valid string keyvalue or +* a valid CONTINUE keyrecord. +* +* If any of these conditions is violated, the keyrecord is considered in +* isolation. +* +* Syntax errors in keycomments in a continued string are treated more +* permissively than usual; the '/' delimiter may be omitted provided that +* parsing of the string keyvalue is not compromised. However, the +* FITSHDR_COMMENT status bit will be set for the keyrecord (see +* fitskey::status). +* +* As for normal strings, trailing blanks in a continued string are not +* significant. +* +* In the OGIP convention "the '&' character is used as the last non-blank +* character of the string to indicate that the string is (probably) +* continued on the following keyword". This additional syntax is not +* required by fitshdr(), but if '&' does occur as the last non-blank +* character of a continued string keyvalue then it will be removed, along +* with any trailing blanks. However, blanks that occur before the '&' +* will be preserved. +* +* +* fitskeyid struct - Keyword indexing +* ----------------------------------- +* fitshdr() uses the fitskeyid struct to return indexing information for +* specified keywords. The struct contains three members, the first of which, +* fitskeyid::name, must be set by the user with the remainder returned by +* fitshdr(). +* +* char name[12]: +* (Given) Name of the required keyword. This is to be set by the user; +* the '.' character may be used for wildcarding. Trailing blanks will be +* replaced with nulls. +* +* int count: +* (Returned) The number of matches found for the keyword. +* +* int idx[2]: +* (Returned) Indices into keys[], the array of fitskey structs returned by +* fitshdr(). Note that these are 0-relative array indices, not keyrecord +* numbers. +* +* If the keyword is found in the header the first index will be set to the +* array index of its first occurrence, otherwise it will be set to -1. +* +* If multiples of the keyword are found, the second index will be set to +* the array index of its last occurrence, otherwise it will be set to -1. +* +* +* fitskey struct - Keyword/value information +* ------------------------------------------ +* fitshdr() returns an array of fitskey structs, each of which contains the +* result of parsing one FITS header keyrecord. All members of the fitskey +* struct are returned by fitshdr(), none are given by the user. +* +* int keyno +* (Returned) Keyrecord number (1-relative) in the array passed as input to +* fitshdr(). This will be negated if the keyword matched any specified in +* the keyids[] index. +* +* int keyid +* (Returned) Index into the first entry in keyids[] with which the +* keyrecord matches, else -1. +* +* int status +* (Returned) Status flag bit-vector for the header keyrecord employing the +* following bit masks defined as preprocessor macros: +* +* - FITSHDR_KEYWORD: Illegal keyword syntax. +* - FITSHDR_KEYVALUE: Illegal keyvalue syntax. +* - FITSHDR_COMMENT: Illegal keycomment syntax. +* - FITSHDR_KEYREC: Illegal keyrecord, e.g. an END keyrecord with +* trailing text. +* - FITSHDR_TRAILER: Keyrecord following a valid END keyrecord. +* +* The header keyrecord is syntactically correct if no bits are set. +* +* char keyword[12] +* (Returned) Keyword name, null-filled for keywords of less than eight +* characters (trailing blanks replaced by nulls). +* +* Use +* += sprintf(dst, "%.8s", keyword) +* +* to copy it to a character array with null-termination, or +* += sprintf(dst, "%8.8s", keyword) +* +* to blank-fill to eight characters followed by null-termination. +* +* int type +* (Returned) Keyvalue data type: +* - 0: No keyvalue (both the value and type are undefined). +* - 1: Logical, represented as int. +* - 2: 32-bit signed integer. +* - 3: 64-bit signed integer (see below). +* - 4: Very long integer (see below). +* - 5: Floating point (stored as double). +* - 6: Integer complex (stored as double[2]). +* - 7: Floating point complex (stored as double[2]). +* - 8: String. +* - 8+10*n: Continued string (described below and in fitshdr() note 2). +* +* A negative type indicates that a syntax error was encountered when +* attempting to parse a keyvalue of the particular type. +* +* Comments on particular data types: +* - 64-bit signed integers lie in the range +* += (-9223372036854775808 <= int64 < -2147483648) || += (+2147483647 < int64 <= +9223372036854775807) +* +* A native 64-bit data type may be defined via preprocessor macro +* WCSLIB_INT64 defined in wcsconfig.h, e.g. as 'long long int'; this +* will be typedef'd to 'int64' here. If WCSLIB_INT64 is not set, then +* int64 is typedef'd to int[3] instead and fitskey::keyvalue is to be +* computed as +* += ((keyvalue.k[2]) * 1000000000 + += keyvalue.k[1]) * 1000000000 + += keyvalue.k[0] +* +* and may reported via +* += if (keyvalue.k[2]) { += printf("%d%09d%09d", keyvalue.k[2], abs(keyvalue.k[1]), += abs(keyvalue.k[0])); += } else { += printf("%d%09d", keyvalue.k[1], abs(keyvalue.k[0])); += } +* +* where keyvalue.k[0] and keyvalue.k[1] range from -999999999 to +* +999999999. +* +* - Very long integers, up to 70 decimal digits in length, are encoded +* in keyvalue.l as an array of int[8], each of which stores 9 decimal +* digits. fitskey::keyvalue is to be computed as +* += (((((((keyvalue.l[7]) * 1000000000 + += keyvalue.l[6]) * 1000000000 + += keyvalue.l[5]) * 1000000000 + += keyvalue.l[4]) * 1000000000 + += keyvalue.l[3]) * 1000000000 + += keyvalue.l[2]) * 1000000000 + += keyvalue.l[1]) * 1000000000 + += keyvalue.l[0] +* +* - Continued strings are not reconstructed, they remain split over +* successive fitskey structs in the keys[] array returned by +* fitshdr(). fitskey::keyvalue data type, 8 + 10n, indicates the +* segment number, n, in the continuation. +* +* int padding +* (An unused variable inserted for alignment purposes only.) +* +* union keyvalue +* (Returned) A union comprised of +* +* - fitskey::i, +* - fitskey::k, +* - fitskey::l, +* - fitskey::f, +* - fitskey::c, +* - fitskey::s, +* +* used by the fitskey struct to contain the value associated with a +* keyword. +* +* int i +* (Returned) Logical (fitskey::type == 1) and 32-bit signed integer +* (fitskey::type == 2) data types in the fitskey::keyvalue union. +* +* int64 k +* (Returned) 64-bit signed integer (fitskey::type == 3) data type in the +* fitskey::keyvalue union. +* +* int l[8] +* (Returned) Very long integer (fitskey::type == 4) data type in the +* fitskey::keyvalue union. +* +* double f +* (Returned) Floating point (fitskey::type == 5) data type in the +* fitskey::keyvalue union. +* +* double c[2] +* (Returned) Integer and floating point complex (fitskey::type == 6 || 7) +* data types in the fitskey::keyvalue union. +* +* char s[72] +* (Returned) Null-terminated string (fitskey::type == 8) data type in the +* fitskey::keyvalue union. +* +* int ulen +* (Returned) Where a keycomment contains a units string in the standard +* form, e.g. [m/s], the ulen member indicates its length, inclusive of +* square brackets. Otherwise ulen is zero. +* +* char comment[84] +* (Returned) Keycomment, i.e. comment associated with the keyword or, for +* keyrecords rejected because of syntax errors, the compete keyrecord +* itself with null-termination. +* +* Comments are null-terminated with trailing spaces removed. Leading +* spaces are also removed from keycomments (i.e. those immediately +* following the '/' character), but not from COMMENT or HISTORY keyrecords +* or keyrecords without a value indicator ("= " in columns 9-80). +* +* +* Global variable: const char *fitshdr_errmsg[] - Status return messages +* ---------------------------------------------------------------------- +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_FITSHDR +#define WCSLIB_FITSHDR + +#include "wcsconfig.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define FITSHDR_KEYWORD 0x01 +#define FITSHDR_KEYVALUE 0x02 +#define FITSHDR_COMMENT 0x04 +#define FITSHDR_KEYREC 0x08 +#define FITSHDR_CARD 0x08 /* Alias for backwards compatibility. */ +#define FITSHDR_TRAILER 0x10 + + +extern const char *fitshdr_errmsg[]; + +enum fitshdr_errmsg_enum { + FITSHDRERR_SUCCESS = 0, /* Success. */ + FITSHDRERR_NULL_POINTER = 1, /* Null fitskey pointer passed. */ + FITSHDRERR_MEMORY = 2, /* Memory allocation failed. */ + FITSHDRERR_FLEX_PARSER = 3 /* Fatal error returned by Flex parser. */ +}; + +#ifdef WCSLIB_INT64 + typedef WCSLIB_INT64 int64; +#else + typedef int int64[3]; +#endif + + +/* Struct used for indexing the keywords. */ +struct fitskeyid { + char name[12]; /* Keyword name, null-terminated. */ + int count; /* Number of occurrences of keyword. */ + int idx[2]; /* Indices into fitskey array. */ +}; + +/* Size of the fitskeyid struct in int units, used by the Fortran wrappers. */ +#define KEYIDLEN (sizeof(struct fitskeyid)/sizeof(int)) + + +/* Struct used for storing FITS keywords. */ +struct fitskey { + int keyno; /* Header keyrecord sequence number (1-rel).*/ + int keyid; /* Index into fitskeyid[]. */ + int status; /* Header keyrecord status bit flags. */ + char keyword[12]; /* Keyword name, null-filled. */ + int type; /* Keyvalue type (see above). */ + int padding; /* (Dummy inserted for alignment purposes.) */ + union { + int i; /* 32-bit integer and logical values. */ + int64 k; /* 64-bit integer values. */ + int l[8]; /* Very long signed integer values. */ + double f; /* Floating point values. */ + double c[2]; /* Complex values. */ + char s[72]; /* String values, null-terminated. */ + } keyvalue; /* Keyvalue. */ + int ulen; /* Length of units string. */ + char comment[84]; /* Comment (or keyrecord), null-terminated. */ +}; + +/* Size of the fitskey struct in int units, used by the Fortran wrappers. */ +#define KEYLEN (sizeof(struct fitskey)/sizeof(int)) + + +int fitshdr(const char header[], int nkeyrec, int nkeyids, + struct fitskeyid keyids[], int *nreject, struct fitskey **keys); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_FITSHDR */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.l b/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.l new file mode 100644 index 0000000000000000000000000000000000000000..581db764c9411225979ff337fd032a909bbd4815 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/fitshdr.l @@ -0,0 +1,599 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: fitshdr.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* fitshdr.l is a Flex description file containing a lexical scanner +* definition for extracting keywords and keyvalues from a FITS header. +* +* It requires Flex v2.5.4 or later. +* +* Refer to fitshdr.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ + +/* Options. */ +%option full +%option never-interactive +%option nounput +%option noyywrap +%option outfile="fitshdr.c" +%option prefix="fitshdr" +%option reentrant + +/* Keywords. */ +KEYCHR [-_A-Z0-9] +KW1 {KEYCHR}{1}" "{7} +KW2 {KEYCHR}{2}" "{6} +KW3 {KEYCHR}{3}" "{5} +KW4 {KEYCHR}{4}" "{4} +KW5 {KEYCHR}{5}" "{3} +KW6 {KEYCHR}{6}" "{2} +KW7 {KEYCHR}{7}" "{1} +KW8 {KEYCHR}{8} +KEYWORD ({KW1}|{KW2}|{KW3}|{KW4}|{KW5}|{KW6}|{KW7}|{KW8}) + +/* Keyvalue data types. */ +LOGICAL [TF] +INT32 [+-]?0*[0-9]{1,9} +INT64 [+-]?0*[0-9]{10,18} +INTVL [+-]?0*[0-9]{19,} +INTEGER [+-]?[0-9]+ +FLOAT [+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eEdD][+-]?[0-9]+)? +ICOMPLX \(" "*{INTEGER}" "*," "*{INTEGER}" "*\) +FCOMPLX \(" "*{FLOAT}" "*," "*{FLOAT}" "*\) +STRING '([^']|'')*' + +/* Characters forming standard unit strings (jwBIQX are not used). */ +UNITSTR \[[-+*/^(). 0-9a-zA-Z]+\] + +/* Exclusive start states. */ +%x VALUE INLINE UNITS COMMENT ERROR FLUSH + +%{ +#include +#include +#include +#include +#include + +#include "fitshdr.h" +#include "wcsutil.h" + +static int fitshdr_scanner(const char header[], int nkeyrec, int nkeyids, \ + struct fitskeyid keyids[], int *nreject, \ + struct fitskey **keys, yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int fitshdr( + const char header[], + int nkeyrec, + int nkeyids, + struct fitskeyid keyids[], + int *nreject, + struct fitskey **keys) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject, + keys, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int fitshdr_scanner(const char header[], int nkeyrec, \ + int nkeyids, struct fitskeyid keyids[], int *nreject, \ + struct fitskey **keys, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (fitshdr_nkeyrec) { \ + strncpy(inbuff, fitshdr_hdr, 80); \ + inbuff[80] = '\n'; \ + fitshdr_hdr += 80; \ + fitshdr_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* These global variables are required by YY_INPUT. */ +const char *fitshdr_hdr; +int fitshdr_nkeyrec; + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf fitshdr_abort_jmp_env; +#define exit(status) longjmp(fitshdr_abort_jmp_env, status) + +/* Map status return value to message. */ +const char *fitshdr_errmsg[] = { + "Success", + "Null fitskey pointer-pointer passed", + "Memory allocation failed", + "Fatal error returned by Flex parser"}; + +%} + +%% + char *cptr, ctmp[72]; + int blank, continuation, end, j, k, keyno; + double dtmp; + struct fitskey *kptr; + struct fitskeyid *iptr; + void nullfill(char cptr[], int len); + + fitshdr_hdr = header; + fitshdr_nkeyrec = nkeyrec; + + *nreject = 0; + keyno = 0; + + if (keys == 0x0) { + return 1; + } + + /* Allocate memory for the required number of fitskey structs. */ + /* Recall that calloc() initializes allocated memory to zero. */ + if (!(kptr = *keys = calloc(nkeyrec, sizeof(struct fitskey)))) { + return 2; + } + + /* Initialize keyids[]. */ + iptr = keyids; + for (j = 0; j < nkeyids; j++, iptr++) { + iptr->count = 0; + iptr->idx[0] = -1; + iptr->idx[1] = -1; + } + + blank = 0; + continuation = 0; + end = 0; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(fitshdr_abort_jmp_env)) { + return 3; + } + + BEGIN(INITIAL); + +^" "{80} { + /* A completely blank keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + yyless(0); + blank = 1; + BEGIN(COMMENT); + } + +^(COMMENT|HISTORY|" "{8}) { + strncpy(kptr->keyword, yytext, 8); + BEGIN(COMMENT); + } + +^END" "{77} { + strncpy(kptr->keyword, yytext, 8); + end = 1; + BEGIN(FLUSH); + } + +^END" "{5}=" "+ { + /* Illegal END keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYREC; + BEGIN(VALUE); + } + +^END" "{5} { + /* Illegal END keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYREC; + BEGIN(COMMENT); + } + +^{KEYWORD}=" "+ { + strncpy(kptr->keyword, yytext, 8); + BEGIN(VALUE); + } + +^CONTINUE" "+{STRING} { + /* Continued string keyvalue. */ + strncpy(kptr->keyword, yytext, 8); + + if (keyno > 0 && (kptr-1)->type%10 == 8) { + /* Put back the string keyvalue. */ + for (k = 10; yytext[k] != '\''; k++); + yyless(k); + continuation = 1; + BEGIN(VALUE); + + } else { + /* Not a valid continuation. */ + yyless(8); + BEGIN(COMMENT); + } + } + +^{KEYWORD} { + /* Keyword without value. */ + strncpy(kptr->keyword, yytext, 8); + BEGIN(COMMENT); + } + +^.{8}=" "+ { + /* Illegal keyword, carry on regardless. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYWORD; + BEGIN(VALUE); + } + +^.{8} { + /* Illegal keyword, carry on regardless. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYWORD; + BEGIN(COMMENT); + } + +" "*/\/ { + /* Null keyvalue. */ + BEGIN(INLINE); + } + +{LOGICAL} { + /* Logical keyvalue. */ + kptr->type = 1; + kptr->keyvalue.i = (*yytext == 'T'); + BEGIN(INLINE); + } + +{INT32} { + /* 32-bit signed integer keyvalue. */ + kptr->type = 2; + if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + +{INT64} { + /* 64-bit signed integer keyvalue (up to 18 digits). */ + if (wcsutil_str2double(yytext, &dtmp)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + + } else if (INT_MIN <= dtmp && dtmp <= INT_MAX) { + /* Can be accomodated as a 32-bit signed integer. */ + kptr->type = 2; + if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + } else { + /* 64-bit signed integer. */ + kptr->type = 3; + #ifdef WCSLIB_INT64 + /* Native 64-bit integer is available. */ + if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + #else + /* 64-bit integer (up to 18 digits) implemented as int[3]. */ + kptr->keyvalue.k[2] = 0; + + sprintf(ctmp, "%%%dd%%9d", yyleng-9); + if (sscanf(yytext, ctmp, kptr->keyvalue.k+1, + kptr->keyvalue.k) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } else if (*yytext == '-') { + kptr->keyvalue.k[0] *= -1; + } + #endif + } + + BEGIN(INLINE); + } + +{INTVL} { + /* Very long integer keyvalue (and 19-digit int64). */ + kptr->type = 4; + strcpy(ctmp, yytext); + k = yyleng; + for (j = 0; j < 8; j++) { + /* Read it backwards. */ + k -= 9; + if (k < 0) k = 0; + if (sscanf(ctmp+k, "%d", kptr->keyvalue.l+j) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + if (*yytext == '-') { + kptr->keyvalue.l[j] = -abs(kptr->keyvalue.l[j]); + } + + if (k == 0) break; + ctmp[k] = '\0'; + } + + /* Can it be accomodated as a 64-bit signed integer? */ + if (j == 2 && abs(kptr->keyvalue.l[2]) <= 9 && + abs(kptr->keyvalue.l[1]) <= 223372036 && + kptr->keyvalue.l[0] <= 854775807 && + kptr->keyvalue.l[0] >= -854775808) { + kptr->type = 3; + + #ifdef WCSLIB_INT64 + /* Native 64-bit integer is available. */ + kptr->keyvalue.l[2] = 0; + if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + #endif + } + + BEGIN(INLINE); + } + +{FLOAT} { + /* Float keyvalue. */ + kptr->type = 5; + if (wcsutil_str2double(yytext, &(kptr->keyvalue.f))) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + +{ICOMPLX} { + /* Integer complex keyvalue. */ + kptr->type = 6; + if (sscanf(yytext, "(%lf,%lf)", kptr->keyvalue.c, + kptr->keyvalue.c+1) < 2) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + +{FCOMPLX} { + /* Floating point complex keyvalue. */ + kptr->type = 7; + + for (cptr = ctmp, k = 1; yytext[k] != ','; cptr++, k++) { + *cptr = yytext[k]; + } + *cptr = '\0'; + + if (wcsutil_str2double(ctmp, kptr->keyvalue.c)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + for (cptr = ctmp, k++; yytext[k] != ')'; cptr++, k++) { + *cptr = yytext[k]; + } + *cptr = '\0'; + + if (wcsutil_str2double(ctmp, kptr->keyvalue.c+1)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + +{STRING} { + /* String keyvalue. */ + kptr->type = 8; + cptr = kptr->keyvalue.s; + strcpy(cptr, yytext+1); + + /* Squeeze out repeated quotes. */ + k = 0; + for (j = 0; j < 72; j++) { + if (k < j) { + cptr[k] = cptr[j]; + } + + if (cptr[j] == '\0') { + if (k) cptr[k-1] = '\0'; + break; + } else if (cptr[j] == '\'' && cptr[j+1] == '\'') { + j++; + } + + k++; + } + + if (*cptr) { + /* Retain the initial blank in all-blank strings. */ + nullfill(cptr+1, 71); + } else { + nullfill(cptr, 72); + } + + BEGIN(INLINE); + } + +. { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + +" "*$ { + BEGIN(FLUSH); + } + +" "*\/" "*$ { + BEGIN(FLUSH); + } + +" "*\/" "* { + BEGIN(UNITS); + } + +" " { + kptr->status |= FITSHDR_COMMENT; + BEGIN(ERROR); + } + +. { + /* Keyvalue parsing must now also be suspect. */ + kptr->status |= FITSHDR_COMMENT; + kptr->type = 0; + BEGIN(ERROR); + } + +{UNITSTR} { + kptr->ulen = yyleng; + yymore(); + BEGIN(COMMENT); + } + +. { + yymore(); + BEGIN(COMMENT); + } + +.* { + strcpy(kptr->comment, yytext); + nullfill(kptr->comment, 84); + BEGIN(FLUSH); + } + +.* { + if (!continuation) kptr->type = -abs(kptr->type); + + sprintf(kptr->comment, "%.80s", fitshdr_hdr-80); + kptr->comment[80] = '\0'; + nullfill(kptr->comment+80, 4); + + BEGIN(FLUSH); + } + +.*\n { + /* Discard the rest of the input line. */ + kptr->keyno = ++keyno; + + /* Null-fill the keyword. */ + kptr->keyword[8] = '\0'; + nullfill(kptr->keyword, 12); + + /* Do indexing. */ + iptr = keyids; + kptr->keyid = -1; + for (j = 0; j < nkeyids; j++, iptr++) { + cptr = iptr->name; + cptr[8] = '\0'; + nullfill(cptr, 12); + for (k = 0; k < 8; k++, cptr++) { + if (*cptr != '.' && *cptr != kptr->keyword[k]) break; + } + + if (k == 8) { + /* Found a match. */ + iptr->count++; + if (iptr->idx[0] == -1) { + iptr->idx[0] = keyno-1; + } else { + iptr->idx[1] = keyno-1; + } + + kptr->keyno = -abs(kptr->keyno); + if (kptr->keyid < 0) kptr->keyid = j; + } + } + + /* Deal with continued strings. */ + if (continuation) { + /* Tidy up the previous string keyvalue. */ + if ((kptr-1)->type == 8) (kptr-1)->type += 10; + cptr = (kptr-1)->keyvalue.s; + if (cptr[strlen(cptr)-1] == '&') cptr[strlen(cptr)-1] = '\0'; + + kptr->type = (kptr-1)->type + 10; + } + + /* Check for keyrecords following the END keyrecord. */ + if (end && (end++ > 1) && !blank) { + kptr->status |= FITSHDR_TRAILER; + } + if (kptr->status) (*nreject)++; + + kptr++; + blank = 0; + continuation = 0; + + BEGIN(INITIAL); + } + +<> { + /* End-of-input. */ + return 0; + } + +%% + +/*--------------------------------------------------------------------------*/ + +void nullfill(char cptr[], int len) + +{ + int j, k; + + /* Null-fill the string. */ + for (j = 0; j < len; j++) { + if (cptr[j] == '\0') { + for (k = j+1; k < len; k++) { + cptr[k] = '\0'; + } + break; + } + } + + for (k = j-1; k >= 0; k--) { + if (cptr[k] != ' ') break; + cptr[k] = '\0'; + } + + return; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/README b/testbed/astropy__astropy/cextern/wcslib/C/flexed/README new file mode 100644 index 0000000000000000000000000000000000000000..ad28cd2b8e9fd0baa468c5de1966e06a684ae20f --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/README @@ -0,0 +1,5 @@ +This directory contains C code generated by flex 2.6.0 under KDE Neon 5.11 +(Kubuntu 16.04) from the Flex description files (*.l) in the parent directory. + +These pre-generated source files may be used during installation if +Flex 2.5.9 or later is not available on the build host. diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/fitshdr.c b/testbed/astropy__astropy/cextern/wcslib/C/flexed/fitshdr.c new file mode 100644 index 0000000000000000000000000000000000000000..4d375be13ce49cc3bfa1bdc02338d6ea31cc680a --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/fitshdr.c @@ -0,0 +1,12347 @@ +#line 2 "fitshdr.c" + +#line 4 "fitshdr.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define fitshdr_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer fitshdr_create_buffer +#endif + +#ifdef yy_delete_buffer +#define fitshdr_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer fitshdr_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define fitshdr_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer fitshdr_scan_buffer +#endif + +#ifdef yy_scan_string +#define fitshdr_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string fitshdr_scan_string +#endif + +#ifdef yy_scan_bytes +#define fitshdr_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes fitshdr_scan_bytes +#endif + +#ifdef yy_init_buffer +#define fitshdr_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer fitshdr_init_buffer +#endif + +#ifdef yy_flush_buffer +#define fitshdr_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer fitshdr_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define fitshdr_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state fitshdr_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define fitshdr_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer fitshdr_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define fitshdrpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state fitshdrpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define fitshdrpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state fitshdrpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define fitshdrensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack fitshdrensure_buffer_stack +#endif + +#ifdef yylex +#define fitshdrlex_ALREADY_DEFINED +#else +#define yylex fitshdrlex +#endif + +#ifdef yyrestart +#define fitshdrrestart_ALREADY_DEFINED +#else +#define yyrestart fitshdrrestart +#endif + +#ifdef yylex_init +#define fitshdrlex_init_ALREADY_DEFINED +#else +#define yylex_init fitshdrlex_init +#endif + +#ifdef yylex_init_extra +#define fitshdrlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra fitshdrlex_init_extra +#endif + +#ifdef yylex_destroy +#define fitshdrlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy fitshdrlex_destroy +#endif + +#ifdef yyget_debug +#define fitshdrget_debug_ALREADY_DEFINED +#else +#define yyget_debug fitshdrget_debug +#endif + +#ifdef yyset_debug +#define fitshdrset_debug_ALREADY_DEFINED +#else +#define yyset_debug fitshdrset_debug +#endif + +#ifdef yyget_extra +#define fitshdrget_extra_ALREADY_DEFINED +#else +#define yyget_extra fitshdrget_extra +#endif + +#ifdef yyset_extra +#define fitshdrset_extra_ALREADY_DEFINED +#else +#define yyset_extra fitshdrset_extra +#endif + +#ifdef yyget_in +#define fitshdrget_in_ALREADY_DEFINED +#else +#define yyget_in fitshdrget_in +#endif + +#ifdef yyset_in +#define fitshdrset_in_ALREADY_DEFINED +#else +#define yyset_in fitshdrset_in +#endif + +#ifdef yyget_out +#define fitshdrget_out_ALREADY_DEFINED +#else +#define yyget_out fitshdrget_out +#endif + +#ifdef yyset_out +#define fitshdrset_out_ALREADY_DEFINED +#else +#define yyset_out fitshdrset_out +#endif + +#ifdef yyget_leng +#define fitshdrget_leng_ALREADY_DEFINED +#else +#define yyget_leng fitshdrget_leng +#endif + +#ifdef yyget_text +#define fitshdrget_text_ALREADY_DEFINED +#else +#define yyget_text fitshdrget_text +#endif + +#ifdef yyget_lineno +#define fitshdrget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno fitshdrget_lineno +#endif + +#ifdef yyset_lineno +#define fitshdrset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno fitshdrset_lineno +#endif + +#ifdef yyget_column +#define fitshdrget_column_ALREADY_DEFINED +#else +#define yyget_column fitshdrget_column +#endif + +#ifdef yyset_column +#define fitshdrset_column_ALREADY_DEFINED +#else +#define yyset_column fitshdrset_column +#endif + +#ifdef yywrap +#define fitshdrwrap_ALREADY_DEFINED +#else +#define yywrap fitshdrwrap +#endif + +#ifdef yyalloc +#define fitshdralloc_ALREADY_DEFINED +#else +#define yyalloc fitshdralloc +#endif + +#ifdef yyrealloc +#define fitshdrrealloc_ALREADY_DEFINED +#else +#define yyrealloc fitshdrrealloc +#endif + +#ifdef yyfree +#define fitshdrfree_ALREADY_DEFINED +#else +#define yyfree fitshdrfree +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define fitshdrwrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static const flex_int16_t yy_nxt[][128] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16 + }, + + { + 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 18, 17, 17, 17, 17, 17, 17, 17, + + 17, 17, 17, 17, 17, 19, 17, 17, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 17, 17, + 17, 17, 17, 17, 17, 19, 19, 20, 19, 21, + 19, 19, 22, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 17, 17, 17, 17, 19, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17 + }, + + { + 15, 23, 23, 23, 23, 23, 23, 23, 23, 23, + + 16, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 24, 23, 23, 23, 23, 23, 23, 25, + 26, 23, 23, 27, 23, 27, 28, 29, 30, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 32, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 32, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23 + }, + + { + 15, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 16, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 24, 23, 23, 23, 23, 23, 23, 25, + 26, 23, 23, 27, 23, 27, 28, 29, 30, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 32, 23, 23, 23, 23, 23, 23, 23, 23, 23, + + 23, 23, 23, 23, 32, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23 + }, + + { + 15, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 35, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 36, 33, 33, + + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33 + }, + + { + 15, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, + + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 35, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 36, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + + 33, 33, 33, 33, 33, 33, 33, 33 + }, + + { + 15, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 16, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + + 37, 38, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37 + }, + + { + 15, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 16, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 38, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37 + }, + + { + 15, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 16, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39 + + }, + + { + 15, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 16, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39 + }, + + { + 15, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 16, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40 + }, + + { + 15, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 16, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40 + }, + + { + 15, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 42, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41 + }, + + { + 15, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 42, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41 + }, + + { + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15 + }, + + { + 15, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + + -16, -16, -16, -16, -16, -16, -16, -16 + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -17, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -18, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 44, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -19, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 46, 43, 43, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 43, 43, + 43, 43, 43, 43, 43, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 43, 43, 43, 43, 46, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -20, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 46, 43, 43, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 43, 43, + 43, 43, 43, 43, 43, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 47, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 43, 43, 43, 43, 46, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -21, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 46, 43, 43, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 43, 43, + 43, 43, 43, 43, 43, 46, 46, 46, 46, 46, + + 46, 46, 46, 46, 46, 46, 46, 46, 48, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 43, 43, 43, 43, 46, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + }, + + { + 15, 43, 43, 43, 43, 43, 43, 43, 43, 43, + -22, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 46, 43, 43, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 43, 43, + 43, 43, 43, 43, 43, 46, 46, 46, 46, 46, + 46, 46, 46, 49, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 43, 43, 43, 43, 46, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43 + }, + + { + 15, -23, -23, -23, -23, -23, -23, -23, -23, -23, + + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23 + }, + + { + 15, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, 50, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, 51, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24 + }, + + { + 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52 + }, + + { + 15, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, 54, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, 55, -26, 55, 56, -26, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + + -26, -26, -26, -26, -26, -26, -26, -26 + }, + + { + 15, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, 58, -27, 59, 60, + 60, 60, 60, 60, 60, 60, 60, 60, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27 + }, + + { + 15, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, -28, -28, + + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28 + }, + + { + 15, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29 + + }, + + { + 15, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, 62, -30, 63, 64, + 64, 64, 64, 64, 64, 64, 64, 64, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, 65, 65, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + + 65, 65, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30 + }, + + { + 15, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, 62, -31, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, 65, 65, + + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + 65, 65, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31 + }, + + { + 15, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32 + }, + + { + 15, -33, -33, -33, -33, -33, -33, -33, -33, -33, + + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33 + }, + + { + 15, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34 + }, + + { + 15, -35, -35, -35, -35, -35, -35, -35, -35, -35, + 67, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, 68, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, 69, -35, -35, + + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35 + }, + + { + 15, -36, -36, -36, -36, -36, -36, -36, -36, -36, + 70, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, 71, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36 + }, + + { + 15, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37 + }, + + { + 15, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, 72, -38, -38, -38, -38, -38, -38, -38, + 72, 72, 72, 72, -38, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, -38, -38, + + -38, -38, -38, -38, -38, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, -38, -38, -38, 72, -38, -38, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, -38, -38, -38, -38, -38 + }, + + { + 15, 73, 73, 73, 73, 73, 73, 73, 73, 73, + -39, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73 + + }, + + { + 15, 74, 74, 74, 74, 74, 74, 74, 74, 74, + -40, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74 + }, + + { + 15, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 76, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75 + }, + + { + 15, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + -43, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -44, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 78, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -45, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 79, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -46, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 80, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 81, 77, 77, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 77, 77, + 77, 77, 77, 77, 77, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 77, 77, 77, 77, 81, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -47, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 80, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 81, 77, 77, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 77, 77, + 77, 77, 77, 77, 77, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 82, 83, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + + 81, 77, 77, 77, 77, 81, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -48, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 80, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 81, 77, 77, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 77, 77, + + 77, 77, 77, 77, 77, 81, 81, 81, 84, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 77, 77, 77, 77, 81, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 15, 77, 77, 77, 77, 77, 77, 77, 77, 77, + -49, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 80, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 81, 77, 77, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 77, 77, + 77, 77, 77, 77, 77, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 85, 81, 81, 81, 81, 81, 81, + 81, 77, 77, 77, 77, 81, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + + }, + + { + 15, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, 50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, 51, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50 + }, + + { + 15, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51 + }, + + { + 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, + + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52 + }, + + { + 15, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, 52, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53 + }, + + { + 15, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, 54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, 55, -54, 55, 56, -54, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54 + }, + + { + 15, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, 56, -55, 57, 57, + + 57, 57, 57, 57, 57, 57, 57, 57, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55 + }, + + { + 15, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56 + }, + + { + 15, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, 87, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, 88, -57, 89, -57, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, 91, 91, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + 91, 91, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57 + }, + + { + 15, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, -58, -58, + + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58 + }, + + { + 15, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, 62, -59, 63, 64, + 64, 64, 64, 64, 64, 64, 64, 64, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, 65, 65, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + 65, 65, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59 + + }, + + { + 15, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, 62, -60, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, 65, 65, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + + 65, 65, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60 + }, + + { + 15, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, 65, 65, + + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + 65, 65, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61 + }, + + { + 15, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + + -62, -62, -62, -62, -62, -62, -62, -62, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, 65, 65, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + 65, 65, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62 + }, + + { + 15, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, 62, -63, 93, 94, + 94, 94, 94, 94, 94, 94, 94, 94, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, 65, 65, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + 65, 65, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63 + }, + + { + 15, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, 62, -64, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, 65, 65, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + 65, 65, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64 + }, + + { + 15, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, 96, -65, 96, -65, -65, 97, 97, + + 97, 97, 97, 97, 97, 97, 97, 97, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65 + }, + + { + 15, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, 62, -66, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, 65, 65, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + 65, 65, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66 + }, + + { + 15, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67 + }, + + { + 15, -68, -68, -68, -68, -68, -68, -68, -68, -68, + 67, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, 68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, 69, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68 + }, + + { + 15, -69, -69, -69, -69, -69, -69, -69, -69, -69, + 70, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + + -69, -69, 71, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69 + + }, + + { + 15, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70 + }, + + { + 15, -71, -71, -71, -71, -71, -71, -71, -71, -71, + 70, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, 71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71 + }, + + { + 15, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, 72, -72, -72, -72, -72, -72, -72, -72, + + 72, 72, 72, 72, -72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, -72, -72, + -72, -72, -72, -72, -72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, -72, -72, 99, 72, -72, -72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, -72, -72, -72, -72, -72 + }, + + { + 15, 73, 73, 73, 73, 73, 73, 73, 73, 73, + + -73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 73, 73 + }, + + { + 15, 74, 74, 74, 74, 74, 74, 74, 74, 74, + -74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74 + }, + + { + 15, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 76, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75 + }, + + { + 15, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -77, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -78, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 101, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -79, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 102, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -80, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 103, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -81, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 104, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 105, 100, 100, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 100, 100, + 100, 100, 100, 100, 100, 105, 105, 105, 105, 105, + + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 100, 100, 100, 100, 105, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -82, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 104, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 105, 100, 100, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 100, 100, + 100, 100, 100, 100, 100, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 106, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 100, 100, 100, 100, 105, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + -83, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 104, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 105, 100, 100, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 100, 100, + 100, 100, 100, 100, 100, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 107, 105, 105, 105, 105, 105, + 105, 100, 100, 100, 100, 105, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -84, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 108, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 105, 100, 100, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 100, 100, + 100, 100, 100, 100, 100, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 100, 100, 100, 100, 105, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, 100, 100, 100, 100, 100, 100, 100, 100, 100, + -85, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 104, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 105, 100, 100, 105, 105, + + 105, 105, 105, 105, 105, 105, 105, 105, 100, 100, + 100, 100, 100, 100, 100, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 109, 105, 105, 105, 105, 105, + 105, 100, 100, 100, 100, 105, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 15, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, 110, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, 111, -86, -86, -86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, 91, 91, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + 91, 91, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86 + }, + + { + 15, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, 87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, 88, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87 + }, + + { + 15, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, 112, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, 113, -88, 113, 114, -88, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88 + }, + + { + 15, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, 110, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, 111, -89, -89, -89, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, 91, 91, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + 91, 91, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89 + + }, + + { + 15, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, 87, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, 88, -90, 89, -90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, 91, 91, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + + 91, 91, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90 + }, + + { + 15, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, 117, -91, 117, -91, -91, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91 + }, + + { + 15, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, 65, 65, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + 65, 65, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92 + }, + + { + 15, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, 62, -93, 119, 120, + 120, 120, 120, 120, 120, 120, 120, 120, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, 65, 65, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + 65, 65, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93 + }, + + { + 15, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, 62, -94, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, 65, 65, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + 65, 65, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94 + }, + + { + 15, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, 62, -95, 122, 122, + + 122, 122, 122, 122, 122, 122, 122, 122, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, 65, 65, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + 65, 65, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95 + }, + + { + 15, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96 + }, + + { + 15, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97 + }, + + { + 15, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 62, -98, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, -98, -98, + + -98, -98, -98, -98, -98, -98, -98, -98, 65, 65, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + 65, 65, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98 + }, + + { + 15, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99 + + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -100, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -101, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 125, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -102, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 126, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + -103, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 127, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -104, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 128, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -105, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 129, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 130, 124, 124, 130, 130, + + 130, 130, 130, 130, 130, 130, 130, 130, 124, 124, + 124, 124, 124, 124, 124, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 124, 124, 124, 124, 130, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -106, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 129, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 130, 124, 124, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 124, 124, + 124, 124, 124, 124, 124, 130, 130, 130, 130, 131, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 124, 124, 124, 124, 130, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -107, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 129, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 130, 124, 124, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 124, 124, + 124, 124, 124, 124, 124, 130, 130, 130, 130, 130, + 130, 130, 130, 132, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 130, 124, 124, 124, 124, 130, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -108, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 133, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + }, + + { + 15, 124, 124, 124, 124, 124, 124, 124, 124, 124, + -109, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + + 124, 124, 129, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 130, 124, 124, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 124, 124, + 124, 124, 124, 124, 124, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 134, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 124, 124, 124, 124, 130, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124 + + }, + + { + 15, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, 110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, 111, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110 + }, + + { + 15, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, 135, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, 136, -111, 136, 114, -111, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111 + }, + + { + 15, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, 112, -112, -112, -112, -112, -112, -112, -112, + + -112, -112, -112, 113, -112, 113, 114, -112, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112 + }, + + { + 15, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, 114, -113, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113 + }, + + { + 15, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114 + }, + + { + 15, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, 139, -115, -115, -115, -115, -115, -115, -115, + -115, 140, -115, -115, -115, -115, 141, -115, 142, 142, + + 142, 142, 142, 142, 142, 142, 142, 142, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, 143, 143, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + 143, 143, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115 + }, + + { + 15, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, 110, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, 111, -116, -116, -116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, 91, 91, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + 91, 91, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116 + }, + + { + 15, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117 + }, + + { + 15, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, 110, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, 111, -118, -118, -118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, -118, -118, + + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118 + }, + + { + 15, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, 62, -119, 144, 145, + 145, 145, 145, 145, 145, 145, 145, 145, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, 65, 65, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + 65, 65, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119 + + }, + + { + 15, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, 62, -120, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, 65, 65, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + + 65, 65, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120 + }, + + { + 15, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, 62, -121, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, 65, 65, + + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + 65, 65, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121 + }, + + { + 15, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + + -122, -122, -122, -122, -122, -122, 62, -122, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, 65, 65, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + 65, 65, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122 + }, + + { + 15, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, 62, -123, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, 65, 65, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + 65, 65, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -124, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -125, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 151, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -126, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 152, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -127, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 153, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -128, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 154, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -129, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 155, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -130, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 156, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 157, 150, 150, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 150, 150, + 150, 150, 150, 150, 150, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 150, 150, 150, 150, 157, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -131, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 156, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 157, 150, 150, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 150, 150, + 150, 150, 150, 150, 150, 157, 157, 157, 157, 157, + + 157, 157, 157, 157, 157, 157, 157, 157, 158, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 150, 150, 150, 150, 157, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -132, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 156, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 157, 150, 150, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 150, 150, + 150, 150, 150, 150, 150, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 159, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 150, 150, 150, 150, 157, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + -133, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 160, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, 150, 150, 150, 150, 150, 150, 150, 150, 150, + -134, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 156, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 157, 150, 150, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 150, 150, + 150, 150, 150, 150, 150, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + + 157, 157, 161, 157, 157, 157, 157, 157, 157, 157, + 157, 150, 150, 150, 150, 157, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150 + }, + + { + 15, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, 135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, 136, -135, 136, 114, -135, 137, 137, + + 137, 137, 137, 137, 137, 137, 137, 137, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135 + }, + + { + 15, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, 114, -136, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136 + }, + + { + 15, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, 162, -137, -137, -137, -137, -137, -137, -137, + -137, 163, -137, -137, -137, -137, 141, -137, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, 143, 143, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + 143, 143, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137 + }, + + { + 15, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, 162, -138, -138, -138, -138, -138, -138, -138, + -138, 163, -138, -138, -138, -138, -138, -138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, -138, -138, + + -138, -138, -138, -138, -138, -138, -138, -138, 143, 143, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + 143, 143, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138 + }, + + { + 15, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + + -139, -139, 139, -139, -139, -139, -139, -139, -139, -139, + -139, 140, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139 + + }, + + { + 15, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140 + }, + + { + 15, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, 162, -141, -141, -141, -141, -141, -141, -141, + -141, 163, -141, -141, -141, -141, -141, -141, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, 143, 143, + + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + 143, 143, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141 + }, + + { + 15, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, 139, -142, -142, -142, -142, -142, -142, -142, + + -142, 140, -142, -142, -142, -142, 141, -142, 142, 142, + 142, 142, 142, 142, 142, 142, 142, 142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, 143, 143, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + 143, 143, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142 + }, + + { + 15, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, 166, -143, 166, -143, -143, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143 + }, + + { + 15, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, 62, -144, 168, 169, + 169, 169, 169, 169, 169, 169, 169, 169, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, 65, 65, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + 65, 65, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144 + }, + + { + 15, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, 62, -145, 170, 170, + + 170, 170, 170, 170, 170, 170, 170, 170, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, 65, 65, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + 65, 65, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145 + }, + + { + 15, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, 62, -146, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, 65, 65, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + 65, 65, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146 + }, + + { + 15, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, 62, -147, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, 65, 65, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + 65, 65, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147 + }, + + { + 15, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, 62, -148, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, -148, -148, + + -148, -148, -148, -148, -148, -148, -148, -148, 65, 65, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + 65, 65, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148 + }, + + { + 15, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, 62, -149, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, 65, 65, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + 65, 65, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149 + + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -150, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -151, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 176, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -152, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 177, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + -153, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 178, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -154, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 179, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -155, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 180, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -156, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 181, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -157, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 182, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 183, 175, 175, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 175, 175, + 175, 175, 175, 175, 175, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + + 183, 175, 175, 175, 175, 183, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -158, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 182, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 183, 175, 175, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 175, 175, + + 175, 175, 175, 175, 175, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 184, 183, 183, 183, 183, 183, + 183, 175, 175, 175, 175, 183, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -159, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 182, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 183, 175, 175, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 175, 175, + 175, 175, 175, 175, 175, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 185, 183, 183, 183, 183, + 183, 175, 175, 175, 175, 183, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -160, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 186, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, 175, 175, 175, 175, 175, 175, 175, 175, 175, + -161, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 182, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 183, 175, 175, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 175, 175, + 175, 175, 175, 175, 175, 183, 183, 183, 183, 183, + + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, + 183, 175, 175, 175, 175, 183, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175 + }, + + { + 15, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, 162, -162, -162, -162, -162, -162, -162, -162, + + -162, 163, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162 + }, + + { + 15, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163 + }, + + { + 15, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, 162, -164, -164, -164, -164, -164, -164, -164, + -164, 163, -164, -164, -164, -164, 141, -164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, 143, 143, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + 143, 143, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164 + }, + + { + 15, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, 162, -165, -165, -165, -165, -165, -165, -165, + -165, 163, -165, -165, -165, -165, -165, -165, 165, 165, + + 165, 165, 165, 165, 165, 165, 165, 165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, 143, 143, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + 143, 143, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165 + }, + + { + 15, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166 + }, + + { + 15, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, 162, -167, -167, -167, -167, -167, -167, -167, + -167, 163, -167, -167, -167, -167, -167, -167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167 + }, + + { + 15, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, 62, -168, 187, 188, + 188, 188, 188, 188, 188, 188, 188, 188, -168, -168, + + -168, -168, -168, -168, -168, -168, -168, -168, 65, 65, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + 65, 65, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168 + }, + + { + 15, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, 62, -169, 189, 189, + 189, 189, 189, 189, 189, 189, 189, 189, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, 65, 65, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + 65, 65, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169 + + }, + + { + 15, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, 62, -170, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, 65, 65, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + + 65, 65, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170 + }, + + { + 15, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, 62, -171, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, 65, 65, + + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + 65, 65, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171 + }, + + { + 15, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + + -172, -172, -172, -172, -172, -172, 62, -172, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, 65, 65, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + 65, 65, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172 + }, + + { + 15, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, 62, -173, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, 65, 65, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + 65, 65, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173 + }, + + { + 15, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, 62, -174, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, 65, 65, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + 65, 65, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -175, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -176, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 196, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -177, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -178, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -179, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -180, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -181, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -182, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 197, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + -183, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 198, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 197, 195, 195, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 195, 195, + 195, 195, 195, 195, 195, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 195, 195, 195, 195, 197, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -184, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 198, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 197, 195, 195, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 195, 195, + 195, 195, 195, 195, 195, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 195, 195, 195, 195, 197, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -185, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 198, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 197, 195, 195, 197, 197, + + 197, 197, 197, 197, 197, 197, 197, 197, 195, 195, + 195, 195, 195, 195, 195, 197, 197, 197, 197, 199, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 195, 195, 195, 195, 197, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, 195, 195, 195, 195, 195, 195, 195, 195, 195, + -186, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 200, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + + 195, 195, 195, 195, 195, 195, 195, 195 + }, + + { + 15, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, 62, -187, 201, 202, + 202, 202, 202, 202, 202, 202, 202, 202, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, 65, 65, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + 65, 65, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187 + }, + + { + 15, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, 62, -188, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, -188, -188, + + -188, -188, -188, -188, -188, -188, -188, -188, 65, 65, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + 65, 65, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188 + }, + + { + 15, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, 62, -189, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, 65, 65, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + 65, 65, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189 + + }, + + { + 15, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, 62, -190, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, 65, 65, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + + 65, 65, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190 + }, + + { + 15, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, 62, -191, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, 65, 65, + + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + 65, 65, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191 + }, + + { + 15, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + + -192, -192, -192, -192, -192, -192, 62, -192, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, 65, 65, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + 65, 65, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192 + }, + + { + 15, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, 62, -193, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, 65, 65, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + 65, 65, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193 + }, + + { + 15, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, 62, -194, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, 65, 65, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + 65, 65, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194 + }, + + { + 15, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, 210, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195 + }, + + { + 15, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, 211, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, 210, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196 + }, + + { + 15, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, 212, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197 + }, + + { + 15, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + + -198, 212, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198 + }, + + { + 15, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + + -199, -199, 213, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, 212, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199 + + }, + + { + 15, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, 214, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, 215, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200 + }, + + { + 15, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, 62, -201, 216, 217, + 217, 217, 217, 217, 217, 217, 217, 217, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, 65, 65, + + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + 65, 65, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201 + }, + + { + 15, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + + -202, -202, -202, -202, -202, -202, 62, -202, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, 65, 65, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + 65, 65, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202 + }, + + { + 15, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, 62, -203, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, 65, 65, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + 65, 65, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203 + }, + + { + 15, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, 62, -204, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, 65, 65, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + 65, 65, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204 + }, + + { + 15, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, 62, -205, 221, 221, + + 221, 221, 221, 221, 221, 221, 221, 221, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, 65, 65, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + 65, 65, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205 + }, + + { + 15, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, 62, -206, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, 65, 65, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + 65, 65, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206 + }, + + { + 15, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, 62, -207, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, 65, 65, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + 65, 65, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207 + }, + + { + 15, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, 62, -208, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, -208, -208, + + -208, -208, -208, -208, -208, -208, -208, -208, 65, 65, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + 65, 65, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208 + }, + + { + 15, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, 62, -209, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, 65, 65, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + 65, 65, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209 + + }, + + { + 15, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, 226, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210 + }, + + { + 15, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, 227, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211 + }, + + { + 15, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, 228, -212, -212, -212, -212, -212, -212, -212, + + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212 + }, + + { + 15, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, 229, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213 + }, + + { + 15, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, 230, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214 + }, + + { + 15, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, 231, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215 + }, + + { + 15, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, 62, -216, 232, 233, + 233, 233, 233, 233, 233, 233, 233, 233, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, 65, 65, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + 65, 65, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216 + }, + + { + 15, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, 62, -217, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, 65, 65, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + 65, 65, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217 + }, + + { + 15, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, 62, -218, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, -218, -218, + + -218, -218, -218, -218, -218, -218, -218, -218, 65, 65, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + 65, 65, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218 + }, + + { + 15, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, 62, -219, 236, 236, + 236, 236, 236, 236, 236, 236, 236, 236, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, 65, 65, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + 65, 65, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219 + + }, + + { + 15, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, 62, -220, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, 65, 65, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + + 65, 65, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220 + }, + + { + 15, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, 62, -221, 238, 238, + 238, 238, 238, 238, 238, 238, 238, 238, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, 65, 65, + + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + 65, 65, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221 + }, + + { + 15, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + + -222, -222, -222, -222, -222, -222, 62, -222, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, 65, 65, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + 65, 65, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222 + }, + + { + 15, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, 62, -223, 240, 240, + 240, 240, 240, 240, 240, 240, 240, 240, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, 65, 65, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + 65, 65, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223 + }, + + { + 15, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, 62, -224, 241, 241, + 241, 241, 241, 241, 241, 241, 241, 241, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, 65, 65, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + 65, 65, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224 + }, + + { + 15, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, 62, -225, 242, 242, + + 242, 242, 242, 242, 242, 242, 242, 242, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, 65, 65, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + 65, 65, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225 + }, + + { + 15, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, 226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226 + }, + + { + 15, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, 243, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227 + }, + + { + 15, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, 228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228 + }, + + { + 15, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + + -229, -229, 213, -229, -229, -229, -229, -229, -229, 244, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229 + + }, + + { + 15, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 245, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230 + }, + + { + 15, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, 231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231 + }, + + { + 15, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + + -232, -232, -232, -232, -232, -232, 62, -232, 246, 247, + 247, 247, 247, 247, 247, 247, 247, 247, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, 65, 65, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + 65, 65, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232 + }, + + { + 15, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, 62, -233, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, 65, 65, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + 65, 65, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233 + }, + + { + 15, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, 62, -234, 249, 249, + 249, 249, 249, 249, 249, 249, 249, 249, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, 65, 65, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + 65, 65, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234 + }, + + { + 15, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, 62, -235, 250, 250, + + 250, 250, 250, 250, 250, 250, 250, 250, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, 65, 65, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + 65, 65, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235 + }, + + { + 15, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, 62, -236, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, 65, 65, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + 65, 65, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236 + }, + + { + 15, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, 62, -237, 252, 252, + 252, 252, 252, 252, 252, 252, 252, 252, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, 65, 65, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + 65, 65, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237 + }, + + { + 15, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, 62, -238, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, -238, -238, + + -238, -238, -238, -238, -238, -238, -238, -238, 65, 65, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + 65, 65, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238 + }, + + { + 15, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, 62, -239, 254, 254, + 254, 254, 254, 254, 254, 254, 254, 254, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, 65, 65, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + 65, 65, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239 + + }, + + { + 15, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, 62, -240, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, 65, 65, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + + 65, 65, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240 + }, + + { + 15, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, 62, -241, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, 65, 65, + + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + 65, 65, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241 + }, + + { + 15, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + + -242, -242, -242, -242, -242, -242, 62, -242, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 257, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, 65, 65, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + 65, 65, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242 + }, + + { + 15, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, 258, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243 + }, + + { + 15, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 260, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259 + }, + + { + 15, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, 261, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245 + }, + + { + 15, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, 62, -246, 262, 263, + 263, 263, 263, 263, 263, 263, 263, 263, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, 65, 65, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + 65, 65, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246 + }, + + { + 15, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, 62, -247, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, 65, 65, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + 65, 65, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247 + }, + + { + 15, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, 62, -248, 265, 265, + 265, 265, 265, 265, 265, 265, 265, 265, -248, -248, + + -248, -248, -248, -248, -248, -248, -248, -248, 65, 65, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + 65, 65, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248 + }, + + { + 15, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, 62, -249, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, 65, 65, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + 65, 65, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249 + + }, + + { + 15, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, 62, -250, 267, 267, + 267, 267, 267, 267, 267, 267, 267, 267, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, 65, 65, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + + 65, 65, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250 + }, + + { + 15, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, 62, -251, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, 65, 65, + + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + 65, 65, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251 + }, + + { + 15, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + + -252, -252, -252, -252, -252, -252, 62, -252, 269, 269, + 269, 269, 269, 269, 269, 269, 269, 269, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, 65, 65, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + 65, 65, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252 + }, + + { + 15, -253, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, 62, -253, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, 65, 65, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + 65, 65, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253 + }, + + { + 15, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, 62, -254, 271, 271, + 271, 271, 271, 271, 271, 271, 271, 271, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, 65, 65, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + 65, 65, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254 + }, + + { + 15, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, 62, -255, 272, 272, + + 272, 272, 272, 272, 272, 272, 272, 272, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, 65, 65, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + 65, 65, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255 + }, + + { + 15, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, 62, -256, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, 65, 65, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + 65, 65, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256 + }, + + { + 15, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, 62, -257, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, 65, 65, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + 65, 65, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257 + }, + + { + 15, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, 275, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258 + }, + + { + 15, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + + 259, 259, 259, 259, 259, 259, 259, 259, 259, 260, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259 + + }, + + { + 15, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, 259, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260 + }, + + { + 15, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, 276, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261 + }, + + { + 15, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + + -262, -262, -262, -262, -262, -262, 62, -262, 277, 278, + 278, 278, 278, 278, 278, 278, 278, 278, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, 65, 65, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + 65, 65, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262 + }, + + { + 15, -263, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, 62, -263, 279, 279, + 279, 279, 279, 279, 279, 279, 279, 279, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, 65, 65, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + 65, 65, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263 + }, + + { + 15, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, 62, -264, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, 65, 65, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + 65, 65, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264 + }, + + { + 15, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, 62, -265, 281, 281, + + 281, 281, 281, 281, 281, 281, 281, 281, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, 65, 65, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + 65, 65, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265 + }, + + { + 15, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, 62, -266, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, 65, 65, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + 65, 65, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266 + }, + + { + 15, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, 62, -267, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, 65, 65, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + 65, 65, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267 + }, + + { + 15, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, 62, -268, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, -268, -268, + + -268, -268, -268, -268, -268, -268, -268, -268, 65, 65, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + 65, 65, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268 + }, + + { + 15, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, 62, -269, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, 65, 65, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + 65, 65, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269 + + }, + + { + 15, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, 62, -270, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, 65, 65, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + + 65, 65, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270 + }, + + { + 15, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, 62, -271, 287, 287, + 287, 287, 287, 287, 287, 287, 287, 287, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, 65, 65, + + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + 65, 65, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271 + }, + + { + 15, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + + -272, -272, -272, -272, -272, -272, 62, -272, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, 65, 65, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + 65, 65, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272 + }, + + { + 15, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, 62, -273, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, 65, 65, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + 65, 65, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273 + }, + + { + 15, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, 62, -274, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, 65, 65, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + 65, 65, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274 + }, + + { + 15, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, 291, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275 + }, + + { + 15, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, 292, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276 + }, + + { + 15, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, 62, -277, 293, 294, + 294, 294, 294, 294, 294, 294, 294, 294, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, 65, 65, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + 65, 65, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277 + }, + + { + 15, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, 62, -278, 295, 295, + 295, 295, 295, 295, 295, 295, 295, 295, -278, -278, + + -278, -278, -278, -278, -278, -278, -278, -278, 65, 65, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + 65, 65, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278 + }, + + { + 15, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, 62, -279, 296, 296, + 296, 296, 296, 296, 296, 296, 296, 296, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, 65, 65, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + 65, 65, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279 + + }, + + { + 15, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, 62, -280, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, 65, 65, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + + 65, 65, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280 + }, + + { + 15, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, 62, -281, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, 65, 65, + + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + 65, 65, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281 + }, + + { + 15, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + + -282, -282, -282, -282, -282, -282, 62, -282, 299, 299, + 299, 299, 299, 299, 299, 299, 299, 299, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, 65, 65, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + 65, 65, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282 + }, + + { + 15, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, 62, -283, 300, 300, + 300, 300, 300, 300, 300, 300, 300, 300, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, 65, 65, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + 65, 65, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283 + }, + + { + 15, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, 62, -284, 301, 301, + 301, 301, 301, 301, 301, 301, 301, 301, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, 65, 65, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + 65, 65, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284 + }, + + { + 15, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, 62, -285, 302, 302, + + 302, 302, 302, 302, 302, 302, 302, 302, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, 65, 65, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + 65, 65, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285 + }, + + { + 15, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, 62, -286, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, 65, 65, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + 65, 65, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286 + }, + + { + 15, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, 62, -287, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, 65, 65, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + 65, 65, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287 + }, + + { + 15, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, 62, -288, 305, 305, + 305, 305, 305, 305, 305, 305, 305, 305, -288, -288, + + -288, -288, -288, -288, -288, -288, -288, -288, 65, 65, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + 65, 65, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288 + }, + + { + 15, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, 62, -289, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, 65, 65, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + 65, 65, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289 + + }, + + { + 15, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, 62, -290, 307, 307, + 307, 307, 307, 307, 307, 307, 307, 307, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, 65, 65, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + + 65, 65, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290 + }, + + { + 15, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, 308, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291 + }, + + { + 15, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, 309, -292, -292, -292, -292, -292, -292, -292, + + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292 + }, + + { + 15, -293, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, 62, -293, 310, 311, + 311, 311, 311, 311, 311, 311, 311, 311, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, 65, 65, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + 65, 65, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293 + }, + + { + 15, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, 62, -294, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, 65, 65, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + 65, 65, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294 + }, + + { + 15, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, 62, -295, 313, 313, + + 313, 313, 313, 313, 313, 313, 313, 313, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, 65, 65, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + 65, 65, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295 + }, + + { + 15, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, 62, -296, 314, 314, + 314, 314, 314, 314, 314, 314, 314, 314, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, 65, 65, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + 65, 65, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296 + }, + + { + 15, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, 62, -297, 315, 315, + 315, 315, 315, 315, 315, 315, 315, 315, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, 65, 65, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + 65, 65, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297 + }, + + { + 15, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, 62, -298, 316, 316, + 316, 316, 316, 316, 316, 316, 316, 316, -298, -298, + + -298, -298, -298, -298, -298, -298, -298, -298, 65, 65, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + 65, 65, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298 + }, + + { + 15, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, 62, -299, 317, 317, + 317, 317, 317, 317, 317, 317, 317, 317, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, 65, 65, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + 65, 65, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299 + + }, + + { + 15, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, 62, -300, 318, 318, + 318, 318, 318, 318, 318, 318, 318, 318, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, 65, 65, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + + 65, 65, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300 + }, + + { + 15, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, 62, -301, 319, 319, + 319, 319, 319, 319, 319, 319, 319, 319, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, 65, 65, + + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + 65, 65, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301 + }, + + { + 15, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + + -302, -302, -302, -302, -302, -302, 62, -302, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, 65, 65, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + 65, 65, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302 + }, + + { + 15, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, 62, -303, 321, 321, + 321, 321, 321, 321, 321, 321, 321, 321, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, 65, 65, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + 65, 65, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303 + }, + + { + 15, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, 62, -304, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, 65, 65, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + 65, 65, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304 + }, + + { + 15, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, 62, -305, 323, 323, + + 323, 323, 323, 323, 323, 323, 323, 323, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, 65, 65, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + 65, 65, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305 + }, + + { + 15, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, 62, -306, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 324, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, 65, 65, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + 65, 65, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306 + }, + + { + 15, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, 62, -307, 325, 325, + 325, 325, 325, 325, 325, 325, 325, 325, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, 65, 65, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + 65, 65, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307 + }, + + { + 15, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, 326, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308 + }, + + { + 15, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + + -309, -309, 327, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309 + + }, + + { + 15, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, 62, -310, 328, 329, + 329, 329, 329, 329, 329, 329, 329, 329, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, 65, 65, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + + 65, 65, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310 + }, + + { + 15, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, 62, -311, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, 65, 65, + + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + 65, 65, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311 + }, + + { + 15, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + + -312, -312, -312, -312, -312, -312, 62, -312, 331, 331, + 331, 331, 331, 331, 331, 331, 331, 331, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, 65, 65, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + 65, 65, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312 + }, + + { + 15, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, 62, -313, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, 65, 65, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + 65, 65, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313 + }, + + { + 15, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, 62, -314, 333, 333, + 333, 333, 333, 333, 333, 333, 333, 333, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, 65, 65, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + 65, 65, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314 + }, + + { + 15, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, 62, -315, 334, 334, + + 334, 334, 334, 334, 334, 334, 334, 334, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, 65, 65, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + 65, 65, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315 + }, + + { + 15, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, 62, -316, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, 65, 65, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + 65, 65, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316 + }, + + { + 15, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, 62, -317, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, 65, 65, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + 65, 65, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317 + }, + + { + 15, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, 62, -318, 337, 337, + 337, 337, 337, 337, 337, 337, 337, 337, -318, -318, + + -318, -318, -318, -318, -318, -318, -318, -318, 65, 65, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + 65, 65, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318 + }, + + { + 15, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, 62, -319, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, 65, 65, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + 65, 65, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319 + + }, + + { + 15, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, 62, -320, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, 65, 65, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + + 65, 65, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320 + }, + + { + 15, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, 62, -321, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, 65, 65, + + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + 65, 65, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321 + }, + + { + 15, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + + -322, -322, -322, -322, -322, -322, 62, -322, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, 65, 65, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + 65, 65, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322 + }, + + { + 15, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, 62, -323, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, 65, 65, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + 65, 65, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323 + }, + + { + 15, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, 62, -324, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, 65, 65, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + 65, 65, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324 + }, + + { + 15, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, 62, -325, 344, 344, + + 344, 344, 344, 344, 344, 344, 344, 344, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, 65, 65, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + 65, 65, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325 + }, + + { + 15, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, 345, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326 + }, + + { + 15, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, 346, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327 + }, + + { + 15, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, 62, -328, 347, 348, + 348, 348, 348, 348, 348, 348, 348, 348, -328, -328, + + -328, -328, -328, -328, -328, -328, -328, -328, 65, 65, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + 65, 65, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328 + }, + + { + 15, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, 62, -329, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, 65, 65, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + 65, 65, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329 + + }, + + { + 15, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, 62, -330, 350, 350, + 350, 350, 350, 350, 350, 350, 350, 350, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, 65, 65, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + + 65, 65, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330 + }, + + { + 15, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, 62, -331, 351, 351, + 351, 351, 351, 351, 351, 351, 351, 351, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, 65, 65, + + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + 65, 65, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331 + }, + + { + 15, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + + -332, -332, -332, -332, -332, -332, 62, -332, 352, 352, + 352, 352, 352, 352, 352, 352, 352, 352, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, 65, 65, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + 65, 65, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332 + }, + + { + 15, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, 62, -333, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, 65, 65, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + 65, 65, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333 + }, + + { + 15, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, 62, -334, 354, 354, + 354, 354, 354, 354, 354, 354, 354, 354, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, 65, 65, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + 65, 65, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334 + }, + + { + 15, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, 62, -335, 355, 355, + + 355, 355, 355, 355, 355, 355, 355, 355, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, 65, 65, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + 65, 65, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335 + }, + + { + 15, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, 62, -336, 356, 356, + 356, 356, 356, 356, 356, 356, 356, 356, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, 65, 65, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + 65, 65, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336 + }, + + { + 15, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, 62, -337, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, 65, 65, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + 65, 65, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337 + }, + + { + 15, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, 62, -338, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, -338, -338, + + -338, -338, -338, -338, -338, -338, -338, -338, 65, 65, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + 65, 65, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338 + }, + + { + 15, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, 62, -339, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, 65, 65, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + 65, 65, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339 + + }, + + { + 15, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, 62, -340, 360, 360, + 360, 360, 360, 360, 360, 360, 360, 360, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, 65, 65, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + + 65, 65, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340 + }, + + { + 15, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, 62, -341, 361, 361, + 361, 361, 361, 361, 361, 361, 361, 361, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, 65, 65, + + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + 65, 65, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341 + }, + + { + 15, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + + -342, -342, -342, -342, -342, -342, 62, -342, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, 65, 65, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + 65, 65, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342 + }, + + { + 15, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, 62, -343, 363, 363, + 363, 363, 363, 363, 363, 363, 363, 363, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, 65, 65, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + 65, 65, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343 + }, + + { + 15, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, 62, -344, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 364, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, 65, 65, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + 65, 65, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344 + }, + + { + 15, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, 365, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345 + }, + + { + 15, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, 366, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346 + }, + + { + 15, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, 62, -347, 367, 368, + 368, 368, 368, 368, 368, 368, 368, 368, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, 65, 65, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + 65, 65, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347 + }, + + { + 15, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, 62, -348, 369, 369, + 369, 369, 369, 369, 369, 369, 369, 369, -348, -348, + + -348, -348, -348, -348, -348, -348, -348, -348, 65, 65, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + 65, 65, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348 + }, + + { + 15, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, 62, -349, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, 65, 65, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + 65, 65, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349 + + }, + + { + 15, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, 62, -350, 371, 371, + 371, 371, 371, 371, 371, 371, 371, 371, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, 65, 65, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + + 65, 65, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350 + }, + + { + 15, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, 62, -351, 372, 372, + 372, 372, 372, 372, 372, 372, 372, 372, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, 65, 65, + + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + 65, 65, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351 + }, + + { + 15, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + + -352, -352, -352, -352, -352, -352, 62, -352, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 373, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, 65, 65, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + 65, 65, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352 + }, + + { + 15, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, 62, -353, 374, 374, + 374, 374, 374, 374, 374, 374, 374, 374, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, 65, 65, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + 65, 65, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353 + }, + + { + 15, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, 62, -354, 375, 375, + 375, 375, 375, 375, 375, 375, 375, 375, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, 65, 65, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + 65, 65, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354 + }, + + { + 15, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, 62, -355, 376, 376, + + 376, 376, 376, 376, 376, 376, 376, 376, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, 65, 65, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + 65, 65, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355 + }, + + { + 15, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, 62, -356, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, 65, 65, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + 65, 65, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356 + }, + + { + 15, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, 62, -357, 378, 378, + 378, 378, 378, 378, 378, 378, 378, 378, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, 65, 65, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + 65, 65, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357 + }, + + { + 15, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, 62, -358, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, -358, -358, + + -358, -358, -358, -358, -358, -358, -358, -358, 65, 65, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + 65, 65, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358 + }, + + { + 15, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, 62, -359, 380, 380, + 380, 380, 380, 380, 380, 380, 380, 380, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, 65, 65, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + 65, 65, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359 + + }, + + { + 15, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, 62, -360, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, 65, 65, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + + 65, 65, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360 + }, + + { + 15, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, 62, -361, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, 65, 65, + + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + 65, 65, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361 + }, + + { + 15, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + + -362, -362, -362, -362, -362, -362, 62, -362, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, 65, 65, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + 65, 65, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362 + }, + + { + 15, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, 62, -363, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, 65, 65, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + 65, 65, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363 + }, + + { + 15, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, 62, -364, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 385, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, 65, 65, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + 65, 65, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364 + }, + + { + 15, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, 386, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365 + }, + + { + 15, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, 387, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366 + }, + + { + 15, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, 62, -367, 388, 389, + 389, 389, 389, 389, 389, 389, 389, 389, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, 65, 65, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + 65, 65, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367 + }, + + { + 15, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, 62, -368, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, -368, -368, + + -368, -368, -368, -368, -368, -368, -368, -368, 65, 65, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + 65, 65, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368 + }, + + { + 15, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, 62, -369, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, 65, 65, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + 65, 65, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369 + + }, + + { + 15, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, 62, -370, 392, 392, + 392, 392, 392, 392, 392, 392, 392, 392, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, 65, 65, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + + 65, 65, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370 + }, + + { + 15, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, 62, -371, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, 65, 65, + + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + 65, 65, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371 + }, + + { + 15, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + + -372, -372, -372, -372, -372, -372, 62, -372, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, 65, 65, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + 65, 65, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372 + }, + + { + 15, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, 62, -373, 395, 395, + 395, 395, 395, 395, 395, 395, 395, 395, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, 65, 65, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + 65, 65, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373 + }, + + { + 15, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, 62, -374, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, 65, 65, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + 65, 65, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374 + }, + + { + 15, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, 62, -375, 397, 397, + + 397, 397, 397, 397, 397, 397, 397, 397, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, 65, 65, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + 65, 65, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375 + }, + + { + 15, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, 62, -376, 398, 398, + 398, 398, 398, 398, 398, 398, 398, 398, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, 65, 65, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + 65, 65, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376 + }, + + { + 15, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, 62, -377, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, 65, 65, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + 65, 65, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377 + }, + + { + 15, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, 62, -378, 400, 400, + 400, 400, 400, 400, 400, 400, 400, 400, -378, -378, + + -378, -378, -378, -378, -378, -378, -378, -378, 65, 65, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + 65, 65, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378 + }, + + { + 15, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, 62, -379, 401, 401, + 401, 401, 401, 401, 401, 401, 401, 401, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, 65, 65, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + 65, 65, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379 + + }, + + { + 15, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, 62, -380, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, 65, 65, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + + 65, 65, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380 + }, + + { + 15, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, 62, -381, 403, 403, + 403, 403, 403, 403, 403, 403, 403, 403, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, 65, 65, + + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + 65, 65, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381 + }, + + { + 15, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + + -382, -382, -382, -382, -382, -382, 62, -382, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, 65, 65, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + 65, 65, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382 + }, + + { + 15, -383, -383, -383, -383, -383, -383, -383, -383, -383, + + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, 62, -383, 405, 405, + 405, 405, 405, 405, 405, 405, 405, 405, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, 65, 65, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + 65, 65, -383, -383, -383, -383, -383, -383, -383, -383, + + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383 + }, + + { + 15, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, 62, -384, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, 65, 65, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + 65, 65, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384 + }, + + { + 15, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, 62, -385, 407, 407, + + 407, 407, 407, 407, 407, 407, 407, 407, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, 65, 65, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + 65, 65, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385 + }, + + { + 15, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, 408, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + + -386, -386, -386, -386, -386, -386, -386, -386 + }, + + { + 15, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, 409, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387 + }, + + { + 15, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, 62, -388, 410, 411, + 411, 411, 411, 411, 411, 411, 411, 411, -388, -388, + + -388, -388, -388, -388, -388, -388, -388, -388, 65, 65, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + 65, 65, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388 + }, + + { + 15, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, 62, -389, 412, 412, + 412, 412, 412, 412, 412, 412, 412, 412, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, 65, 65, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + 65, 65, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389 + + }, + + { + 15, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, 62, -390, 413, 413, + 413, 413, 413, 413, 413, 413, 413, 413, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, 65, 65, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + + 65, 65, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390 + }, + + { + 15, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, 62, -391, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 414, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, 65, 65, + + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + 65, 65, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391 + }, + + { + 15, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + + -392, -392, -392, -392, -392, -392, 62, -392, 415, 415, + 415, 415, 415, 415, 415, 415, 415, 415, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, 65, 65, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + 65, 65, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392 + }, + + { + 15, -393, -393, -393, -393, -393, -393, -393, -393, -393, + + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, 62, -393, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, 65, 65, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + 65, 65, -393, -393, -393, -393, -393, -393, -393, -393, + + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393 + }, + + { + 15, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, 62, -394, 417, 417, + 417, 417, 417, 417, 417, 417, 417, 417, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, 65, 65, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + 65, 65, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394 + }, + + { + 15, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, 62, -395, 418, 418, + + 418, 418, 418, 418, 418, 418, 418, 418, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, 65, 65, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + 65, 65, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395 + }, + + { + 15, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, 62, -396, 419, 419, + 419, 419, 419, 419, 419, 419, 419, 419, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, 65, 65, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + 65, 65, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396 + }, + + { + 15, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, 62, -397, 420, 420, + 420, 420, 420, 420, 420, 420, 420, 420, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, 65, 65, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + 65, 65, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397 + }, + + { + 15, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, 62, -398, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, -398, -398, + + -398, -398, -398, -398, -398, -398, -398, -398, 65, 65, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + 65, 65, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398 + }, + + { + 15, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, 62, -399, 422, 422, + 422, 422, 422, 422, 422, 422, 422, 422, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, 65, 65, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + 65, 65, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399 + + }, + + { + 15, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, 62, -400, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, 65, 65, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + + 65, 65, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400 + }, + + { + 15, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 62, -401, 424, 424, + 424, 424, 424, 424, 424, 424, 424, 424, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, 65, 65, + + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + 65, 65, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401 + }, + + { + 15, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + + -402, -402, -402, -402, -402, -402, 62, -402, 425, 425, + 425, 425, 425, 425, 425, 425, 425, 425, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, 65, 65, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + 65, 65, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402 + }, + + { + 15, -403, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, 62, -403, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 426, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, 65, 65, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + 65, 65, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403 + }, + + { + 15, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, 62, -404, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, 65, 65, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + 65, 65, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404 + }, + + { + 15, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, 62, -405, 428, 428, + + 428, 428, 428, 428, 428, 428, 428, 428, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, 65, 65, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + 65, 65, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405 + }, + + { + 15, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, 62, -406, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, 65, 65, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + 65, 65, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406 + }, + + { + 15, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, 62, -407, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, 65, 65, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + 65, 65, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407 + }, + + { + 15, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, 431, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408 + }, + + { + 15, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + + -409, -409, 432, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409 + + }, + + { + 15, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, 62, -410, 410, 411, + 411, 411, 411, 411, 411, 411, 411, 411, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, 65, 65, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + + 65, 65, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410 + }, + + { + 15, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, 62, -411, 412, 412, + 412, 412, 412, 412, 412, 412, 412, 412, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, 65, 65, + + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + 65, 65, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411 + }, + + { + 15, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + + -412, -412, -412, -412, -412, -412, 62, -412, 413, 413, + 413, 413, 413, 413, 413, 413, 413, 413, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, 65, 65, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + 65, 65, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412 + }, + + { + 15, -413, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, 62, -413, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 414, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, 65, 65, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + 65, 65, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413 + }, + + { + 15, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, 62, -414, 415, 415, + 415, 415, 415, 415, 415, 415, 415, 415, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, 65, 65, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + 65, 65, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414 + }, + + { + 15, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, 62, -415, 416, 416, + + 416, 416, 416, 416, 416, 416, 416, 416, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, 65, 65, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + 65, 65, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415 + }, + + { + 15, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, 62, -416, 417, 417, + 417, 417, 417, 417, 417, 417, 417, 417, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, 65, 65, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + 65, 65, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416 + }, + + { + 15, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, 62, -417, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, 65, 65, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + 65, 65, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417 + }, + + { + 15, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, 62, -418, 419, 419, + 419, 419, 419, 419, 419, 419, 419, 419, -418, -418, + + -418, -418, -418, -418, -418, -418, -418, -418, 65, 65, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + 65, 65, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418 + }, + + { + 15, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, 62, -419, 420, 420, + 420, 420, 420, 420, 420, 420, 420, 420, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, 65, 65, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + 65, 65, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419 + + }, + + { + 15, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, 62, -420, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, 65, 65, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + + 65, 65, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420 + }, + + { + 15, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, 62, -421, 422, 422, + 422, 422, 422, 422, 422, 422, 422, 422, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, 65, 65, + + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + 65, 65, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421 + }, + + { + 15, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + + -422, -422, -422, -422, -422, -422, 62, -422, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, 65, 65, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + 65, 65, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422 + }, + + { + 15, -423, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, 62, -423, 424, 424, + 424, 424, 424, 424, 424, 424, 424, 424, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, 65, 65, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + 65, 65, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423 + }, + + { + 15, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, 62, -424, 425, 425, + 425, 425, 425, 425, 425, 425, 425, 425, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, 65, 65, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + 65, 65, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424 + }, + + { + 15, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, 62, -425, 426, 426, + + 426, 426, 426, 426, 426, 426, 426, 426, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, 65, 65, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + 65, 65, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425 + }, + + { + 15, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, 62, -426, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, 65, 65, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + 65, 65, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426 + }, + + { + 15, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, 62, -427, 428, 428, + 428, 428, 428, 428, 428, 428, 428, 428, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, 65, 65, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + 65, 65, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427 + }, + + { + 15, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, 62, -428, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, -428, -428, + + -428, -428, -428, -428, -428, -428, -428, -428, 65, 65, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + 65, 65, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428 + }, + + { + 15, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, 62, -429, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, 65, 65, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + 65, 65, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429 + + }, + + { + 15, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, 62, -430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, 65, 65, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + + 65, 65, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430 + }, + + { + 15, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, 433, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431 + }, + + { + 15, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, 434, -432, -432, -432, -432, -432, -432, -432, + + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432 + }, + + { + 15, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, 435, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433 + }, + + { + 15, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, 436, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434 + }, + + { + 15, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, 437, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435 + }, + + { + 15, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, 438, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436 + }, + + { + 15, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, 439, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437 + }, + + { + 15, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, 440, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438 + }, + + { + 15, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + + -439, -439, 441, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439 + + }, + + { + 15, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, 442, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440 + }, + + { + 15, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, 443, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441 + }, + + { + 15, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, 444, -442, -442, -442, -442, -442, -442, -442, + + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442 + }, + + { + 15, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, 445, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443 + }, + + { + 15, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, 446, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444 + }, + + { + 15, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, 447, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445 + }, + + { + 15, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, 448, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446 + }, + + { + 15, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, 449, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447 + }, + + { + 15, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, 450, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448 + }, + + { + 15, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + + -449, -449, 451, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449 + + }, + + { + 15, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, 452, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450 + }, + + { + 15, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, 453, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451 + }, + + { + 15, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, 454, -452, -452, -452, -452, -452, -452, -452, + + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452 + }, + + { + 15, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, 455, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453 + }, + + { + 15, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, 456, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454 + }, + + { + 15, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, 457, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455 + }, + + { + 15, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, 458, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456 + }, + + { + 15, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, 459, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457 + }, + + { + 15, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, 460, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458 + }, + + { + 15, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + + -459, -459, 461, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459 + + }, + + { + 15, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, 462, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460 + }, + + { + 15, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, 463, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461 + }, + + { + 15, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, 464, -462, -462, -462, -462, -462, -462, -462, + + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462 + }, + + { + 15, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, 465, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463 + }, + + { + 15, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, 466, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464 + }, + + { + 15, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, 467, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465 + }, + + { + 15, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, 468, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466 + }, + + { + 15, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, 469, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467 + }, + + { + 15, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, 470, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468 + }, + + { + 15, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + + -469, -469, 471, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469 + + }, + + { + 15, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, 472, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470 + }, + + { + 15, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, 473, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471 + }, + + { + 15, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, 474, -472, -472, -472, -472, -472, -472, -472, + + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472 + }, + + { + 15, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, 475, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473 + }, + + { + 15, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, 476, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474 + }, + + { + 15, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, 477, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475 + }, + + { + 15, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 478, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476 + }, + + { + 15, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, 479, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477 + }, + + { + 15, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, 480, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478 + }, + + { + 15, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + + -479, -479, 481, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479 + + }, + + { + 15, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, 482, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480 + }, + + { + 15, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, 483, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481 + }, + + { + 15, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, 484, -482, -482, -482, -482, -482, -482, -482, + + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482 + }, + + { + 15, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, 485, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483 + }, + + { + 15, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, 486, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484 + }, + + { + 15, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, 487, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485 + }, + + { + 15, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, 488, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486 + }, + + { + 15, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, 489, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487 + }, + + { + 15, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, 490, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488 + }, + + { + 15, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + + -489, -489, 491, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489 + + }, + + { + 15, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, 492, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490 + }, + + { + 15, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, 493, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491 + }, + + { + 15, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, 494, -492, -492, -492, -492, -492, -492, -492, + + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492 + }, + + { + 15, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, 495, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493 + }, + + { + 15, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, 496, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494 + }, + + { + 15, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, 497, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495 + }, + + { + 15, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, 498, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + + -496, -496, -496, -496, -496, -496, -496, -496 + }, + + { + 15, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, 499, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497 + }, + + { + 15, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, 500, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498 + }, + + { + 15, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + + -499, -499, 501, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499 + + }, + + { + 15, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, 502, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500 + }, + + { + 15, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, 503, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501 + }, + + { + 15, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, 504, -502, -502, -502, -502, -502, -502, -502, + + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502 + }, + + { + 15, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, 505, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503 + }, + + { + 15, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, 506, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504 + }, + + { + 15, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, 507, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505 + }, + + { + 15, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, 508, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506 + }, + + { + 15, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, 509, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507 + }, + + { + 15, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, 510, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508 + }, + + { + 15, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + + -509, -509, 511, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509 + + }, + + { + 15, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, 512, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510 + }, + + { + 15, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, 513, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511 + }, + + { + 15, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, 514, -512, -512, -512, -512, -512, -512, -512, + + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512 + }, + + { + 15, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, 515, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513 + }, + + { + 15, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, 516, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514 + }, + + { + 15, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, 517, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515 + }, + + { + 15, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, 518, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516 + }, + + { + 15, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, 519, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517 + }, + + { + 15, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, 520, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518 + }, + + { + 15, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + + -519, -519, 521, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519 + + }, + + { + 15, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, 522, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520 + }, + + { + 15, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, 523, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521 + }, + + { + 15, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, 524, -522, -522, -522, -522, -522, -522, -522, + + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522 + }, + + { + 15, -523, -523, -523, -523, -523, -523, -523, -523, -523, + + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, 525, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523 + }, + + { + 15, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, 526, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524 + }, + + { + 15, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, 527, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525 + }, + + { + 15, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, 528, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + + -526, -526, -526, -526, -526, -526, -526, -526 + }, + + { + 15, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, 529, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527 + }, + + { + 15, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, 530, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528 + }, + + { + 15, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + + -529, -529, 531, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529 + + }, + + { + 15, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, 532, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530 + }, + + { + 15, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, 533, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531 + }, + + { + 15, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, 534, -532, -532, -532, -532, -532, -532, -532, + + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532 + }, + + { + 15, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, 535, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533 + }, + + { + 15, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, 536, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534 + }, + + { + 15, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, 537, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535 + }, + + { + 15, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, 538, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536 + }, + + { + 15, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, 539, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537 + }, + + { + 15, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, 540, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538 + }, + + { + 15, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + + -539, -539, 541, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539 + + }, + + { + 15, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, 542, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540 + }, + + { + 15, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, 543, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541 + }, + + { + 15, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, 544, -542, -542, -542, -542, -542, -542, -542, + + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542 + }, + + { + 15, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, 545, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543 + }, + + { + 15, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, 546, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544 + }, + + { + 15, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, 547, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545 + }, + + { + 15, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, 548, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546 + }, + + { + 15, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, 549, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547 + }, + + { + 15, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, 550, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548 + }, + + { + 15, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549 + + }, + + { + 15, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550 + }, + + } ; + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyg->yytext_ptr -= yyg->yy_more_len; \ + yyleng = (int) (yy_cp - yyg->yytext_ptr); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 31 +#define YY_END_OF_BUFFER 32 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[551] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 28, + 29, 29, 0, 0, 32, 31, 31, 31, 31, 31, + 31, 31, 20, 20, 20, 20, 20, 20, 11, 13, + 13, 12, 25, 21, 24, 23, 27, 27, 28, 29, + 31, 30, 0, 0, 0, 0, 0, 0, 0, 0, + 11, 0, 19, 0, 0, 0, 0, 0, 13, 13, + 16, 16, 13, 13, 0, 13, 21, 0, 23, 22, + 23, 0, 28, 29, 0, 30, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 16, 13, 13, 13, 0, 16, 13, 26, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, + 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, + 0, 0, 0, 13, 13, 13, 13, 13, 13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 0, 0, 0, 13, 13, 13, + 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 13, 13, 13, 13, + 13, 13, 13, 13, 10, 2, 8, 8, 8, 5, + + 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, + 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 9, 0, 6, 0, 0, + 4, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 14, 0, 0, 0, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 14, 14, 0, 0, 7, + 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 14, 14, 14, 0, 0, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, + + 13, 13, 14, 14, 14, 14, 14, 0, 0, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, + 14, 14, 14, 14, 14, 0, 0, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, + 14, 14, 14, 14, 0, 0, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 0, 0, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 0, 0, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, + + 14, 14, 14, 14, 14, 14, 15, 0, 0, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 3 + } ; + +static const yy_state_type yy_NUL_trans[551] = + { 0, + 16, 17, 23, 23, 33, 33, 37, 37, 39, 39, + 40, 40, 41, 41, 0, 0, 43, 43, 43, 43, + 43, 43, 0, 0, 52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 73, 74, + 75, 0, 77, 77, 77, 77, 77, 77, 77, 0, + 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 73, 74, 75, 0, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 124, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, + 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 259, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 259, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() (yyg->yy_more_flag = 1) +#define YY_MORE_ADJ yyg->yy_more_len +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "fitshdr.l" +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: fitshdr.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*============================================================================= +* +* fitshdr.l is a Flex description file containing a lexical scanner +* definition for extracting keywords and keyvalues from a FITS header. +* +* It requires Flex v2.5.4 or later. +* +* Refer to fitshdr.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ +/* Options. */ +/* Keywords. */ +/* Keyvalue data types. */ +/* Characters forming standard unit strings (jwBIQX are not used). */ +/* Exclusive start states. */ + +#line 77 "fitshdr.l" +#include +#include +#include +#include +#include + +#include "fitshdr.h" +#include "wcsutil.h" + +static int fitshdr_scanner(const char header[], int nkeyrec, int nkeyids, \ + struct fitskeyid keyids[], int *nreject, \ + struct fitskey **keys, yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int fitshdr( + const char header[], + int nkeyrec, + int nkeyids, + struct fitskeyid keyids[], + int *nreject, + struct fitskey **keys) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject, + keys, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int fitshdr_scanner(const char header[], int nkeyrec, \ + int nkeyids, struct fitskeyid keyids[], int *nreject, \ + struct fitskey **keys, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (fitshdr_nkeyrec) { \ + strncpy(inbuff, fitshdr_hdr, 80); \ + inbuff[80] = '\n'; \ + fitshdr_hdr += 80; \ + fitshdr_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* These global variables are required by YY_INPUT. */ +const char *fitshdr_hdr; +int fitshdr_nkeyrec; + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf fitshdr_abort_jmp_env; +#define exit(status) longjmp(fitshdr_abort_jmp_env, status) + +/* Map status return value to message. */ +const char *fitshdr_errmsg[] = { + "Success", + "Null fitskey pointer-pointer passed", + "Memory allocation failed", + "Fatal error returned by Flex parser"}; + +#line 10349 "fitshdr.c" +#line 10350 "fitshdr.c" + +#define INITIAL 0 +#define VALUE 1 +#define INLINE 2 +#define UNITS 3 +#define COMMENT 4 +#define ERROR 5 +#define FLUSH 6 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 150 "fitshdr.l" + +#line 152 "fitshdr.l" + char *cptr, ctmp[72]; + int blank, continuation, end, j, k, keyno; + double dtmp; + struct fitskey *kptr; + struct fitskeyid *iptr; + void nullfill(char cptr[], int len); + + fitshdr_hdr = header; + fitshdr_nkeyrec = nkeyrec; + + *nreject = 0; + keyno = 0; + + if (keys == 0x0) { + return 1; + } + + /* Allocate memory for the required number of fitskey structs. */ + /* Recall that calloc() initializes allocated memory to zero. */ + if (!(kptr = *keys = calloc(nkeyrec, sizeof(struct fitskey)))) { + return 2; + } + + /* Initialize keyids[]. */ + iptr = keyids; + for (j = 0; j < nkeyids; j++, iptr++) { + iptr->count = 0; + iptr->idx[0] = -1; + iptr->idx[1] = -1; + } + + blank = 0; + continuation = 0; + end = 0; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(fitshdr_abort_jmp_env)) { + return 3; + } + + BEGIN(INITIAL); + +#line 10646 "fitshdr.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yyg->yy_more_len = 0; + if ( yyg->yy_more_flag ) + { + yyg->yy_more_len = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + yyg->yy_more_flag = 0; + } + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + + ++yy_cp; + } + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos + 1; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 194 "fitshdr.l" +{ + /* A completely blank keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + yyless(0); + blank = 1; + BEGIN(COMMENT); + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 202 "fitshdr.l" +{ + strncpy(kptr->keyword, yytext, 8); + BEGIN(COMMENT); + } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 207 "fitshdr.l" +{ + strncpy(kptr->keyword, yytext, 8); + end = 1; + BEGIN(FLUSH); + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 213 "fitshdr.l" +{ + /* Illegal END keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYREC; + BEGIN(VALUE); + } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 220 "fitshdr.l" +{ + /* Illegal END keyrecord. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYREC; + BEGIN(COMMENT); + } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 227 "fitshdr.l" +{ + strncpy(kptr->keyword, yytext, 8); + BEGIN(VALUE); + } + YY_BREAK +case 7: +/* rule 7 can match eol */ +YY_RULE_SETUP +#line 232 "fitshdr.l" +{ + /* Continued string keyvalue. */ + strncpy(kptr->keyword, yytext, 8); + + if (keyno > 0 && (kptr-1)->type%10 == 8) { + /* Put back the string keyvalue. */ + for (k = 10; yytext[k] != '\''; k++); + yyless(k); + continuation = 1; + BEGIN(VALUE); + + } else { + /* Not a valid continuation. */ + yyless(8); + BEGIN(COMMENT); + } + } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 250 "fitshdr.l" +{ + /* Keyword without value. */ + strncpy(kptr->keyword, yytext, 8); + BEGIN(COMMENT); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 256 "fitshdr.l" +{ + /* Illegal keyword, carry on regardless. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYWORD; + BEGIN(VALUE); + } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 263 "fitshdr.l" +{ + /* Illegal keyword, carry on regardless. */ + strncpy(kptr->keyword, yytext, 8); + kptr->status |= FITSHDR_KEYWORD; + BEGIN(COMMENT); + } + YY_BREAK +case 11: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 270 "fitshdr.l" +{ + /* Null keyvalue. */ + BEGIN(INLINE); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 275 "fitshdr.l" +{ + /* Logical keyvalue. */ + kptr->type = 1; + kptr->keyvalue.i = (*yytext == 'T'); + BEGIN(INLINE); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 282 "fitshdr.l" +{ + /* 32-bit signed integer keyvalue. */ + kptr->type = 2; + if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 293 "fitshdr.l" +{ + /* 64-bit signed integer keyvalue (up to 18 digits). */ + if (wcsutil_str2double(yytext, &dtmp)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + + } else if (INT_MIN <= dtmp && dtmp <= INT_MAX) { + /* Can be accomodated as a 32-bit signed integer. */ + kptr->type = 2; + if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + } else { + /* 64-bit signed integer. */ + kptr->type = 3; +#ifdef WCSLIB_INT64 + /* Native 64-bit integer is available. */ + if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } +#else + /* 64-bit integer (up to 18 digits) implemented as int[3]. */ + kptr->keyvalue.k[2] = 0; + + sprintf(ctmp, "%%%dd%%9d", yyleng-9); + if (sscanf(yytext, ctmp, kptr->keyvalue.k+1, + kptr->keyvalue.k) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } else if (*yytext == '-') { + kptr->keyvalue.k[0] *= -1; + } +#endif + } + + BEGIN(INLINE); + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 334 "fitshdr.l" +{ + /* Very long integer keyvalue (and 19-digit int64). */ + kptr->type = 4; + strcpy(ctmp, yytext); + k = yyleng; + for (j = 0; j < 8; j++) { + /* Read it backwards. */ + k -= 9; + if (k < 0) k = 0; + if (sscanf(ctmp+k, "%d", kptr->keyvalue.l+j) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + if (*yytext == '-') { + kptr->keyvalue.l[j] = -abs(kptr->keyvalue.l[j]); + } + + if (k == 0) break; + ctmp[k] = '\0'; + } + + /* Can it be accomodated as a 64-bit signed integer? */ + if (j == 2 && abs(kptr->keyvalue.l[2]) <= 9 && + abs(kptr->keyvalue.l[1]) <= 223372036 && + kptr->keyvalue.l[0] <= 854775807 && + kptr->keyvalue.l[0] >= -854775808) { + kptr->type = 3; + +#ifdef WCSLIB_INT64 + /* Native 64-bit integer is available. */ + kptr->keyvalue.l[2] = 0; + if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } +#endif + } + + BEGIN(INLINE); + } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 375 "fitshdr.l" +{ + /* Float keyvalue. */ + kptr->type = 5; + if (wcsutil_str2double(yytext, &(kptr->keyvalue.f))) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 386 "fitshdr.l" +{ + /* Integer complex keyvalue. */ + kptr->type = 6; + if (sscanf(yytext, "(%lf,%lf)", kptr->keyvalue.c, + kptr->keyvalue.c+1) < 2) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 398 "fitshdr.l" +{ + /* Floating point complex keyvalue. */ + kptr->type = 7; + + for (cptr = ctmp, k = 1; yytext[k] != ','; cptr++, k++) { + *cptr = yytext[k]; + } + *cptr = '\0'; + + if (wcsutil_str2double(ctmp, kptr->keyvalue.c)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + for (cptr = ctmp, k++; yytext[k] != ')'; cptr++, k++) { + *cptr = yytext[k]; + } + *cptr = '\0'; + + if (wcsutil_str2double(ctmp, kptr->keyvalue.c+1)) { + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + + BEGIN(INLINE); + } + YY_BREAK +case 19: +/* rule 19 can match eol */ +YY_RULE_SETUP +#line 425 "fitshdr.l" +{ + /* String keyvalue. */ + kptr->type = 8; + cptr = kptr->keyvalue.s; + strcpy(cptr, yytext+1); + + /* Squeeze out repeated quotes. */ + k = 0; + for (j = 0; j < 72; j++) { + if (k < j) { + cptr[k] = cptr[j]; + } + + if (cptr[j] == '\0') { + if (k) cptr[k-1] = '\0'; + break; + } else if (cptr[j] == '\'' && cptr[j+1] == '\'') { + j++; + } + + k++; + } + + if (*cptr) { + /* Retain the initial blank in all-blank strings. */ + nullfill(cptr+1, 71); + } else { + nullfill(cptr, 72); + } + + BEGIN(INLINE); + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 458 "fitshdr.l" +{ + kptr->status |= FITSHDR_KEYVALUE; + BEGIN(ERROR); + } + YY_BREAK +case 21: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 463 "fitshdr.l" +{ + BEGIN(FLUSH); + } + YY_BREAK +case 22: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 467 "fitshdr.l" +{ + BEGIN(FLUSH); + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 471 "fitshdr.l" +{ + BEGIN(UNITS); + } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 475 "fitshdr.l" +{ + kptr->status |= FITSHDR_COMMENT; + BEGIN(ERROR); + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 480 "fitshdr.l" +{ + /* Keyvalue parsing must now also be suspect. */ + kptr->status |= FITSHDR_COMMENT; + kptr->type = 0; + BEGIN(ERROR); + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 487 "fitshdr.l" +{ + kptr->ulen = yyleng; + yymore(); + BEGIN(COMMENT); + } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 493 "fitshdr.l" +{ + yymore(); + BEGIN(COMMENT); + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 498 "fitshdr.l" +{ + strcpy(kptr->comment, yytext); + nullfill(kptr->comment, 84); + BEGIN(FLUSH); + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 504 "fitshdr.l" +{ + if (!continuation) kptr->type = -abs(kptr->type); + + sprintf(kptr->comment, "%.80s", fitshdr_hdr-80); + kptr->comment[80] = '\0'; + nullfill(kptr->comment+80, 4); + + BEGIN(FLUSH); + } + YY_BREAK +case 30: +/* rule 30 can match eol */ +YY_RULE_SETUP +#line 514 "fitshdr.l" +{ + /* Discard the rest of the input line. */ + kptr->keyno = ++keyno; + + /* Null-fill the keyword. */ + kptr->keyword[8] = '\0'; + nullfill(kptr->keyword, 12); + + /* Do indexing. */ + iptr = keyids; + kptr->keyid = -1; + for (j = 0; j < nkeyids; j++, iptr++) { + cptr = iptr->name; + cptr[8] = '\0'; + nullfill(cptr, 12); + for (k = 0; k < 8; k++, cptr++) { + if (*cptr != '.' && *cptr != kptr->keyword[k]) break; + } + + if (k == 8) { + /* Found a match. */ + iptr->count++; + if (iptr->idx[0] == -1) { + iptr->idx[0] = keyno-1; + } else { + iptr->idx[1] = keyno-1; + } + + kptr->keyno = -abs(kptr->keyno); + if (kptr->keyid < 0) kptr->keyid = j; + } + } + + /* Deal with continued strings. */ + if (continuation) { + /* Tidy up the previous string keyvalue. */ + if ((kptr-1)->type == 8) (kptr-1)->type += 10; + cptr = (kptr-1)->keyvalue.s; + if (cptr[strlen(cptr)-1] == '&') cptr[strlen(cptr)-1] = '\0'; + + kptr->type = (kptr-1)->type + 10; + } + + /* Check for keyrecords following the END keyrecord. */ + if (end && (end++ > 1) && !blank) { + kptr->status |= FITSHDR_TRAILER; + } + if (kptr->status) (*nreject)++; + + kptr++; + blank = 0; + continuation = 0; + + BEGIN(INITIAL); + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(VALUE): +case YY_STATE_EOF(INLINE): +case YY_STATE_EOF(UNITS): +case YY_STATE_EOF(COMMENT): +case YY_STATE_EOF(ERROR): +case YY_STATE_EOF(FLUSH): +#line 570 "fitshdr.l" +{ + /* End-of-input. */ + return 0; + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 575 "fitshdr.l" +ECHO; + YY_BREAK +#line 11194 "fitshdr.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + if ( *yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; + } + else + yy_current_state = yy_NUL_trans[yy_current_state]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + yy_current_state = yy_NUL_trans[yy_current_state]; + yy_is_jam = (yy_current_state == 0); + + if ( ! yy_is_jam ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 575 "fitshdr.l" + + +/*--------------------------------------------------------------------------*/ + +void nullfill(char cptr[], int len) + +{ + int j, k; + + /* Null-fill the string. */ + for (j = 0; j < len; j++) { + if (cptr[j] == '\0') { + for (k = j+1; k < len; k++) { + cptr[k] = '\0'; + } + break; + } + } + + for (k = j-1; k >= 0; k--) { + if (cptr[k] != ' ') break; + cptr[k] = '\0'; + } + + return; +} + diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsbth.c b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsbth.c new file mode 100644 index 0000000000000000000000000000000000000000..58a926687d54cce47963f1f4d2612a86a36d4c29 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsbth.c @@ -0,0 +1,30262 @@ +#line 2 "wcsbth.c" + +#line 4 "wcsbth.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define wcsbth_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer wcsbth_create_buffer +#endif + +#ifdef yy_delete_buffer +#define wcsbth_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer wcsbth_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define wcsbth_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer wcsbth_scan_buffer +#endif + +#ifdef yy_scan_string +#define wcsbth_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string wcsbth_scan_string +#endif + +#ifdef yy_scan_bytes +#define wcsbth_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes wcsbth_scan_bytes +#endif + +#ifdef yy_init_buffer +#define wcsbth_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer wcsbth_init_buffer +#endif + +#ifdef yy_flush_buffer +#define wcsbth_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer wcsbth_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define wcsbth_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state wcsbth_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define wcsbth_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer wcsbth_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define wcsbthpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state wcsbthpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define wcsbthpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state wcsbthpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define wcsbthensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack wcsbthensure_buffer_stack +#endif + +#ifdef yylex +#define wcsbthlex_ALREADY_DEFINED +#else +#define yylex wcsbthlex +#endif + +#ifdef yyrestart +#define wcsbthrestart_ALREADY_DEFINED +#else +#define yyrestart wcsbthrestart +#endif + +#ifdef yylex_init +#define wcsbthlex_init_ALREADY_DEFINED +#else +#define yylex_init wcsbthlex_init +#endif + +#ifdef yylex_init_extra +#define wcsbthlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra wcsbthlex_init_extra +#endif + +#ifdef yylex_destroy +#define wcsbthlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy wcsbthlex_destroy +#endif + +#ifdef yyget_debug +#define wcsbthget_debug_ALREADY_DEFINED +#else +#define yyget_debug wcsbthget_debug +#endif + +#ifdef yyset_debug +#define wcsbthset_debug_ALREADY_DEFINED +#else +#define yyset_debug wcsbthset_debug +#endif + +#ifdef yyget_extra +#define wcsbthget_extra_ALREADY_DEFINED +#else +#define yyget_extra wcsbthget_extra +#endif + +#ifdef yyset_extra +#define wcsbthset_extra_ALREADY_DEFINED +#else +#define yyset_extra wcsbthset_extra +#endif + +#ifdef yyget_in +#define wcsbthget_in_ALREADY_DEFINED +#else +#define yyget_in wcsbthget_in +#endif + +#ifdef yyset_in +#define wcsbthset_in_ALREADY_DEFINED +#else +#define yyset_in wcsbthset_in +#endif + +#ifdef yyget_out +#define wcsbthget_out_ALREADY_DEFINED +#else +#define yyget_out wcsbthget_out +#endif + +#ifdef yyset_out +#define wcsbthset_out_ALREADY_DEFINED +#else +#define yyset_out wcsbthset_out +#endif + +#ifdef yyget_leng +#define wcsbthget_leng_ALREADY_DEFINED +#else +#define yyget_leng wcsbthget_leng +#endif + +#ifdef yyget_text +#define wcsbthget_text_ALREADY_DEFINED +#else +#define yyget_text wcsbthget_text +#endif + +#ifdef yyget_lineno +#define wcsbthget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno wcsbthget_lineno +#endif + +#ifdef yyset_lineno +#define wcsbthset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno wcsbthset_lineno +#endif + +#ifdef yyget_column +#define wcsbthget_column_ALREADY_DEFINED +#else +#define yyget_column wcsbthget_column +#endif + +#ifdef yyset_column +#define wcsbthset_column_ALREADY_DEFINED +#else +#define yyset_column wcsbthset_column +#endif + +#ifdef yywrap +#define wcsbthwrap_ALREADY_DEFINED +#else +#define yywrap wcsbthwrap +#endif + +#ifdef yyalloc +#define wcsbthalloc_ALREADY_DEFINED +#else +#define yyalloc wcsbthalloc +#endif + +#ifdef yyrealloc +#define wcsbthrealloc_ALREADY_DEFINED +#else +#define yyrealloc wcsbthrealloc +#endif + +#ifdef yyfree +#define wcsbthfree_ALREADY_DEFINED +#else +#define yyfree wcsbthfree +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define wcsbthwrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static const flex_int16_t yy_nxt[][128] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70 + }, + + { + 69, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, + + 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 71, 71, + 71, 71, 71, 71, 71, 71, 73, 74, 75, 76, + 71, 71, 71, 71, 77, 71, 78, 79, 71, 80, + 81, 71, 82, 83, 84, 71, 85, 86, 87, 71, + 88, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 71, 71 + }, + + { + 69, 89, 89, 89, 89, 89, 89, 89, 89, 89, + + 70, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 90, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89 + }, + + { + 69, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 70, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 90, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89 + }, + + { + 69, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 70, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, + + 93, 93, 93, 93, 93, 93, 93, 93, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92 + }, + + { + 69, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 70, 92, 92, 92, 92, 92, 92, 92, 92, 92, + + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + + 92, 92, 92, 92, 92, 92, 92, 92 + }, + + { + 69, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 70, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94 + }, + + { + 69, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 70, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 94, 94, + + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94 + }, + + { + 69, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 70, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96 + + }, + + { + 69, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 70, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96 + }, + + { + 69, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 70, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98 + }, + + { + 69, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 70, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + + 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98 + }, + + { + 69, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 70, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 101, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 69, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 70, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 101, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 103, + + 103, 103, 103, 103, 103, 103, 103, 103, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70 + }, + + { + 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + + 70, 70, 70, 70, 70, 70, 70, 70 + }, + + { + 69, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 70, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104 + }, + + { + 69, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 70, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 104, 104, + + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104 + }, + + { + 69, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 70, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106 + + }, + + { + 69, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 70, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106 + }, + + { + 69, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 70, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108 + }, + + { + 69, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 70, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + + 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108 + }, + + { + 69, 110, 110, 110, 110, 110, 110, 110, 110, 110, + + 70, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110 + }, + + { + 69, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 70, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110 + }, + + { + 69, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 70, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112 + }, + + { + 69, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 70, 112, 112, 112, 112, 112, 112, 112, 112, 112, + + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + + 112, 112, 112, 112, 112, 112, 112, 112 + }, + + { + 69, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 70, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 115, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114 + }, + + { + 69, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 70, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 115, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 114, 114, + + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114 + }, + + { + 69, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 70, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117 + + }, + + { + 69, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 70, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117 + }, + + { + 69, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 70, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119 + }, + + { + 69, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 70, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + + 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119 + }, + + { + 69, 121, 121, 121, 121, 121, 121, 121, 121, 121, + + 70, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121 + }, + + { + 69, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 70, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121 + }, + + { + 69, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 70, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, + + 124, 124, 124, 124, 124, 124, 124, 124, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123 + }, + + { + 69, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 70, 123, 123, 123, 123, 123, 123, 123, 123, 123, + + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + + 123, 123, 123, 123, 123, 123, 123, 123 + }, + + { + 69, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 70, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + 69, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 70, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + 69, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 70, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127 + + }, + + { + 69, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 70, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127 + }, + + { + 69, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 70, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, + + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + }, + + { + 69, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 70, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, + + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128 + }, + + { + 69, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 70, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130 + }, + + { + 69, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 70, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130 + }, + + { + 69, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 70, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, + + 133, 133, 133, 133, 133, 133, 133, 133, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132 + }, + + { + 69, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 70, 132, 132, 132, 132, 132, 132, 132, 132, 132, + + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + + 132, 132, 132, 132, 132, 132, 132, 132 + }, + + { + 69, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 70, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134 + }, + + { + 69, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 70, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 134, 134, + + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134 + }, + + { + 69, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 70, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136 + + }, + + { + 69, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 70, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136 + }, + + { + 69, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 70, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 139, 138, 138, 138, 138, 138, 138, 138, 138, + + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138 + }, + + { + 69, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 70, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 139, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138 + }, + + { + 69, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 70, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 141, 140, 141, 140, 140, 142, 142, + 142, 142, 142, 142, 142, 142, 142, 142, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140 + }, + + { + 69, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 70, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 141, 140, 141, 140, 140, 142, 142, + 142, 142, 142, 142, 142, 142, 142, 142, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140 + }, + + { + 69, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 70, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 144, 143, 144, 145, 143, 146, 146, + + 146, 146, 146, 146, 146, 146, 146, 146, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143 + }, + + { + 69, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 70, 143, 143, 143, 143, 143, 143, 143, 143, 143, + + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 144, 143, 144, 145, 143, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + + 143, 143, 143, 143, 143, 143, 143, 143 + }, + + { + 69, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 70, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 148, 147, 148, 149, 147, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147 + }, + + { + 69, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 70, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 148, 147, 148, 149, 147, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 147, 147, + + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147 + }, + + { + 69, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 70, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + + 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151 + + }, + + { + 69, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 70, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151 + }, + + { + 69, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 154, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 155, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 156, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153 + }, + + { + 69, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 154, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 155, 153, 153, 153, 153, 153, 153, 153, + + 153, 153, 153, 153, 153, 153, 153, 156, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153 + }, + + { + 69, 157, 157, 157, 157, 157, 157, 157, 157, 157, + + 158, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157 + }, + + { + 69, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 158, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157 + }, + + { + 69, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 160, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159 + }, + + { + 69, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 160, 159, 159, 159, 159, 159, 159, 159, 159, 159, + + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + + 159, 159, 159, 159, 159, 159, 159, 159 + }, + + { + 69, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 162, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161 + }, + + { + 69, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 162, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161 + }, + + { + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69 + + }, + + { + 69, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70 + }, + + { + 69, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71 + }, + + { + 69, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + + -72, -72, -72, -72, -72, -72, -72, -72, 163, 163, + 163, 163, 163, 163, 163, 163, 163, 163, -72, -72, + -72, -72, -72, -72, -72, -72, -72, 164, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + 165, -72, -72, 166, -72, -72, 167, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72 + }, + + { + 69, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, 168, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73 + }, + + { + 69, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, 169, -74, + -74, -74, -74, -74, -74, -74, -74, -74, 170, -74, + + 171, -74, 172, 173, 174, 175, -74, -74, -74, -74, + 176, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74 + }, + + { + 69, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, 177, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, 178, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75 + }, + + { + 69, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, 179, -76, + 180, 181, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76 + }, + + { + 69, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, 182, 183, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77 + }, + + { + 69, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + + -78, -78, -78, -78, -78, 184, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, 185, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78 + }, + + { + 69, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, 186, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79 + + }, + + { + 69, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, 187, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80 + }, + + { + 69, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, 188, -81, -81, + + -81, -81, -81, -81, -81, -81, 189, -81, -81, -81, + -81, -81, 190, 191, -81, -81, 192, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81 + }, + + { + 69, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, 193, -82, -82, -82, 194, + 195, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, 196, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82 + }, + + { + 69, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, 197, + 198, -83, -83, 199, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83 + }, + + { + 69, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, 200, -84, 201, + 202, -84, -84, 203, -84, -84, -84, -84, -84, -84, + + 204, -84, 205, 206, -84, -84, 207, 208, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84 + }, + + { + 69, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, 209, -85, -85, -85, 210, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, 211, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85 + }, + + { + 69, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, 212, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86 + }, + + { + 69, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + 213, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87 + }, + + { + 69, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, 214, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88 + }, + + { + 69, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89 + + }, + + { + 69, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, 215, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, 216, 217, + 217, 217, 217, 217, 217, 217, 217, 217, -90, -90, + -90, -90, -90, -90, -90, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, -90, -90, -90, -90, -90, -90, -90, -90, -90, + + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90 + }, + + { + 69, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, 218, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, -91, -91, + -91, -91, -91, -91, -91, 218, 218, 218, 218, 218, + + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91 + }, + + { + 69, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92 + }, + + { + 69, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, 220, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, -93, -93, + -93, -93, -93, -93, -93, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93 + }, + + { + 69, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94 + }, + + { + 69, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, 222, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, 223, 223, + + 223, 223, 223, 223, 223, 223, 223, 223, -95, -95, + -95, -95, -95, -95, -95, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95 + }, + + { + 69, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96 + }, + + { + 69, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, 225, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, 226, 226, + 226, 226, 226, 226, 226, 226, 226, 226, -97, -97, + -97, -97, -97, -97, -97, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + + 225, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97 + }, + + { + 69, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98 + }, + + { + 69, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + + -99, -99, 227, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, -99, -99, + -99, -99, -99, -99, -99, 229, 229, 229, 229, 229, + 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, + 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, + 229, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99 + + }, + + { + 69, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100 + }, + + { + 69, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, 230, -101, -101, 231, 232, + 232, 232, 232, 232, 232, 232, 232, 232, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, 233, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101 + }, + + { + 69, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + + -102, -102, -102, -102, -102, 230, -102, -102, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, 235, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102 + }, + + { + 69, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, 236, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, -103, -103, + -103, -103, -103, -103, -103, 236, 236, 236, 236, 236, + 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, + 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, + 236, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103 + }, + + { + 69, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104 + }, + + { + 69, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, 238, 238, + + 238, 238, 238, 238, 238, 238, 238, 238, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, 239, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105 + }, + + { + 69, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106 + }, + + { + 69, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, 240, 240, + 240, 240, 240, 240, 240, 240, 240, 240, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + + -107, -107, -107, -107, -107, 241, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107 + }, + + { + 69, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108 + }, + + { + 69, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + + -109, -109, 242, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, -109, -109, + -109, -109, -109, -109, -109, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109 + + }, + + { + 69, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110 + }, + + { + 69, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, 244, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, -111, -111, + -111, -111, -111, -111, -111, 246, 246, 246, 246, 246, + + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111 + }, + + { + 69, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112 + }, + + { + 69, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, 247, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, 248, 248, + 248, 248, 248, 248, 248, 248, 248, 248, -113, -113, + -113, -113, -113, -113, -113, 249, 249, 249, 249, 249, + 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113 + }, + + { + 69, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114 + }, + + { + 69, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, 250, -115, -115, 251, 252, + + 252, 252, 252, 252, 252, 252, 252, 252, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, 253, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115 + }, + + { + 69, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, 250, -116, -116, 254, 254, + 254, 254, 254, 254, 254, 254, 254, 254, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, 255, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116 + }, + + { + 69, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117 + }, + + { + 69, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256, -118, -118, + + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, 257, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118 + }, + + { + 69, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119 + + }, + + { + 69, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, 259, -120, -120, -120, -120, + + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120 + }, + + { + 69, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121 + }, + + { + 69, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + + -122, -122, -122, -122, -122, -122, -122, -122, 260, 260, + 260, 260, 260, 260, 260, 260, 260, 260, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, 261, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122 + }, + + { + 69, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123 + }, + + { + 69, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, 263, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124 + }, + + { + 69, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125 + }, + + { + 69, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, 264, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, 265, 265, + 265, 265, 265, 265, 265, 265, 265, 265, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126 + }, + + { + 69, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127 + }, + + { + 69, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128 + }, + + { + 69, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129 + + }, + + { + 69, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130 + }, + + { + 69, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, 266, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, 267, 267, + 267, 267, 267, 267, 267, 267, 267, 267, -131, -131, + -131, -131, -131, -131, -131, 266, 266, 266, 266, 266, + + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131 + }, + + { + 69, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132 + }, + + { + 69, -133, -133, -133, -133, -133, -133, -133, -133, -133, + + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, 268, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, 269, 269, + 269, 269, 269, 269, 269, 269, 269, 269, -133, -133, + -133, -133, -133, -133, -133, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, + 268, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133 + }, + + { + 69, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134 + }, + + { + 69, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, 270, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, 271, 271, + + 271, 271, 271, 271, 271, 271, 271, 271, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135 + }, + + { + 69, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136 + }, + + { + 69, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, 272, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137 + }, + + { + 69, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138 + }, + + { + 69, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + + -139, -139, 274, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139 + + }, + + { + 69, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140 + }, + + { + 69, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141 + }, + + { + 69, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + + -142, -142, -142, -142, -142, -142, -142, -142, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142 + }, + + { + 69, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143 + }, + + { + 69, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, 276, -144, 277, 277, + 277, 277, 277, 277, 277, 277, 277, 277, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144 + }, + + { + 69, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, 278, 278, + + 278, 278, 278, 278, 278, 278, 278, 278, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145 + }, + + { + 69, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, 279, -146, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, 281, 281, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + 281, 281, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146 + }, + + { + 69, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147 + }, + + { + 69, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, 282, -148, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, -148, -148, + + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148 + }, + + { + 69, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149 + + }, + + { + 69, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, 285, -150, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, 287, 287, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + + 287, 287, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150 + }, + + { + 69, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151 + }, + + { + 69, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 289, + + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288 + }, + + { + 69, 290, 290, 290, 290, 290, 290, 290, 290, 290, + + 291, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 292, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 293, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290 + }, + + { + 69, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154 + }, + + { + 69, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 295, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 296, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 297, 294, 294, + + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294 + }, + + { + 69, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 299, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 300, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 301, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298 + }, + + { + 69, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 303, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302 + }, + + { + 69, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158 + }, + + { + 69, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 305, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304 + + }, + + { + 69, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160 + }, + + { + 69, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 307, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306 + }, + + { + 69, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162 + }, + + { + 69, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, 308, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + 309, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163 + }, + + { + 69, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, 310, -164, + -164, -164, -164, -164, -164, -164, -164, -164, 311, -164, + + 312, -164, 313, 314, 315, 316, -164, -164, -164, -164, + 317, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164 + }, + + { + 69, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, 318, -165, -165, 319, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165 + }, + + { + 69, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166 + }, + + { + 69, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167 + }, + + { + 69, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + 320, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168 + }, + + { + 69, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, 321, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169 + + }, + + { + 69, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, 322, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170 + }, + + { + 69, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, 323, + + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171 + }, + + { + 69, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, 324, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, 325, + 326, -172, -172, -172, -172, -172, 327, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172 + }, + + { + 69, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, 328, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173 + }, + + { + 69, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + + -174, -174, -174, -174, -174, -174, -174, -174, -174, 329, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174 + }, + + { + 69, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, 330, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175 + }, + + { + 69, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + 331, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176 + }, + + { + 69, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, 332, -177, 333, -177, -177, -177, + + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177 + }, + + { + 69, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + + -178, -178, -178, -178, -178, -178, 334, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178 + }, + + { + 69, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, 335, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179 + + }, + + { + 69, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, 336, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180 + }, + + { + 69, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, 337, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181 + }, + + { + 69, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, 338, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182 + }, + + { + 69, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + 339, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183 + }, + + { + 69, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + + -184, -184, -184, -184, 340, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184 + }, + + { + 69, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, 341, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185 + }, + + { + 69, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, 342, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186 + }, + + { + 69, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, 343, -187, -187, -187, -187, -187, -187, + + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187 + }, + + { + 69, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188 + }, + + { + 69, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, 344, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189 + + }, + + { + 69, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, 345, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190 + }, + + { + 69, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191 + }, + + { + 69, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192 + }, + + { + 69, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, 346, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193 + }, + + { + 69, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + + -194, -194, -194, 347, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194 + }, + + { + 69, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, 348, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195 + }, + + { + 69, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, 349, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196 + }, + + { + 69, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, 350, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197 + }, + + { + 69, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + + -198, -198, -198, -198, -198, -198, -198, -198, -198, 351, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198 + }, + + { + 69, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, 352, -199, -199, -199, -199, -199, -199, 353, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199 + + }, + + { + 69, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, 354, -200, + -200, -200, -200, -200, -200, -200, -200, -200, 355, -200, + 356, -200, 357, 358, 359, 360, -200, -200, -200, -200, + 361, -200, -200, -200, -200, -200, -200, -200, -200, -200, + + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200 + }, + + { + 69, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + + -201, -201, -201, -201, -201, -201, 362, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201 + }, + + { + 69, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, 363, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202 + }, + + { + 69, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, 364, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203 + }, + + { + 69, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, 365, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + + -204, -204, -204, 366, -204, -204, 367, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204 + }, + + { + 69, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, 368, 369, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + 370, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205 + }, + + { + 69, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, 371, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206 + }, + + { + 69, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207 + }, + + { + 69, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + + -208, -208, -208, -208, -208, -208, -208, 372, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208 + }, + + { + 69, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, 373, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209 + + }, + + { + 69, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, 374, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210 + }, + + { + 69, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + + -211, -211, -211, -211, -211, -211, -211, -211, -211, 375, + -211, -211, -211, -211, -211, -211, -211, -211, -211, 376, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211 + }, + + { + 69, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, 377, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, 378, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212 + }, + + { + 69, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, 379, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213 + }, + + { + 69, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, 380, + + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214 + }, + + { + 69, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, 381, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215 + }, + + { + 69, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, 382, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, 383, 384, + 384, 384, 384, 384, 384, 384, 384, 384, -216, -216, + -216, -216, -216, -216, -216, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216 + }, + + { + 69, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, 385, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, -217, -217, + -217, -217, -217, -217, -217, 385, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + + 385, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217 + }, + + { + 69, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, 386, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218 + }, + + { + 69, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + + -219, -219, 387, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, -219, -219, + -219, -219, -219, -219, -219, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219 + + }, + + { + 69, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, 388, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220 + }, + + { + 69, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, 389, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, -221, -221, + -221, -221, -221, -221, -221, 389, 389, 389, 389, 389, + + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 389, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221 + }, + + { + 69, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, 391, -222, -222, -222, -222, -222, -222, -222, + + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222 + }, + + { + 69, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, 392, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, 393, 393, + 393, 393, 393, 393, 393, 393, 393, 393, -223, -223, + -223, -223, -223, -223, -223, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, + 394, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223 + }, + + { + 69, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, 395, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224 + }, + + { + 69, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, 396, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225 + }, + + { + 69, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, 397, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, 398, 398, + 398, 398, 398, 398, 398, 398, 398, 398, -226, -226, + -226, -226, -226, -226, -226, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, + 397, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226 + }, + + { + 69, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, 399, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227 + }, + + { + 69, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, 400, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, 401, 401, + 401, 401, 401, 401, 401, 401, 401, 401, -228, -228, + + -228, -228, -228, -228, -228, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228 + }, + + { + 69, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + + -229, -229, 403, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229 + + }, + + { + 69, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230 + }, + + { + 69, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, 405, -231, -231, 406, 407, + 407, 407, 407, 407, 407, 407, 407, 407, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, 408, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231 + }, + + { + 69, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + + -232, -232, -232, -232, -232, 405, -232, -232, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, 410, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232 + }, + + { + 69, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, 411, 411, + 411, 411, 411, 411, 411, 411, 411, 411, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233 + }, + + { + 69, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, 405, -234, -234, 412, 412, + 412, 412, 412, 412, 412, 412, 412, 412, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, 413, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234 + }, + + { + 69, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, 414, 415, + + 415, 415, 415, 415, 415, 415, 415, 415, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235 + }, + + { + 69, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, 416, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236 + }, + + { + 69, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, 417, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, -237, -237, + -237, -237, -237, -237, -237, 417, 417, 417, 417, 417, + 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, + 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, + + 417, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237 + }, + + { + 69, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, 419, 419, + 419, 419, 419, 419, 419, 419, 419, 419, -238, -238, + + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, 420, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238 + }, + + { + 69, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, 421, + 421, 421, 421, 421, 421, 421, 421, 421, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239 + + }, + + { + 69, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, 422, 422, + 422, 422, 422, 422, 422, 422, 422, 422, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, 423, -240, -240, -240, -240, + + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240 + }, + + { + 69, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, 424, + 424, 424, 424, 424, 424, 424, 424, 424, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241 + }, + + { + 69, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, 425, -242, -242, -242, -242, -242, -242, -242, + + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242 + }, + + { + 69, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, 426, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 427, -243, -243, + -243, -243, -243, -243, -243, 426, 426, 426, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, + 426, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243 + }, + + { + 69, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, 428, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244 + }, + + { + 69, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, 429, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, 430, 430, + + 430, 430, 430, 430, 430, 430, 430, 430, -245, -245, + -245, -245, -245, -245, -245, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, + 431, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245 + }, + + { + 69, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, 432, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246 + }, + + { + 69, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, 433, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247 + }, + + { + 69, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, 434, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, 435, 435, + 435, 435, 435, 435, 435, 435, 435, 435, -248, -248, + + -248, -248, -248, -248, -248, 436, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, + 436, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248 + }, + + { + 69, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + + -249, -249, 437, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249 + + }, + + { + 69, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, 438, 438, + 438, 438, 438, 438, 438, 438, 438, 438, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250 + }, + + { + 69, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, 439, -251, -251, 440, 441, + 441, 441, 441, 441, 441, 441, 441, 441, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, 442, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251 + }, + + { + 69, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + + -252, -252, -252, -252, -252, 439, -252, -252, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, 444, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252 + }, + + { + 69, -253, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, 445, 445, + 445, 445, 445, 445, 445, 445, 445, 445, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253 + }, + + { + 69, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, 439, -254, -254, 446, 446, + 446, 446, 446, 446, 446, 446, 446, 446, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, 447, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254 + }, + + { + 69, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, 448, 449, + + 449, 449, 449, 449, 449, 449, 449, 449, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255 + }, + + { + 69, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, 451, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256 + }, + + { + 69, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, 452, 453, + 453, 453, 453, 453, 453, 453, 453, 453, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257 + }, + + { + 69, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, 454, 454, + 454, 454, 454, 454, 454, 454, 454, 454, -258, -258, + + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, 455, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258 + }, + + { + 69, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, 456, 457, + 457, 457, 457, 457, 457, 457, 457, 457, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259 + + }, + + { + 69, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, 459, -260, -260, -260, -260, + + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260 + }, + + { + 69, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, 460, 461, + 461, 461, 461, 461, 461, 461, 461, 461, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261 + }, + + { + 69, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + + -262, -262, -262, -262, -262, -262, -262, -262, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, 463, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262 + }, + + { + 69, -263, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, 464, 465, + 465, 465, 465, 465, 465, 465, 465, 465, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263 + }, + + { + 69, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, 466, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264 + }, + + { + 69, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, 467, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, 468, 468, + + 468, 468, 468, 468, 468, 468, 468, 468, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265 + }, + + { + 69, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, 469, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266 + }, + + { + 69, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, 470, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, 471, 471, + 471, 471, 471, 471, 471, 471, 471, 471, -267, -267, + -267, -267, -267, -267, -267, 470, 470, 470, 470, 470, + 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, + 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, + + 470, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267 + }, + + { + 69, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, 472, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268 + }, + + { + 69, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + + -269, -269, 473, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, 474, 474, + 474, 474, 474, 474, 474, 474, 474, 474, -269, -269, + -269, -269, -269, -269, -269, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269 + + }, + + { + 69, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, 475, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270 + }, + + { + 69, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, 476, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, 477, 477, + 477, 477, 477, 477, 477, 477, 477, 477, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271 + }, + + { + 69, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, 478, -272, -272, -272, -272, -272, -272, -272, + + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272 + }, + + { + 69, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, 479, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, 480, 480, + 480, 480, 480, 480, 480, 480, 480, 480, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273 + }, + + { + 69, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, 274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274 + }, + + { + 69, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, 275, 275, + + 275, 275, 275, 275, 275, 275, 275, 275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275 + }, + + { + 69, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276 + }, + + { + 69, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, 279, -277, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, 281, 281, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + 281, 281, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277 + }, + + { + 69, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, -278, -278, + + -278, -278, -278, -278, -278, -278, -278, -278, 281, 281, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + 281, 281, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278 + }, + + { + 69, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, 281, 281, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + 281, 281, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279 + + }, + + { + 69, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, 279, -280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, 281, 281, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + + 281, 281, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280 + }, + + { + 69, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, 482, -281, 482, -281, -281, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281 + }, + + { + 69, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + + -282, -282, -282, -282, -282, -282, -282, -282, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282 + }, + + { + 69, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, 285, -283, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, 287, 287, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + 287, 287, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283 + }, + + { + 69, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, 287, 287, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + 287, 287, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284 + }, + + { + 69, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, 484, 484, + + 484, 484, 484, 484, 484, 484, 484, 484, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, 287, 287, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + 287, 287, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285 + }, + + { + 69, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, 285, -286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, 287, 287, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + 287, 287, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286 + }, + + { + 69, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, 485, -287, 485, -287, -287, 486, 486, + 486, 486, 486, 486, 486, 486, 486, 486, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287 + }, + + { + 69, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 289, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288 + }, + + { + 69, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + + -289, -289, -289, -289, -289, -289, -289, -289, -289, 288, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289 + + }, + + { + 69, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 291, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 292, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 293, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 290, 290 + }, + + { + 69, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291 + }, + + { + 69, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 291, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 292, 487, 487, 487, 487, 487, 487, 487, + + 487, 487, 487, 487, 487, 487, 487, 293, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487 + }, + + { + 69, 488, 488, 488, 488, 488, 488, 488, 488, 488, + + 489, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 490, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 491, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488 + }, + + { + 69, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 493, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 494, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 495, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492 + }, + + { + 69, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295 + }, + + { + 69, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 497, 496, 496, 496, 496, 496, 496, 496, 496, 496, + + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 498, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 499, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + + 496, 496, 496, 496, 496, 496, 496, 496 + }, + + { + 69, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 299, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 300, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 301, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298 + }, + + { + 69, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 299, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 300, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 301, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298 + }, + + { + 69, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299 + + }, + + { + 69, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 299, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 300, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 301, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298 + }, + + { + 69, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 299, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 300, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 301, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298 + }, + + { + 69, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 303, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 302, 302, 302, 302 + }, + + { + 69, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303 + }, + + { + 69, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 305, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, + 304, 304, 304, 304, 304, 304, 304, 304 + }, + + { + 69, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305 + }, + + { + 69, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 307, 306, 306, 306, 306, 306, 306, 306, 306, 306, + + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + + 306, 306, 306, 306, 306, 306, 306, 306 + }, + + { + 69, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307 + }, + + { + 69, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + + -308, -308, -308, -308, -308, -308, -308, -308, 500, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308 + }, + + { + 69, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, 501, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309 + + }, + + { + 69, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, 502, + -310, -310, -310, -310, -310, -310, 503, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310 + }, + + { + 69, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, 504, -311, -311, -311, -311, + + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311 + }, + + { + 69, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, 505, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, 506, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312 + }, + + { + 69, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, 507, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, 508, + 509, -313, -313, -313, -313, -313, 510, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313 + }, + + { + 69, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + + -314, -314, -314, -314, -314, -314, -314, -314, -314, 511, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314 + }, + + { + 69, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, 512, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315 + }, + + { + 69, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, 513, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316 + }, + + { + 69, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + 514, -317, -317, -317, -317, -317, -317, -317, -317, -317, + + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317 + }, + + { + 69, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318 + }, + + { + 69, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319 + + }, + + { + 69, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, 515, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320 + }, + + { + 69, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + + -321, -321, -321, -321, -321, -321, 516, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321 + }, + + { + 69, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, 517, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322 + }, + + { + 69, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, 518, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323 + }, + + { + 69, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, 519, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324 + }, + + { + 69, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, 520, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325 + }, + + { + 69, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, 521, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326 + }, + + { + 69, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, 522, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327 + }, + + { + 69, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + + -328, -328, -328, -328, -328, -328, -328, -328, -328, 523, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328 + }, + + { + 69, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + 524, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329 + + }, + + { + 69, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, 525, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330 + }, + + { + 69, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + + -331, -331, 526, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331 + }, + + { + 69, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, 527, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332 + }, + + { + 69, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, 528, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333 + }, + + { + 69, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + + -334, -334, -334, 529, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334 + }, + + { + 69, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, 530, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335 + }, + + { + 69, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, 531, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336 + }, + + { + 69, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, 532, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337 + }, + + { + 69, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + + -338, -338, -338, -338, -338, -338, -338, -338, -338, 533, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338 + }, + + { + 69, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, 534, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339 + + }, + + { + 69, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + 535, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340 + }, + + { + 69, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + 536, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341 + }, + + { + 69, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + + -342, -342, -342, -342, -342, 537, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, 538, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, 539, + -342, -342, 540, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342 + }, + + { + 69, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, 541, -343, -343, -343, -343, -343, -343, -343, 542, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343 + }, + + { + 69, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + + 543, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344 + }, + + { + 69, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, 544, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345 + }, + + { + 69, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, 545, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346 + }, + + { + 69, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, 546, -347, -347, -347, -347, -347, + + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347 + }, + + { + 69, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, 547, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348 + }, + + { + 69, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, 548, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349 + + }, + + { + 69, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, 549, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350 + }, + + { + 69, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, 550, -351, -351, + + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351 + }, + + { + 69, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, 551, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352 + }, + + { + 69, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, 552, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353 + }, + + { + 69, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, 553, + -354, -354, -354, -354, -354, -354, 554, -354, -354, -354, + + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354 + }, + + { + 69, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, 555, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355 + }, + + { + 69, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, 556, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, 557, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356 + }, + + { + 69, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, 558, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, 559, + 560, -357, -357, -357, -357, -357, 561, -357, -357, -357, + + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357 + }, + + { + 69, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, 562, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358 + }, + + { + 69, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, 563, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359 + + }, + + { + 69, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, 564, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360 + }, + + { + 69, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + 565, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361 + }, + + { + 69, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, 566, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362 + }, + + { + 69, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, 567, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363 + }, + + { + 69, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, 568, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + + -364, -364, 569, 570, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364 + }, + + { + 69, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365 + }, + + { + 69, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366 + }, + + { + 69, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367 + }, + + { + 69, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, 571, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368 + }, + + { + 69, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + 572, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369 + + }, + + { + 69, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, 573, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370 + }, + + { + 69, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, 574, -371, -371, -371, -371, + + -371, -371, -371, -371, -371, -371, -371, -371, -371, 575, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371 + }, + + { + 69, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, 576, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372 + }, + + { + 69, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, 577, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373 + }, + + { + 69, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, 578, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, 579, + + -374, -374, 580, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374 + }, + + { + 69, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, 581, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375 + }, + + { + 69, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, 582, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376 + }, + + { + 69, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, 583, -377, + + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377 + }, + + { + 69, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + + -378, -378, -378, -378, -378, 584, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, 585, -378, + -378, -378, -378, -378, 586, -378, -378, -378, 587, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378 + }, + + { + 69, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, 588, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379 + + }, + + { + 69, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, 589, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380 + }, + + { + 69, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381 + }, + + { + 69, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382, -382, -382, + -382, -382, -382, -382, -382, -382, -382, -382 + }, + + { + 69, -383, -383, -383, -383, -383, -383, -383, -383, -383, + + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + + -383, -383, -383, -383, -383, -383, -383, -383, -383, -383, + -383, -383, -383, -383, -383, -383, -383, -383 + }, + + { + 69, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384 + }, + + { + 69, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385, -385, -385, + -385, -385, -385, -385, -385, -385, -385, -385 + }, + + { + 69, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + + -386, -386, -386, -386, -386, -386, -386, -386 + }, + + { + 69, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387 + }, + + { + 69, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, 590, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388 + }, + + { + 69, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + + -389, -389, 591, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389, -389, -389, + -389, -389, -389, -389, -389, -389, -389, -389 + + }, + + { + 69, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, 592, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, 592, 592, 592, 592, 592, + 592, 592, 592, 592, 592, 592, 592, 592, 592, 592, + 592, 592, 592, 592, 592, 592, 592, 592, 592, 592, + 592, -390, -390, -390, -390, -390, -390, -390, -390, -390, + + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390, -390, -390, + -390, -390, -390, -390, -390, -390, -390, -390 + }, + + { + 69, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391, -391, -391, + -391, -391, -391, -391, -391, -391, -391, -391 + }, + + { + 69, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392 + }, + + { + 69, -393, -393, -393, -393, -393, -393, -393, -393, -393, + + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393 + }, + + { + 69, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394 + }, + + { + 69, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395 + }, + + { + 69, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, 593, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396 + }, + + { + 69, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, 594, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397 + }, + + { + 69, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, 595, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + + -398, -398, -398, -398, -398, 595, 595, 595, 595, 595, + 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, + 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, + 595, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398 + }, + + { + 69, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399 + + }, + + { + 69, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400 + }, + + { + 69, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401 + }, + + { + 69, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402 + }, + + { + 69, -403, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403 + }, + + { + 69, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, 596, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, 597, 597, + 597, 597, 597, 597, 597, 597, 597, 597, -404, -404, + -404, -404, -404, -404, -404, 596, 596, 596, 596, 596, + 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, + + 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, + 596, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404 + }, + + { + 69, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, 598, 598, + + 598, 598, 598, 598, 598, 598, 598, 598, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405 + }, + + { + 69, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, 599, -406, -406, 600, 601, + 601, 601, 601, 601, 601, 601, 601, 601, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, 602, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406 + }, + + { + 69, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, 599, -407, -407, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + + -407, -407, -407, -407, -407, 604, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407 + }, + + { + 69, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, 605, 605, + 605, 605, 605, 605, 605, 605, 605, 605, -408, -408, + + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408 + }, + + { + 69, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, 599, -409, -409, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, 606, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409 + + }, + + { + 69, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, 607, 608, + 608, 608, 608, 608, 608, 608, 608, 608, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410 + }, + + { + 69, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, 609, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, 610, 610, + 610, 610, 610, 610, 610, 610, 610, 610, -411, -411, + -411, -411, -411, -411, -411, 609, 609, 609, 609, 609, + + 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, + 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, + 609, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411 + }, + + { + 69, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + + -412, -412, -412, -412, -412, 599, -412, -412, 600, 600, + 600, 600, 600, 600, 600, 600, 600, 600, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, 602, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412 + }, + + { + 69, -413, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, 611, 612, + 612, 612, 612, 612, 612, 612, 612, 612, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413 + }, + + { + 69, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, 609, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, 613, 614, + 614, 614, 614, 614, 614, 614, 614, 614, -414, -414, + -414, -414, -414, -414, -414, 609, 609, 609, 609, 609, + 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, + + 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, + 609, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414 + }, + + { + 69, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, 615, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, 616, 616, + + 616, 616, 616, 616, 616, 616, 616, 616, -415, -415, + -415, -415, -415, -415, -415, 615, 615, 615, 615, 615, + 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + 615, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415 + }, + + { + 69, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, 617, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416 + }, + + { + 69, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, 618, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417 + }, + + { + 69, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, 619, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + + -418, -418, -418, -418, -418, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418 + }, + + { + 69, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, 620, 620, + 620, 620, 620, 620, 620, 620, 620, 620, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, 621, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419 + + }, + + { + 69, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, 622, + 622, 622, 622, 622, 622, 622, 622, 622, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420 + }, + + { + 69, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, 623, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, 624, 624, + 624, 624, 624, 624, 624, 624, 624, 624, -421, -421, + -421, -421, -421, -421, -421, 623, 623, 623, 623, 623, + + 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, + 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, + 623, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421 + }, + + { + 69, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, 625, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422 + }, + + { + 69, -423, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, 626, + 626, 626, 626, 626, 626, 626, 626, 626, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423 + }, + + { + 69, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, 627, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, -424, -424, + -424, -424, -424, -424, -424, 627, 627, 627, 627, 627, + 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, + + 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, + 627, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424 + }, + + { + 69, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425 + }, + + { + 69, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426 + }, + + { + 69, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427 + }, + + { + 69, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428 + }, + + { + 69, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429 + + }, + + { + 69, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430 + }, + + { + 69, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431 + }, + + { + 69, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432 + }, + + { + 69, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433 + }, + + { + 69, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434 + }, + + { + 69, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435 + }, + + { + 69, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436 + }, + + { + 69, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437 + }, + + { + 69, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, 629, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, 630, 630, + 630, 630, 630, 630, 630, 630, 630, 630, -438, -438, + + -438, -438, -438, -438, -438, 629, 629, 629, 629, 629, + 629, 629, 629, 629, 629, 629, 629, 629, 629, 629, + 629, 629, 629, 629, 629, 629, 629, 629, 629, 629, + 629, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438 + }, + + { + 69, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, 631, 631, + 631, 631, 631, 631, 631, 631, 631, 631, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439 + + }, + + { + 69, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, 632, -440, -440, 633, 634, + 634, 634, 634, 634, 634, 634, 634, 634, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, 635, -440, -440, -440, -440, + + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440 + }, + + { + 69, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, 632, -441, -441, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, 637, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441 + }, + + { + 69, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + + -442, -442, -442, -442, -442, -442, -442, -442, 638, 638, + 638, 638, 638, 638, 638, 638, 638, 638, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442 + }, + + { + 69, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, 632, -443, -443, 633, 633, + 633, 633, 633, 633, 633, 633, 633, 633, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, 639, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443 + }, + + { + 69, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, 640, 641, + 641, 641, 641, 641, 641, 641, 641, 641, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444 + }, + + { + 69, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, 642, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, 643, 643, + + 643, 643, 643, 643, 643, 643, 643, 643, -445, -445, + -445, -445, -445, -445, -445, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445 + }, + + { + 69, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, 632, -446, -446, 633, 633, + 633, 633, 633, 633, 633, 633, 633, 633, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, 635, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446 + }, + + { + 69, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, 644, 645, + 645, 645, 645, 645, 645, 645, 645, 645, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447 + }, + + { + 69, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, 646, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, 647, 648, + 648, 648, 648, 648, 648, 648, 648, 648, -448, -448, + + -448, -448, -448, -448, -448, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448 + }, + + { + 69, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + + -449, -449, 646, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, -449, -449, + -449, -449, -449, -449, -449, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449 + + }, + + { + 69, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, 650, 650, + 650, 650, 650, 650, 650, 650, 650, 650, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, 651, -450, -450, -450, -450, + + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450 + }, + + { + 69, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, 652, 653, + 653, 653, 653, 653, 653, 653, 653, 653, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451 + }, + + { + 69, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, 654, -452, -452, -452, -452, -452, -452, -452, + + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 654, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452 + }, + + { + 69, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, 654, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, -453, -453, + -453, -453, -453, -453, -453, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 654, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453 + }, + + { + 69, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, 656, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454 + }, + + { + 69, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, 657, 658, + + 658, 658, 658, 658, 658, 658, 658, 658, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455 + }, + + { + 69, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, 659, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456 + }, + + { + 69, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, 659, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, -457, -457, + -457, -457, -457, -457, -457, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457 + }, + + { + 69, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, 661, 661, + 661, 661, 661, 661, 661, 661, 661, 661, -458, -458, + + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, 662, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458 + }, + + { + 69, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, 663, 664, + 664, 664, 664, 664, 664, 664, 664, 664, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459 + + }, + + { + 69, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, 665, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, 665, 665, 665, 665, 665, + 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, + 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, + 665, -460, -460, -460, -460, -460, -460, -460, -460, -460, + + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460 + }, + + { + 69, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, 665, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, 666, 666, + 666, 666, 666, 666, 666, 666, 666, 666, -461, -461, + -461, -461, -461, -461, -461, 665, 665, 665, 665, 665, + + 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, + 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, + 665, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461 + }, + + { + 69, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, 667, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462 + }, + + { + 69, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, 668, 669, + 669, 669, 669, 669, 669, 669, 669, 669, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463 + }, + + { + 69, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, 670, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, 670, 670, 670, 670, 670, + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + 670, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464 + }, + + { + 69, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, 670, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, 671, 671, + + 671, 671, 671, 671, 671, 671, 671, 671, -465, -465, + -465, -465, -465, -465, -465, 670, 670, 670, 670, 670, + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + 670, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465 + }, + + { + 69, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466 + }, + + { + 69, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467 + }, + + { + 69, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468 + }, + + { + 69, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + + -469, -469, 672, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469 + + }, + + { + 69, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, 673, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470 + }, + + { + 69, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, 674, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, 674, 674, 674, 674, 674, + + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471 + }, + + { + 69, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472 + }, + + { + 69, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473 + }, + + { + 69, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474 + }, + + { + 69, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, 675, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475 + }, + + { + 69, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 676, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476 + }, + + { + 69, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, 677, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, 678, 678, + 678, 678, 678, 678, 678, 678, 678, 678, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477 + }, + + { + 69, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478 + }, + + { + 69, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479 + + }, + + { + 69, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480 + }, + + { + 69, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, 281, 281, + + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + 281, 281, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481 + }, + + { + 69, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + + -482, -482, -482, -482, -482, -482, -482, -482, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482 + }, + + { + 69, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483 + }, + + { + 69, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, 484, 484, + 484, 484, 484, 484, 484, 484, 484, 484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, 287, 287, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + 287, 287, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484 + }, + + { + 69, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, 486, 486, + + 486, 486, 486, 486, 486, 486, 486, 486, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485 + }, + + { + 69, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, 486, 486, + 486, 486, 486, 486, 486, 486, 486, 486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486 + }, + + { + 69, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 679, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 680, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 681, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487 + }, + + { + 69, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 489, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 490, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 491, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488 + }, + + { + 69, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489 + + }, + + { + 69, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 489, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 490, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 491, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488 + }, + + { + 69, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 489, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 490, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 491, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488 + }, + + { + 69, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 493, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 494, 492, 492, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 495, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492 + }, + + { + 69, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493 + }, + + { + 69, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 493, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 494, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 495, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492 + }, + + { + 69, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 683, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 684, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 685, 682, 682, + + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682 + }, + + { + 69, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 493, 492, 492, 492, 492, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 494, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 495, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 492 + }, + + { + 69, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497 + }, + + { + 69, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 497, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 498, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 499, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496 + }, + + { + 69, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 687, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 688, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 689, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686 + + }, + + { + 69, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500 + }, + + { + 69, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501 + }, + + { + 69, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502 + }, + + { + 69, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, 690, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503 + }, + + { + 69, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, 691, -504, -504, + + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504 + }, + + { + 69, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, 692, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505 + }, + + { + 69, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506 + }, + + { + 69, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, 693, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507 + }, + + { + 69, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, 694, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508 + }, + + { + 69, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, 695, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509 + + }, + + { + 69, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, 696, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510 + }, + + { + 69, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, 697, + + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511 + }, + + { + 69, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + 698, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512 + }, + + { + 69, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, 699, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513 + }, + + { + 69, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, 700, -514, -514, -514, -514, -514, -514, -514, + + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514 + }, + + { + 69, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, 701, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515 + }, + + { + 69, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, 702, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516 + }, + + { + 69, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, 703, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517 + }, + + { + 69, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, 704, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518 + }, + + { + 69, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, 705, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519, -519, -519, + -519, -519, -519, -519, -519, -519, -519, -519 + + }, + + { + 69, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, 706, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520 + }, + + { + 69, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, 707, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521 + }, + + { + 69, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, 708, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522, -522, -522, + -522, -522, -522, -522, -522, -522, -522, -522 + }, + + { + 69, -523, -523, -523, -523, -523, -523, -523, -523, -523, + + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, 709, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + + -523, -523, -523, -523, -523, -523, -523, -523, -523, -523, + -523, -523, -523, -523, -523, -523, -523, -523 + }, + + { + 69, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, 710, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524 + }, + + { + 69, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, 711, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525 + }, + + { + 69, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, 712, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + + -526, -526, -526, -526, -526, -526, -526, -526 + }, + + { + 69, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, 713, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, 714, -527, -527, -527, -527, -527, -527, -527, + + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527 + }, + + { + 69, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528, -528, -528, + -528, -528, -528, -528, -528, -528, -528, -528 + }, + + { + 69, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, 715, + 715, 715, 715, 715, 715, 715, 715, 715, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529 + + }, + + { + 69, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, 716, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530, -530, -530, + -530, -530, -530, -530, -530, -530, -530, -530 + }, + + { + 69, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + + -531, -531, 717, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531, -531, -531, + -531, -531, -531, -531, -531, -531, -531, -531 + }, + + { + 69, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, 718, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532 + }, + + { + 69, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + 719, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533 + }, + + { + 69, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, 720, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534 + }, + + { + 69, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, 721, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535 + }, + + { + 69, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, 722, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536 + }, + + { + 69, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, 723, 724, -537, -537, 725, + -537, -537, -537, -537, -537, -537, -537, -537, -537, 726, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537 + }, + + { + 69, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538 + }, + + { + 69, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, 727, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539 + + }, + + { + 69, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, 728, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540 + }, + + { + 69, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, 729, -541, -541, 730, + + -541, -541, 731, -541, -541, -541, 732, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, 733, 734, + 735, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541 + }, + + { + 69, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, 736, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542 + }, + + { + 69, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, 737, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543 + }, + + { + 69, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + + 738, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544 + }, + + { + 69, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, 739, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, 740, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545 + }, + + { + 69, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + 741, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, 742, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546 + }, + + { + 69, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547 + }, + + { + 69, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548 + }, + + { + 69, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549 + + }, + + { + 69, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, 743, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550 + }, + + { + 69, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551 + }, + + { + 69, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, 744, + -552, -552, -552, 745, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552 + }, + + { + 69, -553, -553, -553, -553, -553, -553, -553, -553, -553, + + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553 + }, + + { + 69, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + + -554, -554, -554, -554, 746, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554 + }, + + { + 69, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, 747, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555 + }, + + { + 69, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, 748, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + + -556, -556, -556, -556, -556, -556, -556, -556 + }, + + { + 69, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557 + }, + + { + 69, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + + -558, -558, -558, -558, -558, -558, -558, -558, -558, 749, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558 + }, + + { + 69, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, 750, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559 + + }, + + { + 69, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, 751, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560 + }, + + { + 69, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + + -561, -561, -561, -561, -561, -561, 752, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561 + }, + + { + 69, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, 753, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562 + }, + + { + 69, -563, -563, -563, -563, -563, -563, -563, -563, -563, + + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + 754, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563 + }, + + { + 69, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, 755, -564, -564, -564, -564, -564, -564, + + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564 + }, + + { + 69, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, 756, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565 + }, + + { + 69, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + 757, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + + -566, -566, -566, -566, -566, -566, -566, -566 + }, + + { + 69, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, 758, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567 + }, + + { + 69, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + + -568, -568, -568, -568, -568, -568, -568, -568, 759, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, 760, + 761, -568, -568, 762, -568, 763, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568 + }, + + { + 69, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, 764, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569 + + }, + + { + 69, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, 765, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570 + }, + + { + 69, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, 766, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571 + }, + + { + 69, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, 767, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + 768, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572 + }, + + { + 69, -573, -573, -573, -573, -573, -573, -573, -573, -573, + + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, 769, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573 + }, + + { + 69, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + + -574, -574, 770, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574 + }, + + { + 69, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + 771, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575 + }, + + { + 69, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + + -576, -576, -576, -576, -576, -576, -576, -576 + }, + + { + 69, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577 + }, + + { + 69, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, 772, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578 + }, + + { + 69, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, 773, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579 + + }, + + { + 69, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, 774, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580 + }, + + { + 69, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, 775, + 775, 775, 775, 775, 775, 775, 775, 775, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, 776, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581 + }, + + { + 69, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582 + }, + + { + 69, -583, -583, -583, -583, -583, -583, -583, -583, -583, + + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, 777, + 777, 777, 777, 777, 777, 777, 777, 777, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583 + }, + + { + 69, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + + -584, -584, -584, -584, -584, -584, -584, -584, 778, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584 + }, + + { + 69, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, 779, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585 + }, + + { + 69, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, 780, + 780, 780, 780, 780, 780, 780, 780, 780, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + + -586, -586, -586, -586, -586, -586, -586, -586 + }, + + { + 69, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, 781, + 781, 781, 781, 781, 781, 781, 781, 781, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587 + }, + + { + 69, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, 782, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588 + }, + + { + 69, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, 783, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589 + + }, + + { + 69, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590 + }, + + { + 69, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591 + }, + + { + 69, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592 + }, + + { + 69, -593, -593, -593, -593, -593, -593, -593, -593, -593, + + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593 + }, + + { + 69, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594 + }, + + { + 69, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595 + }, + + { + 69, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, 784, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + + -596, -596, -596, -596, -596, -596, -596, -596 + }, + + { + 69, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, 785, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, -597, -597, + -597, -597, -597, -597, -597, 785, 785, 785, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, + + 785, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597 + }, + + { + 69, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, 787, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, 788, 788, + 788, 788, 788, 788, 788, 788, 788, 788, -598, -598, + + -598, -598, -598, -598, -598, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, + 787, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598 + }, + + { + 69, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, 789, 789, + 789, 789, 789, 789, 789, 789, 789, 789, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599 + + }, + + { + 69, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, 790, -600, -600, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, 792, -600, -600, -600, -600, + + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600 + }, + + { + 69, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, 790, -601, -601, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, 793, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601 + }, + + { + 69, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + + -602, -602, -602, -602, -602, -602, -602, -602, 794, 794, + 794, 794, 794, 794, 794, 794, 794, 794, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602 + }, + + { + 69, -603, -603, -603, -603, -603, -603, -603, -603, -603, + + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, 790, -603, -603, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, 795, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603 + }, + + { + 69, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, 796, 797, + 797, 797, 797, 797, 797, 797, 797, 797, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604 + }, + + { + 69, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, 798, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, 799, 799, + + 799, 799, 799, 799, 799, 799, 799, 799, -605, -605, + -605, -605, -605, -605, -605, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605 + }, + + { + 69, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, 800, 801, + 801, 801, 801, 801, 801, 801, 801, 801, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + + -606, -606, -606, -606, -606, -606, -606, -606 + }, + + { + 69, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, 798, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, 802, 803, + 803, 803, 803, 803, 803, 803, 803, 803, -607, -607, + -607, -607, -607, -607, -607, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + + 798, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607 + }, + + { + 69, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, 804, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, 805, 805, + 805, 805, 805, 805, 805, 805, 805, 805, -608, -608, + + -608, -608, -608, -608, -608, 804, 804, 804, 804, 804, + 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, + 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, + 804, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608 + }, + + { + 69, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + + -609, -609, 806, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609 + + }, + + { + 69, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, 807, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, 808, 808, + 808, 808, 808, 808, 808, 808, 808, 808, -610, -610, + -610, -610, -610, -610, -610, 807, 807, 807, 807, 807, + 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + 807, -610, -610, -610, -610, -610, -610, -610, -610, -610, + + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610 + }, + + { + 69, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, 798, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, 809, 810, + 810, 810, 810, 810, 810, 810, 810, 810, -611, -611, + -611, -611, -611, -611, -611, 798, 798, 798, 798, 798, + + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, + 798, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611 + }, + + { + 69, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, 811, -612, -612, -612, -612, -612, -612, -612, + + -612, -612, -612, -612, -612, -612, -612, -612, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, -612, -612, + -612, -612, -612, -612, -612, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612 + }, + + { + 69, -613, -613, -613, -613, -613, -613, -613, -613, -613, + + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, 807, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, 813, 814, + 814, 814, 814, 814, 814, 814, 814, 814, -613, -613, + -613, -613, -613, -613, -613, 807, 807, 807, 807, 807, + 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, + 807, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613 + }, + + { + 69, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, 815, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, 816, 816, + 816, 816, 816, 816, 816, 816, 816, 816, -614, -614, + -614, -614, -614, -614, -614, 815, 815, 815, 815, 815, + 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, + + 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, + 815, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614 + }, + + { + 69, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, 817, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615 + }, + + { + 69, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, 818, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, 808, 808, + 808, 808, 808, 808, 808, 808, 808, 808, -616, -616, + -616, -616, -616, -616, -616, 818, 818, 818, 818, 818, + 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + 818, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + + -616, -616, -616, -616, -616, -616, -616, -616 + }, + + { + 69, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617 + }, + + { + 69, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618 + }, + + { + 69, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619 + + }, + + { + 69, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, 819, -620, -620, -620, -620, + + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620 + }, + + { + 69, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, 820, + 820, 820, 820, 820, 820, 820, 820, 820, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621 + }, + + { + 69, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, 821, -622, -622, -622, -622, -622, -622, -622, + + -622, -622, -622, -622, -622, -622, -622, -622, 822, 822, + 822, 822, 822, 822, 822, 822, 822, 822, -622, -622, + -622, -622, -622, -622, -622, 821, 821, 821, 821, 821, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 821, 821, 821, 821, 821, 821, 821, 821, 821, + 821, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622 + }, + + { + 69, -623, -623, -623, -623, -623, -623, -623, -623, -623, + + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, 823, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623 + }, + + { + 69, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, 824, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, 825, 825, + 825, 825, 825, 825, 825, 825, 825, 825, -624, -624, + -624, -624, -624, -624, -624, 824, 824, 824, 824, 824, + 824, 824, 824, 824, 824, 824, 824, 824, 824, 824, + + 824, 824, 824, 824, 824, 824, 824, 824, 824, 824, + 824, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624 + }, + + { + 69, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, 826, + + 826, 826, 826, 826, 826, 826, 826, 826, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625 + }, + + { + 69, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, 827, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, 828, 828, + 828, 828, 828, 828, 828, 828, 828, 828, -626, -626, + -626, -626, -626, -626, -626, 827, 827, 827, 827, 827, + 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, + 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, + 827, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + + -626, -626, -626, -626, -626, -626, -626, -626 + }, + + { + 69, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, 829, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627 + }, + + { + 69, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, 830, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, 831, 831, + 831, 831, 831, 831, 831, 831, 831, 831, -628, -628, + + -628, -628, -628, -628, -628, 830, 830, 830, 830, 830, + 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, + 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, + 830, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628 + }, + + { + 69, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + + -629, -629, 832, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629 + + }, + + { + 69, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, 833, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, 834, 834, + 834, 834, 834, 834, 834, 834, 834, 834, -630, -630, + -630, -630, -630, -630, -630, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, -630, -630, -630, -630, -630, -630, -630, -630, -630, + + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630 + }, + + { + 69, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, 835, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, 836, 836, + 836, 836, 836, 836, 836, 836, 836, 836, -631, -631, + -631, -631, -631, -631, -631, 835, 835, 835, 835, 835, + + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631 + }, + + { + 69, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + + -632, -632, -632, -632, -632, -632, -632, -632, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632 + }, + + { + 69, -633, -633, -633, -633, -633, -633, -633, -633, -633, + + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, 838, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, 839, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633 + }, + + { + 69, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, 838, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, 840, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634 + }, + + { + 69, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, 841, 841, + + 841, 841, 841, 841, 841, 841, 841, 841, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635 + }, + + { + 69, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, 838, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, 842, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + + -636, -636, -636, -636, -636, -636, -636, -636 + }, + + { + 69, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, 843, 844, + 844, 844, 844, 844, 844, 844, 844, 844, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637 + }, + + { + 69, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, 845, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, -638, -638, + + -638, -638, -638, -638, -638, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, + 845, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638 + }, + + { + 69, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, 847, 848, + 848, 848, 848, 848, 848, 848, 848, 848, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639 + + }, + + { + 69, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, 849, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, 850, 851, + 851, 851, 851, 851, 851, 851, 851, 851, -640, -640, + -640, -640, -640, -640, -640, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, -640, -640, -640, -640, -640, -640, -640, -640, -640, + + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640 + }, + + { + 69, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, 849, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, -641, -641, + -641, -641, -641, -641, -641, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641 + }, + + { + 69, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, 853, -642, -642, -642, -642, -642, -642, -642, + + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642 + }, + + { + 69, -643, -643, -643, -643, -643, -643, -643, -643, -643, + + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, 854, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 855, -643, -643, + -643, -643, -643, -643, -643, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, + 854, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643 + }, + + { + 69, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, 856, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, 857, 858, + 858, 858, 858, 858, 858, 858, 858, 858, -644, -644, + -644, -644, -644, -644, -644, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + 856, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644 + }, + + { + 69, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, 856, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, 859, 859, + + 859, 859, 859, 859, 859, 859, 859, 859, -645, -645, + -645, -645, -645, -645, -645, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + 856, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645 + }, + + { + 69, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, 860, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + + -646, -646, -646, -646, -646, -646, -646, -646 + }, + + { + 69, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, 861, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, 862, 863, + 863, 863, 863, 863, 863, 863, 863, 863, -647, -647, + -647, -647, -647, -647, -647, 861, 861, 861, 861, 861, + 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, + 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, + + 861, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647 + }, + + { + 69, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, 861, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, 864, 864, + 864, 864, 864, 864, 864, 864, 864, 864, -648, -648, + + -648, -648, -648, -648, -648, 861, 861, 861, 861, 861, + 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, + 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, + 861, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648 + }, + + { + 69, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + + -649, -649, 865, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 855, -649, -649, + -649, -649, -649, -649, -649, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649 + + }, + + { + 69, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, 866, -650, -650, -650, -650, + + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650 + }, + + { + 69, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, 867, 868, + 868, 868, 868, 868, 868, 868, 868, 868, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651 + }, + + { + 69, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, 869, -652, -652, -652, -652, -652, -652, -652, + + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, + 869, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652 + }, + + { + 69, -653, -653, -653, -653, -653, -653, -653, -653, -653, + + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, 869, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, -653, -653, + -653, -653, -653, -653, -653, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, + 869, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653 + }, + + { + 69, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, 871, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654 + }, + + { + 69, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, 872, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, 873, 873, + + 873, 873, 873, 873, 873, 873, 873, 873, -655, -655, + -655, -655, -655, -655, -655, 872, 872, 872, 872, 872, + 872, 872, 872, 872, 872, 872, 872, 872, 872, 872, + 872, 872, 872, 872, 872, 872, 872, 872, 872, 872, + 872, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655 + }, + + { + 69, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + + -656, -656, -656, -656, -656, -656, -656, -656 + }, + + { + 69, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, 875, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, 875, 875, 875, 875, 875, + 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, + 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, + + 875, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657 + }, + + { + 69, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, 875, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, 876, 876, + 876, 876, 876, 876, 876, 876, 876, 876, -658, -658, + + -658, -658, -658, -658, -658, 875, 875, 875, 875, 875, + 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, + 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, + 875, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658 + }, + + { + 69, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + + -659, -659, 877, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659 + + }, + + { + 69, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, 878, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, -660, -660, + -660, -660, -660, -660, -660, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, -660, -660, -660, -660, -660, -660, -660, -660, -660, + + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660 + }, + + { + 69, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, 880, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661 + }, + + { + 69, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + + -662, -662, -662, -662, -662, -662, -662, -662, 881, 882, + 882, 882, 882, 882, 882, 882, 882, 882, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662 + }, + + { + 69, -663, -663, -663, -663, -663, -663, -663, -663, -663, + + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, 883, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, 883, 883, 883, 883, 883, + 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, + 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, + 883, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663 + }, + + { + 69, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, 883, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, 884, 884, + 884, 884, 884, 884, 884, 884, 884, 884, -664, -664, + -664, -664, -664, -664, -664, 883, 883, 883, 883, 883, + 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, + + 883, 883, 883, 883, 883, 883, 883, 883, 883, 883, + 883, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664 + }, + + { + 69, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, 885, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665 + }, + + { + 69, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, 886, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, 887, 887, + 887, 887, 887, 887, 887, 887, 887, 887, -666, -666, + -666, -666, -666, -666, -666, 886, 886, 886, 886, 886, + 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, + 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, + 886, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + + -666, -666, -666, -666, -666, -666, -666, -666 + }, + + { + 69, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, 888, 888, + 888, 888, 888, 888, 888, 888, 888, 888, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667 + }, + + { + 69, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, 889, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + + -668, -668, -668, -668, -668, 889, 889, 889, 889, 889, + 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, + 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, + 889, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668 + }, + + { + 69, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + + -669, -669, 889, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, 890, 890, + 890, 890, 890, 890, 890, 890, 890, 890, -669, -669, + -669, -669, -669, -669, -669, 889, 889, 889, 889, 889, + 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, + 889, 889, 889, 889, 889, 889, 889, 889, 889, 889, + 889, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669 + + }, + + { + 69, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, 891, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670 + }, + + { + 69, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, 892, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, -671, -671, + -671, -671, -671, -671, -671, 892, 892, 892, 892, 892, + + 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, + 892, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671 + }, + + { + 69, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672 + }, + + { + 69, -673, -673, -673, -673, -673, -673, -673, -673, -673, + + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673 + }, + + { + 69, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674 + }, + + { + 69, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675 + }, + + { + 69, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + + -676, -676, -676, -676, -676, -676, -676, -676 + }, + + { + 69, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677 + }, + + { + 69, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678 + }, + + { + 69, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679 + + }, + + { + 69, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 679, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 680, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 681, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487 + }, + + { + 69, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 895, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 896, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 897, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894 + }, + + { + 69, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 683, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 684, 682, 682, 682, 682, 682, 682, 682, + + 682, 682, 682, 682, 682, 682, 682, 685, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682 + }, + + { + 69, -683, -683, -683, -683, -683, -683, -683, -683, -683, + + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683 + }, + + { + 69, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 683, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 684, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 685, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682 + }, + + { + 69, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 683, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 684, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 685, 682, 682, + + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682 + }, + + { + 69, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 687, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 688, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 689, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686 + }, + + { + 69, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687 + }, + + { + 69, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 687, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 688, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 689, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686 + }, + + { + 69, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 687, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + + 686, 686, 688, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 689, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686 + + }, + + { + 69, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690 + }, + + { + 69, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691 + }, + + { + 69, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692 + }, + + { + 69, -693, -693, -693, -693, -693, -693, -693, -693, -693, + + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693 + }, + + { + 69, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694 + }, + + { + 69, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695, -695, -695, + -695, -695, -695, -695, -695, -695, -695, -695 + }, + + { + 69, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + -696, -696, -696, -696, -696, -696, -696, -696, -696, -696, + + -696, -696, -696, -696, -696, -696, -696, -696 + }, + + { + 69, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697 + }, + + { + 69, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698 + }, + + { + 69, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699 + + }, + + { + 69, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700 + }, + + { + 69, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + + -701, -701, 898, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701 + }, + + { + 69, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702 + }, + + { + 69, -703, -703, -703, -703, -703, -703, -703, -703, -703, + + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703 + }, + + { + 69, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704 + }, + + { + 69, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705 + }, + + { + 69, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + + -706, -706, -706, -706, -706, -706, -706, -706 + }, + + { + 69, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707 + }, + + { + 69, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708 + }, + + { + 69, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709 + + }, + + { + 69, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710 + }, + + { + 69, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711 + }, + + { + 69, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712 + }, + + { + 69, -713, -713, -713, -713, -713, -713, -713, -713, -713, + + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, 899, 900, -713, -713, 901, + -713, -713, -713, -713, -713, -713, -713, -713, -713, 902, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713 + }, + + { + 69, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, 903, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714 + }, + + { + 69, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, 904, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, 905, 905, + + 905, 905, 905, 905, 905, 905, 905, 905, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715 + }, + + { + 69, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, 906, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + + -716, -716, -716, -716, -716, -716, -716, -716 + }, + + { + 69, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, 907, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, 907, 907, 907, 907, 907, + 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, + 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, + + 907, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717 + }, + + { + 69, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, 908, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718 + }, + + { + 69, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + + -719, -719, 909, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + 910, -719, -719, 911, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719 + + }, + + { + 69, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, 912, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720 + }, + + { + 69, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + + -721, -721, -721, -721, -721, -721, 913, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721 + }, + + { + 69, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, 914, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722 + }, + + { + 69, -723, -723, -723, -723, -723, -723, -723, -723, -723, + + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, 915, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723 + }, + + { + 69, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, 916, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724 + }, + + { + 69, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, 917, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725 + }, + + { + 69, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, 918, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + + -726, -726, -726, -726, -726, -726, -726, -726 + }, + + { + 69, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727 + }, + + { + 69, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + 919, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728 + }, + + { + 69, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, 920, + 920, 920, 920, 920, 920, 920, 920, 920, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729 + + }, + + { + 69, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, 921, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730 + }, + + { + 69, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, 922, + 922, 922, 922, 922, 922, 922, 922, 922, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731 + }, + + { + 69, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + + -732, -732, -732, -732, -732, -732, -732, -732, -732, 923, + 923, 923, 923, 923, 923, 923, 923, 923, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732 + }, + + { + 69, -733, -733, -733, -733, -733, -733, -733, -733, -733, + + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733 + }, + + { + 69, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734 + }, + + { + 69, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735 + }, + + { + 69, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, 924, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + + -736, -736, -736, -736, -736, -736, -736, -736 + }, + + { + 69, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, 925, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737 + }, + + { + 69, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738 + }, + + { + 69, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, 926, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739 + + }, + + { + 69, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, 927, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740 + }, + + { + 69, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, 928, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741 + }, + + { + 69, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, 929, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742 + }, + + { + 69, -743, -743, -743, -743, -743, -743, -743, -743, -743, + + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, 930, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743 + }, + + { + 69, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, 931, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744 + }, + + { + 69, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, 932, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745 + }, + + { + 69, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + + -746, -746, -746, -746, -746, -746, -746, -746 + }, + + { + 69, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747 + }, + + { + 69, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748 + }, + + { + 69, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749 + + }, + + { + 69, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750 + }, + + { + 69, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751 + }, + + { + 69, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752 + }, + + { + 69, -753, -753, -753, -753, -753, -753, -753, -753, -753, + + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753 + }, + + { + 69, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754 + }, + + { + 69, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755 + }, + + { + 69, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + + -756, -756, -756, -756, -756, -756, -756, -756 + }, + + { + 69, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, 933, -757, -757, -757, -757, -757, -757, + + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757 + }, + + { + 69, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + + -758, -758, -758, -758, -758, -758, -758, -758, 934, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758 + }, + + { + 69, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, 935, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759 + + }, + + { + 69, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + 936, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760 + }, + + { + 69, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + + -761, -761, -761, 937, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761 + }, + + { + 69, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, 938, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762 + }, + + { + 69, -763, -763, -763, -763, -763, -763, -763, -763, -763, + + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, 939, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763 + }, + + { + 69, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, 940, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764 + }, + + { + 69, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, 941, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765 + }, + + { + 69, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + + -766, -766, -766, -766, -766, -766, -766, -766 + }, + + { + 69, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, 942, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767 + }, + + { + 69, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, 943, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768 + }, + + { + 69, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769 + + }, + + { + 69, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, 944, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770 + }, + + { + 69, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, 945, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771 + }, + + { + 69, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, 946, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772 + }, + + { + 69, -773, -773, -773, -773, -773, -773, -773, -773, -773, + + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, 947, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773 + }, + + { + 69, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + 948, -774, -774, -774, -774, -774, -774, -774, -774, -774, + + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774 + }, + + { + 69, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, 949, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, 950, 950, + + 950, 950, 950, 950, 950, 950, 950, 950, -775, -775, + -775, -775, -775, -775, -775, 949, 949, 949, 949, 949, + 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, + 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, + 949, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775 + }, + + { + 69, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, 951, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + + -776, -776, -776, -776, -776, -776, -776, -776 + }, + + { + 69, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, 952, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, 953, 953, + 953, 953, 953, 953, 953, 953, 953, 953, -777, -777, + -777, -777, -777, -777, -777, 952, 952, 952, 952, 952, + 952, 952, 952, 952, 952, 952, 952, 952, 952, 952, + 952, 952, 952, 952, 952, 952, 952, 952, 952, 952, + + 952, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777 + }, + + { + 69, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + + -778, -778, -778, -778, -778, -778, -778, -778, -778, 954, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778 + }, + + { + 69, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, 955, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779 + + }, + + { + 69, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, 956, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, 957, 957, + 957, 957, 957, 957, 957, 957, 957, 957, -780, -780, + -780, -780, -780, -780, -780, 956, 956, 956, 956, 956, + 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, + 956, 956, 956, 956, 956, 956, 956, 956, 956, 956, + 956, -780, -780, -780, -780, -780, -780, -780, -780, -780, + + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780 + }, + + { + 69, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, 958, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, -781, -781, + -781, -781, -781, -781, -781, 958, 958, 958, 958, 958, + + 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, + 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, + 958, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781 + }, + + { + 69, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, 960, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782 + }, + + { + 69, -783, -783, -783, -783, -783, -783, -783, -783, -783, + + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, 961, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783 + }, + + { + 69, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, 962, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784 + }, + + { + 69, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, 963, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785 + }, + + { + 69, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, 964, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, 965, 965, + 965, 965, 965, 965, 965, 965, 965, 965, -786, -786, + -786, -786, -786, -786, -786, 964, 964, 964, 964, 964, + 964, 964, 964, 964, 964, 964, 964, 964, 964, 964, + 964, 964, 964, 964, 964, 964, 964, 964, 964, 964, + 964, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + + -786, -786, -786, -786, -786, -786, -786, -786 + }, + + { + 69, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, 966, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787 + }, + + { + 69, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, 967, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, 968, 968, + 968, 968, 968, 968, 968, 968, 968, 968, -788, -788, + + -788, -788, -788, -788, -788, 967, 967, 967, 967, 967, + 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, + 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, + 967, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788 + }, + + { + 69, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + + -789, -789, 969, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, 970, 970, + 970, 970, 970, 970, 970, 970, 970, 970, -789, -789, + -789, -789, -789, -789, -789, 969, 969, 969, 969, 969, + 969, 969, 969, 969, 969, 969, 969, 969, 969, 969, + 969, 969, 969, 969, 969, 969, 969, 969, 969, 969, + 969, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789 + + }, + + { + 69, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, 971, 971, + 971, 971, 971, 971, 971, 971, 971, 971, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790 + }, + + { + 69, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, 972, 972, + 972, 972, 972, 972, 972, 972, 972, 972, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791 + }, + + { + 69, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + + -792, -792, -792, -792, -792, -792, -792, -792, 973, 973, + 973, 973, 973, 973, 973, 973, 973, 973, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792 + }, + + { + 69, -793, -793, -793, -793, -793, -793, -793, -793, -793, + + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, 973, 974, + 974, 974, 974, 974, 974, 974, 974, 974, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793 + }, + + { + 69, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, 975, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, 976, 976, + 976, 976, 976, 976, 976, 976, 976, 976, -794, -794, + -794, -794, -794, -794, -794, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + 975, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794 + }, + + { + 69, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, 973, 977, + + 977, 977, 977, 977, 977, 977, 977, 977, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795 + }, + + { + 69, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, 975, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, 976, 978, + 978, 978, 978, 978, 978, 978, 978, 978, -796, -796, + -796, -796, -796, -796, -796, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + 975, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + + -796, -796, -796, -796, -796, -796, -796, -796 + }, + + { + 69, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, 979, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, 980, 980, + 980, 980, 980, 980, 980, 980, 980, 980, -797, -797, + -797, -797, -797, -797, -797, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + + 979, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797 + }, + + { + 69, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, 981, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798 + }, + + { + 69, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + + -799, -799, 982, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, 983, 983, + 983, 983, 983, 983, 983, 983, 983, 983, -799, -799, + -799, -799, -799, -799, -799, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799 + + }, + + { + 69, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, 975, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, 976, 984, + 984, 984, 984, 984, 984, 984, 984, 984, -800, -800, + -800, -800, -800, -800, -800, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, + 975, -800, -800, -800, -800, -800, -800, -800, -800, -800, + + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800 + }, + + { + 69, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, 985, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, 986, 986, + 986, 986, 986, 986, 986, 986, 986, 986, -801, -801, + -801, -801, -801, -801, -801, 985, 985, 985, 985, 985, + + 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, + 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, + 985, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801 + }, + + { + 69, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, 982, -802, -802, -802, -802, -802, -802, -802, + + -802, -802, -802, -802, -802, -802, -802, -802, 983, 987, + 987, 987, 987, 987, 987, 987, 987, 987, -802, -802, + -802, -802, -802, -802, -802, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802 + }, + + { + 69, -803, -803, -803, -803, -803, -803, -803, -803, -803, + + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, 988, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, 989, 989, + 989, 989, 989, 989, 989, 989, 989, 989, -803, -803, + -803, -803, -803, -803, -803, 988, 988, 988, 988, 988, + 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, + 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, + 988, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803 + }, + + { + 69, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, 990, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804 + }, + + { + 69, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, 991, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, 983, 983, + + 983, 983, 983, 983, 983, 983, 983, 983, -805, -805, + -805, -805, -805, -805, -805, 991, 991, 991, 991, 991, + 991, 991, 991, 991, 991, 991, 991, 991, 991, 991, + 991, 991, 991, 991, 991, 991, 991, 991, 991, 991, + 991, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805 + }, + + { + 69, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, 992, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + + -806, -806, -806, -806, -806, -806, -806, -806 + }, + + { + 69, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, 993, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807 + }, + + { + 69, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, 994, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, 995, 995, + 995, 995, 995, 995, 995, 995, 995, 995, -808, -808, + + -808, -808, -808, -808, -808, 994, 994, 994, 994, 994, + 994, 994, 994, 994, 994, 994, 994, 994, 994, 994, + 994, 994, 994, 994, 994, 994, 994, 994, 994, 994, + 994, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808 + }, + + { + 69, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + + -809, -809, 982, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, 983, 996, + 996, 996, 996, 996, 996, 996, 996, 996, -809, -809, + -809, -809, -809, -809, -809, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, 982, 982, + 982, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809 + + }, + + { + 69, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, 997, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, 998, 998, + 998, 998, 998, 998, 998, 998, 998, 998, -810, -810, + -810, -810, -810, -810, -810, 997, 997, 997, 997, 997, + 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + 997, -810, -810, -810, -810, -810, -810, -810, -810, -810, + + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810 + }, + + { + 69, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, 999, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811 + }, + + { + 69, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, 1000, -812, -812, -812, -812, -812, -812, -812, + + -812, -812, -812, -812, -812, -812, -812, -812, 983, 983, + 983, 983, 983, 983, 983, 983, 983, 983, -812, -812, + -812, -812, -812, -812, -812, 1000, 1000, 1000, 1000, 1000, + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, + 1000, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812 + }, + + { + 69, -813, -813, -813, -813, -813, -813, -813, -813, -813, + + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, 994, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, 995, 1001, + 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, -813, -813, + -813, -813, -813, -813, -813, 994, 994, 994, 994, 994, + 994, 994, 994, 994, 994, 994, 994, 994, 994, 994, + 994, 994, 994, 994, 994, 994, 994, 994, 994, 994, + 994, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813 + }, + + { + 69, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, 1002, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, 1003, 1003, + 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, -814, -814, + -814, -814, -814, -814, -814, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + + 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814 + }, + + { + 69, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, 1004, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815 + }, + + { + 69, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, 1005, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, 995, 995, + 995, 995, 995, 995, 995, 995, 995, 995, -816, -816, + -816, -816, -816, -816, -816, 1005, 1005, 1005, 1005, 1005, + 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, + 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, + 1005, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + + -816, -816, -816, -816, -816, -816, -816, -816 + }, + + { + 69, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, 1006, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817 + }, + + { + 69, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, 1007, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818 + }, + + { + 69, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819 + + }, + + { + 69, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, 1009, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, 1010, 1010, + 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, -820, -820, + -820, -820, -820, -820, -820, 1009, 1009, 1009, 1009, 1009, + 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, + 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, + 1009, -820, -820, -820, -820, -820, -820, -820, -820, -820, + + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820 + }, + + { + 69, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, 1011, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821 + }, + + { + 69, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, 1012, -822, -822, -822, -822, -822, -822, -822, + + -822, -822, -822, -822, -822, -822, -822, -822, 1013, 1013, + 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, -822, -822, + -822, -822, -822, -822, -822, 1012, 1012, 1012, 1012, 1012, + 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, + 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, + 1012, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822 + }, + + { + 69, -823, -823, -823, -823, -823, -823, -823, -823, -823, + + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, 1014, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823 + }, + + { + 69, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, 1015, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824 + }, + + { + 69, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, 1016, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, 1017, 1017, + + 1017, 1017, 1017, 1017, 1017, 1017, 1017, 1017, -825, -825, + -825, -825, -825, -825, -825, 1016, 1016, 1016, 1016, 1016, + 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, + 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, + 1016, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825 + }, + + { + 69, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + + -826, -826, -826, -826, -826, -826, -826, -826 + }, + + { + 69, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827 + }, + + { + 69, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828 + }, + + { + 69, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829 + + }, + + { + 69, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830 + }, + + { + 69, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831 + }, + + { + 69, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, 1018, -832, -832, -832, -832, -832, -832, -832, + + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832 + }, + + { + 69, -833, -833, -833, -833, -833, -833, -833, -833, -833, + + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, 1019, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833 + }, + + { + 69, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, 1020, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, -834, -834, + -834, -834, -834, -834, -834, 1020, 1020, 1020, 1020, 1020, + 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, + + 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, + 1020, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834 + }, + + { + 69, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, 1022, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835 + }, + + { + 69, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, 1023, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, -836, -836, + -836, -836, -836, -836, -836, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, + 1023, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + + -836, -836, -836, -836, -836, -836, -836, -836 + }, + + { + 69, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, 1025, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, 1026, 1026, + 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026, -837, -837, + -837, -837, -837, -837, -837, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + + 1025, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837 + }, + + { + 69, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, 1027, 1027, + 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, -838, -838, + + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838 + }, + + { + 69, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, 1028, 1028, + 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839 + + }, + + { + 69, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840 + }, + + { + 69, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, 1030, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, 1031, 1031, + 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, -841, -841, + -841, -841, -841, -841, -841, 1030, 1030, 1030, 1030, 1030, + + 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, + 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, + 1030, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841 + }, + + { + 69, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + + -842, -842, -842, -842, -842, -842, -842, -842, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842 + }, + + { + 69, -843, -843, -843, -843, -843, -843, -843, -843, -843, + + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, 1033, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, 1034, 1034, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, -843, -843, + -843, -843, -843, -843, -843, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843 + }, + + { + 69, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, 1033, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, 1035, 1035, + 1035, 1035, 1035, 1035, 1035, 1035, 1035, 1035, -844, -844, + -844, -844, -844, -844, -844, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844 + }, + + { + 69, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, 1036, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845 + }, + + { + 69, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, 1037, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, 1038, 1038, + 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, -846, -846, + -846, -846, -846, -846, -846, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + + -846, -846, -846, -846, -846, -846, -846, -846 + }, + + { + 69, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, 1039, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, 1040, 1040, + 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, -847, -847, + -847, -847, -847, -847, -847, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + + 1039, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847 + }, + + { + 69, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, 1039, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, -848, -848, + + -848, -848, -848, -848, -848, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848 + }, + + { + 69, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + + -849, -849, 1042, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849 + + }, + + { + 69, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, 1043, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, -850, -850, + -850, -850, -850, -850, -850, 1043, 1043, 1043, 1043, 1043, + 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, + 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, + 1043, -850, -850, -850, -850, -850, -850, -850, -850, -850, + + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850 + }, + + { + 69, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, 1043, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, -851, -851, + -851, -851, -851, -851, -851, 1043, 1043, 1043, 1043, 1043, + + 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, + 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, + 1043, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851 + }, + + { + 69, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, 1046, -852, -852, -852, -852, -852, -852, -852, + + -852, -852, -852, -852, -852, -852, -852, -852, 1038, 1038, + 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, -852, -852, + -852, -852, -852, -852, -852, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852 + }, + + { + 69, -853, -853, -853, -853, -853, -853, -853, -853, -853, + + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, 1047, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853 + }, + + { + 69, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, 1048, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854 + }, + + { + 69, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, 1049, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, 1050, 1050, + + 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, -855, -855, + -855, -855, -855, -855, -855, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, + 1049, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855 + }, + + { + 69, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, 1051, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + + -856, -856, -856, -856, -856, -856, -856, -856 + }, + + { + 69, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, 1052, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, 1053, 1053, + 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, -857, -857, + -857, -857, -857, -857, -857, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + + 1052, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857 + }, + + { + 69, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, 1052, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, 1054, 1054, + 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, -858, -858, + + -858, -858, -858, -858, -858, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858 + }, + + { + 69, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + + -859, -859, 1055, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, 1038, 1038, + 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, -859, -859, + -859, -859, -859, -859, -859, 1055, 1055, 1055, 1055, 1055, + 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, + 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, + 1055, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859 + + }, + + { + 69, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, 1056, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860 + }, + + { + 69, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, 1057, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861 + }, + + { + 69, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, 1058, -862, -862, -862, -862, -862, -862, -862, + + -862, -862, -862, -862, -862, -862, -862, -862, 1059, 1059, + 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, -862, -862, + -862, -862, -862, -862, -862, 1058, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, + 1058, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862 + }, + + { + 69, -863, -863, -863, -863, -863, -863, -863, -863, -863, + + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, 1058, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, 1060, 1060, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, -863, -863, + -863, -863, -863, -863, -863, 1058, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, + 1058, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863 + }, + + { + 69, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, 1061, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, 1050, 1050, + 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, -864, -864, + -864, -864, -864, -864, -864, 1061, 1061, 1061, 1061, 1061, + 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, + + 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, + 1061, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864 + }, + + { + 69, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, 1062, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865 + }, + + { + 69, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + + -866, -866, -866, -866, -866, -866, -866, -866 + }, + + { + 69, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, 1064, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + + 1064, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867 + }, + + { + 69, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, 1064, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, 1065, 1065, + 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, -868, -868, + + -868, -868, -868, -868, -868, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868 + }, + + { + 69, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + + -869, -869, 1066, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869 + + }, + + { + 69, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, 1067, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, -870, -870, + -870, -870, -870, -870, -870, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, -870, -870, -870, -870, -870, -870, -870, -870, -870, + + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870 + }, + + { + 69, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, 1069, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871 + }, + + { + 69, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, 1070, -872, -872, -872, -872, -872, -872, -872, + + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872 + }, + + { + 69, -873, -873, -873, -873, -873, -873, -873, -873, -873, + + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, 1071, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, 1072, 1072, + 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, -873, -873, + -873, -873, -873, -873, -873, 1071, 1071, 1071, 1071, 1071, + 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, + 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, + 1071, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873 + }, + + { + 69, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874 + }, + + { + 69, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875 + }, + + { + 69, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + + -876, -876, -876, -876, -876, -876, -876, -876 + }, + + { + 69, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877 + }, + + { + 69, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878 + }, + + { + 69, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879 + + }, + + { + 69, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, 1073, 1073, + 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880 + }, + + { + 69, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, 1074, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, 1074, 1074, 1074, 1074, 1074, + + 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, + 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, + 1074, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881 + }, + + { + 69, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, 1074, -882, -882, -882, -882, -882, -882, -882, + + -882, -882, -882, -882, -882, -882, -882, -882, 1075, 1075, + 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, -882, -882, + -882, -882, -882, -882, -882, 1074, 1074, 1074, 1074, 1074, + 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, + 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, + 1074, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882 + }, + + { + 69, -883, -883, -883, -883, -883, -883, -883, -883, -883, + + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, 1076, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883 + }, + + { + 69, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, 1077, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, 1078, 1078, + 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, -884, -884, + -884, -884, -884, -884, -884, 1077, 1077, 1077, 1077, 1077, + 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, + + 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, + 1077, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884 + }, + + { + 69, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, 1079, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885 + }, + + { + 69, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, 1080, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + + -886, -886, -886, -886, -886, -886, -886, -886 + }, + + { + 69, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, 1081, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, 1082, 1082, + 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1082, -887, -887, + -887, -887, -887, -887, -887, 1081, 1081, 1081, 1081, 1081, + 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, + 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, + + 1081, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887 + }, + + { + 69, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888 + }, + + { + 69, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889 + + }, + + { + 69, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890 + }, + + { + 69, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891 + }, + + { + 69, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892 + }, + + { + 69, -893, -893, -893, -893, -893, -893, -893, -893, -893, + + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893 + }, + + { + 69, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 895, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 896, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 897, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894 + }, + + { + 69, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895 + }, + + { + 69, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 895, 894, 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 896, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 897, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894 + }, + + { + 69, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 895, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 896, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 897, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894 + }, + + { + 69, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, 1083, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898 + }, + + { + 69, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, 1084, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899 + + }, + + { + 69, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, 1085, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900 + }, + + { + 69, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + + -901, -901, -901, -901, -901, -901, -901, -901, 1086, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901 + }, + + { + 69, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, 1087, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902 + }, + + { + 69, -903, -903, -903, -903, -903, -903, -903, -903, -903, + + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + 1088, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903 + }, + + { + 69, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, 1089, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904 + }, + + { + 69, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, 1090, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, 1091, 1091, + + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905 + }, + + { + 69, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, 1092, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + + -906, -906, -906, -906, -906, -906, -906, -906 + }, + + { + 69, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, 1093, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907 + }, + + { + 69, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, 1094, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908 + }, + + { + 69, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + + -909, -909, 1095, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909 + + }, + + { + 69, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, 1096, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910 + }, + + { + 69, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, 1097, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911 + }, + + { + 69, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, 1098, -912, -912, -912, -912, -912, -912, -912, + + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912 + }, + + { + 69, -913, -913, -913, -913, -913, -913, -913, -913, -913, + + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, 1099, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913 + }, + + { + 69, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, 1100, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914 + }, + + { + 69, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, 1101, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915 + }, + + { + 69, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, 1102, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + + -916, -916, -916, -916, -916, -916, -916, -916 + }, + + { + 69, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, 1103, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917 + }, + + { + 69, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, 1104, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918 + }, + + { + 69, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + + -919, -919, 1105, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + 1106, -919, -919, 1107, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919 + + }, + + { + 69, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, 1108, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, 1109, 1109, + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920 + }, + + { + 69, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, 1110, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921 + }, + + { + 69, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, 1111, -922, -922, -922, -922, -922, -922, -922, + + -922, -922, -922, -922, -922, -922, -922, -922, 1112, 1112, + 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922 + }, + + { + 69, -923, -923, -923, -923, -923, -923, -923, -923, -923, + + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, 1113, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923 + }, + + { + 69, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, 1115, -924, -924, -924, -924, -924, -924, + + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924 + }, + + { + 69, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, 1116, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925 + }, + + { + 69, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, 1117, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + + -926, -926, -926, -926, -926, -926, -926, -926 + }, + + { + 69, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, 1118, -927, -927, -927, -927, -927, -927, + + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927 + }, + + { + 69, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + + -928, -928, -928, -928, -928, -928, -928, -928, -928, 1119, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, 1120, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928 + }, + + { + 69, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, 1121, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929 + + }, + + { + 69, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, 1122, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930 + }, + + { + 69, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, 1123, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931 + }, + + { + 69, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, 1124, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932 + }, + + { + 69, -933, -933, -933, -933, -933, -933, -933, -933, -933, + + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, 1125, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933 + }, + + { + 69, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + + -934, -934, -934, 1126, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934 + }, + + { + 69, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, 1127, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935 + }, + + { + 69, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + 1128, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + + -936, -936, -936, -936, -936, -936, -936, -936 + }, + + { + 69, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, 1129, -937, + + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937 + }, + + { + 69, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, 1130, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938 + }, + + { + 69, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, 1131, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939 + + }, + + { + 69, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, 1132, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940 + }, + + { + 69, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, 1133, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941 + }, + + { + 69, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, 1134, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942 + }, + + { + 69, -943, -943, -943, -943, -943, -943, -943, -943, -943, + + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, 1135, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943 + }, + + { + 69, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, 1136, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944 + }, + + { + 69, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, 1137, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945 + }, + + { + 69, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, 1138, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + + -946, -946, -946, -946, -946, -946, -946, -946 + }, + + { + 69, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, 1139, -947, -947, -947, -947, -947, -947, + + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947 + }, + + { + 69, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, 1140, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + + -948, -948, -948, -948, -948, 1140, 1140, 1140, 1140, 1140, + 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, + 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, + 1140, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948 + }, + + { + 69, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + + -949, -949, 1141, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949 + + }, + + { + 69, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, 1142, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, 1143, 1143, + 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, -950, -950, + -950, -950, -950, -950, -950, 1142, 1142, 1142, 1142, 1142, + 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, + 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, + 1142, -950, -950, -950, -950, -950, -950, -950, -950, -950, + + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950 + }, + + { + 69, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, 1144, + + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951 + }, + + { + 69, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, 1145, -952, -952, -952, -952, -952, -952, -952, + + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952 + }, + + { + 69, -953, -953, -953, -953, -953, -953, -953, -953, -953, + + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, 1146, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, 1147, 1147, + 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, -953, -953, + -953, -953, -953, -953, -953, 1146, 1146, 1146, 1146, 1146, + 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, + 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, + 1146, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953 + }, + + { + 69, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + + -954, -954, -954, 1148, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954 + }, + + { + 69, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, 1149, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955 + }, + + { + 69, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, 1150, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + + -956, -956, -956, -956, -956, -956, -956, -956 + }, + + { + 69, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, 1151, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, 1152, 1152, + 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, -957, -957, + -957, -957, -957, -957, -957, 1151, 1151, 1151, 1151, 1151, + 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, + 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, + + 1151, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957 + }, + + { + 69, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, 1153, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958 + }, + + { + 69, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + + -959, -959, 1154, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, 1155, 1155, + 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1155, -959, -959, + -959, -959, -959, -959, -959, 1154, 1154, 1154, 1154, 1154, + 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, + 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, + 1154, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959 + + }, + + { + 69, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, 1156, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960 + }, + + { + 69, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, 1157, + + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961 + }, + + { + 69, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962 + }, + + { + 69, -963, -963, -963, -963, -963, -963, -963, -963, -963, + + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963 + }, + + { + 69, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964 + }, + + { + 69, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965 + }, + + { + 69, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + + -966, -966, -966, -966, -966, -966, -966, -966 + }, + + { + 69, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967 + }, + + { + 69, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968 + }, + + { + 69, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969 + + }, + + { + 69, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970 + }, + + { + 69, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971 + }, + + { + 69, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972 + }, + + { + 69, -973, -973, -973, -973, -973, -973, -973, -973, -973, + + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973 + }, + + { + 69, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974 + }, + + { + 69, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975 + }, + + { + 69, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + + -976, -976, -976, -976, -976, -976, -976, -976 + }, + + { + 69, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977 + }, + + { + 69, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978 + }, + + { + 69, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979 + + }, + + { + 69, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980 + }, + + { + 69, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981 + }, + + { + 69, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982 + }, + + { + 69, -983, -983, -983, -983, -983, -983, -983, -983, -983, + + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983 + }, + + { + 69, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984 + }, + + { + 69, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985 + }, + + { + 69, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + + -986, -986, -986, -986, -986, -986, -986, -986 + }, + + { + 69, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987 + }, + + { + 69, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988 + }, + + { + 69, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989 + + }, + + { + 69, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990 + }, + + { + 69, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991 + }, + + { + 69, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992 + }, + + { + 69, -993, -993, -993, -993, -993, -993, -993, -993, -993, + + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993 + }, + + { + 69, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994 + }, + + { + 69, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995 + }, + + { + 69, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + + -996, -996, -996, -996, -996, -996, -996, -996 + }, + + { + 69, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997 + }, + + { + 69, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998 + }, + + { + 69, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999 + + }, + + { + 69,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000 + }, + + { + 69,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001 + }, + + { + 69,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002 + }, + + { + 69,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003 + }, + + { + 69,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004 + }, + + { + 69,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005 + }, + + { + 69,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006 + }, + + { + 69,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007 + }, + + { + 69,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008 + }, + + { + 69,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009 + + }, + + { + 69,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010 + }, + + { + 69,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011 + }, + + { + 69,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012 + }, + + { + 69,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013 + }, + + { + 69,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014 + }, + + { + 69,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015 + }, + + { + 69,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016 + }, + + { + 69,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017 + }, + + { + 69,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018 + }, + + { + 69,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019 + + }, + + { + 69,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020 + }, + + { + 69,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021 + }, + + { + 69,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022 + }, + + { + 69,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023 + }, + + { + 69,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024 + }, + + { + 69,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025 + }, + + { + 69,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026 + }, + + { + 69,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027, + -1027,-1027,-1027,-1027,-1027,-1027,-1027,-1027 + }, + + { + 69,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028 + }, + + { + 69,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029, + -1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029 + + }, + + { + 69,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030 + }, + + { + 69,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031 + }, + + { + 69,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032 + }, + + { + 69,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033 + }, + + { + 69,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034 + }, + + { + 69,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035 + }, + + { + 69,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036 + }, + + { + 69,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037 + }, + + { + 69,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038 + }, + + { + 69,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039 + + }, + + { + 69,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040 + }, + + { + 69,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041 + }, + + { + 69,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042 + }, + + { + 69,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043 + }, + + { + 69,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044 + }, + + { + 69,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045 + }, + + { + 69,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046 + }, + + { + 69,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047 + }, + + { + 69,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048 + }, + + { + 69,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049 + + }, + + { + 69,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050 + }, + + { + 69,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051 + }, + + { + 69,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052 + }, + + { + 69,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053 + }, + + { + 69,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054 + }, + + { + 69,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055 + }, + + { + 69,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056 + }, + + { + 69,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057 + }, + + { + 69,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058 + }, + + { + 69,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059 + + }, + + { + 69,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060 + }, + + { + 69,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061 + }, + + { + 69,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062 + }, + + { + 69,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063 + }, + + { + 69,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064 + }, + + { + 69,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065 + }, + + { + 69,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066 + }, + + { + 69,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067 + }, + + { + 69,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068 + }, + + { + 69,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069 + + }, + + { + 69,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070 + }, + + { + 69,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071 + }, + + { + 69,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072 + }, + + { + 69,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073 + }, + + { + 69,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074 + }, + + { + 69,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075 + }, + + { + 69,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076 + }, + + { + 69,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077 + }, + + { + 69,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078 + }, + + { + 69,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079 + + }, + + { + 69,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080 + }, + + { + 69,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081 + }, + + { + 69,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082 + }, + + { + 69,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083, 1158,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083 + }, + + { + 69,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084, 1159,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084 + }, + + { + 69,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085, 1160,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085 + }, + + { + 69,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, 1161,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086 + }, + + { + 69,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087, 1162,-1087,-1087,-1087,-1087,-1087,-1087, + + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087 + }, + + { + 69,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088, 1163,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088 + }, + + { + 69,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + + -1089,-1089, 1164,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089 + + }, + + { + 69,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090, 1165,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090 + }, + + { + 69,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091, 1166,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091 + }, + + { + 69,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092, 1167,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092 + }, + + { + 69,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093, 1168,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093 + }, + + { + 69,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094 + }, + + { + 69,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095, 1169,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095 + }, + + { + 69,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096, 1170,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096 + }, + + { + 69,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097, 1171,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097, + -1097,-1097,-1097,-1097,-1097,-1097,-1097,-1097 + }, + + { + 69,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098, 1172,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098, + -1098,-1098,-1098,-1098,-1098,-1098,-1098,-1098 + }, + + { + 69,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099, + -1099,-1099,-1099,-1099,-1099,-1099,-1099,-1099 + + }, + + { + 69,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100, + -1100,-1100,-1100,-1100,-1100,-1100,-1100,-1100 + }, + + { + 69,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101, 1173,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101, + -1101,-1101,-1101,-1101,-1101,-1101,-1101,-1101 + }, + + { + 69,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102, 1174,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102, + -1102,-1102,-1102,-1102,-1102,-1102,-1102,-1102 + }, + + { + 69,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103, 1175,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103, + -1103,-1103,-1103,-1103,-1103,-1103,-1103,-1103 + }, + + { + 69,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104, 1176,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104, + -1104,-1104,-1104,-1104,-1104,-1104,-1104,-1104 + }, + + { + 69,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105, 1177,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105, + -1105,-1105,-1105,-1105,-1105,-1105,-1105,-1105 + }, + + { + 69,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106, 1178,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106, + + -1106,-1106,-1106,-1106,-1106,-1106,-1106,-1106 + }, + + { + 69,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107, 1179,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107, + -1107,-1107,-1107,-1107,-1107,-1107,-1107,-1107 + }, + + { + 69,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108, 1180,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108, + -1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108 + }, + + { + 69,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + + -1109,-1109, 1181,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, 1182, 1182, + 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109, + -1109,-1109,-1109,-1109,-1109,-1109,-1109,-1109 + + }, + + { + 69,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110, 1183,-1110,-1110,-1110, + -1110,-1110, 1184,-1110,-1110,-1110, 1185,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, 1186, 1187, + 1188,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110, + -1110,-1110,-1110,-1110,-1110,-1110,-1110,-1110 + }, + + { + 69,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111, 1189,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111, + -1111,-1111,-1111,-1111,-1111,-1111,-1111,-1111 + }, + + { + 69,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112, 1190,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, 1191, 1191, + 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112, + -1112,-1112,-1112,-1112,-1112,-1112,-1112,-1112 + }, + + { + 69,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113, 1192,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113, + -1113,-1113,-1113,-1113,-1113,-1113,-1113,-1113 + }, + + { + 69,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114, 1193,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, 1194, 1194, + 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114, + -1114,-1114,-1114,-1114,-1114,-1114,-1114,-1114 + }, + + { + 69,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115, 1195,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115, + -1115,-1115,-1115,-1115,-1115,-1115,-1115,-1115 + }, + + { + 69,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116, 1196,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116, + + -1116,-1116,-1116,-1116,-1116,-1116,-1116,-1116 + }, + + { + 69,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117, 1197,-1117,-1117,-1117,-1117,-1117,-1117, + + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117, + -1117,-1117,-1117,-1117,-1117,-1117,-1117,-1117 + }, + + { + 69,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118, + -1118,-1118,-1118,-1118,-1118,-1118,-1118,-1118 + }, + + { + 69,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119, 1198,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119, + -1119,-1119,-1119,-1119,-1119,-1119,-1119,-1119 + + }, + + { + 69,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120, + -1120,-1120,-1120,-1120,-1120,-1120,-1120,-1120 + }, + + { + 69,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121, + -1121,-1121,-1121,-1121,-1121,-1121,-1121,-1121 + }, + + { + 69,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122, + -1122,-1122,-1122,-1122,-1122,-1122,-1122,-1122 + }, + + { + 69,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123, + -1123,-1123,-1123,-1123,-1123,-1123,-1123,-1123 + }, + + { + 69,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124, + -1124,-1124,-1124,-1124,-1124,-1124,-1124,-1124 + }, + + { + 69,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125, 1199,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125, + -1125,-1125,-1125,-1125,-1125,-1125,-1125,-1125 + }, + + { + 69,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126, 1200,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126, + + -1126,-1126,-1126,-1126,-1126,-1126,-1126,-1126 + }, + + { + 69,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127, 1201,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127, + -1127,-1127,-1127,-1127,-1127,-1127,-1127,-1127 + }, + + { + 69,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128, 1202,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128, + -1128,-1128,-1128,-1128,-1128,-1128,-1128,-1128 + }, + + { + 69,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129, 1203,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129, + -1129,-1129,-1129,-1129,-1129,-1129,-1129,-1129 + + }, + + { + 69,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130, 1204,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130, + -1130,-1130,-1130,-1130,-1130,-1130,-1130,-1130 + }, + + { + 69,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131, 1205,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131, + -1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131 + }, + + { + 69,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132, 1206,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132, + -1132,-1132,-1132,-1132,-1132,-1132,-1132,-1132 + }, + + { + 69,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133, 1207,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133, + -1133,-1133,-1133,-1133,-1133,-1133,-1133,-1133 + }, + + { + 69,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134, 1208,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134, + -1134,-1134,-1134,-1134,-1134,-1134,-1134,-1134 + }, + + { + 69,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135, 1209,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135, + -1135,-1135,-1135,-1135,-1135,-1135,-1135,-1135 + }, + + { + 69,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136, 1210,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136, + + -1136,-1136,-1136,-1136,-1136,-1136,-1136,-1136 + }, + + { + 69,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137, 1211,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137, + -1137,-1137,-1137,-1137,-1137,-1137,-1137,-1137 + }, + + { + 69,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138, + -1138,-1138,-1138,-1138,-1138,-1138,-1138,-1138 + }, + + { + 69,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139, + -1139,-1139,-1139,-1139,-1139,-1139,-1139,-1139 + + }, + + { + 69,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140, 1212,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140, + -1140,-1140,-1140,-1140,-1140,-1140,-1140,-1140 + }, + + { + 69,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141, 1213,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141, + -1141,-1141,-1141,-1141,-1141,-1141,-1141,-1141 + }, + + { + 69,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142, 1214,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142, + -1142,-1142,-1142,-1142,-1142,-1142,-1142,-1142 + }, + + { + 69,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143, 1215,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143, 1215, 1215, 1215, 1215, 1215, + 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, + 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1215, + 1215,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143, + -1143,-1143,-1143,-1143,-1143,-1143,-1143,-1143 + }, + + { + 69,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144, 1216,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144, 1216, 1216, 1216, 1216, 1216, + 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, + + 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, + 1216,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144, + -1144,-1144,-1144,-1144,-1144,-1144,-1144,-1144 + }, + + { + 69,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145, 1217,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145, + -1145,-1145,-1145,-1145,-1145,-1145,-1145,-1145 + }, + + { + 69,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146, 1218,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146, + + -1146,-1146,-1146,-1146,-1146,-1146,-1146,-1146 + }, + + { + 69,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147, 1219,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147, 1219, 1219, 1219, 1219, 1219, + 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, + 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1219, + + 1219,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147, + -1147,-1147,-1147,-1147,-1147,-1147,-1147,-1147 + }, + + { + 69,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148, 1220,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + + -1148,-1148,-1148,-1148,-1148, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, 1220, + 1220,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148, + -1148,-1148,-1148,-1148,-1148,-1148,-1148,-1148 + }, + + { + 69,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149, + -1149,-1149,-1149,-1149,-1149,-1149,-1149,-1149 + + }, + + { + 69,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150, 1221,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150, + -1150,-1150,-1150,-1150,-1150,-1150,-1150,-1150 + }, + + { + 69,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151, 1222,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151, + -1151,-1151,-1151,-1151,-1151,-1151,-1151,-1151 + }, + + { + 69,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152, 1223,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152, 1223, 1223, 1223, 1223, 1223, + 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, + 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, 1223, + 1223,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152, + -1152,-1152,-1152,-1152,-1152,-1152,-1152,-1152 + }, + + { + 69,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153, 1224,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153, + -1153,-1153,-1153,-1153,-1153,-1153,-1153,-1153 + }, + + { + 69,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154, 1225,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154, + -1154,-1154,-1154,-1154,-1154,-1154,-1154,-1154 + }, + + { + 69,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155, 1226,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155, 1226, 1226, 1226, 1226, 1226, + 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, + 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, + 1226,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155, + -1155,-1155,-1155,-1155,-1155,-1155,-1155,-1155 + }, + + { + 69,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156, 1227,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156, + + -1156,-1156,-1156,-1156,-1156,-1156,-1156,-1156 + }, + + { + 69,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157, + -1157,-1157,-1157,-1157,-1157,-1157,-1157,-1157 + }, + + { + 69,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158, + -1158,-1158,-1158,-1158,-1158,-1158,-1158,-1158 + }, + + { + 69,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159, + -1159,-1159,-1159,-1159,-1159,-1159,-1159,-1159 + + }, + + { + 69,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160, + -1160,-1160,-1160,-1160,-1160,-1160,-1160,-1160 + }, + + { + 69,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161, + -1161,-1161,-1161,-1161,-1161,-1161,-1161,-1161 + }, + + { + 69,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162, + -1162,-1162,-1162,-1162,-1162,-1162,-1162,-1162 + }, + + { + 69,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163, + -1163,-1163,-1163,-1163,-1163,-1163,-1163,-1163 + }, + + { + 69,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164, + -1164,-1164,-1164,-1164,-1164,-1164,-1164,-1164 + }, + + { + 69,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165, + -1165,-1165,-1165,-1165,-1165,-1165,-1165,-1165 + }, + + { + 69,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166, + + -1166,-1166,-1166,-1166,-1166,-1166,-1166,-1166 + }, + + { + 69,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167, 1228,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167, + -1167,-1167,-1167,-1167,-1167,-1167,-1167,-1167 + }, + + { + 69,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168, + -1168,-1168,-1168,-1168,-1168,-1168,-1168,-1168 + }, + + { + 69,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169, + -1169,-1169,-1169,-1169,-1169,-1169,-1169,-1169 + + }, + + { + 69,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170, + -1170,-1170,-1170,-1170,-1170,-1170,-1170,-1170 + }, + + { + 69,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171, + -1171,-1171,-1171,-1171,-1171,-1171,-1171,-1171 + }, + + { + 69,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172, + -1172,-1172,-1172,-1172,-1172,-1172,-1172,-1172 + }, + + { + 69,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173, + -1173,-1173,-1173,-1173,-1173,-1173,-1173,-1173 + }, + + { + 69,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174, + -1174,-1174,-1174,-1174,-1174,-1174,-1174,-1174 + }, + + { + 69,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175, + -1175,-1175,-1175,-1175,-1175,-1175,-1175,-1175 + }, + + { + 69,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176, + + -1176,-1176,-1176,-1176,-1176,-1176,-1176,-1176 + }, + + { + 69,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177, + -1177,-1177,-1177,-1177,-1177,-1177,-1177,-1177 + }, + + { + 69,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178, + -1178,-1178,-1178,-1178,-1178,-1178,-1178,-1178 + }, + + { + 69,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179, + -1179,-1179,-1179,-1179,-1179,-1179,-1179,-1179 + + }, + + { + 69,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180, + -1180,-1180,-1180,-1180,-1180,-1180,-1180,-1180 + }, + + { + 69,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181, + -1181,-1181,-1181,-1181,-1181,-1181,-1181,-1181 + }, + + { + 69,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182, + -1182,-1182,-1182,-1182,-1182,-1182,-1182,-1182 + }, + + { + 69,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183, + -1183,-1183,-1183,-1183,-1183,-1183,-1183,-1183 + }, + + { + 69,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184, + -1184,-1184,-1184,-1184,-1184,-1184,-1184,-1184 + }, + + { + 69,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185, + -1185,-1185,-1185,-1185,-1185,-1185,-1185,-1185 + }, + + { + 69,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186, + + -1186,-1186,-1186,-1186,-1186,-1186,-1186,-1186 + }, + + { + 69,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187, + -1187,-1187,-1187,-1187,-1187,-1187,-1187,-1187 + }, + + { + 69,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188, + -1188,-1188,-1188,-1188,-1188,-1188,-1188,-1188 + }, + + { + 69,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189, + -1189,-1189,-1189,-1189,-1189,-1189,-1189,-1189 + + }, + + { + 69,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190, + -1190,-1190,-1190,-1190,-1190,-1190,-1190,-1190 + }, + + { + 69,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191, + -1191,-1191,-1191,-1191,-1191,-1191,-1191,-1191 + }, + + { + 69,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192, + -1192,-1192,-1192,-1192,-1192,-1192,-1192,-1192 + }, + + { + 69,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193, + -1193,-1193,-1193,-1193,-1193,-1193,-1193,-1193 + }, + + { + 69,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194, + -1194,-1194,-1194,-1194,-1194,-1194,-1194,-1194 + }, + + { + 69,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195, + -1195,-1195,-1195,-1195,-1195,-1195,-1195,-1195 + }, + + { + 69,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196, + + -1196,-1196,-1196,-1196,-1196,-1196,-1196,-1196 + }, + + { + 69,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197, + -1197,-1197,-1197,-1197,-1197,-1197,-1197,-1197 + }, + + { + 69,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198, + -1198,-1198,-1198,-1198,-1198,-1198,-1198,-1198 + }, + + { + 69,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199, + -1199,-1199,-1199,-1199,-1199,-1199,-1199,-1199 + + }, + + { + 69,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200, 1229,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200, + -1200,-1200,-1200,-1200,-1200,-1200,-1200,-1200 + }, + + { + 69,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201, + -1201,-1201,-1201,-1201,-1201,-1201,-1201,-1201 + }, + + { + 69,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202, + -1202,-1202,-1202,-1202,-1202,-1202,-1202,-1202 + }, + + { + 69,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203, + -1203,-1203,-1203,-1203,-1203,-1203,-1203,-1203 + }, + + { + 69,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204, + -1204,-1204,-1204,-1204,-1204,-1204,-1204,-1204 + }, + + { + 69,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205, + -1205,-1205,-1205,-1205,-1205,-1205,-1205,-1205 + }, + + { + 69,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206, + + -1206,-1206,-1206,-1206,-1206,-1206,-1206,-1206 + }, + + { + 69,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207, + -1207,-1207,-1207,-1207,-1207,-1207,-1207,-1207 + }, + + { + 69,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208, + -1208,-1208,-1208,-1208,-1208,-1208,-1208,-1208 + }, + + { + 69,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209, + -1209,-1209,-1209,-1209,-1209,-1209,-1209,-1209 + + }, + + { + 69,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210, + -1210,-1210,-1210,-1210,-1210,-1210,-1210,-1210 + }, + + { + 69,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211, + -1211,-1211,-1211,-1211,-1211,-1211,-1211,-1211 + }, + + { + 69,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212, + -1212,-1212,-1212,-1212,-1212,-1212,-1212,-1212 + }, + + { + 69,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213, + -1213,-1213,-1213,-1213,-1213,-1213,-1213,-1213 + }, + + { + 69,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214, + -1214,-1214,-1214,-1214,-1214,-1214,-1214,-1214 + }, + + { + 69,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215, + -1215,-1215,-1215,-1215,-1215,-1215,-1215,-1215 + }, + + { + 69,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216, + + -1216,-1216,-1216,-1216,-1216,-1216,-1216,-1216 + }, + + { + 69,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217, 1230,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217, + -1217,-1217,-1217,-1217,-1217,-1217,-1217,-1217 + }, + + { + 69,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + + -1218, 1231,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218, + -1218,-1218,-1218,-1218,-1218,-1218,-1218,-1218 + }, + + { + 69,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219, 1232,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219, + -1219,-1219,-1219,-1219,-1219,-1219,-1219,-1219 + + }, + + { + 69,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220, 1233,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220, + -1220,-1220,-1220,-1220,-1220,-1220,-1220,-1220 + }, + + { + 69,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221, 1234,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221, + -1221,-1221,-1221,-1221,-1221,-1221,-1221,-1221 + }, + + { + 69,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222, 1235,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222, + -1222,-1222,-1222,-1222,-1222,-1222,-1222,-1222 + }, + + { + 69,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223, 1236,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223, + -1223,-1223,-1223,-1223,-1223,-1223,-1223,-1223 + }, + + { + 69,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224, 1237,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224, + -1224,-1224,-1224,-1224,-1224,-1224,-1224,-1224 + }, + + { + 69,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225, 1238,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225, + -1225,-1225,-1225,-1225,-1225,-1225,-1225,-1225 + }, + + { + 69,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226, 1239,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226, + + -1226,-1226,-1226,-1226,-1226,-1226,-1226,-1226 + }, + + { + 69,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227, + -1227,-1227,-1227,-1227,-1227,-1227,-1227,-1227 + }, + + { + 69,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228, 1240,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228, + -1228,-1228,-1228,-1228,-1228,-1228,-1228,-1228 + }, + + { + 69,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + + -1229,-1229, 1241,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229, + -1229,-1229,-1229,-1229,-1229,-1229,-1229,-1229 + + }, + + { + 69,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230, 1242,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230, + -1230,-1230,-1230,-1230,-1230,-1230,-1230,-1230 + }, + + { + 69,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231, 1243,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231, + -1231,-1231,-1231,-1231,-1231,-1231,-1231,-1231 + }, + + { + 69,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232, 1244,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232, + -1232,-1232,-1232,-1232,-1232,-1232,-1232,-1232 + }, + + { + 69,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233, 1245,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233, + -1233,-1233,-1233,-1233,-1233,-1233,-1233,-1233 + }, + + { + 69,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234, 1246,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234, + -1234,-1234,-1234,-1234,-1234,-1234,-1234,-1234 + }, + + { + 69,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235, 1247,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235, + -1235,-1235,-1235,-1235,-1235,-1235,-1235,-1235 + }, + + { + 69,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236, 1248,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236, + + -1236,-1236,-1236,-1236,-1236,-1236,-1236,-1236 + }, + + { + 69,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237, 1249,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237, + -1237,-1237,-1237,-1237,-1237,-1237,-1237,-1237 + }, + + { + 69,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238, 1250,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238, + -1238,-1238,-1238,-1238,-1238,-1238,-1238,-1238 + }, + + { + 69,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + + -1239,-1239, 1251,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239, + -1239,-1239,-1239,-1239,-1239,-1239,-1239,-1239 + + }, + + { + 69,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240, 1252,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240, + -1240,-1240,-1240,-1240,-1240,-1240,-1240,-1240 + }, + + { + 69,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241, 1253,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241, 1254,-1241, 1254,-1241,-1241, 1255, 1255, + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241, + -1241,-1241,-1241,-1241,-1241,-1241,-1241,-1241 + }, + + { + 69,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242, 1256,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + + -1242,-1242,-1242, 1257,-1242, 1257,-1242,-1242, 1258, 1258, + 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242, + -1242,-1242,-1242,-1242,-1242,-1242,-1242,-1242 + }, + + { + 69,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243, 1259,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243, 1260,-1243, 1260,-1243,-1243, 1261, 1261, + 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243, + -1243,-1243,-1243,-1243,-1243,-1243,-1243,-1243 + }, + + { + 69,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244, 1262,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244, 1263,-1244, 1263,-1244,-1244, 1264, 1264, + 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244, + -1244,-1244,-1244,-1244,-1244,-1244,-1244,-1244 + }, + + { + 69,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245, 1265,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245, 1266,-1245, 1266,-1245,-1245, 1267, 1267, + + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245, + -1245,-1245,-1245,-1245,-1245,-1245,-1245,-1245 + }, + + { + 69,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246, 1268,-1246,-1246,-1246,-1246,-1246,-1246, 1269, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246, + + -1246,-1246,-1246,-1246,-1246,-1246,-1246,-1246 + }, + + { + 69,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247, 1270,-1247,-1247,-1247,-1247,-1247,-1247, 1271, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247, + -1247,-1247,-1247,-1247,-1247,-1247,-1247,-1247 + }, + + { + 69,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248, 1272,-1248,-1248,-1248,-1248,-1248,-1248, 1273, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248, + -1248,-1248,-1248,-1248,-1248,-1248,-1248,-1248 + }, + + { + 69,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + + -1249,-1249, 1274,-1249,-1249,-1249,-1249,-1249,-1249, 1275, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249, + -1249,-1249,-1249,-1249,-1249,-1249,-1249,-1249 + + }, + + { + 69,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250, 1276,-1250,-1250,-1250,-1250,-1250,-1250, 1277, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250, + -1250,-1250,-1250,-1250,-1250,-1250,-1250,-1250 + }, + + { + 69,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251, 1278,-1251,-1251,-1251,-1251,-1251,-1251, 1279, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251, + -1251,-1251,-1251,-1251,-1251,-1251,-1251,-1251 + }, + + { + 69,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252, 1280,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252, + -1252,-1252,-1252,-1252,-1252,-1252,-1252,-1252 + }, + + { + 69,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253, 1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253, 1254,-1253, 1254,-1253,-1253, 1255, 1255, + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253, + -1253,-1253,-1253,-1253,-1253,-1253,-1253,-1253 + }, + + { + 69,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, 1255, 1255, + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254, + -1254,-1254,-1254,-1254,-1254,-1254,-1254,-1254 + }, + + { + 69,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, 1255, 1255, + + 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255, + -1255,-1255,-1255,-1255,-1255,-1255,-1255,-1255 + }, + + { + 69,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256, 1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256, 1257,-1256, 1257,-1256,-1256, 1258, 1258, + 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256, + + -1256,-1256,-1256,-1256,-1256,-1256,-1256,-1256 + }, + + { + 69,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, 1258, 1258, + 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257, + -1257,-1257,-1257,-1257,-1257,-1257,-1257,-1257 + }, + + { + 69,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, 1258, 1258, + 1258, 1258, 1258, 1258, 1258, 1258, 1258, 1258,-1258,-1258, + + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258, + -1258,-1258,-1258,-1258,-1258,-1258,-1258,-1258 + }, + + { + 69,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + + -1259,-1259, 1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259, 1260,-1259, 1260,-1259,-1259, 1261, 1261, + 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259, + -1259,-1259,-1259,-1259,-1259,-1259,-1259,-1259 + + }, + + { + 69,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, 1261, 1261, + 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260, + -1260,-1260,-1260,-1260,-1260,-1260,-1260,-1260 + }, + + { + 69,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, 1261, 1261, + 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261, + -1261,-1261,-1261,-1261,-1261,-1261,-1261,-1261 + }, + + { + 69,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262, 1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + + -1262,-1262,-1262, 1263,-1262, 1263,-1262,-1262, 1264, 1264, + 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262, + -1262,-1262,-1262,-1262,-1262,-1262,-1262,-1262 + }, + + { + 69,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, 1264, 1264, + 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263, + -1263,-1263,-1263,-1263,-1263,-1263,-1263,-1263 + }, + + { + 69,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, 1264, 1264, + 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264, + -1264,-1264,-1264,-1264,-1264,-1264,-1264,-1264 + }, + + { + 69,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265, 1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265, 1266,-1265, 1266,-1265,-1265, 1267, 1267, + + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265, + -1265,-1265,-1265,-1265,-1265,-1265,-1265,-1265 + }, + + { + 69,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266, + + -1266,-1266,-1266,-1266,-1266,-1266,-1266,-1266 + }, + + { + 69,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267, + -1267,-1267,-1267,-1267,-1267,-1267,-1267,-1267 + }, + + { + 69,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268, 1268,-1268,-1268,-1268,-1268,-1268,-1268, 1269, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268, + -1268,-1268,-1268,-1268,-1268,-1268,-1268,-1268 + }, + + { + 69, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1282, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281 + + }, + + { + 69,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270, 1270,-1270,-1270,-1270,-1270,-1270,-1270, 1271, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270, + -1270,-1270,-1270,-1270,-1270,-1270,-1270,-1270 + }, + + { + 69, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1284, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283 + }, + + { + 69,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272, 1272,-1272,-1272,-1272,-1272,-1272,-1272, 1273, + + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272, + -1272,-1272,-1272,-1272,-1272,-1272,-1272,-1272 + }, + + { + 69, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1286, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285 + }, + + { + 69,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274, 1274,-1274,-1274,-1274,-1274,-1274,-1274, 1275, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274, + -1274,-1274,-1274,-1274,-1274,-1274,-1274,-1274 + }, + + { + 69, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1288, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287 + }, + + { + 69,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276, 1276,-1276,-1276,-1276,-1276,-1276,-1276, 1277, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276, + + -1276,-1276,-1276,-1276,-1276,-1276,-1276,-1276 + }, + + { + 69, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1290, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289 + }, + + { + 69,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278, 1278,-1278,-1278,-1278,-1278,-1278,-1278, 1279, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278, + -1278,-1278,-1278,-1278,-1278,-1278,-1278,-1278 + }, + + { + 69, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1292, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291 + + }, + + { + 69,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280, 1293,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280, + -1280,-1280,-1280,-1280,-1280,-1280,-1280,-1280 + }, + + { + 69, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1282, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281 + }, + + { + 69,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, 1281, + + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282, + -1282,-1282,-1282,-1282,-1282,-1282,-1282,-1282 + }, + + { + 69, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1284, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283 + }, + + { + 69,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, 1283, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284, + -1284,-1284,-1284,-1284,-1284,-1284,-1284,-1284 + }, + + { + 69, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1286, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285 + }, + + { + 69,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, 1285, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286, + + -1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286 + }, + + { + 69, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1288, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287 + }, + + { + 69,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, 1287, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288, + -1288,-1288,-1288,-1288,-1288,-1288,-1288,-1288 + }, + + { + 69, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1290, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289 + + }, + + { + 69,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, 1289, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290, + -1290,-1290,-1290,-1290,-1290,-1290,-1290,-1290 + }, + + { + 69, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1292, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291 + }, + + { + 69,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, 1291, + + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292, + -1292,-1292,-1292,-1292,-1292,-1292,-1292,-1292 + }, + + { + 69,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293, 1294,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293, + -1293,-1293,-1293,-1293,-1293,-1293,-1293,-1293 + }, + + { + 69,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294, 1295,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294, + -1294,-1294,-1294,-1294,-1294,-1294,-1294,-1294 + }, + + { + 69,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295, 1296,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295, + -1295,-1295,-1295,-1295,-1295,-1295,-1295,-1295 + }, + + { + 69,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296, 1297,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296, + + -1296,-1296,-1296,-1296,-1296,-1296,-1296,-1296 + }, + + { + 69,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297, 1298,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297, + -1297,-1297,-1297,-1297,-1297,-1297,-1297,-1297 + }, + + { + 69,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298, 1299,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298, + -1298,-1298,-1298,-1298,-1298,-1298,-1298,-1298 + }, + + { + 69,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + + -1299,-1299, 1300,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299, + -1299,-1299,-1299,-1299,-1299,-1299,-1299,-1299 + + }, + + { + 69,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300, 1301,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300, + -1300,-1300,-1300,-1300,-1300,-1300,-1300,-1300 + }, + + { + 69,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301, 1302,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301, + -1301,-1301,-1301,-1301,-1301,-1301,-1301,-1301 + }, + + { + 69,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302, 1303,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302, + -1302,-1302,-1302,-1302,-1302,-1302,-1302,-1302 + }, + + { + 69,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303, 1304,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303, + -1303,-1303,-1303,-1303,-1303,-1303,-1303,-1303 + }, + + { + 69,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304, 1305,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304, + -1304,-1304,-1304,-1304,-1304,-1304,-1304,-1304 + }, + + { + 69,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305, 1306,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305, + -1305,-1305,-1305,-1305,-1305,-1305,-1305,-1305 + }, + + { + 69,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306, 1307,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306, + + -1306,-1306,-1306,-1306,-1306,-1306,-1306,-1306 + }, + + { + 69,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307, 1308,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307, + -1307,-1307,-1307,-1307,-1307,-1307,-1307,-1307 + }, + + { + 69,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308, 1309,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308, + -1308,-1308,-1308,-1308,-1308,-1308,-1308,-1308 + }, + + { + 69,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + + -1309,-1309, 1310,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309, + -1309,-1309,-1309,-1309,-1309,-1309,-1309,-1309 + + }, + + { + 69,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310, 1311,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310, + -1310,-1310,-1310,-1310,-1310,-1310,-1310,-1310 + }, + + { + 69,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311, 1312,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311, + -1311,-1311,-1311,-1311,-1311,-1311,-1311,-1311 + }, + + { + 69,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312, 1313,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312, + -1312,-1312,-1312,-1312,-1312,-1312,-1312,-1312 + }, + + { + 69,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313, 1314,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313, + -1313,-1313,-1313,-1313,-1313,-1313,-1313,-1313 + }, + + { + 69,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314, 1315,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314, + -1314,-1314,-1314,-1314,-1314,-1314,-1314,-1314 + }, + + { + 69,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315, 1316,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315, + -1315,-1315,-1315,-1315,-1315,-1315,-1315,-1315 + }, + + { + 69,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316, 1317,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316, + + -1316,-1316,-1316,-1316,-1316,-1316,-1316,-1316 + }, + + { + 69,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317, 1318,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317, + -1317,-1317,-1317,-1317,-1317,-1317,-1317,-1317 + }, + + { + 69,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318, 1319,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318, + -1318,-1318,-1318,-1318,-1318,-1318,-1318,-1318 + }, + + { + 69,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + + -1319,-1319, 1320,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319, + -1319,-1319,-1319,-1319,-1319,-1319,-1319,-1319 + + }, + + { + 69,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320, 1321,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320, + -1320,-1320,-1320,-1320,-1320,-1320,-1320,-1320 + }, + + { + 69,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321, 1322,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321, + -1321,-1321,-1321,-1321,-1321,-1321,-1321,-1321 + }, + + { + 69,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322, 1323,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322, + -1322,-1322,-1322,-1322,-1322,-1322,-1322,-1322 + }, + + { + 69,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323, 1324,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323, + -1323,-1323,-1323,-1323,-1323,-1323,-1323,-1323 + }, + + { + 69,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324, 1325,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324, + -1324,-1324,-1324,-1324,-1324,-1324,-1324,-1324 + }, + + { + 69,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325, 1326,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325, + -1325,-1325,-1325,-1325,-1325,-1325,-1325,-1325 + }, + + { + 69,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326, 1327,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326, + + -1326,-1326,-1326,-1326,-1326,-1326,-1326,-1326 + }, + + { + 69,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327, 1328,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327, + -1327,-1327,-1327,-1327,-1327,-1327,-1327,-1327 + }, + + { + 69,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328, 1329,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328, + -1328,-1328,-1328,-1328,-1328,-1328,-1328,-1328 + }, + + { + 69,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + + -1329,-1329, 1330,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329, + -1329,-1329,-1329,-1329,-1329,-1329,-1329,-1329 + + }, + + { + 69,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330, 1331,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330, + -1330,-1330,-1330,-1330,-1330,-1330,-1330,-1330 + }, + + { + 69,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331, 1332,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331, + -1331,-1331,-1331,-1331,-1331,-1331,-1331,-1331 + }, + + { + 69,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332, 1333,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332, + -1332,-1332,-1332,-1332,-1332,-1332,-1332,-1332 + }, + + { + 69,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333, 1334,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333, + -1333,-1333,-1333,-1333,-1333,-1333,-1333,-1333 + }, + + { + 69,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334, 1335,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334, + -1334,-1334,-1334,-1334,-1334,-1334,-1334,-1334 + }, + + { + 69,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335, 1336,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335, + -1335,-1335,-1335,-1335,-1335,-1335,-1335,-1335 + }, + + { + 69,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336, 1337,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336, + + -1336,-1336,-1336,-1336,-1336,-1336,-1336,-1336 + }, + + { + 69,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337, 1338,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337, + -1337,-1337,-1337,-1337,-1337,-1337,-1337,-1337 + }, + + { + 69,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338, 1339,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338, + -1338,-1338,-1338,-1338,-1338,-1338,-1338,-1338 + }, + + { + 69,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + + -1339,-1339, 1340,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339, + -1339,-1339,-1339,-1339,-1339,-1339,-1339,-1339 + + }, + + { + 69,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340, 1341,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340, + -1340,-1340,-1340,-1340,-1340,-1340,-1340,-1340 + }, + + { + 69,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341, 1342,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341, + -1341,-1341,-1341,-1341,-1341,-1341,-1341,-1341 + }, + + { + 69,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342, 1343,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342, + -1342,-1342,-1342,-1342,-1342,-1342,-1342,-1342 + }, + + { + 69,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343, 1344,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343, + -1343,-1343,-1343,-1343,-1343,-1343,-1343,-1343 + }, + + { + 69,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344, 1345,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344, + -1344,-1344,-1344,-1344,-1344,-1344,-1344,-1344 + }, + + { + 69,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345, 1346,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345, + -1345,-1345,-1345,-1345,-1345,-1345,-1345,-1345 + }, + + { + 69,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346, 1347,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346, + + -1346,-1346,-1346,-1346,-1346,-1346,-1346,-1346 + }, + + { + 69,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347, 1348,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347, + -1347,-1347,-1347,-1347,-1347,-1347,-1347,-1347 + }, + + { + 69,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348, 1349,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348, + -1348,-1348,-1348,-1348,-1348,-1348,-1348,-1348 + }, + + { + 69,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + + -1349,-1349, 1350,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349, + -1349,-1349,-1349,-1349,-1349,-1349,-1349,-1349 + + }, + + { + 69,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350, 1351,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350, + -1350,-1350,-1350,-1350,-1350,-1350,-1350,-1350 + }, + + { + 69,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351, 1352,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351, + -1351,-1351,-1351,-1351,-1351,-1351,-1351,-1351 + }, + + { + 69,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352, 1353,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352, + -1352,-1352,-1352,-1352,-1352,-1352,-1352,-1352 + }, + + { + 69,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353, 1354,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353, + -1353,-1353,-1353,-1353,-1353,-1353,-1353,-1353 + }, + + { + 69,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354, 1355,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354, + -1354,-1354,-1354,-1354,-1354,-1354,-1354,-1354 + }, + + { + 69,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355, 1356,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355, + -1355,-1355,-1355,-1355,-1355,-1355,-1355,-1355 + }, + + { + 69,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356, 1357,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356, + + -1356,-1356,-1356,-1356,-1356,-1356,-1356,-1356 + }, + + { + 69,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357, 1358,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357, + -1357,-1357,-1357,-1357,-1357,-1357,-1357,-1357 + }, + + { + 69,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358, 1359,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358, + -1358,-1358,-1358,-1358,-1358,-1358,-1358,-1358 + }, + + { + 69,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + + -1359,-1359, 1360,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359, + -1359,-1359,-1359,-1359,-1359,-1359,-1359,-1359 + + }, + + { + 69,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360, + -1360,-1360,-1360,-1360,-1360,-1360,-1360,-1360 + }, + + } ; + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 415 +#define YY_END_OF_BUFFER 416 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[1361] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 416, 415, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 186, 186, + 186, 205, 205, 197, 197, 206, 206, 198, 198, 253, + + 253, 253, 415, 274, 274, 263, 263, 278, 278, 289, + 289, 290, 290, 356, 356, 356, 391, 391, 369, 369, + 392, 392, 370, 370, 396, 396, 292, 293, 291, 300, + 300, 301, 301, 309, 309, 310, 310, 398, 398, 400, + 400, 399, 402, 402, 402, 401, 404, 404, 404, 403, + 406, 406, 415, 407, 415, 415, 415, 412, 415, 413, + 415, 414, 0, 0, 0, 64, 58, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, + 63, 57, 0, 0, 0, 0, 0, 0, 0, 23, + + 0, 0, 0, 19, 0, 66, 60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 397, 399, 0, 401, 401, 401, 401, + 0, 0, 403, 403, 403, 403, 0, 0, 405, 0, + 409, 0, 0, 0, 407, 0, 0, 0, 407, 0, + + 0, 0, 412, 0, 413, 0, 414, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 65, 59, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 20, 67, 61, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 183, 184, 185, 182, 181, 179, 180, 0, 0, 0, + 187, 188, 189, 194, 193, 0, 0, 0, 190, 191, + + 192, 196, 195, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 275, 276, 277, 279, 280, 281, + 286, 285, 282, 283, 284, 288, 287, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 393, 394, 395, 0, 0, + 0, 297, 298, 299, 0, 0, 0, 306, 307, 308, + 401, 0, 401, 403, 0, 403, 0, 0, 408, 0, + 0, 0, 410, 0, 0, 0, 407, 0, 0, 22, + + 18, 26, 0, 70, 0, 90, 75, 0, 13, 44, + 80, 39, 34, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 118, 0, 0, + 0, 160, 0, 0, 51, 49, 0, 124, 0, 0, + 0, 0, 0, 0, 156, 0, 54, 56, 164, 162, + 174, 0, 28, 0, 72, 0, 92, 77, 0, 15, + 46, 82, 41, 36, 87, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 96, 176, 0, 0, 0, + 0, 166, 0, 0, 95, 0, 0, 0, 172, 199, + 200, 201, 202, 203, 204, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 254, 255, 256, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 294, 295, 296, 302, 303, 304, 305, 411, 0, + 0, 0, 408, 0, 0, 0, 407, 0, 0, 27, + 71, 91, 76, 31, 14, 45, 81, 40, 35, 86, + + 0, 25, 69, 89, 74, 30, 12, 43, 79, 38, + 33, 84, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, + 0, 0, 137, 139, 141, 0, 0, 62, 0, 0, + 0, 0, 0, 0, 0, 29, 73, 93, 78, 32, + 16, 47, 83, 42, 37, 88, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 101, 0, 0, 99, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 262, 259, 261, 257, 258, + 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 362, 360, 361, 357, 358, 359, 0, + 0, 0, 0, 0, 0, 0, 0, 368, 366, 367, + 363, 364, 365, 0, 408, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 242, 244, 247, 251, 243, 246, 250, 245, 249, + 248, 252, 238, 216, 235, 239, 227, 217, 213, 222, + 233, 236, 240, 228, 225, 230, 218, 214, 223, 211, + 220, 232, 234, 237, 241, 229, 226, 231, 209, 210, + + 219, 215, 224, 212, 221, 207, 208, 273, 269, 272, + 266, 268, 271, 264, 265, 267, 270, 346, 348, 351, + 355, 347, 350, 354, 349, 353, 352, 342, 320, 339, + 343, 331, 317, 321, 326, 337, 340, 344, 329, 332, + 334, 315, 318, 322, 327, 324, 336, 338, 341, 345, + 313, 330, 333, 335, 314, 311, 316, 319, 323, 328, + 325, 312, 386, 376, 385, 374, 375, 384, 371, 372, + 373, 383, 390, 382, 389, 380, 381, 388, 377, 378, + 379, 387, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 159, 0, 0, 0, 0, 50, 48, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 155, 0, 53, + 55, 161, 163, 173, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 175, 165, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, + 0, 0, 0, 0, 0, 0, 171, 127, 117, 116, + 119, 112, 104, 113, 114, 115, 0, 158, 108, 110, + 109, 126, 123, 122, 125, 120, 105, 107, 106, 147, + 148, 149, 146, 150, 142, 136, 138, 140, 151, 152, + 153, 143, 144, 145, 154, 102, 157, 52, 131, 0, + + 134, 111, 135, 97, 103, 133, 132, 100, 98, 128, + 129, 68, 168, 169, 170, 167, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, + 4, 0, 0, 5, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, + 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 177 + } ; + +static const yy_state_type yy_NUL_trans[1361] = + { 0, + 70, 71, 89, 89, 92, 92, 94, 94, 96, 96, + 98, 98, 100, 100, 70, 70, 104, 104, 106, 106, + 108, 108, 110, 110, 112, 112, 114, 114, 117, 117, + 119, 119, 121, 121, 123, 123, 125, 125, 127, 127, + 128, 128, 130, 130, 132, 132, 134, 134, 136, 136, + 138, 138, 140, 140, 143, 143, 147, 147, 151, 151, + 153, 153, 157, 157, 159, 159, 161, 161, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 288, 290, 0, 294, 298, 302, 0, 304, 0, + 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 288, 0, 290, + 0, 487, 488, 492, 0, 496, 298, 298, 0, 298, + + 298, 302, 0, 304, 0, 306, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 487, 488, 0, 488, + 488, 492, 0, 492, 682, 492, 0, 496, 686, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 487, + 894, 682, 0, 682, 682, 686, 0, 686, 686, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 894, 0, 894, 894, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1281, 0, + 1283, 0, 1285, 0, 1287, 0, 1289, 0, 1291, 0, + 1281, 0, 1283, 0, 1285, 0, 1287, 0, 1289, 0, + 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "wcsbth.l" +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsbth.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*============================================================================= +* +* wcsbth.l is a Flex description file containing the definition of a lexical +* scanner for parsing the WCS keyrecords for one or more image arrays and/or +* pixel lists in a FITS binary table header. It can also handle primary image +* and image extension headers. +* +* wcsbth.l requires Flex v2.5.4 or later. Refer to wcshdr.h for a description +* of the user interface and operating notes. +* +* Implementation notes +* -------------------- +* wcsbth() may be invoked with an option that causes it to recognize the +* image-header form of WCS keywords as defaults for each alternate coordinate +* representation (up to 27). By design, with this option enabled wcsbth() can +* also handle primary image and image extension headers, effectively treating +* them as a single-column binary table though with WCS keywords of a different +* form. +* +* NAXIS is always 2 for binary tables, it refers to the two-dimensional nature +* of the table. Thus NAXIS does not count the number of image axes in either +* image arrays or pixels lists and for the latter there is not even a formal +* equivalent of WCSAXESa. Hence NAXIS is always ignored and a first pass +* through the header is required to determine the number of images, the number +* of alternate coordinate representations for each image (up to 27), and the +* number of coordinate axes in each representation; this pass also counts the +* number of iPVn_ma and iPSn_ma or TVk_ma and TSk_ma keywords in each +* representation. +* +* On completion of the first pass, the association between column number and +* axis number is defined for each representation of a pixel list. Memory is +* allocated for an array of the required number of wcsprm structs and each of +* these is initialized appropriately. These structs are filled in the second +* pass. +* +* It is permissible for a scalar table column to contain degenerate (single- +* point) image arrays and simultaneously form one axis of a pixel list. +* +* The parser does not check for duplicated keywords, for most keywords it +* accepts the last encountered. +* +* wcsbth() does not currently handle the Green Bank convention. +* +*===========================================================================*/ +/* Options. */ +/* Indices for parameterized keywords. */ +/* Alternate coordinate system identifier. */ +/* Keyvalue data types. */ +/* Inline comment syntax. */ +/* Exclusive start states. */ + + + + + + + + + + +#line 114 "wcsbth.l" +#include +#include +#include +#include +#include + +#include "wcs.h" +#include "wcshdr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcsutil.h" + + /* Codes used for keyvalue data types. */ +#define INTEGER 0 +#define FLOAT 1 +#define FLOAT2 2 +#define STRING 3 + + /* Bit masks used for keyword types: */ +#define IMGAUX 0x1 /* Auxiliary image header, e.g. LONPOLEa or */ + /* DATE-OBS. */ +#define IMGAXIS 0x2 /* Image header with axis number, e.g. */ + /* CTYPEia. */ +#define IMGHEAD 0x3 /* IMGAUX | IMGAXIS, i.e. image header of */ + /* either type. */ +#define BIMGARR 0x4 /* Binary table image array, e.g. iCTYna. */ +#define PIXLIST 0x8 /* Pixel list, e.g. TCTYna. */ +#define BINTAB 0xC /* BIMGARR | PIXLIST, i.e. binary table */ + /* image array (without axis number) or */ + /* pixel list, e.g. LONPna or OBSGXn. */ + +static int wcsbth_scanner(char *header, int nkeyrec, int relax, int ctrl, + int keysel, int *colsel, int *nreject, int *nwcs, + struct wcsprm **wcs, yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsbth( + char *header, + int nkeyrec, + int relax, + int ctrl, + int keysel, + int *colsel, + int *nreject, + int *nwcs, + struct wcsprm **wcs) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsbth_scanner(header, nkeyrec, relax, ctrl, keysel, colsel, + nreject, nwcs, wcs, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsbth_scanner(char *header, int nkeyrec, int relax, \ + int ctrl, int keysel, int *colsel, int *nreject, int *nwcs, \ + struct wcsprm **wcs, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (wcsbth_nkeyrec) { \ + strncpy(inbuff, wcsbth_hdr, 80); \ + inbuff[80] = '\n'; \ + wcsbth_hdr += 80; \ + wcsbth_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* A convenience macro to get around incompatibilities between unput() and + yyless(): put yytext followed by a blank back onto the input stream. */ +#define WCSBTH_PUTBACK \ + sprintf(strtmp, "%s ", yytext); \ + itmp = strlen(strtmp); \ + while (itmp) unput(strtmp[--itmp]); + +/* These global variables are required by YY_INPUT. */ +static char *wcsbth_hdr; +static int wcsbth_nkeyrec; + +/* Struct used internally for header bookkeeping. */ +struct wcsbth_alts { + int ncol, ialt, icol, imgherit; + short int (*arridx)[27]; + short int pixidx[27]; + short int pad1; + unsigned int *pixlist; + + unsigned char (*npv)[27]; + unsigned char (*nps)[27]; + unsigned char pixnpv[27]; + unsigned char pixnps[27]; + unsigned char pad2[2]; +}; + +/* Internal helper functions. */ +static int wcsbth_colax(struct wcsprm *wcs, struct wcsbth_alts *alts, int k, + char a); +static int wcsbth_final(struct wcsbth_alts *alts, int *nwcs, + struct wcsprm **wcs); +static struct wcsprm *wcsbth_idx(struct wcsprm *wcs, struct wcsbth_alts *alts, + int keytype, int n, char a); +static int wcsbth_init1(struct wcsbth_alts *alts, int *nwcs, + struct wcsprm **wcs); +static int wcsbth_pass1(int keytype, int i, int j, int n, int k, char a, + char ptype, struct wcsbth_alts *alts); + +/* Helper functions for keywords that require special handling. */ +static int wcsbth_jdref(double *wptr, const double *jdref); +static int wcsbth_jdrefi(double *wptr, const double *jdrefi); +static int wcsbth_jdreff(double *wptr, const double *jdreff); +static int wcsbth_epoch(double *wptr, const double *epoch); +static int wcsbth_vsource(double *wptr, const double *vsource); + +/* Helper functions for keyvalue validity checking. */ +static int wcsbth_timepixr(double timepixr); + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsbth_abort_jmp_env; +#define exit(status) longjmp(wcsbth_abort_jmp_env, status) + +#line 24644 "wcsbth.c" +#line 24645 "wcsbth.c" + +#define INITIAL 0 +#define CCCCCia 1 +#define iCCCna 2 +#define iCCCCn 3 +#define TCCCna 4 +#define TCCCCn 5 +#define CCi_ja 6 +#define ijCCna 7 +#define TCn_ka 8 +#define TCCn_ka 9 +#define CROTAi 10 +#define iCROTn 11 +#define TCROTn 12 +#define CCi_ma 13 +#define iCn_ma 14 +#define iCCn_ma 15 +#define TCn_ma 16 +#define TCCn_ma 17 +#define PROJPm 18 +#define CCCCCCCC 19 +#define CCCCCCCa 20 +#define CCCCna 21 +#define CCCCCna 22 +#define CCCCn 23 +#define CCCCCn 24 +#define VALUE 25 +#define INTEGER_VAL 26 +#define FLOAT_VAL 27 +#define FLOAT2_VAL 28 +#define STRING_VAL 29 +#define COMMENT 30 +#define DISCARD 31 +#define ERROR 32 +#define FLUSH 33 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 249 "wcsbth.l" + +#line 251 "wcsbth.l" + /* Keyword indices, as used in the WCS papers, e.g. iVn_ma, TPn_ka. */ + char a; + int i, j, k, m, n; + + char *cptr, *errmsg, errtxt[80], exclude[1000], gotone, *hptr, *keep, + *keyname, *keyrec, ptype, strtmp[80]; + int altlin, ialt, icol, incl, imherit, inttmp, ipass, ipx, itmp, ix, + jx, keytype, nother, nsel, npass, nvalid, status, valtype, voff; + double dbltmp, dbl2tmp[2]; + void *vptr, *wptr; + struct wcsbth_alts alts; + struct wcsprm *wcsp, wcstem; + int (*chekval)(double); + int (*special)(double *, const double *); + + /* The data structures produced. */ + *nwcs = 0; + *wcs = 0x0; + + /* Parameters used to implement YY_INPUT. */ + wcsbth_hdr = header; + wcsbth_nkeyrec = nkeyrec; + + /* Our handle on the input stream. */ + keyrec = header; + hptr = header; + keep = 0x0; + + /* For keeping tallies of keywords found. */ + *nreject = 0; + nvalid = 0; + nother = 0; + + /* Used to flag image header keywords that are always inherited. */ + imherit = 1; + + /* If strict, then also reject. */ + if (relax & WCSHDR_strict) relax |= WCSHDR_reject; + + /* Keyword parameters. */ + i = j = 0; + n = k = 0; + m = 0; + a = ' '; + + /* Header bookkeeping. */ + alts.ncol = 0; + alts.arridx = 0x0; + alts.pixlist = 0x0; + alts.npv = 0x0; + alts.nps = 0x0; + + for (ialt = 0; ialt < 27; ialt++) { + alts.pixidx[ialt] = 0; + alts.pixnpv[ialt] = 0; + alts.pixnps[ialt] = 0; + } + + /* For decoding the keyvalue. */ + keytype = 0; + valtype = -1; + vptr = 0x0; + + /* For keywords that require special handling. */ + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + /* Selection by column number. */ + nsel = colsel ? colsel[0] : 0; + incl = (nsel > 0); + for (icol = 0; icol < 1000; icol++) { + exclude[icol] = incl; + } + for (icol = 1; icol <= abs(nsel); icol++) { + itmp = colsel[icol]; + if (0 < itmp && itmp < 1000) { + exclude[itmp] = !incl; + } + } + exclude[0] = 0; + + /* Selection by keyword type. */ + itmp = keysel; + keysel = 0; + if (itmp) { + if (itmp & WCSHDR_IMGHEAD) keysel |= IMGHEAD; + if (itmp & WCSHDR_BIMGARR) keysel |= BIMGARR; + if (itmp & WCSHDR_PIXLIST) keysel |= PIXLIST; + } + if (keysel == 0) { + keysel = IMGHEAD | BINTAB; + } + + /* Control variables. */ + ipass = 1; + npass = 2; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsbth_abort_jmp_env)) { + return 4; + } + + BEGIN(INITIAL); + + +#line 25035 "wcsbth.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + + ++yy_cp; + } + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos + 1; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 358 "wcsbth.l" +{ + if (ipass == 1) { + if (alts.ncol == 0) { + sscanf(yytext, "TFIELDS = %d", &(alts.ncol)); + BEGIN(FLUSH); + } else { + errmsg = "duplicate or out-of-sequence TFIELDS keyword"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 373 "wcsbth.l" +{ + if (!(keysel & IMGAXIS)) { + /* Ignore this key type. */ + BEGIN(DISCARD); + + } else { + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "WCSAXES%c= %d", &a, &i); + + if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCSAXESa"; + keytype = IMGAXIS; + BEGIN(COMMENT); + } + + } else if (relax & WCSHDR_reject) { + errmsg = "image-header keyword WCSAXESa in binary table"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + } + YY_BREAK +case 3: +#line 407 "wcsbth.l" +case 4: +#line 408 "wcsbth.l" +case 5: +YY_RULE_SETUP +#line 408 "wcsbth.l" +{ + keyname = "WCAXna"; + + /* Note that a blank in the sscanf() format string matches zero or + more of them in the input. */ + sscanf(yytext, "WCAX%d%c = %d", &n, &a, &i); + + if (!(keysel & BIMGARR) || exclude[n]) { + /* Ignore this key type or column. */ + BEGIN(DISCARD); + + } else if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCAXna"; + keytype = IMGAXIS; + BEGIN(COMMENT); + } + } + YY_BREAK +case 6: +/* rule 6 can match eol */ +#line 434 "wcsbth.l" +case 7: +/* rule 7 can match eol */ +#line 435 "wcsbth.l" +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +#line 435 "wcsbth.l" +{ + /* Cross-reference supplier. */ + keyname = "WCSTna"; + errmsg = "cross-references are not implemented"; + BEGIN(ERROR); + } + YY_BREAK +case 9: +/* rule 9 can match eol */ +#line 443 "wcsbth.l" +case 10: +/* rule 10 can match eol */ +#line 444 "wcsbth.l" +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 444 "wcsbth.l" +{ + /* Cross-reference consumer. */ + keyname = "WCSXna"; + errmsg = "cross-references are not implemented"; + BEGIN(ERROR); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 451 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crpix); + + keyname = "CRPIXja"; + BEGIN(CCCCCia); + } + YY_BREAK +case 13: +#line 460 "wcsbth.l" +case 14: +YY_RULE_SETUP +#line 460 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crpix); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "jCRPna"; + BEGIN(iCCCna); + } else { + keyname = "jCRPXn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 15: +#line 476 "wcsbth.l" +case 16: +YY_RULE_SETUP +#line 476 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crpix); + + if (yyleng == 4) { + keyname = "TCRPna"; + BEGIN(TCCCna); + } else { + keyname = "TCRPXn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 489 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + keyname = "PCi_ja"; + BEGIN(CCi_ja); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 498 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + sscanf(yytext, "%1d%1d", &i, &j); + + keyname = "ijPCna"; + BEGIN(ijCCna); + } + YY_BREAK +case 19: +#line 510 "wcsbth.l" +case 20: +YY_RULE_SETUP +#line 510 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + if (yyleng == 2) { + keyname = "TPn_ka"; + BEGIN(TCn_ka); + } else { + keyname = "TPCn_ka"; + BEGIN(TCCn_ka); + } + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 524 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + keyname = "CDi_ja"; + BEGIN(CCi_ja); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 533 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + sscanf(yytext, "%1d%1d", &i, &j); + + keyname = "ijCDna"; + BEGIN(ijCCna); + } + YY_BREAK +case 23: +#line 545 "wcsbth.l" +case 24: +YY_RULE_SETUP +#line 545 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + if (yyleng == 2) { + keyname = "TCn_ka"; + BEGIN(TCn_ka); + } else { + keyname = "TCDn_ka"; + BEGIN(TCCn_ka); + } + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 559 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + keyname = "CDELTia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 26: +#line 568 "wcsbth.l" +case 27: +YY_RULE_SETUP +#line 568 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCDEna"; + BEGIN(iCCCna); + } else { + keyname = "iCDLTn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 28: +#line 584 "wcsbth.l" +case 29: +YY_RULE_SETUP +#line 584 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + if (yyleng == 4) { + keyname = "TCDEna"; + BEGIN(TCCCna); + } else { + keyname = "TCDLTn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 597 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "CROTAi"; + BEGIN(CROTAi); + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 606 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + sscanf(yytext, "%d", &i); + + keyname = "iCROTn"; + BEGIN(iCROTn); + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 617 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "TCROTn"; + BEGIN(TCROTn); + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 626 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cunit); + + keyname = "CUNITia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 34: +#line 635 "wcsbth.l" +case 35: +YY_RULE_SETUP +#line 635 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cunit); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCUNna"; + BEGIN(iCCCna); + } else { + keyname = "iCUNIn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 36: +#line 651 "wcsbth.l" +case 37: +YY_RULE_SETUP +#line 651 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cunit); + + if (yyleng == 4) { + keyname = "TCUNna"; + BEGIN(TCCCna); + } else { + keyname = "TCUNIn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 664 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ctype); + + keyname = "CTYPEia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 39: +#line 673 "wcsbth.l" +case 40: +YY_RULE_SETUP +#line 673 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ctype); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCTYna"; + BEGIN(iCCCna); + } else { + keyname = "iCTYPn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 41: +#line 689 "wcsbth.l" +case 42: +YY_RULE_SETUP +#line 689 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ctype); + + if (yyleng == 4) { + keyname = "TCTYna"; + BEGIN(TCCCna); + } else { + keyname = "TCTYPn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 702 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crval); + + keyname = "CRVALia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 44: +#line 711 "wcsbth.l" +case 45: +YY_RULE_SETUP +#line 711 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crval); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCRVna"; + BEGIN(iCCCna); + } else { + keyname = "iCRVLn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 46: +#line 727 "wcsbth.l" +case 47: +YY_RULE_SETUP +#line 727 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crval); + + if (yyleng == 4) { + keyname = "TCRVna"; + BEGIN(TCCCna); + } else { + keyname = "TCRVLn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 48: +#line 741 "wcsbth.l" +case 49: +YY_RULE_SETUP +#line 741 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.lonpole); + + if (yyleng == 7) { + keyname = "LONPOLEa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "LONPna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 50: +#line 756 "wcsbth.l" +case 51: +YY_RULE_SETUP +#line 756 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.latpole); + + if (yyleng == 7) { + keyname = "LATPOLEa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "LATPna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 52: +#line 771 "wcsbth.l" +case 53: +#line 772 "wcsbth.l" +case 54: +YY_RULE_SETUP +#line 772 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + if (yyleng == 8) { + if (relax & WCSHDR_strict) { + errmsg = "the RESTFREQ keyword is deprecated, use RESTFRQa"; + BEGIN(ERROR); + + } else { + unput(' '); + + keyname = "RESTFREQ"; + BEGIN(CCCCCCCa); + } + + } else if (yyleng == 7) { + keyname = "RESTFRQa"; + BEGIN(CCCCCCCa); + + } else { + keyname = "RFRQna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 55: +#line 799 "wcsbth.l" +case 56: +YY_RULE_SETUP +#line 799 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.restwav); + + if (yyleng == 7) { + keyname = "RESTWAVa"; + BEGIN(CCCCCCCa); + } else { + keyname = "RWAVna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 812 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + keyname = "PVi_ma"; + BEGIN(CCi_ma); + } + YY_BREAK +case 58: +#line 822 "wcsbth.l" +case 59: +YY_RULE_SETUP +#line 822 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + sscanf(yytext, "%d", &i); + + if (yyleng == 2) { + keyname = "iVn_ma"; + BEGIN(iCn_ma); + } else { + keyname = "iPVn_ma"; + BEGIN(iCCn_ma); + } + } + YY_BREAK +case 60: +#line 839 "wcsbth.l" +case 61: +YY_RULE_SETUP +#line 839 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + if (yyleng == 2) { + keyname = "TVn_ma"; + BEGIN(TCn_ma); + } else { + keyname = "TPVn_ma"; + BEGIN(TCCn_ma); + } + } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 853 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + keyname = "PROJPm"; + BEGIN(PROJPm); + } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 862 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + keyname = "PSi_ma"; + BEGIN(CCi_ma); + } + YY_BREAK +case 64: +#line 872 "wcsbth.l" +case 65: +YY_RULE_SETUP +#line 872 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + sscanf(yytext, "%d", &i); + + if (yyleng == 2) { + keyname = "iSn_ma"; + BEGIN(iCn_ma); + } else { + keyname = "iPSn_ma"; + BEGIN(iCCn_ma); + } + } + YY_BREAK +case 66: +#line 889 "wcsbth.l" +case 67: +YY_RULE_SETUP +#line 889 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + if (yyleng == 2) { + keyname = "TSn_ma"; + BEGIN(TCn_ma); + } else { + keyname = "TPSn_ma"; + BEGIN(TCCn_ma); + } + } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 903 "wcsbth.l" +{ + sscanf(yytext, "VELREF%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the VELREF keyword is deprecated, use SPECSYSa"; + BEGIN(ERROR); + + } else if (a == ' ' || (relax & WCSHDR_VELREFa)) { + valtype = INTEGER; + vptr = &(wcstem.velref); + + unput(a); + + keyname = "VELREF"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "VELREF keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 929 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cname); + + keyname = "CNAMEia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 70: +#line 938 "wcsbth.l" +case 71: +YY_RULE_SETUP +#line 938 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cname); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCNAna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCNAMn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 72: +#line 955 "wcsbth.l" +case 73: +YY_RULE_SETUP +#line 955 "wcsbth.l" +{ + valtype = STRING; + vptr = &(wcstem.cname); + + if (yyleng == 4) { + keyname = "TCNAna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCNAMn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 969 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crder); + + keyname = "CRDERia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 75: +#line 978 "wcsbth.l" +case 76: +YY_RULE_SETUP +#line 978 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crder); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCRDna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCRDEn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 77: +#line 995 "wcsbth.l" +case 78: +YY_RULE_SETUP +#line 995 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crder); + + if (yyleng == 4) { + keyname = "TCRDna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCRDEn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 1009 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.csyer); + + keyname = "CSYERia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 80: +#line 1018 "wcsbth.l" +case 81: +YY_RULE_SETUP +#line 1018 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.csyer); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCSYna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCSYEn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 82: +#line 1035 "wcsbth.l" +case 83: +YY_RULE_SETUP +#line 1035 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.csyer); + + if (yyleng == 4) { + keyname = "TCSYna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCSYEn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 1049 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.czphs); + + keyname = "CZPHSia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 85: +#line 1058 "wcsbth.l" +case 86: +YY_RULE_SETUP +#line 1058 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.czphs); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCZPna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCZPHn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 87: +#line 1075 "wcsbth.l" +case 88: +YY_RULE_SETUP +#line 1075 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.czphs); + + if (yyleng == 4) { + keyname = "TCZPna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCZPHn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 1089 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cperi); + + keyname = "CPERIia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 90: +#line 1098 "wcsbth.l" +case 91: +YY_RULE_SETUP +#line 1098 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cperi); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCPRna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCPERn"; + BEGIN(iCCCCn); + } + } + YY_BREAK +case 92: +#line 1115 "wcsbth.l" +case 93: +YY_RULE_SETUP +#line 1115 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cperi); + + if (yyleng == 4) { + keyname = "TCPRna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCPERn"; + BEGIN(TCCCCn); + } + } + YY_BREAK +case 94: +#line 1130 "wcsbth.l" +case 95: +#line 1131 "wcsbth.l" +case 96: +YY_RULE_SETUP +#line 1131 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.wcsname; + + if (yyleng == 7) { + keyname = "WCSNAMEa"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else { + if (*yytext == 'W') { + keyname = "WCSNna"; + } else { + keyname = "TWCSna"; + } + BEGIN(CCCCna); + } + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 1150 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.timesys; + + keyname = "TIMESYS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 98: +#line 1159 "wcsbth.l" +case 99: +YY_RULE_SETUP +#line 1159 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.trefpos; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "TREFPOS"; + BEGIN(CCCCCCCC); + } else { + keyname = "TRPOSn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 100: +#line 1174 "wcsbth.l" +case 101: +YY_RULE_SETUP +#line 1174 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.trefdir; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "TREFDIR"; + BEGIN(CCCCCCCC); + } else { + keyname = "TRDIRn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 1188 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.plephem; + + keyname = "PLEPHEM"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 1196 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.timeunit; + + keyname = "TIMEUNIT"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 1204 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.dateref; + + keyname = "DATEREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 1212 "wcsbth.l" +{ + valtype = FLOAT2; + vptr = wcstem.mjdref; + + keyname = "MJDREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 1220 "wcsbth.l" +{ + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + + keyname = "MJDREFI"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 1229 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.mjdref + 1; + + keyname = "MJDREFF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 1237 "wcsbth.l" +{ + valtype = FLOAT2; + vptr = wcstem.mjdref; + special = wcsbth_jdref; + + keyname = "JDREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 1246 "wcsbth.l" +{ + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcsbth_jdrefi; + + keyname = "JDREFI"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 1256 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcsbth_jdreff; + + keyname = "JDREFF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 1265 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timeoffs); + + keyname = "TIMEOFFS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 1273 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.dateobs; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-OBS"; + imherit = 0; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 113: +#line 1284 "wcsbth.l" +case 114: +#line 1285 "wcsbth.l" +case 115: +YY_RULE_SETUP +#line 1285 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.dateobs; + + if (relax & WCSHDR_DOBSn) { + yyless(4); + + keyname = "DOBSn"; + BEGIN(CCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "DOBSn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 1304 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.datebeg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-BEG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 117: +#line 1314 "wcsbth.l" +case 118: +YY_RULE_SETUP +#line 1314 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.dateavg; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "DATE-AVG"; + BEGIN(CCCCCCCC); + } else { + keyname = "DAVGn"; + BEGIN(CCCCn); + } + } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 1328 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.dateend; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-END"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 120: +#line 1338 "wcsbth.l" +case 121: +YY_RULE_SETUP +#line 1338 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdobs); + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "MJD-OBS"; + imherit = 0; + BEGIN(CCCCCCCC); + } else { + keyname = "MJDOBn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 1353 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdbeg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-BEG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 123: +#line 1363 "wcsbth.l" +case 124: +YY_RULE_SETUP +#line 1363 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdavg); + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "MJD-AVG"; + BEGIN(CCCCCCCC); + } else { + keyname = "MJDAn"; + BEGIN(CCCCn); + } + } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 1377 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdend); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-END"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 1386 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.jepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "JEPOCH"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 1395 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.bepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "BEPOCH"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 1404 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.tstart); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTART"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 1413 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.tstop); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTOP"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 1422 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.xposure); + if (ctrl < -10) keep = keyrec; + + keyname = "XPOSURE"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 1431 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.telapse); + if (ctrl < -10) keep = keyrec; + + keyname = "TELAPSE"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 1440 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timsyer); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMSYER"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 1449 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timrder); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMRDER"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 1458 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timedel); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEDEL"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 1467 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timepixr); + chekval = wcsbth_timepixr; + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEPIXR"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 136: +#line 1478 "wcsbth.l" +case 137: +YY_RULE_SETUP +#line 1478 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-X"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGXn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 138: +#line 1493 "wcsbth.l" +case 139: +YY_RULE_SETUP +#line 1493 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 1; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-Y"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGYn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 140: +#line 1508 "wcsbth.l" +case 141: +YY_RULE_SETUP +#line 1508 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 2; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-Z"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGZn"; + BEGIN(CCCCCn); + } + } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 1522 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 3; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-L"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 143: +#line 1532 "wcsbth.l" +case 144: +#line 1533 "wcsbth.l" +case 145: +YY_RULE_SETUP +#line 1533 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGLn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGLn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 1552 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 4; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-B"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 147: +#line 1562 "wcsbth.l" +case 148: +#line 1563 "wcsbth.l" +case 149: +YY_RULE_SETUP +#line 1563 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGBn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGBn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 1582 "wcsbth.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 5; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-H"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 151: +#line 1592 "wcsbth.l" +case 152: +#line 1593 "wcsbth.l" +case 153: +YY_RULE_SETUP +#line 1593 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGHn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGHn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 1612 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.obsorbit; + + keyname = "OBSORBIT"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 155: +#line 1621 "wcsbth.l" +case 156: +YY_RULE_SETUP +#line 1621 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.radesys; + + if (yyleng == 7) { + keyname = "RADESYSa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "RADEna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 1635 "wcsbth.l" +{ + if (relax & WCSHDR_RADECSYS) { + valtype = STRING; + vptr = wcstem.radesys; + + unput(' '); + + keyname = "RADECSYS"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the RADECSYS keyword is deprecated, use RADESYSa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 1655 "wcsbth.l" +{ + sscanf(yytext, "EPOCH%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the EPOCH keyword is deprecated, use EQUINOXa"; + BEGIN(ERROR); + + } else if (a == ' ' || (relax & WCSHDR_EPOCHa)) { + valtype = FLOAT; + vptr = &(wcstem.equinox); + special = wcsbth_epoch; + + unput(a); + + keyname = "EPOCH"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "EPOCH keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 159: +#line 1683 "wcsbth.l" +case 160: +YY_RULE_SETUP +#line 1683 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.equinox); + + if (yyleng == 7) { + keyname = "EQUINOXa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "EQUIna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 161: +#line 1698 "wcsbth.l" +case 162: +YY_RULE_SETUP +#line 1698 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.specsys; + + if (yyleng == 7) { + keyname = "SPECSYSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SPECna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 163: +#line 1712 "wcsbth.l" +case 164: +YY_RULE_SETUP +#line 1712 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.ssysobs; + + if (yyleng == 7) { + keyname = "SSYSOBSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SOBSna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 165: +#line 1726 "wcsbth.l" +case 166: +YY_RULE_SETUP +#line 1726 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.velosys); + + if (yyleng == 7) { + keyname = "VELOSYSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "VSYSna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 1739 "wcsbth.l" +{ + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcsbth_vsource; + + yyless(7); + + keyname = "VSOURCEa"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the VSOURCEa keyword is deprecated, use ZSOURCEa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 168: +#line 1760 "wcsbth.l" +case 169: +#line 1761 "wcsbth.l" +case 170: +YY_RULE_SETUP +#line 1761 "wcsbth.l" +{ + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcsbth_vsource; + + yyless(4); + keyname = "VSOUna"; + BEGIN(CCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = "VSOUna keyword is deprecated, use ZSOUna"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 171: +#line 1782 "wcsbth.l" +case 172: +YY_RULE_SETUP +#line 1782 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.zsource); + + if (yyleng == 7) { + keyname = "ZSOURCEa"; + BEGIN(CCCCCCCa); + } else { + keyname = "ZSOUna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 173: +#line 1796 "wcsbth.l" +case 174: +YY_RULE_SETUP +#line 1796 "wcsbth.l" +{ + valtype = STRING; + vptr = wcstem.ssyssrc; + + if (yyleng == 7) { + keyname = "SSYSSRCa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SSRCna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 175: +#line 1810 "wcsbth.l" +case 176: +YY_RULE_SETUP +#line 1810 "wcsbth.l" +{ + valtype = FLOAT; + vptr = &(wcstem.velangl); + + if (yyleng == 7) { + keyname = "VELANGLa"; + BEGIN(CCCCCCCa); + } else { + keyname = "VANGna"; + BEGIN(CCCCna); + } + } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 1823 "wcsbth.l" +{ + if (wcsbth_nkeyrec) { + wcsbth_nkeyrec = 0; + errmsg = "keyrecords following the END keyrecord were ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 1833 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 179: +#line 1838 "wcsbth.l" +case 180: +YY_RULE_SETUP +#line 1838 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d%c", &i, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 181: +#line 1857 "wcsbth.l" +case 182: +YY_RULE_SETUP +#line 1857 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + if (relax & WCSHDR_reject) { + /* Violates the basic FITS standard. */ + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 183: +#line 1883 "wcsbth.l" +case 184: +#line 1884 "wcsbth.l" +case 185: +YY_RULE_SETUP +#line 1884 "wcsbth.l" +{ + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + if (relax & WCSHDR_ALLIMG) { + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 186: +YY_RULE_SETUP +#line 1903 "wcsbth.l" +{ + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "keyword looks very much like %s but isn't", + keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 187: +#line 1918 "wcsbth.l" +case 188: +#line 1919 "wcsbth.l" +case 189: +#line 1920 "wcsbth.l" +case 190: +#line 1921 "wcsbth.l" +case 191: +#line 1922 "wcsbth.l" +case 192: +YY_RULE_SETUP +#line 1922 "wcsbth.l" +{ + if (vptr) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCCCn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 193: +#line 1938 "wcsbth.l" +case 194: +#line 1939 "wcsbth.l" +case 195: +#line 1940 "wcsbth.l" +case 196: +YY_RULE_SETUP +#line 1940 "wcsbth.l" +{ + if (vptr && (relax & WCSHDR_LONGKEY)) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCCCn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + if (!vptr) { + sprintf(errmsg, "%s keyword is non-standard", keyname); + } else { + sprintf(errmsg, + "%s keyword may not have an alternate version code", keyname); + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 197: +#line 1962 "wcsbth.l" +case 198: +YY_RULE_SETUP +#line 1962 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 199: +#line 1967 "wcsbth.l" +case 200: +#line 1968 "wcsbth.l" +case 201: +#line 1969 "wcsbth.l" +case 202: +#line 1970 "wcsbth.l" +case 203: +#line 1971 "wcsbth.l" +case 204: +YY_RULE_SETUP +#line 1971 "wcsbth.l" +{ + sscanf(yytext, "%d%c", &n, &a); + if (YY_START == TCCCna) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCCCna) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + YY_BREAK +case 205: +#line 1979 "wcsbth.l" +case 206: +YY_RULE_SETUP +#line 1979 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 207: +#line 1984 "wcsbth.l" +case 208: +#line 1985 "wcsbth.l" +case 209: +#line 1986 "wcsbth.l" +case 210: +YY_RULE_SETUP +#line 1986 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 211: +#line 2005 "wcsbth.l" +case 212: +#line 2006 "wcsbth.l" +case 213: +#line 2007 "wcsbth.l" +case 214: +#line 2008 "wcsbth.l" +case 215: +#line 2009 "wcsbth.l" +case 216: +#line 2010 "wcsbth.l" +case 217: +#line 2011 "wcsbth.l" +case 218: +#line 2012 "wcsbth.l" +case 219: +#line 2013 "wcsbth.l" +case 220: +#line 2014 "wcsbth.l" +case 221: +#line 2015 "wcsbth.l" +case 222: +#line 2016 "wcsbth.l" +case 223: +#line 2017 "wcsbth.l" +case 224: +#line 2018 "wcsbth.l" +case 225: +#line 2019 "wcsbth.l" +case 226: +#line 2020 "wcsbth.l" +case 227: +#line 2021 "wcsbth.l" +case 228: +#line 2022 "wcsbth.l" +case 229: +#line 2023 "wcsbth.l" +case 230: +#line 2024 "wcsbth.l" +case 231: +YY_RULE_SETUP +#line 2024 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + if (((altlin == 1) && (relax & WCSHDR_PC0i_0ja)) || + ((altlin == 2) && (relax & WCSHDR_CD0i_0ja))) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 232: +#line 2055 "wcsbth.l" +case 233: +#line 2056 "wcsbth.l" +case 234: +#line 2057 "wcsbth.l" +case 235: +#line 2058 "wcsbth.l" +case 236: +#line 2059 "wcsbth.l" +case 237: +#line 2060 "wcsbth.l" +case 238: +#line 2061 "wcsbth.l" +case 239: +#line 2062 "wcsbth.l" +case 240: +#line 2063 "wcsbth.l" +case 241: +YY_RULE_SETUP +#line 2063 "wcsbth.l" +{ + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + if (relax & WCSHDR_ALLIMG) { + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 242: +#line 2083 "wcsbth.l" +case 243: +#line 2084 "wcsbth.l" +case 244: +#line 2085 "wcsbth.l" +case 245: +#line 2086 "wcsbth.l" +case 246: +#line 2087 "wcsbth.l" +case 247: +#line 2088 "wcsbth.l" +case 248: +#line 2089 "wcsbth.l" +case 249: +#line 2090 "wcsbth.l" +case 250: +#line 2091 "wcsbth.l" +case 251: +YY_RULE_SETUP +#line 2091 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 252: +YY_RULE_SETUP +#line 2110 "wcsbth.l" +{ + /* This covers the defunct forms CD00i00j and PC00i00j. */ + if (relax & WCSHDR_ALLIMG) { + if (((altlin == 1) && (relax & WCSHDR_PC00i00j)) || + ((altlin == 2) && (relax & WCSHDR_CD00i00j))) { + sscanf(yytext, "%3d%3d", &i, &j); + a = ' '; + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "this form of the %s keyword is deprecated, use %s", + keyname, keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "deprecated image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 253: +YY_RULE_SETUP +#line 2144 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 254: +#line 2149 "wcsbth.l" +case 255: +#line 2150 "wcsbth.l" +case 256: +YY_RULE_SETUP +#line 2150 "wcsbth.l" +{ + sscanf(yytext, "%d%c", &n, &a); + keytype = BIMGARR; + BEGIN(VALUE); + } + YY_BREAK +case 257: +#line 2157 "wcsbth.l" +case 258: +#line 2158 "wcsbth.l" +case 259: +#line 2159 "wcsbth.l" +case 260: +#line 2160 "wcsbth.l" +case 261: +#line 2161 "wcsbth.l" +case 262: +YY_RULE_SETUP +#line 2161 "wcsbth.l" +{ + if (relax & WCSHDR_LONGKEY) { + WCSBTH_PUTBACK; + BEGIN(TCn_ka); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 263: +YY_RULE_SETUP +#line 2177 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 264: +#line 2182 "wcsbth.l" +case 265: +#line 2183 "wcsbth.l" +case 266: +#line 2184 "wcsbth.l" +case 267: +#line 2185 "wcsbth.l" +case 268: +#line 2186 "wcsbth.l" +case 269: +YY_RULE_SETUP +#line 2186 "wcsbth.l" +{ + sscanf(yytext, "%d_%d%c", &n, &k, &a); + i = wcsbth_colax(*wcs, &alts, n, a); + j = wcsbth_colax(*wcs, &alts, k, a); + keytype = PIXLIST; + BEGIN(VALUE); + } + YY_BREAK +case 270: +#line 2195 "wcsbth.l" +case 271: +#line 2196 "wcsbth.l" +case 272: +#line 2197 "wcsbth.l" +case 273: +YY_RULE_SETUP +#line 2197 "wcsbth.l" +{ + sscanf(yytext, "%d_%d", &n, &k); + a = ' '; + i = wcsbth_colax(*wcs, &alts, n, a); + j = wcsbth_colax(*wcs, &alts, k, a); + keytype = PIXLIST; + BEGIN(VALUE); + } + YY_BREAK +case 274: +YY_RULE_SETUP +#line 2206 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 275: +#line 2211 "wcsbth.l" +case 276: +#line 2212 "wcsbth.l" +case 277: +YY_RULE_SETUP +#line 2212 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + a = ' '; + sscanf(yytext, "%d%c", &i, &a); + + if (relax & WCSHDR_strict) { + errmsg = "the CROTAn keyword is deprecated, use PCi_ja"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_CROTAia) { + yyless(0); + BEGIN(CCCCCia); + + } else if (relax & WCSHDR_reject) { + errmsg = "CROTAn keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "deprecated image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 278: +YY_RULE_SETUP +#line 2246 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + yyless(0); + BEGIN(CCCCCia); + } else { + /* Let it go. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 279: +#line 2257 "wcsbth.l" +case 280: +#line 2258 "wcsbth.l" +case 281: +#line 2259 "wcsbth.l" +case 282: +#line 2260 "wcsbth.l" +case 283: +#line 2261 "wcsbth.l" +case 284: +YY_RULE_SETUP +#line 2261 "wcsbth.l" +{ + WCSBTH_PUTBACK; + BEGIN((YY_START == iCROTn) ? iCCCna : TCCCna); + } + YY_BREAK +case 285: +#line 2267 "wcsbth.l" +case 286: +#line 2268 "wcsbth.l" +case 287: +#line 2269 "wcsbth.l" +case 288: +YY_RULE_SETUP +#line 2269 "wcsbth.l" +{ + if (relax & WCSHDR_CROTAia) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCROTn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "%s keyword may not have an alternate version code", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 289: +#line 2287 "wcsbth.l" +case 290: +YY_RULE_SETUP +#line 2287 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 291: +#line 2292 "wcsbth.l" +case 292: +YY_RULE_SETUP +#line 2292 "wcsbth.l" +{ + /* Image-header keyword. */ + if (imherit || (relax & (WCSHDR_AUXIMG | WCSHDR_ALLIMG))) { + if (YY_START == CCCCCCCa) { + sscanf(yytext, "%c", &a); + } else { + a = 0; + unput(yytext[0]); + } + keytype = IMGAUX; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 293: +YY_RULE_SETUP +#line 2316 "wcsbth.l" +{ + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "invalid alternate code, keyword resembles %s " + "but isn't", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 294: +#line 2331 "wcsbth.l" +case 295: +#line 2332 "wcsbth.l" +case 296: +#line 2333 "wcsbth.l" +case 297: +#line 2334 "wcsbth.l" +case 298: +YY_RULE_SETUP +#line 2334 "wcsbth.l" +{ + sscanf(yytext, "%d%c", &n, &a); + keytype = BINTAB; + BEGIN(VALUE); + } + YY_BREAK +case 299: +YY_RULE_SETUP +#line 2340 "wcsbth.l" +{ + sscanf(yytext, "%d", &n); + a = ' '; + keytype = BINTAB; + BEGIN(VALUE); + } + YY_BREAK +case 300: +#line 2348 "wcsbth.l" +case 301: +YY_RULE_SETUP +#line 2348 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 302: +#line 2353 "wcsbth.l" +case 303: +#line 2354 "wcsbth.l" +case 304: +#line 2355 "wcsbth.l" +case 305: +#line 2356 "wcsbth.l" +case 306: +#line 2357 "wcsbth.l" +case 307: +#line 2358 "wcsbth.l" +case 308: +YY_RULE_SETUP +#line 2358 "wcsbth.l" +{ + sscanf(yytext, "%d", &n); + a = 0; + keytype = BINTAB; + BEGIN(VALUE); + } + YY_BREAK +case 309: +#line 2366 "wcsbth.l" +case 310: +YY_RULE_SETUP +#line 2366 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 311: +#line 2371 "wcsbth.l" +case 312: +#line 2372 "wcsbth.l" +case 313: +#line 2373 "wcsbth.l" +case 314: +YY_RULE_SETUP +#line 2373 "wcsbth.l" +{ + /* Image-header keyword. */ + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 315: +#line 2393 "wcsbth.l" +case 316: +#line 2394 "wcsbth.l" +case 317: +#line 2395 "wcsbth.l" +case 318: +#line 2396 "wcsbth.l" +case 319: +#line 2397 "wcsbth.l" +case 320: +#line 2398 "wcsbth.l" +case 321: +#line 2399 "wcsbth.l" +case 322: +#line 2400 "wcsbth.l" +case 323: +#line 2401 "wcsbth.l" +case 324: +#line 2402 "wcsbth.l" +case 325: +#line 2403 "wcsbth.l" +case 326: +#line 2404 "wcsbth.l" +case 327: +#line 2405 "wcsbth.l" +case 328: +#line 2406 "wcsbth.l" +case 329: +#line 2407 "wcsbth.l" +case 330: +#line 2408 "wcsbth.l" +case 331: +#line 2409 "wcsbth.l" +case 332: +#line 2410 "wcsbth.l" +case 333: +#line 2411 "wcsbth.l" +case 334: +#line 2412 "wcsbth.l" +case 335: +YY_RULE_SETUP +#line 2412 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + if (((valtype == FLOAT) && (relax & WCSHDR_PV0i_0ma)) || + ((valtype == STRING) && (relax & WCSHDR_PS0i_0ma))) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 336: +#line 2443 "wcsbth.l" +case 337: +#line 2444 "wcsbth.l" +case 338: +#line 2445 "wcsbth.l" +case 339: +#line 2446 "wcsbth.l" +case 340: +#line 2447 "wcsbth.l" +case 341: +#line 2448 "wcsbth.l" +case 342: +#line 2449 "wcsbth.l" +case 343: +#line 2450 "wcsbth.l" +case 344: +#line 2451 "wcsbth.l" +case 345: +YY_RULE_SETUP +#line 2451 "wcsbth.l" +{ + if (relax & WCSHDR_ALLIMG) { + /* Anything that has fallen through to this point must contain */ + /* an invalid parameter. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 346: +#line 2471 "wcsbth.l" +case 347: +#line 2472 "wcsbth.l" +case 348: +#line 2473 "wcsbth.l" +case 349: +#line 2474 "wcsbth.l" +case 350: +#line 2475 "wcsbth.l" +case 351: +#line 2476 "wcsbth.l" +case 352: +#line 2477 "wcsbth.l" +case 353: +#line 2478 "wcsbth.l" +case 354: +#line 2479 "wcsbth.l" +case 355: +YY_RULE_SETUP +#line 2479 "wcsbth.l" +{ + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + YY_BREAK +case 356: +YY_RULE_SETUP +#line 2486 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 357: +#line 2491 "wcsbth.l" +case 358: +#line 2492 "wcsbth.l" +case 359: +#line 2493 "wcsbth.l" +case 360: +#line 2494 "wcsbth.l" +case 361: +#line 2495 "wcsbth.l" +case 362: +#line 2496 "wcsbth.l" +case 363: +#line 2497 "wcsbth.l" +case 364: +#line 2498 "wcsbth.l" +case 365: +#line 2499 "wcsbth.l" +case 366: +#line 2500 "wcsbth.l" +case 367: +#line 2501 "wcsbth.l" +case 368: +YY_RULE_SETUP +#line 2501 "wcsbth.l" +{ + if (relax & WCSHDR_LONGKEY) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCn_ma) ? iCn_ma : TCn_ma); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "the %s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 369: +#line 2518 "wcsbth.l" +case 370: +YY_RULE_SETUP +#line 2518 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 371: +#line 2523 "wcsbth.l" +case 372: +#line 2524 "wcsbth.l" +case 373: +#line 2525 "wcsbth.l" +case 374: +#line 2526 "wcsbth.l" +case 375: +#line 2527 "wcsbth.l" +case 376: +#line 2528 "wcsbth.l" +case 377: +#line 2529 "wcsbth.l" +case 378: +#line 2530 "wcsbth.l" +case 379: +#line 2531 "wcsbth.l" +case 380: +#line 2532 "wcsbth.l" +case 381: +#line 2533 "wcsbth.l" +case 382: +YY_RULE_SETUP +#line 2533 "wcsbth.l" +{ + sscanf(yytext, "%d_%d%c", &n, &m, &a); + if (YY_START == TCn_ma) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCn_ma) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + YY_BREAK +case 383: +#line 2541 "wcsbth.l" +case 384: +#line 2542 "wcsbth.l" +case 385: +#line 2543 "wcsbth.l" +case 386: +#line 2544 "wcsbth.l" +case 387: +#line 2545 "wcsbth.l" +case 388: +#line 2546 "wcsbth.l" +case 389: +#line 2547 "wcsbth.l" +case 390: +YY_RULE_SETUP +#line 2547 "wcsbth.l" +{ + /* Invalid combinations will be flagged by . */ + sscanf(yytext, "%d_%d", &n, &m); + a = ' '; + if (YY_START == TCn_ma) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCn_ma) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + YY_BREAK +case 391: +#line 2557 "wcsbth.l" +case 392: +YY_RULE_SETUP +#line 2557 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 393: +YY_RULE_SETUP +#line 2561 "wcsbth.l" +{ + if (relax & WCSHDR_PROJPn) { + sscanf(yytext, "%d", &m); + i = 0; + a = ' '; + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "the PROJPn keyword is deprecated, use PVi_ma"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 394: +#line 2580 "wcsbth.l" +case 395: +YY_RULE_SETUP +#line 2580 "wcsbth.l" +{ + if (relax & (WCSHDR_PROJPn | WCSHDR_reject)) { + errmsg = "invalid PROJPn keyword"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 396: +YY_RULE_SETUP +#line 2590 "wcsbth.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 397: +YY_RULE_SETUP +#line 2594 "wcsbth.l" +{ + /* Do checks on i, j, m, n, k. */ + if (!(keytype & keysel)) { + /* Selection by keyword type. */ + BEGIN(DISCARD); + + } else if (exclude[n] || exclude[k]) { + /* One or other column is not selected. */ + if (k && (exclude[n] != exclude[k])) { + /* For keywords such as TCn_ka, both columns must be excluded. + User error, so return immediately. */ + return 3; + + } else { + BEGIN(DISCARD); + } + + } else if (i > 99 || j > 99 || m > 99 || n > 999 || k > 999) { + if (relax & WCSHDR_reject) { + errmsg = errtxt; + if (i > 99 || j > 99) { + sprintf(errmsg, "axis number exceeds 99"); + } else if (m > 99) { + sprintf(errmsg, "parameter number exceeds 99"); + } else if (n > 999 || k > 999) { + sprintf(errmsg, "column number exceeds 999"); + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (ipass == 2 && npass == 3 && (keytype & BINTAB)) { + /* Skip keyvalues that won't be inherited. */ + BEGIN(FLUSH); + + } else { + if (ipass == 3 && (keytype & IMGHEAD)) { + /* IMGHEAD keytypes are always dealt with on the second pass. */ + /* However, they must be re-parsed in order to report errors. */ + vptr = 0x0; + } + + if (valtype == INTEGER) { + BEGIN(INTEGER_VAL); + } else if (valtype == FLOAT) { + BEGIN(FLOAT_VAL); + } else if (valtype == FLOAT2) { + BEGIN(FLOAT2_VAL); + } else if (valtype == STRING) { + BEGIN(STRING_VAL); + } else { + errmsg = errtxt; + sprintf(errmsg, "internal parser ERROR, bad data type: %d", + valtype); + BEGIN(ERROR); + } + } + } + YY_BREAK +case 398: +YY_RULE_SETUP +#line 2656 "wcsbth.l" +{ + errmsg = "invalid KEYWORD = VALUE syntax"; + BEGIN(ERROR); + } + YY_BREAK +case 399: +YY_RULE_SETUP +#line 2661 "wcsbth.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + sscanf(yytext, "%d", &inttmp); + + BEGIN(COMMENT); + } + } + YY_BREAK +case 400: +YY_RULE_SETUP +#line 2673 "wcsbth.l" +{ + errmsg = "an integer value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 401: +YY_RULE_SETUP +#line 2678 "wcsbth.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + wcsutil_str2double(yytext, &dbltmp); + + if (chekval && chekval(dbltmp)) { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } else { + BEGIN(COMMENT); + } + } + } + YY_BREAK +case 402: +YY_RULE_SETUP +#line 2695 "wcsbth.l" +{ + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 403: +YY_RULE_SETUP +#line 2700 "wcsbth.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue as integer and fractional parts. */ + wcsutil_str2double2(yytext, dbl2tmp); + + BEGIN(COMMENT); + } + } + YY_BREAK +case 404: +YY_RULE_SETUP +#line 2712 "wcsbth.l" +{ + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 405: +/* rule 405 can match eol */ +YY_RULE_SETUP +#line 2717 "wcsbth.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + strcpy(strtmp, yytext+1); + + /* Squeeze out repeated quotes. */ + ix = 0; + for (jx = 0; jx < 72; jx++) { + if (ix < jx) { + strtmp[ix] = strtmp[jx]; + } + + if (strtmp[jx] == '\0') { + if (ix) strtmp[ix-1] = '\0'; + break; + } else if (strtmp[jx] == '\'' && strtmp[jx+1] == '\'') { + jx++; + } + + ix++; + } + + BEGIN(COMMENT); + } + } + YY_BREAK +case 406: +YY_RULE_SETUP +#line 2746 "wcsbth.l" +{ + errmsg = "a string value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 407: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2751 "wcsbth.l" +{ + if (ipass == 1) { + /* Do first-pass bookkeeping. */ + wcsbth_pass1(keytype, i, j, n, k, a, ptype, &alts); + BEGIN(FLUSH); + + } else if (*wcs) { + /* Store the value now that the keyrecord has been validated. */ + alts.icol = 0; + alts.ialt = 0; + + /* Update each coordinate representation. */ + gotone = 0; + while ((wcsp = wcsbth_idx(*wcs, &alts, keytype, n, a))) { + gotone = 1; + + if (vptr) { + voff = (char *)vptr - (char *)(&wcstem); + wptr = (void *)((char *)wcsp + voff); + + if (valtype == INTEGER) { + *((int *)wptr) = inttmp; + + } else if (valtype == FLOAT) { + /* Apply keyword parameterization. */ + if (ptype == 'v') { + ipx = (wcsp->npv)++; + wcsp->pv[ipx].i = i; + wcsp->pv[ipx].m = m; + wptr = &(wcsp->pv[ipx].value); + + } else if (j) { + wptr = *((double **)wptr) + (i - 1)*(wcsp->naxis) + + (j - 1); + + } else if (i) { + wptr = *((double **)wptr) + (i - 1); + } + + if (special) { + special(wptr, &dbltmp); + } else { + *((double *)wptr) = dbltmp; + } + + /* Flag the presence of PCi_ja, or CDi_ja and/or CROTAia. */ + if (altlin) { + wcsp->altlin |= altlin; + altlin = 0; + } + + } else if (valtype == FLOAT2) { + /* Split MJDREF and JDREF into integer and fraction.*/ + if (special) { + special(wptr, dbl2tmp); + } else { + *((double *)wptr) = dbl2tmp[0]; + *((double *)wptr + 1) = dbl2tmp[1]; + } + + } else if (valtype == STRING) { + /* Apply keyword parameterization. */ + if (ptype == 's') { + ipx = wcsp->nps++; + wcsp->ps[ipx].i = i; + wcsp->ps[ipx].m = m; + wptr = wcsp->ps[ipx].value; + + } else if (j) { + wptr = *((char (**)[72])wptr) + + (i - 1)*(wcsp->naxis) + (j - 1); + + } else if (i) { + wptr = *((char (**)[72])wptr) + (i - 1); + } + + cptr = (char *)wptr; + strcpy(cptr, strtmp); + } + } + } + + if (ipass == npass) { + if (gotone) { + nvalid++; + if (ctrl == 4) { + wcsfprintf(stderr, + "%.80s\n Accepted (%d) as a valid WCS keyrecord.\n", + keyrec, nvalid); + } + + BEGIN(FLUSH); + + } else { + errmsg = "syntactically valid WCS keyrecord has no effect"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + + } else { + BEGIN(FLUSH); + } + } + YY_BREAK +case 408: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2858 "wcsbth.l" +{ + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + YY_BREAK +case 409: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2863 "wcsbth.l" +{ + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + YY_BREAK +case 410: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2868 "wcsbth.l" +{ + errmsg = "invalid keyvalue or malformed keycomment"; + BEGIN(ERROR); + } + YY_BREAK +case 411: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2873 "wcsbth.l" +{ + errmsg = "malformed keycomment"; + BEGIN(ERROR); + } + YY_BREAK +case 412: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2878 "wcsbth.l" +{ + if (ipass == npass) { + if (ctrl < 0) { + /* Preserve discards. */ + keep = keyrec; + + } else if (2 < ctrl) { + nother++; + wcsfprintf(stderr, "%.80s\n Not a recognized WCS keyword.\n", + keyrec); + } + } + BEGIN(FLUSH); + } + YY_BREAK +case 413: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2893 "wcsbth.l" +{ + if (ipass == npass) { + (*nreject)++; + + if (ctrl%10 == -1) { + keep = keyrec; + } + + if (1 < abs(ctrl%10)) { + wcsfprintf(stderr, "%.80s\n Rejected (%d), %s.\n", + keyrec, *nreject, errmsg); + } + } + BEGIN(FLUSH); + } + YY_BREAK +case 414: +/* rule 414 can match eol */ +YY_RULE_SETUP +#line 2909 "wcsbth.l" +{ + if (ipass == npass && keep) { + if (hptr < keep) { + strncpy(hptr, keep, 80); + } + hptr += 80; + } + + /* Throw away the rest of the line and reset for the next one. */ + i = j = 0; + n = k = 0; + m = 0; + a = ' '; + + keyrec += 80; + + keytype = 0; + valtype = -1; + vptr = 0x0; + keep = 0x0; + + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + BEGIN(INITIAL); + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(CCCCCia): +case YY_STATE_EOF(iCCCna): +case YY_STATE_EOF(iCCCCn): +case YY_STATE_EOF(TCCCna): +case YY_STATE_EOF(TCCCCn): +case YY_STATE_EOF(CCi_ja): +case YY_STATE_EOF(ijCCna): +case YY_STATE_EOF(TCn_ka): +case YY_STATE_EOF(TCCn_ka): +case YY_STATE_EOF(CROTAi): +case YY_STATE_EOF(iCROTn): +case YY_STATE_EOF(TCROTn): +case YY_STATE_EOF(CCi_ma): +case YY_STATE_EOF(iCn_ma): +case YY_STATE_EOF(iCCn_ma): +case YY_STATE_EOF(TCn_ma): +case YY_STATE_EOF(TCCn_ma): +case YY_STATE_EOF(PROJPm): +case YY_STATE_EOF(CCCCCCCC): +case YY_STATE_EOF(CCCCCCCa): +case YY_STATE_EOF(CCCCna): +case YY_STATE_EOF(CCCCCna): +case YY_STATE_EOF(CCCCn): +case YY_STATE_EOF(CCCCCn): +case YY_STATE_EOF(VALUE): +case YY_STATE_EOF(INTEGER_VAL): +case YY_STATE_EOF(FLOAT_VAL): +case YY_STATE_EOF(FLOAT2_VAL): +case YY_STATE_EOF(STRING_VAL): +case YY_STATE_EOF(COMMENT): +case YY_STATE_EOF(DISCARD): +case YY_STATE_EOF(ERROR): +case YY_STATE_EOF(FLUSH): +#line 2938 "wcsbth.l" +{ + /* End-of-input. */ + if (ipass == 1) { + if ((status = wcsbth_init1(&alts, nwcs, wcs)) || + (*nwcs == 0 && ctrl == 0)) { + return status; + } + + if (2 < abs(ctrl%10)) { + if (*nwcs == 1) { + if (strcmp(wcs[0]->wcsname, "DEFAULTS") != 0) { + wcsfprintf(stderr, "Found one coordinate representation.\n"); + } + } else { + wcsfprintf(stderr, "Found %d coordinate representations.\n", + *nwcs); + } + } + + if (alts.imgherit) npass = 3; + } + + if (ipass++ < npass) { + wcsbth_hdr = header; + wcsbth_nkeyrec = nkeyrec; + keyrec = header; + *nreject = 0; + + imherit = 1; + + i = j = 0; + k = n = 0; + m = 0; + a = ' '; + + keytype = 0; + valtype = -1; + vptr = 0x0; + + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + yyrestart(yyin, yyscanner); + + } else { + + if (ctrl < 0) { + *hptr = '\0'; + } else if (ctrl == 1) { + wcsfprintf(stderr, "%d WCS keyrecord%s rejected.\n", + *nreject, (*nreject==1)?" was":"s were"); + } else if (ctrl == 4) { + wcsfprintf(stderr, "\n"); + wcsfprintf(stderr, "%5d keyrecord%s rejected for syntax or " + "other errors,\n", *nreject, (*nreject==1)?" was":"s were"); + wcsfprintf(stderr, "%5d %s recognized as syntactically valid, " + "and\n", nvalid, (nvalid==1)?"was":"were"); + wcsfprintf(stderr, "%5d other%s were not recognized as WCS " + "keyrecords.\n", nother, (nother==1)?"":"s"); + } + + return wcsbth_final(&alts, nwcs, wcs); + } + } + YY_BREAK +case 415: +YY_RULE_SETUP +#line 3005 "wcsbth.l" +ECHO; + YY_BREAK +#line 28565 "wcsbth.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + if ( *yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; + } + else + yy_current_state = yy_NUL_trans[yy_current_state]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + yy_current_state = yy_NUL_trans[yy_current_state]; + yy_is_jam = (yy_current_state == 0); + + if ( ! yy_is_jam ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) +{ + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_cp = yyg->yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yyg->yy_hold_char; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + yyg->yytext_ptr = yy_bp; + yyg->yy_hold_char = *yy_cp; + yyg->yy_c_buf_p = yy_cp; +} + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 3005 "wcsbth.l" + + +/*---------------------------------------------------------------------------- +* Perform first-pass tasks: +* +* 1) Count the number of coordinate axes in each of the 27 possible alternate +* image-header coordinate representations. Also count the number of PVi_ma +* and PSi_ma keywords in each representation. +* +* 2) Determine the number of binary table columns that have an image array +* with a coordinate representation (up to 999), and count the number of +* coordinate axes in each of the 27 possible alternates. Also count the +* number of iVn_ma and iSn_ma keywords in each representation. +* +* 3) Determine the number of alternate pixel list coordinate representations +* (up to 27) and the table columns associated with each. Also count the +* number of TVn_ma and TSn_ma keywords in each representation. +* +* In the first pass alts->arridx[icol][27] is used to determine the number of +* axes in each of 27 possible image-header coordinate descriptions (icol == 0) +* and each of the 27 possible coordinate representations for an image array in +* each column. +* +* The elements of alts->pixlist[icol] are used as bit arrays to flag which of +* the 27 possible pixel list coordinate representations are associated with +* each table column. +*---------------------------------------------------------------------------*/ + +int wcsbth_pass1( + int keytype, + int i, + int j, + int n, + int k, + char a, + char ptype, + struct wcsbth_alts *alts) + +{ + int ialt, icol, mask, ncol; + + if (a == 0) { + /* Keywords such as DATE-OBS go along for the ride. */ + return 0; + } + + ncol = alts->ncol; + + /* Do we need to allocate memory for alts? */ + if (alts->arridx == 0x0) { + if (ncol == 0) { + /* Can only happen if TFIELDS is missing or out-of-sequence. If n and + k are both zero then we may be processing an image header so leave + ncol alone - the array will be realloc'd later if required. */ + if (n || k) { + /* The header is mangled, assume the worst. */ + ncol = 999; + } + } + + if (!(alts->arridx = calloc((1 + ncol)*27, sizeof(short int))) || + !(alts->npv = calloc((1 + ncol)*27, sizeof(unsigned char))) || + !(alts->nps = calloc((1 + ncol)*27, sizeof(unsigned char))) || + !(alts->pixlist = calloc((1 + ncol), sizeof(unsigned int)))) { + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + return 2; + } + + alts->ncol = ncol; + + } else if (n > ncol || k > ncol) { + /* Can only happen if TFIELDS or the WCS keyword is wrong; carry on. */ + ncol = 999; + if (!(alts->arridx = realloc(alts->arridx, + 27*(1 + ncol)*sizeof(short int))) || + !(alts->npv = realloc(alts->npv, + 27*(1 + ncol)*sizeof(unsigned char))) || + !(alts->nps = realloc(alts->nps, + 27*(1 + ncol)*sizeof(unsigned char))) || + !(alts->pixlist = realloc(alts->pixlist, + (1 + ncol)*sizeof(unsigned int)))) { + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + return 2; + } + + /* Since realloc() doesn't initialize the extra memory. */ + for (icol = (1 + alts->ncol); icol < (1 + ncol); icol++) { + for (ialt = 0; ialt < 27; ialt++) { + alts->arridx[icol][ialt] = 0; + alts->npv[icol][ialt] = 0; + alts->nps[icol][ialt] = 0; + alts->pixlist[icol] = 0; + } + } + + alts->ncol = ncol; + } + + ialt = 0; + if (a != ' ') { + ialt = a - 'A' + 1; + } + + /* A BINTAB keytype such as LONPna, in conjunction with an IMGAXIS keytype + causes a table column to be recognized as an image array. */ + if (keytype & IMGHEAD || keytype & BIMGARR) { + /* n == 0 is expected for IMGHEAD keywords. */ + if (i == 0 && j == 0) { + if (alts->arridx[n][ialt] == 0) { + /* Flag that an auxiliary keyword was seen. */ + alts->arridx[n][ialt] = -1; + } + + } else { + /* Record the maximum axis number found. */ + if (alts->arridx[n][ialt] < i) { + alts->arridx[n][ialt] = i; + } + + if (alts->arridx[n][ialt] < j) { + alts->arridx[n][ialt] = j; + } + } + + if (ptype == 'v') { + alts->npv[n][ialt]++; + } else if (ptype == 's') { + alts->nps[n][ialt]++; + } + } + + /* BINTAB keytypes, which apply both to pixel lists as well as binary table + image arrays, never contribute to recognizing a table column as a pixel + list axis. A PIXLIST keytype is required for that. */ + if (keytype == PIXLIST) { + mask = 1 << ialt; + + /* n > 0 for PIXLIST keytypes. */ + alts->pixlist[n] |= mask; + if (k) alts->pixlist[k] |= mask; + + /* Used as a flag over all columns. */ + alts->pixlist[0] |= mask; + + if (ptype == 'v') { + alts->pixnpv[ialt]++; + } else if (ptype == 's') { + alts->pixnps[ialt]++; + } + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Perform initializations at the end of the first pass: +* +* 1) Determine the required number of wcsprm structs, allocate memory for +* an array of them and initialize each one. +*---------------------------------------------------------------------------*/ + +int wcsbth_init1( + struct wcsbth_alts *alts, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, icol, inherit[27], ix, mask, ncol, npsmax, npvmax, status = 0; + struct wcsprm *wcsp; + + + if (alts->arridx == 0x0) { + *nwcs = 0; + return 0; + } + + /* Determine the number of axes in each pixel list representation. */ + ncol = alts->ncol; + for (ialt = 0, mask = 1; ialt < 27; ialt++, mask <<= 1) { + alts->pixidx[ialt] = 0; + + if (alts->pixlist[0] | mask) { + for (icol = 1; icol <= ncol; icol++) { + if (alts->pixlist[icol] & mask) { + alts->pixidx[ialt]++; + } + } + } + } + + /* Find the total number of coordinate representations. */ + *nwcs = 0; + alts->imgherit = 0; + for (ialt = 0; ialt < 27; ialt++) { + inherit[ialt] = 0; + + for (icol = 1; icol <= ncol; icol++) { + if (alts->arridx[icol][ialt] < 0) { + /* No BIMGARR keytype but there's at least one BINTAB. */ + if (alts->arridx[0][ialt] > 0) { + /* There is an IMGAXIS keytype that we will inherit, so count this + representation. */ + alts->arridx[icol][ialt] = alts->arridx[0][ialt]; + } else { + alts->arridx[icol][ialt] = 0; + } + } + + if (alts->arridx[icol][ialt]) { + if (alts->arridx[0][ialt]) { + /* All IMGHEAD keywords are inherited for this ialt. */ + inherit[ialt] = 1; + + if (alts->arridx[icol][ialt] < alts->arridx[0][ialt]) { + /* The extra axes are also inherited. */ + alts->arridx[icol][ialt] = alts->arridx[0][ialt]; + } + } + + (*nwcs)++; + } + } + + /* Count every "a" found in any IMGHEAD keyword... */ + if (alts->arridx[0][ialt]) { + if (inherit[ialt]) { + /* ...but not if the IMGHEAD keywords will be inherited. */ + alts->arridx[0][ialt] = 0; + alts->imgherit = 1; + } else if (alts->arridx[0][ialt] > 0) { + (*nwcs)++; + } + } + + /* We need a struct for every "a" found in a PIXLIST keyword. */ + if (alts->pixidx[ialt]) { + (*nwcs)++; + } + } + + + if (*nwcs) { + /* Allocate memory for the required number of wcsprm structs. */ + if (!(*wcs = calloc(*nwcs, sizeof(struct wcsprm)))) { + return 2; + } + + /* Initialize each wcsprm struct. */ + wcsp = *wcs; + *nwcs = 0; + for (icol = 0; icol <= ncol; icol++) { + for (ialt = 0; ialt < 27; ialt++) { + if (alts->arridx[icol][ialt] > 0) { + /* Image-header representations that are not for inheritance + (icol == 0) or binary table image array representations. */ + wcsp->flag = -1; + npvmax = alts->npv[icol][ialt]; + npsmax = alts->nps[icol][ialt]; + if ((status = wcsinit(1, (int)(alts->arridx[icol][ialt]), wcsp, + npvmax, npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record the table column number. */ + wcsp->colnum = icol; + + /* On the second pass alts->arridx[icol][27] indexes the array of + wcsprm structs. */ + alts->arridx[icol][ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that this column has no WCS for this "a". */ + alts->arridx[icol][ialt] = -1; + } + } + } + + for (ialt = 0; ialt < 27; ialt++) { + if (alts->pixidx[ialt]) { + /* Pixel lists representations. */ + wcsp->flag = -1; + npvmax = alts->pixnpv[ialt]; + npsmax = alts->pixnps[ialt]; + if ((status = wcsinit(1, (int)(alts->pixidx[ialt]), wcsp, npvmax, + npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record the pixel list column numbers. */ + mask = (1 << ialt); + for (icol = 1, ix = 0; icol <= ncol; icol++) { + if (alts->pixlist[icol] & mask) { + wcsp->colax[ix++] = icol; + } + } + + /* alts->pixidx[] indexes the array of wcsprm structs. */ + alts->pixidx[ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that this column is not a pixel list axis for this "a". */ + alts->pixidx[ialt] = -1; + } + } + } + + return status; +} + + +/*---------------------------------------------------------------------------- +* Return a pointer to the next wcsprm struct for a particular column number +* and alternate. +*---------------------------------------------------------------------------*/ + +struct wcsprm *wcsbth_idx( + struct wcsprm *wcs, + struct wcsbth_alts *alts, + int keytype, + int n, + char a) + +{ + const char as[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iwcs; + + if (!wcs) return 0x0; + + iwcs = -1; + for (; iwcs < 0 && alts->ialt < 27; alts->ialt++) { + /* Note that a == 0 applies to every alternate, otherwise this + loop simply determines the appropriate value of alts->ialt. */ + if (a && a != as[alts->ialt]) continue; + + if (keytype & (IMGHEAD | BIMGARR)) { + for (; iwcs < 0 && alts->icol <= alts->ncol; alts->icol++) { + /* Image header keywords, n == 0, apply to all columns, otherwise this + loop simply determines the appropriate value of alts->icol. */ + if (n && n != alts->icol) continue; + iwcs = alts->arridx[alts->icol][alts->ialt]; + } + + /* Break out of the loop to stop alts->ialt from being incremented. */ + if (iwcs >= 0) break; + + /* Start from scratch for the next alts->ialt. */ + alts->icol = 0; + } + + if (keytype & (IMGAUX | PIXLIST)) { + iwcs = alts->pixidx[alts->ialt]; + } + } + + return (iwcs >= 0) ? (wcs + iwcs) : 0x0; +} + + +/*---------------------------------------------------------------------------- +* Return the axis number associated with the specified column number in a +* particular pixel list coordinate representation. +*---------------------------------------------------------------------------*/ + +int wcsbth_colax( + struct wcsprm *wcs, + struct wcsbth_alts *alts, + int n, + char a) + +{ + int ix; + struct wcsprm *wcsp; + + if (!wcs) return 0; + + wcsp = wcs; + if (a != ' ') { + wcsp += alts->pixidx[a-'A'+1]; + } + + for (ix = 0; ix < wcsp->naxis; ix++) { + if (wcsp->colax[ix] == n) { + return ++ix; + } + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret the JDREF, JDREFI, and JDREFF keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_jdref(double *mjdref, const double *jdref) + +{ + /* Set MJDREF from JDREF. */ + if (undefined(mjdref[0] && undefined(mjdref[1]))) { + mjdref[0] = jdref[0] - 2400000.0; + mjdref[1] = jdref[1] - 0.5; + + if (mjdref[1] < 0.0) { + mjdref[0] -= 1.0; + mjdref[1] += 1.0; + } + } + + return 0; +} + +int wcsbth_jdrefi(double *mjdref, const double *jdrefi) + +{ + /* Set the integer part of MJDREF from JDREFI. */ + if (undefined(mjdref[0])) { + mjdref[0] = *jdrefi - 2400000.5; + } + + return 0; +} + + +int wcsbth_jdreff(double *mjdref, const double *jdreff) + +{ + /* Set the fractional part of MJDREF from JDREFF. */ + if (undefined(mjdref[1])) { + mjdref[1] = *jdreff; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret EPOCHa keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_epoch(double *equinox, const double *epoch) + +{ + /* If EQUINOXa is currently undefined then set it from EPOCHa. */ + if (undefined(*equinox)) { + *equinox = *epoch; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret VSOURCEa keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_vsource(double *zsource, const double *vsource) + +{ + double beta, c = 299792458.0; + + /* If ZSOURCEa is currently undefined then set it from VSOURCEa. */ + if (undefined(*zsource)) { + /* Convert relativistic Doppler velocity to redshift. */ + beta = *vsource/c; + *zsource = (1.0 + beta)/sqrt(1.0 - beta*beta) - 1.0; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Check validity of a TIMEPIXR keyvalue. +*---------------------------------------------------------------------------*/ + +int wcsbth_timepixr(double timepixr) + +{ + return (timepixr < 0.0 || 1.0 < timepixr); +} + + +/*---------------------------------------------------------------------------- +* Tie up loose ends. +*---------------------------------------------------------------------------*/ + +int wcsbth_final( + struct wcsbth_alts *alts, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, status; + + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + + for (ialt = 0; ialt < *nwcs; ialt++) { + /* Interpret -TAB header keywords. */ + if ((status = wcstab(*wcs+ialt))) { + wcsvfree(nwcs, wcs); + return status; + } + } + + return 0; +} + diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcspih.c b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcspih.c new file mode 100644 index 0000000000000000000000000000000000000000..62313e6c88b1373ea4888d9ecf7da9a6aaa35af4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcspih.c @@ -0,0 +1,24793 @@ +#line 2 "wcspih.c" + +#line 4 "wcspih.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define wcspih_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer wcspih_create_buffer +#endif + +#ifdef yy_delete_buffer +#define wcspih_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer wcspih_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define wcspih_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer wcspih_scan_buffer +#endif + +#ifdef yy_scan_string +#define wcspih_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string wcspih_scan_string +#endif + +#ifdef yy_scan_bytes +#define wcspih_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes wcspih_scan_bytes +#endif + +#ifdef yy_init_buffer +#define wcspih_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer wcspih_init_buffer +#endif + +#ifdef yy_flush_buffer +#define wcspih_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer wcspih_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define wcspih_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state wcspih_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define wcspih_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer wcspih_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define wcspihpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state wcspihpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define wcspihpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state wcspihpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define wcspihensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack wcspihensure_buffer_stack +#endif + +#ifdef yylex +#define wcspihlex_ALREADY_DEFINED +#else +#define yylex wcspihlex +#endif + +#ifdef yyrestart +#define wcspihrestart_ALREADY_DEFINED +#else +#define yyrestart wcspihrestart +#endif + +#ifdef yylex_init +#define wcspihlex_init_ALREADY_DEFINED +#else +#define yylex_init wcspihlex_init +#endif + +#ifdef yylex_init_extra +#define wcspihlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra wcspihlex_init_extra +#endif + +#ifdef yylex_destroy +#define wcspihlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy wcspihlex_destroy +#endif + +#ifdef yyget_debug +#define wcspihget_debug_ALREADY_DEFINED +#else +#define yyget_debug wcspihget_debug +#endif + +#ifdef yyset_debug +#define wcspihset_debug_ALREADY_DEFINED +#else +#define yyset_debug wcspihset_debug +#endif + +#ifdef yyget_extra +#define wcspihget_extra_ALREADY_DEFINED +#else +#define yyget_extra wcspihget_extra +#endif + +#ifdef yyset_extra +#define wcspihset_extra_ALREADY_DEFINED +#else +#define yyset_extra wcspihset_extra +#endif + +#ifdef yyget_in +#define wcspihget_in_ALREADY_DEFINED +#else +#define yyget_in wcspihget_in +#endif + +#ifdef yyset_in +#define wcspihset_in_ALREADY_DEFINED +#else +#define yyset_in wcspihset_in +#endif + +#ifdef yyget_out +#define wcspihget_out_ALREADY_DEFINED +#else +#define yyget_out wcspihget_out +#endif + +#ifdef yyset_out +#define wcspihset_out_ALREADY_DEFINED +#else +#define yyset_out wcspihset_out +#endif + +#ifdef yyget_leng +#define wcspihget_leng_ALREADY_DEFINED +#else +#define yyget_leng wcspihget_leng +#endif + +#ifdef yyget_text +#define wcspihget_text_ALREADY_DEFINED +#else +#define yyget_text wcspihget_text +#endif + +#ifdef yyget_lineno +#define wcspihget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno wcspihget_lineno +#endif + +#ifdef yyset_lineno +#define wcspihset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno wcspihset_lineno +#endif + +#ifdef yyget_column +#define wcspihget_column_ALREADY_DEFINED +#else +#define yyget_column wcspihget_column +#endif + +#ifdef yyset_column +#define wcspihset_column_ALREADY_DEFINED +#else +#define yyset_column wcspihset_column +#endif + +#ifdef yywrap +#define wcspihwrap_ALREADY_DEFINED +#else +#define yywrap wcspihwrap +#endif + +#ifdef yyalloc +#define wcspihalloc_ALREADY_DEFINED +#else +#define yyalloc wcspihalloc +#endif + +#ifdef yyrealloc +#define wcspihrealloc_ALREADY_DEFINED +#else +#define yyrealloc wcspihrealloc +#endif + +#ifdef yyfree +#define wcspihfree_ALREADY_DEFINED +#else +#define yyfree wcspihfree +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define wcspihwrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static const flex_int16_t yy_nxt[][128] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56 + }, + + { + 55, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 58, 59, 60, 61, 62, + 57, 57, 57, 57, 63, 57, 64, 65, 66, 67, + 68, 57, 69, 70, 71, 57, 72, 73, 74, 75, + 76, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57 + }, + + { + 55, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 56, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 78, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 55, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 56, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 78, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 + }, + + { + 55, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 56, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 81, 82, + + 82, 82, 82, 82, 82, 82, 82, 82, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80 + }, + + { + 55, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 56, 80, 80, 80, 80, 80, 80, 80, 80, 80, + + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 81, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + + 80, 80, 80, 80, 80, 80, 80, 80 + }, + + { + 55, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 56, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 84, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83 + }, + + { + 55, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 56, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 84, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 83, 83, + + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83 + }, + + { + 55, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 56, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 87, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86 + + }, + + { + 55, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 56, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 87, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86 + }, + + { + 55, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 56, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 90, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89 + }, + + { + 55, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 56, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 90, 89, 89, 89, 89, 89, 89, 89, + + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89 + }, + + { + 55, 91, 91, 91, 91, 91, 91, 91, 91, 91, + + 56, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91 + }, + + { + 55, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 56, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91 + }, + + { + 55, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 56, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, + + 93, 93, 93, 93, 93, 93, 93, 93, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92 + }, + + { + 55, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 56, 92, 92, 92, 92, 92, 92, 92, 92, 92, + + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + + 92, 92, 92, 92, 92, 92, 92, 92 + }, + + { + 55, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 56, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94 + }, + + { + 55, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 56, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 94, 94, + + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94 + }, + + { + 55, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 56, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96 + + }, + + { + 55, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 56, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96 + }, + + { + 55, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 56, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98 + }, + + { + 55, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 56, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + + 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98 + }, + + { + 55, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 56, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 55, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 56, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100 + }, + + { + 55, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 56, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102 + }, + + { + 55, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 56, 102, 102, 102, 102, 102, 102, 102, 102, 102, + + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + + 102, 102, 102, 102, 102, 102, 102, 102 + }, + + { + 55, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 56, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 105, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104 + }, + + { + 55, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 56, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + + 104, 105, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104 + }, + + { + 55, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 56, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 107, 106, 107, 106, 106, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106 + + }, + + { + 55, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 56, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 107, 106, 107, 106, 106, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106 + }, + + { + 55, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 56, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 110, 109, 110, 111, 109, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109 + }, + + { + 55, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 56, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + + 109, 109, 109, 110, 109, 110, 111, 109, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109 + }, + + { + 55, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 56, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 114, 113, 114, 115, 113, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113 + }, + + { + 55, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 56, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 114, 113, 114, 115, 113, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113 + }, + + { + 55, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 56, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117 + }, + + { + 55, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 56, 117, 117, 117, 117, 117, 117, 117, 117, 117, + + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, + + 117, 117, 117, 117, 117, 117, 117, 117 + }, + + { + 55, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 56, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119 + }, + + { + 55, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 56, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119 + }, + + { + 55, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 56, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 121, 121, 121, 121, 122, 121, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 121, 121, 121, 121, 121 + + }, + + { + 55, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 56, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 121, 121, 121, 121, 122, 121, 122, 122, 122, + + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 121, 121, 121, 121, 121 + }, + + { + 55, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 56, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 124, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123 + }, + + { + 55, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 56, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 124, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123 + }, + + { + 55, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 56, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 126, 125, 126, 127, 125, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + 55, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 56, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 126, 125, 126, 127, 125, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 129, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56 + }, + + { + 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 129, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 56, 56, 56, 56, 56, 56, 56 + }, + + { + 55, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 132, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 133, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130 + }, + + { + 55, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 132, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 133, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130 + }, + + { + 55, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 135, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134 + + }, + + { + 55, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 135, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134 + }, + + { + 55, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 137, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136 + }, + + { + 55, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 137, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136 + }, + + { + 55, 138, 138, 138, 138, 138, 138, 138, 138, 138, + + 139, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138 + }, + + { + 55, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 139, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138 + }, + + { + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55 + }, + + { + 55, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56 + }, + + { + 55, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57 + }, + + { + 55, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, 140, -58, -58, + 141, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, 142, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58 + }, + + { + 55, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, 143, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + 144, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, 145, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59 + + }, + + { + 55, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, 146, -60, + -60, -60, -60, -60, -60, -60, -60, -60, 147, -60, + 148, 149, 150, 151, 152, 153, -60, -60, -60, -60, + 154, -60, -60, -60, -60, -60, -60, -60, -60, -60, + + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60 + }, + + { + 55, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, 155, -61, -61, -61, -61, + + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + 156, 157, -61, -61, -61, -61, 158, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61 + }, + + { + 55, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, 159, -62, + 160, 161, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62 + }, + + { + 55, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, 162, 163, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63 + }, + + { + 55, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, 164, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, 165, + + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64 + }, + + { + 55, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, 166, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65 + }, + + { + 55, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, 167, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66 + }, + + { + 55, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, 168, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67 + }, + + { + 55, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + + -68, -68, -68, -68, -68, -68, -68, 169, -68, -68, + -68, -68, -68, -68, -68, -68, 170, -68, -68, -68, + 171, -68, 172, 173, -68, -68, 174, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68 + }, + + { + 55, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, 175, -69, -69, -69, 176, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69 + + }, + + { + 55, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + 177, -70, -70, 178, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70 + }, + + { + 55, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, 179, + + -71, -71, -71, 180, -71, -71, -71, -71, -71, -71, + -71, -71, 181, 182, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71 + }, + + { + 55, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, 183, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, 184, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72 + }, + + { + 55, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, 185, -73, 186, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73 + }, + + { + 55, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + + 187, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74 + }, + + { + 55, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + 188, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75 + }, + + { + 55, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, 189, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76 + }, + + { + 55, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77 + }, + + { + 55, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, 190, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, 191, 192, + 192, 192, 192, 192, 192, 192, 192, 192, -78, -78, + + -78, -78, -78, -78, -78, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78 + }, + + { + 55, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + + -79, -79, 193, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, -79, -79, + -79, -79, -79, -79, -79, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79 + + }, + + { + 55, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80 + }, + + { + 55, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, 195, -81, -81, 196, 197, + 197, 197, 197, 197, 197, 197, 197, 197, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, 198, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81 + }, + + { + 55, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + + -82, -82, -82, -82, -82, 195, -82, -82, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, 200, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82 + }, + + { + 55, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83 + }, + + { + 55, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, 201, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, 202, 203, + 203, 203, 203, 203, 203, 203, 203, 203, -84, -84, + -84, -84, -84, -84, -84, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84 + }, + + { + 55, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, 204, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, 205, 205, + + 205, 205, 205, 205, 205, 205, 205, 205, -85, -85, + -85, -85, -85, -85, -85, 204, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 204, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85 + }, + + { + 55, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86 + }, + + { + 55, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, 206, -87, -87, 207, 208, + 208, 208, 208, 208, 208, 208, 208, 208, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, 209, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87 + }, + + { + 55, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, 206, -88, -88, 210, 210, + 210, 210, 210, 210, 210, 210, 210, 210, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, 211, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88 + }, + + { + 55, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89 + + }, + + { + 55, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90 + }, + + { + 55, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91 + }, + + { + 55, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92 + }, + + { + 55, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, 212, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, -93, -93, + -93, -93, -93, -93, -93, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93 + }, + + { + 55, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94 + }, + + { + 55, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, 214, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, 215, 215, + + 215, 215, 215, 215, 215, 215, 215, 215, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95 + }, + + { + 55, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96 + }, + + { + 55, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + + -97, -97, -97, -97, -97, 216, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97 + }, + + { + 55, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98 + }, + + { + 55, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, 217, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99 + + }, + + { + 55, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100 + }, + + { + 55, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, 218, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101 + }, + + { + 55, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102 + }, + + { + 55, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, 220, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103 + }, + + { + 55, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104 + }, + + { + 55, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, 221, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105 + }, + + { + 55, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106 + }, + + { + 55, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107 + }, + + { + 55, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, -108, -108, + + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108 + }, + + { + 55, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109 + + }, + + { + 55, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, 223, -110, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110 + }, + + { + 55, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111 + }, + + { + 55, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + + -112, -112, -112, -112, -112, -112, 226, -112, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, 228, 228, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + 228, 228, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112 + }, + + { + 55, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113 + }, + + { + 55, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, 229, -114, 230, 230, + 230, 230, 230, 230, 230, 230, 230, 230, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114 + }, + + { + 55, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, 231, 231, + + 231, 231, 231, 231, 231, 231, 231, 231, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115 + }, + + { + 55, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, 232, -116, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, 234, 234, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + 234, 234, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116 + }, + + { + 55, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117 + }, + + { + 55, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235 + }, + + { + 55, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119 + + }, + + { + 55, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237 + }, + + { + 55, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121 + }, + + { + 55, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + + -122, -122, -122, -122, -122, -122, 239, -122, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, -122, -122, + -122, -122, -122, -122, -122, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, -122, -122, -122, -122, 239, -122, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, -122, -122, -122, -122, -122 + }, + + { + 55, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123 + }, + + { + 55, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, 240, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124 + }, + + { + 55, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125 + }, + + { + 55, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, 241, -126, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126 + }, + + { + 55, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127 + }, + + { + 55, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, 244, -128, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, -128, -128, + + -128, -128, -128, -128, -128, -128, -128, -128, 246, 246, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + 246, 246, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128 + }, + + { + 55, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129 + + }, + + { + 55, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 248, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 249, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 250, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247 + }, + + { + 55, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131 + }, + + { + 55, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 252, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 253, 251, 251, 251, 251, 251, 251, 251, + + 251, 251, 251, 251, 251, 251, 251, 254, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + 251, 251, 251, 251, 251, 251, 251, 251 + }, + + { + 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 257, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 258, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 + }, + + { + 55, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 260, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259 + }, + + { + 55, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135 + }, + + { + 55, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 262, 261, 261, 261, 261, 261, 261, 261, 261, 261, + + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + + 261, 261, 261, 261, 261, 261, 261, 261 + }, + + { + 55, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137 + }, + + { + 55, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 264, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263 + }, + + { + 55, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139 + + }, + + { + 55, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, 265, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140 + }, + + { + 55, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, 266, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141 + }, + + { + 55, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, 267, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, 268, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142 + }, + + { + 55, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + 269, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143 + }, + + { + 55, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, 270, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144 + }, + + { + 55, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, 271, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, 272, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145 + }, + + { + 55, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, 273, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146 + }, + + { + 55, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, 274, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + 275, -147, -147, -147, -147, -147, -147, -147, -147, -147, + + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147 + }, + + { + 55, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + + -148, -148, -148, -148, -148, -148, -148, -148, 276, 277, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148 + }, + + { + 55, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, 278, 279, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149 + + }, + + { + 55, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, 280, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, 281, + 282, -150, -150, -150, -150, -150, 283, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150 + }, + + { + 55, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, 284, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151 + }, + + { + 55, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, 285, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152 + }, + + { + 55, -153, -153, -153, -153, -153, -153, -153, -153, -153, + + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, 286, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153 + }, + + { + 55, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + + 287, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154 + }, + + { + 55, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, 288, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155 + }, + + { + 55, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + + -156, -156, -156, -156, -156, -156, -156, -156 + }, + + { + 55, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157 + }, + + { + 55, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + + -158, -158, -158, -158, -158, -158, -158, -158, -158, 289, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158 + }, + + { + 55, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, 290, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159 + + }, + + { + 55, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, 291, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160 + }, + + { + 55, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, 292, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161 + }, + + { + 55, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, 293, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162 + }, + + { + 55, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + 294, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163 + }, + + { + 55, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + + -164, -164, -164, -164, 295, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164 + }, + + { + 55, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, 296, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165 + }, + + { + 55, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, 297, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166 + }, + + { + 55, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, 298, -167, + + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167 + }, + + { + 55, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, 299, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168 + }, + + { + 55, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169 + + }, + + { + 55, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, 300, -170, -170, -170, 301, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, 302, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170 + }, + + { + 55, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + + -171, -171, -171, -171, -171, -171, -171, -171, -171, 303, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171 + }, + + { + 55, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, 304, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172 + }, + + { + 55, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173 + }, + + { + 55, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174 + }, + + { + 55, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, 305, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175 + }, + + { + 55, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, 306, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176 + }, + + { + 55, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, 307, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177 + }, + + { + 55, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, 308, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178 + }, + + { + 55, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, 309, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179 + + }, + + { + 55, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, 310, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180 + }, + + { + 55, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, 311, + + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181 + }, + + { + 55, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, 312, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182 + }, + + { + 55, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, 313, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183 + }, + + { + 55, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, 314, + + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184 + }, + + { + 55, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, 315, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185 + }, + + { + 55, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, 316, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186 + }, + + { + 55, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, 317, -187, -187, -187, -187, -187, 318, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187 + }, + + { + 55, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, 319, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188 + }, + + { + 55, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, 320, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189 + + }, + + { + 55, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, 321, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190 + }, + + { + 55, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, 322, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, 323, 324, + 324, 324, 324, 324, 324, 324, 324, 324, -191, -191, + -191, -191, -191, -191, -191, 322, 322, 322, 322, 322, + + 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191 + }, + + { + 55, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, 325, -192, -192, -192, -192, -192, -192, -192, + + -192, -192, -192, -192, -192, -192, -192, -192, 323, 324, + 324, 324, 324, 324, 324, 324, 324, 324, -192, -192, + -192, -192, -192, -192, -192, 325, 325, 325, 325, 325, + 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + 325, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192 + }, + + { + 55, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, 326, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193 + }, + + { + 55, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, 327, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, 328, 328, + 328, 328, 328, 328, 328, 328, 328, 328, -194, -194, + -194, -194, -194, -194, -194, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194 + }, + + { + 55, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, 329, 329, + + 329, 329, 329, 329, 329, 329, 329, 329, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195 + }, + + { + 55, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, 330, -196, -196, 331, 332, + 332, 332, 332, 332, 332, 332, 332, 332, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, 333, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196 + }, + + { + 55, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, 330, -197, -197, 334, 335, + 335, 335, 335, 335, 335, 335, 335, 335, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + + -197, -197, -197, -197, -197, 336, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197 + }, + + { + 55, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, 337, 337, + 337, 337, 337, 337, 337, 337, 337, 337, -198, -198, + + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198 + }, + + { + 55, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, 330, -199, -199, 338, 339, + 339, 339, 339, 339, 339, 339, 339, 339, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, 340, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199 + + }, + + { + 55, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, 341, 342, + 342, 342, 342, 342, 342, 342, 342, 342, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200 + }, + + { + 55, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, 343, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201 + }, + + { + 55, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, 344, -202, -202, -202, -202, -202, -202, -202, + + -202, -202, -202, -202, -202, -202, -202, -202, 345, 346, + 346, 346, 346, 346, 346, 346, 346, 346, -202, -202, + -202, -202, -202, -202, -202, 344, 344, 344, 344, 344, + 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + 344, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202 + }, + + { + 55, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, 347, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, 345, 346, + 346, 346, 346, 346, 346, 346, 346, 346, -203, -203, + -203, -203, -203, -203, -203, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203 + }, + + { + 55, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, 348, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204 + }, + + { + 55, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, 349, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, 345, 345, + + 345, 345, 345, 345, 345, 345, 345, 345, -205, -205, + -205, -205, -205, -205, -205, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205 + }, + + { + 55, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, 350, 350, + 350, 350, 350, 350, 350, 350, 350, 350, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206 + }, + + { + 55, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, 351, -207, -207, 352, 353, + 353, 353, 353, 353, 353, 353, 353, 353, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + + -207, -207, -207, -207, -207, 354, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207 + }, + + { + 55, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 351, -208, -208, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, -208, -208, + + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 356, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208 + }, + + { + 55, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209 + + }, + + { + 55, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, 351, -210, -210, 358, 358, + 358, 358, 358, 358, 358, 358, 358, 358, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, 359, -210, -210, -210, -210, + + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210 + }, + + { + 55, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, 360, 361, + 361, 361, 361, 361, 361, 361, 361, 361, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211 + }, + + { + 55, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, 362, -212, -212, -212, -212, -212, -212, -212, + + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212 + }, + + { + 55, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, 363, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 364, -213, -213, + -213, -213, -213, -213, -213, 363, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, + 363, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213 + }, + + { + 55, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, 365, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214 + }, + + { + 55, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, 366, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, 367, 367, + + 367, 367, 367, 367, 367, 367, 367, 367, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215 + }, + + { + 55, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216 + }, + + { + 55, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, 369, 369, + 369, 369, 369, 369, 369, 369, 369, 369, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217 + }, + + { + 55, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, 370, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218 + }, + + { + 55, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + + -219, -219, 371, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219 + + }, + + { + 55, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, 220, -220, -220, -220, -220, -220, -220, 372, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220 + }, + + { + 55, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, 221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221 + }, + + { + 55, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + + -222, -222, -222, -222, -222, -222, -222, -222, 222, 222, + 222, 222, 222, 222, 222, 222, 222, 222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222 + }, + + { + 55, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223 + }, + + { + 55, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, 226, -224, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, 228, 228, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + 228, 228, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224 + }, + + { + 55, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, 225, 225, + + 225, 225, 225, 225, 225, 225, 225, 225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, 228, 228, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + 228, 228, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225 + }, + + { + 55, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 373, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, 228, 228, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + 228, 228, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226 + }, + + { + 55, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, 226, -227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, 228, 228, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + 228, 228, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227 + }, + + { + 55, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, 374, -228, 374, -228, -228, 375, 375, + 375, 375, 375, 375, 375, 375, 375, 375, -228, -228, + + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228 + }, + + { + 55, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229 + + }, + + { + 55, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, 232, -230, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, 234, 234, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + + 234, 234, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230 + }, + + { + 55, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, 234, 234, + + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + 234, 234, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231 + }, + + { + 55, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + + -232, -232, -232, -232, -232, -232, -232, -232, 376, 376, + 376, 376, 376, 376, 376, 376, 376, 376, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, 234, 234, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + 234, 234, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232 + }, + + { + 55, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, 232, -233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, 234, 234, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + 234, 234, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233 + }, + + { + 55, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, 377, -234, 377, -234, -234, 378, 378, + 378, 378, 378, 378, 378, 378, 378, 378, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234 + }, + + { + 55, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235 + }, + + { + 55, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, 235, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236 + }, + + { + 55, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237 + }, + + { + 55, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238 + }, + + { + 55, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, 239, -239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, -239, -239, + -239, -239, -239, -239, -239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, -239, -239, -239, -239, 239, -239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, -239, -239, -239, -239, -239 + + }, + + { + 55, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, 240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240 + }, + + { + 55, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241 + }, + + { + 55, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + + -242, -242, -242, -242, -242, -242, 244, -242, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, 246, 246, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + 246, 246, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242 + }, + + { + 55, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, 246, 246, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + 246, 246, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243 + }, + + { + 55, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, 246, 246, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + 246, 246, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244 + }, + + { + 55, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, 244, -245, 245, 245, + + 245, 245, 245, 245, 245, 245, 245, 245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, 246, 246, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + 246, 246, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245, -245, -245, + -245, -245, -245, -245, -245, -245, -245, -245 + }, + + { + 55, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, 380, -246, 380, -246, -246, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246 + }, + + { + 55, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 248, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 249, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 250, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247 + }, + + { + 55, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248 + }, + + { + 55, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 248, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + + 382, 382, 249, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 250, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382 + + }, + + { + 55, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 384, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 385, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 386, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383 + }, + + { + 55, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 388, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 389, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 390, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387 + }, + + { + 55, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252 + }, + + { + 55, 391, 391, 391, 391, 391, 391, 391, 391, 391, + + 392, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 393, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 394, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391 + }, + + { + 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 257, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 258, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 + }, + + { + 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 257, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 258, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 + }, + + { + 55, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256 + }, + + { + 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 257, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 258, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 + }, + + { + 55, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 257, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 258, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255 + }, + + { + 55, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 260, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259 + + }, + + { + 55, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260 + }, + + { + 55, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 262, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261 + }, + + { + 55, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262 + }, + + { + 55, 263, 263, 263, 263, 263, 263, 263, 263, 263, + + 264, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263 + }, + + { + 55, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264 + }, + + { + 55, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, 395, 396, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265 + }, + + { + 55, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, 397, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266 + }, + + { + 55, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, 398, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267 + }, + + { + 55, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, 399, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268 + }, + + { + 55, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, 400, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269 + + }, + + { + 55, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, 401, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270 + }, + + { + 55, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + + -271, -271, -271, -271, -271, -271, -271, 402, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271 + }, + + { + 55, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, 403, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272 + }, + + { + 55, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, 404, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273 + }, + + { + 55, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, 405, -274, -274, + + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274 + }, + + { + 55, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, 406, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275 + }, + + { + 55, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, 407, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276 + }, + + { + 55, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, 408, -277, -277, -277, -277, -277, -277, -277, + + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277 + }, + + { + 55, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, 409, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278 + }, + + { + 55, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, 410, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279 + + }, + + { + 55, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, 411, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280 + }, + + { + 55, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, 412, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281 + }, + + { + 55, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, 413, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282 + }, + + { + 55, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, 414, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283 + }, + + { + 55, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, 415, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284 + }, + + { + 55, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + 416, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285 + }, + + { + 55, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, 417, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286 + }, + + { + 55, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, 418, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287 + }, + + { + 55, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + + -288, -288, -288, -288, -288, -288, -288, -288, -288, 419, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288 + }, + + { + 55, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, 420, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289 + + }, + + { + 55, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, 421, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290 + }, + + { + 55, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, 422, -291, -291, + + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291 + }, + + { + 55, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, 423, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292 + }, + + { + 55, -293, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, 424, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293 + }, + + { + 55, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, 425, + + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294 + }, + + { + 55, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + 426, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295 + }, + + { + 55, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + 427, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296 + }, + + { + 55, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, 428, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, 429, -297, -297, -297, -297, -297, -297, -297, + + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297 + }, + + { + 55, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, 430, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298 + }, + + { + 55, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, 431, -299, -299, -299, -299, -299, -299, -299, 432, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299 + + }, + + { + 55, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, 433, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300 + }, + + { + 55, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + 434, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301 + }, + + { + 55, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, 435, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, 436, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302 + }, + + { + 55, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, 437, -303, -303, 438, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303 + }, + + { + 55, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, 439, -304, -304, -304, -304, -304, + + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304 + }, + + { + 55, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, 440, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305 + }, + + { + 55, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, 441, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306 + }, + + { + 55, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, 442, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307 + }, + + { + 55, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, 443, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308 + }, + + { + 55, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, 444, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309 + + }, + + { + 55, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, 445, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, 446, 447, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310 + }, + + { + 55, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + + 448, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311 + }, + + { + 55, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, 449, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, 450, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312 + }, + + { + 55, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, 451, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, 452, + -313, -313, 453, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313 + }, + + { + 55, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + + -314, -314, -314, -314, -314, 454, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314 + }, + + { + 55, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, 455, + + 455, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315 + }, + + { + 55, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, 456, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, 457, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316 + }, + + { + 55, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, 458, -317, + + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317 + }, + + { + 55, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, 459, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318 + }, + + { + 55, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, 460, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319 + + }, + + { + 55, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, 461, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320 + }, + + { + 55, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, 462, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321 + }, + + { + 55, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, 463, -322, -322, -322, -322, -322, -322, -322, + + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322 + }, + + { + 55, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, 464, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, 465, 466, + 466, 466, 466, 466, 466, 466, 466, 466, -323, -323, + -323, -323, -323, -323, -323, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323 + }, + + { + 55, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, 467, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, 465, 466, + 466, 466, 466, 466, 466, 466, 466, 466, -324, -324, + -324, -324, -324, -324, -324, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324 + }, + + { + 55, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, 468, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325 + }, + + { + 55, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, 469, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326 + }, + + { + 55, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, 470, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327 + }, + + { + 55, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, 464, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, 471, 471, + 471, 471, 471, 471, 471, 471, 471, 471, -328, -328, + + -328, -328, -328, -328, -328, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, + 464, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328 + }, + + { + 55, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + + -329, -329, 472, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, -329, -329, + -329, -329, -329, -329, -329, 472, 472, 472, 472, 472, + 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, + 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, + 472, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329 + + }, + + { + 55, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, 474, 474, + 474, 474, 474, 474, 474, 474, 474, 474, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330 + }, + + { + 55, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, 475, -331, -331, 476, 477, + 477, 477, 477, 477, 477, 477, 477, 477, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, 478, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331 + }, + + { + 55, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + + -332, -332, -332, -332, -332, 475, -332, -332, 479, 479, + 479, 479, 479, 479, 479, 479, 479, 479, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, 480, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332 + }, + + { + 55, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333 + }, + + { + 55, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, 475, -334, -334, 476, 476, + 476, 476, 476, 476, 476, 476, 476, 476, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, 482, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334 + }, + + { + 55, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, 475, -335, -335, 483, 483, + + 483, 483, 483, 483, 483, 483, 483, 483, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, 482, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335 + }, + + { + 55, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, 484, 485, + 485, 485, 485, 485, 485, 485, 485, 485, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336 + }, + + { + 55, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, 486, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, 487, 487, + 487, 487, 487, 487, 487, 487, 487, 487, -337, -337, + -337, -337, -337, -337, -337, 486, 486, 486, 486, 486, + 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, + 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, + + 486, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337 + }, + + { + 55, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, 475, -338, -338, 476, 476, + 476, 476, 476, 476, 476, 476, 476, 476, -338, -338, + + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, 478, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338 + }, + + { + 55, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, 475, -339, -339, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, 478, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339 + + }, + + { + 55, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, 488, 489, + 489, 489, 489, 489, 489, 489, 489, 489, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340 + }, + + { + 55, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, 486, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, 490, 491, + 491, 491, 491, 491, 491, 491, 491, 491, -341, -341, + -341, -341, -341, -341, -341, 486, 486, 486, 486, 486, + + 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, + 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, + 486, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341 + }, + + { + 55, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, 492, -342, -342, -342, -342, -342, -342, -342, + + -342, -342, -342, -342, -342, -342, -342, -342, 493, 493, + 493, 493, 493, 493, 493, 493, 493, 493, -342, -342, + -342, -342, -342, -342, -342, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342 + }, + + { + 55, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343 + }, + + { + 55, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344 + }, + + { + 55, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345 + }, + + { + 55, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346 + }, + + { + 55, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347 + }, + + { + 55, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348 + }, + + { + 55, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349 + + }, + + { + 55, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, 494, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, 495, 495, + 495, 495, 495, 495, 495, 495, 495, 495, -350, -350, + -350, -350, -350, -350, -350, 494, 494, 494, 494, 494, + 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, + 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, + 494, -350, -350, -350, -350, -350, -350, -350, -350, -350, + + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350 + }, + + { + 55, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351 + }, + + { + 55, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + + -352, -352, -352, -352, -352, 497, -352, -352, 498, 499, + 499, 499, 499, 499, 499, 499, 499, 499, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, 500, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352 + }, + + { + 55, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, 497, -353, -353, 501, 501, + 501, 501, 501, 501, 501, 501, 501, 501, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, 502, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353 + }, + + { + 55, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, 503, 503, + 503, 503, 503, 503, 503, 503, 503, 503, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354 + }, + + { + 55, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, 497, -355, -355, 498, 498, + + 498, 498, 498, 498, 498, 498, 498, 498, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, 504, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355 + }, + + { + 55, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, 505, 506, + 506, 506, 506, 506, 506, 506, 506, 506, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356 + }, + + { + 55, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, 507, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, 508, 508, + 508, 508, 508, 508, 508, 508, 508, 508, -357, -357, + -357, -357, -357, -357, -357, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + + 507, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357 + }, + + { + 55, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, 497, -358, -358, 498, 498, + 498, 498, 498, 498, 498, 498, 498, 498, -358, -358, + + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, 500, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358 + }, + + { + 55, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, 509, 510, + 510, 510, 510, 510, 510, 510, 510, 510, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359 + + }, + + { + 55, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, 511, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, 512, 513, + 513, 513, 513, 513, 513, 513, 513, 513, -360, -360, + -360, -360, -360, -360, -360, 511, 511, 511, 511, 511, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, -360, -360, -360, -360, -360, -360, -360, -360, -360, + + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360 + }, + + { + 55, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, 511, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, 514, 514, + 514, 514, 514, 514, 514, 514, 514, 514, -361, -361, + -361, -361, -361, -361, -361, 511, 511, 511, 511, 511, + + 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + 511, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361 + }, + + { + 55, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362 + }, + + { + 55, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363 + }, + + { + 55, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364 + }, + + { + 55, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365 + }, + + { + 55, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366 + }, + + { + 55, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367 + }, + + { + 55, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, 515, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368 + }, + + { + 55, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + + -369, -369, 516, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369 + + }, + + { + 55, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, 517, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370 + }, + + { + 55, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, 518, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371 + }, + + { + 55, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 520, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519 + }, + + { + 55, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, 373, 373, + 373, 373, 373, 373, 373, 373, 373, 373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, 228, 228, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + 228, 228, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373 + }, + + { + 55, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, 375, 375, + 375, 375, 375, 375, 375, 375, 375, 375, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374 + }, + + { + 55, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, 375, 375, + + 375, 375, 375, 375, 375, 375, 375, 375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375, -375, -375, + -375, -375, -375, -375, -375, -375, -375, -375 + }, + + { + 55, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, 376, 376, + 376, 376, 376, 376, 376, 376, 376, 376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, 234, 234, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + 234, 234, -376, -376, -376, -376, -376, -376, -376, -376, + -376, -376, -376, -376, -376, -376, -376, -376, -376, -376, + + -376, -376, -376, -376, -376, -376, -376, -376 + }, + + { + 55, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, 378, 378, + 378, 378, 378, 378, 378, 378, 378, 378, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377 + }, + + { + 55, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, 378, 378, + 378, 378, 378, 378, 378, 378, 378, 378, -378, -378, + + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378, -378, -378, + -378, -378, -378, -378, -378, -378, -378, -378 + }, + + { + 55, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, 246, 246, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + 246, 246, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379, -379, -379, + -379, -379, -379, -379, -379, -379, -379, -379 + + }, + + { + 55, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380, -380, -380, + -380, -380, -380, -380, -380, -380, -380, -380 + }, + + { + 55, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381, -381, -381, + -381, -381, -381, -381, -381, -381, -381, -381 + }, + + { + 55, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 521, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 522, 382, 382, 382, 382, 382, 382, 382, + + 382, 382, 382, 382, 382, 382, 382, 523, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382 + }, + + { + 55, 383, 383, 383, 383, 383, 383, 383, 383, 383, + + 384, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 385, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 386, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383 + }, + + { + 55, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384 + }, + + { + 55, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 384, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 385, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 386, 383, 383, + + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383 + }, + + { + 55, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 384, 383, 383, 383, 383, 383, 383, 383, 383, 383, + + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 385, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 386, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + + 383, 383, 383, 383, 383, 383, 383, 383 + }, + + { + 55, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 388, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 389, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 390, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387 + }, + + { + 55, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388, -388, -388, + -388, -388, -388, -388, -388, -388, -388, -388 + }, + + { + 55, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 388, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + + 387, 387, 389, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 390, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387 + + }, + + { + 55, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 525, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 526, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 527, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524 + }, + + { + 55, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 388, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 389, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 390, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387 + }, + + { + 55, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392 + }, + + { + 55, 391, 391, 391, 391, 391, 391, 391, 391, 391, + + 392, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 393, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 394, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + + 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391 + }, + + { + 55, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 529, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 530, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 531, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528 + }, + + { + 55, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395, -395, -395, + -395, -395, -395, -395, -395, -395, -395, -395 + }, + + { + 55, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + + -396, -396, -396, -396, -396, -396, -396, -396 + }, + + { + 55, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, 532, -397, -397, -397, -397, -397, -397, -397, + + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397, -397, -397, + -397, -397, -397, -397, -397, -397, -397, -397 + }, + + { + 55, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + + -398, -398, -398, -398, -398, 533, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398, -398, -398, + -398, -398, -398, -398, -398, -398, -398, -398 + }, + + { + 55, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, 534, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399 + + }, + + { + 55, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, 535, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400, -400, -400, + -400, -400, -400, -400, -400, -400, -400, -400 + }, + + { + 55, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, 536, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401 + }, + + { + 55, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, 537, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402, -402, -402, + -402, -402, -402, -402, -402, -402, -402, -402 + }, + + { + 55, -403, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, 538, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403 + }, + + { + 55, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + + -404, -404, -404, -404, 539, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404, -404, -404, + -404, -404, -404, -404, -404, -404, -404, -404 + }, + + { + 55, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, 540, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405, -405, -405, + -405, -405, -405, -405, -405, -405, -405, -405 + }, + + { + 55, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, 541, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, + + -406, -406, -406, -406, -406, -406, -406, -406 + }, + + { + 55, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, 542, -407, -407, -407, -407, -407, -407, + + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407, -407, -407, + -407, -407, -407, -407, -407, -407, -407, -407 + }, + + { + 55, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, 543, -408, -408, -408, -408, -408, -408, + -408, -408, 544, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408, -408, -408, + -408, -408, -408, -408, -408, -408, -408, -408 + }, + + { + 55, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, 545, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409, -409, -409, + -409, -409, -409, -409, -409, -409, -409, -409 + + }, + + { + 55, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, 546, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410, -410, -410, + -410, -410, -410, -410, -410, -410, -410, -410 + }, + + { + 55, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, 547, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411 + }, + + { + 55, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, 548, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412, -412, -412, + -412, -412, -412, -412, -412, -412, -412, -412 + }, + + { + 55, -413, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, 549, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + + -413, -413, -413, -413, -413, -413, -413, -413, -413, -413, + -413, -413, -413, -413, -413, -413, -413, -413 + }, + + { + 55, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, 550, -414, -414, -414, + + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414 + }, + + { + 55, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, 551, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415, -415, -415, + -415, -415, -415, -415, -415, -415, -415, -415 + }, + + { + 55, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, 552, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + -416, -416, -416, -416, -416, -416, -416, -416, -416, -416, + + -416, -416, -416, -416, -416, -416, -416, -416 + }, + + { + 55, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, 553, -417, -417, -417, -417, -417, + + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417, -417, -417, + -417, -417, -417, -417, -417, -417, -417, -417 + }, + + { + 55, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, 554, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418, -418, -418, + -418, -418, -418, -418, -418, -418, -418, -418 + }, + + { + 55, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, 555, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, 556, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419, -419, -419, + -419, -419, -419, -419, -419, -419, -419, -419 + + }, + + { + 55, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, 557, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420, -420, -420, + -420, -420, -420, -420, -420, -420, -420, -420 + }, + + { + 55, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, 558, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421, -421, -421, + -421, -421, -421, -421, -421, -421, -421, -421 + }, + + { + 55, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, 559, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422, -422, -422, + -422, -422, -422, -422, -422, -422, -422, -422 + }, + + { + 55, -423, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, 560, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + + -423, -423, -423, -423, -423, -423, -423, -423, -423, -423, + -423, -423, -423, -423, -423, -423, -423, -423 + }, + + { + 55, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + 561, -424, -424, -424, -424, -424, -424, -424, -424, -424, + + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424, -424, -424, + -424, -424, -424, -424, -424, -424, -424, -424 + }, + + { + 55, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, 562, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425, -425, -425, + -425, -425, -425, -425, -425, -425, -425, -425 + }, + + { + 55, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, 563, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + -426, -426, -426, -426, -426, -426, -426, -426, -426, -426, + + -426, -426, -426, -426, -426, -426, -426, -426 + }, + + { + 55, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, 564, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427, -427, -427, + -427, -427, -427, -427, -427, -427, -427, -427 + }, + + { + 55, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + + -428, -428, -428, -428, -428, 565, 566, -428, -428, 567, + -428, -428, -428, -428, -428, -428, -428, -428, -428, 568, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, + -428, -428, -428, -428, -428, -428, -428, -428 + }, + + { + 55, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, 569, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -429, -429, -429 + + }, + + { + 55, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, 570, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430, -430, -430, + -430, -430, -430, -430, -430, -430, -430, -430 + }, + + { + 55, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, 571, + + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431, -431, -431, + -431, -431, -431, -431, -431, -431, -431, -431 + }, + + { + 55, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, 572, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432, -432, -432, + -432, -432, -432, -432, -432, -432, -432, -432 + }, + + { + 55, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, 573, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + + -433, -433, -433, -433, -433, -433, -433, -433, -433, -433, + -433, -433, -433, -433, -433, -433, -433, -433 + }, + + { + 55, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, 574, -434, -434, -434, -434, -434, -434, -434, + + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434, -434, -434, + -434, -434, -434, -434, -434, -434, -434, -434 + }, + + { + 55, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, 575, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, + -435, -435, -435, -435, -435, -435, -435, -435 + }, + + { + 55, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, 576, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + -436, -436, -436, -436, -436, -436, -436, -436, -436, -436, + + -436, -436, -436, -436, -436, -436, -436, -436 + }, + + { + 55, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, 577, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437, -437, -437, + -437, -437, -437, -437, -437, -437, -437, -437 + }, + + { + 55, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, 578, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438, -438, -438, + -438, -438, -438, -438, -438, -438, -438, -438 + }, + + { + 55, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + 579, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439 + + }, + + { + 55, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, 580, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, 581, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440, -440, -440, + -440, -440, -440, -440, -440, -440, -440, -440 + }, + + { + 55, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + + 582, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, 583, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441, -441, -441, + -441, -441, -441, -441, -441, -441, -441, -441 + }, + + { + 55, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, 584, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442 + }, + + { + 55, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, 585, + -443, -443, -443, 586, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + + -443, -443, -443, -443, -443, -443, -443, -443, -443, -443, + -443, -443, -443, -443, -443, -443, -443, -443 + }, + + { + 55, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + + 587, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444, -444, -444, + -444, -444, -444, -444, -444, -444, -444, -444 + }, + + { + 55, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, 588, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, 589, + 590, -445, -445, 591, -445, 592, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445, -445, -445, + -445, -445, -445, -445, -445, -445, -445, -445 + }, + + { + 55, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, 593, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + + -446, -446, -446, -446, -446, -446, -446, -446 + }, + + { + 55, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, 594, + + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447, -447, -447, + -447, -447, -447, -447, -447, -447, -447, -447 + }, + + { + 55, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + + -448, -448, -448, -448, -448, -448, -448, -448, 595, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + 596, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448, -448, -448, + -448, -448, -448, -448, -448, -448, -448, -448 + }, + + { + 55, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, 597, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449, -449, -449, + -449, -449, -449, -449, -449, -449, -449, -449 + + }, + + { + 55, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + 598, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450 + }, + + { + 55, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + + -451, -451, -451, -451, -451, -451, -451, -451, 599, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, + -451, -451, -451, -451, -451, -451, -451, -451 + }, + + { + 55, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, 600, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452, -452, -452, + -452, -452, -452, -452, -452, -452, -452, -452 + }, + + { + 55, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, 601, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + + -453, -453, -453, -453, -453, -453, -453, -453, -453, -453, + -453, -453, -453, -453, -453, -453, -453, -453 + }, + + { + 55, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + + -454, -454, 602, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454, -454, -454, + -454, -454, -454, -454, -454, -454, -454, -454 + }, + + { + 55, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, 603, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455, -455, -455, + -455, -455, -455, -455, -455, -455, -455, -455 + }, + + { + 55, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, 604, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + -456, -456, -456, -456, -456, -456, -456, -456, -456, -456, + + -456, -456, -456, -456, -456, -456, -456, -456 + }, + + { + 55, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, 605, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457 + }, + + { + 55, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + + -458, -458, -458, -458, -458, -458, -458, -458, -458, 606, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, + -458, -458, -458, -458, -458, -458, -458, -458 + }, + + { + 55, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, 607, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459, -459, -459, + -459, -459, -459, -459, -459, -459, -459, -459 + + }, + + { + 55, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, 608, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, + -460, -460, -460, -460, -460, -460, -460, -460 + }, + + { + 55, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, 609, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, -461 + }, + + { + 55, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, 610, -462, -462, -462, -462, -462, -462, -462, + + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462, -462, -462, + -462, -462, -462, -462, -462, -462, -462, -462 + }, + + { + 55, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, 611, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + + -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, + -463, -463, -463, -463, -463, -463, -463, -463 + }, + + { + 55, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, 612, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464, -464, -464, + -464, -464, -464, -464, -464, -464, -464, -464 + }, + + { + 55, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, 613, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, 614, 615, + + 615, 615, 615, 615, 615, 615, 615, 615, -465, -465, + -465, -465, -465, -465, -465, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465, -465, -465, + -465, -465, -465, -465, -465, -465, -465, -465 + }, + + { + 55, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, 616, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, 614, 615, + 615, 615, 615, 615, 615, 615, 615, 615, -466, -466, + -466, -466, -466, -466, -466, 616, 616, 616, 616, 616, + 616, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, 616, 616, 616, 616, 616, 616, 616, 616, 616, + 616, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, + + -466, -466, -466, -466, -466, -466, -466, -466 + }, + + { + 55, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, 617, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467, -467, -467, + -467, -467, -467, -467, -467, -467, -467, -467 + }, + + { + 55, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, 618, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468, -468, -468, + -468, -468, -468, -468, -468, -468, -468, -468 + }, + + { + 55, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + + -469, -469, 619, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469, -469, -469, + -469, -469, -469, -469, -469, -469, -469, -469 + + }, + + { + 55, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, 620, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470, -470, -470, + -470, -470, -470, -470, -470, -470, -470, -470 + }, + + { + 55, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, 613, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, 621, 621, + 621, 621, 621, 621, 621, 621, 621, 621, -471, -471, + -471, -471, -471, -471, -471, 613, 613, 613, 613, 613, + + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471, -471, -471, + -471, -471, -471, -471, -471, -471, -471, -471 + }, + + { + 55, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, 622, -472, -472, -472, -472, -472, -472, -472, + + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472, -472, -472, + -472, -472, -472, -472, -472, -472, -472, -472 + }, + + { + 55, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, 623, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, 624, 624, + 624, 624, 624, 624, 624, 624, 624, 624, -473, -473, + -473, -473, -473, -473, -473, 623, 623, 623, 623, 623, + 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, + 623, 623, 623, 623, 623, 623, 623, 623, 623, 623, + 623, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473 + }, + + { + 55, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, 625, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, -474, -474, + -474, -474, -474, -474, -474, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, + + 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, + 625, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, + -474, -474, -474, -474, -474, -474, -474, -474 + }, + + { + 55, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, 627, 627, + + 627, 627, 627, 627, 627, 627, 627, 627, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475, -475, -475, + -475, -475, -475, -475, -475, -475, -475, -475 + }, + + { + 55, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 628, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 629, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + + -476, -476, -476, -476, -476, -476, -476, -476 + }, + + { + 55, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, 628, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + + -477, -477, -477, -477, -477, 630, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477, -477, -477, + -477, -477, -477, -477, -477, -477, -477, -477 + }, + + { + 55, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, 631, 631, + 631, 631, 631, 631, 631, 631, 631, 631, -478, -478, + + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478, -478, -478, + -478, -478, -478, -478, -478, -478, -478, -478 + }, + + { + 55, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, 628, -479, -479, 632, 632, + 632, 632, 632, 632, 632, 632, 632, 632, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, 633, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479, -479, -479, + -479, -479, -479, -479, -479, -479, -479, -479 + + }, + + { + 55, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, 634, 635, + 635, 635, 635, 635, 635, 635, 635, 635, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480, -480, -480, + -480, -480, -480, -480, -480, -480, -480, -480 + }, + + { + 55, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, 636, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, 637, 637, + 637, 637, 637, 637, 637, 637, 637, 637, -481, -481, + -481, -481, -481, -481, -481, 636, 636, 636, 636, 636, + + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + 636, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481, -481, -481, + -481, -481, -481, -481, -481, -481, -481, -481 + }, + + { + 55, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + + -482, -482, -482, -482, -482, -482, -482, -482, 638, 639, + 639, 639, 639, 639, 639, 639, 639, 639, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482, -482, -482, + -482, -482, -482, -482, -482, -482, -482, -482 + }, + + { + 55, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, 628, -483, -483, 632, 632, + 632, 632, 632, 632, 632, 632, 632, 632, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, 629, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + + -483, -483, -483, -483, -483, -483, -483, -483, -483, -483, + -483, -483, -483, -483, -483, -483, -483, -483 + }, + + { + 55, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, 636, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, 640, 641, + 641, 641, 641, 641, 641, 641, 641, 641, -484, -484, + -484, -484, -484, -484, -484, 636, 636, 636, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + 636, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -484, -484, -484, -484 + }, + + { + 55, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, 642, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, 643, 643, + + 643, 643, 643, 643, 643, 643, 643, 643, -485, -485, + -485, -485, -485, -485, -485, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485, -485, -485, + -485, -485, -485, -485, -485, -485, -485, -485 + }, + + { + 55, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, 644, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + -486, -486, -486, -486, -486, -486, -486, -486, -486, -486, + + -486, -486, -486, -486, -486, -486, -486, -486 + }, + + { + 55, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, 645, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, -487, -487, + -487, -487, -487, -487, -487, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + + 645, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487, -487, -487, + -487, -487, -487, -487, -487, -487, -487, -487 + }, + + { + 55, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, 636, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, 647, 648, + 648, 648, 648, 648, 648, 648, 648, 648, -488, -488, + + -488, -488, -488, -488, -488, 636, 636, 636, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, 636, 636, + 636, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, + -488, -488, -488, -488, -488, -488, -488, -488 + }, + + { + 55, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + + -489, -489, 649, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, 650, 650, + 650, 650, 650, 650, 650, 650, 650, 650, -489, -489, + -489, -489, -489, -489, -489, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + 649, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489, -489, -489, + -489, -489, -489, -489, -489, -489, -489, -489 + + }, + + { + 55, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, 645, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, 651, 652, + 652, 652, 652, 652, 652, 652, 652, 652, -490, -490, + -490, -490, -490, -490, -490, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, + 645, -490, -490, -490, -490, -490, -490, -490, -490, -490, + + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490, -490, -490, + -490, -490, -490, -490, -490, -490, -490, -490 + }, + + { + 55, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, 653, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, -491, -491, + -491, -491, -491, -491, -491, 653, 653, 653, 653, 653, + + 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, + 653, 653, 653, 653, 653, 653, 653, 653, 653, 653, + 653, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491, -491, -491, + -491, -491, -491, -491, -491, -491, -491, -491 + }, + + { + 55, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, 655, -492, -492, -492, -492, -492, -492, -492, + + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492, -492, -492, + -492, -492, -492, -492, -492, -492, -492, -492 + }, + + { + 55, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, 656, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, -493, -493, + -493, -493, -493, -493, -493, 656, 656, 656, 656, 656, + 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, + 656, 656, 656, 656, 656, 656, 656, 656, 656, 656, + 656, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + + -493, -493, -493, -493, -493, -493, -493, -493, -493, -493, + -493, -493, -493, -493, -493, -493, -493, -493 + }, + + { + 55, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, 657, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494, -494, -494, + -494, -494, -494, -494, -494, -494, -494, -494 + }, + + { + 55, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, 658, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, 659, 659, + + 659, 659, 659, 659, 659, 659, 659, 659, -495, -495, + -495, -495, -495, -495, -495, 658, 658, 658, 658, 658, + 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, + 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, + 658, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495, -495, -495, + -495, -495, -495, -495, -495, -495, -495, -495 + }, + + { + 55, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, 660, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, 661, 661, + 661, 661, 661, 661, 661, 661, 661, 661, -496, -496, + -496, -496, -496, -496, -496, 660, 660, 660, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, + 660, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + + -496, -496, -496, -496, -496, -496, -496, -496 + }, + + { + 55, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, 662, 662, + 662, 662, 662, 662, 662, 662, 662, 662, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497, -497, -497, + -497, -497, -497, -497, -497, -497, -497, -497 + }, + + { + 55, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, 663, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, 664, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498, -498, -498, + -498, -498, -498, -498, -498, -498, -498, -498 + }, + + { + 55, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, 663, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, 665, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499, -499, -499, + -499, -499, -499, -499, -499, -499, -499, -499 + + }, + + { + 55, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, 666, 666, + 666, 666, 666, 666, 666, 666, 666, 666, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500 + }, + + { + 55, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, 663, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, 667, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, + -501, -501, -501, -501, -501, -501, -501, -501 + }, + + { + 55, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + + -502, -502, -502, -502, -502, -502, -502, -502, 668, 669, + 669, 669, 669, 669, 669, 669, 669, 669, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502, -502, -502, + -502, -502, -502, -502, -502, -502, -502, -502 + }, + + { + 55, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, 670, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, 671, 671, + 671, 671, 671, 671, 671, 671, 671, 671, -503, -503, + -503, -503, -503, -503, -503, 670, 670, 670, 670, 670, + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, + 670, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + + -503, -503, -503, -503, -503, -503, -503, -503, -503, -503, + -503, -503, -503, -503, -503, -503, -503, -503 + }, + + { + 55, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, 672, 673, + 673, 673, 673, 673, 673, 673, 673, 673, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504, -504, -504, + -504, -504, -504, -504, -504, -504, -504, -504 + }, + + { + 55, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, 674, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, 675, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, -505, -505, + -505, -505, -505, -505, -505, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505, -505, -505, + -505, -505, -505, -505, -505, -505, -505, -505 + }, + + { + 55, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, 674, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, 677, 677, + 677, 677, 677, 677, 677, 677, 677, 677, -506, -506, + -506, -506, -506, -506, -506, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + -506, -506, -506, -506, -506, -506, -506, -506, -506, -506, + + -506, -506, -506, -506, -506, -506, -506, -506 + }, + + { + 55, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, 678, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507, -507, -507, + -507, -507, -507, -507, -507, -507, -507, -507 + }, + + { + 55, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, 679, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, 680, 680, + 680, 680, 680, 680, 680, 680, 680, 680, -508, -508, + + -508, -508, -508, -508, -508, 679, 679, 679, 679, 679, + 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, + 679, 679, 679, 679, 679, 679, 679, 679, 679, 679, + 679, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508, -508, -508, + -508, -508, -508, -508, -508, -508, -508, -508 + }, + + { + 55, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + + -509, -509, 681, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, 682, 683, + 683, 683, 683, 683, 683, 683, 683, 683, -509, -509, + -509, -509, -509, -509, -509, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509, -509, -509, + -509, -509, -509, -509, -509, -509, -509, -509 + + }, + + { + 55, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, 681, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, -510, -510, + -510, -510, -510, -510, -510, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 681, 681, 681, 681, 681, 681, + 681, -510, -510, -510, -510, -510, -510, -510, -510, -510, + + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510, -510, -510, + -510, -510, -510, -510, -510, -510, -510, -510 + }, + + { + 55, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, 685, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511, -511, -511, + -511, -511, -511, -511, -511, -511, -511, -511 + }, + + { + 55, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, 686, -512, -512, -512, -512, -512, -512, -512, + + -512, -512, -512, -512, -512, -512, -512, -512, 687, 688, + 688, 688, 688, 688, 688, 688, 688, 688, -512, -512, + -512, -512, -512, -512, -512, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512, -512, -512, + -512, -512, -512, -512, -512, -512, -512, -512 + }, + + { + 55, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, 686, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, 689, 689, + 689, 689, 689, 689, 689, 689, 689, 689, -513, -513, + -513, -513, -513, -513, -513, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 686, 686, 686, 686, 686, + 686, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + + -513, -513, -513, -513, -513, -513, -513, -513, -513, -513, + -513, -513, -513, -513, -513, -513, -513, -513 + }, + + { + 55, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, 690, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, 680, 680, + 680, 680, 680, 680, 680, 680, 680, 680, -514, -514, + -514, -514, -514, -514, -514, 690, 690, 690, 690, 690, + 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, + + 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, + 690, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514, -514, -514, + -514, -514, -514, -514, -514, -514, -514, -514 + }, + + { + 55, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, 691, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515, -515, -515, + -515, -515, -515, -515, -515, -515, -515, -515 + }, + + { + 55, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, 692, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + -516, -516, -516, -516, -516, -516, -516, -516, -516, -516, + + -516, -516, -516, -516, -516, -516, -516, -516 + }, + + { + 55, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517, -517, -517, + -517, -517, -517, -517, -517, -517, -517, -517 + }, + + { + 55, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518, -518, -518, + -518, -518, -518, -518, -518, -518, -518, -518 + }, + + { + 55, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 520, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519 + + }, + + { + 55, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, 519, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520, -520, -520, + -520, -520, -520, -520, -520, -520, -520, -520 + }, + + { + 55, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521, -521, -521, + -521, -521, -521, -521, -521, -521, -521, -521 + }, + + { + 55, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 521, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 522, 382, 382, 382, 382, 382, 382, 382, + + 382, 382, 382, 382, 382, 382, 382, 523, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382 + }, + + { + 55, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 694, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 695, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 696, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693 + }, + + { + 55, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 525, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 526, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 527, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524 + }, + + { + 55, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525, -525, -525, + -525, -525, -525, -525, -525, -525, -525, -525 + }, + + { + 55, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 525, 524, 524, 524, 524, 524, 524, 524, 524, 524, + + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 526, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 527, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + + 524, 524, 524, 524, 524, 524, 524, 524 + }, + + { + 55, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 525, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 526, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 527, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 524, 524, 524, 524 + }, + + { + 55, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 529, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 530, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 531, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528 + }, + + { + 55, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529, -529, -529, + -529, -529, -529, -529, -529, -529, -529, -529 + + }, + + { + 55, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 529, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 530, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 531, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528 + }, + + { + 55, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 529, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 530, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 531, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528 + }, + + { + 55, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, 697, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532, -532, -532, + -532, -532, -532, -532, -532, -532, -532, -532 + }, + + { + 55, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, 698, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + + -533, -533, -533, -533, -533, -533, -533, -533, -533, -533, + -533, -533, -533, -533, -533, -533, -533, -533 + }, + + { + 55, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, 699, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534, -534, -534, + -534, -534, -534, -534, -534, -534, -534, -534 + }, + + { + 55, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, 700, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535, -535, -535, + -535, -535, -535, -535, -535, -535, -535, -535 + }, + + { + 55, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, 701, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + -536, -536, -536, -536, -536, -536, -536, -536, -536, -536, + + -536, -536, -536, -536, -536, -536, -536, -536 + }, + + { + 55, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, 702, -537, + + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, + -537, -537, -537, -537, -537, -537, -537, -537 + }, + + { + 55, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + + -538, -538, -538, -538, -538, -538, -538, -538, -538, 703, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538, -538, -538, + -538, -538, -538, -538, -538, -538, -538, -538 + }, + + { + 55, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539, -539, -539, + -539, -539, -539, -539, -539, -539, -539, -539 + + }, + + { + 55, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540, -540, -540, + -540, -540, -540, -540, -540, -540, -540, -540 + }, + + { + 55, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, 704, + 705, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541, -541, -541, + -541, -541, -541, -541, -541, -541, -541, -541 + }, + + { + 55, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542, -542, -542, + -542, -542, -542, -542, -542, -542, -542, -542 + }, + + { + 55, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + + -543, -543, -543, -543, -543, -543, -543, -543, -543, -543, + -543, -543, -543, -543, -543, -543, -543, -543 + }, + + { + 55, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544 + }, + + { + 55, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545, -545, -545, + -545, -545, -545, -545, -545, -545, -545, -545 + }, + + { + 55, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + -546, -546, -546, -546, -546, -546, -546, -546, -546, -546, + + -546, -546, -546, -546, -546, -546, -546, -546 + }, + + { + 55, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547, -547, -547, + -547, -547, -547, -547, -547, -547, -547, -547 + }, + + { + 55, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548, -548, -548, + -548, -548, -548, -548, -548, -548, -548, -548 + }, + + { + 55, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549, -549, -549, + -549, -549, -549, -549, -549, -549, -549, -549 + + }, + + { + 55, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, + -550, -550, -550, -550, -550, -550, -550, -550 + }, + + { + 55, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551, -551, -551, + -551, -551, -551, -551, -551, -551, -551, -551 + }, + + { + 55, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552, -552, -552, + -552, -552, -552, -552, -552, -552, -552, -552 + }, + + { + 55, -553, -553, -553, -553, -553, -553, -553, -553, -553, + + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + + -553, -553, -553, -553, -553, -553, -553, -553, -553, -553, + -553, -553, -553, -553, -553, -553, -553, -553 + }, + + { + 55, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554, -554, -554, + -554, -554, -554, -554, -554, -554, -554, -554 + }, + + { + 55, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, 706, 707, -555, -555, 708, + -555, -555, -555, -555, -555, -555, -555, -555, -555, 709, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555 + }, + + { + 55, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, 710, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + -556, -556, -556, -556, -556, -556, -556, -556, -556, -556, + + -556, -556, -556, -556, -556, -556, -556, -556 + }, + + { + 55, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, + -557, -557, -557, -557, -557, -557, -557, -557 + }, + + { + 55, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, 711, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558, -558, -558, + -558, -558, -558, -558, -558, -558, -558, -558 + }, + + { + 55, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + + -559, -559, 712, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, 712, 712, 712, 712, 712, + 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, + 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, + 712, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559, -559, -559, + -559, -559, -559, -559, -559, -559, -559, -559 + + }, + + { + 55, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, 713, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560 + }, + + { + 55, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, 714, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + + 715, -561, -561, 716, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, + -561, -561, -561, -561, -561, -561, -561, -561 + }, + + { + 55, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, 717, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562, -562, -562, + -562, -562, -562, -562, -562, -562, -562, -562 + }, + + { + 55, -563, -563, -563, -563, -563, -563, -563, -563, -563, + + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, 718, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + + -563, -563, -563, -563, -563, -563, -563, -563, -563, -563, + -563, -563, -563, -563, -563, -563, -563, -563 + }, + + { + 55, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, 719, -564, -564, -564, + + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, + -564, -564, -564, -564, -564, -564, -564, -564 + }, + + { + 55, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, 720, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565, -565, -565, + -565, -565, -565, -565, -565, -565, -565, -565 + }, + + { + 55, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, 721, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + -566, -566, -566, -566, -566, -566, -566, -566, -566, -566, + + -566, -566, -566, -566, -566, -566, -566, -566 + }, + + { + 55, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, 722, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567, -567, -567, + -567, -567, -567, -567, -567, -567, -567, -567 + }, + + { + 55, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + + -568, -568, -568, -568, -568, -568, 723, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568 + }, + + { + 55, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + 724, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569, -569, -569, + -569, -569, -569, -569, -569, -569, -569, -569 + + }, + + { + 55, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, 725, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570, -570, -570, + -570, -570, -570, -570, -570, -570, -570, -570 + }, + + { + 55, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + + -571, -571, -571, -571, -571, -571, -571, -571, -571, 726, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571, -571, -571, + -571, -571, -571, -571, -571, -571, -571, -571 + }, + + { + 55, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, 727, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572 + }, + + { + 55, -573, -573, -573, -573, -573, -573, -573, -573, -573, + + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, 728, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + + -573, -573, -573, -573, -573, -573, -573, -573, -573, -573, + -573, -573, -573, -573, -573, -573, -573, -573 + }, + + { + 55, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, 729, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574, -574, -574, + -574, -574, -574, -574, -574, -574, -574, -574 + }, + + { + 55, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, 730, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575, -575, -575, + -575, -575, -575, -575, -575, -575, -575, -575 + }, + + { + 55, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, 731, -576, -576, -576, -576, 732, -576, -576, + -576, -576, -576, 733, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + -576, -576, -576, -576, -576, -576, -576, -576, -576, -576, + + -576, -576, -576, -576, -576, -576, -576, -576 + }, + + { + 55, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, 734, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577, -577, -577, + -577, -577, -577, -577, -577, -577, -577, -577 + }, + + { + 55, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, 735, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, + -578, -578, -578, -578, -578, -578, -578, -578 + }, + + { + 55, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579, -579, -579, + -579, -579, -579, -579, -579, -579, -579, -579 + + }, + + { + 55, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, 736, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580 + }, + + { + 55, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, 737, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581, -581, -581, + -581, -581, -581, -581, -581, -581, -581, -581 + }, + + { + 55, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, 738, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582, -582, -582, + -582, -582, -582, -582, -582, -582, -582, -582 + }, + + { + 55, -583, -583, -583, -583, -583, -583, -583, -583, -583, + + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, 739, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + + -583, -583, -583, -583, -583, -583, -583, -583, -583, -583, + -583, -583, -583, -583, -583, -583, -583, -583 + }, + + { + 55, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + + -584, -584, -584, -584, -584, -584, -584, -584, -584, 740, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, + -584, -584, -584, -584, -584, -584, -584, -584 + }, + + { + 55, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, 741, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585, -585, -585, + -585, -585, -585, -585, -585, -585, -585, -585 + }, + + { + 55, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, 742, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + -586, -586, -586, -586, -586, -586, -586, -586, -586, -586, + + -586, -586, -586, -586, -586, -586, -586, -586 + }, + + { + 55, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, 743, -587, -587, -587, -587, -587, -587, + + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587, -587, -587, + -587, -587, -587, -587, -587, -587, -587, -587 + }, + + { + 55, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + + -588, -588, -588, -588, -588, -588, -588, -588, -588, 744, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588, -588, -588, + -588, -588, -588, -588, -588, -588, -588, -588 + }, + + { + 55, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + 745, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589, -589, -589, + -589, -589, -589, -589, -589, -589, -589, -589 + + }, + + { + 55, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, 746, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, + -590, -590, -590, -590, -590, -590, -590, -590 + }, + + { + 55, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, 747, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591, -591, -591, + -591, -591, -591, -591, -591, -591, -591, -591 + }, + + { + 55, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, 748, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592, -592, -592, + -592, -592, -592, -592, -592, -592, -592, -592 + }, + + { + 55, -593, -593, -593, -593, -593, -593, -593, -593, -593, + + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, 749, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + + -593, -593, -593, -593, -593, -593, -593, -593, -593, -593, + -593, -593, -593, -593, -593, -593, -593, -593 + }, + + { + 55, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, 750, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594, -594, -594, + -594, -594, -594, -594, -594, -594, -594, -594 + }, + + { + 55, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, 751, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595, -595, -595, + -595, -595, -595, -595, -595, -595, -595, -595 + }, + + { + 55, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, 752, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + -596, -596, -596, -596, -596, -596, -596, -596, -596, -596, + + -596, -596, -596, -596, -596, -596, -596, -596 + }, + + { + 55, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, 753, -597, -597, -597, -597, -597, + + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597, -597, -597, + -597, -597, -597, -597, -597, -597, -597, -597 + }, + + { + 55, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, 754, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598, -598, -598, + -598, -598, -598, -598, -598, -598, -598, -598 + }, + + { + 55, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, 755, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599, -599, -599, + -599, -599, -599, -599, -599, -599, -599, -599 + + }, + + { + 55, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, 756, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600, -600, -600, + -600, -600, -600, -600, -600, -600, -600, -600 + }, + + { + 55, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + + 757, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601, -601, -601, + -601, -601, -601, -601, -601, -601, -601, -601 + }, + + { + 55, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, 758, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602, -602, -602, + -602, -602, -602, -602, -602, -602, -602, -602 + }, + + { + 55, -603, -603, -603, -603, -603, -603, -603, -603, -603, + + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + + -603, -603, -603, -603, -603, -603, -603, -603, -603, -603, + -603, -603, -603, -603, -603, -603, -603, -603 + }, + + { + 55, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, 760, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604, -604, -604, + -604, -604, -604, -604, -604, -604, -604, -604 + }, + + { + 55, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, 761, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605, -605, -605, + -605, -605, -605, -605, -605, -605, -605, -605 + }, + + { + 55, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, 762, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + -606, -606, -606, -606, -606, -606, -606, -606, -606, -606, + + -606, -606, -606, -606, -606, -606, -606, -606 + }, + + { + 55, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, 763, -607, -607, -607, -607, -607, -607, -607, + + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607, -607, -607, + -607, -607, -607, -607, -607, -607, -607, -607 + }, + + { + 55, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, 764, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608, -608, -608, + -608, -608, -608, -608, -608, -608, -608, -608 + }, + + { + 55, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, 765, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609, -609, -609, + -609, -609, -609, -609, -609, -609, -609, -609 + + }, + + { + 55, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, 766, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610, -610, -610, + -610, -610, -610, -610, -610, -610, -610, -610 + }, + + { + 55, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, 767, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611 + }, + + { + 55, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, 768, -612, -612, -612, -612, -612, -612, -612, + + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612, -612, -612, + -612, -612, -612, -612, -612, -612, -612, -612 + }, + + { + 55, -613, -613, -613, -613, -613, -613, -613, -613, -613, + + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, 769, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + + -613, -613, -613, -613, -613, -613, -613, -613, -613, -613, + -613, -613, -613, -613, -613, -613, -613, -613 + }, + + { + 55, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, 770, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, 771, 772, + 772, 772, 772, 772, 772, 772, 772, 772, -614, -614, + -614, -614, -614, -614, -614, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614, -614, -614, + -614, -614, -614, -614, -614, -614, -614, -614 + }, + + { + 55, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, 773, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, 771, 772, + + 772, 772, 772, 772, 772, 772, 772, 772, -615, -615, + -615, -615, -615, -615, -615, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, + -615, -615, -615, -615, -615, -615, -615, -615 + }, + + { + 55, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, 774, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + -616, -616, -616, -616, -616, -616, -616, -616, -616, -616, + + -616, -616, -616, -616, -616, -616, -616, -616 + }, + + { + 55, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, 775, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617, -617, -617, + -617, -617, -617, -617, -617, -617, -617, -617 + }, + + { + 55, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, 776, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618, -618, -618, + -618, -618, -618, -618, -618, -618, -618, -618 + }, + + { + 55, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + + -619, -619, 777, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619, -619, -619, + -619, -619, -619, -619, -619, -619, -619, -619 + + }, + + { + 55, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, 778, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620, -620, -620, + -620, -620, -620, -620, -620, -620, -620, -620 + }, + + { + 55, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, 770, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, -621, -621, + -621, -621, -621, -621, -621, 770, 770, 770, 770, 770, + + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, + 770, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621, -621, -621, + -621, -621, -621, -621, -621, -621, -621, -621 + }, + + { + 55, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, 779, -622, -622, -622, -622, -622, -622, -622, + + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622, -622, -622, + -622, -622, -622, -622, -622, -622, -622, -622 + }, + + { + 55, -623, -623, -623, -623, -623, -623, -623, -623, -623, + + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, 780, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + + -623, -623, -623, -623, -623, -623, -623, -623, -623, -623, + -623, -623, -623, -623, -623, -623, -623, -623 + }, + + { + 55, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, 781, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, -624, -624, + -624, -624, -624, -624, -624, 781, 781, 781, 781, 781, + 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, + + 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, + 781, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624, -624, -624, + -624, -624, -624, -624, -624, -624, -624, -624 + }, + + { + 55, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, 783, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625, -625, -625, + -625, -625, -625, -625, -625, -625, -625, -625 + }, + + { + 55, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, 784, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, -626, -626, + -626, -626, -626, -626, -626, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, + 784, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + -626, -626, -626, -626, -626, -626, -626, -626, -626, -626, + + -626, -626, -626, -626, -626, -626, -626, -626 + }, + + { + 55, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, 786, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, -627, -627, + -627, -627, -627, -627, -627, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, + + 786, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627, -627, -627, + -627, -627, -627, -627, -627, -627, -627, -627 + }, + + { + 55, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, 788, 788, + 788, 788, 788, 788, 788, 788, 788, 788, -628, -628, + + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628, -628, -628, + -628, -628, -628, -628, -628, -628, -628, -628 + }, + + { + 55, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, 789, 789, + 789, 789, 789, 789, 789, 789, 789, 789, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629, -629, -629, + -629, -629, -629, -629, -629, -629, -629, -629 + + }, + + { + 55, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, 789, 790, + 790, 790, 790, 790, 790, 790, 790, 790, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630 + }, + + { + 55, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, 791, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, 792, 792, + 792, 792, 792, 792, 792, 792, 792, 792, -631, -631, + -631, -631, -631, -631, -631, 791, 791, 791, 791, 791, + + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631, -631, -631, + -631, -631, -631, -631, -631, -631, -631, -631 + }, + + { + 55, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + + -632, -632, -632, -632, -632, -632, -632, -632, -632, 793, + 793, 793, 793, 793, 793, 793, 793, 793, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632, -632, -632, + -632, -632, -632, -632, -632, -632, -632, -632 + }, + + { + 55, -633, -633, -633, -633, -633, -633, -633, -633, -633, + + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, 789, 794, + 794, 794, 794, 794, 794, 794, 794, 794, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + + -633, -633, -633, -633, -633, -633, -633, -633, -633, -633, + -633, -633, -633, -633, -633, -633, -633, -633 + }, + + { + 55, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, 791, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, 792, 795, + 795, 795, 795, 795, 795, 795, 795, 795, -634, -634, + -634, -634, -634, -634, -634, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634, -634, -634, + -634, -634, -634, -634, -634, -634, -634, -634 + }, + + { + 55, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, 796, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, 797, 797, + + 797, 797, 797, 797, 797, 797, 797, 797, -635, -635, + -635, -635, -635, -635, -635, 796, 796, 796, 796, 796, + 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, + 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, + 796, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635, -635, -635, + -635, -635, -635, -635, -635, -635, -635, -635 + }, + + { + 55, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, 798, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + -636, -636, -636, -636, -636, -636, -636, -636, -636, -636, + + -636, -636, -636, -636, -636, -636, -636, -636 + }, + + { + 55, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, 799, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, -637, -637, + -637, -637, -637, -637, -637, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + + 799, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637, -637, -637, + -637, -637, -637, -637, -637, -637, -637, -637 + }, + + { + 55, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, 791, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, 792, 801, + 801, 801, 801, 801, 801, 801, 801, 801, -638, -638, + + -638, -638, -638, -638, -638, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638, -638, -638, + -638, -638, -638, -638, -638, -638, -638, -638 + }, + + { + 55, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + + -639, -639, 802, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, 803, 803, + 803, 803, 803, 803, 803, 803, 803, 803, -639, -639, + -639, -639, -639, -639, -639, 802, 802, 802, 802, 802, + 802, 802, 802, 802, 802, 802, 802, 802, 802, 802, + 802, 802, 802, 802, 802, 802, 802, 802, 802, 802, + 802, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639, -639, -639, + -639, -639, -639, -639, -639, -639, -639, -639 + + }, + + { + 55, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, 799, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, 800, 804, + 804, 804, 804, 804, 804, 804, 804, 804, -640, -640, + -640, -640, -640, -640, -640, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + 799, -640, -640, -640, -640, -640, -640, -640, -640, -640, + + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640, -640, -640, + -640, -640, -640, -640, -640, -640, -640, -640 + }, + + { + 55, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, 805, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, 806, 806, + 806, 806, 806, 806, 806, 806, 806, 806, -641, -641, + -641, -641, -641, -641, -641, 805, 805, 805, 805, 805, + + 805, 805, 805, 805, 805, 805, 805, 805, 805, 805, + 805, 805, 805, 805, 805, 805, 805, 805, 805, 805, + 805, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641, -641, -641, + -641, -641, -641, -641, -641, -641, -641, -641 + }, + + { + 55, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, 807, -642, -642, -642, -642, -642, -642, -642, + + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642, -642, -642, + -642, -642, -642, -642, -642, -642, -642, -642 + }, + + { + 55, -643, -643, -643, -643, -643, -643, -643, -643, -643, + + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, 808, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, -643, -643, + -643, -643, -643, -643, -643, 808, 808, 808, 808, 808, + 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, + 808, 808, 808, 808, 808, 808, 808, 808, 808, 808, + 808, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + + -643, -643, -643, -643, -643, -643, -643, -643, -643, -643, + -643, -643, -643, -643, -643, -643, -643, -643 + }, + + { + 55, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, 809, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644, -644, -644, + -644, -644, -644, -644, -644, -644, -644, -644 + }, + + { + 55, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, 810, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645, -645, -645, + -645, -645, -645, -645, -645, -645, -645, -645 + }, + + { + 55, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, 811, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, -646, -646, + -646, -646, -646, -646, -646, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + -646, -646, -646, -646, -646, -646, -646, -646, -646, -646, + + -646, -646, -646, -646, -646, -646, -646, -646 + }, + + { + 55, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, 799, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, 800, 813, + 813, 813, 813, 813, 813, 813, 813, 813, -647, -647, + -647, -647, -647, -647, -647, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, + + 799, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647, -647, -647, + -647, -647, -647, -647, -647, -647, -647, -647 + }, + + { + 55, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, 814, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, 815, 815, + 815, 815, 815, 815, 815, 815, 815, 815, -648, -648, + + -648, -648, -648, -648, -648, 814, 814, 814, 814, 814, + 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, + 814, 814, 814, 814, 814, 814, 814, 814, 814, 814, + 814, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648, -648, -648, + -648, -648, -648, -648, -648, -648, -648, -648 + }, + + { + 55, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + + -649, -649, 816, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649, -649, -649, + -649, -649, -649, -649, -649, -649, -649, -649 + + }, + + { + 55, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, 817, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, -650, -650, + -650, -650, -650, -650, -650, 817, 817, 817, 817, 817, + 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, + 817, 817, 817, 817, 817, 817, 817, 817, 817, 817, + 817, -650, -650, -650, -650, -650, -650, -650, -650, -650, + + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650, -650, -650, + -650, -650, -650, -650, -650, -650, -650, -650 + }, + + { + 55, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, 811, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, 812, 818, + 818, 818, 818, 818, 818, 818, 818, 818, -651, -651, + -651, -651, -651, -651, -651, 811, 811, 811, 811, 811, + + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + 811, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651, -651, -651, + -651, -651, -651, -651, -651, -651, -651, -651 + }, + + { + 55, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, 819, -652, -652, -652, -652, -652, -652, -652, + + -652, -652, -652, -652, -652, -652, -652, -652, 820, 820, + 820, 820, 820, 820, 820, 820, 820, 820, -652, -652, + -652, -652, -652, -652, -652, 819, 819, 819, 819, 819, + 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, + 819, 819, 819, 819, 819, 819, 819, 819, 819, 819, + 819, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652, -652, -652, + -652, -652, -652, -652, -652, -652, -652, -652 + }, + + { + 55, -653, -653, -653, -653, -653, -653, -653, -653, -653, + + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, 821, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + + -653, -653, -653, -653, -653, -653, -653, -653, -653, -653, + -653, -653, -653, -653, -653, -653, -653, -653 + }, + + { + 55, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, 822, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, 812, 812, + 812, 812, 812, 812, 812, 812, 812, 812, -654, -654, + -654, -654, -654, -654, -654, 822, 822, 822, 822, 822, + 822, 822, 822, 822, 822, 822, 822, 822, 822, 822, + + 822, 822, 822, 822, 822, 822, 822, 822, 822, 822, + 822, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654 + }, + + { + 55, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, 823, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655, -655, -655, + -655, -655, -655, -655, -655, -655, -655, -655 + }, + + { + 55, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, 824, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + + -656, -656, -656, -656, -656, -656, -656, -656 + }, + + { + 55, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, 825, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657, -657, -657, + -657, -657, -657, -657, -657, -657, -657, -657 + }, + + { + 55, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, 826, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, + -658, -658, -658, -658, -658, -658, -658, -658 + }, + + { + 55, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + + -659, -659, 827, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, 828, 828, + 828, 828, 828, 828, 828, 828, 828, 828, -659, -659, + -659, -659, -659, -659, -659, 827, 827, 827, 827, 827, + 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, + 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, + 827, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659, -659, -659, + -659, -659, -659, -659, -659, -659, -659, -659 + + }, + + { + 55, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, 829, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660, -660, -660, + -660, -660, -660, -660, -660, -660, -660, -660 + }, + + { + 55, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, 830, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, 831, 831, + 831, 831, 831, 831, 831, 831, 831, 831, -661, -661, + -661, -661, -661, -661, -661, 830, 830, 830, 830, 830, + + 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, + 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, + 830, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661, -661, -661, + -661, -661, -661, -661, -661, -661, -661, -661 + }, + + { + 55, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, 832, -662, -662, -662, -662, -662, -662, -662, + + -662, -662, -662, -662, -662, -662, -662, -662, 833, 833, + 833, 833, 833, 833, 833, 833, 833, 833, -662, -662, + -662, -662, -662, -662, -662, 832, 832, 832, 832, 832, + 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, + 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, + 832, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662, -662, -662, + -662, -662, -662, -662, -662, -662, -662, -662 + }, + + { + 55, -663, -663, -663, -663, -663, -663, -663, -663, -663, + + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, 834, 834, + 834, 834, 834, 834, 834, 834, 834, 834, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663 + }, + + { + 55, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664, -664, -664, + -664, -664, -664, -664, -664, -664, -664, -664 + }, + + { + 55, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, 836, 836, + + 836, 836, 836, 836, 836, 836, 836, 836, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665, -665, -665, + -665, -665, -665, -665, -665, -665, -665, -665 + }, + + { + 55, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, 837, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, -666, -666, + -666, -666, -666, -666, -666, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + -666, -666, -666, -666, -666, -666, -666, -666, -666, -666, + + -666, -666, -666, -666, -666, -666, -666, -666 + }, + + { + 55, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, 839, 839, + 839, 839, 839, 839, 839, 839, 839, 839, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, + -667, -667, -667, -667, -667, -667, -667, -667 + }, + + { + 55, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, 840, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, 841, 841, + 841, 841, 841, 841, 841, 841, 841, 841, -668, -668, + + -668, -668, -668, -668, -668, 840, 840, 840, 840, 840, + 840, 840, 840, 840, 840, 840, 840, 840, 840, 840, + 840, 840, 840, 840, 840, 840, 840, 840, 840, 840, + 840, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668, -668, -668, + -668, -668, -668, -668, -668, -668, -668, -668 + }, + + { + 55, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + + -669, -669, 840, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, 842, 842, + 842, 842, 842, 842, 842, 842, 842, 842, -669, -669, + -669, -669, -669, -669, -669, 840, 840, 840, 840, 840, + 840, 840, 840, 840, 840, 840, 840, 840, 840, 840, + 840, 840, 840, 840, 840, 840, 840, 840, 840, 840, + 840, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669, -669, -669, + -669, -669, -669, -669, -669, -669, -669, -669 + + }, + + { + 55, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, 843, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670, -670, -670, + -670, -670, -670, -670, -670, -670, -670, -670 + }, + + { + 55, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, 844, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, -671, -671, + -671, -671, -671, -671, -671, 844, 844, 844, 844, 844, + + 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, + 844, 844, 844, 844, 844, 844, 844, 844, 844, 844, + 844, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671, -671, -671, + -671, -671, -671, -671, -671, -671, -671, -671 + }, + + { + 55, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, 846, -672, -672, -672, -672, -672, -672, -672, + + -672, -672, -672, -672, -672, -672, -672, -672, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, -672, -672, + -672, -672, -672, -672, -672, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, + 846, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672, -672, -672, + -672, -672, -672, -672, -672, -672, -672, -672 + }, + + { + 55, -673, -673, -673, -673, -673, -673, -673, -673, -673, + + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, 846, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, -673, -673, + -673, -673, -673, -673, -673, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, + 846, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + + -673, -673, -673, -673, -673, -673, -673, -673, -673, -673, + -673, -673, -673, -673, -673, -673, -673, -673 + }, + + { + 55, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, 849, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, + -674, -674, -674, -674, -674, -674, -674, -674 + }, + + { + 55, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, 850, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, -675, -675, + -675, -675, -675, -675, -675, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675, -675, -675, + -675, -675, -675, -675, -675, -675, -675, -675 + }, + + { + 55, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, 850, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, -676, -676, + -676, -676, -676, -676, -676, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + -676, -676, -676, -676, -676, -676, -676, -676, -676, -676, + + -676, -676, -676, -676, -676, -676, -676, -676 + }, + + { + 55, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, 853, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, -677, -677, + -677, -677, -677, -677, -677, 853, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, + + 853, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677, -677, -677, + -677, -677, -677, -677, -677, -677, -677, -677 + }, + + { + 55, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, 854, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678, -678, -678, + -678, -678, -678, -678, -678, -678, -678, -678 + }, + + { + 55, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + + -679, -679, 855, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679, -679, -679, + -679, -679, -679, -679, -679, -679, -679, -679 + + }, + + { + 55, -680, -680, -680, -680, -680, -680, -680, -680, -680, + -680, -680, -680, -680, -680, -680, -680, -680, -680, -680, + -680, -680, -680, -680, -680, -680, -680, -680, -680, -680, + -680, -680, 856, -680, -680, -680, -680, -680, -680, -680, + -680, -680, -680, -680, -680, -680, -680, -680, 857, 857, + 857, 857, 857, 857, 857, 857, 857, 857, -680, -680, + -680, -680, -680, -680, -680, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, + 856, -680, -680, -680, -680, -680, -680, -680, -680, -680, + + -680, -680, -680, -680, -680, -680, -680, -680, -680, -680, + -680, -680, -680, -680, -680, -680, -680, -680, -680, -680, + -680, -680, -680, -680, -680, -680, -680, -680 + }, + + { + 55, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, 858, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681, -681, -681, + -681, -681, -681, -681, -681, -681, -681, -681 + }, + + { + 55, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, 859, -682, -682, -682, -682, -682, -682, -682, + + -682, -682, -682, -682, -682, -682, -682, -682, 860, 860, + 860, 860, 860, 860, 860, 860, 860, 860, -682, -682, + -682, -682, -682, -682, -682, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 859, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 859, 859, 859, 859, 859, 859, + 859, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, -682, -682, -682, -682, -682, -682, -682, -682, + -682, -682, -682, -682, -682, -682, -682, -682 + }, + + { + 55, -683, -683, -683, -683, -683, -683, -683, -683, -683, + + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, 859, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, 861, 861, + 861, 861, 861, 861, 861, 861, 861, 861, -683, -683, + -683, -683, -683, -683, -683, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 859, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 859, 859, 859, 859, 859, 859, + 859, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + + -683, -683, -683, -683, -683, -683, -683, -683, -683, -683, + -683, -683, -683, -683, -683, -683, -683, -683 + }, + + { + 55, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, 862, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, -684, -684, + -684, -684, -684, -684, -684, 862, 862, 862, 862, 862, + 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, + + 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, + 862, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684, -684, -684, + -684, -684, -684, -684, -684, -684, -684, -684 + }, + + { + 55, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, 863, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685, -685, -685, + -685, -685, -685, -685, -685, -685, -685, -685 + }, + + { + 55, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, 864, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + -686, -686, -686, -686, -686, -686, -686, -686, -686, -686, + + -686, -686, -686, -686, -686, -686, -686, -686 + }, + + { + 55, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, 865, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, 866, 866, + 866, 866, 866, 866, 866, 866, 866, 866, -687, -687, + -687, -687, -687, -687, -687, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + + 865, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687, -687, -687, + -687, -687, -687, -687, -687, -687, -687, -687 + }, + + { + 55, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, 865, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, -688, -688, + + -688, -688, -688, -688, -688, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 865, 865, + 865, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688, -688, -688, + -688, -688, -688, -688, -688, -688, -688, -688 + }, + + { + 55, -689, -689, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689, -689, -689, + + -689, -689, 868, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689, 857, 857, + 857, 857, 857, 857, 857, 857, 857, 857, -689, -689, + -689, -689, -689, -689, -689, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 868, -689, -689, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689, -689, -689, + -689, -689, -689, -689, -689, -689, -689, -689 + + }, + + { + 55, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, 869, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690, -690, -690, + -690, -690, -690, -690, -690, -690, -690, -690 + }, + + { + 55, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, 870, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691, -691, -691, + -691, -691, -691, -691, -691, -691, -691, -691 + }, + + { + 55, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692, -692, -692, + -692, -692, -692, -692, -692, -692, -692, -692 + }, + + { + 55, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 694, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 695, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 696, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693 + }, + + { + 55, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694, -694, -694, + -694, -694, -694, -694, -694, -694, -694, -694 + }, + + { + 55, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 694, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 695, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 696, 693, 693, + + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693 + }, + + { + 55, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 694, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 695, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 696, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + 693, 693, 693, 693, 693, 693, 693, 693, 693, 693, + + 693, 693, 693, 693, 693, 693, 693, 693 + }, + + { + 55, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, 871, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697, -697, -697, + -697, -697, -697, -697, -697, -697, -697, -697 + }, + + { + 55, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, 872, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698, -698, -698, + -698, -698, -698, -698, -698, -698, -698, -698 + }, + + { + 55, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, 873, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699, -699, -699, + -699, -699, -699, -699, -699, -699, -699, -699 + + }, + + { + 55, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, 874, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700, -700, -700, + -700, -700, -700, -700, -700, -700, -700, -700 + }, + + { + 55, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, 875, + + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701, -701, -701, + -701, -701, -701, -701, -701, -701, -701, -701 + }, + + { + 55, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, 876, -702, -702, -702, -702, -702, -702, -702, + + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702, -702, -702, + -702, -702, -702, -702, -702, -702, -702, -702 + }, + + { + 55, -703, -703, -703, -703, -703, -703, -703, -703, -703, + + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, 877, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + + -703, -703, -703, -703, -703, -703, -703, -703, -703, -703, + -703, -703, -703, -703, -703, -703, -703, -703 + }, + + { + 55, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, 878, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704, -704, -704, + -704, -704, -704, -704, -704, -704, -704, -704 + }, + + { + 55, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, 879, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705, -705, -705, + -705, -705, -705, -705, -705, -705, -705, -705 + }, + + { + 55, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, 880, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, + + -706, -706, -706, -706, -706, -706, -706, -706 + }, + + { + 55, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, 881, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707, -707, -707, + -707, -707, -707, -707, -707, -707, -707, -707 + }, + + { + 55, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, 882, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708, -708, -708, + -708, -708, -708, -708, -708, -708, -708, -708 + }, + + { + 55, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, 883, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709, -709, -709, + -709, -709, -709, -709, -709, -709, -709, -709 + + }, + + { + 55, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + 884, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710 + }, + + { + 55, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, 885, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711, -711, -711, + -711, -711, -711, -711, -711, -711, -711, -711 + }, + + { + 55, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, 886, -712, -712, -712, -712, -712, -712, -712, + + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712, -712, -712, + -712, -712, -712, -712, -712, -712, -712, -712 + }, + + { + 55, -713, -713, -713, -713, -713, -713, -713, -713, -713, + + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, 887, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + + -713, -713, -713, -713, -713, -713, -713, -713, -713, -713, + -713, -713, -713, -713, -713, -713, -713, -713 + }, + + { + 55, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, 888, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714, -714, -714, + -714, -714, -714, -714, -714, -714, -714, -714 + }, + + { + 55, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, 889, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715, -715, -715, + -715, -715, -715, -715, -715, -715, -715, -715 + }, + + { + 55, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, 890, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + -716, -716, -716, -716, -716, -716, -716, -716, -716, -716, + + -716, -716, -716, -716, -716, -716, -716, -716 + }, + + { + 55, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, 891, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717, -717, -717, + -717, -717, -717, -717, -717, -717, -717, -717 + }, + + { + 55, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + + -718, -718, -718, -718, -718, -718, -718, -718, -718, 892, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718, -718, -718, + -718, -718, -718, -718, -718, -718, -718, -718 + }, + + { + 55, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, 893, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719, -719, -719, + -719, -719, -719, -719, -719, -719, -719, -719 + + }, + + { + 55, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, 894, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720, -720, -720, + -720, -720, -720, -720, -720, -720, -720, -720 + }, + + { + 55, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + + -721, 895, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721, -721, -721, + -721, -721, -721, -721, -721, -721, -721, -721 + }, + + { + 55, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, 896, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722, -722, -722, + -722, -722, -722, -722, -722, -722, -722, -722 + }, + + { + 55, -723, -723, -723, -723, -723, -723, -723, -723, -723, + + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, 897, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + + -723, -723, -723, -723, -723, -723, -723, -723, -723, -723, + -723, -723, -723, -723, -723, -723, -723, -723 + }, + + { + 55, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, 898, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + 899, -724, -724, 900, -724, -724, -724, -724, -724, -724, + + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724, -724, -724, + -724, -724, -724, -724, -724, -724, -724, -724 + }, + + { + 55, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, 901, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, + -725, -725, -725, -725, -725, -725, -725, -725 + }, + + { + 55, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, 902, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + -726, -726, -726, -726, -726, -726, -726, -726, -726, -726, + + -726, -726, -726, -726, -726, -726, -726, -726 + }, + + { + 55, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, 903, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727, -727, -727, + -727, -727, -727, -727, -727, -727, -727, -727 + }, + + { + 55, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + + -728, -728, -728, -728, -728, -728, -728, -728, 904, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728, -728, -728, + -728, -728, -728, -728, -728, -728, -728, -728 + }, + + { + 55, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, 905, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729, -729, -729, + -729, -729, -729, -729, -729, -729, -729, -729 + + }, + + { + 55, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, 906, -730, + -730, -730, -730, -730, -730, -730, -730, 907, -730, -730, + -730, -730, -730, 908, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730, -730, -730, + -730, -730, -730, -730, -730, -730, -730, -730 + }, + + { + 55, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, 909, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731, -731, -731, + -731, -731, -731, -731, -731, -731, -731, -731 + }, + + { + 55, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, 910, -732, -732, -732, -732, -732, -732, -732, + + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732, -732, -732, + -732, -732, -732, -732, -732, -732, -732, -732 + }, + + { + 55, -733, -733, -733, -733, -733, -733, -733, -733, -733, + + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, 911, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + + -733, -733, -733, -733, -733, -733, -733, -733, -733, -733, + -733, -733, -733, -733, -733, -733, -733, -733 + }, + + { + 55, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, 912, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734, -734, -734, + -734, -734, -734, -734, -734, -734, -734, -734 + }, + + { + 55, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, 913, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735, -735, -735, + -735, -735, -735, -735, -735, -735, -735, -735 + }, + + { + 55, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, 914, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + -736, -736, -736, -736, -736, -736, -736, -736, -736, -736, + + -736, -736, -736, -736, -736, -736, -736, -736 + }, + + { + 55, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, 915, -737, -737, -737, -737, -737, -737, + + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737, -737, -737, + -737, -737, -737, -737, -737, -737, -737, -737 + }, + + { + 55, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + + -738, -738, -738, -738, -738, -738, -738, -738, -738, 916, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, 917, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738, -738, -738, + -738, -738, -738, -738, -738, -738, -738, -738 + }, + + { + 55, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, 918, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739, -739, -739, + -739, -739, -739, -739, -739, -739, -739, -739 + + }, + + { + 55, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, 919, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740, -740, -740, + -740, -740, -740, -740, -740, -740, -740, -740 + }, + + { + 55, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, 920, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741, -741, -741, + -741, -741, -741, -741, -741, -741, -741, -741 + }, + + { + 55, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, 921, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742, -742, -742, + -742, -742, -742, -742, -742, -742, -742, -742 + }, + + { + 55, -743, -743, -743, -743, -743, -743, -743, -743, -743, + + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, 922, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + + -743, -743, -743, -743, -743, -743, -743, -743, -743, -743, + -743, -743, -743, -743, -743, -743, -743, -743 + }, + + { + 55, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, 923, -744, -744, -744, + + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744, -744, -744, + -744, -744, -744, -744, -744, -744, -744, -744 + }, + + { + 55, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + 924, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745 + }, + + { + 55, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, 925, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + + -746, -746, -746, -746, -746, -746, -746, -746 + }, + + { + 55, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, 926, -747, -747, -747, -747, -747, -747, + + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747, -747, -747, + -747, -747, -747, -747, -747, -747, -747, -747 + }, + + { + 55, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, 927, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748, -748, -748, + -748, -748, -748, -748, -748, -748, -748, -748 + }, + + { + 55, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, 928, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749, -749, -749, + -749, -749, -749, -749, -749, -749, -749, -749 + + }, + + { + 55, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, 929, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750, -750, -750, + -750, -750, -750, -750, -750, -750, -750, -750 + }, + + { + 55, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, 930, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751, -751, -751, + -751, -751, -751, -751, -751, -751, -751, -751 + }, + + { + 55, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, 931, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752, -752, -752, + -752, -752, -752, -752, -752, -752, -752, -752 + }, + + { + 55, -753, -753, -753, -753, -753, -753, -753, -753, -753, + + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, 932, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + + -753, -753, -753, -753, -753, -753, -753, -753, -753, -753, + -753, -753, -753, -753, -753, -753, -753, -753 + }, + + { + 55, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, 933, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754, -754, -754, + -754, -754, -754, -754, -754, -754, -754, -754 + }, + + { + 55, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, 934, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, + -755, -755, -755, -755, -755, -755, -755, -755 + }, + + { + 55, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, 935, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + -756, -756, -756, -756, -756, -756, -756, -756, -756, -756, + + -756, -756, -756, -756, -756, -756, -756, -756 + }, + + { + 55, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, 936, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + + 936, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757, -757, -757, + -757, -757, -757, -757, -757, -757, -757, -757 + }, + + { + 55, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + + -758, -758, -758, -758, -758, -758, -758, -758, -758, 937, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758, -758, -758, + -758, -758, -758, -758, -758, -758, -758, -758 + }, + + { + 55, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, 938, 938, + 938, 938, 938, 938, 938, 938, 938, 938, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759, -759, -759, + -759, -759, -759, -759, -759, -759, -759, -759 + + }, + + { + 55, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, 939, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760, -760, -760, + -760, -760, -760, -760, -760, -760, -760, -760 + }, + + { + 55, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, 940, + + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761, -761, -761, + -761, -761, -761, -761, -761, -761, -761, -761 + }, + + { + 55, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, 941, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762, -762, -762, + -762, -762, -762, -762, -762, -762, -762, -762 + }, + + { + 55, -763, -763, -763, -763, -763, -763, -763, -763, -763, + + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, 942, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + + -763, -763, -763, -763, -763, -763, -763, -763, -763, -763, + -763, -763, -763, -763, -763, -763, -763, -763 + }, + + { + 55, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + + -764, -764, -764, 943, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764, -764, -764, + -764, -764, -764, -764, -764, -764, -764, -764 + }, + + { + 55, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, 944, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765, -765, -765, + -765, -765, -765, -765, -765, -765, -765, -765 + }, + + { + 55, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + -766, -766, -766, -766, -766, -766, -766, -766, -766, -766, + + -766, -766, -766, -766, -766, -766, -766, -766 + }, + + { + 55, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767, -767, -767, + -767, -767, -767, -767, -767, -767, -767, -767 + }, + + { + 55, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768, -768, -768, + -768, -768, -768, -768, -768, -768, -768, -768 + }, + + { + 55, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769, -769, -769, + -769, -769, -769, -769, -769, -769, -769, -769 + + }, + + { + 55, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770, -770, -770, + -770, -770, -770, -770, -770, -770, -770, -770 + }, + + { + 55, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771, -771, -771, + -771, -771, -771, -771, -771, -771, -771, -771 + }, + + { + 55, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772, -772, -772, + -772, -772, -772, -772, -772, -772, -772, -772 + }, + + { + 55, -773, -773, -773, -773, -773, -773, -773, -773, -773, + + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + + -773, -773, -773, -773, -773, -773, -773, -773, -773, -773, + -773, -773, -773, -773, -773, -773, -773, -773 + }, + + { + 55, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774, -774, -774, + -774, -774, -774, -774, -774, -774, -774, -774 + }, + + { + 55, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775, -775, -775, + -775, -775, -775, -775, -775, -775, -775, -775 + }, + + { + 55, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + -776, -776, -776, -776, -776, -776, -776, -776, -776, -776, + + -776, -776, -776, -776, -776, -776, -776, -776 + }, + + { + 55, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777, -777, -777, + -777, -777, -777, -777, -777, -777, -777, -777 + }, + + { + 55, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778, -778, -778, + -778, -778, -778, -778, -778, -778, -778, -778 + }, + + { + 55, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779, -779, -779, + -779, -779, -779, -779, -779, -779, -779, -779 + + }, + + { + 55, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780, -780, -780, + -780, -780, -780, -780, -780, -780, -780, -780 + }, + + { + 55, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781, -781, -781, + -781, -781, -781, -781, -781, -781, -781, -781 + }, + + { + 55, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782, -782, -782, + -782, -782, -782, -782, -782, -782, -782, -782 + }, + + { + 55, -783, -783, -783, -783, -783, -783, -783, -783, -783, + + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + + -783, -783, -783, -783, -783, -783, -783, -783, -783, -783, + -783, -783, -783, -783, -783, -783, -783, -783 + }, + + { + 55, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784, -784, -784, + -784, -784, -784, -784, -784, -784, -784, -784 + }, + + { + 55, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785, -785, -785, + -785, -785, -785, -785, -785, -785, -785, -785 + }, + + { + 55, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + -786, -786, -786, -786, -786, -786, -786, -786, -786, -786, + + -786, -786, -786, -786, -786, -786, -786, -786 + }, + + { + 55, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787, -787, -787, + -787, -787, -787, -787, -787, -787, -787, -787 + }, + + { + 55, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788, -788, -788, + -788, -788, -788, -788, -788, -788, -788, -788 + }, + + { + 55, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, + -789, -789, -789, -789, -789, -789, -789, -789 + + }, + + { + 55, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790, -790, -790, + -790, -790, -790, -790, -790, -790, -790, -790 + }, + + { + 55, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, + -791, -791, -791, -791, -791, -791, -791, -791 + }, + + { + 55, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792, -792, -792, + -792, -792, -792, -792, -792, -792, -792, -792 + }, + + { + 55, -793, -793, -793, -793, -793, -793, -793, -793, -793, + + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + + -793, -793, -793, -793, -793, -793, -793, -793, -793, -793, + -793, -793, -793, -793, -793, -793, -793, -793 + }, + + { + 55, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794, -794, -794, + -794, -794, -794, -794, -794, -794, -794, -794 + }, + + { + 55, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795, -795, -795, + -795, -795, -795, -795, -795, -795, -795, -795 + }, + + { + 55, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + -796, -796, -796, -796, -796, -796, -796, -796, -796, -796, + + -796, -796, -796, -796, -796, -796, -796, -796 + }, + + { + 55, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797, -797, -797, + -797, -797, -797, -797, -797, -797, -797, -797 + }, + + { + 55, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798, -798, -798, + -798, -798, -798, -798, -798, -798, -798, -798 + }, + + { + 55, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799, -799, -799, + -799, -799, -799, -799, -799, -799, -799, -799 + + }, + + { + 55, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800, -800, -800, + -800, -800, -800, -800, -800, -800, -800, -800 + }, + + { + 55, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801, -801, -801, + -801, -801, -801, -801, -801, -801, -801, -801 + }, + + { + 55, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802, -802, -802, + -802, -802, -802, -802, -802, -802, -802, -802 + }, + + { + 55, -803, -803, -803, -803, -803, -803, -803, -803, -803, + + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + + -803, -803, -803, -803, -803, -803, -803, -803, -803, -803, + -803, -803, -803, -803, -803, -803, -803, -803 + }, + + { + 55, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804, -804, -804, + -804, -804, -804, -804, -804, -804, -804, -804 + }, + + { + 55, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805, -805, -805, + -805, -805, -805, -805, -805, -805, -805, -805 + }, + + { + 55, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + -806, -806, -806, -806, -806, -806, -806, -806, -806, -806, + + -806, -806, -806, -806, -806, -806, -806, -806 + }, + + { + 55, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807, -807, -807, + -807, -807, -807, -807, -807, -807, -807, -807 + }, + + { + 55, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808, -808, -808, + -808, -808, -808, -808, -808, -808, -808, -808 + }, + + { + 55, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809, -809, -809, + -809, -809, -809, -809, -809, -809, -809, -809 + + }, + + { + 55, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810, -810, -810, + -810, -810, -810, -810, -810, -810, -810, -810 + }, + + { + 55, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811, -811, -811, + -811, -811, -811, -811, -811, -811, -811, -811 + }, + + { + 55, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812, -812, -812, + -812, -812, -812, -812, -812, -812, -812, -812 + }, + + { + 55, -813, -813, -813, -813, -813, -813, -813, -813, -813, + + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + + -813, -813, -813, -813, -813, -813, -813, -813, -813, -813, + -813, -813, -813, -813, -813, -813, -813, -813 + }, + + { + 55, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814, -814, -814, + -814, -814, -814, -814, -814, -814, -814, -814 + }, + + { + 55, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815, -815, -815, + -815, -815, -815, -815, -815, -815, -815, -815 + }, + + { + 55, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + -816, -816, -816, -816, -816, -816, -816, -816, -816, -816, + + -816, -816, -816, -816, -816, -816, -816, -816 + }, + + { + 55, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817, -817, -817, + -817, -817, -817, -817, -817, -817, -817, -817 + }, + + { + 55, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818, -818, -818, + -818, -818, -818, -818, -818, -818, -818, -818 + }, + + { + 55, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819, -819, -819, + -819, -819, -819, -819, -819, -819, -819, -819 + + }, + + { + 55, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820, -820, -820, + -820, -820, -820, -820, -820, -820, -820, -820 + }, + + { + 55, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821, -821, -821, + -821, -821, -821, -821, -821, -821, -821, -821 + }, + + { + 55, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822, -822, -822, + -822, -822, -822, -822, -822, -822, -822, -822 + }, + + { + 55, -823, -823, -823, -823, -823, -823, -823, -823, -823, + + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + + -823, -823, -823, -823, -823, -823, -823, -823, -823, -823, + -823, -823, -823, -823, -823, -823, -823, -823 + }, + + { + 55, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824, -824, -824, + -824, -824, -824, -824, -824, -824, -824, -824 + }, + + { + 55, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825, -825, -825, + -825, -825, -825, -825, -825, -825, -825, -825 + }, + + { + 55, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + -826, -826, -826, -826, -826, -826, -826, -826, -826, -826, + + -826, -826, -826, -826, -826, -826, -826, -826 + }, + + { + 55, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827, -827, -827, + -827, -827, -827, -827, -827, -827, -827, -827 + }, + + { + 55, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828, -828, -828, + -828, -828, -828, -828, -828, -828, -828, -828 + }, + + { + 55, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829, -829, -829, + -829, -829, -829, -829, -829, -829, -829, -829 + + }, + + { + 55, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830, -830, -830, + -830, -830, -830, -830, -830, -830, -830, -830 + }, + + { + 55, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831, -831, -831, + -831, -831, -831, -831, -831, -831, -831, -831 + }, + + { + 55, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832, -832, -832, + -832, -832, -832, -832, -832, -832, -832, -832 + }, + + { + 55, -833, -833, -833, -833, -833, -833, -833, -833, -833, + + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + + -833, -833, -833, -833, -833, -833, -833, -833, -833, -833, + -833, -833, -833, -833, -833, -833, -833, -833 + }, + + { + 55, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834, -834, -834, + -834, -834, -834, -834, -834, -834, -834, -834 + }, + + { + 55, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835, -835, -835, + -835, -835, -835, -835, -835, -835, -835, -835 + }, + + { + 55, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + -836, -836, -836, -836, -836, -836, -836, -836, -836, -836, + + -836, -836, -836, -836, -836, -836, -836, -836 + }, + + { + 55, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837, -837, -837, + -837, -837, -837, -837, -837, -837, -837, -837 + }, + + { + 55, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838, -838, -838, + -838, -838, -838, -838, -838, -838, -838, -838 + }, + + { + 55, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839, -839, -839, + -839, -839, -839, -839, -839, -839, -839, -839 + + }, + + { + 55, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840, -840, -840, + -840, -840, -840, -840, -840, -840, -840, -840 + }, + + { + 55, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841, -841, -841, + -841, -841, -841, -841, -841, -841, -841, -841 + }, + + { + 55, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842, -842, -842, + -842, -842, -842, -842, -842, -842, -842, -842 + }, + + { + 55, -843, -843, -843, -843, -843, -843, -843, -843, -843, + + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + + -843, -843, -843, -843, -843, -843, -843, -843, -843, -843, + -843, -843, -843, -843, -843, -843, -843, -843 + }, + + { + 55, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844, -844, -844, + -844, -844, -844, -844, -844, -844, -844, -844 + }, + + { + 55, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845, -845, -845, + -845, -845, -845, -845, -845, -845, -845, -845 + }, + + { + 55, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + -846, -846, -846, -846, -846, -846, -846, -846, -846, -846, + + -846, -846, -846, -846, -846, -846, -846, -846 + }, + + { + 55, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847, -847, -847, + -847, -847, -847, -847, -847, -847, -847, -847 + }, + + { + 55, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848, -848, -848, + -848, -848, -848, -848, -848, -848, -848, -848 + }, + + { + 55, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849 + + }, + + { + 55, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850, -850, -850, + -850, -850, -850, -850, -850, -850, -850, -850 + }, + + { + 55, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851, -851, -851, + -851, -851, -851, -851, -851, -851, -851, -851 + }, + + { + 55, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852, -852, -852, + -852, -852, -852, -852, -852, -852, -852, -852 + }, + + { + 55, -853, -853, -853, -853, -853, -853, -853, -853, -853, + + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + + -853, -853, -853, -853, -853, -853, -853, -853, -853, -853, + -853, -853, -853, -853, -853, -853, -853, -853 + }, + + { + 55, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854, -854, -854, + -854, -854, -854, -854, -854, -854, -854, -854 + }, + + { + 55, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855, -855, -855, + -855, -855, -855, -855, -855, -855, -855, -855 + }, + + { + 55, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + -856, -856, -856, -856, -856, -856, -856, -856, -856, -856, + + -856, -856, -856, -856, -856, -856, -856, -856 + }, + + { + 55, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857, -857, -857, + -857, -857, -857, -857, -857, -857, -857, -857 + }, + + { + 55, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858, -858, -858, + -858, -858, -858, -858, -858, -858, -858, -858 + }, + + { + 55, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859 + + }, + + { + 55, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860, -860, -860, + -860, -860, -860, -860, -860, -860, -860, -860 + }, + + { + 55, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861, -861, -861, + -861, -861, -861, -861, -861, -861, -861, -861 + }, + + { + 55, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862, -862, -862, + -862, -862, -862, -862, -862, -862, -862, -862 + }, + + { + 55, -863, -863, -863, -863, -863, -863, -863, -863, -863, + + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + + -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, + -863, -863, -863, -863, -863, -863, -863, -863 + }, + + { + 55, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864, -864, -864, + -864, -864, -864, -864, -864, -864, -864, -864 + }, + + { + 55, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865, -865, -865, + -865, -865, -865, -865, -865, -865, -865, -865 + }, + + { + 55, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + -866, -866, -866, -866, -866, -866, -866, -866, -866, -866, + + -866, -866, -866, -866, -866, -866, -866, -866 + }, + + { + 55, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867, -867, -867, + -867, -867, -867, -867, -867, -867, -867, -867 + }, + + { + 55, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868, -868, -868, + -868, -868, -868, -868, -868, -868, -868, -868 + }, + + { + 55, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869, -869, -869, + -869, -869, -869, -869, -869, -869, -869, -869 + + }, + + { + 55, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870, -870, -870, + -870, -870, -870, -870, -870, -870, -870, -870 + }, + + { + 55, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, 945, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871, -871, -871, + -871, -871, -871, -871, -871, -871, -871, -871 + }, + + { + 55, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, 946, -872, -872, -872, -872, -872, -872, -872, + + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872, -872, -872, + -872, -872, -872, -872, -872, -872, -872, -872 + }, + + { + 55, -873, -873, -873, -873, -873, -873, -873, -873, -873, + + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, 947, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + + -873, -873, -873, -873, -873, -873, -873, -873, -873, -873, + -873, -873, -873, -873, -873, -873, -873, -873 + }, + + { + 55, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, 948, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874, -874, -874, + -874, -874, -874, -874, -874, -874, -874, -874 + }, + + { + 55, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, 949, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875, -875, -875, + -875, -875, -875, -875, -875, -875, -875, -875 + }, + + { + 55, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, 950, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + -876, -876, -876, -876, -876, -876, -876, -876, -876, -876, + + -876, -876, -876, -876, -876, -876, -876, -876 + }, + + { + 55, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, 951, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877, -877, -877, + -877, -877, -877, -877, -877, -877, -877, -877 + }, + + { + 55, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, 952, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878, -878, -878, + -878, -878, -878, -878, -878, -878, -878, -878 + }, + + { + 55, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + + -879, -879, 953, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879, -879, -879, + -879, -879, -879, -879, -879, -879, -879, -879 + + }, + + { + 55, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, 954, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880, -880, -880, + -880, -880, -880, -880, -880, -880, -880, -880 + }, + + { + 55, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + + -881, 955, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881, -881, -881, + -881, -881, -881, -881, -881, -881, -881, -881 + }, + + { + 55, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, 956, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882, -882, -882, + -882, -882, -882, -882, -882, -882, -882, -882 + }, + + { + 55, -883, -883, -883, -883, -883, -883, -883, -883, -883, + + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, 957, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + + -883, -883, -883, -883, -883, -883, -883, -883, -883, -883, + -883, -883, -883, -883, -883, -883, -883, -883 + }, + + { + 55, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, 958, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884, -884, -884, + -884, -884, -884, -884, -884, -884, -884, -884 + }, + + { + 55, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, 959, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885, -885, -885, + -885, -885, -885, -885, -885, -885, -885, -885 + }, + + { + 55, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, 960, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + -886, -886, -886, -886, -886, -886, -886, -886, -886, -886, + + -886, -886, -886, -886, -886, -886, -886, -886 + }, + + { + 55, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887 + }, + + { + 55, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, 961, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888, -888, -888, + -888, -888, -888, -888, -888, -888, -888, -888 + }, + + { + 55, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + + -889, -889, 962, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889, -889, -889, + -889, -889, -889, -889, -889, -889, -889, -889 + + }, + + { + 55, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, 963, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890, -890, -890, + -890, -890, -890, -890, -890, -890, -890, -890 + }, + + { + 55, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, 964, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891, -891, -891, + -891, -891, -891, -891, -891, -891, -891, -891 + }, + + { + 55, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892, -892, -892, + -892, -892, -892, -892, -892, -892, -892, -892 + }, + + { + 55, -893, -893, -893, -893, -893, -893, -893, -893, -893, + + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + + -893, -893, -893, -893, -893, -893, -893, -893, -893, -893, + -893, -893, -893, -893, -893, -893, -893, -893 + }, + + { + 55, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, 965, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, + -894, -894, -894, -894, -894, -894, -894, -894 + }, + + { + 55, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, 966, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895, -895, -895, + -895, -895, -895, -895, -895, -895, -895, -895 + }, + + { + 55, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, 967, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + -896, -896, -896, -896, -896, -896, -896, -896, -896, -896, + + -896, -896, -896, -896, -896, -896, -896, -896 + }, + + { + 55, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, 968, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897, -897, -897, + -897, -897, -897, -897, -897, -897, -897, -897 + }, + + { + 55, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, 969, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898, -898, -898, + -898, -898, -898, -898, -898, -898, -898, -898 + }, + + { + 55, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + + -899, -899, 970, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899, -899, -899, + -899, -899, -899, -899, -899, -899, -899, -899 + + }, + + { + 55, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, 971, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900, -900, -900, + -900, -900, -900, -900, -900, -900, -900, -900 + }, + + { + 55, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, 972, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901, -901, -901, + -901, -901, -901, -901, -901, -901, -901, -901 + }, + + { + 55, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, 973, -902, -902, -902, + -902, -902, 974, -902, -902, -902, 975, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, 976, 977, + 978, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902, -902, -902, + -902, -902, -902, -902, -902, -902, -902, -902 + }, + + { + 55, -903, -903, -903, -903, -903, -903, -903, -903, -903, + + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, 979, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + + -903, -903, -903, -903, -903, -903, -903, -903, -903, -903, + -903, -903, -903, -903, -903, -903, -903, -903 + }, + + { + 55, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, 980, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904, -904, -904, + -904, -904, -904, -904, -904, -904, -904, -904 + }, + + { + 55, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, 981, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905, -905, -905, + -905, -905, -905, -905, -905, -905, -905, -905 + }, + + { + 55, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, 982, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + -906, -906, -906, -906, -906, -906, -906, -906, -906, -906, + + -906, -906, -906, -906, -906, -906, -906, -906 + }, + + { + 55, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, 983, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907, -907, -907, + -907, -907, -907, -907, -907, -907, -907, -907 + }, + + { + 55, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, 984, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, 985, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908, -908, -908, + -908, -908, -908, -908, -908, -908, -908, -908 + }, + + { + 55, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + + -909, -909, 986, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909, -909, -909, + -909, -909, -909, -909, -909, -909, -909, -909 + + }, + + { + 55, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, 987, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910, -910, -910, + -910, -910, -910, -910, -910, -910, -910, -910 + }, + + { + 55, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, 988, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, + -911, -911, -911, -911, -911, -911, -911, -911 + }, + + { + 55, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, 989, -912, -912, -912, -912, -912, -912, -912, + + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912, -912, -912, + -912, -912, -912, -912, -912, -912, -912, -912 + }, + + { + 55, -913, -913, -913, -913, -913, -913, -913, -913, -913, + + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, 990, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + + -913, -913, -913, -913, -913, -913, -913, -913, -913, -913, + -913, -913, -913, -913, -913, -913, -913, -913 + }, + + { + 55, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + + -914, -914, -914, 991, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914, -914, -914, + -914, -914, -914, -914, -914, -914, -914, -914 + }, + + { + 55, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915, -915, -915, + -915, -915, -915, -915, -915, -915, -915, -915 + }, + + { + 55, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, 992, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + -916, -916, -916, -916, -916, -916, -916, -916, -916, -916, + + -916, -916, -916, -916, -916, -916, -916, -916 + }, + + { + 55, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917 + }, + + { + 55, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918, -918, -918, + -918, -918, -918, -918, -918, -918, -918, -918 + }, + + { + 55, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919, -919, -919, + -919, -919, -919, -919, -919, -919, -919, -919 + + }, + + { + 55, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920, -920, -920, + -920, -920, -920, -920, -920, -920, -920, -920 + }, + + { + 55, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921, -921, -921, + -921, -921, -921, -921, -921, -921, -921, -921 + }, + + { + 55, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, 993, -922, -922, -922, -922, -922, -922, -922, + + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922, -922, -922, + -922, -922, -922, -922, -922, -922, -922, -922 + }, + + { + 55, -923, -923, -923, -923, -923, -923, -923, -923, -923, + + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, 994, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + + -923, -923, -923, -923, -923, -923, -923, -923, -923, -923, + -923, -923, -923, -923, -923, -923, -923, -923 + }, + + { + 55, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + + -924, -924, -924, 995, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924, -924, -924, + -924, -924, -924, -924, -924, -924, -924, -924 + }, + + { + 55, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, 996, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925, -925, -925, + -925, -925, -925, -925, -925, -925, -925, -925 + }, + + { + 55, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, 997, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + -926, -926, -926, -926, -926, -926, -926, -926, -926, -926, + + -926, -926, -926, -926, -926, -926, -926, -926 + }, + + { + 55, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, 998, -927, -927, -927, -927, -927, + + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927, -927, -927, + -927, -927, -927, -927, -927, -927, -927, -927 + }, + + { + 55, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, 999, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928, -928, -928, + -928, -928, -928, -928, -928, -928, -928, -928 + }, + + { + 55, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + + -929, -929, 1000, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929, -929, -929, + -929, -929, -929, -929, -929, -929, -929, -929 + + }, + + { + 55, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, 1001, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930, -930, -930, + -930, -930, -930, -930, -930, -930, -930, -930 + }, + + { + 55, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, 1002, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931, -931, -931, + -931, -931, -931, -931, -931, -931, -931, -931 + }, + + { + 55, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, 1003, -932, -932, -932, -932, -932, -932, -932, + + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932, -932, -932, + -932, -932, -932, -932, -932, -932, -932, -932 + }, + + { + 55, -933, -933, -933, -933, -933, -933, -933, -933, -933, + + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, 1004, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + + -933, -933, -933, -933, -933, -933, -933, -933, -933, -933, + -933, -933, -933, -933, -933, -933, -933, -933 + }, + + { + 55, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934, -934, -934, + -934, -934, -934, -934, -934, -934, -934, -934 + }, + + { + 55, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935, -935, -935, + -935, -935, -935, -935, -935, -935, -935, -935 + }, + + { + 55, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, 1005, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + -936, -936, -936, -936, -936, -936, -936, -936, -936, -936, + + -936, -936, -936, -936, -936, -936, -936, -936 + }, + + { + 55, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, 1006, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, 1006, 1006, 1006, 1006, 1006, + 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, + 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, + + 1006, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937, -937, -937, + -937, -937, -937, -937, -937, -937, -937, -937 + }, + + { + 55, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, 1007, 1007, + 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, -938, -938, + + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938, -938, -938, + -938, -938, -938, -938, -938, -938, -938, -938 + }, + + { + 55, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + + -939, -939, 1008, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939, -939, -939, + -939, -939, -939, -939, -939, -939, -939, -939 + + }, + + { + 55, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940, -940, -940, + -940, -940, -940, -940, -940, -940, -940, -940 + }, + + { + 55, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + 1009, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941, -941, -941, + -941, -941, -941, -941, -941, -941, -941, -941 + }, + + { + 55, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, 1010, -942, -942, -942, -942, -942, -942, -942, + + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942, -942, -942, + -942, -942, -942, -942, -942, -942, -942, -942 + }, + + { + 55, -943, -943, -943, -943, -943, -943, -943, -943, -943, + + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + 1011, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + + -943, -943, -943, -943, -943, -943, -943, -943, -943, -943, + -943, -943, -943, -943, -943, -943, -943, -943 + }, + + { + 55, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944, -944, -944, + -944, -944, -944, -944, -944, -944, -944, -944 + }, + + { + 55, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945, -945, -945, + -945, -945, -945, -945, -945, -945, -945, -945 + }, + + { + 55, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + -946, -946, -946, -946, -946, -946, -946, -946, -946, -946, + + -946, -946, -946, -946, -946, -946, -946, -946 + }, + + { + 55, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947, -947, -947, + -947, -947, -947, -947, -947, -947, -947, -947 + }, + + { + 55, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948, -948, -948, + -948, -948, -948, -948, -948, -948, -948, -948 + }, + + { + 55, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949, -949, -949, + -949, -949, -949, -949, -949, -949, -949, -949 + + }, + + { + 55, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950, -950, -950, + -950, -950, -950, -950, -950, -950, -950, -950 + }, + + { + 55, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951, -951, -951, + -951, -951, -951, -951, -951, -951, -951, -951 + }, + + { + 55, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952, -952, -952, + -952, -952, -952, -952, -952, -952, -952, -952 + }, + + { + 55, -953, -953, -953, -953, -953, -953, -953, -953, -953, + + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + + -953, -953, -953, -953, -953, -953, -953, -953, -953, -953, + -953, -953, -953, -953, -953, -953, -953, -953 + }, + + { + 55, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954, -954, -954, + -954, -954, -954, -954, -954, -954, -954, -954 + }, + + { + 55, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955, -955, -955, + -955, -955, -955, -955, -955, -955, -955, -955 + }, + + { + 55, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + -956, -956, -956, -956, -956, -956, -956, -956, -956, -956, + + -956, -956, -956, -956, -956, -956, -956, -956 + }, + + { + 55, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957, -957, -957, + -957, -957, -957, -957, -957, -957, -957, -957 + }, + + { + 55, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958, -958, -958, + -958, -958, -958, -958, -958, -958, -958, -958 + }, + + { + 55, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + + -959, -959, 1012, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959, -959, -959, + -959, -959, -959, -959, -959, -959, -959, -959 + + }, + + { + 55, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960, -960, -960, + -960, -960, -960, -960, -960, -960, -960, -960 + }, + + { + 55, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961, -961, -961, + -961, -961, -961, -961, -961, -961, -961, -961 + }, + + { + 55, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962, -962, -962, + -962, -962, -962, -962, -962, -962, -962, -962 + }, + + { + 55, -963, -963, -963, -963, -963, -963, -963, -963, -963, + + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + + -963, -963, -963, -963, -963, -963, -963, -963, -963, -963, + -963, -963, -963, -963, -963, -963, -963, -963 + }, + + { + 55, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964, -964, -964, + -964, -964, -964, -964, -964, -964, -964, -964 + }, + + { + 55, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965, -965, -965, + -965, -965, -965, -965, -965, -965, -965, -965 + }, + + { + 55, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + -966, -966, -966, -966, -966, -966, -966, -966, -966, -966, + + -966, -966, -966, -966, -966, -966, -966, -966 + }, + + { + 55, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967, -967, -967, + -967, -967, -967, -967, -967, -967, -967, -967 + }, + + { + 55, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968, -968, -968, + -968, -968, -968, -968, -968, -968, -968, -968 + }, + + { + 55, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969, -969, -969, + -969, -969, -969, -969, -969, -969, -969, -969 + + }, + + { + 55, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970, -970, -970, + -970, -970, -970, -970, -970, -970, -970, -970 + }, + + { + 55, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971, -971, -971, + -971, -971, -971, -971, -971, -971, -971, -971 + }, + + { + 55, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, 1013, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972, -972, -972, + -972, -972, -972, -972, -972, -972, -972, -972 + }, + + { + 55, -973, -973, -973, -973, -973, -973, -973, -973, -973, + + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + + -973, -973, -973, -973, -973, -973, -973, -973, -973, -973, + -973, -973, -973, -973, -973, -973, -973, -973 + }, + + { + 55, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974, -974, -974, + -974, -974, -974, -974, -974, -974, -974, -974 + }, + + { + 55, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975, -975, -975, + -975, -975, -975, -975, -975, -975, -975, -975 + }, + + { + 55, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + -976, -976, -976, -976, -976, -976, -976, -976, -976, -976, + + -976, -976, -976, -976, -976, -976, -976, -976 + }, + + { + 55, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977, -977, -977, + -977, -977, -977, -977, -977, -977, -977, -977 + }, + + { + 55, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978, -978, -978, + -978, -978, -978, -978, -978, -978, -978, -978 + }, + + { + 55, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979, -979, -979, + -979, -979, -979, -979, -979, -979, -979, -979 + + }, + + { + 55, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980, -980, -980, + -980, -980, -980, -980, -980, -980, -980, -980 + }, + + { + 55, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981, -981, -981, + -981, -981, -981, -981, -981, -981, -981, -981 + }, + + { + 55, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982, -982, -982, + -982, -982, -982, -982, -982, -982, -982, -982 + }, + + { + 55, -983, -983, -983, -983, -983, -983, -983, -983, -983, + + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + + -983, -983, -983, -983, -983, -983, -983, -983, -983, -983, + -983, -983, -983, -983, -983, -983, -983, -983 + }, + + { + 55, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984, -984, -984, + -984, -984, -984, -984, -984, -984, -984, -984 + }, + + { + 55, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985, -985, -985, + -985, -985, -985, -985, -985, -985, -985, -985 + }, + + { + 55, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + -986, -986, -986, -986, -986, -986, -986, -986, -986, -986, + + -986, -986, -986, -986, -986, -986, -986, -986 + }, + + { + 55, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987, -987, -987, + -987, -987, -987, -987, -987, -987, -987, -987 + }, + + { + 55, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988, -988, -988, + -988, -988, -988, -988, -988, -988, -988, -988 + }, + + { + 55, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989, -989, -989, + -989, -989, -989, -989, -989, -989, -989, -989 + + }, + + { + 55, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990, -990, -990, + -990, -990, -990, -990, -990, -990, -990, -990 + }, + + { + 55, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991, -991, -991, + -991, -991, -991, -991, -991, -991, -991, -991 + }, + + { + 55, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992, -992, -992, + -992, -992, -992, -992, -992, -992, -992, -992 + }, + + { + 55, -993, -993, -993, -993, -993, -993, -993, -993, -993, + + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + + -993, -993, -993, -993, -993, -993, -993, -993, -993, -993, + -993, -993, -993, -993, -993, -993, -993, -993 + }, + + { + 55, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994, -994, -994, + -994, -994, -994, -994, -994, -994, -994, -994 + }, + + { + 55, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995, -995, -995, + -995, -995, -995, -995, -995, -995, -995, -995 + }, + + { + 55, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + -996, -996, -996, -996, -996, -996, -996, -996, -996, -996, + + -996, -996, -996, -996, -996, -996, -996, -996 + }, + + { + 55, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997, -997, -997, + -997, -997, -997, -997, -997, -997, -997, -997 + }, + + { + 55, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998, -998, -998, + -998, -998, -998, -998, -998, -998, -998, -998 + }, + + { + 55, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, + -999, -999, -999, -999, -999, -999, -999, -999 + + }, + + { + 55,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, + -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000 + }, + + { + 55,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001, + -1001,-1001,-1001,-1001,-1001,-1001,-1001,-1001 + }, + + { + 55,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002, + -1002,-1002,-1002,-1002,-1002,-1002,-1002,-1002 + }, + + { + 55,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003, + -1003,-1003,-1003,-1003,-1003,-1003,-1003,-1003 + }, + + { + 55,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004, + -1004,-1004,-1004,-1004,-1004,-1004,-1004,-1004 + }, + + { + 55,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005, + -1005,-1005,-1005,-1005,-1005,-1005,-1005,-1005 + }, + + { + 55,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006, + + -1006,-1006,-1006,-1006,-1006,-1006,-1006,-1006 + }, + + { + 55,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007, + -1007,-1007,-1007,-1007,-1007,-1007,-1007,-1007 + }, + + { + 55,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + + -1008, 1014,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008, + -1008,-1008,-1008,-1008,-1008,-1008,-1008,-1008 + }, + + { + 55,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009, + -1009,-1009,-1009,-1009,-1009,-1009,-1009,-1009 + + }, + + { + 55,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010, + -1010,-1010,-1010,-1010,-1010,-1010,-1010,-1010 + }, + + { + 55,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011, + -1011,-1011,-1011,-1011,-1011,-1011,-1011,-1011 + }, + + { + 55,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012, 1015,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012, + -1012,-1012,-1012,-1012,-1012,-1012,-1012,-1012 + }, + + { + 55,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013, 1016,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013, + -1013,-1013,-1013,-1013,-1013,-1013,-1013,-1013 + }, + + { + 55,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014, 1017,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014, + -1014,-1014,-1014,-1014,-1014,-1014,-1014,-1014 + }, + + { + 55,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015, 1018,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015, + -1015,-1015,-1015,-1015,-1015,-1015,-1015,-1015 + }, + + { + 55,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016, 1019,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016, 1020,-1016, 1020,-1016,-1016, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016, + + -1016,-1016,-1016,-1016,-1016,-1016,-1016,-1016 + }, + + { + 55,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017, 1022,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017, 1023,-1017, 1023,-1017,-1017, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017, + -1017,-1017,-1017,-1017,-1017,-1017,-1017,-1017 + }, + + { + 55,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018, 1025,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018, + -1018,-1018,-1018,-1018,-1018,-1018,-1018,-1018 + }, + + { + 55,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + + -1019,-1019, 1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019, 1020,-1019, 1020,-1019,-1019, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019, + -1019,-1019,-1019,-1019,-1019,-1019,-1019,-1019 + + }, + + { + 55,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020, + -1020,-1020,-1020,-1020,-1020,-1020,-1020,-1020 + }, + + { + 55,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021, 1026,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021, 1027, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021, + -1021,-1021,-1021,-1021,-1021,-1021,-1021,-1021 + }, + + { + 55,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022, 1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + + -1022,-1022,-1022, 1023,-1022, 1023,-1022,-1022, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022, + -1022,-1022,-1022,-1022,-1022,-1022,-1022,-1022 + }, + + { + 55,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023, + -1023,-1023,-1023,-1023,-1023,-1023,-1023,-1023 + }, + + { + 55,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024, + -1024,-1024,-1024,-1024,-1024,-1024,-1024,-1024 + }, + + { + 55,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025, 1028,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025, + -1025,-1025,-1025,-1025,-1025,-1025,-1025,-1025 + }, + + { + 55,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026, 1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026, 1027,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026, + + -1026,-1026,-1026,-1026,-1026,-1026,-1026,-1026 + }, + + { + 55, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + -1027, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029 + }, + + { + 55,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028, 1030,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028, + -1028,-1028,-1028,-1028,-1028,-1028,-1028,-1028 + }, + + { + 55, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + -1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029 + + }, + + { + 55,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030, 1031,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030, + -1030,-1030,-1030,-1030,-1030,-1030,-1030,-1030 + }, + + { + 55,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031, 1032,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031, + -1031,-1031,-1031,-1031,-1031,-1031,-1031,-1031 + }, + + { + 55,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032, 1033,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032, + -1032,-1032,-1032,-1032,-1032,-1032,-1032,-1032 + }, + + { + 55,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033, 1034,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033, + -1033,-1033,-1033,-1033,-1033,-1033,-1033,-1033 + }, + + { + 55,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034, 1035,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034, + -1034,-1034,-1034,-1034,-1034,-1034,-1034,-1034 + }, + + { + 55,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035, 1036,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035, + -1035,-1035,-1035,-1035,-1035,-1035,-1035,-1035 + }, + + { + 55,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036, 1037,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036, + + -1036,-1036,-1036,-1036,-1036,-1036,-1036,-1036 + }, + + { + 55,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037, 1038,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037, + -1037,-1037,-1037,-1037,-1037,-1037,-1037,-1037 + }, + + { + 55,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038, 1039,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038, + -1038,-1038,-1038,-1038,-1038,-1038,-1038,-1038 + }, + + { + 55,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + + -1039,-1039, 1040,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039, + -1039,-1039,-1039,-1039,-1039,-1039,-1039,-1039 + + }, + + { + 55,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040, 1041,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040, + -1040,-1040,-1040,-1040,-1040,-1040,-1040,-1040 + }, + + { + 55,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041, 1042,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041, + -1041,-1041,-1041,-1041,-1041,-1041,-1041,-1041 + }, + + { + 55,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042, 1043,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042, + -1042,-1042,-1042,-1042,-1042,-1042,-1042,-1042 + }, + + { + 55,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043, 1044,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043, + -1043,-1043,-1043,-1043,-1043,-1043,-1043,-1043 + }, + + { + 55,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044, 1045,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044, + -1044,-1044,-1044,-1044,-1044,-1044,-1044,-1044 + }, + + { + 55,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045, 1046,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045, + -1045,-1045,-1045,-1045,-1045,-1045,-1045,-1045 + }, + + { + 55,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046, 1047,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046, + + -1046,-1046,-1046,-1046,-1046,-1046,-1046,-1046 + }, + + { + 55,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047, 1048,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047, + -1047,-1047,-1047,-1047,-1047,-1047,-1047,-1047 + }, + + { + 55,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048, 1049,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048, + -1048,-1048,-1048,-1048,-1048,-1048,-1048,-1048 + }, + + { + 55,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + + -1049,-1049, 1050,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049, + -1049,-1049,-1049,-1049,-1049,-1049,-1049,-1049 + + }, + + { + 55,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050, 1051,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050, + -1050,-1050,-1050,-1050,-1050,-1050,-1050,-1050 + }, + + { + 55,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051, 1052,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051, + -1051,-1051,-1051,-1051,-1051,-1051,-1051,-1051 + }, + + { + 55,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052, 1053,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052, + -1052,-1052,-1052,-1052,-1052,-1052,-1052,-1052 + }, + + { + 55,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053, 1054,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053, + -1053,-1053,-1053,-1053,-1053,-1053,-1053,-1053 + }, + + { + 55,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054, 1055,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054, + -1054,-1054,-1054,-1054,-1054,-1054,-1054,-1054 + }, + + { + 55,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055, 1056,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055, + -1055,-1055,-1055,-1055,-1055,-1055,-1055,-1055 + }, + + { + 55,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056, 1057,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056, + + -1056,-1056,-1056,-1056,-1056,-1056,-1056,-1056 + }, + + { + 55,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057, 1058,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057, + -1057,-1057,-1057,-1057,-1057,-1057,-1057,-1057 + }, + + { + 55,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058, 1059,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058, + -1058,-1058,-1058,-1058,-1058,-1058,-1058,-1058 + }, + + { + 55,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + + -1059,-1059, 1060,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059, + -1059,-1059,-1059,-1059,-1059,-1059,-1059,-1059 + + }, + + { + 55,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060, 1061,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060, + -1060,-1060,-1060,-1060,-1060,-1060,-1060,-1060 + }, + + { + 55,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061, 1062,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061, + -1061,-1061,-1061,-1061,-1061,-1061,-1061,-1061 + }, + + { + 55,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062, 1063,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062, + -1062,-1062,-1062,-1062,-1062,-1062,-1062,-1062 + }, + + { + 55,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063, 1064,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063, + -1063,-1063,-1063,-1063,-1063,-1063,-1063,-1063 + }, + + { + 55,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064, 1065,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064, + -1064,-1064,-1064,-1064,-1064,-1064,-1064,-1064 + }, + + { + 55,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065, 1066,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065, + -1065,-1065,-1065,-1065,-1065,-1065,-1065,-1065 + }, + + { + 55,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066, 1067,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066, + + -1066,-1066,-1066,-1066,-1066,-1066,-1066,-1066 + }, + + { + 55,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067, 1068,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067, + -1067,-1067,-1067,-1067,-1067,-1067,-1067,-1067 + }, + + { + 55,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068, 1069,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068, + -1068,-1068,-1068,-1068,-1068,-1068,-1068,-1068 + }, + + { + 55,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + + -1069,-1069, 1070,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069, + -1069,-1069,-1069,-1069,-1069,-1069,-1069,-1069 + + }, + + { + 55,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070, 1071,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070, + -1070,-1070,-1070,-1070,-1070,-1070,-1070,-1070 + }, + + { + 55,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071, 1072,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071, + -1071,-1071,-1071,-1071,-1071,-1071,-1071,-1071 + }, + + { + 55,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072, 1073,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072, + -1072,-1072,-1072,-1072,-1072,-1072,-1072,-1072 + }, + + { + 55,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073, 1074,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073, + -1073,-1073,-1073,-1073,-1073,-1073,-1073,-1073 + }, + + { + 55,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074, 1075,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074, + -1074,-1074,-1074,-1074,-1074,-1074,-1074,-1074 + }, + + { + 55,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075, 1076,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075, + -1075,-1075,-1075,-1075,-1075,-1075,-1075,-1075 + }, + + { + 55,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076, 1077,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076, + + -1076,-1076,-1076,-1076,-1076,-1076,-1076,-1076 + }, + + { + 55,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077, 1078,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077, + -1077,-1077,-1077,-1077,-1077,-1077,-1077,-1077 + }, + + { + 55,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078, 1079,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078, + -1078,-1078,-1078,-1078,-1078,-1078,-1078,-1078 + }, + + { + 55,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + + -1079,-1079, 1080,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079, + -1079,-1079,-1079,-1079,-1079,-1079,-1079,-1079 + + }, + + { + 55,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080, 1081,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080, + -1080,-1080,-1080,-1080,-1080,-1080,-1080,-1080 + }, + + { + 55,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081, 1082,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081, + -1081,-1081,-1081,-1081,-1081,-1081,-1081,-1081 + }, + + { + 55,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082, 1083,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082, + -1082,-1082,-1082,-1082,-1082,-1082,-1082,-1082 + }, + + { + 55,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083, 1084,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083, + -1083,-1083,-1083,-1083,-1083,-1083,-1083,-1083 + }, + + { + 55,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084, 1085,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084, + -1084,-1084,-1084,-1084,-1084,-1084,-1084,-1084 + }, + + { + 55,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085, 1086,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085, + -1085,-1085,-1085,-1085,-1085,-1085,-1085,-1085 + }, + + { + 55,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086, 1087,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086, + + -1086,-1086,-1086,-1086,-1086,-1086,-1086,-1086 + }, + + { + 55,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087, 1088,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087, + -1087,-1087,-1087,-1087,-1087,-1087,-1087,-1087 + }, + + { + 55,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088, 1089,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088, + -1088,-1088,-1088,-1088,-1088,-1088,-1088,-1088 + }, + + { + 55,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + + -1089,-1089, 1090,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089, + -1089,-1089,-1089,-1089,-1089,-1089,-1089,-1089 + + }, + + { + 55,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090, 1091,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090, + -1090,-1090,-1090,-1090,-1090,-1090,-1090,-1090 + }, + + { + 55,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091, 1092,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091, + -1091,-1091,-1091,-1091,-1091,-1091,-1091,-1091 + }, + + { + 55,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092, 1093,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092, + -1092,-1092,-1092,-1092,-1092,-1092,-1092,-1092 + }, + + { + 55,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093, 1094,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093, + -1093,-1093,-1093,-1093,-1093,-1093,-1093,-1093 + }, + + { + 55,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094, 1095,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094, + -1094,-1094,-1094,-1094,-1094,-1094,-1094,-1094 + }, + + { + 55,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095, 1096,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095, + -1095,-1095,-1095,-1095,-1095,-1095,-1095,-1095 + }, + + { + 55,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096, + + -1096,-1096,-1096,-1096,-1096,-1096,-1096,-1096 + }, + + } ; + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 274 +#define YY_END_OF_BUFFER 275 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[1097] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 275, 274, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 131, 131, 131, 179, + 179, 179, 132, 132, 132, 228, 228, 228, 182, 180, + 181, 232, 232, 236, 236, 239, 239, 240, 240, 243, + + 243, 245, 245, 247, 247, 249, 249, 248, 251, 251, + 251, 250, 253, 253, 253, 252, 255, 255, 257, 257, + 259, 258, 261, 261, 264, 264, 264, 262, 265, 274, + 266, 274, 274, 274, 271, 274, 272, 274, 273, 0, + 0, 88, 0, 0, 89, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 77, 78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, + 0, 0, 18, 16, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 246, 248, 0, 250, 250, 250, 250, 0, 0, 252, + 252, 252, 252, 0, 0, 254, 0, 256, 258, 260, + 0, 262, 263, 263, 262, 0, 0, 268, 0, 0, + 0, 266, 0, 0, 0, 266, 0, 0, 0, 271, + 0, 272, 0, 273, 0, 90, 0, 0, 0, 91, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 128, 129, 130, 121, 120, 113, 114, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 229, 230, 231, 233, 234, 235, 0, 0, 0, + 0, 0, 250, 0, 250, 252, 0, 252, 263, 0, + 263, 0, 0, 267, 0, 0, 0, 269, 0, 0, + 0, 266, 0, 0, 106, 107, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 241, 242, 0, 244, + 270, 0, 0, 0, 267, 0, 0, 0, 266, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 6, 20, + 0, 75, 24, 79, 76, 80, 21, 7, 3, 10, + 22, 9, 8, 23, 0, 0, 81, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 238, 0, 267, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 122, 123, 124, 125, 126, + 127, 119, 118, 117, 116, 115, 111, 112, 168, 170, + 173, 177, 169, 172, 176, 171, 175, 174, 164, 142, + 161, 165, 178, 153, 143, 139, 148, 159, 162, 166, + + 154, 151, 156, 144, 140, 149, 137, 146, 158, 160, + 163, 167, 155, 152, 157, 135, 136, 145, 141, 150, + 138, 147, 133, 134, 218, 220, 223, 227, 219, 222, + 226, 221, 225, 224, 214, 192, 211, 215, 203, 189, + 193, 198, 209, 212, 216, 201, 204, 206, 187, 190, + 194, 199, 196, 208, 210, 213, 217, 185, 202, 205, + 207, 186, 183, 188, 191, 195, 200, 197, 184, 237, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, + 0, 12, 11, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 64, 0, 13, 15, 68, 69, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 70, 0, 0, 0, 0, 25, + 0, 0, 0, 72, 84, 86, 82, 48, 85, 87, + 83, 92, 93, 41, 40, 42, 39, 31, 0, 66, + 35, 37, 36, 47, 45, 44, 46, 43, 32, 34, + 33, 0, 61, 62, 60, 57, 58, 59, 63, 105, + 29, 102, 103, 104, 101, 98, 99, 100, 94, 95, + 65, 14, 52, 55, 38, 56, 26, 30, 54, 53, + + 28, 27, 49, 50, 19, 71, 108, 0, 96, 51, + 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 2, 0, 1, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 109 + + } ; + +static const yy_state_type yy_NUL_trans[1097] = + { 0, + 56, 57, 77, 77, 80, 80, 83, 83, 86, 86, + 89, 89, 91, 91, 92, 92, 94, 94, 96, 96, + 98, 98, 100, 100, 102, 102, 104, 104, 106, 106, + 109, 109, 113, 113, 117, 117, 119, 119, 121, 121, + 123, 123, 125, 125, 56, 56, 130, 130, 134, 134, + 136, 136, 138, 138, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 235, 0, 237, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, + 0, 251, 255, 259, 0, 261, 0, 263, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 235, 0, 237, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 247, 0, 382, 383, + 387, 0, 391, 255, 255, 0, 255, 255, 259, 0, + 261, 0, 263, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 519, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 382, 383, 0, 383, 383, 387, 0, 387, 524, + 387, 0, 391, 528, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 519, 0, + 0, 382, 693, 524, 0, 524, 524, 528, 0, 528, + 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 693, 0, 693, 693, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1029, 0, 1029, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "wcspih.l" +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcspih.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*============================================================================= +* +* wcspih.l is a Flex description file containing the definition of a lexical +* scanner for parsing the WCS keyrecords from a FITS primary image or image +* extension header. +* +* wcspih.l requires Flex v2.5.4 or later. Refer to wcshdr.h for a description +* of the user interface and operating notes. +* +* Implementation notes +* -------------------- +* Use of the WCSAXESa keyword is not mandatory. Its default value is "the +* larger of NAXIS and the largest index of these keywords [i.e. CRPIXj, PCi_j +* or CDi_j, CDELTi, CTYPEi, CRVALi, and CUNITi] found in the FITS header". +* Consequently the definition of WCSAXESa effectively invalidates the use of +* NAXIS for determining the number of coordinate axes and forces a preliminary +* pass through the header to determine the "largest index" in headers where +* WCSAXESa was omitted. +* +* Furthermore, since the use of WCSAXESa is optional, there is no way to +* determine the number of coordinate representations (the "a" value) other +* than by parsing all of the WCS keywords in the header; even if WCSAXESa was +* specified for some representations it cannot be known in advance whether it +* was specified for all of those present in the header. +* +* Hence the definition of WCSAXESa forces the scanner to be implemented in two +* passes. The first pass is used to determine the number of coordinate +* representations (up to 27) and the number of coordinate axes in each. +* Effectively WCSAXESa is ignored unless it exceeds the "largest index" in +* which case the keywords for the extra axes assume their default values. The +* number of PVi_ma and PSi_ma keywords in each representation is also counted +* in the first pass. +* +* On completion of the first pass, memory is allocated for an array of the +* required number of wcsprm structs and each of these is initialized +* appropriately. These structs are filled in the second pass. +* +* The parser does not check for duplicated keywords, it accepts the last +* encountered. +* +*===========================================================================*/ +/* Options. */ +/* Indices for parameterized keywords. */ +/* Alternate coordinate system identifier. */ +/* Keyvalue data types. */ +/* Inline comment syntax. */ +/* Exclusive start states. */ + + + + + + +#line 111 "wcspih.l" +#include +#include +#include +#include +#include + +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcsutil.h" + +#include "dis.h" +#include "wcs.h" +#include "wcshdr.h" + +#define INTEGER 0 +#define FLOAT 1 +#define FLOAT2 2 +#define STRING 3 +#define RECORD 4 + +#define PRIOR 1 +#define SEQUENT 2 + +#define SIP 1 +#define DSS 2 +#define WAT 3 + +static int wcspih_scanner(char *header, int nkeyrec, int relax, int ctrl, + int *nreject, int *nwcs, struct wcsprm **wcs, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcspih( + char *header, + int nkeyrec, + int relax, + int ctrl, + int *nreject, + int *nwcs, + struct wcsprm **wcs) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcspih_scanner(header, nkeyrec, relax, ctrl, nreject, nwcs, wcs, + yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcspih_scanner(char *header, int nkeyrec, int relax, \ + int ctrl, int *nreject, int *nwcs, struct wcsprm **wcs, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (wcspih_nkeyrec) { \ + strncpy(inbuff, wcspih_hdr, 80); \ + inbuff[80] = '\n'; \ + wcspih_hdr += 80; \ + wcspih_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* These global variables are required by YY_INPUT. */ +static char *wcspih_hdr; +static int wcspih_nkeyrec; + +/* Internal helper functions. */ +static int wcspih_final(int ndp[], int ndq[], int distran, double dsstmp[], + char *wat[], int *nwcs, struct wcsprm **wcs); +static int wcspih_inits(int naxis, int alts[], int dpq[], int npv[], + int nps[], int ndp[], int ndq[], int distran, int *nwcs, + struct wcsprm **wcs); +static void wcspih_naxes(int naxis, int i, int j, char a, int distype, + int alts[], int dpq[], int *npptr); + +static int wcspih_jdref(double *wptr, const double *jdref); +static int wcspih_jdrefi(double *wptr, const double *jdrefi); +static int wcspih_jdreff(double *wptr, const double *jdreff); +static int wcspih_epoch(double *wptr, const double *epoch); +static int wcspih_vsource(double *wptr, const double *vsource); + +static int wcspih_timepixr(double timepixr); + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcspih_abort_jmp_env; +#define exit(status) longjmp(wcspih_abort_jmp_env, status) + +#line 19980 "wcspih.c" +#line 19981 "wcspih.c" + +#define INITIAL 0 +#define CCia 1 +#define CCi_ja 2 +#define CCCCCia 3 +#define CCi_ma 4 +#define CCCCCCCa 5 +#define CCCCCCCC 6 +#define CROTAi 7 +#define PROJPn 8 +#define SIP2 9 +#define SIP3 10 +#define DSSAMDXY 11 +#define PLTDECSN 12 +#define VALUE 13 +#define INTEGER_VAL 14 +#define FLOAT_VAL 15 +#define FLOAT2_VAL 16 +#define STRING_VAL 17 +#define RECORD_VAL 18 +#define RECFIELD 19 +#define RECCOLON 20 +#define RECVALUE 21 +#define RECEND 22 +#define COMMENT 23 +#define DISCARD 24 +#define ERROR 25 +#define FLUSH 26 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 212 "wcspih.l" + +#line 214 "wcspih.l" + /* Keyword indices, as used in the WCS papers, e.g. PCi_ja, PVi_ma. */ + char a; + int i, j, m, p, q; + + char *cptr, *errmsg, errtxt[80], *hptr, *keep, *keyname, *keyrec, + keyword[16], strtmp[80], *wat[2], *watstr; + int altlin, alts[27], distran, distype, dpq[27], dssflag, gotone, + ialt, inttmp, ipass, ipx, ix, jx, naxis, ndp[27], ndq[27], + nother, *npptr, nps[27], npass, npv[27], nvalid, rectype, + sipflag, status, valtype, voff, watflag, watn; + double dbltmp, dbl2tmp[2], dsstmp[20]; + void *vptr, *wptr; + struct disprm *disp, distem; + struct wcsprm *wcsp, wcstem; + int (*chekval)(double); + int (*special)(double *, const double *); + + naxis = 0; + for (ialt = 0; ialt < 27; ialt++) { + alts[ialt] = 0; + dpq[ialt] = 0; + npv[ialt] = 0; + nps[ialt] = 0; + ndp[ialt] = 0; + ndq[ialt] = 0; + } + + /* Parameters used to implement YY_INPUT. */ + wcspih_hdr = header; + wcspih_nkeyrec = nkeyrec; + + /* Our handle on the input stream. */ + keyrec = header; + hptr = header; + keep = 0x0; + + /* For keeping tallies of keywords found. */ + *nreject = 0; + nvalid = 0; + nother = 0; + + /* If strict, then also reject. */ + if (relax & WCSHDR_strict) relax |= WCSHDR_reject; + + /* Keyword parameters. */ + i = j = 0; + m = 0; + a = ' '; + + /* For decoding the keyvalue. */ + valtype = -1; + distype = 0; + vptr = 0x0; + + /* For keywords that require special handling. */ + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + distran = 0; + sipflag = 0; + dssflag = 0; + watflag = 0; + watn = 0; + + /* The data structures produced. */ + *nwcs = 0; + *wcs = 0x0; + + /* Control variables. */ + ipass = 1; + npass = 2; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcspih_abort_jmp_env)) { + return 3; + } + + BEGIN(INITIAL); + + +#line 20338 "wcspih.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + + ++yy_cp; + } + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos + 1; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 295 "wcspih.l" +{ + keyname = "NAXISn"; + + if (ipass == 1) { + sscanf(yytext, "NAXIS = %d", &naxis); + if (naxis < 0) naxis = 0; + BEGIN(FLUSH); + + } else { + sscanf(yytext, "NAXIS = %d", &i); + + if (i < 0) { + errmsg = "negative value of NAXIS ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 315 "wcspih.l" +{ + sscanf(yytext, "WCSAXES%c= %d", &a, &i); + + if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCSAXESa"; + BEGIN(COMMENT); + } + } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 331 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crpix); + + keyname = "CRPIXja"; + BEGIN(CCCCCia); + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 339 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + keyname = "PCi_ja"; + BEGIN(CCi_ja); + } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 348 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + keyname = "CDi_ja"; + BEGIN(CCi_ja); + } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 357 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + keyname = "CDELTia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 365 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "CROTAn"; + BEGIN(CROTAi); + } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 374 "wcspih.l" +{ + valtype = STRING; + vptr = &(wcstem.cunit); + + keyname = "CUNITia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 382 "wcspih.l" +{ + valtype = STRING; + vptr = &(wcstem.ctype); + + keyname = "CTYPEia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 390 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crval); + + keyname = "CRVALia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 398 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.lonpole); + + keyname = "LONPOLEa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 406 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.latpole); + + keyname = "LATPOLEa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 414 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + keyname = "RESTFRQa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 422 "wcspih.l" +{ + if (relax & WCSHDR_strict) { + errmsg = "the RESTFREQ keyword is deprecated, use RESTFRQa"; + BEGIN(ERROR); + + } else { + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + unput(' '); + + keyname = "RESTFREQ"; + BEGIN(CCCCCCCa); + } + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 438 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.restwav); + + keyname = "RESTWAVa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 446 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + npptr = npv; + + keyname = "PVi_ma"; + BEGIN(CCi_ma); + } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 455 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.pv); + npptr = npv; + + keyname = "PROJPn"; + BEGIN(PROJPn); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 464 "wcspih.l" +{ + valtype = STRING; + vptr = &(wcstem.ps); + npptr = nps; + + keyname = "PSi_ma"; + BEGIN(CCi_ma); + } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 473 "wcspih.l" +{ + sscanf(yytext, "VELREF%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the VELREF keyword is deprecated, use SPECSYSa"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_VELREFa) { + valtype = INTEGER; + vptr = &(wcstem.velref); + + unput(a); + + keyname = "VELREF"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "VELREF keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 498 "wcspih.l" +{ + valtype = STRING; + vptr = &(wcstem.cname); + + keyname = "CNAMEia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 506 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.crder); + + keyname = "CRDERia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 514 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.csyer); + + keyname = "CSYERia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 522 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.czphs); + + keyname = "CZPHSia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 530 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.cperi); + + keyname = "CPERIia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 538 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.wcsname; + + keyname = "WCSNAMEa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 546 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.timesys; + + keyname = "TIMESYS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 554 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.trefpos; + + keyname = "TREFPOS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 562 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.trefdir; + + keyname = "TREFDIR"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 570 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.plephem; + + keyname = "PLEPHEM"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 578 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.timeunit; + + keyname = "TIMEUNIT"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 586 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.dateref; + + keyname = "DATEREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 594 "wcspih.l" +{ + valtype = FLOAT2; + vptr = wcstem.mjdref; + + keyname = "MJDREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 602 "wcspih.l" +{ + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + + keyname = "MJDREFI"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 611 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.mjdref + 1; + + keyname = "MJDREFF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 619 "wcspih.l" +{ + valtype = FLOAT2; + vptr = wcstem.mjdref; + special = wcspih_jdref; + + keyname = "JDREF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 628 "wcspih.l" +{ + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcspih_jdrefi; + + keyname = "JDREFI"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 638 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcspih_jdreff; + + keyname = "JDREFF"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 647 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timeoffs); + + keyname = "TIMEOFFS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 655 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.dateobs; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-OBS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 664 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.datebeg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-BEG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 673 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.dateavg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-AVG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 682 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.dateend; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-END"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 691 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdobs); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-OBS"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 700 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdbeg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-BEG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 709 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdavg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-AVG"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 718 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.mjdend); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-END"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 727 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.jepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "JEPOCH"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 736 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.bepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "BEPOCH"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 745 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.tstart); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTART"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 754 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.tstop); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTOP"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 763 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.xposure); + if (ctrl < -10) keep = keyrec; + + keyname = "XPOSURE"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 772 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.telapse); + if (ctrl < -10) keep = keyrec; + + keyname = "TELAPSE"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 781 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timsyer); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMSYER"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 790 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timrder); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMRDER"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 799 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timedel); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEDEL"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 808 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.timepixr); + chekval = wcspih_timepixr; + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEPIXR"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 818 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-X"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 827 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 1; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-Y"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 836 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 2; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-Z"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 845 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 3; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-L"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 854 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 4; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-B"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 863 "wcspih.l" +{ + valtype = FLOAT; + vptr = wcstem.obsgeo + 5; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-H"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 872 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.obsorbit; + + keyname = "OBSORBIT"; + BEGIN(CCCCCCCC); + } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 880 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.radesys; + + keyname = "RADESYSa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 888 "wcspih.l" +{ + if (relax & WCSHDR_RADECSYS) { + valtype = STRING; + vptr = wcstem.radesys; + + unput(' '); + + keyname = "RADECSYS"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the RADECSYS keyword is deprecated, use RADESYSa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 907 "wcspih.l" +{ + sscanf(yytext, "EPOCH%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the EPOCH keyword is deprecated, use EQUINOXa"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_EPOCHa) { + valtype = FLOAT; + vptr = &(wcstem.equinox); + special = wcspih_epoch; + + unput(a); + + keyname = "EPOCH"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "EPOCH keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 933 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.equinox); + + keyname = "EQUINOXa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 941 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.specsys; + + keyname = "SPECSYSa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 949 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.ssysobs; + + keyname = "SSYSOBSa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 957 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.velosys); + + keyname = "VELOSYSa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 965 "wcspih.l" +{ + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcspih_vsource; + + yyless(7); + + keyname = "VSOURCEa"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the VSOURCEa keyword is deprecated, use ZSOURCEa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 985 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.zsource); + + keyname = "ZSOURCEa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 993 "wcspih.l" +{ + valtype = STRING; + vptr = wcstem.ssyssrc; + + keyname = "SSYSSRCa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 1001 "wcspih.l" +{ + valtype = FLOAT; + vptr = &(wcstem.velangl); + + keyname = "VELANGLa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 1009 "wcspih.l" +{ + valtype = STRING; + distype = PRIOR; + vptr = &(distem.dtype); + + keyname = "CPDISja"; + BEGIN(CCCCCia); + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 1018 "wcspih.l" +{ + valtype = STRING; + distype = SEQUENT; + vptr = &(distem.dtype); + + keyname = "CQDISia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 1027 "wcspih.l" +{ + valtype = RECORD; + distype = PRIOR; + vptr = &(distem.dp); + npptr = ndp; + + keyname = "DPja"; + BEGIN(CCia); + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 1037 "wcspih.l" +{ + valtype = RECORD; + distype = SEQUENT; + vptr = &(distem.dp); + npptr = ndq; + + keyname = "DQia"; + BEGIN(CCia); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 1047 "wcspih.l" +{ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + keyname = "CPERRja"; + BEGIN(CCCCCia); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 1056 "wcspih.l" +{ + valtype = FLOAT; + distype = SEQUENT; + vptr = &(distem.maxdis); + + keyname = "CQERRia"; + BEGIN(CCCCCia); + } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 1065 "wcspih.l" +{ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.totdis); + + keyname = "DVERRa"; + BEGIN(CCCCCCCa); + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 1074 "wcspih.l" +{ + /* SIP: axis 1 polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 1; + a = ' '; + + keyname = "A_ORDER"; + BEGIN(VALUE); + } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 1087 "wcspih.l" +{ + /* SIP: axis 2 polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 2; + a = ' '; + + keyname = "B_ORDER"; + BEGIN(VALUE); + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 1100 "wcspih.l" +{ + /* SIP: axis 1 inverse polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 1; + a = ' '; + + keyname = "AP_ORDER"; + BEGIN(VALUE); + } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 1113 "wcspih.l" +{ + /* SIP: axis 2 inverse polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 2; + a = ' '; + + keyname = "BP_ORDER"; + BEGIN(VALUE); + } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 1126 "wcspih.l" +{ + /* SIP: axis 1 maximum distortion. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + i = 1; + a = ' '; + + keyname = "A_DMAX"; + BEGIN(VALUE); + } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 1139 "wcspih.l" +{ + /* SIP: axis 2 maximum distortion. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + i = 2; + a = ' '; + + keyname = "B_DMAX"; + BEGIN(VALUE); + } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 1152 "wcspih.l" +{ + /* SIP: axis 1 polynomial coefficient. */ + i = 1; + sipflag = 2; + + keyname = "A_p_q"; + BEGIN(SIP2); + } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 1161 "wcspih.l" +{ + /* SIP: axis 2 polynomial coefficient. */ + i = 2; + sipflag = 2; + + keyname = "B_p_q"; + BEGIN(SIP2); + } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 1170 "wcspih.l" +{ + /* SIP: axis 1 inverse polynomial coefficient. */ + i = 1; + sipflag = 3; + + keyname = "AP_p_q"; + BEGIN(SIP3); + } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 1179 "wcspih.l" +{ + /* SIP: axis 2 inverse polynomial coefficient. */ + i = 2; + sipflag = 3; + + keyname = "BP_p_q"; + BEGIN(SIP3); + } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 1188 "wcspih.l" +{ + /* DSS: LLH corner pixel coordinate 1. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp; + dssflag = 1; + distran = DSS; + + keyname = "CNPIX1"; + BEGIN(VALUE); + } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 1200 "wcspih.l" +{ + /* DSS: LLH corner pixel coordinate 2. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+1; + dssflag = 1; + distran = DSS; + + keyname = "CNPIX1"; + BEGIN(VALUE); + } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 1212 "wcspih.l" +{ + /* DSS: plate centre x-coordinate in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+2; + dssflag = 1; + distran = DSS; + + keyname = "PPO3"; + BEGIN(VALUE); + } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 1224 "wcspih.l" +{ + /* DSS: plate centre y-coordinate in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+3; + dssflag = 1; + distran = DSS; + + keyname = "PPO6"; + BEGIN(VALUE); + } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 1236 "wcspih.l" +{ + /* DSS: pixel x-dimension in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+4; + dssflag = 1; + distran = DSS; + + keyname = "XPIXELSZ"; + BEGIN(VALUE); + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 1248 "wcspih.l" +{ + /* DSS: pixel y-dimension in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+5; + dssflag = 1; + distran = DSS; + + keyname = "YPIXELSZ"; + BEGIN(VALUE); + } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 1260 "wcspih.l" +{ + /* DSS: plate centre, right ascension - hours. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+6; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAH"; + BEGIN(VALUE); + } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 1272 "wcspih.l" +{ + /* DSS: plate centre, right ascension - minutes. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+7; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAM"; + BEGIN(VALUE); + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 1284 "wcspih.l" +{ + /* DSS: plate centre, right ascension - seconds. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+8; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAS"; + BEGIN(VALUE); + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 1296 "wcspih.l" +{ + /* DSS: plate centre, declination - sign. */ + valtype = STRING; + distype = SEQUENT; + vptr = dsstmp+9; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECSN"; + BEGIN(PLTDECSN); + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 1308 "wcspih.l" +{ + /* DSS: plate centre, declination - degrees. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+10; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECD"; + BEGIN(VALUE); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 1320 "wcspih.l" +{ + /* DSS: plate centre, declination - arcmin. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+11; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECM"; + BEGIN(VALUE); + } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 1332 "wcspih.l" +{ + /* DSS: plate centre, declination - arcsec. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+12; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECS"; + BEGIN(VALUE); + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 1344 "wcspih.l" +{ + /* DSS: plate identification (insufficient to trigger DSS). */ + valtype = STRING; + distype = SEQUENT; + vptr = dsstmp+13; + dssflag = 2; + distran = 0; + + keyname = "PLATEID"; + BEGIN(VALUE); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 1356 "wcspih.l" +{ + /* DSS: axis 1 polynomial coefficient. */ + i = 1; + dssflag = 3; + + keyname = "AMDXm"; + BEGIN(DSSAMDXY); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 1365 "wcspih.l" +{ + /* DSS: axis 2 polynomial coefficient. */ + i = 2; + dssflag = 3; + + keyname = "AMDYm"; + BEGIN(DSSAMDXY); + } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 1374 "wcspih.l" +{ + /* TNX or ZPX: string-encoded data array. */ + sscanf(yytext, "WAT%d_%d", &i, &m); + if (watn < m) watn = m; + watflag = 1; + + valtype = STRING; + distype = SEQUENT; + vptr = wat[i-1] + 68*(m-1); + + a = ' '; + distran = WAT; + + keyname = "WATi_m"; + BEGIN(VALUE); + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 1391 "wcspih.l" +{ + if (wcspih_nkeyrec) { + wcspih_nkeyrec = 0; + errmsg = "keyrecords following the END keyrecord were ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 1401 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 111: +#line 1406 "wcspih.l" +case 112: +#line 1407 "wcspih.l" +case 113: +#line 1408 "wcspih.l" +case 114: +YY_RULE_SETUP +#line 1408 "wcspih.l" +{ + sscanf(yytext, "%d%c", &i, &a); + BEGIN(VALUE); + } + YY_BREAK +case 115: +#line 1414 "wcspih.l" +case 116: +#line 1415 "wcspih.l" +case 117: +#line 1416 "wcspih.l" +case 118: +#line 1417 "wcspih.l" +case 119: +#line 1418 "wcspih.l" +case 120: +#line 1419 "wcspih.l" +case 121: +YY_RULE_SETUP +#line 1419 "wcspih.l" +{ + if (relax & WCSHDR_reject) { + /* Violates the basic FITS standard. */ + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 122: +#line 1433 "wcspih.l" +case 123: +#line 1434 "wcspih.l" +case 124: +#line 1435 "wcspih.l" +case 125: +#line 1436 "wcspih.l" +case 126: +#line 1437 "wcspih.l" +case 127: +#line 1438 "wcspih.l" +case 128: +#line 1439 "wcspih.l" +case 129: +#line 1440 "wcspih.l" +case 130: +YY_RULE_SETUP +#line 1440 "wcspih.l" +{ + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 1447 "wcspih.l" +{ + /* Let it go. */ + BEGIN(DISCARD); + } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 1452 "wcspih.l" +{ + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "keyword looks very much like %s but isn't", + keyname); + BEGIN(ERROR); + + } else { + /* Let it go. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 133: +#line 1467 "wcspih.l" +case 134: +#line 1468 "wcspih.l" +case 135: +#line 1469 "wcspih.l" +case 136: +YY_RULE_SETUP +#line 1469 "wcspih.l" +{ + sscanf(yytext, "%d_%d%c", &i, &j, &a); + BEGIN(VALUE); + } + YY_BREAK +case 137: +#line 1476 "wcspih.l" +case 138: +#line 1477 "wcspih.l" +case 139: +#line 1478 "wcspih.l" +case 140: +#line 1479 "wcspih.l" +case 141: +#line 1480 "wcspih.l" +case 142: +#line 1481 "wcspih.l" +case 143: +#line 1482 "wcspih.l" +case 144: +#line 1483 "wcspih.l" +case 145: +#line 1484 "wcspih.l" +case 146: +#line 1485 "wcspih.l" +case 147: +#line 1486 "wcspih.l" +case 148: +#line 1487 "wcspih.l" +case 149: +#line 1488 "wcspih.l" +case 150: +#line 1489 "wcspih.l" +case 151: +#line 1490 "wcspih.l" +case 152: +#line 1491 "wcspih.l" +case 153: +#line 1492 "wcspih.l" +case 154: +#line 1493 "wcspih.l" +case 155: +#line 1494 "wcspih.l" +case 156: +#line 1495 "wcspih.l" +case 157: +YY_RULE_SETUP +#line 1495 "wcspih.l" +{ + if (((altlin == 1) && (relax & WCSHDR_PC0i_0ja)) || + ((altlin == 2) && (relax & WCSHDR_CD0i_0ja))) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 158: +#line 1513 "wcspih.l" +case 159: +#line 1514 "wcspih.l" +case 160: +#line 1515 "wcspih.l" +case 161: +#line 1516 "wcspih.l" +case 162: +#line 1517 "wcspih.l" +case 163: +#line 1518 "wcspih.l" +case 164: +#line 1519 "wcspih.l" +case 165: +#line 1520 "wcspih.l" +case 166: +#line 1521 "wcspih.l" +case 167: +YY_RULE_SETUP +#line 1521 "wcspih.l" +{ + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + YY_BREAK +case 168: +#line 1529 "wcspih.l" +case 169: +#line 1530 "wcspih.l" +case 170: +#line 1531 "wcspih.l" +case 171: +#line 1532 "wcspih.l" +case 172: +#line 1533 "wcspih.l" +case 173: +#line 1534 "wcspih.l" +case 174: +#line 1535 "wcspih.l" +case 175: +#line 1536 "wcspih.l" +case 176: +#line 1537 "wcspih.l" +case 177: +YY_RULE_SETUP +#line 1537 "wcspih.l" +{ + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 1544 "wcspih.l" +{ + /* This covers the defunct forms CD00i00j and PC00i00j. */ + if (((altlin == 1) && (relax & WCSHDR_PC00i00j)) || + ((altlin == 2) && (relax & WCSHDR_CD00i00j))) { + sscanf(yytext, "%3d%3d", &i, &j); + a = ' '; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "this form of the %s keyword is deprecated, use %s", + keyname, keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 1565 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 180: +#line 1570 "wcspih.l" +case 181: +YY_RULE_SETUP +#line 1570 "wcspih.l" +{ + if (YY_START == CCCCCCCa) { + sscanf(yytext, "%c", &a); + } else { + unput(yytext[0]); + a = 0; + } + + BEGIN(VALUE); + } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 1581 "wcspih.l" +{ + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "invalid alternate code, keyword resembles %s " + "but isn't", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 183: +#line 1596 "wcspih.l" +case 184: +#line 1597 "wcspih.l" +case 185: +#line 1598 "wcspih.l" +case 186: +YY_RULE_SETUP +#line 1598 "wcspih.l" +{ + sscanf(yytext, "%d_%d%c", &i, &m, &a); + BEGIN(VALUE); + } + YY_BREAK +case 187: +#line 1604 "wcspih.l" +case 188: +#line 1605 "wcspih.l" +case 189: +#line 1606 "wcspih.l" +case 190: +#line 1607 "wcspih.l" +case 191: +#line 1608 "wcspih.l" +case 192: +#line 1609 "wcspih.l" +case 193: +#line 1610 "wcspih.l" +case 194: +#line 1611 "wcspih.l" +case 195: +#line 1612 "wcspih.l" +case 196: +#line 1613 "wcspih.l" +case 197: +#line 1614 "wcspih.l" +case 198: +#line 1615 "wcspih.l" +case 199: +#line 1616 "wcspih.l" +case 200: +#line 1617 "wcspih.l" +case 201: +#line 1618 "wcspih.l" +case 202: +#line 1619 "wcspih.l" +case 203: +#line 1620 "wcspih.l" +case 204: +#line 1621 "wcspih.l" +case 205: +#line 1622 "wcspih.l" +case 206: +#line 1623 "wcspih.l" +case 207: +YY_RULE_SETUP +#line 1623 "wcspih.l" +{ + if (((valtype == FLOAT) && (relax & WCSHDR_PV0i_0ma)) || + ((valtype == STRING) && (relax & WCSHDR_PS0i_0ma))) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 208: +#line 1641 "wcspih.l" +case 209: +#line 1642 "wcspih.l" +case 210: +#line 1643 "wcspih.l" +case 211: +#line 1644 "wcspih.l" +case 212: +#line 1645 "wcspih.l" +case 213: +#line 1646 "wcspih.l" +case 214: +#line 1647 "wcspih.l" +case 215: +#line 1648 "wcspih.l" +case 216: +#line 1649 "wcspih.l" +case 217: +YY_RULE_SETUP +#line 1649 "wcspih.l" +{ + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + YY_BREAK +case 218: +#line 1657 "wcspih.l" +case 219: +#line 1658 "wcspih.l" +case 220: +#line 1659 "wcspih.l" +case 221: +#line 1660 "wcspih.l" +case 222: +#line 1661 "wcspih.l" +case 223: +#line 1662 "wcspih.l" +case 224: +#line 1663 "wcspih.l" +case 225: +#line 1664 "wcspih.l" +case 226: +#line 1665 "wcspih.l" +case 227: +YY_RULE_SETUP +#line 1665 "wcspih.l" +{ + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + YY_BREAK +case 228: +YY_RULE_SETUP +#line 1672 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 229: +#line 1677 "wcspih.l" +case 230: +#line 1678 "wcspih.l" +case 231: +YY_RULE_SETUP +#line 1678 "wcspih.l" +{ + a = ' '; + sscanf(yytext, "%d%c", &i, &a); + + if (relax & WCSHDR_strict) { + errmsg = "the CROTAn keyword is deprecated, use PCi_ja"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_CROTAia) { + yyless(0); + BEGIN(CCCCCia); + + } else if (relax & WCSHDR_reject) { + errmsg = "CROTAn keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + YY_BREAK +case 232: +YY_RULE_SETUP +#line 1700 "wcspih.l" +{ + yyless(0); + BEGIN(CCCCCia); + } + YY_BREAK +case 233: +YY_RULE_SETUP +#line 1705 "wcspih.l" +{ + if (relax & WCSHDR_PROJPn) { + sscanf(yytext, "%d", &m); + i = 0; + a = ' '; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "the PROJPn keyword is deprecated, use PVi_ma"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 234: +#line 1722 "wcspih.l" +case 235: +YY_RULE_SETUP +#line 1722 "wcspih.l" +{ + if (relax & (WCSHDR_PROJPn | WCSHDR_reject)) { + errmsg = "invalid PROJPn keyword"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + YY_BREAK +case 236: +YY_RULE_SETUP +#line 1732 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 237: +#line 1737 "wcspih.l" +case 238: +YY_RULE_SETUP +#line 1737 "wcspih.l" +{ + /* SIP keywords. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.dp); + npptr = ndp; + + a = ' '; + distran = SIP; + + sscanf(yytext, "%d_%d", &p, &q); + BEGIN(VALUE); + } + YY_BREAK +case 239: +#line 1752 "wcspih.l" +case 240: +YY_RULE_SETUP +#line 1752 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 241: +#line 1757 "wcspih.l" +case 242: +YY_RULE_SETUP +#line 1757 "wcspih.l" +{ + /* DSS keywords. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = &(distem.dp); + npptr = ndq; + + a = ' '; + distran = DSS; + + sscanf(yytext, "%d", &m); + BEGIN(VALUE); + } + YY_BREAK +case 243: +YY_RULE_SETUP +#line 1771 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 244: +/* rule 244 can match eol */ +YY_RULE_SETUP +#line 1775 "wcspih.l" +{ + /* Special handling for this iconic DSS keyword. */ + if (1 < ipass) { + /* Look for a minus sign. */ + sscanf(yytext, "= '%s", strtmp); + dbltmp = strcmp(strtmp, "-") ? 1.0 : -1.0; + } + + BEGIN(COMMENT); + } + YY_BREAK +case 245: +YY_RULE_SETUP +#line 1786 "wcspih.l" +{ + BEGIN(DISCARD); + } + YY_BREAK +case 246: +YY_RULE_SETUP +#line 1790 "wcspih.l" +{ + /* Do checks on i, j & m. */ + if (99 < i || 99 < j || 99 < m) { + if (relax & WCSHDR_reject) { + if (99 < i || 99 < j) { + errmsg = "axis number exceeds 99"; + } else if (m > 99) { + errmsg = "parameter number exceeds 99"; + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else { + if (valtype == INTEGER) { + BEGIN(INTEGER_VAL); + } else if (valtype == FLOAT) { + BEGIN(FLOAT_VAL); + } else if (valtype == FLOAT2) { + BEGIN(FLOAT2_VAL); + } else if (valtype == STRING) { + BEGIN(STRING_VAL); + } else if (valtype == RECORD) { + BEGIN(RECORD_VAL); + } else { + errmsg = errtxt; + sprintf(errmsg, "internal parser ERROR, bad data type: %d", + valtype); + BEGIN(ERROR); + } + } + } + YY_BREAK +case 247: +YY_RULE_SETUP +#line 1826 "wcspih.l" +{ + errmsg = "invalid KEYWORD = VALUE syntax"; + BEGIN(ERROR); + } + YY_BREAK +case 248: +YY_RULE_SETUP +#line 1831 "wcspih.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + sscanf(yytext, "%d", &inttmp); + + BEGIN(COMMENT); + } + } + YY_BREAK +case 249: +YY_RULE_SETUP +#line 1843 "wcspih.l" +{ + errmsg = "an integer value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 250: +YY_RULE_SETUP +#line 1848 "wcspih.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + wcsutil_str2double(yytext, &dbltmp); + + if (chekval && chekval(dbltmp)) { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } else { + BEGIN(COMMENT); + } + } + } + YY_BREAK +case 251: +YY_RULE_SETUP +#line 1865 "wcspih.l" +{ + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 252: +YY_RULE_SETUP +#line 1870 "wcspih.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue as integer and fractional parts. */ + wcsutil_str2double2(yytext, dbl2tmp); + + BEGIN(COMMENT); + } + } + YY_BREAK +case 253: +YY_RULE_SETUP +#line 1882 "wcspih.l" +{ + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 254: +/* rule 254 can match eol */ +YY_RULE_SETUP +#line 1887 "wcspih.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + strcpy(strtmp, yytext+1); + + /* Squeeze out repeated quotes. */ + ix = 0; + for (jx = 0; jx < 72; jx++) { + if (ix < jx) { + strtmp[ix] = strtmp[jx]; + } + + if (strtmp[jx] == '\0') { + if (ix) strtmp[ix-1] = '\0'; + break; + } else if (strtmp[jx] == '\'' && strtmp[jx+1] == '\'') { + jx++; + } + + ix++; + } + + BEGIN(COMMENT); + } + } + YY_BREAK +case 255: +YY_RULE_SETUP +#line 1916 "wcspih.l" +{ + errmsg = "a string value was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 256: +/* rule 256 can match eol */ +YY_RULE_SETUP +#line 1921 "wcspih.l" +{ + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + yyless(1); + + BEGIN(RECFIELD); + } + } + YY_BREAK +case 257: +YY_RULE_SETUP +#line 1932 "wcspih.l" +{ + errmsg = "a record was expected"; + BEGIN(ERROR); + } + YY_BREAK +case 258: +YY_RULE_SETUP +#line 1937 "wcspih.l" +{ + strcpy(strtmp, yytext); + BEGIN(RECCOLON); + } + YY_BREAK +case 259: +YY_RULE_SETUP +#line 1942 "wcspih.l" +{ + errmsg = "invalid record field"; + BEGIN(ERROR); + } + YY_BREAK +case 260: +YY_RULE_SETUP +#line 1947 "wcspih.l" +{ + BEGIN(RECVALUE); + } + YY_BREAK +case 261: +YY_RULE_SETUP +#line 1951 "wcspih.l" +{ + errmsg = "invalid record syntax"; + BEGIN(ERROR); + } + YY_BREAK +case 262: +YY_RULE_SETUP +#line 1956 "wcspih.l" +{ + rectype = 0; + sscanf(yytext, "%d", &inttmp); + BEGIN(RECEND); + } + YY_BREAK +case 263: +YY_RULE_SETUP +#line 1962 "wcspih.l" +{ + rectype = 1; + wcsutil_str2double(yytext, &dbltmp); + BEGIN(RECEND); + } + YY_BREAK +case 264: +YY_RULE_SETUP +#line 1968 "wcspih.l" +{ + errmsg = "invalid record value"; + BEGIN(ERROR); + } + YY_BREAK +case 265: +YY_RULE_SETUP +#line 1973 "wcspih.l" +{ + BEGIN(COMMENT); + } + YY_BREAK +case 266: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1977 "wcspih.l" +{ + if (ipass == 1) { + /* Do first-pass bookkeeping. */ + wcspih_naxes(naxis, i, j, a, distype, alts, dpq, npptr); + BEGIN(FLUSH); + + } else if (*wcs) { + /* Store the value now that the keyrecord has been validated. */ + gotone = 0; + for (ialt = 0; ialt < *nwcs; ialt++) { + /* The loop here is for keywords that apply */ + /* to every alternate; these have a == 0. */ + if (a >= 'A') { + ialt = alts[a-'A'+1]; + if (ialt < 0) break; + } + gotone = 1; + + if (vptr) { + if (sipflag) { + /* Translate a SIP keyword into DPja. */ + disp = (*wcs)->lin.dispre; + ipx = (disp->ndp)++; + + /* SIP doesn't have alternates. */ + sprintf(keyword, "DP%d", i); + sprintf(strtmp, "SIP.%s.%d_%d", (sipflag==2)?"FWD":"REV", + p, q); + if (valtype == INTEGER) { + dpfill(disp->dp+ipx, keyword, strtmp, i, 0, inttmp, 0.0); + } else { + dpfill(disp->dp+ipx, keyword, strtmp, i, 1, 0, dbltmp); + } + + } else if (dssflag) { + /* All DSS keywords require special handling. */ + if (dssflag == 1) { + /* Temporary parameter for DSS used by wcspih_final(). */ + *((double *)vptr) = dbltmp; + + } else if (dssflag == 2) { + /* Temporary parameter for DSS used by wcspih_final(). */ + strcpy((char *)vptr, strtmp); + + } else { + /* Translate a DSS keyword into DQia. */ + if (m <= 13 || dbltmp != 0.0) { + disp = (*wcs)->lin.disseq; + ipx = (disp->ndp)++; + + /* DSS doesn't have alternates. */ + sprintf(keyword, "DQ%d", i); + sprintf(strtmp, "DSS.AMD.%d", m); + dpfill(disp->dp+ipx, keyword, strtmp, i, 1, 0, dbltmp); + + /* Also required by wcspih_final(). */ + if (m <= 3) { + dsstmp[13+(i-1)*3+m] = dbltmp; + } + } + } + + } else if (watflag) { + /* String array for TNX and ZPX used by wcspih_final(). */ + strcpy((char *)vptr, strtmp); + + } else { + /* An ordinary keyword. */ + wcsp = *wcs + ialt; + if (distype == 0) { + voff = (char *)vptr - (char *)(&wcstem); + wptr = (void *)((char *)wcsp + voff); + + } else { + voff = (char *)vptr - (char *)(&distem); + if (distype == PRIOR) { + /* Prior distortion. */ + disp = wcsp->lin.dispre; + } else { + /* Sequent distortion. */ + disp = wcsp->lin.disseq; + } + wptr = (void *)((char *)disp + voff); + } + + if (valtype == INTEGER) { + *((int *)wptr) = inttmp; + + } else if (valtype == FLOAT) { + /* Apply keyword parameterization. */ + if (npptr == npv) { + ipx = (wcsp->npv)++; + wcsp->pv[ipx].i = i; + wcsp->pv[ipx].m = m; + wptr = &(wcsp->pv[ipx].value); + + } else if (j) { + wptr = *((double **)wptr) + (i - 1)*(wcsp->naxis) + + (j - 1); + + } else if (i) { + wptr = *((double **)wptr) + (i - 1); + } + + if (special) { + special(wptr, &dbltmp); + } else { + *((double *)wptr) = dbltmp; + } + + /* Flag presence of PCi_ja, or CDi_ja and/or CROTAia. */ + if (altlin) { + wcsp->altlin |= altlin; + altlin = 0; + } + + } else if (valtype == FLOAT2) { + /* Split MJDREF and JDREF into integer and fraction.*/ + if (special) { + special(wptr, dbl2tmp); + } else { + *((double *)wptr) = dbl2tmp[0]; + *((double *)wptr + 1) = dbl2tmp[1]; + } + + } else if (valtype == STRING) { + /* Apply keyword parameterization. */ + if (npptr == nps) { + ipx = (wcsp->nps)++; + wcsp->ps[ipx].i = i; + wcsp->ps[ipx].m = m; + wptr = wcsp->ps[ipx].value; + + } else if (j) { + wptr = *((char (**)[72])wptr) + + (i - 1)*(wcsp->naxis) + (j - 1); + + } else if (i) { + wptr = *((char (**)[72])wptr) + (i - 1); + } + + cptr = (char *)wptr; + strcpy(cptr, strtmp); + + } else if (valtype == RECORD) { + ipx = (disp->ndp)++; + + if (a == ' ') { + sprintf(keyword, "%.2s%d", keyname, i); + } else { + sprintf(keyword, "%.2s%d%c", keyname, i, a); + } + + dpfill(disp->dp+ipx, keyword, strtmp, i, rectype, inttmp, + dbltmp); + } + } + } + + if (a) break; + } + + if (gotone) { + nvalid++; + if (ctrl == 4) { + if (distran || dssflag) { + wcsfprintf(stderr, "%.80s\n Accepted (%d) as a " + "recognised WCS convention.\n", keyrec, nvalid); + } else { + wcsfprintf(stderr, "%.80s\n Accepted (%d) as a " + "valid WCS keyrecord.\n", keyrec, nvalid); + } + } + + BEGIN(FLUSH); + + } else { + errmsg = "syntactically valid WCS keyrecord has no effect"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + } + YY_BREAK +case 267: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2163 "wcspih.l" +{ + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + YY_BREAK +case 268: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2168 "wcspih.l" +{ + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + YY_BREAK +case 269: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2173 "wcspih.l" +{ + errmsg = "invalid keyvalue or malformed keycomment"; + BEGIN(ERROR); + } + YY_BREAK +case 270: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2178 "wcspih.l" +{ + errmsg = "malformed keycomment"; + BEGIN(ERROR); + } + YY_BREAK +case 271: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2183 "wcspih.l" +{ + if (ipass == npass) { + if (ctrl < 0) { + /* Preserve discards. */ + keep = keyrec; + + } else if (2 < ctrl) { + nother++; + wcsfprintf(stderr, "%.80s\n Not a recognized WCS keyword.\n", + keyrec); + } + } + BEGIN(FLUSH); + } + YY_BREAK +case 272: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 2198 "wcspih.l" +{ + if (ipass == npass) { + (*nreject)++; + + if (ctrl%10 == -1) { + /* Preserve rejects. */ + keep = keyrec; + } + + if (1 < abs(ctrl%10)) { + wcsfprintf(stderr, "%.80s\n Rejected (%d), %s.\n", + keyrec, *nreject, errmsg); + } + } + BEGIN(FLUSH); + } + YY_BREAK +case 273: +/* rule 273 can match eol */ +YY_RULE_SETUP +#line 2215 "wcspih.l" +{ + if (ipass == npass && keep) { + if (hptr < keep) { + strncpy(hptr, keep, 80); + } + hptr += 80; + } + + /* Throw away the rest of the line and reset for the next one. */ + i = j = 0; + m = 0; + a = ' '; + + keyrec += 80; + + valtype = -1; + distype = 0; + vptr = 0x0; + keep = 0x0; + + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + sipflag = 0; + dssflag = 0; + watflag = 0; + + BEGIN(INITIAL); + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(CCia): +case YY_STATE_EOF(CCi_ja): +case YY_STATE_EOF(CCCCCia): +case YY_STATE_EOF(CCi_ma): +case YY_STATE_EOF(CCCCCCCa): +case YY_STATE_EOF(CCCCCCCC): +case YY_STATE_EOF(CROTAi): +case YY_STATE_EOF(PROJPn): +case YY_STATE_EOF(SIP2): +case YY_STATE_EOF(SIP3): +case YY_STATE_EOF(DSSAMDXY): +case YY_STATE_EOF(PLTDECSN): +case YY_STATE_EOF(VALUE): +case YY_STATE_EOF(INTEGER_VAL): +case YY_STATE_EOF(FLOAT_VAL): +case YY_STATE_EOF(FLOAT2_VAL): +case YY_STATE_EOF(STRING_VAL): +case YY_STATE_EOF(RECORD_VAL): +case YY_STATE_EOF(RECFIELD): +case YY_STATE_EOF(RECCOLON): +case YY_STATE_EOF(RECVALUE): +case YY_STATE_EOF(RECEND): +case YY_STATE_EOF(COMMENT): +case YY_STATE_EOF(DISCARD): +case YY_STATE_EOF(ERROR): +case YY_STATE_EOF(FLUSH): +#line 2246 "wcspih.l" +{ + /* End-of-input. */ + if (ipass == 1) { + if ((status = wcspih_inits(naxis, alts, dpq, npv, nps, ndp, ndq, + distran, nwcs, wcs)) || + (*nwcs == 0 && ctrl == 0)) { + return status; + } + + if (2 < abs(ctrl%10)) { + if (*nwcs == 1) { + if (strcmp(wcs[0]->wcsname, "DEFAULTS") != 0) { + wcsfprintf(stderr, "Found one coordinate representation.\n"); + } + } else { + wcsfprintf(stderr, "Found %d coordinate representations.\n", + *nwcs); + } + } + + watstr = calloc(2*(watn*68 + 1), sizeof(char)); + wat[0] = watstr; + wat[1] = watstr + watn*68 + 1; + } + + if (ipass++ < npass) { + wcspih_hdr = header; + wcspih_nkeyrec = nkeyrec; + keyrec = header; + *nreject = 0; + + i = j = 0; + m = 0; + a = ' '; + + valtype = -1; + distype = 0; + vptr = 0x0; + + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + sipflag = 0; + dssflag = 0; + watflag = 0; + + yyrestart(yyin, yyscanner); + + } else { + + if (ctrl < 0) { + *hptr = '\0'; + } else if (ctrl == 1) { + wcsfprintf(stderr, "%d WCS keyrecord%s rejected.\n", + *nreject, (*nreject==1)?" was":"s were"); + } else if (ctrl == 4) { + wcsfprintf(stderr, "\n"); + wcsfprintf(stderr, "%5d keyrecord%s rejected for syntax or " + "other errors,\n", *nreject, (*nreject==1)?" was":"s were"); + wcsfprintf(stderr, "%5d %s recognized as syntactically valid, " + "and\n", nvalid, (nvalid==1)?"was":"were"); + wcsfprintf(stderr, "%5d other%s were not recognized as WCS " + "keyrecords.\n", nother, (nother==1)?"":"s"); + } + + status = wcspih_final(ndp, ndq, distran, dsstmp, wat, nwcs, wcs); + free(watstr); + return status; + } + } + YY_BREAK +case 274: +YY_RULE_SETUP +#line 2318 "wcspih.l" +ECHO; + YY_BREAK +#line 23071 "wcspih.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + if ( *yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; + } + else + yy_current_state = yy_NUL_trans[yy_current_state]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + yy_current_state = yy_NUL_trans[yy_current_state]; + yy_is_jam = (yy_current_state == 0); + + if ( ! yy_is_jam ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) +{ + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_cp = yyg->yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yyg->yy_hold_char; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + yyg->yytext_ptr = yy_bp; + yyg->yy_hold_char = *yy_cp; + yyg->yy_c_buf_p = yy_cp; +} + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 2318 "wcspih.l" + + +/*---------------------------------------------------------------------------- +* Determine the number of coordinate representations (up to 27) and the +* number of coordinate axes in each, which distortions are present, and the +* number of PVi_ma, PSi_ma, DPja, and DQia keywords in each representation. +*---------------------------------------------------------------------------*/ + +void wcspih_naxes( + int naxis, + int i, + int j, + char a, + int distype, + int alts[], + int dpq[], + int *npptr) + +{ + /* On the first pass alts[] is used to determine the number of axes */ + /* for each of the 27 possible alternate coordinate descriptions. */ + int ialt, *ip; + + if (a == 0) { + return; + } + + ialt = 0; + if (a != ' ') { + ialt = a - 'A' + 1; + } + + ip = alts + ialt; + + if (*ip < naxis) { + *ip = naxis; + } + + /* i or j can be greater than naxis. */ + if (*ip < i) { + *ip = i; + } + + if (*ip < j) { + *ip = j; + } + + /* Type of distortions present. */ + dpq[ialt] |= distype; + + /* Count PVi_ma, PSi_ma, DPja, or DQia keywords. */ + if (npptr) { + npptr[ialt]++; + } +} + + +/*---------------------------------------------------------------------------- +* Allocate memory for an array of the required number of wcsprm structs and +* initialize each of them. +*---------------------------------------------------------------------------*/ + +int wcspih_inits( + int naxis, + int alts[], + int dpq[], + int npv[], + int nps[], + int ndp[], + int ndq[], + int distran, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, defaults, ndis, ndpmax, npsmax, npvmax, status = 0; + struct wcsprm *wcsp; + struct disprm *dis; + + /* Find the number of coordinate descriptions. */ + *nwcs = 0; + for (ialt = 0; ialt < 27; ialt++) { + if (alts[ialt]) (*nwcs)++; + } + + if ((defaults = !(*nwcs) && naxis)) { + /* NAXIS is non-zero but there were no WCS keywords with an alternate + version code; create a default WCS with blank alternate version. */ + wcspih_naxes(naxis, 0, 0, ' ', 0, alts, dpq, 0x0); + *nwcs = 1; + } + + if (*nwcs) { + /* Allocate memory for the required number of wcsprm structs. */ + if ((*wcs = calloc(*nwcs, sizeof(struct wcsprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + ndis = 0; + if (distran == SIP) { + /* DPja.NAXES and DPja.OFFSET.j to be added for SIP (see below and + wcspih_final()). */ + ndp[0] += 6; + + } else if (distran == DSS) { + /* DPja.NAXES to be added for DSS (see below and wcspih_final()). */ + ndq[0] += 2; + } + + /* Initialize each wcsprm struct. */ + wcsp = *wcs; + *nwcs = 0; + for (ialt = 0; ialt < 27; ialt++) { + if (alts[ialt]) { + wcsp->flag = -1; + npvmax = npv[ialt]; + npsmax = nps[ialt]; + if ((status = wcsinit(1, alts[ialt], wcsp, npvmax, npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record in wcsname whether this is a default description. */ + if (defaults) { + strcpy(wcsp->wcsname, "DEFAULTS"); + } + + /* Any distortions present? */ + if (dpq[ialt] & 1) { + if ((dis = calloc(1, sizeof(struct disprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + /* Attach it to linprm. Also inits it. */ + ndis++; + ndpmax = ndp[ialt]; + dis->flag = -1; + lindist(1, &(wcsp->lin), dis, ndpmax); + } + + if (dpq[ialt] & 2) { + if ((dis = calloc(1, sizeof(struct disprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + /* Attach it to linprm. Also inits it. */ + ndis++; + ndpmax = ndq[ialt]; + dis->flag = -1; + lindist(2, &(wcsp->lin), dis, ndpmax); + } + + /* On the second pass alts[] indexes the array of wcsprm structs. */ + alts[ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that there is no wcsprm for this alt. */ + alts[ialt] = -1; + } + } + + + /* Translated distortion? Neither SIP nor DSS have alternates, so the */ + /* presence of keywords for either (not both together), as flagged by */ + /* distran, necessarily refers to the primary representation. */ + if (distran == SIP) { + strcpy((*wcs)->lin.dispre->dtype[0], "SIP"); + strcpy((*wcs)->lin.dispre->dtype[1], "SIP"); + + /* SIP doesn't have axis mapping. */ + (*wcs)->lin.dispre->ndp = 6; + dpfill((*wcs)->lin.dispre->dp, "DP1", "NAXES", 0, 0, 2, 0.0); + dpfill((*wcs)->lin.dispre->dp+3, "DP2", "NAXES", 0, 0, 2, 0.0); + + } else if (distran == DSS) { + strcpy((*wcs)->lin.disseq->dtype[0], "DSS"); + strcpy((*wcs)->lin.disseq->dtype[1], "DSS"); + + /* The Paper IV translation of DSS doesn't require an axis mapping. */ + (*wcs)->lin.disseq->ndp = 2; + dpfill((*wcs)->lin.disseq->dp, "DQ1", "NAXES", 0, 0, 2, 0.0); + dpfill((*wcs)->lin.disseq->dp+1, "DQ2", "NAXES", 0, 0, 2, 0.0); + } + } + + return status; +} + + +/*---------------------------------------------------------------------------- +* Interpret the JDREF, JDREFI, and JDREFF keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_jdref(double *mjdref, const double *jdref) + +{ + /* Set MJDREF from JDREF. */ + if (undefined(mjdref[0] && undefined(mjdref[1]))) { + mjdref[0] = jdref[0] - 2400000.0; + mjdref[1] = jdref[1] - 0.5; + + if (mjdref[1] < 0.0) { + mjdref[0] -= 1.0; + mjdref[1] += 1.0; + } + } + + return 0; +} + +int wcspih_jdrefi(double *mjdref, const double *jdrefi) + +{ + /* Set the integer part of MJDREF from JDREFI. */ + if (undefined(mjdref[0])) { + mjdref[0] = *jdrefi - 2400000.5; + } + + return 0; +} + + +int wcspih_jdreff(double *mjdref, const double *jdreff) + +{ + /* Set the fractional part of MJDREF from JDREFF. */ + if (undefined(mjdref[1])) { + mjdref[1] = *jdreff; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret EPOCHa keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_epoch(double *equinox, const double *epoch) + +{ + /* If EQUINOXa is currently undefined then set it from EPOCHa. */ + if (undefined(*equinox)) { + *equinox = *epoch; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret VSOURCEa keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_vsource(double *zsource, const double *vsource) + +{ + double beta, c = 299792458.0; + + /* If ZSOURCEa is currently undefined then set it from VSOURCEa. */ + if (undefined(*zsource)) { + /* Convert relativistic Doppler velocity to redshift. */ + beta = *vsource/c; + *zsource = (1.0 + beta)/sqrt(1.0 - beta*beta) - 1.0; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Check validity of a TIMEPIXR keyvalue. +*---------------------------------------------------------------------------*/ + +int wcspih_timepixr(double timepixr) + +{ + return (timepixr < 0.0 || 1.0 < timepixr); +} + + +/*---------------------------------------------------------------------------- +* Interpret special keywords encountered for each coordinate representation. +*---------------------------------------------------------------------------*/ + +int wcspih_final( + int ndp[], + int ndq[], + int distran, + double dsstmp[], + char *wat[], + int *nwcs, + struct wcsprm **wcs) + +{ + char field[32], *wp, wpoly[12], wtype[8]; + int i, ialt, idp, ipv, m, npv, n, nterms, omax, omin, status, wctrl[4]; + double A1, A2, A3, B1, B2, B3, CNPIX1, CNPIX2, *crval, Rx, Ry, S, wval, + X0, Y0, Xc, Yc; + struct disprm *disp; + struct wcsprm *wcsp; + + for (ialt = 0; ialt < *nwcs; ialt++) { + /* Interpret -TAB header keywords. */ + if ((status = wcstab(*wcs+ialt))) { + wcsvfree(nwcs, wcs); + return status; + } + + if (ndp[ialt] && ndq[ialt]) { + /* Prior and sequent distortions co-exist in this representation; + ensure the latter gets DVERRa. */ + (*wcs+ialt)->lin.disseq->totdis = (*wcs+ialt)->lin.dispre->totdis; + } + } + + /* Translated distortion functions; apply only to the primary WCS. */ + wcsp = *wcs; + if (distran == SIP) { + /* SIP doesn't have alternates, nor axis mapping. */ + disp = wcsp->lin.dispre; + dpfill(disp->dp+1, "DP1", "OFFSET.1", 0, 1, 0, wcsp->crpix[0]); + dpfill(disp->dp+2, "DP1", "OFFSET.2", 0, 1, 0, wcsp->crpix[1]); + dpfill(disp->dp+4, "DP2", "OFFSET.1", 0, 1, 0, wcsp->crpix[0]); + dpfill(disp->dp+5, "DP2", "OFFSET.2", 0, 1, 0, wcsp->crpix[1]); + + } else if (distran == DSS) { + /* DSS doesn't have alternates, nor axis mapping. This translation */ + /* follows Paper IV, Sect. 5.2 using the same variable names. */ + CNPIX1 = dsstmp[0]; + CNPIX2 = dsstmp[1]; + + Xc = dsstmp[2]/1000.0; + Yc = dsstmp[3]/1000.0; + Rx = dsstmp[4]/1000.0; + Ry = dsstmp[5]/1000.0; + + A1 = dsstmp[14]; + A2 = dsstmp[15]; + A3 = dsstmp[16]; + B1 = dsstmp[17]; + B2 = dsstmp[18]; + B3 = dsstmp[19]; + S = sqrt(fabs(A1*B1 - A2*B2)); + + X0 = (A2*B3 - A3*B1) / (A1*B1 - A2*B2); + Y0 = (A3*B2 - A1*B3) / (A1*B1 - A2*B2); + + wcsp->crpix[0] = (Xc - X0)/Rx - (CNPIX1 - 0.5); + wcsp->crpix[1] = (Yc + Y0)/Ry - (CNPIX2 - 0.5); + + wcsp->pc[0] = A1*Rx/S; + wcsp->pc[1] = -A2*Ry/S; + wcsp->pc[2] = -B2*Rx/S; + wcsp->pc[3] = B1*Ry/S; + wcsp->altlin = 1; + + wcsp->cdelt[0] = -S/3600.0; + wcsp->cdelt[1] = S/3600.0; + + crval = wcsp->crval; + crval[0] = (dsstmp[6] + (dsstmp[7] + dsstmp[8] /60.0)/60.0)*15.0; + crval[1] = dsstmp[10] + (dsstmp[11] + dsstmp[12]/60.0)/60.0; + if (dsstmp[9] == -1.0) crval[1] *= -1.0; + + strcpy(wcsp->ctype[0], "RA---TAN"); + strcpy(wcsp->ctype[1], "DEC--TAN"); + + sprintf(wcsp->wcsname, "DSS PLATEID %.4s", (char *)(dsstmp+13)); + + /* Erase the approximate WCS provided in modern DSS headers. */ + wcsp->cd[0] = 0.0; + wcsp->cd[1] = 0.0; + wcsp->cd[2] = 0.0; + wcsp->cd[3] = 0.0; + + } else if (distran == WAT) { + /* TNX and ZPX don't have alternates, nor axis mapping. */ + disp = wcsp->lin.disseq; + + /* Disassemble the core dump stored in the WATi_m strings. */ + nterms = 0; + for (i = 0; i < 2; i++) { + sscanf(wat[i], "wtype=%s", wtype); + + if (strcmp(wtype, "tnx") == 0) { + strcpy(disp->dtype[i], "WAT-TNX"); + } else if (strcmp(wtype, "zpx") == 0) { + strcpy(disp->dtype[i], "WAT-ZPX"); + } else { + /* Could contain "tan" or something else to be ignored. */ + lindist(2, &(wcsp->lin), 0x0, 0); + return 0; + } + + /* The PROJPn parameters are duplicated on each ZPX axis. */ + if (i == 1 && strcmp(wtype, "zpx") == 0) { + /* Take those on the second (latitude) axis ignoring the other. */ + /* First we have to count them and allocate space in wcsprm. */ + wp = wat[i]; + for (npv = 0; npv < 30; npv++) { + if ((wp = strstr(wp, "projp")) == 0x0) break; + wp += 5; + } + + /* Allocate space. */ + if (npv) { + wcsp->npvmax += npv; + wcsp->pv = realloc(wcsp->pv, wcsp->npvmax*sizeof(struct pvcard)); + if (wcsp->pv == 0x0) { + return WCSHDRERR_MEMORY; + } + + wcsp->m_pv = wcsp->pv; + } + + /* Copy the values. */ + wp = wat[i]; + for (ipv = wcsp->npv; ipv < wcsp->npvmax; ipv++) { + if ((wp = strstr(wp, "projp")) == 0x0) break; + + sscanf(wp, "projp%d=%lf", &m, &wval); + wcsp->pv[ipv].i = 2; + wcsp->pv[ipv].m = m; + wcsp->pv[ipv].value = wval; + + wp += 5; + } + + wcsp->npv += npv; + } + + /* Read the control parameters. */ + if ((wp = strchr(wat[i], '"')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + + for (m = 0; m < 4; m++) { + sscanf(wp, "%d", wctrl+m); + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* How many coefficients are we expecting? */ + omin = (wctrl[1] < wctrl[2]) ? wctrl[1] : wctrl[2]; + omax = (wctrl[1] < wctrl[2]) ? wctrl[2] : wctrl[1]; + if (wctrl[3] == 0) { + /* No cross terms. */ + nterms += omin + omax; + + } else if (wctrl[3] == 1) { + /* Full cross terms. */ + nterms += omin*omax; + + } else if (wctrl[3] == 2) { + /* Half cross terms. */ + nterms += omin*omax - omin*(omin-1)/2; + } + } + + /* Allocate memory for dpkeys. */ + ndq[0] += 2*(1 + 1 + 4) + nterms; + + disp->ndpmax += ndq[0]; + disp->dp = realloc(disp->dp, disp->ndpmax*sizeof(struct dpkey)); + if (disp->dp == 0x0) { + return WCSHDRERR_MEMORY; + } + + disp->m_dp = disp->dp; + + + /* Populate dpkeys. */ + idp = disp->ndp; + for (i = 0; i < 2; i++) { + dpfill(disp->dp+(idp++), "DQ", "NAXES", i+1, 0, 2, 0.0); + + /* Read the control parameters. */ + if ((wp = strchr(wat[i], '"')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + + for (m = 0; m < 4; m++) { + sscanf(wp, "%d", wctrl+m); + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* Polynomial type. */ + dpfill(disp->dp+(idp++), "DQ", "WAT.POLY", i+1, 0, wctrl[0], 0.0); + if (wctrl[0] == 1) { + /* Chebyshev polynomial. */ + strcpy(wpoly, "CHBY"); + } else if (wctrl[0] == 2) { + /* Legendre polynomial. */ + strcpy(wpoly, "LEGR"); + } else if (wctrl[0] == 3) { + /* Polynomial is the sum of monomials. */ + strcpy(wpoly, "MONO"); + } else { + /* Unknown code. */ + strcpy(wpoly, "UNKN"); + } + + /* Read the scaling parameters. */ + for (m = 0; m < 4; m++) { + sscanf(wp, "%lf", &wval); + sprintf(field, "WAT.%c%s", (m<2)?'X':'Y', (m%2)?"MAX":"MIN"); + dpfill(disp->dp+(idp++), "DQ", field, i+1, 1, 0, wval); + + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* Read the coefficients. */ + for (n = 0; n < wctrl[2]; n++) { + for (m = 0; m < wctrl[1]; m++) { + if (wctrl[3] == 0) { + if (m && n) continue; + } else if (wctrl[3] == 2) { + if (m+n > omax-1) continue; + } + + sscanf(wp, "%lf", &wval); + if (wval == 0.0) continue; + + sprintf(field, "WAT.%s.%d_%d", wpoly, m, n); + dpfill(disp->dp+(idp++), "DQ", field, i+1, 1, 0, wval); + + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + } + } + + disp->ndp = idp; + } + + return 0; +} + diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsulex.c b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsulex.c new file mode 100644 index 0000000000000000000000000000000000000000..b4f618f35caf690c94d00b86d403d01040491e00 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsulex.c @@ -0,0 +1,9992 @@ +#line 2 "wcsulex.c" + +#line 4 "wcsulex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define wcsulex_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer wcsulex_create_buffer +#endif + +#ifdef yy_delete_buffer +#define wcsulex_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer wcsulex_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define wcsulex_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer wcsulex_scan_buffer +#endif + +#ifdef yy_scan_string +#define wcsulex_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string wcsulex_scan_string +#endif + +#ifdef yy_scan_bytes +#define wcsulex_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes wcsulex_scan_bytes +#endif + +#ifdef yy_init_buffer +#define wcsulex_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer wcsulex_init_buffer +#endif + +#ifdef yy_flush_buffer +#define wcsulex_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer wcsulex_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define wcsulex_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state wcsulex_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define wcsulex_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer wcsulex_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define wcsulexpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state wcsulexpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define wcsulexpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state wcsulexpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define wcsulexensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack wcsulexensure_buffer_stack +#endif + +#ifdef yylex +#define wcsulexlex_ALREADY_DEFINED +#else +#define yylex wcsulexlex +#endif + +#ifdef yyrestart +#define wcsulexrestart_ALREADY_DEFINED +#else +#define yyrestart wcsulexrestart +#endif + +#ifdef yylex_init +#define wcsulexlex_init_ALREADY_DEFINED +#else +#define yylex_init wcsulexlex_init +#endif + +#ifdef yylex_init_extra +#define wcsulexlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra wcsulexlex_init_extra +#endif + +#ifdef yylex_destroy +#define wcsulexlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy wcsulexlex_destroy +#endif + +#ifdef yyget_debug +#define wcsulexget_debug_ALREADY_DEFINED +#else +#define yyget_debug wcsulexget_debug +#endif + +#ifdef yyset_debug +#define wcsulexset_debug_ALREADY_DEFINED +#else +#define yyset_debug wcsulexset_debug +#endif + +#ifdef yyget_extra +#define wcsulexget_extra_ALREADY_DEFINED +#else +#define yyget_extra wcsulexget_extra +#endif + +#ifdef yyset_extra +#define wcsulexset_extra_ALREADY_DEFINED +#else +#define yyset_extra wcsulexset_extra +#endif + +#ifdef yyget_in +#define wcsulexget_in_ALREADY_DEFINED +#else +#define yyget_in wcsulexget_in +#endif + +#ifdef yyset_in +#define wcsulexset_in_ALREADY_DEFINED +#else +#define yyset_in wcsulexset_in +#endif + +#ifdef yyget_out +#define wcsulexget_out_ALREADY_DEFINED +#else +#define yyget_out wcsulexget_out +#endif + +#ifdef yyset_out +#define wcsulexset_out_ALREADY_DEFINED +#else +#define yyset_out wcsulexset_out +#endif + +#ifdef yyget_leng +#define wcsulexget_leng_ALREADY_DEFINED +#else +#define yyget_leng wcsulexget_leng +#endif + +#ifdef yyget_text +#define wcsulexget_text_ALREADY_DEFINED +#else +#define yyget_text wcsulexget_text +#endif + +#ifdef yyget_lineno +#define wcsulexget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno wcsulexget_lineno +#endif + +#ifdef yyset_lineno +#define wcsulexset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno wcsulexset_lineno +#endif + +#ifdef yyget_column +#define wcsulexget_column_ALREADY_DEFINED +#else +#define yyget_column wcsulexget_column +#endif + +#ifdef yyset_column +#define wcsulexset_column_ALREADY_DEFINED +#else +#define yyset_column wcsulexset_column +#endif + +#ifdef yywrap +#define wcsulexwrap_ALREADY_DEFINED +#else +#define yywrap wcsulexwrap +#endif + +#ifdef yyalloc +#define wcsulexalloc_ALREADY_DEFINED +#else +#define yyalloc wcsulexalloc +#endif + +#ifdef yyrealloc +#define wcsulexrealloc_ALREADY_DEFINED +#else +#define yyrealloc wcsulexrealloc +#endif + +#ifdef yyfree +#define wcsulexfree_ALREADY_DEFINED +#else +#define yyfree wcsulexfree +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define wcsulexwrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static const flex_int16_t yy_nxt[][128] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 16, 14, 14, 14, 14, 14, 14, 14, + 17, 14, 18, 14, 14, 14, 18, 19, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 20, 21, 22, 23, 24, + + 22, 25, 26, 14, 27, 28, 14, 24, 22, 29, + 30, 14, 31, 32, 33, 14, 22, 34, 14, 24, + 24, 14, 14, 35, 14, 14, 14, 36, 37, 38, + 39, 40, 41, 28, 42, 14, 14, 24, 43, 44, + 41, 29, 45, 14, 46, 47, 48, 49, 50, 14, + 14, 51, 41, 14, 14, 14, 14, 14 + }, + + { + 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 52, 14, 14, 14, 14, 14, 14, 14, + + 17, 14, 53, 14, 14, 14, 53, 19, 14, 54, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 20, 21, 22, 23, 24, + 22, 25, 26, 14, 27, 28, 14, 24, 22, 29, + 30, 14, 31, 32, 33, 14, 22, 34, 14, 24, + 24, 55, 14, 35, 14, 14, 14, 36, 37, 38, + 39, 56, 41, 28, 42, 14, 14, 24, 57, 44, + 41, 29, 45, 14, 46, 47, 48, 49, 50, 14, + 14, 51, 41, 14, 14, 14, 14, 14 + }, + + { + 13, 58, 58, 58, 58, 58, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 59, 60, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58 + }, + + { + 13, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 59, 60, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58 + }, + + { + 13, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 15, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, + 61, 63, 61, 61, 61, 61, 61, 64, 61, 61, + 65, 61, 61, 61, 66, 61, 61, 61, 61, 67, + 68, 61, 61, 61, 61, 61, 61, 69, 61, 70, + 71, 61, 72, 61, 73, 61, 61, 74, 61, 75, + 76, 61, 77, 61, 61, 61, 61, 78, 61, 61, + 61, 79, 80, 61, 61, 61, 61, 61 + }, + + { + 13, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 15, 61, 61, 61, 61, 61, 61, 61, 61, 61, + + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, + 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, + 61, 63, 61, 61, 61, 61, 61, 64, 61, 61, + 65, 61, 61, 61, 66, 61, 61, 61, 61, 67, + 68, 61, 61, 61, 61, 61, 61, 69, 61, 70, + 71, 61, 72, 61, 73, 61, 61, 74, 61, 75, + 76, 61, 77, 61, 61, 61, 61, 78, 61, 61, + + 61, 79, 80, 61, 61, 61, 61, 61 + }, + + { + 13, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 15, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 82, 83, 84, 85, 81, + 86, 87, 88, 81, 89, 90, 81, 81, 91, 92, + 93, 81, 94, 95, 96, 81, 97, 98, 81, 81, + + 81, 81, 81, 81, 81, 81, 81, 99, 100, 101, + 102, 103, 81, 104, 105, 81, 81, 81, 106, 107, + 81, 92, 108, 81, 109, 110, 111, 112, 113, 81, + 81, 114, 81, 81, 81, 81, 81, 81 + }, + + { + 13, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 15, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + + 81, 81, 81, 81, 81, 82, 83, 84, 85, 81, + 86, 87, 88, 81, 89, 90, 81, 81, 91, 92, + 93, 81, 94, 95, 96, 81, 97, 98, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 99, 100, 101, + 102, 103, 81, 104, 105, 81, 81, 81, 106, 107, + 81, 92, 108, 81, 109, 110, 111, 112, 113, 81, + 81, 114, 81, 81, 81, 81, 81, 81 + }, + + { + 13, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 15, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + + 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, + 117, 115, 118, 119, 115, 119, 120, 121, 115, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 123, 124, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115 + + }, + + { + 13, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 15, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, + 117, 115, 118, 119, 115, 119, 120, 121, 115, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 123, 124, 115, 115, 115, 115, 115, + + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115 + }, + + { + 13, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 15, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + 13, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 15, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125 + }, + + { + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13 + }, + + { + 13, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14 + }, + + { + 13, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15 + }, + + { + 13, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, 126, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + + -16, -16, -16, -16, -16, -16, -16, -16 + }, + + { + 13, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17 + }, + + { + 13, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18 + }, + + { + 13, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19 + + }, + + { + 13, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, 127, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + 128, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20 + }, + + { + 13, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, 129, -21, -21, -21, -21, -21, -21 + }, + + { + 13, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22 + }, + + { + 13, -23, -23, -23, -23, -23, -23, -23, -23, -23, + + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23 + }, + + { + 13, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, 130, 131, 132, -24, -24, + 132, 133, 134, -24, 135, 130, -24, -24, 132, 136, + + 137, -24, 133, 132, 132, -24, 132, 138, -24, -24, + -24, -24, -24, -24, -24, -24, -24, 139, 140, 141, + -24, 142, -24, 130, -24, -24, -24, -24, 143, 144, + -24, 136, 145, -24, 146, 147, -24, -24, -24, -24, + -24, 148, -24, -24, -24, -24, -24, -24 + }, + + { + 13, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, 130, 131, 132, -25, -25, + 132, 133, 134, -25, 135, 130, -25, -25, 132, 136, + 137, -25, 133, 132, 132, -25, 132, 138, -25, -25, + -25, -25, -25, -25, -25, -25, -25, 139, 140, 141, + -25, 142, -25, 130, -25, -25, -25, -25, 143, 144, + -25, 136, 145, -25, 146, 147, -25, -25, -25, -25, + -25, 148, -25, -25, -25, -25, -25, -25 + }, + + { + 13, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + + -26, -26, 149, -26, -26, -26, -26, -26 + }, + + { + 13, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, 150, -27, -27, -27, -27, -27, -27 + }, + + { + 13, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28 + }, + + { + 13, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, 151, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29 + + }, + + { + 13, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, 130, 131, 132, -30, -30, + 132, 133, 134, -30, 135, 130, -30, -30, 132, 136, + 137, -30, 133, 132, 132, -30, 132, 138, -30, -30, + -30, -30, -30, -30, -30, -30, -30, 152, 140, 141, + + -30, 142, -30, 130, -30, -30, -30, -30, 143, 144, + -30, 136, 145, -30, 146, 147, -30, -30, -30, -30, + -30, 148, -30, -30, -30, -30, -30, -30 + }, + + { + 13, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, 153, -31, -31, -31, -31, -31, -31 + }, + + { + 13, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, 154, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32 + }, + + { + 13, -33, -33, -33, -33, -33, -33, -33, -33, -33, + + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, 130, 131, 132, -33, -33, + 132, 133, 134, -33, 135, 130, -33, -33, 132, 136, + 137, -33, 133, 132, 132, -33, 132, 138, -33, -33, + -33, -33, -33, -33, -33, -33, -33, 139, 140, 141, + -33, 142, -33, 130, -33, -33, -33, -33, 143, 144, + + -33, 136, 145, -33, 146, 147, -33, -33, -33, -33, + -33, 148, -33, -33, -33, -33, -33, -33 + }, + + { + 13, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, 149, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34 + }, + + { + 13, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35 + }, + + { + 13, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, 130, -36, 132, -36, -36, + 132, 133, 134, -36, 135, 130, -36, -36, 132, 136, + 137, -36, 133, 132, 132, -36, 132, 138, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, 155, 141, + 156, 142, -36, 130, -36, -36, -36, -36, 143, 157, + 128, 136, -36, -36, 158, 147, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36 + }, + + { + 13, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + + -37, -37, -37, -37, -37, -37, -37, 159, -37, -37, + -37, 160, -37, -37, -37, 161, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, 129, -37, -37, -37, -37, -37, -37 + }, + + { + 13, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + + -38, -38, -38, -38, -38, 130, -38, 132, -38, -38, + 132, 133, 134, -38, 135, 130, -38, -38, 132, 136, + 137, -38, 133, 132, 132, -38, 132, 138, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, 155, 141, + 162, 142, -38, 130, 163, -38, -38, -38, 143, 157, + -38, 164, -38, -38, 146, 147, 165, -38, -38, -38, + -38, 153, -38, -38, -38, -38, -38, -38 + }, + + { + 13, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, -39, 130, -39, 132, -39, -39, + 132, 133, 134, -39, 135, 130, -39, -39, 132, 136, + 137, -39, 133, 132, 132, -39, 132, 138, -39, -39, + -39, -39, -39, -39, -39, -39, -39, 166, 155, 141, + -39, 167, -39, 130, -39, -39, -39, -39, 143, 157, + -39, 136, -39, -39, 146, 147, -39, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39, -39 + + }, + + { + 13, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, 150, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, 168, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40 + }, + + { + 13, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, + -41, -41, -41, -41, -41, 130, -41, 132, -41, -41, + + 132, 133, 134, -41, 135, 130, -41, -41, 132, 136, + 137, -41, 133, 132, 132, -41, 132, 138, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41, 155, 141, + -41, 142, -41, 130, -41, -41, -41, -41, 143, 157, + -41, 136, -41, -41, 146, 147, -41, -41, -41, -41, + -41, -41, -41, -41, -41, -41, -41, -41 + }, + + { + 13, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, 130, 131, 132, -42, -42, + 132, 133, 134, -42, 135, 130, -42, -42, 132, 136, + 137, -42, 133, 132, 132, -42, 132, 138, -42, -42, + -42, -42, -42, -42, -42, -42, -42, 139, 140, 141, + -42, 142, -42, 130, -42, -42, -42, -42, 143, 144, + -42, 136, 145, -42, 146, 147, -42, -42, -42, -42, + -42, 148, -42, -42, -42, -42, -42, -42 + }, + + { + 13, -43, -43, -43, -43, -43, -43, -43, -43, -43, + + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, 149, + + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + 149, 169, -43, -43, -43, -43, -43, -43 + }, + + { + 13, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, 130, -44, 132, -44, -44, + 132, 133, 134, -44, 135, 130, -44, -44, 132, 136, + + 137, -44, 133, 132, 132, -44, 132, 138, -44, -44, + -44, -44, -44, -44, -44, -44, -44, 170, 155, 141, + -44, 142, -44, 130, -44, 171, -44, -44, 143, 157, + -44, 172, -44, -44, 146, 147, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44 + }, + + { + 13, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, 130, -45, 132, -45, -45, + 132, 133, 134, -45, 135, 130, -45, -45, 132, 136, + 137, -45, 133, 132, 132, -45, 132, 138, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, 155, 173, + -45, 142, -45, 130, 174, 175, -45, -45, 143, 157, + -45, 136, -45, -45, 146, 147, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45 + }, + + { + 13, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, 176, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + + -46, -46, -46, -46, -46, -46, -46, -46 + }, + + { + 13, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, 177, -47, 178, 162, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47 + }, + + { + 13, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, 179, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48 + }, + + { + 13, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, 130, -49, 132, -49, -49, + 132, 133, 134, -49, 135, 130, -49, -49, 132, 136, + 137, -49, 133, 132, 132, -49, 132, 138, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, 155, 141, + -49, 142, -49, 130, -49, -49, -49, -49, 143, 157, + -49, 136, -49, -49, 146, 147, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49 + + }, + + { + 13, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, 180, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50 + }, + + { + 13, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, 130, -51, 132, -51, -51, + + 132, 133, 134, -51, 135, 130, -51, -51, 132, 136, + 137, -51, 133, 132, 132, -51, 132, 138, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, 155, 141, + -51, 142, -51, 130, -51, -51, -51, -51, 143, 157, + -51, 136, -51, -51, 181, 147, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51 + }, + + { + 13, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, 182, -52, -52, -52, -52, -52, -52, -52, + + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52 + }, + + { + 13, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53 + }, + + { + 13, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, 183, 184, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54 + }, + + { + 13, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55 + }, + + { + 13, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, 150, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, 168, -56, -56, -56, -56, -56, + + 185, -56, -56, -56, -56, -56, -56, -56 + }, + + { + 13, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, 149, + 186, 187, -57, -57, -57, -57, -57, -57, -57, -57, + 149, 169, -57, -57, -57, -57, -57, -57 + }, + + { + 13, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + -58, -58, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188 + }, + + { + 13, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59 + + }, + + { + 13, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60 + }, + + { + 13, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61 + }, + + { + 13, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62 + }, + + { + 13, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63 + }, + + { + 13, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64 + }, + + { + 13, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65 + }, + + { + 13, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66 + }, + + { + 13, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67 + }, + + { + 13, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68 + }, + + { + 13, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69 + + }, + + { + 13, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70 + }, + + { + 13, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, 189, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71 + }, + + { + 13, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72 + }, + + { + 13, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73 + }, + + { + 13, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74 + }, + + { + 13, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75 + }, + + { + 13, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76 + }, + + { + 13, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77 + }, + + { + 13, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78 + }, + + { + 13, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79 + + }, + + { + 13, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80 + }, + + { + 13, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81 + }, + + { + 13, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, 190, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + 191, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82 + }, + + { + 13, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, 192, -83, -83, -83, -83, -83, -83 + }, + + { + 13, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84 + }, + + { + 13, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85 + }, + + { + 13, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, + + -86, -86, -86, -86, -86, -86, -86, -86 + }, + + { + 13, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87 + }, + + { + 13, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, 193, -88, -88, -88, -88, -88 + }, + + { + 13, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, 194, -89, -89, -89, -89, -89, -89 + + }, + + { + 13, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90 + }, + + { + 13, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91 + }, + + { + 13, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, 195, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92 + }, + + { + 13, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, 196, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93 + }, + + { + 13, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, 197, -94, -94, -94, -94, -94, -94 + }, + + { + 13, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, 198, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95 + }, + + { + 13, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96 + }, + + { + 13, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97 + }, + + { + 13, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, 199, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98 + }, + + { + 13, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + 200, -99, -99, -99, -99, -99, -99, -99, -99, -99, + 191, -99, -99, -99, 201, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99 + + }, + + { + 13, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, 202, -100, -100, + + -100, 203, -100, -100, -100, 204, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, 192, -100, -100, -100, -100, -100, -100 + }, + + { + 13, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + 205, -101, -101, -101, 206, -101, -101, -101, -101, -101, + -101, 207, -101, -101, -101, -101, 208, -101, -101, -101, + -101, 209, -101, -101, -101, -101, -101, -101 + }, + + { + 13, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, 210, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102 + }, + + { + 13, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, 211, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, 212, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103 + }, + + { + 13, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104 + }, + + { + 13, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105 + }, + + { + 13, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, 213, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + 214, 215, -106, -106, -106, -106, -106, -106 + }, + + { + 13, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + + -107, -107, -107, -107, -107, -107, -107, 216, -107, -107, + -107, -107, -107, -107, -107, 217, -107, -107, -107, -107, + -107, 218, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107 + }, + + { + 13, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, 219, + -108, -108, -108, -108, 220, 221, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108 + }, + + { + 13, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, 222, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109 + + }, + + { + 13, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, 223, -110, -110, 224, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110 + }, + + { + 13, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, 225, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111 + }, + + { + 13, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112 + }, + + { + 13, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, 226, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113 + }, + + { + 13, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, 227, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114 + }, + + { + 13, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115 + }, + + { + 13, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, 228, -116, -116, -116, -116, -116, -116, -116, + 229, -116, 230, 231, -116, 231, 232, 233, -116, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, 235, 236, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116 + }, + + { + 13, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, 237, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, 238, -117, 238, 239, -117, 240, 241, + 241, 241, 241, 241, 241, 241, 241, 241, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117 + }, + + { + 13, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, 242, -118, -118, -118, -118, -118, -118, -118, + -118, -118, 236, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118 + }, + + { + 13, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119 + + }, + + { + 13, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, 242, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120 + }, + + { + 13, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, 243, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121 + }, + + { + 13, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + + -122, -122, -122, -122, -122, -122, -122, -122, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122 + }, + + { + 13, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123 + }, + + { + 13, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124 + }, + + { + 13, 245, 245, 245, 245, 245, 245, 245, 245, 245, + -125, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245 + }, + + { + 13, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, 126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126 + }, + + { + 13, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127 + }, + + { + 13, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, 246, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128 + }, + + { + 13, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, 247, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129 + + }, + + { + 13, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130 + }, + + { + 13, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, 248, -131, -131, -131, -131, -131, -131 + }, + + { + 13, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132 + }, + + { + 13, -133, -133, -133, -133, -133, -133, -133, -133, -133, + + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133 + }, + + { + 13, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, 132, -134, -134, -134, -134, -134 + }, + + { + 13, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, 133, -135, -135, -135, -135, -135, -135 + }, + + { + 13, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, 249, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136 + }, + + { + 13, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + + -137, -137, -137, -137, -137, -137, -137, 132, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137 + }, + + { + 13, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, 132, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138 + }, + + { + 13, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139 + + }, + + { + 13, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, 250, -140, -140, + + -140, -140, -140, -140, -140, 251, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, 248, -140, -140, -140, -140, -140, -140 + }, + + { + 13, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + 130, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141 + }, + + { + 13, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, 133, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142 + }, + + { + 13, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, 132, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + 132, -143, -143, -143, -143, -143, -143, -143 + }, + + { + 13, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, 252, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144 + }, + + { + 13, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, 139, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145 + }, + + { + 13, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, 253, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146 + }, + + { + 13, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, 130, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147 + }, + + { + 13, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, 139, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148 + }, + + { + 13, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149 + + }, + + { + 13, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150 + }, + + { + 13, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, 149, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151 + }, + + { + 13, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152 + }, + + { + 13, -153, -153, -153, -153, -153, -153, -153, -153, -153, + + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153 + }, + + { + 13, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + 127, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154 + }, + + { + 13, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, 250, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155 + }, + + { + 13, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, 165, -156, -156, + + -156, -156, -156, -156, -156, -156, -156, -156 + }, + + { + 13, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + + -157, -157, -157, -157, -157, -157, -157, 254, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, 252, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157 + }, + + { + 13, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, 253, -158, 255, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158 + }, + + { + 13, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, 256, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159 + + }, + + { + 13, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, 257, -160, -160, + + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160 + }, + + { + 13, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + 165, -161, -161, -161, -161, -161, 258, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161 + }, + + { + 13, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162 + }, + + { + 13, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, 259, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163 + }, + + { + 13, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, 249, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, 260, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164 + }, + + { + 13, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165 + }, + + { + 13, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, 130, 131, 132, -166, -166, + 132, 133, 134, -166, 135, 130, -166, -166, 132, 136, + 137, -166, 133, 132, 132, -166, 132, 138, -166, -166, + -166, -166, -166, -166, -166, -166, -166, 139, 140, 141, + -166, 142, -166, 130, -166, -166, -166, -166, 143, 144, + -166, 136, 145, -166, 146, 147, -166, -166, -166, -166, + + -166, 148, -166, -166, -166, -166, -166, -166 + }, + + { + 13, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, 133, -167, -167, -167, + + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, 153, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167 + }, + + { + 13, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, 153, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168 + }, + + { + 13, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, 127, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169 + + }, + + { + 13, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + + -170, -170, -170, 150, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, 153, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170 + }, + + { + 13, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + 153, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171 + }, + + { + 13, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, 249, -172, -172, -172, 162, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172 + }, + + { + 13, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + 130, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173 + }, + + { + 13, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, 261, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174 + }, + + { + 13, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + 262, -175, -175, -175, -175, -175, -175, -175 + }, + + { + 13, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + 162, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176 + }, + + { + 13, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, 263, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177 + }, + + { + 13, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, 264, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178 + }, + + { + 13, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, 265, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179 + + }, + + { + 13, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + 266, -180, -180, -180, -180, -180, -180, -180 + }, + + { + 13, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, 253, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181 + }, + + { + 13, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, 182, -182, -182, -182, -182, -182, -182, -182, + + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182 + }, + + { + 13, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183 + }, + + { + 13, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, 267, 267, + 267, 267, 267, 267, 267, 267, 267, 267, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184 + }, + + { + 13, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, 268, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185 + }, + + { + 13, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, 269, -186, -186, -186, -186, -186, -186, -186, + 270, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186 + }, + + { + 13, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, 271, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187 + }, + + { + 13, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + -188, -188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188 + }, + + { + 13, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189 + + }, + + { + 13, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190 + }, + + { + 13, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, 272, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191 + }, + + { + 13, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, 273, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192 + }, + + { + 13, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193 + }, + + { + 13, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194 + }, + + { + 13, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, 274, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195 + }, + + { + 13, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196 + }, + + { + 13, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197 + }, + + { + 13, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + 275, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198 + }, + + { + 13, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199 + + }, + + { + 13, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, 276, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200 + }, + + { + 13, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, 277, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201 + }, + + { + 13, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, 278, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202 + }, + + { + 13, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, 279, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203 + }, + + { + 13, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + 280, -204, -204, -204, -204, -204, 281, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204 + }, + + { + 13, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205 + }, + + { + 13, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, 282, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206 + }, + + { + 13, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, 283, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207 + }, + + { + 13, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208 + }, + + { + 13, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, -209, -209, -209, -209, -209 + + }, + + { + 13, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + + -210, -210, -210, 284, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, -210, -210, -210, -210, -210 + }, + + { + 13, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211, -211, -211, + -211, -211, -211, -211, -211, -211, -211, -211 + }, + + { + 13, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, 285, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212, -212, -212, + -212, -212, -212, -212, -212, -212, -212, -212 + }, + + { + 13, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + + -213, -213, -213, -213, -213, -213, -213, -213, -213, -213, + -213, -213, -213, -213, -213, -213, -213, -213 + }, + + { + 13, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214, -214, -214, + -214, -214, -214, -214, -214, -214, -214, -214 + }, + + { + 13, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215, -215, -215, + -215, -215, -215, -215, 286, -215, -215, -215, -215, -215, + -215, -215, -215, -215, -215, -215, -215, -215 + }, + + { + 13, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, 287, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, 288, -216, -216, -216, -216, + + -216, -216, -216, -216, -216, -216, -216, -216 + }, + + { + 13, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217, -217, -217, + 289, -217, -217, -217, -217, -217, -217, -217, -217, -217, + -217, -217, -217, -217, -217, -217, -217, -217 + }, + + { + 13, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, 290, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218 + }, + + { + 13, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219 + + }, + + { + 13, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + + -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, + -220, 291, -220, -220, -220, -220, -220, -220, -220, -220, + -220, -220, -220, -220, -220, -220, -220, -220 + }, + + { + 13, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + 292, -221, -221, -221, -221, -221, -221, -221 + }, + + { + 13, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + 293, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222, -222, -222, + -222, -222, -222, -222, -222, -222, -222, -222 + }, + + { + 13, -223, -223, -223, -223, -223, -223, -223, -223, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223, 294, -223, + + -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, + -223, -223, -223, -223, -223, -223, -223, -223 + }, + + { + 13, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224 + }, + + { + 13, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, + -225, -225, -225, -225, 295, -225, -225, -225, -225, -225, + -225, -225, -225, -225, -225, -225, -225, -225 + }, + + { + 13, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + -226, -226, -226, -226, -226, -226, -226, -226, -226, -226, + + 296, -226, -226, -226, -226, -226, -226, -226 + }, + + { + 13, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, + -227, -227, -227, -227, -227, -227, -227, -227 + }, + + { + 13, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, 228, -228, -228, -228, -228, -228, -228, -228, + 229, -228, 230, 231, -228, 231, 232, 233, -228, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -228, -228, + + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, 235, 236, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228 + }, + + { + 13, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + + -229, -229, 237, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, 238, -229, 238, 239, -229, 240, 241, + 241, 241, 241, 241, 241, 241, 241, 241, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229, -229, -229, + -229, -229, -229, -229, -229, -229, -229, -229 + + }, + + { + 13, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 242, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 236, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230 + }, + + { + 13, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, 234, + 234, 234, 234, 234, 234, 234, 234, 234, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231, -231, -231, + -231, -231, -231, -231, -231, -231, -231, -231 + }, + + { + 13, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, 242, -232, -232, -232, -232, -232, -232, -232, + + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232 + }, + + { + 13, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, 243, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + + -233, -233, -233, -233, -233, -233, -233, -233, -233, -233, + -233, -233, -233, -233, -233, -233, -233, -233 + }, + + { + 13, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, + -234, -234, -234, -234, -234, -234, -234, -234 + }, + + { + 13, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235 + }, + + { + 13, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -236, + + -236, -236, -236, -236, -236, -236, -236, -236 + }, + + { + 13, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, 237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, 238, -237, 238, 239, -237, 240, 241, + 241, 241, 241, 241, 241, 241, 241, 241, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237, -237, -237, + -237, -237, -237, -237, -237, -237, -237, -237 + }, + + { + 13, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, 239, -238, 240, 241, + 241, 241, 241, 241, 241, 241, 241, 241, -238, -238, + + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238 + }, + + { + 13, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239, -239, -239, + -239, -239, -239, -239, -239, -239, -239, -239 + + }, + + { + 13, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, 298, -240, -240, -240, -240, -240, -240, -240, + -240, 299, -240, -240, -240, -240, 300, -240, 301, 301, + 301, 301, 301, 301, 301, 301, 301, 301, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240, -240, -240, + -240, -240, -240, -240, -240, -240, -240, -240 + }, + + { + 13, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, 302, -241, -241, -241, -241, -241, -241, -241, + -241, 303, -241, -241, -241, -241, 300, 304, 305, 305, + 305, 305, 305, 305, 305, 305, 305, 305, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241, -241, -241, + -241, -241, -241, -241, -241, -241, -241, -241 + }, + + { + 13, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, 242, -242, -242, -242, -242, -242, -242, -242, + + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242, -242, -242, + -242, -242, -242, -242, -242, -242, -242, -242 + }, + + { + 13, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, 243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + + -243, -243, -243, -243, -243, -243, -243, -243, -243, -243, + -243, -243, -243, -243, -243, -243, -243, -243 + }, + + { + 13, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244, -244, -244, + -244, -244, -244, -244, -244, -244, -244, -244 + }, + + { + 13, 245, 245, 245, 245, 245, 245, 245, 245, 245, + -245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245 + }, + + { + 13, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, -246, -246, -246, -246, -246, + -246, -246, -246, -246, -246, 306, -246, -246, -246, -246, + + -246, -246, -246, -246, -246, -246, -246, -246 + }, + + { + 13, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, 258, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247, -247, -247, + -247, -247, -247, -247, -247, -247, -247, -247 + }, + + { + 13, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248, -248, -248, + -248, -248, -248, -248, -248, -248, 307, -248, -248, -248, + -248, -248, -248, -248, -248, -248, -248, -248 + }, + + { + 13, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249, -249, 132, + -249, -249, -249, -249, -249, -249, -249, -249, -249, -249, + -249, -249, -249, -249, -249, -249, -249, -249 + + }, + + { + 13, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + + -250, -250, -250, -250, -250, -250, -250, -250, -250, -250, + -250, -250, -250, -250, 308, -250, -250, -250, -250, -250, + -250, -250, -250, -250, -250, -250, -250, -250 + }, + + { + 13, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251, -251, -251, + -251, -251, -251, -251, -251, -251, 139, -251, -251, -251, + -251, -251, -251, -251, -251, -251, -251, -251 + }, + + { + 13, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252, 130, -252, + -252, -252, -252, -252, -252, -252, -252, -252, -252, -252, + -252, -252, -252, -252, -252, -252, -252, -252 + }, + + { + 13, -253, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + 130, -253, -253, -253, -253, -253, -253, -253, -253, -253, + + -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, + -253, -253, -253, -253, -253, -253, -253, -253 + }, + + { + 13, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, 309, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254, -254, -254, + -254, -254, -254, -254, -254, -254, -254, -254 + }, + + { + 13, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255, -255, 310, + -255, -255, -255, -255, -255, 311, -255, -255, -255, -255, + -255, -255, -255, -255, -255, -255, -255, -255 + }, + + { + 13, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + 150, -256, -256, -256, -256, -256, -256, -256, -256, -256, + + -256, -256, -256, -256, -256, -256, -256, -256 + }, + + { + 13, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257, -257, 127, + -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, + -257, -257, -257, -257, -257, -257, -257, -257 + }, + + { + 13, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, + -258, -258, -258, -258, -258, -258, -258, -258 + }, + + { + 13, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259, -259, -259, + 165, -259, -259, -259, -259, -259, -259, -259, -259, -259, + -259, -259, -259, -259, -259, -259, -259, -259 + + }, + + { + 13, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + + -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, + 312, -260, -260, -260, -260, -260, -260, -260, -260, -260, + -260, -260, -260, -260, -260, -260, -260, -260 + }, + + { + 13, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261, -261, -261, + -261, -261, -261, -261, -261, -261, 313, -261, -261, -261, + -261, -261, -261, -261, -261, -261, -261, -261 + }, + + { + 13, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, 314, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262, -262, -262, + -262, -262, -262, -262, -262, -262, -262, -262 + }, + + { + 13, -263, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, 315, 316, -263, -263, + -263, -263, 317, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + + -263, -263, -263, -263, -263, -263, -263, -263, -263, -263, + -263, -263, -263, -263, -263, -263, -263, -263 + }, + + { + 13, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264, -264, -264, + -264, -264, -264, -264, -264, -264, 318, -264, -264, -264, + -264, -264, -264, -264, -264, -264, -264, -264 + }, + + { + 13, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265, -265, -265, + 153, -265, -265, -265, -265, -265, -265, -265, -265, -265, + -265, -265, -265, -265, -265, -265, -265, -265 + }, + + { + 13, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + -266, 319, -266, -266, -266, -266, -266, -266, -266, -266, + -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, + + -266, -266, -266, -266, -266, -266, -266, -266 + }, + + { + 13, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267, -267, -267, + -267, -267, -267, -267, -267, -267, -267, -267 + }, + + { + 13, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, 320, -268, -268, -268, -268, -268, -268, -268, + 321, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268, -268, -268, + -268, -268, -268, -268, -268, -268, -268, -268 + }, + + { + 13, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + + -269, -269, 269, -269, -269, -269, -269, -269, -269, -269, + 270, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269 + + }, + + { + 13, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270, -270, -270, + -270, -270, -270, -270, -270, -270, -270, -270 + }, + + { + 13, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, 322, -271, -271, -271, -271, -271, -271, -271, + 323, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271, -271, -271, + -271, -271, -271, -271, -271, -271, -271, -271 + }, + + { + 13, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272, -272, -272, + -272, -272, -272, -272, -272, 324, -272, -272, -272, -272, + -272, -272, -272, -272, -272, -272, -272, -272 + }, + + { + 13, -273, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, 325, -273, -273, -273, -273, -273, -273, -273, -273, + + -273, -273, -273, -273, -273, -273, -273, -273, -273, -273, + -273, -273, -273, -273, -273, -273, -273, -273 + }, + + { + 13, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, + -274, -274, -274, -274, -274, -274, -274, -274 + }, + + { + 13, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275, -275, -275, + -275, -275, -275, -275, -275, -275, -275, -275 + }, + + { + 13, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, -276, -276, -276, + + -276, -276, -276, -276, -276, -276, -276, -276 + }, + + { + 13, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + + -277, -277, -277, -277, -277, -277, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277, -277, 326, + -277, -277, -277, -277, -277, 327, -277, -277, -277, -277, + -277, -277, -277, -277, -277, -277, -277, -277 + }, + + { + 13, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + 328, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278 + }, + + { + 13, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279, -279, 329, + -279, -279, -279, -279, -279, -279, -279, -279, -279, -279, + -279, -279, -279, -279, -279, -279, -279, -279 + + }, + + { + 13, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, + -280, -280, -280, -280, -280, -280, -280, -280 + }, + + { + 13, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281, -281, -281, + -281, -281, -281, -281, -281, -281, -281, -281 + }, + + { + 13, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282, -282, -282, + 330, -282, -282, -282, -282, -282, -282, -282, -282, -282, + -282, -282, -282, -282, -282, -282, -282, -282 + }, + + { + 13, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283, -283, -283, + + 331, -283, -283, -283, -283, -283, -283, -283, -283, -283, + -283, -283, -283, -283, -283, -283, -283, -283 + }, + + { + 13, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284, -284, -284, + -284, -284, -284, -284, -284, -284, -284, -284 + }, + + { + 13, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285 + }, + + { + 13, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + -286, -286, -286, -286, -286, -286, -286, -286, -286, -286, + + -286, -286, -286, -286, -286, -286, -286, -286 + }, + + { + 13, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, + -287, -287, -287, -287, -287, -287, -287, -287 + }, + + { + 13, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288, -288, -288, + -288, -288, -288, -288, -288, -288, -288, -288 + }, + + { + 13, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, + -289, -289, -289, -289, -289, -289, -289, -289 + + }, + + { + 13, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, + -290, -290, -290, -290, -290, -290, -290, -290 + }, + + { + 13, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291, -291, -291, + -291, -291, -291, -291, -291, -291, 332, -291, -291, -291, + -291, -291, -291, -291, -291, -291, -291, -291 + }, + + { + 13, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, 333, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292, -292, -292, + -292, -292, -292, -292, -292, -292, -292, -292 + }, + + { + 13, -293, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + + -293, -293, -293, -293, -293, -293, -293, -293, -293, -293, + -293, -293, -293, -293, -293, -293, -293, -293 + }, + + { + 13, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, 334, 335, -294, -294, + + -294, -294, 336, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294 + }, + + { + 13, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, -295, + 337, -295, -295, -295, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295 + }, + + { + 13, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + -296, 338, -296, -296, -296, -296, -296, -296, -296, -296, + -296, -296, -296, -296, -296, -296, -296, -296, -296, -296, + + -296, -296, -296, -296, -296, -296, -296, -296 + }, + + { + 13, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, 298, -297, -297, -297, -297, -297, -297, -297, + -297, 299, -297, -297, -297, -297, -297, -297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297 + }, + + { + 13, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, 298, -298, -298, -298, -298, -298, -298, -298, + -298, 299, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298, -298, -298, + -298, -298, -298, -298, -298, -298, -298, -298 + }, + + { + 13, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299 + + }, + + { + 13, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, 298, -300, -300, -300, -300, -300, -300, -300, + -300, 299, -300, -300, -300, -300, -300, -300, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300, -300, -300, + -300, -300, -300, -300, -300, -300, -300, -300 + }, + + { + 13, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, 298, -301, -301, -301, -301, -301, -301, -301, + -301, 299, -301, -301, -301, -301, 300, -301, 301, 301, + 301, 301, 301, 301, 301, 301, 301, 301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301, -301, -301, + -301, -301, -301, -301, -301, -301, -301, -301 + }, + + { + 13, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, 302, -302, -302, -302, -302, -302, -302, -302, + + -302, 303, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302, -302, -302, + -302, -302, -302, -302, -302, -302, -302, -302 + }, + + { + 13, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, + -303, -303, -303, -303, -303, -303, -303, -303 + }, + + { + 13, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, 340, + 340, 340, 340, 340, 340, 340, 340, 340, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304, -304, -304, + -304, -304, -304, -304, -304, -304, -304, -304 + }, + + { + 13, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, 302, -305, -305, -305, -305, -305, -305, -305, + -305, 303, -305, -305, -305, -305, 300, 304, 305, 305, + + 305, 305, 305, 305, 305, 305, 305, 305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305, -305, -305, + -305, -305, -305, -305, -305, -305, -305, -305 + }, + + { + 13, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, -306, -306, -306, -306, + -306, -306, -306, -306, -306, -306, 341, -306, -306, -306, + + -306, -306, -306, -306, -306, -306, -306, -306 + }, + + { + 13, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, 139, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307, -307, -307, + -307, -307, -307, -307, -307, -307, -307, -307 + }, + + { + 13, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + 133, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308 + }, + + { + 13, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309, -309, -309, + -309, -309, -309, -309, -309, -309, -309, -309 + + }, + + { + 13, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + + -310, -310, -310, -310, -310, 342, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310, -310, -310, + -310, -310, -310, -310, -310, -310, -310, -310 + }, + + { + 13, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, 343, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311, -311, -311, + -311, -311, -311, -311, -311, -311, -311, -311 + }, + + { + 13, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312, -312, -312, + -312, -312, -312, -312, -312, -312, 165, -312, -312, -312, + -312, -312, -312, -312, -312, -312, -312, -312 + }, + + { + 13, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313, -313, -313, + + -313, 344, -313, -313, -313, -313, -313, -313, -313, -313, + -313, -313, -313, -313, -313, -313, -313, -313 + }, + + { + 13, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314, 165, -314, + -314, -314, -314, -314, -314, -314, -314, -314, -314, -314, + -314, -314, -314, -314, -314, -314, -314, -314 + }, + + { + 13, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, + -315, -315, -315, -315, -315, -315, -315, 345, -315, -315, + -315, -315, -315, -315, -315, -315, -315, -315 + }, + + { + 13, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, 346, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + -316, -316, -316, -316, -316, -316, -316, -316, -316, -316, + + -316, -316, -316, -316, -316, -316, -316, -316 + }, + + { + 13, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + + -317, -317, -317, -317, -317, -317, -317, 347, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317 + }, + + { + 13, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, 348, -318, -318, -318, -318, -318, -318, -318, + 349, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318, -318, -318, + -318, -318, -318, -318, -318, -318, -318, -318 + }, + + { + 13, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319, 165, -319, + -319, -319, -319, -319, -319, -319, -319, -319, -319, -319, + -319, -319, -319, -319, -319, -319, -319, -319 + + }, + + { + 13, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, 320, -320, -320, -320, -320, -320, -320, -320, + 321, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320, -320, -320, + -320, -320, -320, -320, -320, -320, -320, -320 + }, + + { + 13, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321, -321, -321, + -321, -321, -321, -321, -321, -321, -321, -321 + }, + + { + 13, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, 322, -322, -322, -322, -322, -322, -322, -322, + + 323, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322, -322, -322, + -322, -322, -322, -322, -322, -322, -322, -322 + }, + + { + 13, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + + -323, -323, -323, -323, -323, -323, -323, -323, -323, -323, + -323, -323, -323, -323, -323, -323, -323, -323 + }, + + { + 13, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324, -324, -324, + -324, -324, -324, -324, -324, -324, 350, -324, -324, -324, + -324, -324, -324, -324, -324, -324, -324, -324 + }, + + { + 13, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325, -325, -325, + -325, -325, -325, -325, -325, -325, -325, -325 + }, + + { + 13, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + -326, -326, -326, -326, -326, 351, -326, -326, -326, -326, + -326, -326, -326, -326, -326, -326, -326, -326, -326, -326, + + -326, -326, -326, -326, -326, -326, -326, -326 + }, + + { + 13, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, 352, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327, -327, -327, + -327, -327, -327, -327, -327, -327, -327, -327 + }, + + { + 13, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328, -328, -328, + -328, -328, -328, -328, -328, -328, -328, -328 + }, + + { + 13, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329, -329, -329, + -329, -329, -329, -329, -329, -329, -329, -329 + + }, + + { + 13, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330, -330, -330, + -330, -330, -330, -330, -330, -330, -330, -330 + }, + + { + 13, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331, -331, -331, + -331, -331, -331, -331, -331, -331, 208, -331, -331, -331, + -331, -331, -331, -331, -331, -331, -331, -331 + }, + + { + 13, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332, -332, -332, + -332, 353, -332, -332, -332, -332, -332, -332, -332, -332, + -332, -332, -332, -332, -332, -332, -332, -332 + }, + + { + 13, -333, -333, -333, -333, -333, -333, -333, -333, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333, 354, -333, + + -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, + -333, -333, -333, -333, -333, -333, -333, -333 + }, + + { + 13, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, 355, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334 + }, + + { + 13, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, 356, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335, -335, -335, + -335, -335, -335, -335, -335, -335, -335, -335 + }, + + { + 13, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, 357, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, + + -336, -336, -336, -336, -336, -336, -336, -336 + }, + + { + 13, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337, -337, -337, + -337, -337, -337, -337, -337, -337, -337, -337 + }, + + { + 13, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338, 358, -338, + -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, + -338, -338, -338, -338, -338, -338, -338, -338 + }, + + { + 13, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + + -339, -339, 298, -339, -339, -339, -339, -339, -339, -339, + -339, 299, -339, -339, -339, -339, -339, -339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339, -339, -339, + -339, -339, -339, -339, -339, -339, -339, -339 + + }, + + { + 13, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, 359, -340, -340, -340, -340, -340, -340, -340, + -340, 360, -340, -340, -340, -340, -340, -340, 361, 361, + 361, 361, 361, 361, 361, 361, 361, 361, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340, -340, -340, + -340, -340, -340, -340, -340, -340, -340, -340 + }, + + { + 13, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341, -341, -341, + -341, -341, -341, -341, 362, -341, -341, -341, -341, -341, + -341, -341, -341, -341, -341, -341, -341, -341 + }, + + { + 13, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342, -342, -342, + 153, -342, -342, -342, -342, -342, -342, -342, -342, -342, + -342, -342, -342, -342, -342, -342, -342, -342 + }, + + { + 13, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343, -343, 153, + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + + -343, -343, -343, -343, -343, -343, -343, -343, -343, -343, + -343, -343, -343, -343, -343, -343, -343, -343 + }, + + { + 13, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344, -344, -344, + 165, -344, -344, -344, -344, -344, -344, -344, -344, -344, + -344, -344, -344, -344, -344, -344, -344, -344 + }, + + { + 13, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345, -345, 127, + -345, -345, -345, -345, -345, -345, -345, -345, -345, -345, + -345, -345, -345, -345, -345, -345, -345, -345 + }, + + { + 13, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, -346, -346, -346, -346, -346, + -346, -346, -346, -346, -346, 363, -346, -346, -346, -346, + + -346, -346, -346, -346, -346, -346, -346, -346 + }, + + { + 13, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + 127, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347, -347, -347, + -347, -347, -347, -347, -347, -347, -347, -347 + }, + + { + 13, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, 348, -348, -348, -348, -348, -348, -348, -348, + 349, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348, -348, -348, + -348, -348, -348, -348, -348, -348, -348, -348 + }, + + { + 13, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349 + + }, + + { + 13, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + + -350, -350, -350, -350, -350, -350, -350, -350, -350, -350, + -350, -350, -350, -350, 364, -350, -350, -350, -350, -350, + -350, -350, -350, -350, -350, -350, -350, -350 + }, + + { + 13, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351, -351, -351, + 365, -351, -351, -351, -351, -351, -351, -351, -351, -351, + -351, -351, -351, -351, -351, -351, -351, -351 + }, + + { + 13, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, 366, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352, -352, -352, + -352, -352, -352, -352, -352, -352, -352, -352 + }, + + { + 13, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, + + 367, -353, -353, -353, -353, -353, -353, -353, -353, -353, + -353, -353, -353, -353, -353, -353, -353, -353 + }, + + { + 13, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354, -354, -354, + -354, -354, -354, -354, -354, -354, -354, -354 + }, + + { + 13, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355, -355, 368, + -355, -355, -355, -355, -355, -355, -355, -355, -355, -355, + -355, -355, -355, -355, -355, -355, -355, -355 + }, + + { + 13, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, -356, -356, -356, -356, -356, + -356, -356, -356, -356, -356, 369, -356, -356, -356, -356, + + -356, -356, -356, -356, -356, -356, -356, -356 + }, + + { + 13, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + 370, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, + -357, -357, -357, -357, -357, -357, -357, -357 + }, + + { + 13, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358, -358, -358, + -358, -358, -358, -358, -358, -358, -358, -358 + }, + + { + 13, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + + -359, -359, 359, -359, -359, -359, -359, -359, -359, -359, + -359, 360, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359, -359, -359, + -359, -359, -359, -359, -359, -359, -359, -359 + + }, + + { + 13, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360, -360, -360, + -360, -360, -360, -360, -360, -360, -360, -360 + }, + + { + 13, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, 359, -361, -361, -361, -361, -361, -361, -361, + -361, 360, -361, -361, -361, -361, -361, -361, 361, 361, + 361, 361, 361, 361, 361, 361, 361, 361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, + -361, -361, -361, -361, -361, -361, -361, -361 + }, + + { + 13, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362, -362, -362, + -362, 371, -362, -362, -362, -362, -362, -362, -362, -362, + -362, -362, -362, -362, -362, -362, -362, -362 + }, + + { + 13, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363, -363, -363, + + -363, -363, -363, -363, -363, 127, -363, -363, -363, -363, + -363, -363, -363, -363, -363, -363, -363, -363 + }, + + { + 13, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364, -364, -364, + -364, 372, -364, -364, -364, -364, -364, -364, -364, -364, + -364, -364, -364, -364, -364, -364, -364, -364 + }, + + { + 13, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365, -365, -365, + -365, -365, -365, -365, -365, -365, -365, -365 + }, + + { + 13, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + -366, -366, -366, -366, -366, -366, -366, -366, -366, -366, + + -366, -366, -366, -366, -366, -366, -366, -366 + }, + + { + 13, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367, -367, -367, + -367, -367, -367, -367, -367, -367, -367, -367 + }, + + { + 13, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368, -368, -368, + -368, -368, -368, -368, -368, -368, -368, -368 + }, + + { + 13, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, + -369, -369, -369, -369, -369, 373, -369, -369, -369, -369, + -369, -369, -369, -369, -369, -369, -369, -369 + + }, + + { + 13, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, + -370, -370, -370, -370, -370, -370, -370, -370 + }, + + { + 13, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, 127, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371 + }, + + { + 13, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372, -372, 374, + -372, -372, -372, -372, -372, -372, -372, -372, -372, -372, + -372, -372, -372, -372, -372, -372, -372, -372 + }, + + { + 13, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + + -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, + -373, -373, -373, -373, -373, -373, -373, -373 + }, + + { + 13, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374 + }, + + } ; + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyg->yytext_ptr -= yyg->yy_more_len; \ + yyleng = (int) (yy_cp - yyg->yytext_ptr); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 120 +#define YY_END_OF_BUFFER 121 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[375] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 119, 119, 121, 20, 120, 9, 11, 12, 14, 15, + 20, 15, 15, 20, 15, 15, 15, 15, 20, 20, + 15, 15, 15, 15, 19, 15, 20, 20, 15, 20, + 20, 15, 20, 15, 20, 20, 15, 20, 15, 20, + 20, 1, 8, 20, 2, 20, 20, 23, 21, 22, + 44, 41, 38, 37, 40, 39, 43, 42, 31, 25, + 24, 30, 35, 36, 26, 28, 29, 27, 33, 32, + 107, 45, 107, 57, 62, 67, 68, 70, 73, 75, + 84, 107, 107, 90, 93, 100, 103, 105, 46, 107, + + 107, 63, 107, 69, 71, 107, 79, 107, 107, 94, + 107, 102, 107, 107, 118, 115, 114, 113, 118, 113, + 116, 109, 117, 108, 119, 9, 15, 0, 0, 16, + 0, 16, 16, 16, 16, 0, 0, 16, 17, 0, + 0, 0, 0, 16, 0, 0, 16, 0, 15, 15, + 0, 15, 15, 0, 0, 0, 16, 0, 0, 0, + 0, 15, 0, 0, 15, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 0, 0, 0, 0, 0, 0, + 15, 1, 13, 4, 0, 0, 0, 23, 34, 51, + 0, 0, 72, 74, 0, 86, 92, 0, 106, 0, + + 0, 0, 0, 0, 58, 0, 0, 60, 61, 0, + 66, 0, 76, 77, 0, 0, 0, 0, 87, 88, + 0, 0, 0, 98, 0, 0, 46, 115, 114, 113, + 0, 113, 116, 109, 117, 108, 0, 0, 0, 0, + 0, 113, 116, 109, 119, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 15, 0, 0, 0, 0, 3, 0, 0, 6, + 0, 0, 0, 85, 99, 47, 0, 0, 0, 54, + 55, 0, 0, 64, 65, 78, 80, 81, 82, 83, + 0, 89, 91, 0, 0, 0, 0, 0, 112, 0, + + 0, 0, 110, 0, 0, 0, 0, 0, 18, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 5, 0, 56, 0, 0, 52, 53, 59, + 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, + 0, 0, 0, 89, 0, 0, 0, 104, 0, 111, + 0, 0, 0, 0, 49, 50, 88, 95, 0, 97, + 0, 0, 96, 48 + } ; + +static const yy_state_type yy_NUL_trans[375] = + { 0, + 14, 14, 58, 58, 61, 61, 81, 81, 115, 115, + 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() (yyg->yy_more_flag = 1) +#define YY_MORE_ADJ yyg->yy_more_len +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "wcsulex.l" +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsulex.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*============================================================================= +* +* wcsulex.l is a Flex description file containing the definition of a +* recursive, multi-buffered lexical scanner and parser for FITS units +* specifications. +* +* It requires Flex v2.5.4 or later. +* +* Refer to wcsunits.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ +/* Options. */ +/* Exponents. */ +/* Metric prefixes. */ +/* Basic and derived SI units. */ +/* Additional recognized units: all metric prefixes allowed. */ +/* Additional recognized units: only super-metric prefixes allowed. */ +/* Additional recognized units: only sub-metric prefixes allowed. */ +/* Additional recognized units for which NO metric prefixes are allowed. */ +/* All additional recognized units. */ +/* Exclusive start states. */ + +#line 86 "wcsulex.l" +/* To get the prototype for fileno() from stdio.h when gcc is invoked with + * -std=c89 (same as -ansi) or -std=c99 since we do not define YY_INPUT. */ +#define _POSIX_SOURCE 1 + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsunits.h" +#include "wcsutil.h" + +static int wcsulex_scanner(const char unitstr[], int *func, double *scale, + double units[WCSUNITS_NTYPE], struct wcserr **err, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsulexe( + const char unitstr[], + int *func, + double *scale, + double units[WCSUNITS_NTYPE], + struct wcserr **err) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsulex_scanner(unitstr, func, scale, units, err, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsulex_scanner(const char unitstr[], int *func, \ + double *scale, double units[WCSUNITS_NTYPE], struct wcserr **err, \ + yyscan_t yyscanner) + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsulex_abort_jmp_env; +#define exit(status) longjmp(wcsulex_abort_jmp_env, status) + +#line 7251 "wcsulex.c" +#line 7252 "wcsulex.c" + +#define INITIAL 0 +#define PAREN 1 +#define PREFIX 2 +#define UNITS 3 +#define EXPON 4 +#define FLUSH 5 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 138 "wcsulex.l" + +#line 140 "wcsulex.l" + static const char *function = "wcsulexe"; + + char ctmp[72]; + int bracket = 0; + int operator = 0; + int paren = 0; + int status = 0; + int func_r, i, j; + double dexp, expon, factor, factor_r, types[WCSUNITS_NTYPE]; + YY_BUFFER_STATE buf; + void add(double *factor, double types[], double *expon, double *scale, + double units[]); + + if (err) *err = 0x0; + + *func = 0; + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] = 0.0; + types[i] = 0.0; + } + expon = 1.0; + factor = 1.0; + *scale = 1.0; + + /* Avert a flex-induced memory leak. */ + if (YY_CURRENT_BUFFER && YY_CURRENT_BUFFER->yy_input_file == stdin) { + yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); + } + + yy_scan_string(unitstr, yyscanner); + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsulex_abort_jmp_env)) { + return wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + } + + BEGIN(INITIAL); + +#ifdef DEBUG + fprintf(stderr, "\n%s ->\n", unitstr); +#endif + +#line 7550 "wcsulex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yyg->yy_more_len = 0; + if ( yyg->yy_more_flag ) + { + yyg->yy_more_len = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + yyg->yy_more_flag = 0; + } + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + + ++yy_cp; + } + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos + 1; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 183 "wcsulex.l" +{ + /* Pretend initial whitespace doesn't exist. */ + yy_set_bol(1); + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 188 "wcsulex.l" +{ + if (bracket++) { + BEGIN(FLUSH); + } else { + yy_set_bol(1); + } + } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 196 "wcsulex.l" +{ + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_NUM_MULTIPLIER), + "Invalid exponent in '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 202 "wcsulex.l" +{ + factor = 10.0; + BEGIN(EXPON); + } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 207 "wcsulex.l" +{ + *func = 1; + unput('('); + BEGIN(PAREN); + } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 213 "wcsulex.l" +{ + *func = 2; + unput('('); + BEGIN(PAREN); + } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 219 "wcsulex.l" +{ + *func = 3; + unput('('); + BEGIN(PAREN); + } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 225 "wcsulex.l" +{ + /* Leading binary multiply. */ + status = wcserr_set(WCSERR_SET(UNITSERR_DANGLING_BINOP), + "Dangling binary operator in '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 232 "wcsulex.l" +/* Discard whitespace in INITIAL context. */ + YY_BREAK +case 10: +YY_RULE_SETUP +#line 234 "wcsulex.l" +{ + expon /= 2.0; + unput('('); + BEGIN(PAREN); + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 240 "wcsulex.l" +{ + /* Gather terms in parentheses. */ + yyless(0); + BEGIN(PAREN); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 246 "wcsulex.l" +{ + if (operator++) { + BEGIN(FLUSH); + } + } + YY_BREAK +case 13: +#line 253 "wcsulex.l" +case 14: +YY_RULE_SETUP +#line 253 "wcsulex.l" +{ + if (operator++) { + BEGIN(FLUSH); + } else { + expon *= -1.0; + } + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 261 "wcsulex.l" +{ + operator = 0; + yyless(0); + BEGIN(UNITS); + } + YY_BREAK +case 16: +#line 268 "wcsulex.l" +case 17: +#line 269 "wcsulex.l" +case 18: +YY_RULE_SETUP +#line 269 "wcsulex.l" +{ + operator = 0; + yyless(0); + BEGIN(PREFIX); + } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 275 "wcsulex.l" +{ + bracket = !bracket; + BEGIN(FLUSH); + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 280 "wcsulex.l" +{ + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_INITIAL_SYMBOL), + "Invalid symbol in INITIAL context in '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 286 "wcsulex.l" +{ + paren++; + operator = 0; + yymore(); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 292 "wcsulex.l" +{ + paren--; + if (paren) { + /* Not balanced yet. */ + yymore(); + + } else { + /* Balanced; strip off the outer parentheses and recurse. */ + yytext[yyleng-1] = '\0'; + + buf = YY_CURRENT_BUFFER; + status = wcsulexe(yytext+1, &func_r, &factor_r, types, err); + yy_switch_to_buffer(buf, yyscanner); + + if (func_r) { + status = wcserr_set(WCSERR_SET(UNITSERR_FUNCTION_CONTEXT), + "Function in invalid context in '%s'", unitstr); + } + + if (status) { + BEGIN(FLUSH); + } else { + factor *= factor_r; + BEGIN(EXPON); + } + } + } + YY_BREAK +case 23: +/* rule 23 can match eol */ +YY_RULE_SETUP +#line 320 "wcsulex.l" +{ + yymore(); + } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 324 "wcsulex.l" +{ + factor = 1e-1; + BEGIN(UNITS); + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 329 "wcsulex.l" +{ + factor = 1e-2; + BEGIN(UNITS); + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 334 "wcsulex.l" +{ + factor = 1e-3; + BEGIN(UNITS); + } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 339 "wcsulex.l" +{ + factor = 1e-6; + BEGIN(UNITS); + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 344 "wcsulex.l" +{ + factor = 1e-9; + BEGIN(UNITS); + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 349 "wcsulex.l" +{ + factor = 1e-12; + BEGIN(UNITS); + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 354 "wcsulex.l" +{ + factor = 1e-15; + BEGIN(UNITS); + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 359 "wcsulex.l" +{ + factor = 1e-18; + BEGIN(UNITS); + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 364 "wcsulex.l" +{ + factor = 1e-21; + BEGIN(UNITS); + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 369 "wcsulex.l" +{ + factor = 1e-24; + BEGIN(UNITS); + } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 374 "wcsulex.l" +{ + factor = 1e+1; + BEGIN(UNITS); + } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 379 "wcsulex.l" +{ + factor = 1e+2; + BEGIN(UNITS); + } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 384 "wcsulex.l" +{ + factor = 1e+3; + BEGIN(UNITS); + } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 389 "wcsulex.l" +{ + factor = 1e+6; + BEGIN(UNITS); + } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 394 "wcsulex.l" +{ + factor = 1e+9; + BEGIN(UNITS); + } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 399 "wcsulex.l" +{ + factor = 1e+12; + BEGIN(UNITS); + } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 404 "wcsulex.l" +{ + factor = 1e+15; + BEGIN(UNITS); + } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 409 "wcsulex.l" +{ + factor = 1e+18; + BEGIN(UNITS); + } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 414 "wcsulex.l" +{ + factor = 1e+21; + BEGIN(UNITS); + } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 419 "wcsulex.l" +{ + factor = 1e+24; + BEGIN(UNITS); + } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 424 "wcsulex.l" +{ + /* Internal parser error. */ + status = wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 431 "wcsulex.l" +{ + /* Ampere. */ + types[WCSUNITS_CHARGE] += 1.0; + types[WCSUNITS_TIME] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 438 "wcsulex.l" +{ + /* Julian year (annum). */ + factor *= 31557600.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 445 "wcsulex.l" +{ + /* Analogue-to-digital converter units. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 451 "wcsulex.l" +{ + /* Angstrom. */ + factor *= 1e-10; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 458 "wcsulex.l" +{ + /* Minute of arc. */ + factor /= 60.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 465 "wcsulex.l" +{ + /* Second of arc. */ + factor /= 3600.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 472 "wcsulex.l" +{ + /* Astronomical unit. */ + factor *= 1.49598e+11; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 479 "wcsulex.l" +{ + /* Barn. */ + factor *= 1e-28; + types[WCSUNITS_LENGTH] += 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 486 "wcsulex.l" +{ + /* Beam, as in Jy/beam. */ + types[WCSUNITS_BEAM] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 492 "wcsulex.l" +{ + /* Bin (e.g. histogram). */ + types[WCSUNITS_BIN] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 498 "wcsulex.l" +{ + /* Bit. */ + types[WCSUNITS_BIT] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 504 "wcsulex.l" +{ + /* Byte. */ + factor *= 8.0; + types[WCSUNITS_BIT] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 511 "wcsulex.l" +{ + /* Coulomb. */ + types[WCSUNITS_CHARGE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 517 "wcsulex.l" +{ + /* Candela. */ + types[WCSUNITS_LUMINTEN] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 523 "wcsulex.l" +{ + /* Channel. */ + types[WCSUNITS_BIN] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 529 "wcsulex.l" +{ + /* Count. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 535 "wcsulex.l" +{ + /* Julian century. */ + factor *= 3155760000.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 542 "wcsulex.l" +{ + /* Debye. */ + factor *= 1e-29 / 3.0; + types[WCSUNITS_CHARGE] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 550 "wcsulex.l" +{ + /* Day. */ + factor *= 86400.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 557 "wcsulex.l" +{ + /* Degree. */ + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 563 "wcsulex.l" +{ + /* Erg. */ + factor *= 1e-7; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 572 "wcsulex.l" +{ + /* Electron volt. */ + factor *= 1.6021765e-19; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 581 "wcsulex.l" +{ + /* Farad. */ + types[WCSUNITS_MASS] -= 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] += 3.0; + types[WCSUNITS_CHARGE] += 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 590 "wcsulex.l" +{ + /* Gauss. */ + factor *= 1e-4; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 599 "wcsulex.l" +{ + /* Gram. */ + factor *= 1e-3; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 606 "wcsulex.l" +{ + /* Henry. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] += 2.0; + types[WCSUNITS_CHARGE] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 615 "wcsulex.l" +{ + /* Hour. */ + factor *= 3600.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 622 "wcsulex.l" +{ + /* Hertz. */ + types[WCSUNITS_TIME] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 628 "wcsulex.l" +{ + /* Joule. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 636 "wcsulex.l" +{ + /* Jansky. */ + factor *= 1e-26; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 644 "wcsulex.l" +{ + /* Kelvin. */ + types[WCSUNITS_TEMPERATURE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 650 "wcsulex.l" +{ + /* Lumen. */ + types[WCSUNITS_LUMINTEN] += 1.0; + types[WCSUNITS_SOLID_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 657 "wcsulex.l" +{ + /* Lux. */ + types[WCSUNITS_LUMINTEN] += 1.0; + types[WCSUNITS_SOLID_ANGLE] += 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 665 "wcsulex.l" +{ + /* Light year. */ + factor *= 2.99792458e8 * 31557600.0; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 672 "wcsulex.l" +{ + /* Metre. */ + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 678 "wcsulex.l" +{ + /* Stellar magnitude. */ + types[WCSUNITS_MAGNITUDE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 684 "wcsulex.l" +{ + /* Milli-arcsec. */ + factor /= 3600e+3; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 691 "wcsulex.l" +{ + /* Minute. */ + factor *= 60.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 698 "wcsulex.l" +{ + /* Mole. */ + types[WCSUNITS_MOLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 704 "wcsulex.l" +{ + /* Newton. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 712 "wcsulex.l" +{ + /* Ohm. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 1.0; + types[WCSUNITS_CHARGE] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 721 "wcsulex.l" +{ + /* Pascal. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] -= 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 729 "wcsulex.l" +{ + /* Parsec. */ + factor *= 3.0857e16; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 736 "wcsulex.l" +{ + /* Photon. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 742 "wcsulex.l" +{ + /* Pixel. */ + types[WCSUNITS_PIXEL] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 748 "wcsulex.l" +{ + /* Rayleigh. */ + factor *= 1e10 / (4.0 * PI); + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] -= 1.0; + types[WCSUNITS_SOLID_ANGLE] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 757 "wcsulex.l" +{ + /* Radian. */ + factor *= 180.0 / PI; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 764 "wcsulex.l" +{ + /* Rydberg. */ + factor *= 13.605692 * 1.6021765e-19; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 773 "wcsulex.l" +{ + /* Siemen. */ + types[WCSUNITS_MASS] -= 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] += 2.0; + BEGIN(EXPON); + } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 782 "wcsulex.l" +{ + /* Second. */ + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 788 "wcsulex.l" +{ + /* Solar luminosity. */ + factor *= 3.8268e26; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 3.0; + BEGIN(EXPON); + } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 797 "wcsulex.l" +{ + /* Solar mass. */ + factor *= 1.9891e30; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 804 "wcsulex.l" +{ + /* Solar radius. */ + factor *= 6.9599e8; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 811 "wcsulex.l" +{ + /* Steradian. */ + types[WCSUNITS_SOLID_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 817 "wcsulex.l" +{ + /* Sun (with respect to). */ + types[WCSUNITS_SOLRATIO] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 823 "wcsulex.l" +{ + /* Tesla. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 831 "wcsulex.l" +{ + /* Turn. */ + factor *= 360.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 838 "wcsulex.l" +{ + /* Unified atomic mass unit. */ + factor *= 1.6605387e-27; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 845 "wcsulex.l" +{ + /* Volt. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 854 "wcsulex.l" +{ + /* Voxel. */ + types[WCSUNITS_VOXEL] += 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 860 "wcsulex.l" +{ + /* Watt. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 3.0; + BEGIN(EXPON); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 868 "wcsulex.l" +{ + /* Weber. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 877 "wcsulex.l" +{ + /* Internal parser error. */ + status = wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 884 "wcsulex.l" +{ + /* Exponentiation. */ + if (operator++) { + BEGIN(FLUSH); + } + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 891 "wcsulex.l" +{ + sscanf(yytext, " %d", &i); + expon *= (double)i; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 899 "wcsulex.l" +{ + sscanf(yytext, " (%d)", &i); + expon *= (double)i; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 907 "wcsulex.l" +{ + sscanf(yytext, " (%d/%d)", &i, &j); + expon *= (double)i / (double)j; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 915 "wcsulex.l" +{ + sscanf(yytext, " (%s)", ctmp); + wcsutil_str2double(ctmp, &dexp); + expon *= dexp; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 924 "wcsulex.l" +{ + /* Multiply. */ + if (operator++) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + BEGIN(INITIAL); + } + } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 934 "wcsulex.l" +{ + /* Multiply. */ + if (operator) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + unput('('); + BEGIN(INITIAL); + } + } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 945 "wcsulex.l" +{ + /* Multiply. */ + if (operator) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + BEGIN(INITIAL); + } + } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 955 "wcsulex.l" +{ + /* Divide. */ + if (operator++) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + expon = -1.0; + BEGIN(INITIAL); + } + } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 966 "wcsulex.l" +{ + add(&factor, types, &expon, scale, units); + bracket = !bracket; + BEGIN(FLUSH); + } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 972 "wcsulex.l" +{ + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_EXPON_SYMBOL), + "Invalid symbol in EXPON context in '%s'", unitstr); + BEGIN(FLUSH); + } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 978 "wcsulex.l" +{ + /* Discard any remaining input. */ + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(PAREN): +case YY_STATE_EOF(PREFIX): +case YY_STATE_EOF(UNITS): +case YY_STATE_EOF(EXPON): +case YY_STATE_EOF(FLUSH): +#line 982 "wcsulex.l" +{ + /* End-of-string. */ + if (YY_START == EXPON) { + add(&factor, types, &expon, scale, units); + } + + if (bracket) { + status = wcserr_set(WCSERR_SET(UNITSERR_UNBAL_BRACKET), + "Unbalanced bracket in '%s'", unitstr); + } else if (paren) { + status = wcserr_set(WCSERR_SET(UNITSERR_UNBAL_PAREN), + "Unbalanced parenthesis in '%s'", unitstr); + } else if (operator == 1) { + status = wcserr_set(WCSERR_SET(UNITSERR_DANGLING_BINOP), + "Dangling binary operator in '%s'", unitstr); + } else if (operator) { + status = wcserr_set(WCSERR_SET(UNITSERR_CONSEC_BINOPS), + "Consecutive binary operators in '%s'", unitstr); +#ifdef DEBUG + } else { + fprintf(stderr, "EOS\n"); +#endif + } + + if (status) { + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] = 0.0; + *scale = 0.0; + } + } + + return status; + } + YY_BREAK +case 120: +YY_RULE_SETUP +#line 1016 "wcsulex.l" +ECHO; + YY_BREAK +#line 8799 "wcsulex.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + if ( *yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; + } + else + yy_current_state = yy_NUL_trans[yy_current_state]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + yy_current_state = yy_NUL_trans[yy_current_state]; + yy_is_jam = (yy_current_state == 0); + + if ( ! yy_is_jam ) + { + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + } + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) +{ + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_cp = yyg->yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yyg->yy_hold_char; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + yyg->yytext_ptr = yy_bp; + yyg->yy_hold_char = *yy_cp; + yyg->yy_c_buf_p = yy_cp; +} + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 1016 "wcsulex.l" + + +/*---------------------------------------------------------------------------- +* Accumulate a term in a units specification and reset work variables. +*---------------------------------------------------------------------------*/ + +void add( + double *factor, + double types[], + double *expon, + double *scale, + double units[]) + +{ + int i; + + *scale *= pow(*factor, *expon); + + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] += *expon * types[i]; + types[i] = 0.0; + } + + *expon = 1.0; + *factor = 1.0; + + return; +} + diff --git a/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsutrn.c b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsutrn.c new file mode 100644 index 0000000000000000000000000000000000000000..8768dfa71e2f21612e73c91673c993cab8e0d06a --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/flexed/wcsutrn.c @@ -0,0 +1,6146 @@ +#line 2 "wcsutrn.c" + +#line 4 "wcsutrn.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define wcsutrn_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer wcsutrn_create_buffer +#endif + +#ifdef yy_delete_buffer +#define wcsutrn_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer wcsutrn_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define wcsutrn_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer wcsutrn_scan_buffer +#endif + +#ifdef yy_scan_string +#define wcsutrn_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string wcsutrn_scan_string +#endif + +#ifdef yy_scan_bytes +#define wcsutrn_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes wcsutrn_scan_bytes +#endif + +#ifdef yy_init_buffer +#define wcsutrn_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer wcsutrn_init_buffer +#endif + +#ifdef yy_flush_buffer +#define wcsutrn_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer wcsutrn_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define wcsutrn_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state wcsutrn_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define wcsutrn_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer wcsutrn_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define wcsutrnpush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state wcsutrnpush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define wcsutrnpop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state wcsutrnpop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define wcsutrnensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack wcsutrnensure_buffer_stack +#endif + +#ifdef yylex +#define wcsutrnlex_ALREADY_DEFINED +#else +#define yylex wcsutrnlex +#endif + +#ifdef yyrestart +#define wcsutrnrestart_ALREADY_DEFINED +#else +#define yyrestart wcsutrnrestart +#endif + +#ifdef yylex_init +#define wcsutrnlex_init_ALREADY_DEFINED +#else +#define yylex_init wcsutrnlex_init +#endif + +#ifdef yylex_init_extra +#define wcsutrnlex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra wcsutrnlex_init_extra +#endif + +#ifdef yylex_destroy +#define wcsutrnlex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy wcsutrnlex_destroy +#endif + +#ifdef yyget_debug +#define wcsutrnget_debug_ALREADY_DEFINED +#else +#define yyget_debug wcsutrnget_debug +#endif + +#ifdef yyset_debug +#define wcsutrnset_debug_ALREADY_DEFINED +#else +#define yyset_debug wcsutrnset_debug +#endif + +#ifdef yyget_extra +#define wcsutrnget_extra_ALREADY_DEFINED +#else +#define yyget_extra wcsutrnget_extra +#endif + +#ifdef yyset_extra +#define wcsutrnset_extra_ALREADY_DEFINED +#else +#define yyset_extra wcsutrnset_extra +#endif + +#ifdef yyget_in +#define wcsutrnget_in_ALREADY_DEFINED +#else +#define yyget_in wcsutrnget_in +#endif + +#ifdef yyset_in +#define wcsutrnset_in_ALREADY_DEFINED +#else +#define yyset_in wcsutrnset_in +#endif + +#ifdef yyget_out +#define wcsutrnget_out_ALREADY_DEFINED +#else +#define yyget_out wcsutrnget_out +#endif + +#ifdef yyset_out +#define wcsutrnset_out_ALREADY_DEFINED +#else +#define yyset_out wcsutrnset_out +#endif + +#ifdef yyget_leng +#define wcsutrnget_leng_ALREADY_DEFINED +#else +#define yyget_leng wcsutrnget_leng +#endif + +#ifdef yyget_text +#define wcsutrnget_text_ALREADY_DEFINED +#else +#define yyget_text wcsutrnget_text +#endif + +#ifdef yyget_lineno +#define wcsutrnget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno wcsutrnget_lineno +#endif + +#ifdef yyset_lineno +#define wcsutrnset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno wcsutrnset_lineno +#endif + +#ifdef yyget_column +#define wcsutrnget_column_ALREADY_DEFINED +#else +#define yyget_column wcsutrnget_column +#endif + +#ifdef yyset_column +#define wcsutrnset_column_ALREADY_DEFINED +#else +#define yyset_column wcsutrnset_column +#endif + +#ifdef yywrap +#define wcsutrnwrap_ALREADY_DEFINED +#else +#define yywrap wcsutrnwrap +#endif + +#ifdef yyalloc +#define wcsutrnalloc_ALREADY_DEFINED +#else +#define yyalloc wcsutrnalloc +#endif + +#ifdef yyrealloc +#define wcsutrnrealloc_ALREADY_DEFINED +#else +#define yyrealloc wcsutrnrealloc +#endif + +#ifdef yyfree +#define wcsutrnfree_ALREADY_DEFINED +#else +#define yyfree wcsutrnfree +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +#define YY_LESS_LINENO(n) +#define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define wcsutrnwrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static const flex_int16_t yy_nxt[][128] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + + { + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 10, 11, 12, 13, 12, + + 12, 14, 15, 12, 16, 17, 12, 18, 12, 19, + 20, 12, 21, 22, 12, 12, 23, 12, 12, 24, + 12, 8, 8, 8, 8, 8, 8, 25, 12, 12, + 26, 12, 12, 12, 27, 12, 12, 28, 12, 29, + 12, 12, 30, 12, 31, 32, 12, 12, 33, 12, + 12, 34, 12, 8, 8, 8, 8, 8 + }, + + { + 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 35, 8, 8, 8, 8, 8, 8, 8, + + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 10, 11, 12, 13, 12, + 12, 14, 15, 12, 16, 17, 12, 18, 12, 19, + 20, 12, 21, 22, 12, 12, 23, 12, 12, 24, + 12, 36, 8, 8, 8, 8, 8, 25, 12, 12, + 26, 12, 12, 12, 27, 12, 12, 28, 12, 29, + 12, 12, 30, 12, 31, 32, 12, 12, 33, 12, + 12, 34, 12, 8, 8, 8, 8, 8 + }, + + { + 7, 37, 37, 37, 37, 37, 37, 37, 37, 37, + + 38, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 39, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 37, 37, 37, 37, 37, 37, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 37, 37, 37, 37, 37 + }, + + { + 7, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 38, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 39, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 37, 37, 37, 37, 37, 37, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 37, 37, 37, 37, 37 + }, + + { + 7, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 38, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41 + }, + + { + 7, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 38, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41 + }, + + { + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, + -7, -7, -7, -7, -7, -7, -7, -7 + }, + + { + 7, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8 + }, + + { + 7, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + + -9, -9, 42, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + -9, -9, -9, -9, -9, -9, -9, -9 + + }, + + { + 7, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, + -10, -10, -10, -10, -10, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 44, 43, 43, 43, 43, 43, 43, 43, + 43, -10, -10, -10, -10, -10, -10, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -10, -10, -10, -10, -10 + }, + + { + 7, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, 43, 43, 43, 43, 45, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -11, -11, -11, -11, -11, -11, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 46, 43, -11, -11, -11, -11, -11 + }, + + { + 7, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, + + -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -12, -12, -12, -12, -12, -12, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -12, -12, -12, -12, -12 + }, + + { + 7, -13, -13, -13, -13, -13, -13, -13, -13, -13, + + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, + -13, -13, -13, -13, -13, 47, 43, 43, 43, 48, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -13, -13, -13, -13, -13, -13, 43, 43, 43, + 43, 49, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -13, -13, -13, -13, -13 + }, + + { + 7, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, 43, 43, 43, 43, 43, + 43, 43, 50, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -14, -14, -14, -14, -14, -14, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -14, -14, -14, -14, -14 + }, + + { + 7, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + + -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, + -15, -15, -15, -15, -15, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 51, 43, 43, 43, 43, 43, 43, 43, + 52, -15, -15, -15, -15, -15, -15, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -15, -15, -15, -15, -15 + }, + + { + 7, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 53, + 43, -16, -16, -16, -16, -16, -16, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -16, -16, -16, -16, -16 + }, + + { + 7, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, 43, 43, 43, 43, 54, + 43, 43, 55, 43, 43, 43, 43, 56, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -17, -17, -17, -17, -17, -17, 43, 43, 43, + 43, 57, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -17, -17, -17, -17, -17 + }, + + { + 7, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + + -18, -18, -18, -18, -18, 43, 43, 43, 43, 58, + 43, 43, 59, 60, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -18, -18, -18, -18, -18, -18, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -18, -18, -18, -18, -18 + }, + + { + 7, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, + -19, -19, -19, -19, -19, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -19, -19, -19, -19, -19, -19, 43, 43, 43, + 43, 43, 43, 43, 61, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -19, -19, -19, -19, -19 + + }, + + { + 7, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, 62, 43, 43, 43, 43, + 43, 43, 43, 63, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -20, -20, -20, -20, -20, -20, 64, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -20, -20, -20, -20, -20 + }, + + { + 7, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, + -21, -21, -21, -21, -21, 65, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -21, -21, -21, -21, -21, -21, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -21, -21, -21, -21, -21 + }, + + { + 7, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, 43, 43, 43, 43, 66, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -22, -22, -22, -22, -22, -22, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -22, -22, -22, -22, -22 + }, + + { + 7, -23, -23, -23, -23, -23, -23, -23, -23, -23, + + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 67, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -23, -23, -23, -23, -23, -23, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 68, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -23, -23, -23, -23, -23 + }, + + { + 7, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, 43, 43, 43, 43, 69, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 70, 43, 43, 43, 43, 43, 43, 43, + 43, -24, -24, -24, -24, -24, -24, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -24, -24, -24, -24, -24 + }, + + { + 7, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -25, -25, -25, -25, -25, -25, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 71, 43, 43, 43, 72, 43, 43, 43, 43, 43, + 43, 43, 43, -25, -25, -25, -25, -25 + }, + + { + 7, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -26, -26, -26, -26, -26, -26, 73, 43, 43, + 43, 74, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -26, -26, -26, -26, -26 + }, + + { + 7, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -27, -27, -27, -27, -27, -27, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 51, 43, 43, 43, 43, 43, + 43, 43, 52, -27, -27, -27, -27, -27 + }, + + { + 7, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, + + -28, -28, -28, -28, -28, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -28, -28, -28, -28, -28, -28, 43, 43, 43, + 43, 57, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -28, -28, -28, -28, -28 + }, + + { + 7, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -29, -29, -29, -29, -29, -29, 43, 43, 43, + 43, 75, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -29, -29, -29, -29, -29 + + }, + + { + 7, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, + -30, -30, -30, -30, -30, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -30, -30, -30, -30, -30, -30, 64, 43, 43, + + 43, 43, 43, 43, 43, 76, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -30, -30, -30, -30, -30 + }, + + { + 7, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -31, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -31, -31, -31, -31, -31, -31, 77, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -31, -31, -31, -31, -31 + }, + + { + 7, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -32, -32, -32, -32, -32, -32, 43, 43, 43, + 43, 78, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -32, -32, -32, -32, -32 + }, + + { + 7, -33, -33, -33, -33, -33, -33, -33, -33, -33, + + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -33, -33, -33, -33, -33, -33, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 68, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -33, -33, -33, -33, -33 + }, + + { + 7, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, -34, -34, -34, -34, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -34, -34, -34, -34, -34, -34, 43, 43, 43, + 43, 79, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -34, -34, -34, -34, -34 + }, + + { + 7, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, 80, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, 81, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, -35, -35, -35, -35, -35, -35, -35 + }, + + { + 7, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, + + -36, -36, -36, -36, -36, -36, -36, -36 + }, + + { + 7, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37, -37 + }, + + { + 7, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, -38, -38 + }, + + { + 7, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + + 82, 82, 83, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 82, 82, 82, 82, 82, 82, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 82, 82, 82, 82, 82 + + }, + + { + 7, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, -40, -40, -40, -40, -40, -40, 85, 85, 85, + + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, -40, -40, -40, -40, -40 + }, + + { + 7, 86, 86, 86, 86, 86, 86, 86, 86, 86, + -41, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86 + }, + + { + 7, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, 42, -42, -42, -42, -42, -42, -42, -42, + + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, + -42, -42, -42, -42, -42, -42, -42, -42 + }, + + { + 7, -43, -43, -43, -43, -43, -43, -43, -43, -43, + + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -43, -43, -43, -43, -43, -43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -43, -43, -43, -43, -43 + }, + + { + 7, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, -44, -44, 43, 43, 87, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -44, -44, -44, -44, -44, -44, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -44, -44, -44, -44, -44 + }, + + { + 7, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + + -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, + -45, -45, -45, -45, -45, 88, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -45, -45, -45, -45, -45, -45, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -45, -45, -45, -45, -45 + }, + + { + 7, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -46, -46, -46, -46, -46, -46, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 89, 43, 43, 43, + + 43, 43, 43, -46, -46, -46, -46, -46 + }, + + { + 7, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, + -47, -47, -47, -47, -47, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 90, + + 43, -47, -47, -47, -47, -47, -47, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -47, -47, -47, -47, -47 + }, + + { + 7, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, + + -48, -48, -48, -48, -48, 43, 43, 43, 43, 43, + 43, 91, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -48, -48, -48, -48, -48, -48, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -48, -48, -48, -48, -48 + }, + + { + 7, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, + -49, -49, -49, -49, -49, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -49, -49, -49, -49, -49, -49, 43, 43, 43, + 43, 43, 43, 92, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -49, -49, -49, -49, -49 + + }, + + { + 7, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 93, -50, -50, -50, -50, -50, -50, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -50, -50, -50, -50, -50 + }, + + { + 7, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -51, -51, -51, -51, -51, -51, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -51, -51, -51, -51, -51 + }, + + { + 7, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -52, -52, -52, -52, -52, -52, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -52, -52, -52, -52, -52 + }, + + { + 7, -53, -53, -53, -53, -53, -53, -53, -53, -53, + + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -53, -53, -53, -53, -53, -53, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -53, -53, -53, -53, -53 + }, + + { + 7, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, + -54, -54, -54, -54, -54, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 94, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -54, -54, -54, -54, -54, -54, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -54, -54, -54, -54, -54 + }, + + { + 7, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + + -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 95, -55, -55, -55, -55, -55, -55, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -55, -55, -55, -55, -55 + }, + + { + 7, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, -56, -56, -56, -56, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -56, -56, -56, -56, -56, -56, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -56, -56, -56, -56, -56 + }, + + { + 7, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, -57, -57, -57, -57, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -57, -57, -57, -57, -57, -57, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 96, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -57, -57, -57, -57, -57 + }, + + { + 7, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, + + -58, -58, -58, -58, -58, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 97, 43, 43, 43, 43, 43, + 43, -58, -58, -58, -58, -58, -58, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -58, -58, -58, -58, -58 + }, + + { + 7, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 98, -59, -59, -59, -59, -59, -59, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -59, -59, -59, -59, -59 + + }, + + { + 7, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, -60, -60, -60, -60, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 99, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -60, -60, -60, -60, -60, -60, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -60, -60, -60, -60, -60 + }, + + { + 7, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, + -61, -61, -61, -61, -61, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -61, -61, -61, -61, -61, -61, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 100, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -61, -61, -61, -61, -61 + }, + + { + 7, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 101, 43, 43, 43, 43, 43, 43, + 43, -62, -62, -62, -62, -62, -62, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -62, -62, -62, -62, -62 + }, + + { + 7, -63, -63, -63, -63, -63, -63, -63, -63, -63, + + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, + -63, -63, -63, -63, -63, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 102, 43, + 43, -63, -63, -63, -63, -63, -63, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -63, -63, -63, -63, -63 + }, + + { + 7, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, + -64, -64, -64, -64, -64, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -64, -64, -64, -64, -64, -64, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 103, 43, 43, 43, 43, + 43, 43, 43, -64, -64, -64, -64, -64 + }, + + { + 7, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + + -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, -65, 43, 43, 43, 104, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -65, -65, -65, -65, -65, -65, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -65, -65, -65, -65, -65 + }, + + { + 7, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, + -66, -66, -66, -66, -66, 43, 43, 105, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -66, -66, -66, -66, -66, -66, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -66, -66, -66, -66, -66 + }, + + { + 7, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, + -67, -67, -67, -67, -67, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 106, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -67, -67, -67, -67, -67, -67, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -67, -67, -67, -67, -67 + }, + + { + 7, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + + -68, -68, -68, -68, -68, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -68, -68, -68, -68, -68, -68, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 107, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -68, -68, -68, -68, -68 + }, + + { + 7, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, + -69, -69, -69, -69, -69, 108, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -69, -69, -69, -69, -69, -69, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -69, -69, -69, -69, -69 + + }, + + { + 7, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, + -70, -70, -70, -70, -70, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -70, -70, -70, -70, -70, -70, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -70, -70, -70, -70, -70 + }, + + { + 7, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, + -71, -71, -71, -71, -71, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -71, -71, -71, -71, -71, -71, 43, 43, 43, + 43, 43, 43, 109, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -71, -71, -71, -71, -71 + }, + + { + 7, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, + -72, -72, -72, -72, -72, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -72, -72, -72, -72, -72, -72, 43, 43, 110, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -72, -72, -72, -72, -72 + }, + + { + 7, -73, -73, -73, -73, -73, -73, -73, -73, -73, + + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, + -73, -73, -73, -73, -73, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -73, -73, -73, -73, -73, -73, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 111, 43, -73, -73, -73, -73, -73 + }, + + { + 7, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, + -74, -74, -74, -74, -74, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -74, -74, -74, -74, -74, -74, 43, 43, 43, + 43, 43, 43, 112, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -74, -74, -74, -74, -74 + }, + + { + 7, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + + -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, -75, -75, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -75, -75, -75, -75, -75, -75, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 113, 43, 43, 43, + 43, 43, 43, -75, -75, -75, -75, -75 + }, + + { + 7, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, -76, -76, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -76, -76, -76, -76, -76, -76, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 114, 43, 43, -76, -76, -76, -76, -76 + }, + + { + 7, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -77, -77, -77, -77, -77, -77, 43, 43, 43, + 115, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -77, -77, -77, -77, -77 + }, + + { + 7, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, + + -78, -78, -78, -78, -78, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -78, -78, -78, -78, -78, -78, 43, 43, 116, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -78, -78, -78, -78, -78 + }, + + { + 7, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -79, -79, -79, -79, -79, -79, 117, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -79, -79, -79, -79, -79 + + }, + + { + 7, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, 80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, 81, -80, -80, -80, -80, -80, -80, -80, -80, + + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80 + }, + + { + 7, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, + -81, -81, -81, -81, -81, -81, -81, -81 + }, + + { + 7, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, + -82, -82, -82, -82, -82, -82, -82, -82 + }, + + { + 7, 82, 82, 82, 82, 82, 82, 82, 82, 82, + + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 83, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 82, 82, 82, 82, 82, 82, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 82, 82, 82, 82, 82 + }, + + { + 7, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84 + }, + + { + 7, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + + -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, + -85, -85, -85, -85, -85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, -85, -85, -85, -85, -85, -85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, -85, -85, -85, -85, -85 + }, + + { + 7, 86, 86, 86, 86, 86, 86, 86, 86, 86, + -86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + + 86, 86, 86, 86, 86, 86, 86, 86 + }, + + { + 7, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 118, 43, 43, + 43, 43, 43, 119, 43, 43, 43, 43, 43, 43, + + 43, -87, -87, -87, -87, -87, -87, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -87, -87, -87, -87, -87 + }, + + { + 7, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, + + -88, -88, -88, -88, -88, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 120, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -88, -88, -88, -88, -88, -88, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -88, -88, -88, -88, -88 + }, + + { + 7, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, + -89, -89, -89, -89, -89, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -89, -89, -89, -89, -89, -89, 43, 43, 43, + 43, 121, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -89, -89, -89, -89, -89 + + }, + + { + 7, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 122, 43, 43, 43, 43, 43, 43, + 43, -90, -90, -90, -90, -90, -90, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -90, -90, -90, -90, -90 + }, + + { + 7, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 123, 43, 43, 43, 43, 43, 43, 43, + 43, -91, -91, -91, -91, -91, -91, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -91, -91, -91, -91, -91 + }, + + { + 7, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -92, -92, -92, -92, -92, -92, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 124, 43, 43, 43, 43, 43, + 43, 43, 43, -92, -92, -92, -92, -92 + }, + + { + 7, -93, -93, -93, -93, -93, -93, -93, -93, -93, + + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -93, -93, -93, -93, -93, -93, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -93, -93, -93, -93, -93 + }, + + { + 7, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, + -94, -94, -94, -94, -94, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 125, 43, 43, 43, + 43, -94, -94, -94, -94, -94, -94, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -94, -94, -94, -94, -94 + }, + + { + 7, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + + -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, + -95, -95, -95, -95, -95, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -95, -95, -95, -95, -95, -95, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -95, -95, -95, -95, -95 + }, + + { + 7, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, -96, -96, -96, -96, -96, + -96, -96, -96, -96, -96, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -96, -96, -96, -96, -96, -96, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 126, 43, + + 43, 43, 43, -96, -96, -96, -96, -96 + }, + + { + 7, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, + -97, -97, -97, -97, -97, 43, 43, 43, 43, 127, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 128, 43, 43, 43, 43, 43, 43, 43, + + 43, -97, -97, -97, -97, -97, -97, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -97, -97, -97, -97, -97 + }, + + { + 7, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + + -98, -98, -98, -98, -98, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -98, -98, -98, -98, -98, -98, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -98, -98, -98, -98, -98 + }, + + { + 7, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -99, -99, -99, -99, -99, -99, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -99, -99, -99, -99, -99 + + }, + + { + 7, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, + -100, -100, -100, -100, -100, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -100, -100, -100, -100, -100, -100, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -100, -100, -100, -100, -100 + }, + + { + 7, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, 43, 43, 129, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -101, -101, -101, -101, -101, -101, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -101, -101, -101, -101, -101 + }, + + { + 7, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, + -102, -102, -102, -102, -102, 43, 43, 43, 43, 130, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -102, -102, -102, -102, -102, -102, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -102, -102, -102, -102, -102 + }, + + { + 7, -103, -103, -103, -103, -103, -103, -103, -103, -103, + + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, + -103, -103, -103, -103, -103, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -103, -103, -103, -103, -103, -103, 43, 43, 131, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -103, -103, -103, -103, -103 + }, + + { + 7, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, 43, 43, 43, 43, 43, + 43, 43, 43, 132, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -104, -104, -104, -104, -104, -104, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -104, -104, -104, -104, -104 + }, + + { + 7, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + + -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, + -105, -105, -105, -105, -105, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 133, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -105, -105, -105, -105, -105, -105, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -105, -105, -105, -105, -105 + }, + + { + 7, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 134, 43, 43, 43, 43, 43, + 43, -106, -106, -106, -106, -106, -106, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -106, -106, -106, -106, -106 + }, + + { + 7, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, + -107, -107, -107, -107, -107, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -107, -107, -107, -107, -107, -107, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 135, 43, 43, 43, + 43, 43, 43, -107, -107, -107, -107, -107 + }, + + { + 7, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + + -108, -108, -108, -108, -108, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 136, 43, 43, 43, 43, 43, 43, 43, + 43, -108, -108, -108, -108, -108, -108, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -108, -108, -108, -108, -108 + }, + + { + 7, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -109, -109, -109, -109, -109, -109, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 137, 43, 43, 43, 43, + 43, 43, 43, -109, -109, -109, -109, -109 + + }, + + { + 7, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, -110, -110, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -110, -110, -110, -110, -110, -110, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 138, + 43, 43, 43, 43, 43, 139, 43, 43, 43, 43, + 43, 43, 43, -110, -110, -110, -110, -110 + }, + + { + 7, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -111, -111, -111, -111, -111, -111, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 140, 43, 43, 43, 43, + 43, 43, 43, -111, -111, -111, -111, -111 + }, + + { + 7, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -112, -112, -112, -112, -112, -112, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 141, 43, 43, 43, 43, 43, + 43, 43, 43, -112, -112, -112, -112, -112 + }, + + { + 7, -113, -113, -113, -113, -113, -113, -113, -113, -113, + + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, + -113, -113, -113, -113, -113, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -113, -113, -113, -113, -113, -113, 43, 43, 43, + 43, 142, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 143, 43, 43, 43, 43, 43, + 43, 43, 43, -113, -113, -113, -113, -113 + }, + + { + 7, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, + -114, -114, -114, -114, -114, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -114, -114, -114, -114, -114, -114, 43, 43, 43, + 43, 144, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -114, -114, -114, -114, -114 + }, + + { + 7, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + + -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -115, -115, -115, -115, -115, -115, 43, 43, 43, + 43, 43, 43, 43, 43, 145, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -115, -115, -115, -115, -115 + }, + + { + 7, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, + -116, -116, -116, -116, -116, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -116, -116, -116, -116, -116, -116, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 146, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -116, -116, -116, -116, -116 + }, + + { + 7, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, -117, -117, -117, -117, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -117, -117, -117, -117, -117, -117, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 147, 43, 43, 43, 43, 43, + 43, 43, 43, -117, -117, -117, -117, -117 + }, + + { + 7, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + + -118, -118, -118, -118, -118, 43, 43, 43, 43, 43, + 43, 43, 43, 148, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -118, -118, -118, -118, -118, -118, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -118, -118, -118, -118, -118 + }, + + { + 7, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, + -119, -119, -119, -119, -119, 43, 43, 43, 43, 149, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -119, -119, -119, -119, -119, -119, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -119, -119, -119, -119, -119 + + }, + + { + 7, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, + -120, -120, -120, -120, -120, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -120, -120, -120, -120, -120, -120, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -120, -120, -120, -120, -120 + }, + + { + 7, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, + -121, -121, -121, -121, -121, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -121, -121, -121, -121, -121, -121, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -121, -121, -121, -121, -121 + }, + + { + 7, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, + -122, -122, -122, -122, -122, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -122, -122, -122, -122, -122, -122, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -122, -122, -122, -122, -122 + }, + + { + 7, -123, -123, -123, -123, -123, -123, -123, -123, -123, + + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, + -123, -123, -123, -123, -123, 43, 43, 43, 43, 150, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -123, -123, -123, -123, -123, -123, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -123, -123, -123, -123, -123 + }, + + { + 7, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, + -124, -124, -124, -124, -124, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -124, -124, -124, -124, -124, -124, 43, 43, 43, + 43, 151, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -124, -124, -124, -124, -124 + }, + + { + 7, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + + -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, + -125, -125, -125, -125, -125, 43, 43, 43, 43, 43, + 43, 43, 43, 152, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -125, -125, -125, -125, -125, -125, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -125, -125, -125, -125, -125 + }, + + { + 7, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, + -126, -126, -126, -126, -126, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -126, -126, -126, -126, -126, -126, 43, 43, 43, + 43, 43, 43, 43, 43, 153, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -126, -126, -126, -126, -126 + }, + + { + 7, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, + -127, -127, -127, -127, -127, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 154, 43, 43, 43, 43, 43, 43, 43, + + 43, -127, -127, -127, -127, -127, -127, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -127, -127, -127, -127, -127 + }, + + { + 7, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, + + -128, -128, -128, -128, -128, 43, 43, 43, 43, 155, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -128, -128, -128, -128, -128, -128, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -128, -128, -128, -128, -128 + }, + + { + 7, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, 156, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -129, -129, -129, -129, -129, -129, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -129, -129, -129, -129, -129 + + }, + + { + 7, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, + -130, -130, -130, -130, -130, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 157, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -130, -130, -130, -130, -130, -130, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -130, -130, -130, -130, -130 + }, + + { + 7, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, -131, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -131, -131, -131, -131, -131, -131, 158, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -131, -131, -131, -131, -131 + }, + + { + 7, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, + -132, -132, -132, -132, -132, 159, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -132, -132, -132, -132, -132, -132, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -132, -132, -132, -132, -132 + }, + + { + 7, -133, -133, -133, -133, -133, -133, -133, -133, -133, + + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, + -133, -133, -133, -133, -133, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 160, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -133, -133, -133, -133, -133, -133, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -133, -133, -133, -133, -133 + }, + + { + 7, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, + -134, -134, -134, -134, -134, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 161, 43, 43, 43, 43, 43, 43, + 43, -134, -134, -134, -134, -134, -134, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -134, -134, -134, -134, -134 + }, + + { + 7, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + + -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, -135, -135, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -135, -135, -135, -135, -135, -135, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 162, 43, 43, 43, 43, + 43, 43, 43, -135, -135, -135, -135, -135 + }, + + { + 7, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 163, 43, 43, 43, 43, 43, 43, + 43, -136, -136, -136, -136, -136, -136, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -136, -136, -136, -136, -136 + }, + + { + 7, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, + -137, -137, -137, -137, -137, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -137, -137, -137, -137, -137, -137, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 164, 43, 43, 43, + 43, 43, 43, -137, -137, -137, -137, -137 + }, + + { + 7, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, + + -138, -138, -138, -138, -138, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -138, -138, -138, -138, -138, -138, 43, 43, 43, + 43, 43, 43, 43, 43, 165, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -138, -138, -138, -138, -138 + }, + + { + 7, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, + -139, -139, -139, -139, -139, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -139, -139, -139, -139, -139, -139, 43, 43, 43, + 43, 166, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -139, -139, -139, -139, -139 + + }, + + { + 7, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, + -140, -140, -140, -140, -140, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -140, -140, -140, -140, -140, -140, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -140, -140, -140, -140, -140 + }, + + { + 7, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, + -141, -141, -141, -141, -141, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -141, -141, -141, -141, -141, -141, 43, 43, 43, + 43, 167, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -141, -141, -141, -141, -141 + }, + + { + 7, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -142, -142, -142, -142, -142, -142, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 168, 43, 43, 43, 43, 43, + 43, 43, 43, -142, -142, -142, -142, -142 + }, + + { + 7, -143, -143, -143, -143, -143, -143, -143, -143, -143, + + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, + -143, -143, -143, -143, -143, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -143, -143, -143, -143, -143, -143, 43, 43, 43, + 43, 169, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -143, -143, -143, -143, -143 + }, + + { + 7, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, + -144, -144, -144, -144, -144, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -144, -144, -144, -144, -144, -144, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 170, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -144, -144, -144, -144, -144 + }, + + { + 7, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + + -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, + -145, -145, -145, -145, -145, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -145, -145, -145, -145, -145, -145, 171, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -145, -145, -145, -145, -145 + }, + + { + 7, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, + -146, -146, -146, -146, -146, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -146, -146, -146, -146, -146, -146, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 172, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -146, -146, -146, -146, -146 + }, + + { + 7, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, + -147, -147, -147, -147, -147, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -147, -147, -147, -147, -147, -147, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 70, 43, 43, 43, 43, + 43, 43, 43, -147, -147, -147, -147, -147 + }, + + { + 7, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, + + -148, -148, -148, -148, -148, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 173, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -148, -148, -148, -148, -148, -148, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -148, -148, -148, -148, -148 + }, + + { + 7, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, + -149, -149, -149, -149, -149, 43, 43, 174, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -149, -149, -149, -149, -149, -149, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -149, -149, -149, -149, -149 + + }, + + { + 7, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, + -150, -150, -150, -150, -150, 43, 43, 43, 43, 175, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -150, -150, -150, -150, -150, -150, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -150, -150, -150, -150, -150 + }, + + { + 7, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, + -151, -151, -151, -151, -151, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -151, -151, -151, -151, -151, -151, 43, 43, 43, + 43, 176, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -151, -151, -151, -151, -151 + }, + + { + 7, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, + -152, -152, -152, -152, -152, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 177, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -152, -152, -152, -152, -152, -152, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -152, -152, -152, -152, -152 + }, + + { + 7, -153, -153, -153, -153, -153, -153, -153, -153, -153, + + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, + -153, -153, -153, -153, -153, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -153, -153, -153, -153, -153, -153, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 178, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -153, -153, -153, -153, -153 + }, + + { + 7, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 179, 43, 43, 43, 43, 43, 43, + 43, -154, -154, -154, -154, -154, -154, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -154, -154, -154, -154, -154 + }, + + { + 7, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + + -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, + -155, -155, -155, -155, -155, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 180, 43, 43, 43, 43, 43, 43, + 43, -155, -155, -155, -155, -155, -155, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -155, -155, -155, -155, -155 + }, + + { + 7, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, + -156, -156, -156, -156, -156, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 181, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -156, -156, -156, -156, -156, -156, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -156, -156, -156, -156, -156 + }, + + { + 7, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, + -157, -157, -157, -157, -157, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 182, 43, 43, 43, 43, 43, 43, + + 43, -157, -157, -157, -157, -157, -157, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -157, -157, -157, -157, -157 + }, + + { + 7, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, + + -158, -158, -158, -158, -158, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -158, -158, -158, -158, -158, -158, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 183, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -158, -158, -158, -158, -158 + }, + + { + 7, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 184, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -159, -159, -159, -159, -159, -159, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -159, -159, -159, -159, -159 + + }, + + { + 7, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, + -160, -160, -160, -160, -160, 43, 43, 43, 185, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -160, -160, -160, -160, -160, -160, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -160, -160, -160, -160, -160 + }, + + { + 7, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, + -161, -161, -161, -161, -161, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -161, -161, -161, -161, -161, -161, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -161, -161, -161, -161, -161 + }, + + { + 7, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -162, -162, -162, -162, -162, -162, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -162, -162, -162, -162, -162 + }, + + { + 7, -163, -163, -163, -163, -163, -163, -163, -163, -163, + + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, + -163, -163, -163, -163, -163, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -163, -163, -163, -163, -163, -163, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -163, -163, -163, -163, -163 + }, + + { + 7, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, + -164, -164, -164, -164, -164, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -164, -164, -164, -164, -164, -164, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 186, 43, 43, 43, 43, 43, + 43, 43, 43, -164, -164, -164, -164, -164 + }, + + { + 7, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + + -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, -165, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -165, -165, -165, -165, -165, -165, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 187, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -165, -165, -165, -165, -165 + }, + + { + 7, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -166, -166, -166, -166, -166, -166, 43, 43, 188, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -166, -166, -166, -166, -166 + }, + + { + 7, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, + -167, -167, -167, -167, -167, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -167, -167, -167, -167, -167, -167, 43, 43, 43, + 43, 189, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -167, -167, -167, -167, -167 + }, + + { + 7, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, + + -168, -168, -168, -168, -168, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -168, -168, -168, -168, -168, -168, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 190, 43, 43, 43, 43, + 43, 43, 43, -168, -168, -168, -168, -168 + }, + + { + 7, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, + -169, -169, -169, -169, -169, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -169, -169, -169, -169, -169, -169, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 191, 43, 43, 43, 43, + 43, 43, 43, -169, -169, -169, -169, -169 + + }, + + { + 7, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, + -170, -170, -170, -170, -170, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -170, -170, -170, -170, -170, -170, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 182, 43, 43, 43, 43, + 43, 43, 43, -170, -170, -170, -170, -170 + }, + + { + 7, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, + -171, -171, -171, -171, -171, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -171, -171, -171, -171, -171, -171, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 192, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -171, -171, -171, -171, -171 + }, + + { + 7, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, + -172, -172, -172, -172, -172, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -172, -172, -172, -172, -172, -172, 43, 43, 43, + 193, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -172, -172, -172, -172, -172 + }, + + { + 7, -173, -173, -173, -173, -173, -173, -173, -173, -173, + + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, -173, -173, -173, -173, -173, + -173, -173, -173, -173, -173, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 194, 43, 43, 43, 43, 43, 43, + 43, -173, -173, -173, -173, -173, -173, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -173, -173, -173, -173, -173 + }, + + { + 7, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, + -174, -174, -174, -174, -174, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 195, 43, 43, 43, 43, 43, 43, + 43, -174, -174, -174, -174, -174, -174, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -174, -174, -174, -174, -174 + }, + + { + 7, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + + -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, + -175, -175, -175, -175, -175, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 196, 43, 43, 43, 43, 43, 43, + 43, -175, -175, -175, -175, -175, -175, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -175, -175, -175, -175, -175 + }, + + { + 7, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, + -176, -176, -176, -176, -176, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -176, -176, -176, -176, -176, -176, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 197, 43, 43, 43, 43, + + 43, 43, 43, -176, -176, -176, -176, -176 + }, + + { + 7, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, + -177, -177, -177, -177, -177, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 198, 43, 43, 43, 43, 43, 43, + + 43, -177, -177, -177, -177, -177, -177, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -177, -177, -177, -177, -177 + }, + + { + 7, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, + + -178, -178, -178, -178, -178, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -178, -178, -178, -178, -178, -178, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 199, 43, 43, 43, 43, + 43, 43, 43, -178, -178, -178, -178, -178 + }, + + { + 7, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -179, -179, -179, -179, -179, -179, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -179, -179, -179, -179, -179 + + }, + + { + 7, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, + -180, -180, -180, -180, -180, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -180, -180, -180, -180, -180, -180, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -180, -180, -180, -180, -180 + }, + + { + 7, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, + -181, -181, -181, -181, -181, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 200, 43, 43, 43, 43, 43, 43, + 43, -181, -181, -181, -181, -181, -181, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -181, -181, -181, -181, -181 + }, + + { + 7, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, -182, -182, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -182, -182, -182, -182, -182, -182, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -182, -182, -182, -182, -182 + }, + + { + 7, -183, -183, -183, -183, -183, -183, -183, -183, -183, + + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, -183, -183, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -183, -183, -183, -183, -183, -183, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 201, 43, 43, 43, 43, + 43, 43, 43, -183, -183, -183, -183, -183 + }, + + { + 7, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, -184, -184, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 202, 43, 43, 43, 43, 43, 43, + 43, -184, -184, -184, -184, -184, -184, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -184, -184, -184, -184, -184 + }, + + { + 7, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + + -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, -185, -185, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 203, 43, 43, 43, 43, 43, 43, + 43, -185, -185, -185, -185, -185, -185, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -185, -185, -185, -185, -185 + }, + + { + 7, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -186, -186, -186, -186, -186, -186, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 204, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -186, -186, -186, -186, -186 + }, + + { + 7, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, -187, -187, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -187, -187, -187, -187, -187, -187, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 194, 43, 43, 43, 43, + 43, 43, 43, -187, -187, -187, -187, -187 + }, + + { + 7, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, -188, -188, -188, -188, -188, -188, -188, + + -188, -188, -188, -188, -188, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -188, -188, -188, -188, -188, -188, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 195, 43, 43, 43, 43, + 43, 43, 43, -188, -188, -188, -188, -188 + }, + + { + 7, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, -189, -189, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -189, -189, -189, -189, -189, -189, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 205, 43, 43, 43, 43, + 43, 43, 43, -189, -189, -189, -189, -189 + + }, + + { + 7, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, -190, -190, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -190, -190, -190, -190, -190, -190, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -190, -190, -190, -190, -190 + }, + + { + 7, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -191, -191, -191, -191, -191, -191, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -191, -191, -191, -191, -191 + }, + + { + 7, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, -192, -192, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -192, -192, -192, -192, -192, -192, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 206, 43, 43, 43, 43, + 43, 43, 43, -192, -192, -192, -192, -192 + }, + + { + 7, -193, -193, -193, -193, -193, -193, -193, -193, -193, + + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -193, -193, -193, -193, -193, -193, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 207, 43, 43, 43, 43, + 43, 43, 43, -193, -193, -193, -193, -193 + }, + + { + 7, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, -194, -194, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -194, -194, -194, -194, -194, -194, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -194, -194, -194, -194, -194 + }, + + { + 7, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + + -195, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, -195, -195, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -195, -195, -195, -195, -195, -195, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -195, -195, -195, -195, -195 + }, + + { + 7, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, -196, -196, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -196, -196, -196, -196, -196, -196, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -196, -196, -196, -196, -196 + }, + + { + 7, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, -197, -197, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -197, -197, -197, -197, -197, -197, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -197, -197, -197, -197, -197 + }, + + { + 7, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, -198, -198, -198, -198, -198, -198, -198, + + -198, -198, -198, -198, -198, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -198, -198, -198, -198, -198, -198, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -198, -198, -198, -198, -198 + }, + + { + 7, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, -199, -199, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -199, -199, -199, -199, -199, -199, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -199, -199, -199, -199, -199 + + }, + + { + 7, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, -200, -200, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -200, -200, -200, -200, -200, -200, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -200, -200, -200, -200, -200 + }, + + { + 7, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, -201, -201, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -201, -201, -201, -201, -201, -201, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -201, -201, -201, -201, -201 + }, + + { + 7, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, -202, -202, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -202, -202, -202, -202, -202, -202, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -202, -202, -202, -202, -202 + }, + + { + 7, -203, -203, -203, -203, -203, -203, -203, -203, -203, + + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, -203, -203, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -203, -203, -203, -203, -203, -203, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -203, -203, -203, -203, -203 + }, + + { + 7, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, -204, -204, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -204, -204, -204, -204, -204, -204, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 208, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -204, -204, -204, -204, -204 + }, + + { + 7, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + + -205, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, -205, -205, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -205, -205, -205, -205, -205, -205, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -205, -205, -205, -205, -205 + }, + + { + 7, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, -206, -206, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -206, -206, -206, -206, -206, -206, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, 43, 43, -206, -206, -206, -206, -206 + }, + + { + 7, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, -207, -207, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + + 43, -207, -207, -207, -207, -207, -207, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -207, -207, -207, -207, -207 + }, + + { + 7, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + + -208, -208, -208, -208, -208, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, -208, -208, -208, -208, -208, -208, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, -208, -208, -208, -208, -208 + }, + + } ; + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 37 +#define YY_END_OF_BUFFER 38 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[209] = + { 0, + 0, 0, 0, 0, 36, 36, 38, 3, 2, 31, + 31, 31, 10, 31, 14, 31, 31, 20, 31, 31, + 31, 28, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 2, 1, 35, 37, 35, 32, + 36, 2, 31, 31, 31, 31, 31, 31, 31, 31, + 13, 15, 17, 31, 31, 19, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 30, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 2, + 1, 33, 33, 34, 32, 36, 31, 31, 31, 9, + 11, 11, 12, 31, 16, 31, 31, 22, 21, 23, + + 31, 31, 31, 26, 27, 31, 31, 31, 31, 31, + 9, 31, 31, 31, 31, 27, 31, 31, 31, 7, + 8, 9, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 29, 29, 30, 31, 31, 31, 9, + 31, 31, 31, 31, 31, 31, 30, 31, 31, 31, + 31, 31, 31, 20, 20, 31, 25, 31, 31, 31, + 29, 29, 30, 31, 31, 31, 31, 20, 20, 31, + 31, 31, 5, 6, 11, 11, 18, 18, 20, 20, + 24, 25, 24, 26, 27, 31, 31, 31, 11, 20, + 20, 26, 27, 5, 6, 11, 11, 18, 18, 24, + + 24, 26, 27, 31, 11, 26, 27, 4 + } ; + +static const yy_state_type yy_NUL_trans[209] = + { 0, + 8, 8, 37, 37, 41, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, + 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 82, 0, 0, 86, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "wcsutrn.l" +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsutrn.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*============================================================================= +* +* wcsutrn.l is a Flex description file containing the definition of a lexical +* scanner that translates non-standard FITS units specifications. +* +* It requires Flex v2.5.4 or later. +* +* Refer to wcsunits.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ +/* Options. */ +/* Exclusive start states. */ + +#line 50 "wcsutrn.l" +/* To get the prototype for fileno() from stdio.h when gcc is invoked with + * -std=c89 (same as -ansi) or -std=c99 since we do not define YY_INPUT. */ +#define _POSIX_SOURCE 1 + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsunits.h" + +static int wcsutrne_scanner(int ctrl, char unitstr[], struct wcserr **err, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsutrne( + int ctrl, + char unitstr[], + struct wcserr **err) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsutrne_scanner(ctrl, unitstr, err, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsutrne_scanner(int ctrl, char unitstr[], \ + struct wcserr **err, yyscan_t yyscanner) + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsutrn_abort_jmp_env; +#define exit(status) longjmp(wcsutrn_abort_jmp_env, status) + +#line 4327 "wcsutrn.c" +#line 4328 "wcsutrn.c" + +#define INITIAL 0 +#define NEXT 1 +#define FLUSH 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 96 "wcsutrn.l" + +#line 98 "wcsutrn.l" + static const char *function = "wcsutrne"; + + char orig[80], subs[80]; + int bracket = 0; + int unsafe = 0; + int status = -1; + + if (err) *err = 0x0; + + *orig = '\0'; + *subs = '\0'; + + yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); + yy_scan_string(unitstr, yyscanner); + *unitstr = '\0'; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsutrn_abort_jmp_env)) { + return wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units translator error parsing '%s'", unitstr); + } + + BEGIN(INITIAL); + +#ifdef DEBUG + fprintf(stderr, "\n%s ->\n", unitstr); +#endif + +#line 4608 "wcsutrn.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) + ++yy_cp; + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 126 "wcsutrn.l" +{ + /* Looks like a keycomment. */ + strcat(unitstr, "["); + bracket = 1; + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 132 "wcsutrn.l" +/* Discard leading whitespace. */ + YY_BREAK +case 3: +/* rule 3 can match eol */ +YY_RULE_SETUP +#line 134 "wcsutrn.l" +{ + /* Non-alphabetic character. */ + strcat(unitstr, yytext); + if (bracket && *yytext == ']') { + BEGIN(FLUSH); + } + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 142 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "Angstrom"); + BEGIN(NEXT); + } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 148 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "arcmin"); + BEGIN(NEXT); + } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 154 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "arcsec"); + BEGIN(NEXT); + } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 160 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "beam"); + BEGIN(NEXT); + } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 166 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "byte"); + BEGIN(NEXT); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 172 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "d"); + BEGIN(NEXT); + } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 178 "wcsutrn.l" +{ + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 4) ? "d" : "D"); + BEGIN(NEXT); + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 185 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "deg"); + BEGIN(NEXT); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 191 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "GHz"); + BEGIN(NEXT); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 197 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "h"); + BEGIN(NEXT); + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 203 "wcsutrn.l" +{ + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 2) ? "h" : "H"); + BEGIN(NEXT); + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 210 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "Hz"); + BEGIN(NEXT); + } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 216 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "kHz"); + BEGIN(NEXT); + } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 222 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "Jy"); + BEGIN(NEXT); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 228 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "K"); + BEGIN(NEXT); + } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 234 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "km"); + BEGIN(NEXT); + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 240 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "m"); + BEGIN(NEXT); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 246 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "min"); + BEGIN(NEXT); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 252 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "MHz"); + BEGIN(NEXT); + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 258 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "ohm"); + BEGIN(NEXT); + } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 264 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "Pa"); + BEGIN(NEXT); + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 270 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "pixel"); + BEGIN(NEXT); + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 276 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "rad"); + BEGIN(NEXT); + } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 282 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "s"); + BEGIN(NEXT); + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 288 "wcsutrn.l" +{ + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 1) ? "s" : "S"); + BEGIN(NEXT); + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 295 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "V"); + BEGIN(NEXT); + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 301 "wcsutrn.l" +{ + strcpy(orig, yytext); + strcpy(subs, "yr"); + BEGIN(NEXT); + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 307 "wcsutrn.l" +{ + /* Not a recognized alias. */ + strcpy(orig, yytext); + strcpy(subs, orig); + BEGIN(NEXT); + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 314 "wcsutrn.l" +{ + /* Reject the alias match. */ + strcat(orig, yytext); + strcpy(subs, orig); + } + YY_BREAK +case 33: +/* rule 33 can match eol */ +YY_RULE_SETUP +#line 320 "wcsutrn.l" +{ + /* Discard separating whitespace. */ + unput(yytext[yyleng-1]); + } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 325 "wcsutrn.l" +{ + /* Compress separating whitespace. */ + strcat(unitstr, subs); + strcat(unitstr, " "); + if (strcmp(orig, subs)) status = 0; + unput(yytext[yyleng-1]); + *subs = '\0'; + BEGIN(INITIAL); + } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 335 "wcsutrn.l" +{ + /* Copy anything else unchanged. */ + strcat(unitstr, subs); + if (strcmp(orig, subs)) status = 0; + unput(*yytext); + *subs = '\0'; + BEGIN(INITIAL); + } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 344 "wcsutrn.l" +{ + /* Copy out remaining input. */ + strcat(unitstr, yytext); + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(NEXT): +case YY_STATE_EOF(FLUSH): +#line 349 "wcsutrn.l" +{ + /* End-of-string. */ + if (*subs) { + strcat(unitstr, subs); + if (strcmp(orig, subs)) status = 0; + } + + if (unsafe) { + return wcserr_set(WCSERR_SET(UNITSERR_UNSAFE_TRANS), + "Unsafe unit translation in '%s'", unitstr); + } + return status; + } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 363 "wcsutrn.l" +ECHO; + YY_BREAK +#line 4995 "wcsutrn.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + if ( *yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; + } + else + yy_current_state = yy_NUL_trans[yy_current_state]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + + yy_current_state = yy_NUL_trans[yy_current_state]; + yy_is_jam = (yy_current_state == 0); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) +{ + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_cp = yyg->yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yyg->yy_hold_char; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + yyg->yytext_ptr = yy_bp; + yyg->yy_hold_char = *yy_cp; + yyg->yy_c_buf_p = yy_cp; +} + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 363 "wcsutrn.l" + + diff --git a/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.c b/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.c new file mode 100644 index 0000000000000000000000000000000000000000..b0ab4083195f7e4aa7c66642ebb694ec8fd2f2a4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.c @@ -0,0 +1,154 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: getwcstab.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include + +#include + +#include "getwcstab.h" + +/*--------------------------------------------------------------------------*/ + +int fits_read_wcstab( + fitsfile *fptr, + int nwtb, + wtbarr *wtb, + int *status) + +{ + int anynul, colnum, hdunum, iwtb, m, naxis, nostat; + long *naxes = 0, nelem; + wtbarr *wtbp; + + + if (*status) return *status; + + if (fptr == 0) { + return (*status = NULL_INPUT_PTR); + } + + if (nwtb == 0) return 0; + + /* Zero the array pointers. */ + wtbp = wtb; + for (iwtb = 0; iwtb < nwtb; iwtb++, wtbp++) { + *wtbp->arrayp = 0x0; + } + + /* Save HDU number so that we can move back to it later. */ + fits_get_hdu_num(fptr, &hdunum); + + wtbp = wtb; + for (iwtb = 0; iwtb < nwtb; iwtb++, wtbp++) { + /* Move to the required binary table extension. */ + if (fits_movnam_hdu(fptr, BINARY_TBL, (char *)(wtbp->extnam), + wtbp->extver, status)) { + goto cleanup; + } + + /* Locate the table column. */ + if (fits_get_colnum(fptr, CASEINSEN, (char *)(wtbp->ttype), &colnum, + status)) { + goto cleanup; + } + + /* Get the array dimensions and check for consistency. */ + if (wtbp->ndim < 1) { + *status = NEG_AXIS; + goto cleanup; + } + + if (!(naxes = calloc(wtbp->ndim, sizeof(long)))) { + *status = MEMORY_ALLOCATION; + goto cleanup; + } + + if (fits_read_tdim(fptr, colnum, wtbp->ndim, &naxis, naxes, status)) { + goto cleanup; + } + + if (naxis != wtbp->ndim) { + if (wtbp->kind == 'c' && wtbp->ndim == 2) { + /* Allow TDIMn to be omitted for degenerate coordinate arrays. */ + naxis = 2; + naxes[1] = naxes[0]; + naxes[0] = 1; + } else { + *status = BAD_TDIM; + goto cleanup; + } + } + + if (wtbp->kind == 'c') { + /* Coordinate array; calculate the array size. */ + nelem = naxes[0]; + for (m = 0; m < naxis-1; m++) { + *(wtbp->dimlen + m) = naxes[m+1]; + nelem *= naxes[m+1]; + } + } else { + /* Index vector; check length. */ + if ((nelem = naxes[0]) != *(wtbp->dimlen)) { + /* N.B. coordinate array precedes the index vectors. */ + *status = BAD_TDIM; + goto cleanup; + } + } + + free(naxes); + naxes = 0; + + /* Allocate memory for the array. */ + if (!(*wtbp->arrayp = calloc((size_t)nelem, sizeof(double)))) { + *status = MEMORY_ALLOCATION; + goto cleanup; + } + + /* Read the array from the table. */ + if (fits_read_col_dbl(fptr, colnum, wtbp->row, 1L, nelem, 0.0, + *wtbp->arrayp, &anynul, status)) { + goto cleanup; + } + } + +cleanup: + /* Move back to the starting HDU. */ + nostat = 0; + fits_movabs_hdu(fptr, hdunum, 0, &nostat); + + /* Release allocated memory. */ + if (naxes) free(naxes); + if (*status) { + wtbp = wtb; + for (iwtb = 0; iwtb < nwtb; iwtb++, wtbp++) { + if (*wtbp->arrayp) free(*wtbp->arrayp); + } + } + + return *status; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.h b/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.h new file mode 100644 index 0000000000000000000000000000000000000000..bb8641de3d0a4a084460b18285b2826e5ca739f2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/getwcstab.h @@ -0,0 +1,193 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: getwcstab.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* Summary of the getwcstab routines +* --------------------------------- +* fits_read_wcstab(), an implementation of a FITS table reading routine for +* 'TAB' coordinates, is provided for CFITSIO programmers. It has been +* incorporated into CFITSIO as of v3.006 with the definitions in this file, +* getwcstab.h, moved into fitsio.h. +* +* fits_read_wcstab() is not included in the WCSLIB object library but the +* source code is presented here as it may be useful for programmers using an +* older version of CFITSIO than 3.006, or as a programming template for +* non-CFITSIO programmers. +* +* +* fits_read_wcstab() - FITS 'TAB' table reading routine +* ---------------------------------------------------- +* fits_read_wcstab() extracts arrays from a binary table required in +* constructing 'TAB' coordinates. +* +* Given: +* fptr fitsfile * +* Pointer to the file handle returned, for example, by +* the fits_open_file() routine in CFITSIO. +* +* nwtb int Number of arrays to be read from the binary table(s). +* +* Given and returned: +* wtb wtbarr * Address of the first element of an array of wtbarr +* typedefs. This wtbarr typedef is defined to match the +* wtbarr struct defined in WCSLIB. An array of such +* structs returned by the WCSLIB function wcstab() as +* discussed in the notes below. +* +* Returned: +* status int * CFITSIO status value. +* +* Function return value: +* int CFITSIO status value. +* +* Notes: +* In order to maintain WCSLIB and CFITSIO as independent libraries it is not +* permissible for any CFITSIO library code to include WCSLIB header files, +* or vice versa. However, the CFITSIO function fits_read_wcstab() accepts +* an array of wtbarr structs defined in wcs.h within WCSLIB. +* +* The problem therefore is to define the wtbarr struct within fitsio.h +* without including wcs.h, especially noting that wcs.h will often (but not +* always) be included together with fitsio.h in an applications program that +* uses fits_read_wcstab(). +* +* The solution adopted is for WCSLIB to define "struct wtbarr" while +* fitsio.h defines "typedef wtbarr" as an untagged struct with identical +* members. This allows both wcs.h and fitsio.h to define a wtbarr data type +* without conflict by virtue of the fact that structure tags and typedef +* names share different name spaces in C; Appendix A, Sect. A11.1 (p227) of +* the K&R ANSI edition states that: +* +* Identifiers fall into several name spaces that do not interfere with one +* another; the same identifier may be used for different purposes, even in +* the same scope, if the uses are in different name spaces. These classes +* are: objects, functions, typedef names, and enum constants; labels; tags +* of structures, unions, and enumerations; and members of each structure +* or union individually. +* +* Therefore, declarations within WCSLIB look like +* += struct wtbarr *w; +* +* while within CFITSIO they are simply +* += wtbarr *w; +* +* As suggested by the commonality of the names, these are really the same +* aggregate data type. However, in passing a (struct wtbarr *) to +* fits_read_wcstab() a cast to (wtbarr *) is formally required. +* +* When using WCSLIB and CFITSIO together in C++ the situation is complicated +* by the fact that typedefs and structs share the same namespace; C++ +* Annotated Reference Manual, Sect. 7.1.3 (p105). In that case the wtbarr +* struct in wcs.h is renamed by preprocessor macro substitution to wtbarr_s +* to distinguish it from the typedef defined in fitsio.h. However, the +* scope of this macro substitution is limited to wcs.h itself and CFITSIO +* programmer code, whether in C++ or C, should always use the wtbarr +* typedef. +* +* +* wtbarr typedef +* -------------- +* The wtbarr typedef is defined as a struct containing the following members: +* +* int i +* Image axis number. +* +* int m +* Array axis number for index vectors. +* +* int kind +* Character identifying the array type: +* - c: coordinate array, +* - i: index vector. +* +* char extnam[72] +* EXTNAME identifying the binary table extension. +* +* int extver +* EXTVER identifying the binary table extension. +* +* int extlev +* EXTLEV identifying the binary table extension. +* +* char ttype[72] +* TTYPEn identifying the column of the binary table that contains the +* array. +* +* long row +* Table row number. +* +* int ndim +* Expected dimensionality of the array. +* +* int *dimlen +* Address of the first element of an array of int of length ndim into +* which the array axis lengths are to be written. +* +* double **arrayp +* Pointer to an array of double which is to be allocated by the user +* and into which the array is to be written. +* +*===========================================================================*/ + +#ifndef WCSLIB_GETWCSTAB +#define WCSLIB_GETWCSTAB + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct { + int i; /* Image axis number. */ + int m; /* Array axis number for index vectors. */ + int kind; /* Array type, 'c' (coord) or 'i' (index). */ + char extnam[72]; /* EXTNAME of binary table extension. */ + int extver; /* EXTVER of binary table extension. */ + int extlev; /* EXTLEV of binary table extension. */ + char ttype[72]; /* TTYPEn of column containing the array. */ + long row; /* Table row number. */ + int ndim; /* Expected array dimensionality. */ + int *dimlen; /* Where to write the array axis lengths. */ + double **arrayp; /* Where to write the address of the array */ + /* allocated to store the array. */ +} wtbarr; + + +int fits_read_wcstab(fitsfile *fptr, int nwtb, wtbarr *wtb, int *status); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_GETWCSTAB */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/lin.c b/testbed/astropy__astropy/cextern/wcslib/C/lin.c new file mode 100644 index 0000000000000000000000000000000000000000..c220bd1cab136d6c570f87a9a3b220da387de0df --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/lin.c @@ -0,0 +1,1321 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: lin.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsprintf.h" +#include "lin.h" +#include "dis.h" + +const int LINSET = 137; + +/* Map status return value to message. */ +const char *lin_errmsg[] = { + "Success", + "Null linprm pointer passed", + "Memory allocation failed", + "PCi_ja matrix is singular", + "Failed to initialize distortion functions", + "Distort error", + "De-distort error"}; + +/* Map error returns for lower-level routines. */ +const int lin_diserr[] = { + LINERR_SUCCESS, /* 0: DISERR_SUCCESS */ + LINERR_NULL_POINTER, /* 1: DISERR_NULL_POINTER */ + LINERR_MEMORY, /* 2: DISERR_MEMORY */ + LINERR_DISTORT_INIT, /* 3: DISERR_BAD_PARAM */ + LINERR_DISTORT, /* 4: DISERR_DISTORT */ + LINERR_DEDISTORT /* 5: DISERR_DEDISTORT */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define LIN_ERRMSG(status) WCSERR_SET(status), lin_errmsg[status] + +/*--------------------------------------------------------------------------*/ + +int linini(int alloc, int naxis, struct linprm *lin) + +{ + return lininit(alloc, naxis, lin, -1); +} + +/*--------------------------------------------------------------------------*/ + +int lininit(int alloc, int naxis, struct linprm *lin, int ndpmax) + +{ + static const char *function = "lininit"; + + int i, j; + double *pc; + struct wcserr **err; + + if (lin == 0x0) return LINERR_NULL_POINTER; + + /* Initialize error message handling. */ + err = &(lin->err); + if (lin->flag != -1) { + if (lin->err) free(lin->err); + } + lin->err = 0x0; + + + /* Initialize memory management. */ + if (lin->flag == -1 || lin->m_flag != LINSET) { + if (lin->flag == -1) { + lin->dispre = 0x0; + lin->disseq = 0x0; + lin->tmpcrd = 0x0; + } + + lin->m_flag = 0; + lin->m_naxis = 0; + lin->m_crpix = 0x0; + lin->m_pc = 0x0; + lin->m_cdelt = 0x0; + lin->m_dispre = 0x0; + lin->m_disseq = 0x0; + } + + if (naxis < 0) { + return wcserr_set(WCSERR_SET(LINERR_MEMORY), + "naxis must not be negative (got %d)", naxis); + } + + + /* Allocate memory for arrays if required. */ + if (alloc || + lin->crpix == 0x0 || + lin->pc == 0x0 || + lin->cdelt == 0x0) { + + /* Was sufficient allocated previously? */ + if (lin->m_flag == LINSET && lin->m_naxis < naxis) { + /* No, free it. */ + linfree(lin); + } + + if (alloc || lin->crpix == 0x0) { + if (lin->m_crpix) { + /* In case the caller fiddled with it. */ + lin->crpix = lin->m_crpix; + + } else { + if ((lin->crpix = calloc(naxis, sizeof(double))) == 0x0) { + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lin->m_flag = LINSET; + lin->m_naxis = naxis; + lin->m_crpix = lin->crpix; + } + } + + if (alloc || lin->pc == 0x0) { + if (lin->m_pc) { + /* In case the caller fiddled with it. */ + lin->pc = lin->m_pc; + + } else { + if ((lin->pc = calloc(naxis*naxis, sizeof(double))) == 0x0) { + linfree(lin); + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lin->m_flag = LINSET; + lin->m_naxis = naxis; + lin->m_pc = lin->pc; + } + } + + if (alloc || lin->cdelt == 0x0) { + if (lin->m_cdelt) { + /* In case the caller fiddled with it. */ + lin->cdelt = lin->m_cdelt; + + } else { + if ((lin->cdelt = calloc(naxis, sizeof(double))) == 0x0) { + linfree(lin); + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lin->m_flag = LINSET; + lin->m_naxis = naxis; + lin->m_cdelt = lin->cdelt; + } + } + } + + + /* Reinitialize disprm structs if we are managing them. */ + if (lin->m_dispre) { + disinit(1, naxis, lin->dispre, ndpmax); + } + + if (lin->m_disseq) { + disinit(1, naxis, lin->disseq, ndpmax); + } + + + /* Free memory allocated by linset(). */ + if (lin->flag == LINSET) { + if (lin->piximg) free(lin->piximg); + if (lin->imgpix) free(lin->imgpix); + if (lin->tmpcrd) free(lin->tmpcrd); + } + + lin->piximg = 0x0; + lin->imgpix = 0x0; + lin->i_naxis = 0; + lin->unity = 0; + lin->affine = 0; + lin->simple = 0; + lin->tmpcrd = 0x0; + + + lin->flag = 0; + lin->naxis = naxis; + + + /* CRPIXja defaults to 0.0. */ + for (j = 0; j < naxis; j++) { + lin->crpix[j] = 0.0; + } + + /* PCi_ja defaults to the unit matrix. */ + pc = lin->pc; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + if (j == i) { + *pc = 1.0; + } else { + *pc = 0.0; + } + pc++; + } + } + + /* CDELTia defaults to 1.0. */ + for (i = 0; i < naxis; i++) { + lin->cdelt[i] = 1.0; + } + + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int lindis(int sequence, struct linprm *lin, struct disprm *dis) + +{ + return lindist(sequence, lin, dis, -1); +} + +/*--------------------------------------------------------------------------*/ + +int lindist(int sequence, struct linprm *lin, struct disprm *dis, int ndpmax) + +{ + static const char *function = "lindist"; + + int status; + struct wcserr **err; + + if (lin == 0x0) return LINERR_NULL_POINTER; + err = &(lin->err); + + if (sequence == 1) { + if (lin->m_dispre) { + disfree(lin->m_dispre); + free(lin->m_dispre); + } + + lin->dispre = dis; + lin->m_flag = LINSET; + lin->m_dispre = dis; + + } else if (sequence == 2) { + if (lin->m_disseq) { + disfree(lin->m_disseq); + free(lin->m_disseq); + } + + lin->disseq = dis; + lin->m_flag = LINSET; + lin->m_disseq = dis; + + } else { + return wcserr_set(WCSERR_SET(LINERR_DISTORT_INIT), + "Invalid sequence (%d)", sequence); + } + + if (dis) { + if ((status = disinit(1, lin->naxis, dis, ndpmax))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int lincpy(int alloc, const struct linprm *linsrc, struct linprm *lindst) + +{ + static const char *function = "lincpy"; + + int i, j, naxis, status; + const double *srcp; + double *dstp; + struct wcserr **err; + + if (linsrc == 0x0) return LINERR_NULL_POINTER; + if (lindst == 0x0) return LINERR_NULL_POINTER; + err = &(lindst->err); + + naxis = linsrc->naxis; + if (naxis < 1) { + return wcserr_set(WCSERR_SET(LINERR_MEMORY), + "naxis must be positive (got %d)", naxis); + } + + if ((status = lininit(alloc, naxis, lindst, 0))) { + return status; + } + + srcp = linsrc->crpix; + dstp = lindst->crpix; + for (j = 0; j < naxis; j++) { + *(dstp++) = *(srcp++); + } + + srcp = linsrc->pc; + dstp = lindst->pc; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + *(dstp++) = *(srcp++); + } + } + + srcp = linsrc->cdelt; + dstp = lindst->cdelt; + for (i = 0; i < naxis; i++) { + *(dstp++) = *(srcp++); + } + + if (linsrc->dispre) { + if (!lindst->dispre) { + if ((lindst->dispre = calloc(1, sizeof(struct disprm))) == 0x0) { + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lindst->m_dispre = lindst->dispre; + } + + if ((status = discpy(alloc, linsrc->dispre, lindst->dispre))) { + status = wcserr_set(LIN_ERRMSG(lin_diserr[status])); + goto cleanup; + } + } + + if (linsrc->disseq) { + if (!lindst->disseq) { + if ((lindst->disseq = calloc(1, sizeof(struct disprm))) == 0x0) { + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lindst->m_disseq = lindst->disseq; + } + + if ((status = discpy(alloc, linsrc->disseq, lindst->disseq))) { + status = wcserr_set(LIN_ERRMSG(lin_diserr[status])); + goto cleanup; + } + } + +cleanup: + if (status) { + if (lindst->m_dispre) { + disfree(lindst->m_dispre); + free(lindst->m_dispre); + lindst->m_dispre = 0x0; + lindst->dispre = 0x0; + } + + if (lindst->m_disseq) { + disfree(lindst->m_disseq); + free(lindst->m_disseq); + lindst->m_disseq = 0x0; + lindst->disseq = 0x0; + } + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int linfree(struct linprm *lin) + +{ + if (lin == 0x0) return LINERR_NULL_POINTER; + + if (lin->flag != -1) { + /* Optionally allocated by lininit() for given parameters. */ + if (lin->m_flag == LINSET) { + if (lin->crpix == lin->m_crpix) lin->crpix = 0x0; + if (lin->pc == lin->m_pc) lin->pc = 0x0; + if (lin->cdelt == lin->m_cdelt) lin->cdelt = 0x0; + if (lin->dispre == lin->m_dispre) lin->dispre = 0x0; + if (lin->disseq == lin->m_disseq) lin->disseq = 0x0; + + if (lin->m_crpix) free(lin->m_crpix); + if (lin->m_pc) free(lin->m_pc); + if (lin->m_cdelt) free(lin->m_cdelt); + + if (lin->m_dispre) { + disfree(lin->m_dispre); + free(lin->m_dispre); + } + + if (lin->m_disseq) { + disfree(lin->m_disseq); + free(lin->m_disseq); + } + } + + /* Allocated unconditionally by linset(). */ + if (lin->piximg) free(lin->piximg); + if (lin->imgpix) free(lin->imgpix); + if (lin->tmpcrd) free(lin->tmpcrd); + + if (lin->err) free(lin->err); + } + + + lin->m_flag = 0; + lin->m_naxis = 0; + lin->m_crpix = 0x0; + lin->m_pc = 0x0; + lin->m_cdelt = 0x0; + lin->m_dispre = 0x0; + lin->m_disseq = 0x0; + + lin->piximg = 0x0; + lin->imgpix = 0x0; + lin->i_naxis = 0; + + lin->tmpcrd = 0x0; + + lin->err = 0x0; + + lin->flag = 0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linprt(const struct linprm *lin) + +{ + int i, j, k; + + if (lin == 0x0) return LINERR_NULL_POINTER; + + if (lin->flag != LINSET) { + wcsprintf("The linprm struct is UNINITIALIZED.\n"); + return 0; + } + wcsprintf(" flag: %d\n", lin->flag); + + /* Parameters supplied. */ + wcsprintf(" naxis: %d\n", lin->naxis); + + WCSPRINTF_PTR(" crpix: ", lin->crpix, "\n"); + wcsprintf(" "); + for (j = 0; j < lin->naxis; j++) { + wcsprintf(" %#- 11.5g", lin->crpix[j]); + } + wcsprintf("\n"); + + k = 0; + WCSPRINTF_PTR(" pc: ", lin->pc, "\n"); + for (i = 0; i < lin->naxis; i++) { + wcsprintf(" pc[%d][]:", i); + for (j = 0; j < lin->naxis; j++) { + wcsprintf(" %#- 11.5g", lin->pc[k++]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" cdelt: ", lin->cdelt, "\n"); + wcsprintf(" "); + for (i = 0; i < lin->naxis; i++) { + wcsprintf(" %#- 11.5g", lin->cdelt[i]); + } + wcsprintf("\n"); + + WCSPRINTF_PTR(" dispre: ", lin->dispre, ""); + if (lin->dispre != 0x0) wcsprintf(" (see below)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" disseq: ", lin->disseq, ""); + if (lin->disseq != 0x0) wcsprintf(" (see below)"); + wcsprintf("\n"); + + /* Derived values. */ + if (lin->piximg == 0x0) { + wcsprintf(" piximg: (nil)\n"); + } else { + k = 0; + for (i = 0; i < lin->naxis; i++) { + wcsprintf("piximg[%d][]:", i); + for (j = 0; j < lin->naxis; j++) { + wcsprintf(" %#- 11.5g", lin->piximg[k++]); + } + wcsprintf("\n"); + } + } + + if (lin->imgpix == 0x0) { + wcsprintf(" imgpix: (nil)\n"); + } else { + k = 0; + for (i = 0; i < lin->naxis; i++) { + wcsprintf("imgpix[%d][]:", i); + for (j = 0; j < lin->naxis; j++) { + wcsprintf(" %#- 11.5g", lin->imgpix[k++]); + } + wcsprintf("\n"); + } + } + + wcsprintf(" i_naxis: %d\n", lin->i_naxis); + wcsprintf(" unity: %d\n", lin->unity); + wcsprintf(" affine: %d\n", lin->affine); + wcsprintf(" simple: %d\n", lin->simple); + + /* Error handling. */ + WCSPRINTF_PTR(" err: ", lin->err, "\n"); + if (lin->err) { + wcserr_prt(lin->err, " "); + } + + /* Work arrays. */ + WCSPRINTF_PTR(" tmpcrd: ", lin->tmpcrd, "\n"); + + /* Memory management. */ + wcsprintf(" m_flag: %d\n", lin->m_flag); + wcsprintf(" m_naxis: %d\n", lin->m_naxis); + WCSPRINTF_PTR(" m_crpix: ", lin->m_crpix, ""); + if (lin->m_crpix == lin->crpix) wcsprintf(" (= crpix)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_pc: ", lin->m_pc, ""); + if (lin->m_pc == lin->pc) wcsprintf(" (= pc)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cdelt: ", lin->m_cdelt, ""); + if (lin->m_cdelt == lin->cdelt) wcsprintf(" (= cdelt)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_dispre: ", lin->m_dispre, ""); + if (lin->dispre && lin->m_dispre == lin->dispre) wcsprintf(" (= dispre)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_disseq: ", lin->m_disseq, ""); + if (lin->disseq && lin->m_disseq == lin->disseq) wcsprintf(" (= disseq)"); + wcsprintf("\n"); + + /* Distortion parameters (from above). */ + if (lin->dispre) { + wcsprintf("\n"); + wcsprintf("dispre.*\n"); + disprt(lin->dispre); + } + + if (lin->disseq) { + wcsprintf("\n"); + wcsprintf("disseq.*\n"); + disprt(lin->disseq); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linperr(const struct linprm *lin, const char *prefix) + +{ + if (lin == 0x0) return LINERR_NULL_POINTER; + + if (lin->err && wcserr_prt(lin->err, prefix) == 0) { + if (lin->dispre) wcserr_prt(lin->dispre->err, prefix); + if (lin->disseq) wcserr_prt(lin->disseq->err, prefix); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linset(struct linprm *lin) + +{ + static const char *function = "linset"; + + int i, j, naxis, status; + double *pc, *piximg; + struct wcserr **err; + + if (lin == 0x0) return LINERR_NULL_POINTER; + err = &(lin->err); + + naxis = lin->naxis; + + /* Check for a unit matrix. */ + lin->unity = 1; + pc = lin->pc; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + if (j == i) { + if (*(pc++) != 1.0) { + lin->unity = 0; + break; + } + } else { + if (*(pc++) != 0.0) { + lin->unity = 0; + break; + } + } + } + } + + + if (lin->unity) { + if (lin->flag == LINSET) { + /* Free memory that may have been allocated previously. */ + if (lin->piximg) free(lin->piximg); + if (lin->imgpix) free(lin->imgpix); + } + + lin->piximg = 0x0; + lin->imgpix = 0x0; + lin->i_naxis = 0; + + /* Check cdelt. */ + for (i = 0; i < naxis; i++) { + if (lin->cdelt[i] == 0.0) { + return wcserr_set(LIN_ERRMSG(LINERR_SINGULAR_MTX)); + } + } + + } else { + if (lin->flag != LINSET || lin->i_naxis < naxis) { + if (lin->flag == LINSET) { + /* Free memory that may have been allocated previously. */ + if (lin->piximg) free(lin->piximg); + if (lin->imgpix) free(lin->imgpix); + } + + /* Allocate memory for internal arrays. */ + if ((lin->piximg = calloc(naxis*naxis, sizeof(double))) == 0x0) { + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + if ((lin->imgpix = calloc(naxis*naxis, sizeof(double))) == 0x0) { + free(lin->piximg); + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + lin->i_naxis = naxis; + } + + /* Compute the pixel-to-image transformation matrix. */ + pc = lin->pc; + piximg = lin->piximg; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + if (lin->disseq == 0x0) { + /* No sequent distortions, incorporate cdelt into piximg. */ + *(piximg++) = lin->cdelt[i] * (*(pc++)); + } else { + *(piximg++) = *(pc++); + } + } + } + + /* Compute the image-to-pixel transformation matrix. */ + if ((status = matinv(naxis, lin->piximg, lin->imgpix))) { + return wcserr_set(LIN_ERRMSG(status)); + } + } + + + /* Set up the distortion functions. */ + lin->affine = 1; + if (lin->dispre) { + if ((status = disset(lin->dispre))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + + lin->affine = 0; + } + + if (lin->disseq) { + if ((status = disset(lin->disseq))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + + lin->affine = 0; + } + + lin->simple = lin->unity && lin->affine; + + + /* Create work arrays. */ + if (lin->tmpcrd) free(lin->tmpcrd); + if ((lin->tmpcrd = calloc(naxis, sizeof(double))) == 0x0) { + linfree(lin); + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + + lin->flag = LINSET; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linp2x( + struct linprm *lin, + int ncoord, + int nelem, + const double pixcrd[], + double imgcrd[]) + +{ + static const char *function = "linp2x"; + + int i, j, k, n, ndbl, nelemn, status; + double temp; + register const double *pix; + register double *img, *piximg, *tmp; + struct wcserr **err; + + + /* Initialize. */ + if (lin == 0x0) return LINERR_NULL_POINTER; + err = &(lin->err); + + if (lin->flag != LINSET) { + if ((status = linset(lin))) return status; + } + + n = lin->naxis; + + + /* Convert pixel coordinates to intermediate world coordinates. */ + pix = pixcrd; + img = imgcrd; + + if (lin->simple) { + /* Handle the simplest and most common case with maximum efficiency. */ + nelemn = nelem - n; + for (k = 0; k < ncoord; k++) { + for (i = 0; i < n; i++) { + *(img++) = lin->cdelt[i] * (*(pix++) - lin->crpix[i]); + } + + pix += nelemn; + img += nelemn; + } + + } else if (lin->affine) { + /* No distortions. */ + ndbl = n * sizeof(double); + nelemn = nelem - n; + for (k = 0; k < ncoord; k++) { + memset(img, 0, ndbl); + + for (j = 0; j < n; j++) { + /* cdelt will have been incorporated into piximg. */ + piximg = lin->piximg + j; + + /* Column-wise multiplication allows this to be cached. */ + temp = *(pix++) - lin->crpix[j]; + for (i = 0; i < n; i++, piximg += n) { + img[i] += *piximg * temp; + } + } + + pix += nelemn; + img += nelem; + } + + } else { + /* Distortions are present. */ + ndbl = n * sizeof(double); + tmp = lin->tmpcrd; + + for (k = 0; k < ncoord; k++) { + if (lin->dispre) { + if ((status = disp2x(lin->dispre, pix, tmp))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + } else { + memcpy(tmp, pix, ndbl); + } + + if (lin->unity) { + for (i = 0; i < n; i++) { + img[i] = tmp[i] - lin->crpix[i]; + } + + } else { + for (j = 0; j < n; j++) { + tmp[j] -= lin->crpix[j]; + } + + piximg = lin->piximg; + for (i = 0; i < n; i++) { + img[i] = 0.0; + for (j = 0; j < n; j++) { + img[i] += *(piximg++) * tmp[j]; + } + } + } + + if (lin->disseq) { + if ((status = disp2x(lin->disseq, img, tmp))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + + /* With sequent distortions, cdelt is not incorporated into piximg. */ + for (i = 0; i < n; i++) { + img[i] = lin->cdelt[i] * tmp[i]; + } + + } else if (lin->unity) { + /* ...nor if the matrix is unity. */ + for (i = 0; i < n; i++) { + img[i] *= lin->cdelt[i]; + } + } + + pix += nelem; + img += nelem; + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linx2p( + struct linprm *lin, + int ncoord, + int nelem, + const double imgcrd[], + double pixcrd[]) + +{ + static const char *function = "linx2p"; + + int i, j, k, n, ndbl, nelemn, status; + register const double *img; + register double *imgpix, *pix, *tmp; + struct wcserr **err; + + + /* Initialize. */ + if (lin == 0x0) return LINERR_NULL_POINTER; + err = &(lin->err); + + if (lin->flag != LINSET) { + if ((status = linset(lin))) return status; + } + + n = lin->naxis; + + + /* Convert intermediate world coordinates to pixel coordinates. */ + img = imgcrd; + pix = pixcrd; + + if (lin->simple) { + /* Handle the simplest and most common case with maximum efficiency. */ + nelemn = nelem - n; + for (k = 0; k < ncoord; k++) { + for (j = 0; j < n; j++) { + *(pix++) = (*(img++) / lin->cdelt[j]) + lin->crpix[j]; + } + + img += nelemn; + pix += nelemn; + } + + } else if (lin->affine) { + /* No distortions. */ + nelemn = nelem - n; + for (k = 0; k < ncoord; k++) { + /* cdelt will have been incorporated into imgpix. */ + imgpix = lin->imgpix; + + for (j = 0; j < n; j++) { + *pix = 0.0; + for (i = 0; i < n; i++) { + *pix += *imgpix * img[i]; + imgpix++; + } + + *(pix++) += lin->crpix[j]; + } + + img += nelem; + pix += nelemn; + } + + } else { + /* Distortions are present. */ + ndbl = n * sizeof(double); + tmp = lin->tmpcrd; + + for (k = 0; k < ncoord; k++) { + if (lin->disseq) { + /* With sequent distortions, cdelt is not incorporated into imgpix. */ + for (i = 0; i < n; i++) { + tmp[i] = img[i] / lin->cdelt[i]; + } + + if ((status = disx2p(lin->disseq, tmp, pix))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + + memcpy(tmp, pix, ndbl); + + } else if (lin->unity) { + /* ...nor if the matrix is unity. */ + for (i = 0; i < n; i++) { + tmp[i] = img[i] / lin->cdelt[i]; + } + + } else { + /* cdelt will have been incorporated into imgpix. */ + memcpy(tmp, img, ndbl); + } + + if (lin->unity) { + for (j = 0; j < n; j++) { + pix[j] = tmp[j] + lin->crpix[j]; + } + + } else { + imgpix = lin->imgpix; + for (j = 0; j < n; j++) { + pix[j] = lin->crpix[j]; + for (i = 0; i < n; i++) { + pix[j] += *(imgpix++) * tmp[i]; + } + } + } + + if (lin->dispre) { + memcpy(tmp, pix, ndbl); + + if ((status = disx2p(lin->dispre, tmp, pix))) { + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + } + + img += nelem; + pix += nelem; + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int linwarp( + struct linprm *lin, + const double pixblc[], + const double pixtrc[], + const double pixsamp[], + int *nsamp, + double maxdis[], + double *maxtot, + double avgdis[], + double *avgtot, + double rmsdis[], + double *rmstot) + +{ + static const char *function = "linwarp"; + + int carry, i, j, naxis, ncoord, status = 0; + double dpix, dpx2, dssq, *img, *pix0, *pix0p, *pix1, *pix1p, *pixend, + *pixinc, pixspan, *ssqdis, ssqtot, *sumdis, sumtot, totdis; + struct linprm affine; + struct wcserr **err; + + + /* Initialize. */ + if (lin == 0x0) return LINERR_NULL_POINTER; + err = &(lin->err); + + naxis = lin->naxis; + + if (nsamp) *nsamp = 0; + for (j = 0; j < naxis; j++) { + if (maxdis) maxdis[j] = 0.0; + if (avgdis) avgdis[j] = 0.0; + if (rmsdis) rmsdis[j] = 0.0; + } + if (maxtot) *maxtot = 0.0; + if (avgtot) *avgtot = 0.0; + if (rmstot) *rmstot = 0.0; + + /* Quick return if no distortions. */ + if (lin->affine) return 0; + + /* It's easier if there are no sequent distortions! */ + if (lin->disseq == 0x0) { + status = diswarp(lin->dispre, pixblc, pixtrc, pixsamp, nsamp, + maxdis, maxtot, avgdis, avgtot, rmsdis, rmstot); + return wcserr_set(LIN_ERRMSG(lin_diserr[status])); + } + + /* Make a reference copy of lin without distortions. */ + affine.flag = -1; + if ((status = (lincpy(1, lin, &affine) || + lindist(1, &affine, 0x0, 0) || + lindist(2, &affine, 0x0, 0) || + linset(&affine)))) { + return wcserr_set(LIN_ERRMSG(status)); + } + + /* Work out increments on each axis. */ + pixinc = lin->tmpcrd; + ncoord = 0; + for (j = 0; j < naxis; j++) { + pixspan = pixtrc[j] - (pixblc ? pixblc[j] : 1.0); + + if (pixsamp == 0x0) { + pixinc[j] = 1.0; + } else if (pixsamp[j] == 0.0) { + pixinc[j] = 1.0; + } else if (pixsamp[j] > 0.0) { + pixinc[j] = pixsamp[j]; + } else if (pixsamp[j] > -1.5) { + pixinc[j] = 2.0*pixspan; + } else { + pixinc[j] = pixspan / ((int)(-pixsamp[j] - 0.5)); + } + + if (j == 0) { + /* Number of samples on axis 1. */ + ncoord = 1 + (int)((pixspan/pixinc[0]) + 0.5); + } + } + + /* Get memory for processing the image row by row. */ + if ((pix0 = calloc((3*ncoord+4)*naxis, sizeof(double))) == 0x0) { + return wcserr_set(LIN_ERRMSG(LINERR_MEMORY)); + } + + img = pix0 + naxis*ncoord; + pix1 = img + naxis*ncoord; + pixinc = pix1 + naxis*ncoord; + pixend = pixinc + naxis; + sumdis = pixend + naxis; + ssqdis = sumdis + naxis; + + + /* Copy tmpcrd since linp2x() will overwrite it. */ + memcpy(pixinc, lin->tmpcrd, naxis*sizeof(double)); + + /* Set up the array of pixel coordinates. */ + for (j = 0; j < naxis; j++) { + pix0[j] = pixblc ? pixblc[j] : 1.0; + pixend[j] = pixtrc[j] + 0.5*pixinc[j]; + } + + pix0p = pix0 + naxis; + for (i = 1; i < ncoord; i++) { + *(pix0p++) = pix0[0] + i*pixinc[0]; + + for (j = 1; j < naxis; j++) { + *(pix0p++) = pix0[j]; + } + } + + /* Initialize accumulators. */ + for (j = 0; j < naxis; j++) { + sumdis[j] = 0.0; + ssqdis[j] = 0.0; + } + sumtot = 0.0; + ssqtot = 0.0; + + + /* Loop over N dimensions. */ + carry = 0; + while (carry == 0) { + if ((status = linp2x(lin, ncoord, naxis, pix0, img))) { + /* (Preserve the error message set by linp2x().) */ + goto cleanup; + } + + if ((status = linx2p(&affine, ncoord, naxis, img, pix1))) { + /* (Preserve the error message set by linx2p().) */ + goto cleanup; + } + + /* Accumulate statistics. */ + pix0p = pix0; + pix1p = pix1; + for (i = 0; i < ncoord; i++) { + (*nsamp)++; + + dssq = 0.0; + for (j = 0; j < naxis; j++) { + dpix = *(pix1p++) - *(pix0p++); + dpx2 = dpix*dpix; + + sumdis[j] += dpix; + ssqdis[j] += dpx2; + + if (maxdis && (dpix = fabs(dpix)) > maxdis[j]) maxdis[j] = dpix; + + dssq += dpx2; + } + + totdis = sqrt(dssq); + sumtot += totdis; + ssqtot += totdis*totdis; + + if (maxtot && *maxtot < totdis) *maxtot = totdis; + } + + /* Next array of pixel coordinates. */ + for (j = 1; j < naxis; j++) { + pix0[j] += pixinc[j]; + if ((carry = (pix0[j] > pixend[j]))) { + pix0[j] = pixblc ? pixblc[j] : 1.0; + } + + pix0p = pix0 + naxis + j; + for (i = 1; i < ncoord; i++) { + *pix0p = pix0[j]; + pix0p += naxis; + } + + if (carry == 0) break; + } + } + + + /* Compute the means and RMSs. */ + for (j = 0; j < naxis; j++) { + ssqdis[j] /= *nsamp; + sumdis[j] /= *nsamp; + if (avgdis) avgdis[j] = sumdis[j]; + if (rmsdis) rmsdis[j] = sqrt(ssqdis[j] - sumdis[j]*sumdis[j]); + } + + ssqtot /= *nsamp; + sumtot /= *nsamp; + if (avgtot) *avgtot = sumtot; + if (rmstot) *rmstot = sqrt(ssqtot - sumtot*sumtot); + + +cleanup: + linfree(&affine); + free(pix0); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int matinv(int n, const double mat[], double inv[]) + +{ + register int i, ij, ik, j, k, kj, pj; + int itemp, *mxl, *lxm, pivot; + double colmax, *lu, *rowmax, dtemp; + + + /* Allocate memory for internal arrays. */ + if ((mxl = calloc(n, sizeof(int))) == 0x0) { + return LINERR_MEMORY; + } + if ((lxm = calloc(n, sizeof(int))) == 0x0) { + free(mxl); + return LINERR_MEMORY; + } + + if ((rowmax = calloc(n, sizeof(double))) == 0x0) { + free(mxl); + free(lxm); + return LINERR_MEMORY; + } + + if ((lu = calloc(n*n, sizeof(double))) == 0x0) { + free(mxl); + free(lxm); + free(rowmax); + return LINERR_MEMORY; + } + + + /* Initialize arrays. */ + for (i = 0, ij = 0; i < n; i++) { + /* Vector that records row interchanges. */ + mxl[i] = i; + + rowmax[i] = 0.0; + + for (j = 0; j < n; j++, ij++) { + dtemp = fabs(mat[ij]); + if (dtemp > rowmax[i]) rowmax[i] = dtemp; + + lu[ij] = mat[ij]; + } + + /* A row of zeroes indicates a singular matrix. */ + if (rowmax[i] == 0.0) { + free(mxl); + free(lxm); + free(rowmax); + free(lu); + return LINERR_SINGULAR_MTX; + } + } + + + /* Form the LU triangular factorization using scaled partial pivoting. */ + for (k = 0; k < n; k++) { + /* Decide whether to pivot. */ + colmax = fabs(lu[k*n+k]) / rowmax[k]; + pivot = k; + + for (i = k+1; i < n; i++) { + ik = i*n + k; + dtemp = fabs(lu[ik]) / rowmax[i]; + if (dtemp > colmax) { + colmax = dtemp; + pivot = i; + } + } + + if (pivot > k) { + /* We must pivot, interchange the rows of the design matrix. */ + for (j = 0, pj = pivot*n, kj = k*n; j < n; j++, pj++, kj++) { + dtemp = lu[pj]; + lu[pj] = lu[kj]; + lu[kj] = dtemp; + } + + /* Amend the vector of row maxima. */ + dtemp = rowmax[pivot]; + rowmax[pivot] = rowmax[k]; + rowmax[k] = dtemp; + + /* Record the interchange for later use. */ + itemp = mxl[pivot]; + mxl[pivot] = mxl[k]; + mxl[k] = itemp; + } + + /* Gaussian elimination. */ + for (i = k+1; i < n; i++) { + ik = i*n + k; + + /* Nothing to do if lu[ik] is zero. */ + if (lu[ik] != 0.0) { + /* Save the scaling factor. */ + lu[ik] /= lu[k*n+k]; + + /* Subtract rows. */ + for (j = k+1; j < n; j++) { + lu[i*n+j] -= lu[ik]*lu[k*n+j]; + } + } + } + } + + + /* mxl[i] records which row of mat corresponds to row i of lu. */ + /* lxm[i] records which row of lu corresponds to row i of mat. */ + for (i = 0; i < n; i++) { + lxm[mxl[i]] = i; + } + + + /* Determine the inverse matrix. */ + for (i = 0, ij = 0; i < n; i++) { + for (j = 0; j < n; j++, ij++) { + inv[ij] = 0.0; + } + } + + for (k = 0; k < n; k++) { + inv[lxm[k]*n+k] = 1.0; + + /* Forward substitution. */ + for (i = lxm[k]+1; i < n; i++) { + for (j = lxm[k]; j < i; j++) { + inv[i*n+k] -= lu[i*n+j]*inv[j*n+k]; + } + } + + /* Backward substitution. */ + for (i = n-1; i >= 0; i--) { + for (j = i+1; j < n; j++) { + inv[i*n+k] -= lu[i*n+j]*inv[j*n+k]; + } + inv[i*n+k] /= lu[i*n+i]; + } + } + + free(mxl); + free(lxm); + free(rowmax); + free(lu); + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/lin.h b/testbed/astropy__astropy/cextern/wcslib/C/lin.h new file mode 100644 index 0000000000000000000000000000000000000000..61e119736e525abc9857cc82fce51b5c3a51c165 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/lin.h @@ -0,0 +1,717 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: lin.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the lin routines +* --------------------------- +* Routines in this suite apply the linear transformation defined by the FITS +* World Coordinate System (WCS) standard, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) +* +* These routines are based on the linprm struct which contains all information +* needed for the computations. The struct contains some members that must be +* set by the user, and others that are maintained by these routines, somewhat +* like a C++ class but with no encapsulation. +* +* Six routines, linini(), lininit(), lindis(), lindist() lincpy(), and +* linfree() are provided to manage the linprm struct, and another, linprt(), +* prints its contents. +* +* linperr() prints the error message(s) (if any) stored in a linprm struct, +* and the disprm structs that it may contain. +* +* A setup routine, linset(), computes intermediate values in the linprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by linset() but need not be called explicitly - refer to +* the explanation of linprm::flag. +* +* linp2x() and linx2p() implement the WCS linear transformations. +* +* An auxiliary routine, linwarp(), computes various measures of the distortion +* over a specified range of pixel coordinates. +* +* An auxiliary matrix inversion routine, matinv(), is included. It uses +* LU-triangular factorization with scaled partial pivoting. +* +* +* linini() - Default constructor for the linprm struct +* ---------------------------------------------------- +* linini() is a thin wrapper on lininit(). It invokes it with ndpmax set +* to -1 which causes it to use the value of the global variable NDPMAX. It +* is thereby potentially thread-unsafe if NDPMAX is altered dynamically via +* disndp(). Use lininit() for a thread-safe alternative in this case. +* +* +* lininit() - Default constructor for the linprm struct +* ----------------------------------------------------- +* lininit() allocates memory for arrays in a linprm struct and sets all +* members of the struct to default values. +* +* PLEASE NOTE: every linprm struct must be initialized by lininit(), possibly +* repeatedly. On the first invokation, and only the first invokation, +* linprm::flag must be set to -1 to initialize memory management, regardless +* of whether lininit() will actually be used to allocate memory. +* +* Given: +* alloc int If true, allocate memory unconditionally for arrays in +* the linprm struct. +* +* If false, it is assumed that pointers to these arrays +* have been set by the user except if they are null +* pointers in which case memory will be allocated for +* them regardless. (In other words, setting alloc true +* saves having to initalize these pointers to zero.) +* +* naxis int The number of world coordinate axes, used to determine +* array sizes. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters. Note that, in order +* to initialize memory management linprm::flag should be +* set to -1 when lin is initialized for the first time +* (memory leaks may result if it had already been +* initialized). +* +* Given: +* ndpmax int The number of DPja or DQia keywords to allocate space +* for. If set to -1, the value of the global variable +* NDPMAX will be used. This is potentially +* thread-unsafe if disndp() is being used dynamically to +* alter its value. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* linprm::err if enabled, see wcserr_enable(). +* +* +* lindis() - Assign a distortion to a linprm struct +* ------------------------------------------------- +* lindis() is a thin wrapper on lindist(). It invokes it with ndpmax set +* to -1 which causes the value of the global variable NDPMAX to be used (by +* disinit()). It is thereby potentially thread-unsafe if NDPMAX is altered +* dynamically via disndp(). Use lindist() for a thread-safe alternative in +* this case. +* +* +* lindist() - Assign a distortion to a linprm struct +* -------------------------------------------------- +* lindist() may be used to assign the address of a disprm struct to +* linprm::dispre or linprm::disseq. The linprm struct must already have been +* initialized by lininit(). +* +* The disprm struct must have been allocated from the heap (e.g. using +* malloc(), calloc(), etc.). lindist() will immediately initialize it via a +* call to disini() using the value of linprm::naxis. Subsequently, it will be +* reinitialized by calls to lininit(), and freed by linfree(), neither of +* which would happen if the disprm struct was assigned directly. +* +* If the disprm struct had previously been assigned via lindist(), it will be +* freed before reassignment. It is also permissable for a null disprm pointer +* to be assigned to disable the distortion correction. +* +* Given: +* sequence int Is it a prior or sequent distortion? +* 1: Prior, the assignment is to linprm::dispre. +* 2: Sequent, the assignment is to linprm::disseq. +* +* Anything else is an error. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters. +* +* dis struct disprm* +* Distortion function parameters. +* +* Given: +* ndpmax int The number of DPja or DQia keywords to allocate space +* for. If set to -1, the value of the global variable +* NDPMAX will be used. This is potentially +* thread-unsafe if disndp() is being used dynamically to +* alter its value. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 4: Invalid sequence. +* +* +* lincpy() - Copy routine for the linprm struct +* --------------------------------------------- +* lincpy() does a deep copy of one linprm struct to another, using lininit() +* to allocate memory for its arrays if required. Only the "information to be +* provided" part of the struct is copied; a call to linset() is required to +* initialize the remainder. +* +* Given: +* alloc int If true, allocate memory for the crpix, pc, and cdelt +* arrays in the destination. Otherwise, it is assumed +* that pointers to these arrays have been set by the +* user except if they are null pointers in which case +* memory will be allocated for them regardless. +* +* linsrc const struct linprm* +* Struct to copy from. +* +* Given and returned: +* lindst struct linprm* +* Struct to copy to. linprm::flag should be set to -1 +* if lindst was not previously initialized (memory leaks +* may result if it was previously initialized). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* linprm::err if enabled, see wcserr_enable(). +* +* +* linfree() - Destructor for the linprm struct +* -------------------------------------------- +* linfree() frees memory allocated for the linprm arrays by lininit() and/or +* linset(). lininit() keeps a record of the memory it allocates and linfree() +* will only attempt to free this. +* +* PLEASE NOTE: linfree() must not be invoked on a linprm struct that was not +* initialized by lininit(). +* +* Given: +* lin struct linprm* +* Linear transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* +* +* linprt() - Print routine for the linprm struct +* ---------------------------------------------- +* linprt() prints the contents of a linprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* lin const struct linprm* +* Linear transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* +* +* linperr() - Print error messages from a linprm struct +* ----------------------------------------------------- +* linperr() prints the error message(s) (if any) stored in a linprm struct, +* and the disprm structs that it may contain. If there are no errors then +* nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* lin const struct linprm* +* Coordinate transformation parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* +* +* linset() - Setup routine for the linprm struct +* ---------------------------------------------- +* linset(), if necessary, allocates memory for the linprm::piximg and +* linprm::imgpix arrays and sets up the linprm struct according to information +* supplied within it - refer to the explanation of linprm::flag. +* +* Note that this routine need not be called directly; it will be invoked by +* linp2x() and linx2p() if the linprm::flag is anything other than a +* predefined magic value. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* 3: PCi_ja matrix is singular. +* +* For returns > 1, a detailed error message is set in +* linprm::err if enabled, see wcserr_enable(). +* +* +* linp2x() - Pixel-to-world linear transformation +* ----------------------------------------------- +* linp2x() transforms pixel coordinates to intermediate world coordinates. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length nelem +* but containing lin.naxis coordinate elements. +* +* pixcrd const double[ncoord][nelem] +* Array of pixel coordinates. +* +* Returned: +* imgcrd double[ncoord][nelem] +* Array of intermediate world coordinates. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* 3: PCi_ja matrix is singular. +* +* For returns > 1, a detailed error message is set in +* linprm::err if enabled, see wcserr_enable(). +* +* +* linx2p() - World-to-pixel linear transformation +* ----------------------------------------------- +* linx2p() transforms intermediate world coordinates to pixel coordinates. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length nelem +* but containing lin.naxis coordinate elements. +* +* imgcrd const double[ncoord][nelem] +* Array of intermediate world coordinates. +* +* Returned: +* pixcrd double[ncoord][nelem] +* Array of pixel coordinates. +* +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* 3: PCi_ja matrix is singular. +* +* For returns > 1, a detailed error message is set in +* linprm::err if enabled, see wcserr_enable(). +* +* +* linwarp() - Compute measures of distortion +* ------------------------------------------ +* linwarp() computes various measures of the distortion over a specified range +* of pixel coordinates. +* +* All distortion measures are specified as an offset in pixel coordinates, +* as given directly by prior distortions. The offset in intermediate pixel +* coordinates given by sequent distortions is translated back to pixel +* coordinates by applying the inverse of the linear transformation matrix +* (PCi_ja or CDi_ja). The difference may be significant if the matrix +* introduced a scaling. +* +* If all distortions are prior, then linwarp() uses diswarp(), q.v. +* +* Given and returned: +* lin struct linprm* +* Linear transformation parameters plus distortions. +* +* Given: +* pixblc const double[naxis] +* Start of the range of pixel coordinates (i.e. "bottom +* left-hand corner" in the conventional FITS image +* display orientation). May be specified as a NULL +* pointer which is interpreted as (1,1,...). +* +* pixtrc const double[naxis] +* End of the range of pixel coordinates (i.e. "top +* right-hand corner" in the conventional FITS image +* display orientation). +* +* pixsamp const double[naxis] +* If positive or zero, the increment on the particular +* axis, starting at pixblc[]. Zero is interpreted as a +* unit increment. pixsamp may also be specified as a +* NULL pointer which is interpreted as all zeroes, i.e. +* unit increments on all axes. +* +* If negative, the grid size on the particular axis (the +* absolute value being rounded to the nearest integer). +* For example, if pixsamp is (-128.0,-128.0,...) then +* each axis will be sampled at 128 points between +* pixblc[] and pixtrc[] inclusive. Use caution when +* using this option on non-square images. +* +* Returned: +* nsamp int* The number of pixel coordinates sampled. +* +* Can be specified as a NULL pointer if not required. +* +* maxdis double[naxis] +* For each individual distortion function, the +* maximum absolute value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* maxtot double* For the combination of all distortion functions, the +* maximum absolute value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* avgdis double[naxis] +* For each individual distortion function, the +* mean value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* avgtot double* For the combination of all distortion functions, the +* mean value of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* rmsdis double[naxis] +* For each individual distortion function, the +* root mean square deviation of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* rmstot double* For the combination of all distortion functions, the +* root mean square deviation of the distortion. +* +* Can be specified as a NULL pointer if not required. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null linprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid parameter. +* 4: Distort error. +* +* +* linprm struct - Linear transformation parameters +* ------------------------------------------------ +* The linprm struct contains all of the information required to perform a +* linear transformation. It consists of certain members that must be set by +* the user ("given") and others that are set by the WCSLIB routines +* ("returned"). +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following members of the linprm struct are set or modified: +* +* - linprm::naxis (q.v., not normally set by the user), +* - linprm::pc, +* - linprm::cdelt, +* - linprm::dispre. +* - linprm::disseq. +* +* This signals the initialization routine, linset(), to recompute the +* returned members of the linprm struct. linset() will reset flag to +* indicate that this has been done. +* +* PLEASE NOTE: flag should be set to -1 when lininit() is called for the +* first time for a particular linprm struct in order to initialize memory +* management. It must ONLY be used on the first initialization otherwise +* memory leaks may result. +* +* int naxis +* (Given or returned) Number of pixel and world coordinate elements. +* +* If lininit() is used to initialize the linprm struct (as would normally +* be the case) then it will set naxis from the value passed to it as a +* function argument. The user should not subsequently modify it. +* +* double *crpix +* (Given) Pointer to the first element of an array of double containing +* the coordinate reference pixel, CRPIXja. +* +* It is not necessary to reset the linprm struct (via linset()) when +* linprm::crpix is changed. +* +* double *pc +* (Given) Pointer to the first element of the PCi_ja (pixel coordinate) +* transformation matrix. The expected order is +* += struct linprm lin; += lin.pc = {PC1_1, PC1_2, PC2_1, PC2_2}; +* +* This may be constructed conveniently from a 2-D array via +* += double m[2][2] = {{PC1_1, PC1_2}, += {PC2_1, PC2_2}}; +* +* which is equivalent to +* += double m[2][2]; += m[0][0] = PC1_1; += m[0][1] = PC1_2; += m[1][0] = PC2_1; += m[1][1] = PC2_2; +* +* The storage order for this 2-D array is the same as for the 1-D array, +* whence +* += lin.pc = *m; +* +* would be legitimate. +* +* double *cdelt +* (Given) Pointer to the first element of an array of double containing +* the coordinate increments, CDELTia. +* +* struct disprm *dispre +* (Given) Pointer to a disprm struct holding parameters for prior +* distortion functions, or a null (0x0) pointer if there are none. +* +* Function lindist() may be used to assign a disprm pointer to a linprm +* struct, allowing it to take control of any memory allocated for it, as +* in the following example: +* += void add_distortion(struct linprm *lin) += { += struct disprm *dispre; += += dispre = malloc(sizeof(struct disprm)); += dispre->flag = -1; += lindist(1, lin, dispre, ndpmax); += : += (Set up dispre.) += : += += return; += } +* +* Here, after the distortion function parameters etc. are copied into +* dispre, dispre is assigned using lindist() which takes control of the +* allocated memory. It will be free'd later when linfree() is invoked on +* the linprm struct. +* +* Consider also the following erroneous code: +* += void bad_code(struct linprm *lin) += { += struct disprm dispre; += += dispre.flag = -1; += lindist(1, lin, &dispre, ndpmax); // WRONG. += : += += return; += } +* +* Here, dispre is declared as a struct, rather than a pointer. When the +* function returns, dispre will go out of scope and its memory will most +* likely be reused, thereby trashing its contents. Later, a segfault will +* occur when linfree() tries to free dispre's stale address. +* +* struct disprm *disseq +* (Given) Pointer to a disprm struct holding parameters for sequent +* distortion functions, or a null (0x0) pointer if there are none. +* +* Refer to the comments and examples given for disprm::dispre. +* +* double *piximg +* (Returned) Pointer to the first element of the matrix containing the +* product of the CDELTia diagonal matrix and the PCi_ja matrix. +* +* double *imgpix +* (Returned) Pointer to the first element of the inverse of the +* linprm::piximg matrix. +* +* int i_naxis +* (Returned) The dimension of linprm::piximg and linprm::imgpix (normally +* equal to naxis). +* +* int unity +* (Returned) True if the linear transformation matrix is unity. +* +* int affine +* (Returned) True if there are no distortions. +* +* int simple +* (Returned) True if unity and no distortions. +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* double *tmpcrd +* (For internal use only.) +* int m_flag +* (For internal use only.) +* int m_naxis +* (For internal use only.) +* double *m_crpix +* (For internal use only.) +* double *m_pc +* (For internal use only.) +* double *m_cdelt +* (For internal use only.) +* struct disprm *m_dispre +* (For internal use only.) +* struct disprm *m_disseq +* (For internal use only.) +* +* +* Global variable: const char *lin_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_LIN +#define WCSLIB_LIN + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *lin_errmsg[]; + +enum lin_errmsg_enum { + LINERR_SUCCESS = 0, /* Success. */ + LINERR_NULL_POINTER = 1, /* Null linprm pointer passed. */ + LINERR_MEMORY = 2, /* Memory allocation failed. */ + LINERR_SINGULAR_MTX = 3, /* PCi_ja matrix is singular. */ + LINERR_DISTORT_INIT = 4, /* Failed to initialise distortions. */ + LINERR_DISTORT = 5, /* Distort error. */ + LINERR_DEDISTORT = 6 /* De-distort error. */ +}; + +struct linprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int naxis; /* The number of axes, given by NAXIS. */ + double *crpix; /* CRPIXja keywords for each pixel axis. */ + double *pc; /* PCi_ja linear transformation matrix. */ + double *cdelt; /* CDELTia keywords for each coord axis. */ + struct disprm *dispre; /* Prior distortion parameters, if any. */ + struct disprm *disseq; /* Sequent distortion parameters, if any. */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + double *piximg; /* Product of CDELTia and PCi_ja matrices. */ + double *imgpix; /* Inverse of the piximg matrix. */ + int i_naxis; /* Dimension of piximg and imgpix. */ + int unity; /* True if the PCi_ja matrix is unity. */ + int affine; /* True if there are no distortions. */ + int simple; /* True if unity and no distortions. */ + + /* Error handling, if enabled. */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private - the remainder are for internal use. */ + /*------------------------------------------------------------------------*/ + double *tmpcrd; + + int m_flag, m_naxis; + double *m_crpix, *m_pc, *m_cdelt; + struct disprm *m_dispre, *m_disseq; +}; + +/* Size of the linprm struct in int units, used by the Fortran wrappers. */ +#define LINLEN (sizeof(struct linprm)/sizeof(int)) + + +int linini(int alloc, int naxis, struct linprm *lin); + +int lininit(int alloc, int naxis, struct linprm *lin, int ndpmax); + +int lindis(int sequence, struct linprm *lin, struct disprm *dis); + +int lindist(int sequence, struct linprm *lin, struct disprm *dis, int ndpmax); + +int lincpy(int alloc, const struct linprm *linsrc, struct linprm *lindst); + +int linfree(struct linprm *lin); + +int linprt(const struct linprm *lin); + +int linperr(const struct linprm *lin, const char *prefix); + +int linset(struct linprm *lin); + +int linp2x(struct linprm *lin, int ncoord, int nelem, const double pixcrd[], + double imgcrd[]); + +int linx2p(struct linprm *lin, int ncoord, int nelem, const double imgcrd[], + double pixcrd[]); + +int linwarp(struct linprm *lin, const double pixblc[], const double pixtrc[], + const double pixsamp[], int *nsamp, + double maxdis[], double *maxtot, + double avgdis[], double *avgtot, + double rmsdis[], double *rmstot); + +int matinv(int n, const double mat[], double inv[]); + + +/* Deprecated. */ +#define linini_errmsg lin_errmsg +#define lincpy_errmsg lin_errmsg +#define linfree_errmsg lin_errmsg +#define linprt_errmsg lin_errmsg +#define linset_errmsg lin_errmsg +#define linp2x_errmsg lin_errmsg +#define linx2p_errmsg lin_errmsg + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_LIN */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/log.c b/testbed/astropy__astropy/cextern/wcslib/C/log.c new file mode 100644 index 0000000000000000000000000000000000000000..81346500ed149eb2934295a5fc305f008d7ad1fb --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/log.c @@ -0,0 +1,112 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: log.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include + +#include "log.h" + +/* Map status return value to message. */ +const char *log_errmsg[] = { + "Success", + "", + "Invalid log-coordinate reference value", + "One or more of the x coordinates were invalid", + "One or more of the world coordinates were invalid"}; + + +/*--------------------------------------------------------------------------*/ + +int logx2s( + double crval, + int nx, + int sx, + int slogc, + const double x[], + double logc[], + int stat[]) + +{ + register int ix; + register int *statp; + register const double *xp; + register double *logcp; + + + if (crval <= 0.0) { + return LOGERR_BAD_LOG_REF_VAL; + } + + xp = x; + logcp = logc; + statp = stat; + for (ix = 0; ix < nx; ix++, xp += sx, logcp += slogc) { + *logcp = crval * exp((*xp) / crval); + *(statp++) = 0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int logs2x( + double crval, + int nlogc, + int slogc, + int sx, + const double logc[], + double x[], + int stat[]) + +{ + int status; + register int ilogc; + register int *statp; + register const double *logcp; + register double *xp; + + + if (crval <= 0.0) { + return LOGERR_BAD_LOG_REF_VAL; + } + + xp = x; + logcp = logc; + statp = stat; + status = 0; + for (ilogc = 0; ilogc < nlogc; ilogc++, logcp += slogc, xp += sx) { + if (*logcp > 0.0) { + *xp = crval * log(*logcp / crval); + *(statp++) = 0; + } else { + *(statp++) = 1; + status = LOGERR_BAD_WORLD; + } + } + + return status; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/log.h b/testbed/astropy__astropy/cextern/wcslib/C/log.h new file mode 100644 index 0000000000000000000000000000000000000000..ca51c869a4303961b53239a41c358bf60e496f8b --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/log.h @@ -0,0 +1,167 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: log.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the log routines +* --------------------------- +* Routines in this suite implement the part of the FITS World Coordinate +* System (WCS) standard that deals with logarithmic coordinates, as described +* in +* +* "Representations of world coordinates in FITS", +* Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) +* +* "Representations of spectral coordinates in FITS", +* Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. +* 2006, A&A, 446, 747 (WCS Paper III) +* +* These routines define methods to be used for computing logarithmic world +* coordinates from intermediate world coordinates (a linear transformation of +* image pixel coordinates), and vice versa. +* +* logx2s() and logs2x() implement the WCS logarithmic coordinate +* transformations. +* +* Argument checking: +* ------------------ +* The input log-coordinate values are only checked for values that would +* result in floating point exceptions and the same is true for the +* log-coordinate reference value. +* +* Accuracy: +* --------- +* No warranty is given for the accuracy of these routines (refer to the +* copyright notice); intending users must satisfy for themselves their +* adequacy for the intended purpose. However, closure effectively to within +* double precision rounding error was demonstrated by test routine tlog.c +* which accompanies this software. +* +* +* logx2s() - Transform to logarithmic coordinates +* ----------------------------------------------- +* logx2s() transforms intermediate world coordinates to logarithmic +* coordinates. +* +* Given and returned: +* crval double Log-coordinate reference value (CRVALia). +* +* Given: +* nx int Vector length. +* +* sx int Vector stride. +* +* slogc int Vector stride. +* +* x const double[] +* Intermediate world coordinates, in SI units. +* +* Returned: +* logc double[] Logarithmic coordinates, in SI units. +* +* stat int[] Status return value status for each vector element: +* 0: Success. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid log-coordinate reference value. +* +* +* logs2x() - Transform logarithmic coordinates +* -------------------------------------------- +* logs2x() transforms logarithmic world coordinates to intermediate world +* coordinates. +* +* Given and returned: +* crval double Log-coordinate reference value (CRVALia). +* +* Given: +* nlogc int Vector length. +* +* slogc int Vector stride. +* +* sx int Vector stride. +* +* logc const double[] +* Logarithmic coordinates, in SI units. +* +* Returned: +* x double[] Intermediate world coordinates, in SI units. +* +* stat int[] Status return value status for each vector element: +* 0: Success. +* 1: Invalid value of logc. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid log-coordinate reference value. +* 4: One or more of the world-coordinate values +* are incorrect, as indicated by the stat vector. +* +* +* Global variable: const char *log_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_LOG +#define WCSLIB_LOG + +#ifdef __cplusplus +extern "C" { +#endif + +extern const char *log_errmsg[]; + +enum log_errmsg_enum { + LOGERR_SUCCESS = 0, /* Success. */ + LOGERR_NULL_POINTER = 1, /* Null pointer passed. */ + LOGERR_BAD_LOG_REF_VAL = 2, /* Invalid log-coordinate reference value. */ + LOGERR_BAD_X = 3, /* One or more of the x coordinates were + invalid. */ + LOGERR_BAD_WORLD = 4 /* One or more of the world coordinates were + invalid. */ +}; + +int logx2s(double crval, int nx, int sx, int slogc, const double x[], + double logc[], int stat[]); + +int logs2x(double crval, int nlogc, int slogc, int sx, const double logc[], + double x[], int stat[]); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_LOG */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/prj.c b/testbed/astropy__astropy/cextern/wcslib/C/prj.c new file mode 100644 index 0000000000000000000000000000000000000000..1454c06bb9cd326afb983f3c92a8d9f2c2b2f1ca --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/prj.c @@ -0,0 +1,8499 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: prj.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcstrig.h" +#include "wcsutil.h" +#include "prj.h" + + +/* Projection categories. */ +const int ZENITHAL = 1; +const int CYLINDRICAL = 2; +const int PSEUDOCYLINDRICAL = 3; +const int CONVENTIONAL = 4; +const int CONIC = 5; +const int POLYCONIC = 6; +const int QUADCUBE = 7; +const int HEALPIX = 8; + +const char prj_categories[9][32] = + {"undefined", "zenithal", "cylindrical", "pseudocylindrical", + "conventional", "conic", "polyconic", "quadcube", "HEALPix"}; + + +/* Projection codes. */ +const int prj_ncode = 28; +const char prj_codes[28][4] = + {"AZP", "SZP", "TAN", "STG", "SIN", "ARC", "ZPN", "ZEA", "AIR", "CYP", + "CEA", "CAR", "MER", "COP", "COE", "COD", "COO", "SFL", "PAR", "MOL", + "AIT", "BON", "PCO", "TSC", "CSC", "QSC", "HPX", "XPH"}; + +const int AZP = 101; +const int SZP = 102; +const int TAN = 103; +const int STG = 104; +const int SIN = 105; +const int ARC = 106; +const int ZPN = 107; +const int ZEA = 108; +const int AIR = 109; +const int CYP = 201; +const int CEA = 202; +const int CAR = 203; +const int MER = 204; +const int SFL = 301; +const int PAR = 302; +const int MOL = 303; +const int AIT = 401; +const int COP = 501; +const int COE = 502; +const int COD = 503; +const int COO = 504; +const int BON = 601; +const int PCO = 602; +const int TSC = 701; +const int CSC = 702; +const int QSC = 703; +const int HPX = 801; +const int XPH = 802; + + +/* Map status return value to message. */ +const char *prj_errmsg[] = { + "Success", + "Null prjprm pointer passed", + "Invalid projection parameters", + "One or more of the (x,y) coordinates were invalid", + "One or more of the (phi,theta) coordinates were invalid"}; + +/* Convenience macros for generating common error messages. */ +#define PRJERR_BAD_PARAM_SET(function) \ + wcserr_set(&(prj->err), PRJERR_BAD_PARAM, function, __FILE__, __LINE__, \ + "Invalid parameters for %s projection", prj->name); + +#define PRJERR_BAD_PIX_SET(function) \ + wcserr_set(&(prj->err), PRJERR_BAD_PIX, function, __FILE__, __LINE__, \ + "One or more of the (x, y) coordinates were invalid for %s projection", \ + prj->name); + +#define PRJERR_BAD_WORLD_SET(function) \ + wcserr_set(&(prj->err), PRJERR_BAD_WORLD, function, __FILE__, __LINE__, \ + "One or more of the (lat, lng) coordinates were invalid for " \ + "%s projection", prj->name); + +#define copysign(X, Y) ((Y) < 0.0 ? -fabs(X) : fabs(X)) + + +/*============================================================================ +* Generic routines: +* +* prjini initializes a prjprm struct to default values. +* +* prjfree frees any memory that may have been allocated to store an error +* message in the prjprm struct. +* +* prjprt prints the contents of a prjprm struct. +* +* prjbchk performs bounds checking on the native coordinates returned by the +* *x2s() routines. +* +* prjset invokes the specific initialization routine based on the projection +* code in the prjprm struct. +* +* prjx2s invokes the specific deprojection routine based on the pointer-to- +* function stored in the prjprm struct. +* +* prjs2x invokes the specific projection routine based on the pointer-to- +* function stored in the prjprm struct. +* +*---------------------------------------------------------------------------*/ + +int prjini(prj) + +struct prjprm *prj; + +{ + register int k; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = 0; + + strcpy(prj->code, " "); + prj->pv[0] = 0.0; + prj->pv[1] = UNDEFINED; + prj->pv[2] = UNDEFINED; + prj->pv[3] = UNDEFINED; + for (k = 4; k < PVN; prj->pv[k++] = 0.0); + prj->r0 = 0.0; + prj->phi0 = UNDEFINED; + prj->theta0 = UNDEFINED; + prj->bounds = 7; + + strcpy(prj->name, "undefined"); + for (k = 9; k < 40; prj->name[k++] = '\0'); + prj->category = 0; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 0; + prj->x0 = 0.0; + prj->y0 = 0.0; + + prj->err = 0x0; + + prj->padding = 0x0; + for (k = 0; k < 10; prj->w[k++] = 0.0); + prj->m = 0; + prj->n = 0; + prj->prjx2s = 0x0; + prj->prjs2x = 0x0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int prjfree(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + if (prj->err) { + free(prj->err); + prj->err = 0x0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int prjprt(prj) + +const struct prjprm *prj; + +{ + char hext[32]; + int i, n; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + wcsprintf(" flag: %d\n", prj->flag); + wcsprintf(" code: \"%s\"\n", prj->code); + wcsprintf(" r0: %9f\n", prj->r0); + wcsprintf(" pv:"); + if (prj->pvrange) { + n = (prj->pvrange)%100; + + if (prj->pvrange/100) { + wcsprintf(" (0)"); + } else { + wcsprintf(" %#- 11.5g", prj->pv[0]); + n--; + } + + for (i = 1; i <= n; i++) { + if (i%5 == 1) { + wcsprintf("\n "); + } + + if (undefined(prj->pv[i])) { + wcsprintf(" UNDEFINED "); + } else { + wcsprintf(" %#- 11.5g", prj->pv[i]); + } + } + wcsprintf("\n"); + } else { + wcsprintf(" (not used)\n"); + } + if (undefined(prj->phi0)) { + wcsprintf(" phi0: UNDEFINED\n"); + } else { + wcsprintf(" phi0: %9f\n", prj->phi0); + } + if (undefined(prj->theta0)) { + wcsprintf(" theta0: UNDEFINED\n"); + } else { + wcsprintf(" theta0: %9f\n", prj->theta0); + } + wcsprintf(" bounds: %d\n", prj->bounds); + + wcsprintf("\n"); + wcsprintf(" name: \"%s\"\n", prj->name); + wcsprintf(" category: %d (%s)\n", prj->category, + prj_categories[prj->category]); + wcsprintf(" pvrange: %d\n", prj->pvrange); + wcsprintf(" simplezen: %d\n", prj->simplezen); + wcsprintf(" equiareal: %d\n", prj->equiareal); + wcsprintf(" conformal: %d\n", prj->conformal); + wcsprintf(" global: %d\n", prj->global); + wcsprintf(" divergent: %d\n", prj->divergent); + wcsprintf(" x0: %f\n", prj->x0); + wcsprintf(" y0: %f\n", prj->y0); + + WCSPRINTF_PTR(" err: ", prj->err, "\n"); + if (prj->err) { + wcserr_prt(prj->err, " "); + } + + wcsprintf(" w[]:"); + for (i = 0; i < 5; i++) { + wcsprintf(" %#- 11.5g", prj->w[i]); + } + wcsprintf("\n "); + for (i = 5; i < 10; i++) { + wcsprintf(" %#- 11.5g", prj->w[i]); + } + wcsprintf("\n"); + wcsprintf(" m: %d\n", prj->m); + wcsprintf(" n: %d\n", prj->n); + wcsprintf(" prjx2s: %s\n", + wcsutil_fptr2str((void (*)(void))prj->prjx2s, hext)); + wcsprintf(" prjs2x: %s\n", + wcsutil_fptr2str((void (*)(void))prj->prjs2x, hext)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int prjperr(const struct prjprm *prj, const char *prefix) + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + if (prj->err) { + wcserr_prt(prj->err, prefix); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int prjbchk(tol, nphi, ntheta, spt, phi, theta, stat) + +double tol; +int nphi, ntheta, spt; +double phi[], theta[]; +int stat[]; + +{ + int status = 0; + register int iphi, itheta, *statp; + register double *phip, *thetap; + + phip = phi; + thetap = theta; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++) { + for (iphi = 0; iphi < nphi; iphi++, phip += spt, thetap += spt, statp++) { + /* Skip values already marked as illegal. */ + if (*statp == 0) { + if (*phip < -180.0) { + if (*phip < -180.0-tol) { + *statp = 1; + status = 1; + } else { + *phip = -180.0; + } + } else if (180.0 < *phip) { + if (180.0+tol < *phip) { + *statp = 1; + status = 1; + } else { + *phip = 180.0; + } + } + + if (*thetap < -90.0) { + if (*thetap < -90.0-tol) { + *statp = 1; + status = 1; + } else { + *thetap = -90.0; + } + } else if (90.0 < *thetap) { + if (90.0+tol < *thetap) { + *statp = 1; + status = 1; + } else { + *thetap = 90.0; + } + } + } + } + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int prjset(prj) + +struct prjprm *prj; + +{ + static const char *function = "prjset"; + + int status; + struct wcserr **err; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + err = &(prj->err); + + /* Invoke the relevant initialization routine. */ + prj->code[3] = '\0'; + if (strcmp(prj->code, "AZP") == 0) { + status = azpset(prj); + } else if (strcmp(prj->code, "SZP") == 0) { + status = szpset(prj); + } else if (strcmp(prj->code, "TAN") == 0) { + status = tanset(prj); + } else if (strcmp(prj->code, "STG") == 0) { + status = stgset(prj); + } else if (strcmp(prj->code, "SIN") == 0) { + status = sinset(prj); + } else if (strcmp(prj->code, "ARC") == 0) { + status = arcset(prj); + } else if (strcmp(prj->code, "ZPN") == 0) { + status = zpnset(prj); + } else if (strcmp(prj->code, "ZEA") == 0) { + status = zeaset(prj); + } else if (strcmp(prj->code, "AIR") == 0) { + status = airset(prj); + } else if (strcmp(prj->code, "CYP") == 0) { + status = cypset(prj); + } else if (strcmp(prj->code, "CEA") == 0) { + status = ceaset(prj); + } else if (strcmp(prj->code, "CAR") == 0) { + status = carset(prj); + } else if (strcmp(prj->code, "MER") == 0) { + status = merset(prj); + } else if (strcmp(prj->code, "SFL") == 0) { + status = sflset(prj); + } else if (strcmp(prj->code, "PAR") == 0) { + status = parset(prj); + } else if (strcmp(prj->code, "MOL") == 0) { + status = molset(prj); + } else if (strcmp(prj->code, "AIT") == 0) { + status = aitset(prj); + } else if (strcmp(prj->code, "COP") == 0) { + status = copset(prj); + } else if (strcmp(prj->code, "COE") == 0) { + status = coeset(prj); + } else if (strcmp(prj->code, "COD") == 0) { + status = codset(prj); + } else if (strcmp(prj->code, "COO") == 0) { + status = cooset(prj); + } else if (strcmp(prj->code, "BON") == 0) { + status = bonset(prj); + } else if (strcmp(prj->code, "PCO") == 0) { + status = pcoset(prj); + } else if (strcmp(prj->code, "TSC") == 0) { + status = tscset(prj); + } else if (strcmp(prj->code, "CSC") == 0) { + status = cscset(prj); + } else if (strcmp(prj->code, "QSC") == 0) { + status = qscset(prj); + } else if (strcmp(prj->code, "HPX") == 0) { + status = hpxset(prj); + } else if (strcmp(prj->code, "XPH") == 0) { + status = xphset(prj); + } else { + /* Unrecognized projection code. */ + status = wcserr_set(WCSERR_SET(PRJERR_BAD_PARAM), + "Unrecognized projection code '%s'", prj->code); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int prjx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int status; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag == 0) { + if ((status = prjset(prj))) return status; + } + + return prj->prjx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat); +} + +/*--------------------------------------------------------------------------*/ + +int prjs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int status; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag == 0) { + if ((status = prjset(prj))) return status; + } + + return prj->prjs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat); +} + +/*============================================================================ +* Internal helper routine used by the *set() routines - not intended for +* outside use. It forces (x,y) = (0,0) at (phi0,theta0). +*---------------------------------------------------------------------------*/ + +int prjoff(prj, phi0, theta0) + +struct prjprm *prj; +const double phi0, theta0; + +{ + int stat; + double x0, y0; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->x0 = 0.0; + prj->y0 = 0.0; + + if (undefined(prj->phi0) || undefined(prj->theta0)) { + /* Set both to the projection-specific default if either undefined. */ + prj->phi0 = phi0; + prj->theta0 = theta0; + + } else { + if (prj->prjs2x(prj, 1, 1, 1, 1, &(prj->phi0), &(prj->theta0), &x0, &y0, + &stat)) { + return PRJERR_BAD_PARAM_SET("prjoff"); + } + + prj->x0 = x0; + prj->y0 = y0; + } + + return 0; +} + +/*============================================================================ +* AZP: zenithal/azimuthal perspective projection. +* +* Given: +* prj->pv[1] Distance parameter, mu in units of r0. +* prj->pv[2] Tilt angle, gamma in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag AZP +* prj->code "AZP" +* prj->x0 Offset in x. +* prj->y0 Offset in y. +* prj->w[0] r0*(mu+1) +* prj->w[1] tan(gamma) +* prj->w[2] sec(gamma) +* prj->w[3] cos(gamma) +* prj->w[4] sin(gamma) +* prj->w[5] asin(-1/mu) for |mu| >= 1, -90 otherwise +* prj->w[6] mu*cos(gamma) +* prj->w[7] 1 if |mu*cos(gamma)| < 1, 0 otherwise +* prj->prjx2s Pointer to azpx2s(). +* prj->prjs2x Pointer to azps2x(). +*===========================================================================*/ + +int azpset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = AZP; + strcpy(prj->code, "AZP"); + + if (undefined(prj->pv[1])) prj->pv[1] = 0.0; + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "zenithal/azimuthal perspective"); + prj->category = ZENITHAL; + prj->pvrange = 102; + prj->simplezen = prj->pv[2] == 0.0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = prj->pv[1] <= 1.0; + + prj->w[0] = prj->r0*(prj->pv[1] + 1.0); + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("azpset"); + } + + prj->w[3] = cosd(prj->pv[2]); + if (prj->w[3] == 0.0) { + return PRJERR_BAD_PARAM_SET("azpset"); + } + + prj->w[2] = 1.0/prj->w[3]; + prj->w[4] = sind(prj->pv[2]); + prj->w[1] = prj->w[4] / prj->w[3]; + + if (fabs(prj->pv[1]) > 1.0) { + prj->w[5] = asind(-1.0/prj->pv[1]); + } else { + prj->w[5] = -90.0; + } + + prj->w[6] = prj->pv[1] * prj->w[3]; + prj->w[7] = (fabs(prj->w[6]) < 1.0) ? 1.0 : 0.0; + + prj->prjx2s = azpx2s; + prj->prjs2x = azps2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int azpx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double a, b, q, r, s, t, xj, yj, yc, yc2; + const double tol = 1.0e-13; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AZP) { + if ((status = azpset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + + yc = yj*prj->w[3]; + yc2 = yc*yc; + + q = prj->w[0] + yj*prj->w[4]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yc2); + if (r == 0.0) { + *phip = 0.0; + *thetap = 90.0; + *(statp++) = 0; + + } else { + *phip = atan2d(xj, -yc); + + s = r / q; + t = s*prj->pv[1]/sqrt(s*s + 1.0); + + s = atan2d(1.0, s); + + if (fabs(t) > 1.0) { + if (fabs(t) > 1.0+tol) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("azpx2s"); + continue; + } + t = copysign(90.0, t); + } else { + t = asind(t); + } + + a = s - t; + b = s + t + 180.0; + + if (a > 90.0) a -= 360.0; + if (b > 90.0) b -= 360.0; + + *thetap = (a > b) ? a : b; + *(statp++) = 0; + } + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("azpx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int azps2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double a, b, cosphi, costhe, r, s, sinphi, sinthe, t; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AZP) { + if ((status = azpset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + s = prj->w[1]*(*yp); + t = (prj->pv[1] + sinthe) + costhe*s; + + if (t == 0.0) { + *xp = 0.0; + *yp = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("azps2x"); + + } else { + r = prj->w[0]*costhe/t; + + /* Bounds checking. */ + istat = 0; + if (prj->bounds&1) { + if (*thetap < prj->w[5]) { + /* Overlap. */ + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("azps2x"); + + } else if (prj->w[7] > 0.0) { + /* Divergence. */ + t = prj->pv[1] / sqrt(1.0 + s*s); + + if (fabs(t) <= 1.0) { + s = atand(-s); + t = asind(t); + a = s - t; + b = s + t + 180.0; + + if (a > 90.0) a -= 360.0; + if (b > 90.0) b -= 360.0; + + if (*thetap < ((a > b) ? a : b)) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("azps2x"); + } + } + } + } + + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp)*prj->w[2] - prj->y0; + *(statp++) = istat; + } + } + } + + return status; +} + +/*============================================================================ +* SZP: slant zenithal perspective projection. +* +* Given: +* prj->pv[1] Distance of the point of projection from the centre of the +* generating sphere, mu in units of r0. +* prj->pv[2] Native longitude, phi_c, and ... +* prj->pv[3] Native latitude, theta_c, on the planewards side of the +* intersection of the line through the point of projection +* and the centre of the generating sphere, phi_c in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag SZP +* prj->code "SZP" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 1/r0 +* prj->w[1] xp = -mu*cos(theta_c)*sin(phi_c) +* prj->w[2] yp = mu*cos(theta_c)*cos(phi_c) +* prj->w[3] zp = mu*sin(theta_c) + 1 +* prj->w[4] r0*xp +* prj->w[5] r0*yp +* prj->w[6] r0*zp +* prj->w[7] (zp - 1)^2 +* prj->w[8] asin(1-zp) if |1 - zp| < 1, -90 otherwise +* prj->prjx2s Pointer to szpx2s(). +* prj->prjs2x Pointer to szps2x(). +*===========================================================================*/ + +int szpset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = SZP; + strcpy(prj->code, "SZP"); + + if (undefined(prj->pv[1])) prj->pv[1] = 0.0; + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (undefined(prj->pv[3])) prj->pv[3] = 90.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "slant zenithal perspective"); + prj->category = ZENITHAL; + prj->pvrange = 103; + prj->simplezen = prj->pv[3] == 90.0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = prj->pv[1] <= 1.0; + + prj->w[0] = 1.0/prj->r0; + + prj->w[3] = prj->pv[1] * sind(prj->pv[3]) + 1.0; + if (prj->w[3] == 0.0) { + return PRJERR_BAD_PARAM_SET("szpset"); + } + + prj->w[1] = -prj->pv[1] * cosd(prj->pv[3]) * sind(prj->pv[2]); + prj->w[2] = prj->pv[1] * cosd(prj->pv[3]) * cosd(prj->pv[2]); + prj->w[4] = prj->r0 * prj->w[1]; + prj->w[5] = prj->r0 * prj->w[2]; + prj->w[6] = prj->r0 * prj->w[3]; + prj->w[7] = (prj->w[3] - 1.0) * prj->w[3] - 1.0; + + if (fabs(prj->w[3] - 1.0) < 1.0) { + prj->w[8] = asind(1.0 - prj->w[3]); + } else { + prj->w[8] = -90.0; + } + + prj->prjx2s = szpx2s; + prj->prjs2x = szps2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int szpx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double a, b, c, d, r2, sinth1, sinth2, sinthe, t, x1, xr, xy, y1, yr, z; + const double tol = 1.0e-13; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SZP) { + if ((status = szpset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xr = (*xp + prj->x0)*prj->w[0]; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xr; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yr = (*yp + prj->y0)*prj->w[0]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xr = *phip; + r2 = xr*xr + yr*yr; + + x1 = (xr - prj->w[1])/prj->w[3]; + y1 = (yr - prj->w[2])/prj->w[3]; + xy = xr*x1 + yr*y1; + + if (r2 < 1.0e-10) { + /* Use small angle formula. */ + z = r2/2.0; + *thetap = 90.0 - R2D*sqrt(r2/(1.0 + xy)); + + } else { + t = x1*x1 + y1*y1; + a = t + 1.0; + b = xy - t; + c = r2 - xy - xy + t - 1.0; + d = b*b - a*c; + + /* Check for a solution. */ + if (d < 0.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("szpx2s"); + continue; + } + d = sqrt(d); + + /* Choose solution closest to pole. */ + sinth1 = (-b + d)/a; + sinth2 = (-b - d)/a; + sinthe = (sinth1 > sinth2) ? sinth1 : sinth2; + if (sinthe > 1.0) { + if (sinthe-1.0 < tol) { + sinthe = 1.0; + } else { + sinthe = (sinth1 < sinth2) ? sinth1 : sinth2; + } + } + + if (sinthe < -1.0) { + if (sinthe+1.0 > -tol) { + sinthe = -1.0; + } + } + + if (sinthe > 1.0 || sinthe < -1.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("szpx2s"); + continue; + } + + *thetap = asind(sinthe); + + z = 1.0 - sinthe; + } + + *phip = atan2d(xr - x1*z, -(yr - y1*z)); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("szpx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int szps2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double a, b, cosphi, r, s, sinphi, t, u, v; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SZP) { + if ((status = szpset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + s = 1.0 - sind(*thetap); + t = prj->w[3] - s; + + if (t == 0.0) { + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = 0.0; + *yp = 0.0; + *(statp++) = 1; + } + + if (!status) status = PRJERR_BAD_WORLD_SET("szps2x"); + + } else { + r = prj->w[6]*cosd(*thetap)/t; + u = prj->w[4]*s/t + prj->x0; + v = prj->w[5]*s/t + prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + /* Bounds checking. */ + istat = 0; + if (prj->bounds&1) { + if (*thetap < prj->w[8]) { + /* Divergence. */ + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("szps2x"); + + } else if (fabs(prj->pv[1]) > 1.0) { + /* Overlap. */ + s = prj->w[1]*(*xp) - prj->w[2]*(*yp); + t = 1.0/sqrt(prj->w[7] + s*s); + + if (fabs(t) <= 1.0) { + s = atan2d(s, prj->w[3] - 1.0); + t = asind(t); + a = s - t; + b = s + t + 180.0; + + if (a > 90.0) a -= 360.0; + if (b > 90.0) b -= 360.0; + + if (*thetap < ((a > b) ? a : b)) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("szps2x"); + } + } + } + } + + *xp = r*(*xp) - u; + *yp = -r*(*yp) - v; + *(statp++) = istat; + } + } + } + + return status; +} + + +/*============================================================================ +* TAN: gnomonic projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag TAN +* prj->code "TAN" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->prjx2s Pointer to tanx2s(). +* prj->prjs2x Pointer to tans2x(). +*===========================================================================*/ + +int tanset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = TAN; + strcpy(prj->code, "TAN"); + + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "gnomonic"); + prj->category = ZENITHAL; + prj->pvrange = 0; + prj->simplezen = 1; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 1; + + prj->prjx2s = tanx2s; + prj->prjs2x = tans2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int tanx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, xj, yj, yj2; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != TAN) { + if ((status = tanset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2); + if (r == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(xj, -yj); + } + + *thetap = atan2d(prj->r0, r); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("tanx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int tans2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, r, s, sinphi; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != TAN) { + if ((status = tanset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + s = sind(*thetap); + if (s == 0.0) { + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = 0.0; + *yp = 0.0; + *(statp++) = 1; + } + if (!status) status = PRJERR_BAD_WORLD_SET("tans2x"); + + } else { + r = prj->r0*cosd(*thetap)/s; + + /* Bounds checking. */ + istat = 0; + if (prj->bounds&1) { + if (s < 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("tans2x"); + } + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = istat; + } + } + } + + return status; +} + +/*============================================================================ +* STG: stereographic projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag STG +* prj->code "STG" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 2*r0 +* prj->w[1] 1/(2*r0) +* prj->prjx2s Pointer to stgx2s(). +* prj->prjs2x Pointer to stgs2x(). +*===========================================================================*/ + +int stgset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = STG; + strcpy(prj->code, "STG"); + + strcpy(prj->name, "stereographic"); + prj->category = ZENITHAL; + prj->pvrange = 0; + prj->simplezen = 1; + prj->equiareal = 0; + prj->conformal = 1; + prj->global = 0; + prj->divergent = 1; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 360.0/PI; + prj->w[1] = PI/360.0; + } else { + prj->w[0] = 2.0*prj->r0; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = stgx2s; + prj->prjs2x = stgs2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int stgx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, xj, yj, yj2; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != STG) { + if ((status = stgset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2); + if (r == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(xj, -yj); + } + + *thetap = 90.0 - 2.0*atand(r*prj->w[1]); + *(statp++) = 0; + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int stgs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, r, s, sinphi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != STG) { + if ((status = stgset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + s = 1.0 + sind(*thetap); + if (s == 0.0) { + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = 0.0; + *yp = 0.0; + *(statp++) = 1; + } + if (!status) status = PRJERR_BAD_WORLD_SET("stgs2x"); + + } else { + r = prj->w[0]*cosd(*thetap)/s; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = 0; + } + } + } + + return status; +} + +/*============================================================================ +* SIN: orthographic/synthesis projection. +* +* Given: +* prj->pv[1:2] Obliqueness parameters, xi and eta. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag SIN +* prj->code "SIN" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 1/r0 +* prj->w[1] xi**2 + eta**2 +* prj->w[2] xi**2 + eta**2 + 1 +* prj->w[3] xi**2 + eta**2 - 1 +* prj->prjx2s Pointer to sinx2s(). +* prj->prjs2x Pointer to sins2x(). +*===========================================================================*/ + +int sinset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = SIN; + strcpy(prj->code, "SIN"); + + if (undefined(prj->pv[1])) prj->pv[1] = 0.0; + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "orthographic/synthesis"); + prj->category = ZENITHAL; + prj->pvrange = 102; + prj->simplezen = (prj->pv[1] == 0.0 && prj->pv[2] == 0.0); + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 0; + + prj->w[0] = 1.0/prj->r0; + prj->w[1] = prj->pv[1]*prj->pv[1] + prj->pv[2]*prj->pv[2]; + prj->w[2] = prj->w[1] + 1.0; + prj->w[3] = prj->w[1] - 1.0; + + prj->prjx2s = sinx2s; + prj->prjs2x = sins2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int sinx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + const double tol = 1.0e-13; + double a, b, c, d, eta, r2, sinth1, sinth2, sinthe, x0, xi, x1, xy, y0, y02, + y1, z; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SIN) { + if ((status = sinset(prj))) return status; + } + + xi = prj->pv[1]; + eta = prj->pv[2]; + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + x0 = (*xp + prj->x0)*prj->w[0]; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = x0; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + y0 = (*yp + prj->y0)*prj->w[0]; + y02 = y0*y0; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + /* Compute intermediaries. */ + x0 = *phip; + r2 = x0*x0 + y02; + + if (prj->w[1] == 0.0) { + /* Orthographic projection. */ + if (r2 != 0.0) { + *phip = atan2d(x0, -y0); + } else { + *phip = 0.0; + } + + if (r2 < 0.5) { + *thetap = acosd(sqrt(r2)); + } else if (r2 <= 1.0) { + *thetap = asind(sqrt(1.0 - r2)); + } else { + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("sinx2s") + continue; + } + + } else { + /* "Synthesis" projection. */ + xy = x0*xi + y0*eta; + + if (r2 < 1.0e-10) { + /* Use small angle formula. */ + z = r2/2.0; + *thetap = 90.0 - R2D*sqrt(r2/(1.0 + xy)); + + } else { + a = prj->w[2]; + b = xy - prj->w[1]; + c = r2 - xy - xy + prj->w[3]; + d = b*b - a*c; + + /* Check for a solution. */ + if (d < 0.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("sinx2s") + continue; + } + d = sqrt(d); + + /* Choose solution closest to pole. */ + sinth1 = (-b + d)/a; + sinth2 = (-b - d)/a; + sinthe = (sinth1 > sinth2) ? sinth1 : sinth2; + if (sinthe > 1.0) { + if (sinthe-1.0 < tol) { + sinthe = 1.0; + } else { + sinthe = (sinth1 < sinth2) ? sinth1 : sinth2; + } + } + + if (sinthe < -1.0) { + if (sinthe+1.0 > -tol) { + sinthe = -1.0; + } + } + + if (sinthe > 1.0 || sinthe < -1.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("sinx2s") + continue; + } + + *thetap = asind(sinthe); + z = 1.0 - sinthe; + } + + x1 = -y0 + eta*z; + y1 = x0 - xi*z; + if (x1 == 0.0 && y1 == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(y1,x1); + } + } + + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("sinx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int sins2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, costhe, sinphi, r, t, z, z1, z2; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SIN) { + if ((status = sinset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + t = (90.0 - fabs(*thetap))*D2R; + if (t < 1.0e-5) { + if (*thetap > 0.0) { + z = t*t/2.0; + } else { + z = 2.0 - t*t/2.0; + } + costhe = t; + } else { + z = 1.0 - sind(*thetap); + costhe = cosd(*thetap); + } + r = prj->r0*costhe; + + if (prj->w[1] == 0.0) { + /* Orthographic projection. */ + istat = 0; + if (prj->bounds&1) { + if (*thetap < 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("sins2x"); + } + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = istat; + } + + } else { + /* "Synthesis" projection. */ + z *= prj->r0; + z1 = prj->pv[1]*z - prj->x0; + z2 = prj->pv[2]*z - prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + istat = 0; + if (prj->bounds&1) { + t = -atand(prj->pv[1]*(*xp) - prj->pv[2]*(*yp)); + if (*thetap < t) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("sins2x"); + } + } + + *xp = r*(*xp) + z1; + *yp = -r*(*yp) + z2; + *(statp++) = istat; + } + } + } + + return status; +} + +/*============================================================================ +* ARC: zenithal/azimuthal equidistant projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag ARC +* prj->code "ARC" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->prjx2s Pointer to arcx2s(). +* prj->prjs2x Pointer to arcs2x(). +*===========================================================================*/ + +int arcset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = ARC; + strcpy(prj->code, "ARC"); + + strcpy(prj->name, "zenithal/azimuthal equidistant"); + prj->category = ZENITHAL; + prj->pvrange = 0; + prj->simplezen = 1; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = arcx2s; + prj->prjs2x = arcs2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int arcx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, xj, yj, yj2; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ARC) { + if ((status = arcset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2); + if (r == 0.0) { + *phip = 0.0; + *thetap = 90.0; + } else { + *phip = atan2d(xj, -yj); + *thetap = 90.0 - r*prj->w[1]; + } + + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("arcx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int arcs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, r, sinphi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ARC) { + if ((status = arcset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + r = prj->w[0]*(90.0 - *thetap); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* ZPN: zenithal/azimuthal polynomial projection. +* +* Given: +* prj->pv[] Polynomial coefficients. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag ZPN +* prj->code "ZPN" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->n Degree of the polynomial, N. +* prj->w[0] Co-latitude of the first point of inflection, radian. +* prj->w[1] Radius of the first point of inflection (N > 1), radian. +* prj->prjx2s Pointer to zpnx2s(). +* prj->prjs2x Pointer to zpns2x(). +*===========================================================================*/ + +int zpnset(prj) + +struct prjprm *prj; + +{ + int j, k, m; + double d, d1, d2, r, zd, zd1, zd2; + const double tol = 1.0e-13; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + strcpy(prj->code, "ZPN"); + prj->flag = ZPN; + + if (undefined(prj->pv[1])) prj->pv[1] = 0.0; + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (undefined(prj->pv[3])) prj->pv[3] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "zenithal/azimuthal polynomial"); + prj->category = ZENITHAL; + prj->pvrange = 30; + prj->simplezen = 1; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 0; + + /* Find the highest non-zero coefficient. */ + for (k = PVN-1; k >= 0 && prj->pv[k] == 0.0; k--); + if (k < 0) { + return PRJERR_BAD_PARAM_SET("zpnset"); + } + + prj->n = k; + + if (k < 2) { + /* No point of inflection. */ + prj->w[0] = PI; + + } else { + /* Find the point of inflection closest to the pole. */ + zd1 = 0.0; + d1 = prj->pv[1]; + if (d1 <= 0.0) { + return PRJERR_BAD_PARAM_SET("zpnset"); + } + + /* Find the point where the derivative first goes negative. */ + for (j = 0; j < 180; j++) { + zd2 = j*D2R; + d2 = 0.0; + for (m = k; m > 0; m--) { + d2 = d2*zd2 + m*prj->pv[m]; + } + + if (d2 <= 0.0) break; + zd1 = zd2; + d1 = d2; + } + + if (j == 180) { + /* No negative derivative -> no point of inflection. */ + zd = PI; + prj->global = 1; + } else { + /* Find where the derivative is zero. */ + for (j = 1; j <= 10; j++) { + zd = zd1 - d1*(zd2-zd1)/(d2-d1); + + d = 0.0; + for (m = k; m > 0; m--) { + d = d*zd + m*prj->pv[m]; + } + + if (fabs(d) < tol) break; + + if (d < 0.0) { + zd2 = zd; + d2 = d; + } else { + zd1 = zd; + d1 = d; + } + } + } + + r = 0.0; + for (m = k; m >= 0; m--) { + r = r*zd + prj->pv[m]; + } + prj->w[0] = zd; + prj->w[1] = r; + } + + prj->prjx2s = zpnx2s; + prj->prjs2x = zpns2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int zpnx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int j, k, m, mx, my, rowlen, rowoff, status; + double a, b, c, d, lambda, r, r1, r2, rt, xj, yj, yj2, zd, zd1, zd2; + const double tol = 1.0e-13; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ZPN) { + if ((status = zpnset(prj))) return status; + } + + k = prj->n; + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2)/prj->r0; + if (r == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(xj, -yj); + } + + if (k < 1) { + /* Constant - no solution. */ + return PRJERR_BAD_PARAM_SET("zpnx2s"); + + } else if (k == 1) { + /* Linear. */ + zd = (r - prj->pv[0])/prj->pv[1]; + + } else if (k == 2) { + /* Quadratic. */ + a = prj->pv[2]; + b = prj->pv[1]; + c = prj->pv[0] - r; + + d = b*b - 4.0*a*c; + if (d < 0.0) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + continue; + } + d = sqrt(d); + + /* Choose solution closest to pole. */ + zd1 = (-b + d)/(2.0*a); + zd2 = (-b - d)/(2.0*a); + zd = (zd1zd2) ? zd1 : zd2; + if (zd < 0.0) { + if (zd < -tol) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + continue; + } + zd = 0.0; + } else if (zd > PI) { + if (zd > PI+tol) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + continue; + } + zd = PI; + } + } else { + /* Higher order - solve iteratively. */ + zd1 = 0.0; + r1 = prj->pv[0]; + zd2 = prj->w[0]; + r2 = prj->w[1]; + + if (r < r1) { + if (r < r1-tol) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + continue; + } + zd = zd1; + } else if (r > r2) { + if (r > r2+tol) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + continue; + } + zd = zd2; + } else { + /* Dissect the interval. */ + for (j = 0; j < 100; j++) { + lambda = (r2 - r)/(r2 - r1); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + + zd = zd2 - lambda*(zd2 - zd1); + + rt = 0.0; + for (m = k; m >= 0; m--) { + rt = (rt * zd) + prj->pv[m]; + } + + if (rt < r) { + if (r-rt < tol) break; + r1 = rt; + zd1 = zd; + } else { + if (rt-r < tol) break; + r2 = rt; + zd2 = zd; + } + + if (fabs(zd2-zd1) < tol) break; + } + } + } + + *thetap = 90.0 - zd*R2D; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("zpnx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int zpns2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int m, mphi, mtheta, rowlen, rowoff, status; + double cosphi, r, s, sinphi; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ZPN) { + if ((status = zpnset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + s = (90.0 - *thetap)*D2R; + + r = 0.0; + for (m = prj->n; m >= 0; m--) { + r = r*s + prj->pv[m]; + } + r *= prj->r0; + + /* Bounds checking. */ + istat = 0; + if (prj->bounds&1) { + if (s > prj->w[0]) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("zpns2x"); + } + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* ZEA: zenithal/azimuthal equal area projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag ZEA +* prj->code "ZEA" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 2*r0 +* prj->w[1] 1/(2*r0) +* prj->prjx2s Pointer to zeax2s(). +* prj->prjs2x Pointer to zeas2x(). +*===========================================================================*/ + +int zeaset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = ZEA; + strcpy(prj->code, "ZEA"); + + strcpy(prj->name, "zenithal/azimuthal equal area"); + prj->category = ZENITHAL; + prj->pvrange = 0; + prj->simplezen = 1; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 360.0/PI; + prj->w[1] = PI/360.0; + } else { + prj->w[0] = 2.0*prj->r0; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = zeax2s; + prj->prjs2x = zeas2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int zeax2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, s, xj, yj, yj2; + const double tol = 1.0e-12; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ZEA) { + if ((status = zeaset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2); + if (r == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(xj, -yj); + } + + s = r*prj->w[1]; + if (fabs(s) > 1.0) { + if (fabs(r - prj->w[0]) < tol) { + *thetap = -90.0; + } else { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("zeax2s"); + continue; + } + } else { + *thetap = 90.0 - 2.0*asind(s); + } + + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("zeax2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int zeas2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, r, sinphi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != ZEA) { + if ((status = zeaset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + r = prj->w[0]*sind((90.0 - *thetap)/2.0); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* AIR: Airy's projection. +* +* Given: +* prj->pv[1] Latitude theta_b within which the error is minimized, in +* degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 90.0 if undefined. +* +* Returned: +* prj->flag AIR +* prj->code "AIR" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 2*r0 +* prj->w[1] ln(cos(xi_b))/tan(xi_b)**2, where xi_b = (90-theta_b)/2 +* prj->w[2] 1/2 - prj->w[1] +* prj->w[3] 2*r0*prj->w[2] +* prj->w[4] tol, cutoff for using small angle approximation, in +* radians. +* prj->w[5] prj->w[2]*tol +* prj->w[6] (180/pi)/prj->w[2] +* prj->prjx2s Pointer to airx2s(). +* prj->prjs2x Pointer to airs2x(). +*===========================================================================*/ + +int airset(prj) + +struct prjprm *prj; + +{ + const double tol = 1.0e-4; + double cosxi; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = AIR; + strcpy(prj->code, "AIR"); + + if (undefined(prj->pv[1])) prj->pv[1] = 90.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "Airy's zenithal"); + prj->category = ZENITHAL; + prj->pvrange = 101; + prj->simplezen = 1; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 1; + + prj->w[0] = 2.0*prj->r0; + if (prj->pv[1] == 90.0) { + prj->w[1] = -0.5; + prj->w[2] = 1.0; + } else if (prj->pv[1] > -90.0) { + cosxi = cosd((90.0 - prj->pv[1])/2.0); + prj->w[1] = log(cosxi)*(cosxi*cosxi)/(1.0-cosxi*cosxi); + prj->w[2] = 0.5 - prj->w[1]; + } else { + return PRJERR_BAD_PARAM_SET("airset"); + } + + prj->w[3] = prj->w[0] * prj->w[2]; + prj->w[4] = tol; + prj->w[5] = prj->w[2]*tol; + prj->w[6] = R2D/prj->w[2]; + + prj->prjx2s = airx2s; + prj->prjs2x = airs2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int airx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int k, mx, my, rowlen, rowoff, status; + double cosxi, lambda, r, r1, r2, rt, tanxi, x1, x2, xi, xj, yj, yj2; + const double tol = 1.0e-12; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AIR) { + if ((status = airset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + yj2)/prj->w[0]; + if (r == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(xj, -yj); + } + + + if (r == 0.0) { + xi = 0.0; + } else if (r < prj->w[5]) { + xi = r*prj->w[6]; + } else { + /* Find a solution interval. */ + x1 = x2 = 1.0; + r1 = r2 = 0.0; + for (k = 0; k < 30; k++) { + x2 = x1/2.0; + tanxi = sqrt(1.0-x2*x2)/x2; + r2 = -(log(x2)/tanxi + prj->w[1]*tanxi); + + if (r2 >= r) break; + x1 = x2; + r1 = r2; + } + if (k == 30) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("airx2s"); + continue; + } + + for (k = 0; k < 100; k++) { + /* Weighted division of the interval. */ + lambda = (r2-r)/(r2-r1); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + cosxi = x2 - lambda*(x2-x1); + + tanxi = sqrt(1.0-cosxi*cosxi)/cosxi; + rt = -(log(cosxi)/tanxi + prj->w[1]*tanxi); + + if (rt < r) { + if (r-rt < tol) break; + r1 = rt; + x1 = cosxi; + } else { + if (rt-r < tol) break; + r2 = rt; + x2 = cosxi; + } + } + if (k == 100) { + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("airx2s"); + continue; + } + + xi = acosd(cosxi); + } + + *thetap = 90.0 - 2.0*xi; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("airx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int airs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, cosxi, r, tanxi, xi, sinphi; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AIR) { + if ((status = airset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + istat = 0; + + if (*thetap == 90.0) { + r = 0.0; + } else if (*thetap > -90.0) { + xi = D2R*(90.0 - *thetap)/2.0; + if (xi < prj->w[4]) { + r = xi*prj->w[3]; + } else { + cosxi = cosd((90.0 - *thetap)/2.0); + tanxi = sqrt(1.0 - cosxi*cosxi)/cosxi; + r = -prj->w[0]*(log(cosxi)/tanxi + prj->w[1]*tanxi); + } + } else { + r = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("airs2x"); + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - prj->y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* CYP: cylindrical perspective projection. +* +* Given: +* prj->pv[1] Distance of point of projection from the centre of the +* generating sphere, mu, in units of r0. +* prj->pv[2] Radius of the cylinder of projection, lambda, in units of +* r0. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag CYP +* prj->code "CYP" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*lambda*(pi/180) +* prj->w[1] (180/pi)/(r0*lambda) +* prj->w[2] r0*(mu + lambda) +* prj->w[3] 1/(r0*(mu + lambda)) +* prj->prjx2s Pointer to cypx2s(). +* prj->prjs2x Pointer to cyps2x(). +*===========================================================================*/ + +int cypset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = CYP; + strcpy(prj->code, "CYP"); + + if (undefined(prj->pv[1])) prj->pv[1] = 1.0; + if (undefined(prj->pv[2])) prj->pv[2] = 1.0; + + strcpy(prj->name, "cylindrical perspective"); + prj->category = CYLINDRICAL; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = prj->pv[1] < -1.0 || 0.0 < prj->pv[1]; + prj->divergent = !prj->global; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + + prj->w[0] = prj->pv[2]; + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("cypset"); + } + + prj->w[1] = 1.0/prj->w[0]; + + prj->w[2] = R2D*(prj->pv[1] + prj->pv[2]); + if (prj->w[2] == 0.0) { + return PRJERR_BAD_PARAM_SET("cypset"); + } + + prj->w[3] = 1.0/prj->w[2]; + } else { + prj->w[0] = prj->r0*prj->pv[2]*D2R; + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("cypset"); + } + + prj->w[1] = 1.0/prj->w[0]; + + prj->w[2] = prj->r0*(prj->pv[1] + prj->pv[2]); + if (prj->w[2] == 0.0) { + return PRJERR_BAD_PARAM_SET("cypset"); + } + + prj->w[3] = 1.0/prj->w[2]; + } + + prj->prjx2s = cypx2s; + prj->prjs2x = cyps2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int cypx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double eta, s, t; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CYP) { + if ((status = cypset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1]*(*xp + prj->x0); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + eta = prj->w[3]*(*yp + prj->y0); + t = atan2d(eta,1.0) + asind(eta*prj->pv[1]/sqrt(eta*eta+1.0)); + + for (ix = 0; ix < mx; ix++, thetap += spt) { + *thetap = t; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("cypx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cyps2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, xi; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CYP) { + if ((status = cypset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip) - prj->x0; + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + eta = prj->pv[1] + cosd(*thetap); + + istat = 0; + if (eta == 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cyps2x"); + + } else { + eta = prj->w[2]*sind(*thetap)/eta; + } + + eta -= prj->y0; + for (iphi = 0; iphi < mphi; iphi++, yp += sxy) { + *yp = eta; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* CEA: cylindrical equal area projection. +* +* Given: +* prj->pv[1] Square of the cosine of the latitude at which the +* projection is conformal, lambda. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag CEA +* prj->code "CEA" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->w[2] r0/lambda +* prj->w[3] lambda/r0 +* prj->prjx2s Pointer to ceax2s(). +* prj->prjs2x Pointer to ceas2x(). +*===========================================================================*/ + +int ceaset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = CEA; + strcpy(prj->code, "CEA"); + + if (undefined(prj->pv[1])) prj->pv[1] = 1.0; + + strcpy(prj->name, "cylindrical equal area"); + prj->category = CYLINDRICAL; + prj->pvrange = 101; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + if (prj->pv[1] <= 0.0 || prj->pv[1] > 1.0) { + return PRJERR_BAD_PARAM_SET("ceaset"); + } + prj->w[2] = prj->r0/prj->pv[1]; + prj->w[3] = prj->pv[1]/prj->r0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = R2D/prj->r0; + if (prj->pv[1] <= 0.0 || prj->pv[1] > 1.0) { + return PRJERR_BAD_PARAM_SET("ceaset"); + } + prj->w[2] = prj->r0/prj->pv[1]; + prj->w[3] = prj->pv[1]/prj->r0; + } + + prj->prjx2s = ceax2s; + prj->prjs2x = ceas2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int ceax2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double s; + const double tol = 1.0e-13; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CEA) { + if ((status = ceaset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1]*(*xp + prj->x0); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + s = prj->w[3]*(*yp + prj->y0); + + istat = 0; + if (fabs(s) > 1.0) { + if (fabs(s) > 1.0+tol) { + s = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("ceax2s"); + } else { + s = copysign(90.0, s); + } + } else { + s = asind(s); + } + + for (ix = 0; ix < mx; ix++, thetap += spt) { + *thetap = s; + *(statp++) = istat; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("ceax2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int ceas2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CEA) { + if ((status = ceaset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip) - prj->x0; + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + eta = prj->w[2]*sind(*thetap) - prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, yp += sxy) { + *yp = eta; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* CAR: Plate carree projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag CAR +* prj->code "CAR" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->prjx2s Pointer to carx2s(). +* prj->prjs2x Pointer to cars2x(). +*===========================================================================*/ + +int carset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = CAR; + strcpy(prj->code, "CAR"); + + strcpy(prj->name, "plate caree"); + prj->category = CYLINDRICAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = carx2s; + prj->prjs2x = cars2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int carx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double s, t; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CAR) { + if ((status = carset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1]*(*xp + prj->x0); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + t = prj->w[1]*(*yp + prj->y0); + + for (ix = 0; ix < mx; ix++, thetap += spt) { + *thetap = t; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("carx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cars2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CAR) { + if ((status = carset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip) - prj->x0; + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + eta = prj->w[0]*(*thetap) - prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, yp += sxy) { + *yp = eta; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* MER: Mercator's projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag MER +* prj->code "MER" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->prjx2s Pointer to merx2s(). +* prj->prjs2x Pointer to mers2x(). +*===========================================================================*/ + +int merset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = MER; + strcpy(prj->code, "MER"); + + strcpy(prj->name, "Mercator's"); + prj->category = CYLINDRICAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 1; + prj->global = 0; + prj->divergent = 1; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = merx2s; + prj->prjs2x = mers2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int merx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double s, t; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != MER) { + if ((status = merset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1]*(*xp + prj->x0); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + t = 2.0*atand(exp((*yp + prj->y0)/prj->r0)) - 90.0; + + for (ix = 0; ix < mx; ix++, thetap += spt) { + *thetap = t; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("merx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int mers2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, xi; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != MER) { + if ((status = merset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip) - prj->x0; + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + istat = 0; + + if (*thetap <= -90.0 || *thetap >= 90.0) { + eta = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("mers2x"); + } else { + eta = prj->r0*log(tand((*thetap+90.0)/2.0)) - prj->y0; + } + + for (iphi = 0; iphi < mphi; iphi++, yp += sxy) { + *yp = eta; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* SFL: Sanson-Flamsteed ("global sinusoid") projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag SFL +* prj->code "SFL" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->prjx2s Pointer to sflx2s(). +* prj->prjs2x Pointer to sfls2x(). +*===========================================================================*/ + +int sflset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = SFL; + strcpy(prj->code, "SFL"); + + strcpy(prj->name, "Sanson-Flamsteed"); + prj->category = PSEUDOCYLINDRICAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = sflx2s; + prj->prjs2x = sfls2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int sflx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double s, t, yj; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SFL) { + if ((status = sflset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1]*(*xp + prj->x0); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + s = cos(yj/prj->r0); + + istat = 0; + if (s == 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("sflx2s"); + } else { + s = 1.0/s; + } + + t = prj->w[1]*yj; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + *phip *= s; + *thetap = t; + *(statp++) = istat; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-12, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("sflx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int sfls2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != SFL) { + if ((status = sflset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip); + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + xi = cosd(*thetap); + eta = prj->w[0]*(*thetap) - prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = xi*(*xp) - prj->x0; + *yp = eta; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* PAR: parabolic projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag PAR +* prj->code "PAR" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->w[2] pi*r0 +* prj->w[3] 1/(pi*r0) +* prj->prjx2s Pointer to parx2s(). +* prj->prjs2x Pointer to pars2x(). +*===========================================================================*/ + +int parset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = PAR; + strcpy(prj->code, "PAR"); + + strcpy(prj->name, "parabolic"); + prj->category = PSEUDOCYLINDRICAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + prj->w[2] = 180.0; + prj->w[3] = 1.0/prj->w[2]; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + prj->w[2] = PI*prj->r0; + prj->w[3] = 1.0/prj->w[2]; + } + + prj->prjx2s = parx2s; + prj->prjs2x = pars2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int parx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, s, t, xj; + const double tol = 1.0e-13; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != PAR) { + if ((status = parset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + s = prj->w[1]*xj; + t = fabs(xj) - tol; + + phip = phi + rowoff; + thetap = theta + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + *thetap = t; + phip += rowlen; + thetap += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + r = prj->w[3]*(*yp + prj->y0); + + istat = 0; + if (r > 1.0 || r < -1.0) { + s = 0.0; + t = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("parx2s"); + + } else { + s = 1.0 - 4.0*r*r; + if (s == 0.0) { + /* Deferred test. */ + istat = -1; + } else { + s = 1.0/s; + } + + t = 3.0*asind(r); + } + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + if (istat < 0) { + if (*thetap < 0.0) { + *(statp++) = 0; + } else { + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("parx2s"); + } + } else { + *(statp++) = istat; + } + + *phip *= s; + *thetap = t; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-12, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("parx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int pars2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double eta, s, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != PAR) { + if ((status = parset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0]*(*phip); + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + s = sind((*thetap)/3.0); + xi = (1.0 - 4.0*s*s); + eta = prj->w[2]*s - prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = xi*(*xp) - prj->x0; + *yp = eta; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* MOL: Mollweide's projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag MOL +* prj->code "MOL" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] sqrt(2)*r0 +* prj->w[1] sqrt(2)*r0/90 +* prj->w[2] 1/(sqrt(2)*r0) +* prj->w[3] 90/r0 +* prj->prjx2s Pointer to molx2s(). +* prj->prjs2x Pointer to mols2x(). +*===========================================================================*/ + +int molset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = MOL; + strcpy(prj->code, "MOL"); + + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "Mollweide's"); + prj->category = PSEUDOCYLINDRICAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + prj->w[0] = SQRT2*prj->r0; + prj->w[1] = prj->w[0]/90.0; + prj->w[2] = 1.0/prj->w[0]; + prj->w[3] = 90.0/prj->r0; + prj->w[4] = 2.0/PI; + + prj->prjx2s = molx2s; + prj->prjs2x = mols2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int molx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double r, s, t, xj, y0, yj, z; + const double tol = 1.0e-12; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != MOL) { + if ((status = molset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + s = prj->w[3]*xj; + t = fabs(xj) - tol; + + phip = phi + rowoff; + thetap = theta + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + *thetap = t; + phip += rowlen; + thetap += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + y0 = yj/prj->r0; + r = 2.0 - y0*y0; + + istat = 0; + if (r <= tol) { + if (r < -tol) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("molx2s"); + } else { + /* OK if fabs(x) < tol whence phi = 0.0. */ + istat = -1; + } + + r = 0.0; + s = 0.0; + + } else { + r = sqrt(r); + s = 1.0/r; + } + + z = yj*prj->w[2]; + if (fabs(z) > 1.0) { + if (fabs(z) > 1.0+tol) { + z = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("molx2s"); + } else { + z = copysign(1.0, z) + y0*r/PI; + } + } else { + z = asin(z)*prj->w[4] + y0*r/PI; + } + + if (fabs(z) > 1.0) { + if (fabs(z) > 1.0+tol) { + z = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("molx2s"); + } else { + z = copysign(1.0, z); + } + } + + t = asind(z); + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + if (istat < 0) { + if (*thetap < 0.0) { + *(statp++) = 0; + } else { + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("molx2s"); + } + } else { + *(statp++) = istat; + } + + *phip *= s; + *thetap = t; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-11, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("molx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int mols2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int k, mphi, mtheta, rowlen, rowoff, status; + double eta, gamma, resid, u, v, v0, v1, xi; + const double tol = 1.0e-13; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != MOL) { + if ((status = molset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[1]*(*phip); + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = xi; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + if (fabs(*thetap) == 90.0) { + xi = 0.0; + eta = copysign(prj->w[0], *thetap); + + } else if (*thetap == 0.0) { + xi = 1.0; + eta = 0.0; + + } else { + u = PI*sind(*thetap); + v0 = -PI; + v1 = PI; + v = u; + for (k = 0; k < 100; k++) { + resid = (v - u) + sin(v); + if (resid < 0.0) { + if (resid > -tol) break; + v0 = v; + } else { + if (resid < tol) break; + v1 = v; + } + v = (v0 + v1)/2.0; + } + + gamma = v/2.0; + xi = cos(gamma); + eta = prj->w[0]*sin(gamma); + } + + eta -= prj->y0; + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = xi*(*xp) - prj->x0; + *yp = eta; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* AIT: Hammer-Aitoff projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag AIT +* prj->code "AIT" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] 2*r0**2 +* prj->w[1] 1/(2*r0)**2 +* prj->w[2] 1/(4*r0)**2 +* prj->w[3] 1/(2*r0) +* prj->prjx2s Pointer to aitx2s(). +* prj->prjs2x Pointer to aits2x(). +*===========================================================================*/ + +int aitset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = AIT; + strcpy(prj->code, "AIT"); + + if (prj->r0 == 0.0) prj->r0 = R2D; + + strcpy(prj->name, "Hammer-Aitoff"); + prj->category = CONVENTIONAL; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + prj->w[0] = 2.0*prj->r0*prj->r0; + prj->w[1] = 1.0/(2.0*prj->w[0]); + prj->w[2] = prj->w[1]/4.0; + prj->w[3] = 1.0/(2.0*prj->r0); + + prj->prjx2s = aitx2s; + prj->prjs2x = aits2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int aitx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double s, t, x0, xj, y0, yj, yj2, z; + const double tol = 1.0e-13; + register int ix, iy, istat, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AIT) { + if ((status = aitset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + s = 1.0 - xj*xj*prj->w[2]; + t = xj*prj->w[3]; + + phip = phi + rowoff; + thetap = theta + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = s; + *thetap = t; + phip += rowlen; + thetap += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + yj2 = yj*yj*prj->w[1]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + s = *phip - yj2; + + istat = 0; + if (s < 0.5) { + if (s < 0.5-tol) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("aitx2s"); + } + + s = 0.5; + } + + z = sqrt(s); + x0 = 2.0*z*z - 1.0; + y0 = z*(*thetap); + if (x0 == 0.0 && y0 == 0.0) { + *phip = 0.0; + } else { + *phip = 2.0*atan2d(y0, x0); + } + + t = z*yj/prj->r0; + if (fabs(t) > 1.0) { + if (fabs(t) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("aitx2s"); + } + t = copysign(90.0, t); + + } else { + t = asind(t); + } + + *thetap = t; + *(statp++) = istat; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("aitx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int aits2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cosphi, costhe, sinphi, sinthe, w; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != AIT) { + if ((status = aitset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + w = (*phip)/2.0; + sincosd(w, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinphi; + *yp = cosphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + w = sqrt(prj->w[0]/(1.0 + costhe*(*yp))); + *xp = 2.0*w*costhe*(*xp) - prj->x0; + *yp = w*sinthe - prj->y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* COP: conic perspective projection. +* +* Given: +* prj->pv[1] sigma = (theta2+theta1)/2 +* prj->pv[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the +* latitudes of the standard parallels, in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to sigma if undefined. +* prj->theta0 Reset to sigma if undefined. +* +* Returned: +* prj->flag COP +* prj->code "COP" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] C = sin(sigma) +* prj->w[1] 1/C +* prj->w[2] Y0 = r0*cos(delta)*cot(sigma) +* prj->w[3] r0*cos(delta) +* prj->w[4] 1/(r0*cos(delta) +* prj->w[5] cot(sigma) +* prj->prjx2s Pointer to copx2s(). +* prj->prjs2x Pointer to cops2x(). +*===========================================================================*/ + +int copset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = COP; + strcpy(prj->code, "COP"); + strcpy(prj->name, "conic perspective"); + + if (undefined(prj->pv[1])) { + return PRJERR_BAD_PARAM_SET("copset"); + } + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + prj->category = CONIC; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 0; + prj->divergent = 1; + + prj->w[0] = sind(prj->pv[1]); + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("copset"); + } + + prj->w[1] = 1.0/prj->w[0]; + + prj->w[3] = prj->r0*cosd(prj->pv[2]); + if (prj->w[3] == 0.0) { + return PRJERR_BAD_PARAM_SET("copset"); + } + + prj->w[4] = 1.0/prj->w[3]; + prj->w[5] = 1.0/tand(prj->pv[1]); + + prj->w[2] = prj->w[3]*prj->w[5]; + + prj->prjx2s = copx2s; + prj->prjs2x = cops2x; + + return prjoff(prj, 0.0, prj->pv[1]); +} + +/*--------------------------------------------------------------------------*/ + +int copx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double alpha, dy, dy2, r, xj; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COP) { + if ((status = copset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + dy = prj->w[2] - (*yp + prj->y0); + dy2 = dy*dy; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + dy2); + if (prj->pv[1] < 0.0) r = -r; + + if (r == 0.0) { + alpha = 0.0; + } else { + alpha = atan2d(xj/r, dy/r); + } + + *phip = alpha*prj->w[1]; + *thetap = prj->pv[1] + atand(prj->w[5] - r*prj->w[4]); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("copx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cops2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double alpha, cosalpha, r, s, t, sinalpha, y0; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COP) { + if ((status = copset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + alpha = prj->w[0]*(*phip); + sincosd(alpha, &sinalpha, &cosalpha); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinalpha; + *yp = cosalpha; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + y0 = prj->y0 - prj->w[2]; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + t = *thetap - prj->pv[1]; + s = cosd(t); + + istat = 0; + if (s == 0.0) { + /* Latitude of divergence. */ + r = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cops2x"); + + } else if (fabs(*thetap) == 90.0) { + /* Return an exact value at the poles. */ + r = 0.0; + + /* Bounds checking. */ + if (prj->bounds&1) { + if ((*thetap < 0.0) != (prj->pv[1] < 0.0)) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cops2x"); + } + } + + } else { + r = prj->w[2] - prj->w[3]*sind(t)/s; + + /* Bounds checking. */ + if (prj->bounds&1) { + if (r*prj->w[0] < 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cops2x"); + } + } + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* COE: conic equal area projection. +* +* Given: +* prj->pv[1] sigma = (theta2+theta1)/2 +* prj->pv[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the +* latitudes of the standard parallels, in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to sigma if undefined. +* prj->theta0 Reset to sigma if undefined. +* +* Returned: +* prj->flag COE +* prj->code "COE" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] C = (sin(theta1) + sin(theta2))/2 +* prj->w[1] 1/C +* prj->w[2] Y0 = chi*sqrt(psi - 2C*sind(sigma)) +* prj->w[3] chi = r0/C +* prj->w[4] psi = 1 + sin(theta1)*sin(theta2) +* prj->w[5] 2C +* prj->w[6] (1 + sin(theta1)*sin(theta2))*(r0/C)**2 +* prj->w[7] C/(2*r0**2) +* prj->w[8] chi*sqrt(psi + 2C) +* prj->prjx2s Pointer to coex2s(). +* prj->prjs2x Pointer to coes2x(). +*===========================================================================*/ + +int coeset(prj) + +struct prjprm *prj; + +{ + double theta1, theta2; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = COE; + strcpy(prj->code, "COE"); + strcpy(prj->name, "conic equal area"); + + if (undefined(prj->pv[1])) { + return PRJERR_BAD_PARAM_SET("coeset"); + } + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + prj->category = CONIC; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + theta1 = prj->pv[1] - prj->pv[2]; + theta2 = prj->pv[1] + prj->pv[2]; + + prj->w[0] = (sind(theta1) + sind(theta2))/2.0; + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("coeset"); + } + + prj->w[1] = 1.0/prj->w[0]; + + prj->w[3] = prj->r0/prj->w[0]; + prj->w[4] = 1.0 + sind(theta1)*sind(theta2); + prj->w[5] = 2.0*prj->w[0]; + prj->w[6] = prj->w[3]*prj->w[3]*prj->w[4]; + prj->w[7] = 1.0/(2.0*prj->r0*prj->w[3]); + prj->w[8] = prj->w[3]*sqrt(prj->w[4] + prj->w[5]); + + prj->w[2] = prj->w[3]*sqrt(prj->w[4] - prj->w[5]*sind(prj->pv[1])); + + prj->prjx2s = coex2s; + prj->prjs2x = coes2x; + + return prjoff(prj, 0.0, prj->pv[1]); +} + +/*--------------------------------------------------------------------------*/ + +int coex2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double alpha, dy, dy2, r, t, w, xj; + const double tol = 1.0e-12; + register int ix, iy, istat, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COE) { + if ((status = coeset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + dy = prj->w[2] - (*yp + prj->y0); + dy2 = dy*dy; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + dy2); + if (prj->pv[1] < 0.0) r = -r; + + if (r == 0.0) { + alpha = 0.0; + } else { + alpha = atan2d(xj/r, dy/r); + } + + istat = 0; + if (fabs(r - prj->w[8]) < tol) { + t = -90.0; + } else { + w = (prj->w[6] - r*r)*prj->w[7]; + if (fabs(w) > 1.0) { + if (fabs(w-1.0) < tol) { + t = 90.0; + } else if (fabs(w+1.0) < tol) { + t = -90.0; + } else { + t = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("coex2s"); + } + } else { + t = asind(w); + } + } + + *phip = alpha*prj->w[1]; + *thetap = t; + *(statp++) = istat; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("coex2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int coes2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double alpha, cosalpha, r, sinalpha, y0; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COE) { + if ((status = coeset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + alpha = prj->w[0]*(*phip); + sincosd(alpha, &sinalpha, &cosalpha); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinalpha; + *yp = cosalpha; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + y0 = prj->y0 - prj->w[2]; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + if (*thetap == -90.0) { + r = prj->w[8]; + } else { + r = prj->w[3]*sqrt(prj->w[4] - prj->w[5]*sind(*thetap)); + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* COD: conic equidistant projection. +* +* Given: +* prj->pv[1] sigma = (theta2+theta1)/2 +* prj->pv[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the +* latitudes of the standard parallels, in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to sigma if undefined. +* prj->theta0 Reset to sigma if undefined. +* +* Returned: +* prj->flag COD +* prj->code "COD" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] C = r0*sin(sigma)*sin(delta)/delta +* prj->w[1] 1/C +* prj->w[2] Y0 = delta*cot(delta)*cot(sigma) +* prj->w[3] Y0 + sigma +* prj->prjx2s Pointer to codx2s(). +* prj->prjs2x Pointer to cods2x(). +*===========================================================================*/ + +int codset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = COD; + strcpy(prj->code, "COD"); + strcpy(prj->name, "conic equidistant"); + + if (undefined(prj->pv[1])) { + return PRJERR_BAD_PARAM_SET("codset"); + } + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + prj->category = CONIC; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->pv[2] == 0.0) { + prj->w[0] = prj->r0*sind(prj->pv[1])*D2R; + } else { + prj->w[0] = prj->r0*sind(prj->pv[1])*sind(prj->pv[2])/prj->pv[2]; + } + + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("codset"); + } + + prj->w[1] = 1.0/prj->w[0]; + prj->w[2] = prj->r0*cosd(prj->pv[2])*cosd(prj->pv[1])/prj->w[0]; + prj->w[3] = prj->w[2] + prj->pv[1]; + + prj->prjx2s = codx2s; + prj->prjs2x = cods2x; + + return prjoff(prj, 0.0, prj->pv[1]); +} + +/*--------------------------------------------------------------------------*/ + +int codx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double alpha, dy, dy2, r, xj; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COD) { + if ((status = codset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + dy = prj->w[2] - (*yp + prj->y0); + dy2 = dy*dy; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + dy2); + if (prj->pv[1] < 0.0) r = -r; + + if (r == 0.0) { + alpha = 0.0; + } else { + alpha = atan2d(xj/r, dy/r); + } + + *phip = alpha*prj->w[1]; + *thetap = prj->w[3] - r; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("codx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cods2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double alpha, cosalpha, r, sinalpha, y0; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COD) { + if ((status = codset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + alpha = prj->w[0]*(*phip); + sincosd(alpha, &sinalpha, &cosalpha); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinalpha; + *yp = cosalpha; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + y0 = prj->y0 - prj->w[2]; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + r = prj->w[3] - *thetap; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* COO: conic orthomorphic projection. +* +* Given: +* prj->pv[1] sigma = (theta2+theta1)/2 +* prj->pv[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the +* latitudes of the standard parallels, in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to sigma if undefined. +* prj->theta0 Reset to sigma if undefined. +* +* Returned: +* prj->flag COO +* prj->code "COO" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] C = ln(cos(theta2)/cos(theta1))/ln(tan(tau2)/tan(tau1)) +* where tau1 = (90 - theta1)/2 +* tau2 = (90 - theta2)/2 +* prj->w[1] 1/C +* prj->w[2] Y0 = psi*tan((90-sigma)/2)**C +* prj->w[3] psi = (r0*cos(theta1)/C)/tan(tau1)**C +* prj->w[4] 1/psi +* prj->prjx2s Pointer to coox2s(). +* prj->prjs2x Pointer to coos2x(). +*===========================================================================*/ + +int cooset(prj) + +struct prjprm *prj; + +{ + double cos1, cos2, tan1, tan2, theta1, theta2; + + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = COO; + strcpy(prj->code, "COO"); + strcpy(prj->name, "conic orthomorphic"); + + if (undefined(prj->pv[1])) { + return PRJERR_BAD_PARAM_SET("cooset"); + } + if (undefined(prj->pv[2])) prj->pv[2] = 0.0; + if (prj->r0 == 0.0) prj->r0 = R2D; + + prj->category = CONIC; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 1; + prj->global = 0; + prj->divergent = 1; + + theta1 = prj->pv[1] - prj->pv[2]; + theta2 = prj->pv[1] + prj->pv[2]; + + tan1 = tand((90.0 - theta1)/2.0); + cos1 = cosd(theta1); + + if (theta1 == theta2) { + prj->w[0] = sind(theta1); + } else { + tan2 = tand((90.0 - theta2)/2.0); + cos2 = cosd(theta2); + prj->w[0] = log(cos2/cos1)/log(tan2/tan1); + } + if (prj->w[0] == 0.0) { + return PRJERR_BAD_PARAM_SET("cooset"); + } + + prj->w[1] = 1.0/prj->w[0]; + + prj->w[3] = prj->r0*(cos1/prj->w[0])/pow(tan1,prj->w[0]); + if (prj->w[3] == 0.0) { + return PRJERR_BAD_PARAM_SET("cooset"); + } + prj->w[2] = prj->w[3]*pow(tand((90.0 - prj->pv[1])/2.0),prj->w[0]); + prj->w[4] = 1.0/prj->w[3]; + + prj->prjx2s = coox2s; + prj->prjs2x = coos2x; + + return prjoff(prj, 0.0, prj->pv[1]); +} + +/*--------------------------------------------------------------------------*/ + +int coox2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double alpha, dy, dy2, r, t, xj; + register int ix, iy, istat, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COO) { + if ((status = cooset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + dy = prj->w[2] - (*yp + prj->y0); + dy2 = dy*dy; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + dy2); + if (prj->pv[1] < 0.0) r = -r; + + if (r == 0.0) { + alpha = 0.0; + } else { + alpha = atan2d(xj/r, dy/r); + } + + istat = 0; + if (r == 0.0) { + if (prj->w[0] < 0.0) { + t = -90.0; + } else { + t = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("coox2s"); + } + } else { + t = 90.0 - 2.0*atand(pow(r*prj->w[4],prj->w[1])); + } + + *phip = alpha*prj->w[1]; + *thetap = t; + *(statp++) = istat; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("coox2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int coos2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double alpha, cosalpha, r, sinalpha, y0; + register int iphi, itheta, istat, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != COO) { + if ((status = cooset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + alpha = prj->w[0]*(*phip); + sincosd(alpha, &sinalpha, &cosalpha); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = sinalpha; + *yp = cosalpha; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + y0 = prj->y0 - prj->w[2]; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + istat = 0; + + if (*thetap == -90.0) { + r = 0.0; + if (prj->w[0] >= 0.0) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("coos2x"); + } + } else { + r = prj->w[3]*pow(tand((90.0 - *thetap)/2.0),prj->w[0]); + } + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = r*(*xp) - prj->x0; + *yp = -r*(*yp) - y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* BON: Bonne's projection. +* +* Given: +* prj->pv[1] Bonne conformal latitude, theta1, in degrees. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag BON +* prj->code "BON" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[1] r0*pi/180 +* prj->w[2] Y0 = r0*(cot(theta1) + theta1*pi/180) +* prj->prjx2s Pointer to bonx2s(). +* prj->prjs2x Pointer to bons2x(). +*===========================================================================*/ + +int bonset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = BON; + strcpy(prj->code, "BON"); + strcpy(prj->name, "Bonne's"); + + if (undefined(prj->pv[1])) { + return PRJERR_BAD_PARAM_SET("bonset"); + } + + if (prj->pv[1] == 0.0) { + /* Sanson-Flamsteed. */ + return sflset(prj); + } + + prj->category = POLYCONIC; + prj->pvrange = 101; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[1] = 1.0; + prj->w[2] = prj->r0*cosd(prj->pv[1])/sind(prj->pv[1]) + prj->pv[1]; + } else { + prj->w[1] = prj->r0*D2R; + prj->w[2] = prj->r0*(cosd(prj->pv[1])/sind(prj->pv[1]) + prj->pv[1]*D2R); + } + + prj->prjx2s = bonx2s; + prj->prjs2x = bons2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int bonx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double alpha, dy, dy2, costhe, r, s, t, xj; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->pv[1] == 0.0) { + /* Sanson-Flamsteed. */ + return sflx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat); + } + + if (prj->flag != BON) { + if ((status = bonset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + dy = prj->w[2] - (*yp + prj->y0); + dy2 = dy*dy; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + r = sqrt(xj*xj + dy2); + if (prj->pv[1] < 0.0) r = -r; + + if (r == 0.0) { + alpha = 0.0; + } else { + alpha = atan2d(xj/r, dy/r); + } + + t = (prj->w[2] - r)/prj->w[1]; + costhe = cosd(t); + if (costhe == 0.0) { + s = 0.0; + } else { + s = alpha*(r/prj->r0)/costhe; + } + + *phip = s; + *thetap = t; + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-11, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("bonx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int bons2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double alpha, cosalpha, r, s, sinalpha, y0; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->pv[1] == 0.0) { + /* Sanson-Flamsteed. */ + return sfls2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat); + } + + if (prj->flag != BON) { + if ((status = bonset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + y0 = prj->y0 - prj->w[2]; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + s = prj->r0*(*phip); + + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = s; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + r = prj->w[2] - prj->w[1]*(*thetap); + s = cosd(*thetap)/r; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + alpha = s*(*xp); + sincosd(alpha, &sinalpha, &cosalpha); + *xp = r*sinalpha - prj->x0; + *yp = -r*cosalpha - y0; + *(statp++) = 0; + } + } + + return 0; +} + +/*============================================================================ +* PCO: polyconic projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag PCO +* prj->code "PCO" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->w[2] 2*r0 +* prj->w[3] (pi/180)/(2*r0) +* prj->prjx2s Pointer to pcox2s(). +* prj->prjs2x Pointer to pcos2x(). +*===========================================================================*/ + +int pcoset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = PCO; + strcpy(prj->code, "PCO"); + + strcpy(prj->name, "polyconic"); + prj->category = POLYCONIC; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + prj->w[2] = 360.0/PI; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = 1.0/prj->w[0]; + prj->w[2] = 2.0*prj->r0; + } + prj->w[3] = D2R/prj->w[2]; + + prj->prjx2s = pcox2s; + prj->prjs2x = pcos2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int pcox2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double f, fneg, fpos, lambda, tanthe, the, theneg, thepos, w, x1, xj, xx, + yj, ymthe, y1; + const double tol = 1.0e-12; + register int ix, iy, k, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != PCO) { + if ((status = pcoset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xj = *xp + prj->x0; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xj; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yj = *yp + prj->y0; + w = fabs(yj*prj->w[1]); + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xj = *phip; + + if (w < tol) { + *phip = xj*prj->w[1]; + *thetap = 0.0; + + } else if (fabs(w-90.0) < tol) { + *phip = 0.0; + *thetap = copysign(90.0, yj); + + } else { + if (w < 1.0e-4) { + /* To avoid cot(theta) blowing up near theta == 0. */ + the = yj / (prj->w[0] + prj->w[3]*xj*xj); + ymthe = yj - prj->w[0]*the; + tanthe = tand(the); + + } else { + /* Iterative solution using weighted division of the interval. */ + thepos = yj / prj->w[0]; + theneg = 0.0; + + /* Setting fneg = -fpos halves the interval in the first iter. */ + xx = xj*xj; + fpos = xx; + fneg = -xx; + + for (k = 0; k < 64; k++) { + /* Weighted division of the interval. */ + lambda = fpos/(fpos-fneg); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + the = thepos - lambda*(thepos-theneg); + + /* Compute the residue. */ + ymthe = yj - prj->w[0]*the; + tanthe = tand(the); + f = xx + ymthe*(ymthe - prj->w[2]/tanthe); + + /* Check for convergence. */ + if (fabs(f) < tol) break; + if (fabs(thepos-theneg) < tol) break; + + /* Redefine the interval. */ + if (f > 0.0) { + thepos = the; + fpos = f; + } else { + theneg = the; + fneg = f; + } + } + } + + x1 = prj->r0 - ymthe*tanthe; + y1 = xj*tanthe; + if (x1 == 0.0 && y1 == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(y1, x1)/sind(the); + } + + *thetap = the; + } + + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-12, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("pcox2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int pcos2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double cospsi, costhe, cotthe, sinpsi, sinthe, therad; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != PCO) { + if ((status = pcoset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xp = x + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = *phip; + xp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + if (*thetap == 0.0) { + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = prj->w[0]*(*xp) - prj->x0; + *yp = -prj->y0; + *(statp++) = 0; + } + + } else if (fabs(*thetap) < 1.0e-4) { + /* To avoid cot(theta) blowing up near theta == 0. */ + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *xp = prj->w[0]*(*xp)*cosd(*thetap) - prj->x0; + *yp = (prj->w[0] + prj->w[3]*(*xp)*(*xp))*(*thetap) - prj->y0; + *(statp++) = 0; + } + + } else { + therad = (*thetap)*D2R; + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + sincosd((*xp)*sinthe, &sinpsi, &cospsi); + cotthe = costhe/sinthe; + *xp = prj->r0*cotthe*sinpsi - prj->x0; + *yp = prj->r0*(cotthe*(1.0 - cospsi) + therad) - prj->y0; + *(statp++) = 0; + } + } + } + + return 0; +} + +/*============================================================================ +* TSC: tangential spherical cube projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag TSC +* prj->code "TSC" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/4) +* prj->w[1] (4/pi)/r0 +* prj->prjx2s Pointer to tscx2s(). +* prj->prjs2x Pointer to tscs2x(). +*===========================================================================*/ + +int tscset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = TSC; + strcpy(prj->code, "TSC"); + + strcpy(prj->name, "tangential spherical cube"); + prj->category = QUADCUBE; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 45.0; + prj->w[1] = 1.0/45.0; + } else { + prj->w[0] = prj->r0*PI/4.0; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = tscx2s; + prj->prjs2x = tscs2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int tscx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double l, m, n, xf, yf; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != TSC) { + if ((status = tscset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xf = (*xp + prj->x0)*prj->w[1]; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xf; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yf = (*yp + prj->y0)*prj->w[1]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xf = *phip; + + /* Bounds checking. */ + if (fabs(xf) <= 1.0) { + if (fabs(yf) > 3.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("tscx2s"); + continue; + } + } else { + if (fabs(xf) > 7.0 || fabs(yf) > 1.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("tscx2s"); + continue; + } + } + + /* Map negative faces to the other side. */ + if (xf < -1.0) xf += 8.0; + + /* Determine the face. */ + if (xf > 5.0) { + /* face = 4 */ + xf = xf - 6.0; + m = -1.0/sqrt(1.0 + xf*xf + yf*yf); + l = -m*xf; + n = -m*yf; + } else if (xf > 3.0) { + /* face = 3 */ + xf = xf - 4.0; + l = -1.0/sqrt(1.0 + xf*xf + yf*yf); + m = l*xf; + n = -l*yf; + } else if (xf > 1.0) { + /* face = 2 */ + xf = xf - 2.0; + m = 1.0/sqrt(1.0 + xf*xf + yf*yf); + l = -m*xf; + n = m*yf; + } else if (yf > 1.0) { + /* face = 0 */ + yf = yf - 2.0; + n = 1.0/sqrt(1.0 + xf*xf + yf*yf); + l = -n*yf; + m = n*xf; + } else if (yf < -1.0) { + /* face = 5 */ + yf = yf + 2.0; + n = -1.0/sqrt(1.0 + xf*xf + yf*yf); + l = -n*yf; + m = -n*xf; + } else { + /* face = 1 */ + l = 1.0/sqrt(1.0 + xf*xf + yf*yf); + m = l*xf; + n = l*yf; + } + + if (l == 0.0 && m == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(m, l); + } + + *thetap = asind(n); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("tscx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int tscs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int face, mphi, mtheta, rowlen, rowoff, status; + double cosphi, costhe, l, m, n, sinphi, sinthe, x0, xf, y0, yf, zeta; + const double tol = 1.0e-12; + register int iphi, istat, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != TSC) { + if ((status = tscset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = cosphi; + *yp = sinphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + l = costhe*(*xp); + m = costhe*(*yp); + n = sinthe; + + face = 0; + zeta = n; + if (l > zeta) { + face = 1; + zeta = l; + } + if (m > zeta) { + face = 2; + zeta = m; + } + if (-l > zeta) { + face = 3; + zeta = -l; + } + if (-m > zeta) { + face = 4; + zeta = -m; + } + if (-n > zeta) { + face = 5; + zeta = -n; + } + + switch (face) { + case 1: + xf = m/zeta; + yf = n/zeta; + x0 = 0.0; + y0 = 0.0; + break; + case 2: + xf = -l/zeta; + yf = n/zeta; + x0 = 2.0; + y0 = 0.0; + break; + case 3: + xf = -m/zeta; + yf = n/zeta; + x0 = 4.0; + y0 = 0.0; + break; + case 4: + xf = l/zeta; + yf = n/zeta; + x0 = 6.0; + y0 = 0.0; + break; + case 5: + xf = m/zeta; + yf = l/zeta; + x0 = 0.0; + y0 = -2.0; + break; + default: + /* face == 0 */ + xf = m/zeta; + yf = -l/zeta; + x0 = 0.0; + y0 = 2.0; + break; + } + + istat = 0; + if (fabs(xf) > 1.0) { + if (fabs(xf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("tscs2x"); + } + xf = copysign(1.0, xf); + } + if (fabs(yf) > 1.0) { + if (fabs(yf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("tscs2x"); + } + yf = copysign(1.0, yf); + } + + *xp = prj->w[0]*(xf + x0) - prj->x0; + *yp = prj->w[0]*(yf + y0) - prj->y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* CSC: COBE quadrilateralized spherical cube projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag CSC +* prj->code "CSC" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/4) +* prj->w[1] (4/pi)/r0 +* prj->prjx2s Pointer to cscx2s(). +* prj->prjs2x Pointer to cscs2x(). +*===========================================================================*/ + +int cscset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = CSC; + strcpy(prj->code, "CSC"); + + strcpy(prj->name, "COBE quadrilateralized spherical cube"); + prj->category = QUADCUBE; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 0; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 45.0; + prj->w[1] = 1.0/45.0; + } else { + prj->w[0] = prj->r0*PI/4.0; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = cscx2s; + prj->prjs2x = cscs2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int cscx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int face, mx, my, rowlen, rowoff, status; + double l, m, n, t; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + float chi, psi, xf, xx, yf, yy, z0, z1, z2, z3, z4, z5, z6; + const float p00 = -0.27292696f; + const float p10 = -0.07629969f; + const float p20 = -0.22797056f; + const float p30 = 0.54852384f; + const float p40 = -0.62930065f; + const float p50 = 0.25795794f; + const float p60 = 0.02584375f; + const float p01 = -0.02819452f; + const float p11 = -0.01471565f; + const float p21 = 0.48051509f; + const float p31 = -1.74114454f; + const float p41 = 1.71547508f; + const float p51 = -0.53022337f; + const float p02 = 0.27058160f; + const float p12 = -0.56800938f; + const float p22 = 0.30803317f; + const float p32 = 0.98938102f; + const float p42 = -0.83180469f; + const float p03 = -0.60441560f; + const float p13 = 1.50880086f; + const float p23 = -0.93678576f; + const float p33 = 0.08693841f; + const float p04 = 0.93412077f; + const float p14 = -1.41601920f; + const float p24 = 0.33887446f; + const float p05 = -0.63915306f; + const float p15 = 0.52032238f; + const float p06 = 0.14381585f; + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CSC) { + if ((status = cscset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xf = (float)((*xp + prj->x0)*prj->w[1]); + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xf; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yf = (float)((*yp + prj->y0)*prj->w[1]); + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xf = (float)(*phip); + + /* Bounds checking. */ + if (fabs((double)xf) <= 1.0) { + if (fabs((double)yf) > 3.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("cscx2s"); + continue; + } + } else { + if (fabs((double)xf) > 7.0 || fabs((double)yf) > 1.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("cscx2s"); + continue; + } + } + + /* Map negative faces to the other side. */ + if (xf < -1.0f) xf += 8.0f; + + /* Determine the face. */ + if (xf > 5.0f) { + face = 4; + xf = xf - 6.0f; + } else if (xf > 3.0f) { + face = 3; + xf = xf - 4.0f; + } else if (xf > 1.0f) { + face = 2; + xf = xf - 2.0f; + } else if (yf > 1.0f) { + face = 0; + yf = yf - 2.0f; + } else if (yf < -1.0f) { + face = 5; + yf = yf + 2.0f; + } else { + face = 1; + } + + xx = xf*xf; + yy = yf*yf; + + z0 = p00 + xx*(p10 + xx*(p20 + xx*(p30 + xx*(p40 + xx*(p50 + + xx*(p60)))))); + z1 = p01 + xx*(p11 + xx*(p21 + xx*(p31 + xx*(p41 + xx*(p51))))); + z2 = p02 + xx*(p12 + xx*(p22 + xx*(p32 + xx*(p42)))); + z3 = p03 + xx*(p13 + xx*(p23 + xx*(p33))); + z4 = p04 + xx*(p14 + xx*(p24)); + z5 = p05 + xx*(p15); + z6 = p06; + + chi = z0 + yy*(z1 + yy*(z2 + yy*(z3 + yy*(z4 + yy*(z5 + yy*z6))))); + chi = xf + xf*(1.0f - xx)*chi; + + z0 = p00 + yy*(p10 + yy*(p20 + yy*(p30 + yy*(p40 + yy*(p50 + + yy*(p60)))))); + z1 = p01 + yy*(p11 + yy*(p21 + yy*(p31 + yy*(p41 + yy*(p51))))); + z2 = p02 + yy*(p12 + yy*(p22 + yy*(p32 + yy*(p42)))); + z3 = p03 + yy*(p13 + yy*(p23 + yy*(p33))); + z4 = p04 + yy*(p14 + yy*(p24)); + z5 = p05 + yy*(p15); + z6 = p06; + + psi = z0 + xx*(z1 + xx*(z2 + xx*(z3 + xx*(z4 + xx*(z5 + xx*z6))))); + psi = yf + yf*(1.0f - yy)*psi; + + t = 1.0/sqrt((double)(chi*chi + psi*psi) + 1.0); + switch (face) { + case 1: + l = t; + m = chi*l; + n = psi*l; + break; + case 2: + m = t; + l = -chi*m; + n = psi*m; + break; + case 3: + l = -t; + m = chi*l; + n = -psi*l; + break; + case 4: + m = -t; + l = -chi*m; + n = -psi*m; + break; + case 5: + n = -t; + l = -psi*n; + m = -chi*n; + break; + default: + /* face == 0 */ + n = t; + l = -psi*n; + m = chi*n; + break; + } + + if (l == 0.0 && m == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(m, l); + } + + *thetap = asind(n); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("cscx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cscs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int face, mphi, mtheta, rowlen, rowoff, status; + double cosphi, costhe, eta, l, m, n, sinphi, sinthe, xi, zeta; + const float tol = 1.0e-7; + register int iphi, istat, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + float chi, chi2, chi2psi2, chi4, chipsi, psi, psi2, psi4, chi2co, psi2co, + x0, xf, y0, yf; + const float gstar = 1.37484847732f; + const float mm = 0.004869491981f; + const float gamma = -0.13161671474f; + const float omega1 = -0.159596235474f; + const float d0 = 0.0759196200467f; + const float d1 = -0.0217762490699f; + const float c00 = 0.141189631152f; + const float c10 = 0.0809701286525f; + const float c01 = -0.281528535557f; + const float c11 = 0.15384112876f; + const float c20 = -0.178251207466f; + const float c02 = 0.106959469314f; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != CSC) { + if ((status = cscset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = cosphi; + *yp = sinphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + l = costhe*(*xp); + m = costhe*(*yp); + n = sinthe; + + face = 0; + zeta = n; + if (l > zeta) { + face = 1; + zeta = l; + } + if (m > zeta) { + face = 2; + zeta = m; + } + if (-l > zeta) { + face = 3; + zeta = -l; + } + if (-m > zeta) { + face = 4; + zeta = -m; + } + if (-n > zeta) { + face = 5; + zeta = -n; + } + + switch (face) { + case 1: + xi = m; + eta = n; + x0 = 0.0; + y0 = 0.0; + break; + case 2: + xi = -l; + eta = n; + x0 = 2.0; + y0 = 0.0; + break; + case 3: + xi = -m; + eta = n; + x0 = 4.0; + y0 = 0.0; + break; + case 4: + xi = l; + eta = n; + x0 = 6.0; + y0 = 0.0; + break; + case 5: + xi = m; + eta = l; + x0 = 0.0; + y0 = -2.0; + break; + default: + /* face == 0 */ + xi = m; + eta = -l; + x0 = 0.0; + y0 = 2.0; + break; + } + + chi = (float)( xi/zeta); + psi = (float)(eta/zeta); + + chi2 = chi*chi; + psi2 = psi*psi; + chi2co = 1.0f - chi2; + psi2co = 1.0f - psi2; + + /* Avoid floating underflows. */ + chipsi = (float)fabs((double)(chi*psi)); + chi4 = (chi2 > 1.0e-16f) ? chi2*chi2 : 0.0f; + psi4 = (psi2 > 1.0e-16f) ? psi2*psi2 : 0.0f; + chi2psi2 = (chipsi > 1.0e-16f) ? chi2*psi2 : 0.0f; + + xf = chi*(chi2 + chi2co*(gstar + psi2*(gamma*chi2co + mm*chi2 + + psi2co*(c00 + c10*chi2 + c01*psi2 + c11*chi2psi2 + c20*chi4 + + c02*psi4)) + chi2*(omega1 - chi2co*(d0 + d1*chi2)))); + yf = psi*(psi2 + psi2co*(gstar + chi2*(gamma*psi2co + mm*psi2 + + chi2co*(c00 + c10*psi2 + c01*chi2 + c11*chi2psi2 + c20*psi4 + + c02*chi4)) + psi2*(omega1 - psi2co*(d0 + d1*psi2)))); + + istat = 0; + if (fabs((double)xf) > 1.0) { + if (fabs((double)xf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cscs2x"); + } + xf = (float)copysign(1.0, (double)xf); + } + if (fabs((double)yf) > 1.0) { + if (fabs((double)yf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("cscs2x"); + } + yf = (float)copysign(1.0, (double)yf); + } + + *xp = prj->w[0]*(xf + x0) - prj->x0; + *yp = prj->w[0]*(yf + y0) - prj->y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* QSC: quadrilaterilized spherical cube projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag QSC +* prj->code "QSC" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/4) +* prj->w[1] (4/pi)/r0 +* prj->prjx2s Pointer to qscx2s(). +* prj->prjs2x Pointer to qscs2x(). +*===========================================================================*/ + +int qscset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = QSC; + strcpy(prj->code, "QSC"); + + strcpy(prj->name, "quadrilateralized spherical cube"); + prj->category = QUADCUBE; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 45.0; + prj->w[1] = 1.0/45.0; + } else { + prj->w[0] = prj->r0*PI/4.0; + prj->w[1] = 1.0/prj->w[0]; + } + + prj->prjx2s = qscx2s; + prj->prjs2x = qscs2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int qscx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int direct, face, mx, my, rowlen, rowoff, status; + double cosw, l, m, n, omega, sinw, tau, xf, yf, w, zeco, zeta; + const double tol = 1.0e-12; + register int ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != QSC) { + if ((status = qscset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xf = (*xp + prj->x0)*prj->w[1]; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xf; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yf = (*yp + prj->y0)*prj->w[1]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xf = *phip; + + /* Bounds checking. */ + if (fabs(xf) <= 1.0) { + if (fabs(yf) > 3.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("qscx2s"); + continue; + } + } else { + if (fabs(xf) > 7.0 || fabs(yf) > 1.0) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("qscx2s"); + continue; + } + } + + /* Map negative faces to the other side. */ + if (xf < -1.0) xf += 8.0; + + /* Determine the face. */ + if (xf > 5.0) { + face = 4; + xf -= 6.0; + } else if (xf > 3.0) { + face = 3; + xf -= 4.0; + } else if (xf > 1.0) { + face = 2; + xf -= 2.0; + } else if (yf > 1.0) { + face = 0; + yf -= 2.0; + } else if (yf < -1.0) { + face = 5; + yf += 2.0; + } else { + face = 1; + } + + direct = (fabs(xf) > fabs(yf)); + if (direct) { + if (xf == 0.0) { + omega = 0.0; + tau = 1.0; + zeta = 1.0; + zeco = 0.0; + } else { + w = 15.0*yf/xf; + omega = sind(w)/(cosd(w) - SQRT2INV); + tau = 1.0 + omega*omega; + zeco = xf*xf*(1.0 - 1.0/sqrt(1.0 + tau)); + zeta = 1.0 - zeco; + } + } else { + if (yf == 0.0) { + omega = 0.0; + tau = 1.0; + zeta = 1.0; + zeco = 0.0; + } else { + w = 15.0*xf/yf; + sincosd(w, &sinw, &cosw); + omega = sinw/(cosw - SQRT2INV); + tau = 1.0 + omega*omega; + zeco = yf*yf*(1.0 - 1.0/sqrt(1.0 + tau)); + zeta = 1.0 - zeco; + } + } + + if (zeta < -1.0) { + if (zeta < -1.0-tol) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("qscx2s"); + continue; + } + + zeta = -1.0; + zeco = 2.0; + w = 0.0; + } else { + w = sqrt(zeco*(2.0-zeco)/tau); + } + + switch (face) { + case 1: + l = zeta; + if (direct) { + m = w; + if (xf < 0.0) m = -m; + n = m*omega; + } else { + n = w; + if (yf < 0.0) n = -n; + m = n*omega; + } + break; + case 2: + m = zeta; + if (direct) { + l = w; + if (xf > 0.0) l = -l; + n = -l*omega; + } else { + n = w; + if (yf < 0.0) n = -n; + l = -n*omega; + } + break; + case 3: + l = -zeta; + if (direct) { + m = w; + if (xf > 0.0) m = -m; + n = -m*omega; + } else { + n = w; + if (yf < 0.0) n = -n; + m = -n*omega; + } + break; + case 4: + m = -zeta; + if (direct) { + l = w; + if (xf < 0.0) l = -l; + n = l*omega; + } else { + n = w; + if (yf < 0.0) n = -n; + l = n*omega; + } + break; + case 5: + n = -zeta; + if (direct) { + m = w; + if (xf < 0.0) m = -m; + l = m*omega; + } else { + l = w; + if (yf < 0.0) l = -l; + m = l*omega; + } + break; + default: + /* face == 0 */ + n = zeta; + if (direct) { + m = w; + if (xf < 0.0) m = -m; + l = -m*omega; + } else { + l = w; + if (yf > 0.0) l = -l; + m = -l*omega; + } + break; + } + + if (l == 0.0 && m == 0.0) { + *phip = 0.0; + } else { + *phip = atan2d(m, l); + } + + *thetap = asind(n); + *(statp++) = 0; + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-13, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("qscx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int qscs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int face, mphi, mtheta, rowlen, rowoff, status; + double cosphi, costhe, eta, l, m, n, omega, p, sinphi, sinthe, t, tau, x0, + xf, xi, y0, yf, zeco, zeta; + const double tol = 1.0e-12; + register int iphi, istat, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != QSC) { + if ((status = qscset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + status = 0; + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + sincosd(*phip, &sinphi, &cosphi); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *xp = cosphi; + *yp = sinphi; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + if (fabs(*thetap) == 90.0) { + *xp = -prj->x0; + *yp = copysign(2.0*prj->w[0], *thetap) - prj->y0; + *(statp++) = 0; + continue; + } + + l = costhe*(*xp); + m = costhe*(*yp); + n = sinthe; + + face = 0; + zeta = n; + if (l > zeta) { + face = 1; + zeta = l; + } + if (m > zeta) { + face = 2; + zeta = m; + } + if (-l > zeta) { + face = 3; + zeta = -l; + } + if (-m > zeta) { + face = 4; + zeta = -m; + } + if (-n > zeta) { + face = 5; + zeta = -n; + } + + zeco = 1.0 - zeta; + + switch (face) { + case 1: + xi = m; + eta = n; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (*thetap)*D2R; + p = atan2(*yp, *xp); + zeco = (p*p + t*t)/2.0; + } + x0 = 0.0; + y0 = 0.0; + break; + case 2: + xi = -l; + eta = n; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (*thetap)*D2R; + p = atan2(*yp, *xp) - PI/2.0; + zeco = (p*p + t*t)/2.0; + } + x0 = 2.0; + y0 = 0.0; + break; + case 3: + xi = -m; + eta = n; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (*thetap)*D2R; + p = atan2(*yp, *xp); + p -= copysign(PI, p); + zeco = (p*p + t*t)/2.0; + } + x0 = 4.0; + y0 = 0.0; + break; + case 4: + xi = l; + eta = n; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (*thetap)*D2R; + p = atan2(*yp, *xp) + PI/2.0; + zeco = (p*p + t*t)/2.0; + } + x0 = 6; + y0 = 0.0; + break; + case 5: + xi = m; + eta = l; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (*thetap + 90.0)*D2R; + zeco = t*t/2.0; + } + x0 = 0.0; + y0 = -2; + break; + default: + /* face == 0 */ + xi = m; + eta = -l; + if (zeco < 1.0e-8) { + /* Small angle formula. */ + t = (90.0 - *thetap)*D2R; + zeco = t*t/2.0; + } + x0 = 0.0; + y0 = 2.0; + break; + } + + xf = 0.0; + yf = 0.0; + if (xi != 0.0 || eta != 0.0) { + if (-xi > fabs(eta)) { + omega = eta/xi; + tau = 1.0 + omega*omega; + xf = -sqrt(zeco/(1.0 - 1.0/sqrt(1.0+tau))); + yf = (xf/15.0)*(atand(omega) - asind(omega/sqrt(tau+tau))); + } else if (xi > fabs(eta)) { + omega = eta/xi; + tau = 1.0 + omega*omega; + xf = sqrt(zeco/(1.0 - 1.0/sqrt(1.0+tau))); + yf = (xf/15.0)*(atand(omega) - asind(omega/sqrt(tau+tau))); + } else if (-eta >= fabs(xi)) { + omega = xi/eta; + tau = 1.0 + omega*omega; + yf = -sqrt(zeco/(1.0 - 1.0/sqrt(1.0+tau))); + xf = (yf/15.0)*(atand(omega) - asind(omega/sqrt(tau+tau))); + } else if (eta >= fabs(xi)) { + omega = xi/eta; + tau = 1.0 + omega*omega; + yf = sqrt(zeco/(1.0 - 1.0/sqrt(1.0+tau))); + xf = (yf/15.0)*(atand(omega) - asind(omega/sqrt(tau+tau))); + } + } + + istat = 0; + if (fabs(xf) > 1.0) { + if (fabs(xf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("qscs2x"); + } + xf = copysign(1.0, xf); + } + if (fabs(yf) > 1.0) { + if (fabs(yf) > 1.0+tol) { + istat = 1; + if (!status) status = PRJERR_BAD_WORLD_SET("qscs2x"); + } + yf = copysign(1.0, yf); + } + + *xp = prj->w[0]*(xf + x0) - prj->x0; + *yp = prj->w[0]*(yf + y0) - prj->y0; + *(statp++) = istat; + } + } + + return status; +} + +/*============================================================================ +* HPX: HEALPix projection. +* +* Given: +* prj->pv[1] H - the number of facets in longitude. +* prj->pv[2] K - the number of facets in latitude +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag HPX +* prj->code "HPX" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->m True if H is odd. +* prj->n True if K is odd. +* prj->w[0] r0*(pi/180) +* prj->w[1] (180/pi)/r0 +* prj->w[2] (K-1)/K +* prj->w[3] 90*K/H +* prj->w[4] (K+1)/2 +* prj->w[5] 90*(K-1)/H +* prj->w[6] 180/H +* prj->w[7] H/360 +* prj->w[8] r0*(pi/180)*(90*K/H) +* prj->w[9] r0*(pi/180)*(180/H) +* prj->prjx2s Pointer to hpxx2s(). +* prj->prjs2x Pointer to hpxs2x(). +*===========================================================================*/ + +int hpxset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = HPX; + strcpy(prj->code, "HPX"); + + if (undefined(prj->pv[1])) prj->pv[1] = 4.0; + if (undefined(prj->pv[2])) prj->pv[2] = 3.0; + + strcpy(prj->name, "HEALPix"); + prj->category = HEALPIX; + prj->pvrange = 102; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->pv[1] <= 0.0 || prj->pv[2] <= 0.0) { + return PRJERR_BAD_PARAM_SET("hpxset"); + } + + prj->m = ((int)(prj->pv[1]+0.5))%2; + prj->n = ((int)(prj->pv[2]+0.5))%2; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = R2D/prj->r0; + } + + prj->w[2] = (prj->pv[2] - 1.0) / prj->pv[2]; + prj->w[3] = 90.0 * prj->pv[2] / prj->pv[1]; + prj->w[4] = (prj->pv[2] + 1.0) / 2.0; + prj->w[5] = 90.0 * (prj->pv[2] - 1.0) / prj->pv[1]; + prj->w[6] = 180.0 / prj->pv[1]; + prj->w[7] = prj->pv[1] / 360.0; + prj->w[8] = prj->w[3] * prj->w[0]; + prj->w[9] = prj->w[6] * prj->w[0]; + + prj->prjx2s = hpxx2s; + prj->prjs2x = hpxs2x; + + return prjoff(prj, 0.0, 0.0); +} + +/*--------------------------------------------------------------------------*/ + +int hpxx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int h, mx, my, offset, rowlen, rowoff, status; + double absy, r, s, sigma, slim, t, ylim, yr; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != HPX) { + if ((status = hpxset(prj))) return status; + } + + slim = prj->w[6] + 1e-12; + ylim = prj->w[9] * prj->w[4]; + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + s = prj->w[1] * (*xp + prj->x0); + /* x_c for K odd or theta > 0. */ + t = -180.0 + (2.0 * floor((*xp + 180.0) * prj->w[7]) + 1.0) * prj->w[6]; + t = prj->w[1] * (*xp - t); + + phip = phi + rowoff; + thetap = theta + rowoff; + for (iy = 0; iy < my; iy++) { + /* theta[] is used to hold (x - x_c). */ + *phip = s; + *thetap = t; + phip += rowlen; + thetap += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yr = prj->w[1]*(*yp + prj->y0); + absy = fabs(yr); + + istat = 0; + if (absy <= prj->w[5]) { + /* Equatorial regime. */ + t = asind(yr/prj->w[3]); + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + *thetap = t; + *(statp++) = 0; + } + + } else if (absy <= ylim) { + /* Polar regime. */ + offset = (prj->n || *yp > 0.0) ? 0 : 1; + + sigma = prj->w[4] - absy / prj->w[6]; + + if (sigma == 0.0) { + s = 1e9; + t = 90.0; + + } else { + t = 1.0 - sigma*sigma/prj->pv[2]; + if (t < -1.0) { + s = 0.0; + t = 0.0; + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("hpxx2s"); + } else { + s = 1.0/sigma; + t = asind(t); + } + } + if (*yp < 0.0) t = -t; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + if (offset) { + /* Offset the southern polar half-facets for even K. */ + h = (int)floor(*phip / prj->w[6]) + prj->m; + if (h%2) { + *thetap -= prj->w[6]; + } else { + *thetap += prj->w[6]; + } + } + + /* Recall that theta[] holds (x - x_c). */ + r = s * *thetap; + + /* Bounds checking. */ + if (prj->bounds&2) { + if (slim <= fabs(r)) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("hpxx2s"); + } + } + + if (r != 0.0) r -= *thetap; + *phip += r; + *thetap = t; + + *(statp++) = istat; + } + + } else { + /* Beyond latitude range. */ + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + } + if (!status) status = PRJERR_BAD_PIX_SET("hpxx2s"); + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-12, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("hpxx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int hpxs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int h, mphi, mtheta, offset, rowlen, rowoff, status; + double abssin, eta, sigma, sinthe, t, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != HPX) { + if ((status = hpxset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + xi = prj->w[0] * (*phip) - prj->x0; + + /* phi_c for K odd or theta > 0. */ + t = -180.0 + (2.0*floor((*phip+180.0) * prj->w[7]) + 1.0) * prj->w[6]; + t = prj->w[0] * (*phip - t); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + /* y[] is used to hold (phi - phi_c). */ + *xp = xi; + *yp = t; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sinthe = sind(*thetap); + abssin = fabs(sinthe); + + if (abssin <= prj->w[2]) { + /* Equatorial regime. */ + eta = prj->w[8] * sinthe - prj->y0; + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + *yp = eta; + *(statp++) = 0; + } + + } else { + /* Polar regime. */ + offset = (prj->n || *thetap > 0.0) ? 0 : 1; + + sigma = sqrt(prj->pv[2]*(1.0 - abssin)); + xi = sigma - 1.0; + + eta = prj->w[9] * (prj->w[4] - sigma); + if (*thetap < 0) eta = -eta; + eta -= prj->y0; + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + if (offset) { + /* Offset the southern polar half-facets for even K. */ + h = (int)floor((*xp + prj->x0) / prj->w[9]) + prj->m; + if (h%2) { + *yp -= prj->w[9]; + } else { + *yp += prj->w[9]; + } + } + + /* Recall that y[] holds (phi - phi_c). */ + *xp += *yp * xi; + *yp = eta; + *(statp++) = 0; + + /* Put the phi = 180 meridian in the expected place. */ + if (180.0 < *xp) *xp = 360.0 - *xp; + } + } + } + + return 0; +} + +/*============================================================================ +* XPH: HEALPix polar, aka "butterfly" projection. +* +* Given and/or returned: +* prj->r0 Reset to 180/pi if 0. +* prj->phi0 Reset to 0.0 if undefined. +* prj->theta0 Reset to 0.0 if undefined. +* +* Returned: +* prj->flag XPH +* prj->code "XPH" +* prj->x0 Fiducial offset in x. +* prj->y0 Fiducial offset in y. +* prj->w[0] r0*(pi/180)/sqrt(2) +* prj->w[1] (180/pi)/r0/sqrt(2) +* prj->w[2] 2/3 +* prj->w[3] tol (= 1e-4) +* prj->w[4] sqrt(2/3)*(180/pi) +* prj->w[5] 90 - tol*sqrt(2/3)*(180/pi) +* prj->w[6] sqrt(3/2)*(pi/180) +* prj->prjx2s Pointer to xphx2s(). +* prj->prjs2x Pointer to xphs2x(). +*===========================================================================*/ + +int xphset(prj) + +struct prjprm *prj; + +{ + if (prj == 0x0) return PRJERR_NULL_POINTER; + + prj->flag = XPH; + strcpy(prj->code, "XPH"); + + strcpy(prj->name, "butterfly"); + prj->category = HEALPIX; + prj->pvrange = 0; + prj->simplezen = 0; + prj->equiareal = 1; + prj->conformal = 0; + prj->global = 1; + prj->divergent = 0; + + if (prj->r0 == 0.0) { + prj->r0 = R2D; + prj->w[0] = 1.0; + prj->w[1] = 1.0; + } else { + prj->w[0] = prj->r0*D2R; + prj->w[1] = R2D/prj->r0; + } + + prj->w[0] /= sqrt(2.0); + prj->w[1] /= sqrt(2.0); + prj->w[2] = 2.0/3.0; + prj->w[3] = 1e-4; + prj->w[4] = sqrt(prj->w[2])*R2D; + prj->w[5] = 90.0 - prj->w[3]*prj->w[4]; + prj->w[6] = sqrt(1.5)*D2R; + + prj->prjx2s = xphx2s; + prj->prjs2x = xphs2x; + + return prjoff(prj, 0.0, 90.0); +} + +/*--------------------------------------------------------------------------*/ + +int xphx2s(prj, nx, ny, sxy, spt, x, y, phi, theta, stat) + +struct prjprm *prj; +int nx, ny, sxy, spt; +const double x[], y[]; +double phi[], theta[]; +int stat[]; + +{ + int mx, my, rowlen, rowoff, status; + double abseta, eta, eta1, sigma, xi, xi1, xr, yr; + const double tol = 1.0e-12; + register int istat, ix, iy, *statp; + register const double *xp, *yp; + register double *phip, *thetap; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != XPH) { + if ((status = xphset(prj))) return status; + } + + if (ny > 0) { + mx = nx; + my = ny; + } else { + mx = 1; + my = 1; + ny = nx; + } + + status = 0; + + + /* Do x dependence. */ + xp = x; + rowoff = 0; + rowlen = nx*spt; + for (ix = 0; ix < nx; ix++, rowoff += spt, xp += sxy) { + xr = (*xp + prj->x0)*prj->w[1]; + + phip = phi + rowoff; + for (iy = 0; iy < my; iy++) { + *phip = xr; + phip += rowlen; + } + } + + + /* Do y dependence. */ + yp = y; + phip = phi; + thetap = theta; + statp = stat; + for (iy = 0; iy < ny; iy++, yp += sxy) { + yr = (*yp + prj->y0)*prj->w[1]; + + for (ix = 0; ix < mx; ix++, phip += spt, thetap += spt) { + xr = *phip; + + if (xr <= 0.0 && 0.0 < yr) { + xi1 = -xr - yr; + eta1 = xr - yr; + *phip = -180.0; + } else if (xr < 0.0 && yr <= 0.0) { + xi1 = xr - yr; + eta1 = xr + yr; + *phip = -90.0; + } else if (0.0 <= xr && yr < 0.0) { + xi1 = xr + yr; + eta1 = -xr + yr; + *phip = 0.0; + } else { + xi1 = -xr + yr; + eta1 = -xr - yr; + *phip = 90.0; + } + + xi = xi1 + 45.0; + eta = eta1 + 90.0; + abseta = fabs(eta); + + if (abseta <= 90.0) { + if (abseta <= 45.0) { + /* Equatorial regime. */ + *phip += xi; + *thetap = asind(eta/67.5); + istat = 0; + + /* Bounds checking. */ + if (prj->bounds&2) { + if (45.0+tol < fabs(xi1)) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("xphx2s"); + } + } + + *(statp++) = istat; + + } else { + /* Polar regime. */ + sigma = (90.0 - abseta) / 45.0; + + /* Ensure an exact result for points on the boundary. */ + if (xr == 0.0) { + if (yr <= 0.0) { + *phip = 0.0; + } else { + *phip = 180.0; + } + } else if (yr == 0.0) { + if (xr < 0.0) { + *phip = -90.0; + } else { + *phip = 90.0; + } + } else { + *phip += 45.0 + xi1/sigma; + } + + if (sigma < prj->w[3]) { + *thetap = 90.0 - sigma*prj->w[4]; + } else { + *thetap = asind(1.0 - sigma*sigma/3.0); + } + if (eta < 0.0) *thetap = -(*thetap); + + /* Bounds checking. */ + istat = 0; + if (prj->bounds&2) { + if (eta < -45.0 && eta+90.0+tol < fabs(xi1)) { + istat = 1; + if (!status) status = PRJERR_BAD_PIX_SET("xphx2s"); + } + } + + *(statp++) = istat; + } + + } else { + /* Beyond latitude range. */ + *phip = 0.0; + *thetap = 0.0; + *(statp++) = 1; + if (!status) status = PRJERR_BAD_PIX_SET("xphx2s"); + } + } + } + + + /* Do bounds checking on the native coordinates. */ + if (prj->bounds&4 && prjbchk(1.0e-12, nx, my, spt, phi, theta, stat)) { + if (!status) status = PRJERR_BAD_PIX_SET("xphx2s"); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int xphs2x(prj, nphi, ntheta, spt, sxy, phi, theta, x, y, stat) + +struct prjprm *prj; +int nphi, ntheta, spt, sxy; +const double phi[], theta[]; +double x[], y[]; +int stat[]; + +{ + int mphi, mtheta, rowlen, rowoff, status; + double abssin, chi, eta, psi, sigma, sinthe, xi; + register int iphi, itheta, *statp; + register const double *phip, *thetap; + register double *xp, *yp; + + + /* Initialize. */ + if (prj == 0x0) return PRJERR_NULL_POINTER; + if (prj->flag != XPH) { + if ((status = xphset(prj))) return status; + } + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Do phi dependence. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sxy; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sxy, phip += spt) { + chi = *phip; + if (180.0 <= fabs(chi)) { + chi = fmod(chi, 360.0); + if (chi < -180.0) { + chi += 360.0; + } else if (180.0 <= chi) { + chi -= 360.0; + } + } + + /* phi is also recomputed from chi to avoid rounding problems. */ + chi += 180.0; + psi = fmod(chi, 90.0); + + xp = x + rowoff; + yp = y + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + /* y[] is used to hold phi (rounded). */ + *xp = psi; + *yp = chi - 180.0; + xp += rowlen; + yp += rowlen; + } + } + + + /* Do theta dependence. */ + thetap = theta; + xp = x; + yp = y; + statp = stat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sinthe = sind(*thetap); + abssin = fabs(sinthe); + + for (iphi = 0; iphi < mphi; iphi++, xp += sxy, yp += sxy) { + if (abssin <= prj->w[2]) { + /* Equatorial regime. */ + xi = *xp; + eta = 67.5 * sinthe; + + } else { + /* Polar regime. */ + if (*thetap < prj->w[5]) { + sigma = sqrt(3.0*(1.0 - abssin)); + } else { + sigma = (90.0 - *thetap)*prj->w[6]; + } + + xi = 45.0 + (*xp - 45.0)*sigma; + eta = 45.0 * (2.0 - sigma); + if (*thetap < 0.0) eta = -eta; + } + + xi -= 45.0; + eta -= 90.0; + + /* Recall that y[] holds phi. */ + if (*yp < -90.0) { + *xp = prj->w[0]*(-xi + eta) - prj->x0; + *yp = prj->w[0]*(-xi - eta) - prj->y0; + + } else if (*yp < 0.0) { + *xp = prj->w[0]*(+xi + eta) - prj->x0; + *yp = prj->w[0]*(-xi + eta) - prj->y0; + + } else if (*yp < 90.0) { + *xp = prj->w[0]*( xi - eta) - prj->x0; + *yp = prj->w[0]*( xi + eta) - prj->y0; + + } else { + *xp = prj->w[0]*(-xi - eta) - prj->x0; + *yp = prj->w[0]*( xi - eta) - prj->y0; + } + + *(statp++) = 0; + } + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/prj.h b/testbed/astropy__astropy/cextern/wcslib/C/prj.h new file mode 100644 index 0000000000000000000000000000000000000000..027dc43a03ef3843299c94c23d6ec92e5dee7fa5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/prj.h @@ -0,0 +1,846 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: prj.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the prj routines +* --------------------------- +* Routines in this suite implement the spherical map projections defined by +* the FITS World Coordinate System (WCS) standard, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) += += "Mapping on the HEALPix grid", += Calabretta, M.R., & Roukema, B.F. 2007, MNRAS, 381, 865 (WCS Paper V) += += "Representing the 'Butterfly' Projection in FITS -- Projection Code XPH", += Calabretta, M.R., & Lowe, S.R. 2013, PASA, 30, e050 (WCS Paper VI) +* +* These routines are based on the prjprm struct which contains all information +* needed for the computations. The struct contains some members that must be +* set by the user, and others that are maintained by these routines, somewhat +* like a C++ class but with no encapsulation. +* +* Routine prjini() is provided to initialize the prjprm struct with default +* values, prjfree() reclaims any memory that may have been allocated to store +* an error message, and prjprt() prints its contents. +* +* prjperr() prints the error message(s) (if any) stored in a prjprm struct. +* prjbchk() performs bounds checking on native spherical coordinates. +* +* Setup routines for each projection with names of the form ???set(), where +* "???" is the down-cased three-letter projection code, compute intermediate +* values in the prjprm struct from parameters in it that were supplied by the +* user. The struct always needs to be set by the projection's setup routine +* but that need not be called explicitly - refer to the explanation of +* prjprm::flag. +* +* Each map projection is implemented via separate functions for the spherical +* projection, ???s2x(), and deprojection, ???x2s(). +* +* A set of driver routines, prjset(), prjx2s(), and prjs2x(), provides a +* generic interface to the specific projection routines which they invoke +* via pointers-to-functions stored in the prjprm struct. +* +* In summary, the routines are: +* - prjini() Initialization routine for the prjprm struct. +* - prjfree() Reclaim memory allocated for error messages. +* - prjprt() Print the prjprm struct. +* - prjperr() Print error message (if any). +* - prjbchk() Bounds checking on native coordinates. +* +* - prjset(), prjx2s(), prjs2x(): Generic driver routines +* +* - azpset(), azpx2s(), azps2x(): AZP (zenithal/azimuthal perspective) +* - szpset(), szpx2s(), szps2x(): SZP (slant zenithal perspective) +* - tanset(), tanx2s(), tans2x(): TAN (gnomonic) +* - stgset(), stgx2s(), stgs2x(): STG (stereographic) +* - sinset(), sinx2s(), sins2x(): SIN (orthographic/synthesis) +* - arcset(), arcx2s(), arcs2x(): ARC (zenithal/azimuthal equidistant) +* - zpnset(), zpnx2s(), zpns2x(): ZPN (zenithal/azimuthal polynomial) +* - zeaset(), zeax2s(), zeas2x(): ZEA (zenithal/azimuthal equal area) +* - airset(), airx2s(), airs2x(): AIR (Airy) +* - cypset(), cypx2s(), cyps2x(): CYP (cylindrical perspective) +* - ceaset(), ceax2s(), ceas2x(): CEA (cylindrical equal area) +* - carset(), carx2s(), cars2x(): CAR (Plate carree) +* - merset(), merx2s(), mers2x(): MER (Mercator) +* - sflset(), sflx2s(), sfls2x(): SFL (Sanson-Flamsteed) +* - parset(), parx2s(), pars2x(): PAR (parabolic) +* - molset(), molx2s(), mols2x(): MOL (Mollweide) +* - aitset(), aitx2s(), aits2x(): AIT (Hammer-Aitoff) +* - copset(), copx2s(), cops2x(): COP (conic perspective) +* - coeset(), coex2s(), coes2x(): COE (conic equal area) +* - codset(), codx2s(), cods2x(): COD (conic equidistant) +* - cooset(), coox2s(), coos2x(): COO (conic orthomorphic) +* - bonset(), bonx2s(), bons2x(): BON (Bonne) +* - pcoset(), pcox2s(), pcos2x(): PCO (polyconic) +* - tscset(), tscx2s(), tscs2x(): TSC (tangential spherical cube) +* - cscset(), cscx2s(), cscs2x(): CSC (COBE spherical cube) +* - qscset(), qscx2s(), qscs2x(): QSC (quadrilateralized spherical cube) +* - hpxset(), hpxx2s(), hpxs2x(): HPX (HEALPix) +* - xphset(), xphx2s(), xphs2x(): XPH (HEALPix polar, aka "butterfly") +* +* Argument checking (projection routines): +* ---------------------------------------- +* The values of phi and theta (the native longitude and latitude) normally lie +* in the range [-180,180] for phi, and [-90,90] for theta. However, all +* projection routines will accept any value of phi and will not normalize it. +* +* The projection routines do not explicitly check that theta lies within the +* range [-90,90]. They do check for any value of theta that produces an +* invalid argument to the projection equations (e.g. leading to division by +* zero). The projection routines for AZP, SZP, TAN, SIN, ZPN, and COP also +* return error 2 if (phi,theta) corresponds to the overlapped (far) side of +* the projection but also return the corresponding value of (x,y). This +* strict bounds checking may be relaxed at any time by setting +* prjprm::bounds%2 to 0 (rather than 1); the projections need not be +* reinitialized. +* +* Argument checking (deprojection routines): +* ------------------------------------------ +* Error checking on the projected coordinates (x,y) is limited to that +* required to ascertain whether a solution exists. Where a solution does +* exist, an optional check is made that the value of phi and theta obtained +* lie within the ranges [-180,180] for phi, and [-90,90] for theta. This +* check, performed by prjbchk(), is enabled by default. It may be disabled by +* setting prjprm::bounds%4 to 0 (rather than 1); the projections need not be +* reinitialized. +* +* Accuracy: +* --------- +* No warranty is given for the accuracy of these routines (refer to the +* copyright notice); intending users must satisfy for themselves their +* adequacy for the intended purpose. However, closure to a precision of at +* least 1E-10 degree of longitude and latitude has been verified for typical +* projection parameters on the 1 degree graticule of native longitude and +* latitude (to within 5 degrees of any latitude where the projection may +* diverge). Refer to the tprj1.c and tprj2.c test routines that accompany +* this software. +* +* +* prjini() - Default constructor for the prjprm struct +* ---------------------------------------------------- +* prjini() sets all members of a prjprm struct to default values. It should +* be used to initialize every prjprm struct. +* +* Returned: +* prj struct prjprm* +* Projection parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* +* +* prjfree() - Destructor for the prjprm struct +* -------------------------------------------- +* prjfree() frees any memory that may have been allocated to store an error +* message in the prjprm struct. +* +* Given: +* prj struct prjprm* +* Projection parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* +* +* prjprt() - Print routine for the prjprm struct +* ---------------------------------------------- +* prjprt() prints the contents of a prjprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* prj const struct prjprm* +* Projection parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* +* +* prjperr() - Print error messages from a prjprm struct +* ----------------------------------------------------- +* prjperr() prints the error message(s) (if any) stored in a prjprm struct. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* prj const struct prjprm* +* Projection parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* +* +* prjbchk() - Bounds checking on native coordinates +* ------------------------------------------------- +* prjbchk() performs bounds checking on native spherical coordinates. As +* returned by the deprojection (x2s) routines, native longitude is expected +* to lie in the closed interval [-180,180], with latitude in [-90,90]. +* +* A tolerance may be specified to provide a small allowance for numerical +* imprecision. Values that lie outside the allowed range by not more than +* the specified tolerance will be adjusted back into range. +* +* If prjprm::bounds&4 is set, as it is by prjini(), then prjbchk() will be +* invoked automatically by the Cartesian-to-spherical deprojection (x2s) +* routines with an appropriate tolerance set for each projection. +* +* Given: +* tol double Tolerance for the bounds check [deg]. +* +* nphi, +* ntheta int Vector lengths. +* +* spt int Vector stride. +* +* Given and returned: +* phi,theta double[] Native longitude and latitude (phi,theta) [deg]. +* +* Returned: +* stat int[] Status value for each vector element: +* 0: Valid value of (phi,theta). +* 1: Invalid value. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: One or more of the (phi,theta) coordinates +* were, invalid, as indicated by the stat vector. +* +* +* prjset() - Generic setup routine for the prjprm struct +* ------------------------------------------------------ +* prjset() sets up a prjprm struct according to information supplied within +* it. +* +* Note that this routine need not be called directly; it will be invoked by +* prjx2s() and prjs2x() if prj.flag is anything other than a predefined magic +* value. +* +* The one important distinction between prjset() and the setup routines for +* the specific projections is that the projection code must be defined in the +* prjprm struct in order for prjset() to identify the required projection. +* Once prjset() has initialized the prjprm struct, prjx2s() and prjs2x() use +* the pointers to the specific projection and deprojection routines contained +* therein. +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* prjx2s() - Generic Cartesian-to-spherical deprojection +* ------------------------------------------------------ +* Deproject Cartesian (x,y) coordinates in the plane of projection to native +* spherical coordinates (phi,theta). +* +* The projection is that specified by prjprm::code. +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Given: +* nx,ny int Vector lengths. +* +* sxy,spt int Vector strides. +* +* x,y const double[] +* Projected coordinates. +* +* Returned: +* phi,theta double[] Longitude and latitude (phi,theta) of the projected +* point in native spherical coordinates [deg]. +* +* stat int[] Status value for each vector element: +* 0: Success. +* 1: Invalid value of (x,y). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* 3: One or more of the (x,y) coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* prjs2x() - Generic spherical-to-Cartesian projection +* ---------------------------------------------------- +* Project native spherical coordinates (phi,theta) to Cartesian (x,y) +* coordinates in the plane of projection. +* +* The projection is that specified by prjprm::code. +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Given: +* nphi, +* ntheta int Vector lengths. +* +* spt,sxy int Vector strides. +* +* phi,theta const double[] +* Longitude and latitude (phi,theta) of the projected +* point in native spherical coordinates [deg]. +* +* Returned: +* x,y double[] Projected coordinates. +* +* stat int[] Status value for each vector element: +* 0: Success. +* 1: Invalid value of (phi,theta). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* 4: One or more of the (phi,theta) coordinates +* were, invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* ???set() - Specific setup routines for the prjprm struct +* -------------------------------------------------------- +* Set up a prjprm struct for a particular projection according to information +* supplied within it. +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* ???x2s() - Specific Cartesian-to-spherical deprojection routines +* ---------------------------------------------------------------- +* Transform (x,y) coordinates in the plane of projection to native spherical +* coordinates (phi,theta). +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Given: +* nx,ny int Vector lengths. +* +* sxy,spt int Vector strides. +* +* x,y const double[] +* Projected coordinates. +* +* Returned: +* phi,theta double[] Longitude and latitude of the projected point in +* native spherical coordinates [deg]. +* +* stat int[] Status value for each vector element: +* 0: Success. +* 1: Invalid value of (x,y). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* 3: One or more of the (x,y) coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* ???s2x() - Specific spherical-to-Cartesian projection routines +*--------------------------------------------------------------- +* Transform native spherical coordinates (phi,theta) to (x,y) coordinates in +* the plane of projection. +* +* Given and returned: +* prj struct prjprm* +* Projection parameters. +* +* Given: +* nphi, +* ntheta int Vector lengths. +* +* spt,sxy int Vector strides. +* +* phi,theta const double[] +* Longitude and latitude of the projected point in +* native spherical coordinates [deg]. +* +* Returned: +* x,y double[] Projected coordinates. +* +* stat int[] Status value for each vector element: +* 0: Success. +* 1: Invalid value of (phi,theta). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null prjprm pointer passed. +* 2: Invalid projection parameters. +* 4: One or more of the (phi,theta) coordinates +* were, invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* prjprm::err if enabled, see wcserr_enable(). +* +* +* prjprm struct - Projection parameters +* ------------------------------------- +* The prjprm struct contains all information needed to project or deproject +* native spherical coordinates. It consists of certain members that must be +* set by the user ("given") and others that are set by the WCSLIB routines +* ("returned"). Some of the latter are supplied for informational purposes +* while others are for internal use only. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following prjprm struct members are set or changed: +* +* - prjprm::code, +* - prjprm::r0, +* - prjprm::pv[], +* - prjprm::phi0, +* - prjprm::theta0. +* +* This signals the initialization routine (prjset() or ???set()) to +* recompute the returned members of the prjprm struct. flag will then be +* reset to indicate that this has been done. +* +* Note that flag need not be reset when prjprm::bounds is changed. +* +* char code[4] +* (Given) Three-letter projection code defined by the FITS standard. +* +* double r0 +* (Given) The radius of the generating sphere for the projection, a linear +* scaling parameter. If this is zero, it will be reset to its default +* value of 180/pi (the value for FITS WCS). +* +* double pv[30] +* (Given) Projection parameters. These correspond to the PVi_ma keywords +* in FITS, so pv[0] is PVi_0a, pv[1] is PVi_1a, etc., where i denotes the +* latitude-like axis. Many projections use pv[1] (PVi_1a), some also use +* pv[2] (PVi_2a) and SZP uses pv[3] (PVi_3a). ZPN is currently the only +* projection that uses any of the others. +* +* Usage of the pv[] array as it applies to each projection is described in +* the prologue to each trio of projection routines in prj.c. +* +* double phi0 +* (Given) The native longitude, phi_0 [deg], and ... +* double theta0 +* (Given) ... the native latitude, theta_0 [deg], of the reference point, +* i.e. the point (x,y) = (0,0). If undefined (set to a magic value by +* prjini()) the initialization routine will set this to a +* projection-specific default. +* +* int bounds +* (Given) Controls bounds checking. If bounds&1 then enable strict bounds +* checking for the spherical-to-Cartesian (s2x) transformation for the +* AZP, SZP, TAN, SIN, ZPN, and COP projections. If bounds&2 then enable +* strict bounds checking for the Cartesian-to-spherical transformation +* (x2s) for the HPX and XPH projections. If bounds&4 then the Cartesian- +* to-spherical transformations (x2s) will invoke prjbchk() to perform +* bounds checking on the computed native coordinates, with a tolerance set +* to suit each projection. bounds is set to 7 by prjini() by default +* which enables all checks. Zero it to disable all checking. +* +* It is not necessary to reset the prjprm struct (via prjset() or +* ???set()) when prjprm::bounds is changed. +* +* The remaining members of the prjprm struct are maintained by the setup +* routines and must not be modified elsewhere: +* +* char name[40] +* (Returned) Long name of the projection. +* +* Provided for information only, not used by the projection routines. +* +* int category +* (Returned) Projection category matching the value of the relevant global +* variable: +* +* - ZENITHAL, +* - CYLINDRICAL, +* - PSEUDOCYLINDRICAL, +* - CONVENTIONAL, +* - CONIC, +* - POLYCONIC, +* - QUADCUBE, and +* - HEALPIX. +* +* The category name may be identified via the prj_categories character +* array, e.g. +* += struct prjprm prj; += ... += printf("%s\n", prj_categories[prj.category]); +* +* Provided for information only, not used by the projection routines. +* +* int pvrange +* (Returned) Range of projection parameter indices: 100 times the first +* allowed index plus the number of parameters, e.g. TAN is 0 (no +* parameters), SZP is 103 (1 to 3), and ZPN is 30 (0 to 29). +* +* Provided for information only, not used by the projection routines. +* +* int simplezen +* (Returned) True if the projection is a radially-symmetric zenithal +* projection. +* +* Provided for information only, not used by the projection routines. +* +* int equiareal +* (Returned) True if the projection is equal area. +* +* Provided for information only, not used by the projection routines. +* +* int conformal +* (Returned) True if the projection is conformal. +* +* Provided for information only, not used by the projection routines. +* +* int global +* (Returned) True if the projection can represent the whole sphere in a +* finite, non-overlapped mapping. +* +* Provided for information only, not used by the projection routines. +* +* int divergent +* (Returned) True if the projection diverges in latitude. +* +* Provided for information only, not used by the projection routines. +* +* double x0 +* (Returned) The offset in x, and ... +* double y0 +* (Returned) ... the offset in y used to force (x,y) = (0,0) at +* (phi_0,theta_0). +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* void *padding +* (An unused variable inserted for alignment purposes only.) +* +* double w[10] +* (Returned) Intermediate floating-point values derived from the +* projection parameters, cached here to save recomputation. +* +* Usage of the w[] array as it applies to each projection is described in +* the prologue to each trio of projection routines in prj.c. +* +* int n +* (Returned) Intermediate integer value (used only for the ZPN and HPX +* projections). +* +* int (*prjx2s)(PRJX2S_ARGS) +* (Returned) Pointer to the spherical projection ... +* int (*prjs2x)(PRJ_ARGS) +* (Returned) ... and deprojection routines. +* +* +* Global variable: const char *prj_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_PROJ +#define WCSLIB_PROJ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Total number of projection parameters; 0 to PVN-1. */ +#define PVN 30 + +extern const char *prj_errmsg[]; + +enum prj_errmsg_enum { + PRJERR_SUCCESS = 0, /* Success. */ + PRJERR_NULL_POINTER = 1, /* Null prjprm pointer passed. */ + PRJERR_BAD_PARAM = 2, /* Invalid projection parameters. */ + PRJERR_BAD_PIX = 3, /* One or more of the (x, y) coordinates were + invalid. */ + PRJERR_BAD_WORLD = 4 /* One or more of the (phi, theta) coordinates + were invalid. */ +}; + +extern const int CONIC, CONVENTIONAL, CYLINDRICAL, POLYCONIC, + PSEUDOCYLINDRICAL, QUADCUBE, ZENITHAL, HEALPIX; +extern const char prj_categories[9][32]; + +extern const int prj_ncode; +extern const char prj_codes[28][4]; + +#ifdef PRJX2S_ARGS +#undef PRJX2S_ARGS +#endif + +#ifdef PRJS2X_ARGS +#undef PRJS2X_ARGS +#endif + +/* For use in declaring deprojection function prototypes. */ +#define PRJX2S_ARGS struct prjprm *prj, int nx, int ny, int sxy, int spt, \ +const double x[], const double y[], double phi[], double theta[], int stat[] + +/* For use in declaring projection function prototypes. */ +#define PRJS2X_ARGS struct prjprm *prj, int nx, int ny, int sxy, int spt, \ +const double phi[], const double theta[], double x[], double y[], int stat[] + + +struct prjprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + char code[4]; /* Three-letter projection code. */ + double r0; /* Radius of the generating sphere. */ + double pv[PVN]; /* Projection parameters. */ + double phi0, theta0; /* Fiducial native coordinates. */ + int bounds; /* Controls bounds checking. */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + char name[40]; /* Projection name. */ + int category; /* Projection category. */ + int pvrange; /* Range of projection parameter indices. */ + int simplezen; /* Is it a simple zenithal projection? */ + int equiareal; /* Is it an equal area projection? */ + int conformal; /* Is it a conformal projection? */ + int global; /* Can it map the whole sphere? */ + int divergent; /* Does the projection diverge in latitude? */ + double x0, y0; /* Fiducial offsets. */ + + /* Error handling */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private */ + /*------------------------------------------------------------------------*/ + void *padding; /* (Dummy inserted for alignment purposes.) */ + double w[10]; /* Intermediate values. */ + int m, n; /* Intermediate values. */ + + int (*prjx2s)(PRJX2S_ARGS); /* Pointers to the spherical projection and */ + int (*prjs2x)(PRJS2X_ARGS); /* deprojection functions. */ +}; + +/* Size of the prjprm struct in int units, used by the Fortran wrappers. */ +#define PRJLEN (sizeof(struct prjprm)/sizeof(int)) + + +/* Use the preprocessor to help declare function prototypes (see above). */ +int prjini(struct prjprm *prj); +int prjfree(struct prjprm *prj); +int prjprt(const struct prjprm *prj); +int prjperr(const struct prjprm *prj, const char *prefix); +int prjbchk(double tol, int nphi, int ntheta, int spt, double phi[], + double theta[], int stat[]); + +int prjset(struct prjprm *prj); +int prjx2s(PRJX2S_ARGS); +int prjs2x(PRJS2X_ARGS); + +int azpset(struct prjprm *prj); +int azpx2s(PRJX2S_ARGS); +int azps2x(PRJS2X_ARGS); + +int szpset(struct prjprm *prj); +int szpx2s(PRJX2S_ARGS); +int szps2x(PRJS2X_ARGS); + +int tanset(struct prjprm *prj); +int tanx2s(PRJX2S_ARGS); +int tans2x(PRJS2X_ARGS); + +int stgset(struct prjprm *prj); +int stgx2s(PRJX2S_ARGS); +int stgs2x(PRJS2X_ARGS); + +int sinset(struct prjprm *prj); +int sinx2s(PRJX2S_ARGS); +int sins2x(PRJS2X_ARGS); + +int arcset(struct prjprm *prj); +int arcx2s(PRJX2S_ARGS); +int arcs2x(PRJS2X_ARGS); + +int zpnset(struct prjprm *prj); +int zpnx2s(PRJX2S_ARGS); +int zpns2x(PRJS2X_ARGS); + +int zeaset(struct prjprm *prj); +int zeax2s(PRJX2S_ARGS); +int zeas2x(PRJS2X_ARGS); + +int airset(struct prjprm *prj); +int airx2s(PRJX2S_ARGS); +int airs2x(PRJS2X_ARGS); + +int cypset(struct prjprm *prj); +int cypx2s(PRJX2S_ARGS); +int cyps2x(PRJS2X_ARGS); + +int ceaset(struct prjprm *prj); +int ceax2s(PRJX2S_ARGS); +int ceas2x(PRJS2X_ARGS); + +int carset(struct prjprm *prj); +int carx2s(PRJX2S_ARGS); +int cars2x(PRJS2X_ARGS); + +int merset(struct prjprm *prj); +int merx2s(PRJX2S_ARGS); +int mers2x(PRJS2X_ARGS); + +int sflset(struct prjprm *prj); +int sflx2s(PRJX2S_ARGS); +int sfls2x(PRJS2X_ARGS); + +int parset(struct prjprm *prj); +int parx2s(PRJX2S_ARGS); +int pars2x(PRJS2X_ARGS); + +int molset(struct prjprm *prj); +int molx2s(PRJX2S_ARGS); +int mols2x(PRJS2X_ARGS); + +int aitset(struct prjprm *prj); +int aitx2s(PRJX2S_ARGS); +int aits2x(PRJS2X_ARGS); + +int copset(struct prjprm *prj); +int copx2s(PRJX2S_ARGS); +int cops2x(PRJS2X_ARGS); + +int coeset(struct prjprm *prj); +int coex2s(PRJX2S_ARGS); +int coes2x(PRJS2X_ARGS); + +int codset(struct prjprm *prj); +int codx2s(PRJX2S_ARGS); +int cods2x(PRJS2X_ARGS); + +int cooset(struct prjprm *prj); +int coox2s(PRJX2S_ARGS); +int coos2x(PRJS2X_ARGS); + +int bonset(struct prjprm *prj); +int bonx2s(PRJX2S_ARGS); +int bons2x(PRJS2X_ARGS); + +int pcoset(struct prjprm *prj); +int pcox2s(PRJX2S_ARGS); +int pcos2x(PRJS2X_ARGS); + +int tscset(struct prjprm *prj); +int tscx2s(PRJX2S_ARGS); +int tscs2x(PRJS2X_ARGS); + +int cscset(struct prjprm *prj); +int cscx2s(PRJX2S_ARGS); +int cscs2x(PRJS2X_ARGS); + +int qscset(struct prjprm *prj); +int qscx2s(PRJX2S_ARGS); +int qscs2x(PRJS2X_ARGS); + +int hpxset(struct prjprm *prj); +int hpxx2s(PRJX2S_ARGS); +int hpxs2x(PRJS2X_ARGS); + +int xphset(struct prjprm *prj); +int xphx2s(PRJX2S_ARGS); +int xphs2x(PRJS2X_ARGS); + + +/* Deprecated. */ +#define prjini_errmsg prj_errmsg +#define prjprt_errmsg prj_errmsg +#define prjset_errmsg prj_errmsg +#define prjx2s_errmsg prj_errmsg +#define prjs2x_errmsg prj_errmsg + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_PROJ */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/spc.c b/testbed/astropy__astropy/cextern/wcslib/C/spc.c new file mode 100644 index 0000000000000000000000000000000000000000..6f7fc68b878b0d7a25fc8830353db038a2bd271d --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/spc.c @@ -0,0 +1,1415 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: spc.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcstrig.h" +#include "wcsutil.h" +#include "spc.h" +#include "spx.h" + +/* Spectral algorithm codes. */ +#define F2S 100; /* Axis linear in frequency. */ +#define W2S 200; /* Axis linear in vacuum wavelengths. */ +#define A2S 300; /* Axis linear in air wavelengths. */ +#define V2S 400; /* Axis linear in velocity. */ +#define GRI 500; /* Grism in vacuum. */ +#define GRA 600; /* Grism in air. */ + +/* S-type spectral variables. */ +#define FREQ 0; /* Frequency-like. */ +#define AFRQ 1; /* Frequency-like. */ +#define ENER 2; /* Frequency-like. */ +#define WAVN 3; /* Frequency-like. */ +#define VRAD 4; /* Frequency-like. */ +#define WAVE 10; /* Vacuum wavelength-like. */ +#define VOPT 11; /* Vacuum wavelength-like. */ +#define ZOPT 12; /* Vacuum wavelength-like. */ +#define AWAV 20; /* Air wavelength-like. */ +#define VELO 30; /* Velocity-like. */ +#define BETA 31; /* Velocity-like. */ + + +/* Map status return value to message. */ +const char *spc_errmsg[] = { + "Success", + "Null spcprm pointer passed", + "Invalid spectral parameters", + "One or more of x coordinates were invalid", + "One or more of the spec coordinates were invalid"}; + +/* Map error returns for lower-level routines. SPXERR_BAD_INSPEC_COORD */ +/* maps to either SPCERR_BAD_X or SPCERR_BAD_SPEC depending on context. */ +const int spc_spxerr[] = { + + SPCERR_SUCCESS, /* 0: SPXERR_SUCCESS */ + SPCERR_NULL_POINTER, /* 1: SPXERR_NULL_POINTER */ + SPCERR_BAD_SPEC_PARAMS, /* 2: SPXERR_BAD_SPEC_PARAMS */ + SPCERR_BAD_SPEC_PARAMS /* 3: SPXERR_BAD_SPEC_VAR */ + /* 4: SPXERR_BAD_INSPEC_COORD */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define SPC_ERRMSG(status) WCSERR_SET(status), spc_errmsg[status] + + +#define C 2.99792458e8 + +/*--------------------------------------------------------------------------*/ + +int spcini(struct spcprm *spc) + +{ + register int k; + + if (spc == 0x0) return SPCERR_NULL_POINTER; + + spc->flag = 0; + + memset(spc->type, 0, 8); + strcpy(spc->type, " "); + strcpy(spc->code, " "); + + spc->crval = UNDEFINED; + spc->restfrq = 0.0; + spc->restwav = 0.0; + + for (k = 0; k < 7; k++) { + spc->pv[k] = UNDEFINED; + } + + for (k = 0; k < 6; k++) { + spc->w[k] = 0.0; + } + + spc->isGrism = 0; + spc->padding1 = 0; + + spc->err = 0x0; + + spc->padding2 = 0x0; + spc->spxX2P = 0x0; + spc->spxP2S = 0x0; + spc->spxS2P = 0x0; + spc->spxP2X = 0x0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcfree(struct spcprm *spc) + +{ + if (spc == 0x0) return SPCERR_NULL_POINTER; + + if (spc->err) { + free(spc->err); + spc->err = 0x0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcprt(const struct spcprm *spc) + +{ + char hext[32]; + int i; + + if (spc == 0x0) return SPCERR_NULL_POINTER; + + wcsprintf(" flag: %d\n", spc->flag); + wcsprintf(" type: \"%s\"\n", spc->type); + wcsprintf(" code: \"%s\"\n", spc->code); + if (undefined(spc->crval)) { + wcsprintf(" crval: UNDEFINED\n"); + } else { + wcsprintf(" crval: %#- 11.5g\n", spc->crval); + } + wcsprintf(" restfrq: %f\n", spc->restfrq); + wcsprintf(" restwav: %f\n", spc->restwav); + + wcsprintf(" pv:"); + if (spc->isGrism) { + for (i = 0; i < 5; i++) { + if (undefined(spc->pv[i])) { + wcsprintf(" UNDEFINED "); + } else { + wcsprintf(" %#- 11.5g", spc->pv[i]); + } + } + wcsprintf("\n "); + for (i = 5; i < 7; i++) { + if (undefined(spc->pv[i])) { + wcsprintf(" UNDEFINED "); + } else { + wcsprintf(" %#- 11.5g", spc->pv[i]); + } + } + wcsprintf("\n"); + + } else { + wcsprintf(" (not used)\n"); + } + + wcsprintf(" w:"); + for (i = 0; i < 3; i++) { + wcsprintf(" %#- 11.5g", spc->w[i]); + } + if (spc->isGrism) { + wcsprintf("\n "); + for (i = 3; i < 6; i++) { + wcsprintf(" %#- 11.5g", spc->w[i]); + } + wcsprintf("\n"); + } else { + wcsprintf(" (remainder unused)\n"); + } + + wcsprintf(" isGrism: %d\n", spc->isGrism); + + WCSPRINTF_PTR(" err: ", spc->err, "\n"); + if (spc->err) { + wcserr_prt(spc->err, " "); + } + + wcsprintf(" spxX2P: %s\n", + wcsutil_fptr2str((void (*)(void))spc->spxX2P, hext)); + wcsprintf(" spxP2S: %s\n", + wcsutil_fptr2str((void (*)(void))spc->spxP2S, hext)); + wcsprintf(" spxS2P: %s\n", + wcsutil_fptr2str((void (*)(void))spc->spxS2P, hext)); + wcsprintf(" spxP2X: %s\n", + wcsutil_fptr2str((void (*)(void))spc->spxP2X, hext)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcperr(const struct spcprm *spc, const char *prefix) + +{ + if (spc == 0x0) return SPCERR_NULL_POINTER; + + if (spc->err) { + wcserr_prt(spc->err, prefix); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcset(struct spcprm *spc) + +{ + static const char *function = "spcset"; + + char ctype[9], ptype, xtype; + int restreq, status; + double alpha, beta_r, crvalX, dn_r, dXdS, epsilon, G, m, lambda_r, n_r, + t, restfrq, restwav, theta; + struct wcserr **err; + + if (spc == 0x0) return SPCERR_NULL_POINTER; + err = &(spc->err); + + if (undefined(spc->crval)) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Spectral crval is undefined"); + } + + memset((spc->type)+4, 0, 4); + spc->code[3] = '\0'; + wcsutil_blank_fill(4, spc->type); + wcsutil_blank_fill(3, spc->code); + spc->w[0] = 0.0; + + + /* Analyse the spectral axis type. */ + memset(ctype, 0, 9); + strncpy(ctype, spc->type, 4); + if (*(spc->code) != ' ') { + sprintf(ctype+4, "-%s", spc->code); + } + restfrq = spc->restfrq; + restwav = spc->restwav; + if ((status = spcspxe(ctype, spc->crval, restfrq, restwav, &ptype, &xtype, + &restreq, &crvalX, &dXdS, &(spc->err)))) { + return status; + } + + /* Satisfy rest frequency/wavelength requirements. */ + if (restreq) { + if (restreq == 3 && restfrq == 0.0 && restwav == 0.0) { + /* VRAD-V2F, VOPT-V2W, and ZOPT-V2W require the rest frequency or */ + /* wavelength for the S-P and P-X transformations but not for S-X */ + /* so supply a phoney value. */ + restwav = 1.0; + } + + if (restfrq == 0.0) { + restfrq = C/restwav; + } else { + restwav = C/restfrq; + } + + if (ptype == 'F') { + spc->w[0] = restfrq; + } else if (ptype != 'V') { + spc->w[0] = restwav; + } else { + if (xtype == 'F') { + spc->w[0] = restfrq; + } else { + spc->w[0] = restwav; + } + } + } + + spc->w[1] = crvalX; + spc->w[2] = dXdS; + + + /* Set pointers-to-functions for the linear part of the transformation. */ + if (ptype == 'F') { + if (strcmp(spc->type, "FREQ") == 0) { + /* Frequency. */ + spc->flag = FREQ; + spc->spxP2S = 0x0; + spc->spxS2P = 0x0; + + } else if (strcmp(spc->type, "AFRQ") == 0) { + /* Angular frequency. */ + spc->flag = AFRQ; + spc->spxP2S = freqafrq; + spc->spxS2P = afrqfreq; + + } else if (strcmp(spc->type, "ENER") == 0) { + /* Photon energy. */ + spc->flag = ENER; + spc->spxP2S = freqener; + spc->spxS2P = enerfreq; + + } else if (strcmp(spc->type, "WAVN") == 0) { + /* Wave number. */ + spc->flag = WAVN; + spc->spxP2S = freqwavn; + spc->spxS2P = wavnfreq; + + } else if (strcmp(spc->type, "VRAD") == 0) { + /* Radio velocity. */ + spc->flag = VRAD; + spc->spxP2S = freqvrad; + spc->spxS2P = vradfreq; + } + + } else if (ptype == 'W') { + if (strcmp(spc->type, "WAVE") == 0) { + /* Vacuum wavelengths. */ + spc->flag = WAVE; + spc->spxP2S = 0x0; + spc->spxS2P = 0x0; + + } else if (strcmp(spc->type, "VOPT") == 0) { + /* Optical velocity. */ + spc->flag = VOPT; + spc->spxP2S = wavevopt; + spc->spxS2P = voptwave; + + } else if (strcmp(spc->type, "ZOPT") == 0) { + /* Redshift. */ + spc->flag = ZOPT; + spc->spxP2S = wavezopt; + spc->spxS2P = zoptwave; + } + + } else if (ptype == 'A') { + if (strcmp(spc->type, "AWAV") == 0) { + /* Air wavelengths. */ + spc->flag = AWAV; + spc->spxP2S = 0x0; + spc->spxS2P = 0x0; + } + + } else if (ptype == 'V') { + if (strcmp(spc->type, "VELO") == 0) { + /* Relativistic velocity. */ + spc->flag = VELO; + spc->spxP2S = 0x0; + spc->spxS2P = 0x0; + + } else if (strcmp(spc->type, "BETA") == 0) { + /* Velocity ratio (v/c). */ + spc->flag = BETA; + spc->spxP2S = velobeta; + spc->spxS2P = betavelo; + } + } + + + /* Set pointers-to-functions for the non-linear part of the spectral */ + /* transformation. */ + spc->isGrism = 0; + if (xtype == 'F') { + /* Axis is linear in frequency. */ + if (ptype == 'F') { + spc->spxX2P = 0x0; + spc->spxP2X = 0x0; + + } else if (ptype == 'W') { + spc->spxX2P = freqwave; + spc->spxP2X = wavefreq; + + } else if (ptype == 'A') { + spc->spxX2P = freqawav; + spc->spxP2X = awavfreq; + + } else if (ptype == 'V') { + spc->spxX2P = freqvelo; + spc->spxP2X = velofreq; + } + + spc->flag += F2S; + + } else if (xtype == 'W' || xtype == 'w') { + /* Axis is linear in vacuum wavelengths. */ + if (ptype == 'F') { + spc->spxX2P = wavefreq; + spc->spxP2X = freqwave; + + } else if (ptype == 'W') { + spc->spxX2P = 0x0; + spc->spxP2X = 0x0; + + } else if (ptype == 'A') { + spc->spxX2P = waveawav; + spc->spxP2X = awavwave; + + } else if (ptype == 'V') { + spc->spxX2P = wavevelo; + spc->spxP2X = velowave; + } + + if (xtype == 'W') { + spc->flag += W2S; + } else { + /* Grism in vacuum. */ + spc->isGrism = 1; + spc->flag += GRI; + } + + } else if (xtype == 'A' || xtype == 'a') { + /* Axis is linear in air wavelengths. */ + if (ptype == 'F') { + spc->spxX2P = awavfreq; + spc->spxP2X = freqawav; + + } else if (ptype == 'W') { + spc->spxX2P = awavwave; + spc->spxP2X = waveawav; + + } else if (ptype == 'A') { + spc->spxX2P = 0x0; + spc->spxP2X = 0x0; + + } else if (ptype == 'V') { + spc->spxX2P = awavvelo; + spc->spxP2X = veloawav; + } + + if (xtype == 'A') { + spc->flag += A2S; + } else { + /* Grism in air. */ + spc->isGrism = 2; + spc->flag += GRA; + } + + } else if (xtype == 'V') { + /* Axis is linear in relativistic velocity. */ + if (ptype == 'F') { + spc->spxX2P = velofreq; + spc->spxP2X = freqvelo; + + } else if (ptype == 'W') { + spc->spxX2P = velowave; + spc->spxP2X = wavevelo; + + } else if (ptype == 'A') { + spc->spxX2P = veloawav; + spc->spxP2X = awavvelo; + + } else if (ptype == 'V') { + spc->spxX2P = 0x0; + spc->spxP2X = 0x0; + } + + spc->flag += V2S; + } + + + /* Check for grism axes. */ + if (spc->isGrism) { + /* Axis is linear in "grism parameter"; work in wavelength. */ + lambda_r = crvalX; + + /* Set defaults. */ + if (undefined(spc->pv[0])) spc->pv[0] = 0.0; + if (undefined(spc->pv[1])) spc->pv[1] = 0.0; + if (undefined(spc->pv[2])) spc->pv[2] = 0.0; + if (undefined(spc->pv[3])) spc->pv[3] = 1.0; + if (undefined(spc->pv[4])) spc->pv[4] = 0.0; + if (undefined(spc->pv[5])) spc->pv[5] = 0.0; + if (undefined(spc->pv[6])) spc->pv[6] = 0.0; + + /* Compute intermediaries. */ + G = spc->pv[0]; + m = spc->pv[1]; + alpha = spc->pv[2]; + n_r = spc->pv[3]; + dn_r = spc->pv[4]; + epsilon = spc->pv[5]; + theta = spc->pv[6]; + + t = G*m/cosd(epsilon); + beta_r = asind(t*lambda_r - n_r*sind(alpha)); + + t -= dn_r*sind(alpha); + + spc->w[1] = -tand(theta); + spc->w[2] *= t / (cosd(beta_r)*cosd(theta)*cosd(theta)); + spc->w[3] = beta_r + theta; + spc->w[4] = (n_r - dn_r*lambda_r)*sind(alpha); + spc->w[5] = 1.0 / t; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcx2s( + struct spcprm *spc, + int nx, + int sx, + int sspec, + const double x[], + double spec[], + int stat[]) + +{ + static const char *function = "spcx2s"; + + int statP2S, status = 0, statX2P; + double beta; + register int ix; + register int *statp; + register const double *xp; + register double *specp; + struct wcserr **err; + + /* Initialize. */ + if (spc == 0x0) return SPCERR_NULL_POINTER; + err = &(spc->err); + + if (spc->flag == 0) { + if ((status = spcset(spc))) return status; + } + + /* Convert intermediate world coordinate x to X. */ + xp = x; + specp = spec; + statp = stat; + for (ix = 0; ix < nx; ix++, xp += sx, specp += sspec) { + *specp = spc->w[1] + (*xp)*spc->w[2]; + *(statp++) = 0; + } + + /* If X is the grism parameter then convert it to wavelength. */ + if (spc->isGrism) { + specp = spec; + for (ix = 0; ix < nx; ix++, specp += sspec) { + beta = atand(*specp) + spc->w[3]; + *specp = (sind(beta) + spc->w[4]) * spc->w[5]; + } + } + + /* Apply the non-linear step of the algorithm chain to convert the */ + /* X-type spectral variable to P-type intermediate spectral variable. */ + if (spc->spxX2P) { + if ((statX2P = spc->spxX2P(spc->w[0], nx, sspec, sspec, spec, spec, + stat))) { + if (statX2P == SPXERR_BAD_INSPEC_COORD) { + status = SPCERR_BAD_X; + } else if (statX2P == SPXERR_BAD_SPEC_PARAMS) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral parameters: Frequency or wavelength is 0"); + } else { + return wcserr_set(SPC_ERRMSG(spc_spxerr[statX2P])); + } + } + } + + /* Apply the linear step of the algorithm chain to convert P-type */ + /* intermediate spectral variable to the required S-type variable. */ + if (spc->spxP2S) { + if ((statP2S = spc->spxP2S(spc->w[0], nx, sspec, sspec, spec, spec, + stat))) { + if (statP2S == SPXERR_BAD_INSPEC_COORD) { + status = SPCERR_BAD_X; + } else if (statP2S == SPXERR_BAD_SPEC_PARAMS) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral parameters: Frequency or wavelength is 0"); + } else { + return wcserr_set(SPC_ERRMSG(spc_spxerr[statP2S])); + } + } + } + + if (status) { + wcserr_set(SPC_ERRMSG(status)); + } + return status; +} + +/*--------------------------------------------------------------------------*/ + +int spcs2x( + struct spcprm *spc, + int nspec, + int sspec, + int sx, + const double spec[], + double x[], + int stat[]) + +{ + static const char *function = "spcs2x"; + + int statP2X, status = 0, statS2P; + double beta, s; + register int ispec; + register int *statp; + register const double *specp; + register double *xp; + struct wcserr **err; + + /* Initialize. */ + if (spc == 0x0) return SPCERR_NULL_POINTER; + err = &(spc->err); + + if (spc->flag == 0) { + if ((status = spcset(spc))) return status; + } + + /* Apply the linear step of the algorithm chain to convert the S-type */ + /* spectral variable to P-type intermediate spectral variable. */ + if (spc->spxS2P) { + if ((statS2P = spc->spxS2P(spc->w[0], nspec, sspec, sx, spec, x, stat))) { + if (statS2P == SPXERR_BAD_INSPEC_COORD) { + status = SPCERR_BAD_SPEC; + } else if (statS2P == SPXERR_BAD_SPEC_PARAMS) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral parameters: Frequency or wavelength is 0"); + } else { + return wcserr_set(SPC_ERRMSG(spc_spxerr[statS2P])); + } + } + + } else { + /* Just a copy. */ + xp = x; + specp = spec; + statp = stat; + for (ispec = 0; ispec < nspec; ispec++, specp += sspec, xp += sx) { + *xp = *specp; + *(statp++) = 0; + } + } + + + /* Apply the non-linear step of the algorithm chain to convert P-type */ + /* intermediate spectral variable to X-type spectral variable. */ + if (spc->spxP2X) { + if ((statP2X = spc->spxP2X(spc->w[0], nspec, sx, sx, x, x, stat))) { + if (statP2X == SPCERR_BAD_SPEC) { + status = SPCERR_BAD_SPEC; + } else if (statP2X == SPXERR_BAD_SPEC_PARAMS) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral parameters: Frequency or wavelength is 0"); + } else { + return wcserr_set(SPC_ERRMSG(spc_spxerr[statP2X])); + } + } + } + + if (spc->isGrism) { + /* Convert X-type spectral variable (wavelength) to grism parameter. */ + xp = x; + statp = stat; + for (ispec = 0; ispec < nspec; ispec++, xp += sx, statp++) { + if (*statp) continue; + + s = *xp/spc->w[5] - spc->w[4]; + if (fabs(s) <= 1.0) { + beta = asind(s); + *xp = tand(beta - spc->w[3]); + } else { + *statp = 1; + } + } + } + + + /* Convert X-type spectral variable to intermediate world coordinate x. */ + xp = x; + statp = stat; + for (ispec = 0; ispec < nspec; ispec++, xp += sx) { + if (*(statp++)) continue; + + *xp -= spc->w[1]; + *xp /= spc->w[2]; + } + + if (status) { + wcserr_set(SPC_ERRMSG(status)); + } + return status; +} + +/*--------------------------------------------------------------------------*/ + +int spctyp( + const char ctypei[9], + char stype[], + char scode[], + char sname[], + char units[], + char *ptype, + char *xtype, + int *restreq) + +{ + return spctype( + ctypei, stype, scode, sname, units, ptype, xtype, restreq, NULL); +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int spctype( + const char ctypei[9], + char stype[], + char scode[], + char sname[], + char units[], + char *ptype, + char *xtype, + int *restreq, + struct wcserr **err) + +{ + static const char *function = "spctype"; + + char ctype[9], ptype_t, sname_t[32], units_t[8], xtype_t; + int restreq_t = 0; + + if (err) *err = 0x0; + + /* Copy with blank padding. */ + sprintf(ctype, "%-8.8s", ctypei); + ctype[8] = '\0'; + + /* Validate the S-type spectral variable. */ + if (strncmp(ctype, "FREQ", 4) == 0) { + strcpy(sname_t, "Frequency"); + strcpy(units_t, "Hz"); + ptype_t = 'F'; + } else if (strncmp(ctype, "AFRQ", 4) == 0) { + strcpy(sname_t, "Angular frequency"); + strcpy(units_t, "rad/s"); + ptype_t = 'F'; + } else if (strncmp(ctype, "ENER", 4) == 0) { + strcpy(sname_t, "Photon energy"); + strcpy(units_t, "J"); + ptype_t = 'F'; + } else if (strncmp(ctype, "WAVN", 4) == 0) { + strcpy(sname_t, "Wavenumber"); + strcpy(units_t, "/m"); + ptype_t = 'F'; + } else if (strncmp(ctype, "VRAD", 4) == 0) { + strcpy(sname_t, "Radio velocity"); + strcpy(units_t, "m/s"); + ptype_t = 'F'; + restreq_t = 1; + } else if (strncmp(ctype, "WAVE", 4) == 0) { + strcpy(sname_t, "Vacuum wavelength"); + strcpy(units_t, "m"); + ptype_t = 'W'; + } else if (strncmp(ctype, "VOPT", 4) == 0) { + strcpy(sname_t, "Optical velocity"); + strcpy(units_t, "m/s"); + ptype_t = 'W'; + restreq_t = 1; + } else if (strncmp(ctype, "ZOPT", 4) == 0) { + strcpy(sname_t, "Redshift"); + strcpy(units_t, ""); + ptype_t = 'W'; + restreq_t = 1; + } else if (strncmp(ctype, "AWAV", 4) == 0) { + strcpy(sname_t, "Air wavelength"); + strcpy(units_t, "m"); + ptype_t = 'A'; + } else if (strncmp(ctype, "VELO", 4) == 0) { + strcpy(sname_t, "Relativistic velocity"); + strcpy(units_t, "m/s"); + ptype_t = 'V'; + } else if (strncmp(ctype, "BETA", 4) == 0) { + strcpy(sname_t, "Velocity ratio (v/c)"); + strcpy(units_t, ""); + ptype_t = 'V'; + } else { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Unknown spectral type '%s'", ctype); + } + + + /* Determine X-type and validate the spectral algorithm code. */ + if ((xtype_t = ctype[5]) == ' ') { + /* The algorithm code must be completely blank. */ + if (strcmp(ctype+4, " ") != 0) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral algorithm '%s'", ctype+4); + } + + xtype_t = ptype_t; + + } else if (ctype[4] != '-') { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral type '%s'", ctype); + + } else if (strcmp(ctype+5, "LOG") == 0 || strcmp(ctype+5, "TAB") == 0) { + /* Logarithmic or tabular axis, not linear in any spectral type. */ + + } else if (xtype_t == 'G') { + /* Validate the algorithm code. */ + if (ctype[6] != 'R') { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral algorithm '%s'", xtype_t); + } + + /* Grism coordinates... */ + if (ctype[7] == 'I') { + /* ...in vacuum. */ + xtype_t = 'w'; + } else if (ctype[7] == 'A') { + /* ...in air. */ + xtype_t = 'a'; + } else { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral algorithm '%s'", xtype_t); + } + + } else if (ctype[6] != '2') { + /* Algorithm code has invalid syntax. */ + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Invalid spectral algorithm syntax '%s'", xtype_t); + } else if (ctype[7] != ptype_t && ctype[7] != '?') { + /* The P-, and S-type variables are inconsistent. */ + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "In spectral type '%s', P- and S-type variables are inconsistent", + ctype); + + } else if (ctype[7] == ctype[5]) { + /* Degenerate algorithm code. */ + sprintf(ctype+4, " "); + } + + + /* Rest freq/wavelength required for transformation between P and X? */ + if (strchr("FWAwa", (int)xtype_t)) { + if (ptype_t == 'V') { + restreq_t += 2; + } + } else if (xtype_t == 'V') { + if (strchr("FWAwa", (int)ptype_t)) { + restreq_t += 2; + } + } else if (strchr("LT", (int)xtype_t) == 0) { + /* Invalid X-type variable code. */ + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "In spectral type '%s', invalid X-type variable code", ctype); + } + + + /* Copy results. */ + if (stype) { + strncpy(stype, ctype, 4); + stype[4] = '\0'; + } + if (scode) strcpy(scode, ctype+5); + if (sname) strcpy(sname, sname_t); + if (units) strcpy(units, units_t); + if (ptype) *ptype = ptype_t; + if (xtype) *xtype = xtype_t; + if (restreq) *restreq = restreq_t; + + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcspx( + const char ctypeS[9], + double crvalS, + double restfrq, + double restwav, + char *ptype, + char *xtype, + int *restreq, + double *crvalX, + double *dXdS) + +{ + return spcspxe(ctypeS, crvalS, restfrq, restwav, ptype, xtype, restreq, + crvalX, dXdS, 0x0); +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int spcspxe( + const char ctypeS[9], + double crvalS, + double restfrq, + double restwav, + char *ptype, + char *xtype, + int *restreq, + double *crvalX, + double *dXdS, + struct wcserr **err) + +{ + static const char *function = "spcspxe"; + + char scode[4], stype[5], type[8]; + int status; + double dPdS, dXdP; + struct spxprm spx; + + + /* Analyse the spectral axis code. */ + if ((status = spctype(ctypeS, stype, scode, 0x0, 0x0, ptype, xtype, restreq, + err))) { + return status; + } + + if (strchr("LT", (int)(*xtype))) { + /* Can't handle logarithmic or tabular coordinates. */ + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Can't handle logarithmic or tabular coordinates"); + } + + /* Do we have rest frequency and/or wavelength as required? */ + if ((*restreq)%3 && restfrq == 0.0 && restwav == 0.0) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Missing required rest frequency or wavelength"); + } + + /* Compute all spectral parameters and their derivatives. */ + strcpy(type, stype); + spx.err = (err ? *err : 0x0); + if ((status = specx(type, crvalS, restfrq, restwav, &spx))) { + status = spc_spxerr[status]; + if (err) { + if ((*err = spx.err)) { + (*err)->status = status; + } + } else { + free(spx.err); + } + return status; + } + + + /* Transform S-P (linear) and P-X (non-linear). */ + dPdS = 0.0; + dXdP = 0.0; + if (*ptype == 'F') { + if (strcmp(stype, "FREQ") == 0) { + dPdS = 1.0; + } else if (strcmp(stype, "AFRQ") == 0) { + dPdS = spx.dfreqafrq; + } else if (strcmp(stype, "ENER") == 0) { + dPdS = spx.dfreqener; + } else if (strcmp(stype, "WAVN") == 0) { + dPdS = spx.dfreqwavn; + } else if (strcmp(stype, "VRAD") == 0) { + dPdS = spx.dfreqvrad; + } + + if (*xtype == 'F') { + *crvalX = spx.freq; + dXdP = 1.0; + } else if (*xtype == 'W' || *xtype == 'w') { + *crvalX = spx.wave; + dXdP = spx.dwavefreq; + } else if (*xtype == 'A' || *xtype == 'a') { + *crvalX = spx.awav; + dXdP = spx.dawavfreq; + } else if (*xtype == 'V') { + *crvalX = spx.velo; + dXdP = spx.dvelofreq; + } + + } else if (*ptype == 'W' || *ptype == 'w') { + if (strcmp(stype, "WAVE") == 0) { + dPdS = 1.0; + } else if (strcmp(stype, "VOPT") == 0) { + dPdS = spx.dwavevopt; + } else if (strcmp(stype, "ZOPT") == 0) { + dPdS = spx.dwavezopt; + } + + if (*xtype == 'F') { + *crvalX = spx.freq; + dXdP = spx.dfreqwave; + } else if (*xtype == 'W' || *xtype == 'w') { + *crvalX = spx.wave; + dXdP = 1.0; + } else if (*xtype == 'A' || *xtype == 'a') { + *crvalX = spx.awav; + dXdP = spx.dawavwave; + } else if (*xtype == 'V') { + *crvalX = spx.velo; + dXdP = spx.dvelowave; + } + + } else if (*ptype == 'A' || *ptype == 'a') { + if (strcmp(stype, "AWAV") == 0) { + dPdS = 1.0; + } + + if (*xtype == 'F') { + *crvalX = spx.freq; + dXdP = spx.dfreqawav; + } else if (*xtype == 'W' || *xtype == 'w') { + *crvalX = spx.wave; + dXdP = spx.dwaveawav; + } else if (*xtype == 'A' || *xtype == 'a') { + *crvalX = spx.awav; + dXdP = 1.0; + } else if (*xtype == 'V') { + *crvalX = spx.velo; + dXdP = spx.dveloawav; + } + + } else if (*ptype == 'V') { + if (strcmp(stype, "VELO") == 0) { + dPdS = 1.0; + } else if (strcmp(stype, "BETA") == 0) { + dPdS = spx.dvelobeta; + } + + if (*xtype == 'F') { + *crvalX = spx.freq; + dXdP = spx.dfreqvelo; + } else if (*xtype == 'W' || *xtype == 'w') { + *crvalX = spx.wave; + dXdP = spx.dwavevelo; + } else if (*xtype == 'A' || *xtype == 'a') { + *crvalX = spx.awav; + dXdP = spx.dawavvelo; + } else if (*xtype == 'V') { + *crvalX = spx.velo; + dXdP = 1.0; + } + } + + *dXdS = dXdP * dPdS; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcxps( + const char ctypeS[9], + double crvalX, + double restfrq, + double restwav, + char *ptype, + char *xtype, + int *restreq, + double *crvalS, + double *dSdX) + +{ + return spcxpse(ctypeS, crvalX, restfrq, restwav, ptype, xtype, restreq, + crvalS, dSdX, NULL); +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int spcxpse( + const char ctypeS[9], + double crvalX, + double restfrq, + double restwav, + char *ptype, + char *xtype, + int *restreq, + double *crvalS, + double *dSdX, + struct wcserr **err) + +{ + static const char *function = "spcxpse"; + + char scode[4], stype[5], type[8]; + int status; + double dPdX, dSdP; + struct spxprm spx; + + /* Analyse the spectral axis type. */ + if ((status = spctype(ctypeS, stype, scode, 0x0, 0x0, ptype, xtype, restreq, + err))) { + return status; + } + + if (strchr("LT", (int)(*xtype))) { + /* Can't handle logarithmic or tabular coordinates. */ + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Can't handle logarithmic or tabular coordinates"); + } + + /* Do we have rest frequency and/or wavelength as required? */ + if ((*restreq)%3 && restfrq == 0.0 && restwav == 0.0) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Missing required rest frequency or wavelength"); + } + + /* Compute all spectral parameters and their derivatives. */ + if (*xtype == 'F') { + strcpy(type, "FREQ"); + } else if (*xtype == 'W' || *xtype == 'w') { + strcpy(type, "WAVE"); + } else if (*xtype == 'A' || *xtype == 'a') { + strcpy(type, "AWAV"); + } else if (*xtype == 'V') { + strcpy(type, "VELO"); + } + + spx.err = (err ? *err : 0x0); + if (specx(type, crvalX, restfrq, restwav, &spx)) { + status = spc_spxerr[status]; + if (err) { + if ((*err = spx.err)) { + (*err)->status = status; + } + } else { + free(spx.err); + } + return status; + } + + + /* Transform X-P (non-linear) and P-S (linear). */ + dPdX = 0.0; + dSdP = 0.0; + if (*ptype == 'F') { + if (*xtype == 'F') { + dPdX = 1.0; + } else if (*xtype == 'W' || *xtype == 'w') { + dPdX = spx.dfreqwave; + } else if (*xtype == 'A' || *xtype == 'a') { + dPdX = spx.dfreqawav; + } else if (*xtype == 'V') { + dPdX = spx.dfreqvelo; + } + + if (strcmp(stype, "FREQ") == 0) { + *crvalS = spx.freq; + dSdP = 1.0; + } else if (strcmp(stype, "AFRQ") == 0) { + *crvalS = spx.afrq; + dSdP = spx.dafrqfreq; + } else if (strcmp(stype, "ENER") == 0) { + *crvalS = spx.ener; + dSdP = spx.denerfreq; + } else if (strcmp(stype, "WAVN") == 0) { + *crvalS = spx.wavn; + dSdP = spx.dwavnfreq; + } else if (strcmp(stype, "VRAD") == 0) { + *crvalS = spx.vrad; + dSdP = spx.dvradfreq; + } + + } else if (*ptype == 'W') { + if (*xtype == 'F') { + dPdX = spx.dwavefreq; + } else if (*xtype == 'W' || *xtype == 'w') { + dPdX = 1.0; + } else if (*xtype == 'A' || *xtype == 'a') { + dPdX = spx.dwaveawav; + } else if (*xtype == 'V') { + dPdX = spx.dwavevelo; + } + + if (strcmp(stype, "WAVE") == 0) { + *crvalS = spx.wave; + dSdP = 1.0; + } else if (strcmp(stype, "VOPT") == 0) { + *crvalS = spx.vopt; + dSdP = spx.dvoptwave; + } else if (strcmp(stype, "ZOPT") == 0) { + *crvalS = spx.zopt; + dSdP = spx.dzoptwave; + } + + } else if (*ptype == 'A') { + if (*xtype == 'F') { + dPdX = spx.dawavfreq; + } else if (*xtype == 'W' || *xtype == 'w') { + dPdX = spx.dawavwave; + } else if (*xtype == 'A' || *xtype == 'a') { + dPdX = 1.0; + } else if (*xtype == 'V') { + dPdX = spx.dawavvelo; + } + + if (strcmp(stype, "AWAV") == 0) { + *crvalS = spx.awav; + dSdP = 1.0; + } + + } else if (*ptype == 'V') { + if (*xtype == 'F') { + dPdX = spx.dvelofreq; + } else if (*xtype == 'W' || *xtype == 'w') { + dPdX = spx.dvelowave; + } else if (*xtype == 'A' || *xtype == 'a') { + dPdX = spx.dveloawav; + } else if (*xtype == 'V') { + dPdX = 1.0; + } + + if (strcmp(stype, "VELO") == 0) { + *crvalS = spx.velo; + dSdP = 1.0; + } else if (strcmp(stype, "BETA") == 0) { + *crvalS = spx.beta; + dSdP = spx.dbetavelo; + } + } + + *dSdX = dSdP * dPdX; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spctrn( + const char ctypeS1[9], + double crvalS1, + double cdeltS1, + double restfrq, + double restwav, + char ctypeS2[9], + double *crvalS2, + double *cdeltS2) + +{ + return spctrne(ctypeS1, crvalS1, cdeltS1, restfrq, restwav, + ctypeS2, crvalS2, cdeltS2, NULL); +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int spctrne( + const char ctypeS1[9], + double crvalS1, + double cdeltS1, + double restfrq, + double restwav, + char ctypeS2[9], + double *crvalS2, + double *cdeltS2, + struct wcserr **err) + +{ + static const char *function = "spctrne"; + + char *cp, ptype1, ptype2, stype1[5], stype2[5], xtype1, xtype2; + int restreq, status; + double crvalX, dS2dX, dXdS1; + + if (restfrq == 0.0 && restwav == 0.0) { + /* If translating between two velocity-characteristic types, or between + two wave-characteristic types, then we may need to set a dummy rest + frequency or wavelength to perform the calculations. */ + strncpy(stype1, ctypeS1, 4); + strncpy(stype2, ctypeS2, 4); + stype1[4] = stype2[4] = '\0'; + if ((strstr("VRAD VOPT ZOPT VELO BETA", stype1) != 0x0) == + (strstr("VRAD VOPT ZOPT VELO BETA", stype2) != 0x0)) { + restwav = 1.0; + } + } + + if ((status = spcspxe(ctypeS1, crvalS1, restfrq, restwav, &ptype1, &xtype1, + &restreq, &crvalX, &dXdS1, err))) { + return status; + } + + /* Pad with blanks. */ + ctypeS2[8] = '\0'; + for (cp = ctypeS2; *cp; cp++); + while (cp < ctypeS2+8) *(cp++) = ' '; + + if (strncmp(ctypeS2+5, "???", 3) == 0) { + /* Set the algorithm code if required. */ + if (xtype1 == 'w') { + strcpy(ctypeS2+5, "GRI"); + } else if (xtype1 == 'a') { + strcpy(ctypeS2+5, "GRA"); + } else { + ctypeS2[5] = xtype1; + ctypeS2[6] = '2'; + } + } + + if ((status = spcxpse(ctypeS2, crvalX, restfrq, restwav, &ptype2, &xtype2, + &restreq, crvalS2, &dS2dX, err))) { + return status; + } + + /* Are the X-types compatible? */ + if (xtype2 != xtype1) { + return wcserr_set(WCSERR_SET(SPCERR_BAD_SPEC_PARAMS), + "Incompatible X-types '%c' and '%c'", xtype1, xtype2); + } + + if (ctypeS2[7] == '?') { + if (ptype2 == xtype2) { + strcpy(ctypeS2+4, " "); + } else { + ctypeS2[7] = ptype2; + } + } + + *cdeltS2 = dS2dX * dXdS1 * cdeltS1; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spcaips( + const char ctypeA[9], + int velref, + char ctype[9], + char specsys[9]) + +{ + const char *frames[] = {"LSRK", "BARYCENT", "TOPOCENT", + "LSRD", "GEOCENTR", "SOURCE", "GALACTOC"}; + char *fcode; + int ivf, status; + + /* Make a null-filled copy of ctypeA. */ + if (ctype != ctypeA) strncpy(ctype, ctypeA, 8); + ctype[8] = '\0'; + wcsutil_null_fill(9, ctype); + *specsys = '\0'; + + /* Is it a recognized AIPS-convention type? */ + status = SPCERR_NO_CHANGE; + if (strncmp(ctype, "FREQ", 4) == 0 || + strncmp(ctype, "VELO", 4) == 0 || + strncmp(ctype, "FELO", 4) == 0) { + /* Look for the Doppler frame. */ + if (*(fcode = ctype+4)) { + if (strcmp(fcode, "-LSR") == 0) { + strcpy(specsys, "LSRK"); + } else if (strcmp(fcode, "-HEL") == 0) { + strcpy(specsys, "BARYCENT"); + } else if (strcmp(fcode, "-OBS") == 0) { + strcpy(specsys, "TOPOCENT"); + } else { + /* Not a recognized AIPS spectral type. */ + return SPCERR_NO_CHANGE; + } + + *fcode = '\0'; + status = 0; + } + + /* VELREF takes precedence if present. */ + ivf = velref%256; + if (0 < ivf && ivf <= 7) { + strcpy(specsys, frames[ivf-1]); + status = 0; + } else if (ivf) { + status = SPCERR_BAD_SPEC_PARAMS; + } + + if (strcmp(ctype, "VELO") == 0) { + /* Check that we found an AIPS-convention Doppler frame. */ + if (*specsys) { + /* 'VELO' in AIPS means radio or optical depending on VELREF. */ + ivf = velref/256; + if (ivf == 0) { + strcpy(ctype, "VOPT"); + } else if (ivf == 1) { + strcpy(ctype, "VRAD"); + } else { + status = SPCERR_BAD_SPEC_PARAMS; + } + } + } else if (strcmp(ctype, "FELO") == 0) { + /* Uniform in frequency but expressed as an optical velocity (strictly + we should also have found an AIPS-convention Doppler frame). */ + strcpy(ctype, "VOPT-F2W"); + if (status < 0) status = 0; + } + } + + return status; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/spc.h b/testbed/astropy__astropy/cextern/wcslib/C/spc.h new file mode 100644 index 0000000000000000000000000000000000000000..2e2f42973d2de0df199fac1d9dc5c40a540e27a1 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/spc.h @@ -0,0 +1,914 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: spc.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the spc routines +* --------------------------- +* Routines in this suite implement the part of the FITS World Coordinate +* System (WCS) standard that deals with spectral coordinates, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) +* +* These routines define methods to be used for computing spectral world +* coordinates from intermediate world coordinates (a linear transformation +* of image pixel coordinates), and vice versa. They are based on the spcprm +* struct which contains all information needed for the computations. The +* struct contains some members that must be set by the user, and others that +* are maintained by these routines, somewhat like a C++ class but with no +* encapsulation. +* +* Routine spcini() is provided to initialize the spcprm struct with default +* values, spcfree() reclaims any memory that may have been allocated to store +* an error message, and spcprt() prints its contents. +* +* spcperr() prints the error message(s) (if any) stored in a spcprm struct. +* +* A setup routine, spcset(), computes intermediate values in the spcprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by spcset() but it need not be called explicitly - refer +* to the explanation of spcprm::flag. +* +* spcx2s() and spcs2x() implement the WCS spectral coordinate transformations. +* In fact, they are high level driver routines for the lower level spectral +* coordinate transformation routines described in spx.h. +* +* A number of routines are provided to aid in analysing or synthesising sets +* of FITS spectral axis keywords: +* +* - spctype() checks a spectral CTYPEia keyword for validity and returns +* information derived from it. +* +* - Spectral keyword analysis routine spcspxe() computes the values of the +* X-type spectral variables for the S-type variables supplied. +* +* - Spectral keyword synthesis routine, spcxpse(), computes the S-type +* variables for the X-types supplied. +* +* - Given a set of spectral keywords, a translation routine, spctrne(), +* produces the corresponding set for the specified spectral CTYPEia. +* +* - spcaips() translates AIPS-convention spectral CTYPEia and VELREF +* keyvalues. +* +* Spectral variable types - S, P, and X: +* -------------------------------------- +* A few words of explanation are necessary regarding spectral variable types +* in FITS. +* +* Every FITS spectral axis has three associated spectral variables: +* +* S-type: the spectral variable in which coordinates are to be +* expressed. Each S-type is encoded as four characters and is +* linearly related to one of four basic types as follows: +* +* F (Frequency): +* - 'FREQ': frequency +* - 'AFRQ': angular frequency +* - 'ENER': photon energy +* - 'WAVN': wave number +* - 'VRAD': radio velocity +* +* W (Wavelength in vacuo): +* - 'WAVE': wavelength +* - 'VOPT': optical velocity +* - 'ZOPT': redshift +* +* A (wavelength in Air): +* - 'AWAV': wavelength in air +* +* V (Velocity): +* - 'VELO': relativistic velocity +* - 'BETA': relativistic beta factor +* +* The S-type forms the first four characters of the CTYPEia keyvalue, +* and CRVALia and CDELTia are expressed as S-type quantities so that +* they provide a first-order approximation to the S-type variable at +* the reference point. +* +* Note that 'AFRQ', angular frequency, is additional to the variables +* defined in WCS Paper III. +* +* P-type: the basic spectral variable (F, W, A, or V) with which the +* S-type variable is associated (see list above). +* +* For non-grism axes, the P-type is encoded as the eighth character of +* CTYPEia. +* +* X-type: the basic spectral variable (F, W, A, or V) for which the +* spectral axis is linear, grisms excluded (see below). +* +* For non-grism axes, the X-type is encoded as the sixth character of +* CTYPEia. +* +* Grisms: Grism axes have normal S-, and P-types but the axis is linear, +* not in any spectral variable, but in a special "grism parameter". +* The X-type spectral variable is either W or A for grisms in vacuo or +* air respectively, but is encoded as 'w' or 'a' to indicate that an +* additional transformation is required to convert to or from the +* grism parameter. The spectral algorithm code for grisms also has a +* special encoding in CTYPEia, either 'GRI' (in vacuo) or 'GRA' (in air). +* +* In the algorithm chain, the non-linear transformation occurs between the +* X-type and the P-type variables; the transformation between P-type and +* S-type variables is always linear. +* +* When the P-type and X-type variables are the same, the spectral axis is +* linear in the S-type variable and the second four characters of CTYPEia +* are blank. This can never happen for grism axes. +* +* As an example, correlating radio spectrometers always produce spectra that +* are regularly gridded in frequency; a redshift scale on such a spectrum is +* non-linear. The required value of CTYPEia would be 'ZOPT-F2W', where the +* desired S-type is 'ZOPT' (redshift), the P-type is necessarily 'W' +* (wavelength), and the X-type is 'F' (frequency) by the nature of the +* instrument. +* +* Air-to-vacuum wavelength conversion: +* ------------------------------------ +* Please refer to the prologue of spx.h for important comments relating to the +* air-to-vacuum wavelength conversion. +* +* Argument checking: +* ------------------ +* The input spectral values are only checked for values that would result in +* floating point exceptions. In particular, negative frequencies and +* wavelengths are allowed, as are velocities greater than the speed of +* light. The same is true for the spectral parameters - rest frequency and +* wavelength. +* +* Accuracy: +* --------- +* No warranty is given for the accuracy of these routines (refer to the +* copyright notice); intending users must satisfy for themselves their +* adequacy for the intended purpose. However, closure effectively to within +* double precision rounding error was demonstrated by test routine tspc.c +* which accompanies this software. +* +* +* spcini() - Default constructor for the spcprm struct +* ---------------------------------------------------- +* spcini() sets all members of a spcprm struct to default values. It should +* be used to initialize every spcprm struct. +* +* Given and returned: +* spc struct spcprm* +* Spectral transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* +* +* spcfree() - Destructor for the spcprm struct +* -------------------------------------------- +* spcfree() frees any memory that may have been allocated to store an error +* message in the spcprm struct. +* +* Given: +* spc struct spcprm* +* Spectral transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* +* +* spcprt() - Print routine for the spcprm struct +* ---------------------------------------------- +* spcprt() prints the contents of a spcprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* spc const struct spcprm* +* Spectral transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* +* +* spcperr() - Print error messages from a spcprm struct +* ----------------------------------------------------- +* spcperr() prints the error message(s) (if any) stored in a spcprm struct. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* spc const struct spcprm* +* Spectral transformation parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* +* +* spcset() - Setup routine for the spcprm struct +* ---------------------------------------------- +* spcset() sets up a spcprm struct according to information supplied within +* it. +* +* Note that this routine need not be called directly; it will be invoked by +* spcx2s() and spcs2x() if spcprm::flag is anything other than a predefined +* magic value. +* +* Given and returned: +* spc struct spcprm* +* Spectral transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* 2: Invalid spectral parameters. +* +* For returns > 1, a detailed error message is set in +* spcprm::err if enabled, see wcserr_enable(). +* +* +* spcx2s() - Transform to spectral coordinates +* -------------------------------------------- +* spcx2s() transforms intermediate world coordinates to spectral coordinates. +* +* Given and returned: +* spc struct spcprm* +* Spectral transformation parameters. +* +* Given: +* nx int Vector length. +* +* sx int Vector stride. +* +* sspec int Vector stride. +* +* x const double[] +* Intermediate world coordinates, in SI units. +* +* Returned: +* spec double[] Spectral coordinates, in SI units. +* +* stat int[] Status return value status for each vector element: +* 0: Success. +* 1: Invalid value of x. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* 2: Invalid spectral parameters. +* 3: One or more of the x coordinates were invalid, +* as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* spcprm::err if enabled, see wcserr_enable(). +* +* +* spcs2x() - Transform spectral coordinates +* ----------------------------------------- +* spcs2x() transforms spectral world coordinates to intermediate world +* coordinates. +* +* Given and returned: +* spc struct spcprm* +* Spectral transformation parameters. +* +* Given: +* nspec int Vector length. +* +* sspec int Vector stride. +* +* sx int Vector stride. +* +* spec const double[] +* Spectral coordinates, in SI units. +* +* Returned: +* x double[] Intermediate world coordinates, in SI units. +* +* stat int[] Status return value status for each vector element: +* 0: Success. +* 1: Invalid value of spec. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spcprm pointer passed. +* 2: Invalid spectral parameters. +* 4: One or more of the spec coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* spcprm::err if enabled, see wcserr_enable(). +* +* +* spctype() - Spectral CTYPEia keyword analysis +* --------------------------------------------- +* spctype() checks whether a CTYPEia keyvalue is a valid spectral axis type +* and if so returns information derived from it relating to the associated S-, +* P-, and X-type spectral variables (see explanation above). +* +* The return arguments are guaranteed not be modified if CTYPEia is not a +* valid spectral type; zero-pointers may be specified for any that are not of +* interest. +* +* A deprecated form of this function, spctyp(), lacks the wcserr** parameter. +* +* Given: +* ctype const char[9] +* The CTYPEia keyvalue, (eight characters with null +* termination). +* +* Returned: +* stype char[] The four-letter name of the S-type spectral variable +* copied or translated from ctype. If a non-zero +* pointer is given, the array must accomodate a null- +* terminated string of length 5. +* +* scode char[] The three-letter spectral algorithm code copied or +* translated from ctype. Logarithmic ('LOG') and +* tabular ('TAB') codes are also recognized. If a +* non-zero pointer is given, the array must accomodate a +* null-terminated string of length 4. +* +* sname char[] Descriptive name of the S-type spectral variable. +* If a non-zero pointer is given, the array must +* accomodate a null-terminated string of length 22. +* +* units char[] SI units of the S-type spectral variable. If a +* non-zero pointer is given, the array must accomodate a +* null-terminated string of length 8. +* +* ptype char* Character code for the P-type spectral variable +* derived from ctype, one of 'F', 'W', 'A', or 'V'. +* +* xtype char* Character code for the X-type spectral variable +* derived from ctype, one of 'F', 'W', 'A', or 'V'. +* Also, 'w' and 'a' are synonymous to 'W' and 'A' for +* grisms in vacuo and air respectively. Set to 'L' or +* 'T' for logarithmic ('LOG') and tabular ('TAB') axes. +* +* restreq int* Multivalued flag that indicates whether rest +* frequency or wavelength is required to compute +* spectral variables for this CTYPEia: +* 0: Not required. +* 1: Required for the conversion between S- and +* P-types (e.g. 'ZOPT-F2W'). +* 2: Required for the conversion between P- and +* X-types (e.g. 'BETA-W2V'). +* 3: Required for the conversion between S- and +* P-types, and between P- and X-types, but not +* between S- and X-types (this applies only for +* 'VRAD-V2F', 'VOPT-V2W', and 'ZOPT-V2W'). +* Thus the rest frequency or wavelength is required for +* spectral coordinate computations (i.e. between S- and +* X-types) only if restreq%3 != 0. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters (not a spectral +* CTYPEia). +* +* +* spcspxe() - Spectral keyword analysis +* ------------------------------------ +* spcspxe() analyses the CTYPEia and CRVALia FITS spectral axis keyword values +* and returns information about the associated X-type spectral variable. +* +* A deprecated form of this function, spcspx(), lacks the wcserr** parameter. +* +* Given: +* ctypeS const char[9] +* Spectral axis type, i.e. the CTYPEia keyvalue, (eight +* characters with null termination). For non-grism +* axes, the character code for the P-type spectral +* variable in the algorithm code (i.e. the eighth +* character of CTYPEia) may be set to '?' (it will not +* be reset). +* +* crvalS double Value of the S-type spectral variable at the reference +* point, i.e. the CRVALia keyvalue, SI units. +* +* restfrq, +* restwav double Rest frequency [Hz] and rest wavelength in vacuo [m], +* only one of which need be given, the other should be +* set to zero. +* +* Returned: +* ptype char* Character code for the P-type spectral variable +* derived from ctypeS, one of 'F', 'W', 'A', or 'V'. +* +* xtype char* Character code for the X-type spectral variable +* derived from ctypeS, one of 'F', 'W', 'A', or 'V'. +* Also, 'w' and 'a' are synonymous to 'W' and 'A' for +* grisms in vacuo and air respectively; crvalX and dXdS +* (see below) will conform to these. +* +* restreq int* Multivalued flag that indicates whether rest frequency +* or wavelength is required to compute spectral +* variables for this CTYPEia, as for spctype(). +* +* crvalX double* Value of the X-type spectral variable at the reference +* point, SI units. +* +* dXdS double* The derivative, dX/dS, evaluated at the reference +* point, SI units. Multiply the CDELTia keyvalue by +* this to get the pixel spacing in the X-type spectral +* coordinate. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* +* +* spcxpse() - Spectral keyword synthesis +* ------------------------------------- +* spcxpse(), for the spectral axis type specified and the value provided for +* the X-type spectral variable at the reference point, deduces the value of +* the FITS spectral axis keyword CRVALia and also the derivative dS/dX which +* may be used to compute CDELTia. See above for an explanation of the S-, +* P-, and X-type spectral variables. +* +* A deprecated form of this function, spcxps(), lacks the wcserr** parameter. +* +* Given: +* ctypeS const char[9] +* The required spectral axis type, i.e. the CTYPEia +* keyvalue, (eight characters with null termination). +* For non-grism axes, the character code for the P-type +* spectral variable in the algorithm code (i.e. the +* eighth character of CTYPEia) may be set to '?' (it +* will not be reset). +* +* crvalX double Value of the X-type spectral variable at the reference +* point (N.B. NOT the CRVALia keyvalue), SI units. +* +* restfrq, +* restwav double Rest frequency [Hz] and rest wavelength in vacuo [m], +* only one of which need be given, the other should be +* set to zero. +* +* Returned: +* ptype char* Character code for the P-type spectral variable +* derived from ctypeS, one of 'F', 'W', 'A', or 'V'. +* +* xtype char* Character code for the X-type spectral variable +* derived from ctypeS, one of 'F', 'W', 'A', or 'V'. +* Also, 'w' and 'a' are synonymous to 'W' and 'A' for +* grisms; crvalX and cdeltX must conform to these. +* +* restreq int* Multivalued flag that indicates whether rest frequency +* or wavelength is required to compute spectral +* variables for this CTYPEia, as for spctype(). +* +* crvalS double* Value of the S-type spectral variable at the reference +* point (i.e. the appropriate CRVALia keyvalue), SI +* units. +* +* dSdX double* The derivative, dS/dX, evaluated at the reference +* point, SI units. Multiply this by the pixel spacing +* in the X-type spectral coordinate to get the CDELTia +* keyvalue. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* +* +* spctrne() - Spectral keyword translation +* --------------------------------------- +* spctrne() translates a set of FITS spectral axis keywords into the +* corresponding set for the specified spectral axis type. For example, a +* 'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa. +* +* A deprecated form of this function, spctrn(), lacks the wcserr** parameter. +* +* Given: +* ctypeS1 const char[9] +* Spectral axis type, i.e. the CTYPEia keyvalue, (eight +* characters with null termination). For non-grism +* axes, the character code for the P-type spectral +* variable in the algorithm code (i.e. the eighth +* character of CTYPEia) may be set to '?' (it will not +* be reset). +* +* crvalS1 double Value of the S-type spectral variable at the reference +* point, i.e. the CRVALia keyvalue, SI units. +* +* cdeltS1 double Increment of the S-type spectral variable at the +* reference point, SI units. +* +* restfrq, +* restwav double Rest frequency [Hz] and rest wavelength in vacuo [m], +* only one of which need be given, the other should be +* set to zero. Neither are required if the translation +* is between wave-characteristic types, or between +* velocity-characteristic types. E.g., required for +* 'FREQ' -> 'ZOPT-F2W', but not required for +* 'VELO-F2V' -> 'ZOPT-F2W'. +* +* Given and returned: +* ctypeS2 char[9] Required spectral axis type (eight characters with +* null termination). The first four characters are +* required to be given and are never modified. The +* remaining four, the algorithm code, are completely +* determined by, and must be consistent with, ctypeS1 +* and the first four characters of ctypeS2. A non-zero +* status value will be returned if they are inconsistent +* (see below). However, if the final three characters +* are specified as "???", or if just the eighth +* character is specified as '?', the correct algorithm +* code will be substituted (applies for grism axes as +* well as non-grism). +* +* Returned: +* crvalS2 double* Value of the new S-type spectral variable at the +* reference point, i.e. the new CRVALia keyvalue, SI +* units. +* +* cdeltS2 double* Increment of the new S-type spectral variable at the +* reference point, i.e. the new CDELTia keyvalue, SI +* units. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* +* A status value of 2 will be returned if restfrq or +* restwav are not specified when required, or if ctypeS1 +* or ctypeS2 are self-inconsistent, or have different +* spectral X-type variables. +* +* +* spcaips() - Translate AIPS-convention spectral keywords +* ------------------------------------------------------- +* spcaips() translates AIPS-convention spectral CTYPEia and VELREF keyvalues. +* +* Given: +* ctypeA const char[9] +* CTYPEia keyvalue possibly containing an +* AIPS-convention spectral code (eight characters, need +* not be null-terminated). +* +* velref int AIPS-convention VELREF code. It has the following +* integer values: +* 1: LSR kinematic, originally described simply as +* "LSR" without distinction between the kinematic +* and dynamic definitions. +* 2: Barycentric, originally described as "HEL" +* meaning heliocentric. +* 3: Topocentric, originally described as "OBS" +* meaning geocentric but widely interpreted as +* topocentric. +* AIPS++ extensions to VELREF are also recognized: +* 4: LSR dynamic. +* 5: Geocentric. +* 6: Source rest frame. +* 7: Galactocentric. +* +* For an AIPS 'VELO' axis, a radio convention velocity +* (VRAD) is denoted by adding 256 to VELREF, otherwise +* an optical velocity (VOPT) is indicated (this is not +* applicable to 'FREQ' or 'FELO' axes). Setting velref +* to 0 or 256 chooses between optical and radio velocity +* without specifying a Doppler frame, provided that a +* frame is encoded in ctypeA. If not, i.e. for +* ctypeA = 'VELO', ctype will be returned as 'VELO'. +* +* VELREF takes precedence over CTYPEia in defining the +* Doppler frame, e.g. +* += ctypeA = 'VELO-HEL' += velref = 1 +* +* returns ctype = 'VOPT' with specsys set to 'LSRK'. +* +* If omitted from the header, the default value of +* VELREF is 0. +* +* Returned: +* ctype char[9] Translated CTYPEia keyvalue, or a copy of ctypeA if no +* translation was performed (in which case any trailing +* blanks in ctypeA will be replaced with nulls). +* +* specsys char[9] Doppler reference frame indicated by VELREF or else +* by CTYPEia with value corresponding to the SPECSYS +* keyvalue in the FITS WCS standard. May be returned +* blank if neither specifies a Doppler frame, e.g. +* ctypeA = 'FELO' and velref%256 == 0. +* +* Function return value: +* int Status return value: +* -1: No translation required (not an error). +* 0: Success. +* 2: Invalid value of VELREF. +* +* +* spcprm struct - Spectral transformation parameters +* -------------------------------------------------- +* The spcprm struct contains information required to transform spectral +* coordinates. It consists of certain members that must be set by the user +* ("given") and others that are set by the WCSLIB routines ("returned"). Some +* of the latter are supplied for informational purposes while others are for +* internal use only. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following spcprm structure members are set or changed: +* +* - spcprm::type, +* - spcprm::code, +* - spcprm::crval, +* - spcprm::restfrq, +* - spcprm::restwav, +* - spcprm::pv[]. +* +* This signals the initialization routine, spcset(), to recompute the +* returned members of the spcprm struct. spcset() will reset flag to +* indicate that this has been done. +* +* char type[8] +* (Given) Four-letter spectral variable type, e.g "ZOPT" for +* CTYPEia = 'ZOPT-F2W'. (Declared as char[8] for alignment reasons.) +* +* char code[4] +* (Given) Three-letter spectral algorithm code, e.g "F2W" for +* CTYPEia = 'ZOPT-F2W'. +* +* double crval +* (Given) Reference value (CRVALia), SI units. +* +* double restfrq +* (Given) The rest frequency [Hz], and ... +* +* double restwav +* (Given) ... the rest wavelength in vacuo [m], only one of which need be +* given, the other should be set to zero. Neither are required if the +* X and S spectral variables are both wave-characteristic, or both +* velocity-characteristic, types. +* +* double pv[7] +* (Given) Grism parameters for 'GRI' and 'GRA' algorithm codes: +* - 0: G, grating ruling density. +* - 1: m, interference order. +* - 2: alpha, angle of incidence [deg]. +* - 3: n_r, refractive index at the reference wavelength, lambda_r. +* - 4: n'_r, dn/dlambda at the reference wavelength, lambda_r (/m). +* - 5: epsilon, grating tilt angle [deg]. +* - 6: theta, detector tilt angle [deg]. +* +* The remaining members of the spcprm struct are maintained by spcset() and +* must not be modified elsewhere: +* +* double w[6] +* (Returned) Intermediate values: +* - 0: Rest frequency or wavelength (SI). +* - 1: The value of the X-type spectral variable at the reference point +* (SI units). +* - 2: dX/dS at the reference point (SI units). +* The remainder are grism intermediates. +* +* int isGrism +* (Returned) Grism coordinates? +* - 0: no, +* - 1: in vacuum, +* - 2: in air. +* +* int padding1 +* (An unused variable inserted for alignment purposes only.) +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* void *padding2 +* (An unused variable inserted for alignment purposes only.) +* int (*spxX2P)(SPX_ARGS) +* (Returned) The first and ... +* int (*spxP2S)(SPX_ARGS) +* (Returned) ... the second of the pointers to the transformation +* functions in the two-step algorithm chain X -> P -> S in the +* pixel-to-spectral direction where the non-linear transformation is from +* X to P. The argument list, SPX_ARGS, is defined in spx.h. +* +* int (*spxS2P)(SPX_ARGS) +* (Returned) The first and ... +* int (*spxP2X)(SPX_ARGS) +* (Returned) ... the second of the pointers to the transformation +* functions in the two-step algorithm chain S -> P -> X in the +* spectral-to-pixel direction where the non-linear transformation is from +* P to X. The argument list, SPX_ARGS, is defined in spx.h. +* +* +* Global variable: const char *spc_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_SPC +#define WCSLIB_SPC + +#include "spx.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *spc_errmsg[]; + +enum spc_errmsg_enum { + SPCERR_NO_CHANGE = -1, /* No change. */ + SPCERR_SUCCESS = 0, /* Success. */ + SPCERR_NULL_POINTER = 1, /* Null spcprm pointer passed. */ + SPCERR_BAD_SPEC_PARAMS = 2, /* Invalid spectral parameters. */ + SPCERR_BAD_X = 3, /* One or more of x coordinates were + invalid. */ + SPCERR_BAD_SPEC = 4 /* One or more of the spec coordinates were + invalid. */ +}; + +struct spcprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + char type[8]; /* Four-letter spectral variable type. */ + char code[4]; /* Three-letter spectral algorithm code. */ + + double crval; /* Reference value (CRVALia), SI units. */ + double restfrq; /* Rest frequency, Hz. */ + double restwav; /* Rest wavelength, m. */ + + double pv[7]; /* Grism parameters: */ + /* 0: G, grating ruling density. */ + /* 1: m, interference order. */ + /* 2: alpha, angle of incidence. */ + /* 3: n_r, refractive index at lambda_r. */ + /* 4: n'_r, dn/dlambda at lambda_r. */ + /* 5: epsilon, grating tilt angle. */ + /* 6: theta, detector tilt angle. */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + double w[6]; /* Intermediate values. */ + /* 0: Rest frequency or wavelength (SI). */ + /* 1: CRVALX (SI units). */ + /* 2: CDELTX/CDELTia = dX/dS (SI units). */ + /* The remainder are grism intermediates. */ + + int isGrism; /* Grism coordinates? 1: vacuum, 2: air. */ + int padding1; /* (Dummy inserted for alignment purposes.) */ + + /* Error handling */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private */ + /*------------------------------------------------------------------------*/ + void *padding2; /* (Dummy inserted for alignment purposes.) */ + int (*spxX2P)(SPX_ARGS); /* Pointers to the transformation functions */ + int (*spxP2S)(SPX_ARGS); /* in the two-step algorithm chain in the */ + /* pixel-to-spectral direction. */ + + int (*spxS2P)(SPX_ARGS); /* Pointers to the transformation functions */ + int (*spxP2X)(SPX_ARGS); /* in the two-step algorithm chain in the */ + /* spectral-to-pixel direction. */ +}; + +/* Size of the spcprm struct in int units, used by the Fortran wrappers. */ +#define SPCLEN (sizeof(struct spcprm)/sizeof(int)) + + +int spcini(struct spcprm *spc); + +int spcfree(struct spcprm *spc); + +int spcprt(const struct spcprm *spc); + +int spcperr(const struct spcprm *spc, const char *prefix); + +int spcset(struct spcprm *spc); + +int spcx2s(struct spcprm *spc, int nx, int sx, int sspec, + const double x[], double spec[], int stat[]); + +int spcs2x(struct spcprm *spc, int nspec, int sspec, int sx, + const double spec[], double x[], int stat[]); + +int spctype(const char ctype[9], char stype[], char scode[], char sname[], + char units[], char *ptype, char *xtype, int *restreq, + struct wcserr **err); + +int spcspxe(const char ctypeS[9], double crvalS, double restfrq, + double restwav, char *ptype, char *xtype, int *restreq, + double *crvalX, double *dXdS, struct wcserr **err); + +int spcxpse(const char ctypeS[9], double crvalX, double restfrq, + double restwav, char *ptype, char *xtype, int *restreq, + double *crvalS, double *dSdX, struct wcserr **err); + +int spctrne(const char ctypeS1[9], double crvalS1, double cdeltS1, + double restfrq, double restwav, char ctypeS2[9], double *crvalS2, + double *cdeltS2, struct wcserr **err); + +int spcaips(const char ctypeA[9], int velref, char ctype[9], char specsys[9]); + + +/* Deprecated. */ +#define spcini_errmsg spc_errmsg +#define spcprt_errmsg spc_errmsg +#define spcset_errmsg spc_errmsg +#define spcx2s_errmsg spc_errmsg +#define spcs2x_errmsg spc_errmsg + +int spctyp(const char ctype[9], char stype[], char scode[], char sname[], + char units[], char *ptype, char *xtype, int *restreq); +int spcspx(const char ctypeS[9], double crvalS, double restfrq, + double restwav, char *ptype, char *xtype, int *restreq, + double *crvalX, double *dXdS); +int spcxps(const char ctypeS[9], double crvalX, double restfrq, + double restwav, char *ptype, char *xtype, int *restreq, + double *crvalS, double *dSdX); +int spctrn(const char ctypeS1[9], double crvalS1, double cdeltS1, + double restfrq, double restwav, char ctypeS2[9], double *crvalS2, + double *cdeltS2); + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_SPC */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/sph.c b/testbed/astropy__astropy/cextern/wcslib/C/sph.c new file mode 100644 index 0000000000000000000000000000000000000000..1022e57fa9f160c66c693943f22c4d629e6b9aa8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/sph.c @@ -0,0 +1,460 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: sph.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include "wcstrig.h" +#include "sph.h" + +#define copysign(X, Y) ((Y) < 0.0 ? -fabs(X) : fabs(X)) + +#define tol 1.0e-5 + +/*--------------------------------------------------------------------------*/ + +int sphx2s( + const double eul[5], + int nphi, + int ntheta, + int spt, + int sll, + const double phi[], + const double theta[], + double lng[], + double lat[]) + +{ + int jphi, mphi, mtheta, rowlen, rowoff; + double cosphi, costhe, costhe3, costhe4, dlng, dphi, sinphi, sinthe, + sinthe3, sinthe4, x, y, z; + register int iphi, itheta; + register const double *phip, *thetap; + register double *latp, *lngp; + + if (ntheta > 0) { + mphi = nphi; + mtheta = ntheta; + } else { + mphi = 1; + mtheta = 1; + ntheta = nphi; + } + + + /* Check for special-case rotations. */ + if (eul[4] == 0.0) { + if (eul[1] == 0.0) { + /* Simple change in origin of longitude. */ + dlng = fmod(eul[0] + 180.0 - eul[2], 360.0); + + jphi = 0; + thetap = theta; + lngp = lng; + latp = lat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + phip = phi + (jphi%nphi)*spt; + for (iphi = 0; iphi < mphi; iphi++, phip += spt, jphi++) { + *lngp = *phip + dlng; + *latp = *thetap; + + /* Normalize the celestial longitude. */ + if (eul[0] >= 0.0) { + if (*lngp < 0.0) *lngp += 360.0; + } else { + if (*lngp > 0.0) *lngp -= 360.0; + } + + if (*lngp > 360.0) { + *lngp -= 360.0; + } else if (*lngp < -360.0) { + *lngp += 360.0; + } + + lngp += sll; + latp += sll; + } + } + + } else { + /* Pole-flip with change in origin of longitude. */ + dlng = fmod(eul[0] + eul[2], 360.0); + + jphi = 0; + thetap = theta; + lngp = lng; + latp = lat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + phip = phi + (jphi%nphi)*spt; + for (iphi = 0; iphi < mphi; iphi++, phip += spt, jphi++) { + *lngp = dlng - *phip; + *latp = -(*thetap); + + /* Normalize the celestial longitude. */ + if (eul[0] >= 0.0) { + if (*lngp < 0.0) *lngp += 360.0; + } else { + if (*lngp > 0.0) *lngp -= 360.0; + } + + if (*lngp > 360.0) { + *lngp -= 360.0; + } else if (*lngp < -360.0) { + *lngp += 360.0; + } + + lngp += sll; + latp += sll; + } + } + } + + return 0; + } + + + /* Do phi dependency. */ + phip = phi; + rowoff = 0; + rowlen = nphi*sll; + for (iphi = 0; iphi < nphi; iphi++, rowoff += sll, phip += spt) { + dphi = *phip - eul[2]; + + lngp = lng + rowoff; + for (itheta = 0; itheta < mtheta; itheta++) { + *lngp = dphi; + lngp += rowlen; + } + } + + + /* Do theta dependency. */ + thetap = theta; + lngp = lng; + latp = lat; + for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) { + sincosd(*thetap, &sinthe, &costhe); + costhe3 = costhe*eul[3]; + costhe4 = costhe*eul[4]; + sinthe3 = sinthe*eul[3]; + sinthe4 = sinthe*eul[4]; + + for (iphi = 0; iphi < mphi; iphi++, lngp += sll, latp += sll) { + dphi = *lngp; + sincosd(dphi, &sinphi, &cosphi); + + /* Compute the celestial longitude. */ + x = sinthe4 - costhe3*cosphi; + if (fabs(x) < tol) { + /* Rearrange formula to reduce roundoff errors. */ + x = -cosd(*thetap + eul[1]) + costhe3*(1.0 - cosphi); + } + + y = -costhe*sinphi; + if (x != 0.0 || y != 0.0) { + dlng = atan2d(y, x); + } else { + /* Change of origin of longitude. */ + if (eul[1] < 90.0) { + dlng = dphi + 180.0; + } else { + dlng = -dphi; + } + } + *lngp = eul[0] + dlng; + + /* Normalize the celestial longitude. */ + if (eul[0] >= 0.0) { + if (*lngp < 0.0) *lngp += 360.0; + } else { + if (*lngp > 0.0) *lngp -= 360.0; + } + + if (*lngp > 360.0) { + *lngp -= 360.0; + } else if (*lngp < -360.0) { + *lngp += 360.0; + } + + /* Compute the celestial latitude. */ + if (fmod(dphi,180.0) == 0.0) { + *latp = *thetap + cosphi*eul[1]; + if (*latp > 90.0) *latp = 180.0 - *latp; + if (*latp < -90.0) *latp = -180.0 - *latp; + } else { + z = sinthe3 + costhe4*cosphi; + if (fabs(z) > 0.99) { + /* Use an alternative formula for greater accuracy. */ + *latp = copysign(acosd(sqrt(x*x+y*y)), z); + } else { + *latp = asind(z); + } + } + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int sphs2x( + const double eul[5], + int nlng, + int nlat, + int sll, + int spt, + const double lng[], + const double lat[], + double phi[], + double theta[]) + +{ + int jlng, mlat, mlng, rowlen, rowoff; + double coslat, coslat3, coslat4, coslng, dlng, dphi, sinlat, sinlat3, + sinlat4, sinlng, x, y, z; + register int ilat, ilng; + register const double *latp, *lngp; + register double *phip, *thetap; + + if (nlat > 0) { + mlng = nlng; + mlat = nlat; + } else { + mlng = 1; + mlat = 1; + nlat = nlng; + } + + + /* Check for special-case rotations. */ + if (eul[4] == 0.0) { + if (eul[1] == 0.0) { + /* Simple change in origin of longitude. */ + dphi = fmod(eul[2] - 180.0 - eul[0], 360.0); + + jlng = 0; + latp = lat; + phip = phi; + thetap = theta; + for (ilat = 0; ilat < nlat; ilat++, latp += sll) { + lngp = lng + (jlng%nlng)*sll; + for (ilng = 0; ilng < mlng; ilng++, lngp += sll, jlng++) { + *phip = fmod(*lngp + dphi, 360.0); + *thetap = *latp; + + /* Normalize the native longitude. */ + if (*phip > 180.0) { + *phip -= 360.0; + } else if (*phip < -180.0) { + *phip += 360.0; + } + + phip += spt; + thetap += spt; + } + } + + } else { + /* Pole-flip with change in origin of longitude. */ + dphi = fmod(eul[2] + eul[0], 360.0); + + jlng = 0; + latp = lat; + phip = phi; + thetap = theta; + for (ilat = 0; ilat < nlat; ilat++, latp += sll) { + lngp = lng + (jlng%nlng)*sll; + for (ilng = 0; ilng < mlng; ilng++, lngp += sll, jlng++) { + *phip = fmod(dphi - *lngp, 360.0); + *thetap = -(*latp); + + /* Normalize the native longitude. */ + if (*phip > 180.0) { + *phip -= 360.0; + } else if (*phip < -180.0) { + *phip += 360.0; + } + + phip += spt; + thetap += spt; + } + } + } + + return 0; + } + + + /* Do lng dependency. */ + lngp = lng; + rowoff = 0; + rowlen = nlng*spt; + for (ilng = 0; ilng < nlng; ilng++, rowoff += spt, lngp += sll) { + dlng = *lngp - eul[0]; + + phip = phi + rowoff; + thetap = theta; + for (ilat = 0; ilat < mlat; ilat++) { + *phip = dlng; + phip += rowlen; + } + } + + + /* Do lat dependency. */ + latp = lat; + phip = phi; + thetap = theta; + for (ilat = 0; ilat < nlat; ilat++, latp += sll) { + sincosd(*latp, &sinlat, &coslat); + coslat3 = coslat*eul[3]; + coslat4 = coslat*eul[4]; + sinlat3 = sinlat*eul[3]; + sinlat4 = sinlat*eul[4]; + + for (ilng = 0; ilng < mlng; ilng++, phip += spt, thetap += spt) { + dlng = *phip; + sincosd(dlng, &sinlng, &coslng); + + /* Compute the native longitude. */ + x = sinlat4 - coslat3*coslng; + if (fabs(x) < tol) { + /* Rearrange formula to reduce roundoff errors. */ + x = -cosd(*latp+eul[1]) + coslat3*(1.0 - coslng); + } + + y = -coslat*sinlng; + if (x != 0.0 || y != 0.0) { + dphi = atan2d(y, x); + } else { + /* Change of origin of longitude. */ + if (eul[1] < 90.0) { + dphi = dlng - 180.0; + } else { + dphi = -dlng; + } + } + *phip = fmod(eul[2] + dphi, 360.0); + + /* Normalize the native longitude. */ + if (*phip > 180.0) { + *phip -= 360.0; + } else if (*phip < -180.0) { + *phip += 360.0; + } + + /* Compute the native latitude. */ + if (fmod(dlng,180.0) == 0.0) { + *thetap = *latp + coslng*eul[1]; + if (*thetap > 90.0) *thetap = 180.0 - *thetap; + if (*thetap < -90.0) *thetap = -180.0 - *thetap; + } else { + z = sinlat3 + coslat4*coslng; + if (fabs(z) > 0.99) { + /* Use an alternative formula for greater accuracy. */ + *thetap = copysign(acosd(sqrt(x*x+y*y)), z); + } else { + *thetap = asind(z); + } + } + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int sphdpa( + int nfield, + double lng0, + double lat0, + const double lng[], + const double lat[], + double dist[], + double pa[]) + +{ + int i; + double eul[5]; + + /* Set the Euler angles for the coordinate transformation. */ + eul[0] = lng0; + eul[1] = 90.0 - lat0; + eul[2] = 0.0; + eul[3] = cosd(eul[1]); + eul[4] = sind(eul[1]); + + /* Transform field points to the new system. */ + sphs2x(eul, nfield, 0, 1, 1, lng, lat, pa, dist); + + for (i = 0; i < nfield; i++) { + /* Angular distance is obtained from latitude in the new frame. */ + dist[i] = 90.0 - dist[i]; + + /* Position angle is obtained from longitude in the new frame. */ + pa[i] = -pa[i]; + if (pa[i] < -180.0) pa[i] += 360.0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int sphpad( + int nfield, + double lng0, + double lat0, + const double dist[], + const double pa[], + double lng[], + double lat[]) + +{ + int i; + double eul[5]; + + /* Set the Euler angles for the coordinate transformation. */ + eul[0] = lng0; + eul[1] = 90.0 - lat0; + eul[2] = 0.0; + eul[3] = cosd(eul[1]); + eul[4] = sind(eul[1]); + + for (i = 0; i < nfield; i++) { + /* Latitude in the new frame is obtained from angular distance. */ + lat[i] = 90.0 - dist[i]; + + /* Longitude in the new frame is obtained from position angle. */ + lng[i] = -pa[i]; + } + + /* Transform field points to the old system. */ + sphx2s(eul, nfield, 0, 1, 1, lng, lat, lng, lat); + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/sph.h b/testbed/astropy__astropy/cextern/wcslib/C/sph.h new file mode 100644 index 0000000000000000000000000000000000000000..eba2706d94f6fa53639bf7f9b4a9a696cd7e6750 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/sph.h @@ -0,0 +1,251 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: sph.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the sph routines +* --------------------------- +* Routines in this suite implement the spherical coordinate transformations +* defined by the FITS World Coordinate System (WCS) standard +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) +* +* The transformations are implemented via separate functions, sphx2s() and +* sphs2x(), for the spherical rotation in each direction. +* +* A utility function, sphdpa(), computes the angular distances and position +* angles from a given point on the sky to a number of other points. sphpad() +* does the complementary operation - computes the coordinates of points offset +* by the given angular distances and position angles from a given point on the +* sky. +* +* +* sphx2s() - Rotation in the pixel-to-world direction +* --------------------------------------------------- +* sphx2s() transforms native coordinates of a projection to celestial +* coordinates. +* +* Given: +* eul const double[5] +* Euler angles for the transformation: +* 0: Celestial longitude of the native pole [deg]. +* 1: Celestial colatitude of the native pole, or +* native colatitude of the celestial pole [deg]. +* 2: Native longitude of the celestial pole [deg]. +* 3: cos(eul[1]) +* 4: sin(eul[1]) +* +* nphi, +* ntheta int Vector lengths. +* +* spt,sxy int Vector strides. +* +* phi,theta const double[] +* Longitude and latitude in the native coordinate +* system of the projection [deg]. +* +* Returned: +* lng,lat double[] Celestial longitude and latitude [deg]. These may +* refer to the same storage as phi and theta +* respectively. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* +* sphs2x() - Rotation in the world-to-pixel direction +* --------------------------------------------------- +* sphs2x() transforms celestial coordinates to the native coordinates of a +* projection. +* +* Given: +* eul const double[5] +* Euler angles for the transformation: +* 0: Celestial longitude of the native pole [deg]. +* 1: Celestial colatitude of the native pole, or +* native colatitude of the celestial pole [deg]. +* 2: Native longitude of the celestial pole [deg]. +* 3: cos(eul[1]) +* 4: sin(eul[1]) +* +* nlng,nlat int Vector lengths. +* +* sll,spt int Vector strides. +* +* lng,lat const double[] +* Celestial longitude and latitude [deg]. +* +* Returned: +* phi,theta double[] Longitude and latitude in the native coordinate system +* of the projection [deg]. These may refer to the same +* storage as lng and lat respectively. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* +* sphdpa() - Compute angular distance and position angle +* ------------------------------------------------------ +* sphdpa() computes the angular distance and generalized position angle (see +* notes) from a "reference" point to a number of "field" points on the sphere. +* The points must be specified consistently in any spherical coordinate +* system. +* +* sphdpa() is complementary to sphpad(). +* +* Given: +* nfield int The number of field points. +* +* lng0,lat0 double Spherical coordinates of the reference point [deg]. +* +* lng,lat const double[] +* Spherical coordinates of the field points [deg]. +* +* Returned: +* dist,pa double[] Angular distances and position angles [deg]. These +* may refer to the same storage as lng and lat +* respectively. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* Notes: +* sphdpa() uses sphs2x() to rotate coordinates so that the reference point +* is at the north pole of the new system with the north pole of the old +* system at zero longitude in the new. The Euler angles required by +* sphs2x() for this rotation are +* += eul[0] = lng0; += eul[1] = 90.0 - lat0; += eul[2] = 0.0; +* +* The angular distance and generalized position angle are readily obtained +* from the longitude and latitude of the field point in the new system. +* This applies even if the reference point is at one of the poles, in which +* case the "position angle" returned is as would be computed for a reference +* point at (lng0,+90-epsilon) or (lng0,-90+epsilon), in the limit as epsilon +* goes to zero. +* +* It is evident that the coordinate system in which the two points are +* expressed is irrelevant to the determination of the angular separation +* between the points. However, this is not true of the generalized position +* angle. +* +* The generalized position angle is here defined as the angle of +* intersection of the great circle containing the reference and field points +* with that containing the reference point and the pole. It has its normal +* meaning when the the reference and field points are specified in +* equatorial coordinates (right ascension and declination). +* +* Interchanging the reference and field points changes the position angle in +* a non-intuitive way (because the sum of the angles of a spherical triangle +* normally exceeds 180 degrees). +* +* The position angle is undefined if the reference and field points are +* coincident or antipodal. This may be detected by checking for a distance +* of 0 or 180 degrees (within rounding tolerance). sphdpa() will return an +* arbitrary position angle in such circumstances. +* +* +* sphpad() - Compute field points offset from a given point +* --------------------------------------------------------- +* sphpad() computes the coordinates of a set of points that are offset by the +* specified angular distances and position angles from a given "reference" +* point on the sky. The distances and position angles must be specified +* consistently in any spherical coordinate system. +* +* sphpad() is complementary to sphdpa(). +* +* Given: +* nfield int The number of field points. +* +* lng0,lat0 double Spherical coordinates of the reference point [deg]. +* +* dist,pa const double[] +* Angular distances and position angles [deg]. +* +* Returned: +* lng,lat double[] Spherical coordinates of the field points [deg]. +* These may refer to the same storage as dist and pa +* respectively. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* Notes: +* sphpad() is implemented analogously to sphdpa() although using sphx2s() +* for the inverse transformation. In particular, when the reference point +* is at one of the poles, "position angle" is interpreted as though the +* reference point was at (lng0,+90-epsilon) or (lng0,-90+epsilon), in the +* limit as epsilon goes to zero. +* +* Applying sphpad() with the distances and position angles computed by +* sphdpa() should return the original field points. +* +*===========================================================================*/ + +#ifndef WCSLIB_SPH +#define WCSLIB_SPH + +#ifdef __cplusplus +extern "C" { +#endif + + +int sphx2s(const double eul[5], int nphi, int ntheta, int spt, int sxy, + const double phi[], const double theta[], + double lng[], double lat[]); + +int sphs2x(const double eul[5], int nlng, int nlat, int sll , int spt, + const double lng[], const double lat[], + double phi[], double theta[]); + +int sphdpa(int nfield, double lng0, double lat0, + const double lng[], const double lat[], + double dist[], double pa[]); + +int sphpad(int nfield, double lng0, double lat0, + const double dist[], const double pa[], + double lng[], double lat[]); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_SPH */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/spx.c b/testbed/astropy__astropy/cextern/wcslib/C/spx.c new file mode 100644 index 0000000000000000000000000000000000000000..65bb513bf8d5204ab54c636cd417fd690f2e0dd3 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/spx.c @@ -0,0 +1,1198 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: spx.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "spx.h" + + +/* Map status return value to message. */ +const char *spx_errmsg[] = { + "Success", + "Null spxprm pointer passed", + "Invalid spectral parameters", + "Invalid spectral variable", + "One or more of the inspec coordinates were invalid"}; + +/* Convenience macro for invoking wcserr_set(). */ +#define SPX_ERRMSG(status) WCSERR_SET(status), spx_errmsg[status] + +#define C 2.99792458e8 +#define h 6.6260755e-34 + +/*============================================================================ +* Spectral cross conversions; given one spectral coordinate it computes all +* the others, plus the required derivatives of each with respect to the +* others. +*===========================================================================*/ + +int specx(type, spec, restfrq, restwav, spx) + +const char *type; +double spec, restfrq, restwav; +struct spxprm *spx; + +{ + static const char *function = "specx"; + + register int k; + int haverest; + double beta, dwaveawav, gamma, n, s, t, u; + struct wcserr **err; + + if (spx == 0x0) return SPXERR_NULL_POINTER; + err = &(spx->err); + + haverest = 1; + if (restfrq == 0.0) { + if (restwav == 0.0) { + /* No line rest frequency supplied. */ + haverest = 0; + + /* Temporarily set a dummy value for conversions. */ + spx->restwav = 1.0; + } else { + spx->restwav = restwav; + } + spx->restfrq = C/spx->restwav; + + } else { + spx->restfrq = restfrq; + spx->restwav = C/restfrq; + } + + spx->err = 0x0; + + /* Convert to frequency. */ + spx->wavetype = 0; + spx->velotype = 0; + if (strcmp(type, "FREQ") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable: frequency == 0"); + } + spx->freq = spec; + spx->wavetype = 1; + + } else if (strcmp(type, "AFRQ") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable: frequency == 0"); + } + spx->freq = spec/(2.0*PI); + spx->wavetype = 1; + + } else if (strcmp(type, "ENER") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable: frequency == 0"); + } + spx->freq = spec/h; + spx->wavetype = 1; + + } else if (strcmp(type, "WAVN") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable: frequency == 0"); + } + spx->freq = spec*C; + spx->wavetype = 1; + + } else if (strcmp(type, "VRAD") == 0) { + spx->freq = spx->restfrq*(1.0 - spec/C); + spx->velotype = 1; + + } else if (strcmp(type, "WAVE") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable: frequency == 0"); + } + spx->freq = C/spec; + spx->wavetype = 1; + + } else if (strcmp(type, "VOPT") == 0) { + s = 1.0 + spec/C; + if (s == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable"); + } + spx->freq = spx->restfrq/s; + spx->velotype = 1; + + } else if (strcmp(type, "ZOPT") == 0) { + s = 1.0 + spec; + if (s == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable"); + } + spx->freq = spx->restfrq/s; + spx->velotype = 1; + + } else if (strcmp(type, "AWAV") == 0) { + if (spec == 0.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable"); + } + s = 1.0/spec; + s *= s; + n = 2.554e8 / (0.41e14 - s); + n += 294.981e8 / (1.46e14 - s); + n += 1.000064328; + spx->freq = C/(spec*n); + spx->wavetype = 1; + + } else if (strcmp(type, "VELO") == 0) { + beta = spec/C; + if (fabs(beta) == 1.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable"); + } + spx->freq = spx->restfrq*(1.0 - beta)/sqrt(1.0 - beta*beta); + spx->velotype = 1; + + } else if (strcmp(type, "BETA") == 0) { + if (fabs(spec) == 1.0) { + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_VAR), + "Invalid spectral variable"); + } + spx->freq = spx->restfrq*(1.0 - spec)/sqrt(1.0 - spec*spec); + spx->velotype = 1; + + } else { + /* Unrecognized type. */ + return wcserr_set(WCSERR_SET(SPXERR_BAD_SPEC_PARAMS), + "Unrecognized spectral type '%s'", type); + } + + + /* Convert frequency to the other spectral types. */ + n = 1.0; + for (k = 0; k < 4; k++) { + s = n*spx->freq/C; + s *= s; + t = 0.41e14 - s; + u = 1.46e14 - s; + n = 1.000064328 + (2.554e8/t + 294.981e8/u); + } + + dwaveawav = n - 2.0*s*(2.554e8/(t*t) + 294.981e8/(u*u)); + + s = spx->freq/spx->restfrq; + + spx->ener = spx->freq*h; + spx->afrq = spx->freq*(2.0*PI); + spx->wavn = spx->freq/C; + spx->vrad = C*(1.0 - s); + spx->wave = C/spx->freq; + spx->awav = spx->wave/n; + spx->vopt = C*(1.0/s - 1.0); + spx->zopt = spx->vopt/C; + spx->velo = C*(1.0 - s*s)/(1.0 + s*s); + spx->beta = spx->velo/C; + + /* Compute the required derivatives. */ + gamma = 1.0/sqrt(1.0 - spx->beta*spx->beta); + + spx->dfreqafrq = 1.0/(2.0*PI); + spx->dafrqfreq = 1.0/spx->dfreqafrq; + + spx->dfreqener = 1.0/h; + spx->denerfreq = 1.0/spx->dfreqener; + + spx->dfreqwavn = C; + spx->dwavnfreq = 1.0/spx->dfreqwavn; + + spx->dfreqvrad = -spx->restfrq/C; + spx->dvradfreq = 1.0/spx->dfreqvrad; + + spx->dfreqwave = -spx->freq/spx->wave; + spx->dwavefreq = 1.0/spx->dfreqwave; + + spx->dfreqawav = spx->dfreqwave * dwaveawav; + spx->dawavfreq = 1.0/spx->dfreqawav; + + spx->dfreqvelo = -gamma*spx->restfrq/(C + spx->velo); + spx->dvelofreq = 1.0/spx->dfreqvelo; + + spx->dwavevopt = spx->restwav/C; + spx->dvoptwave = 1.0/spx->dwavevopt; + + spx->dwavezopt = spx->restwav; + spx->dzoptwave = 1.0/spx->dwavezopt; + + spx->dwaveawav = dwaveawav; + spx->dawavwave = 1.0/spx->dwaveawav; + + spx->dwavevelo = gamma*spx->restwav/(C - spx->velo); + spx->dvelowave = 1.0/spx->dwavevelo; + + spx->dawavvelo = spx->dwavevelo/dwaveawav; + spx->dveloawav = 1.0/spx->dawavvelo; + + spx->dvelobeta = C; + spx->dbetavelo = 1.0/spx->dvelobeta; + + + /* Reset values if no line rest frequency was supplied. */ + if (haverest) { + spx->wavetype = 1; + spx->velotype = 1; + + } else { + spx->restfrq = 0.0; + spx->restwav = 0.0; + + if (!spx->wavetype) { + /* Don't have wave characteristic types. */ + spx->freq = 0.0; + spx->afrq = 0.0; + spx->ener = 0.0; + spx->wavn = 0.0; + spx->wave = 0.0; + spx->awav = 0.0; + + spx->dfreqwave = 0.0; + spx->dwavefreq = 0.0; + + spx->dfreqawav = 0.0; + spx->dawavfreq = 0.0; + + spx->dwaveawav = 0.0; + spx->dawavwave = 0.0; + + } else { + /* Don't have velocity types. */ + spx->vrad = 0.0; + spx->vopt = 0.0; + spx->zopt = 0.0; + spx->velo = 0.0; + spx->beta = 0.0; + } + + spx->dfreqvrad = 0.0; + spx->dvradfreq = 0.0; + + spx->dfreqvelo = 0.0; + spx->dvelofreq = 0.0; + + spx->dwavevopt = 0.0; + spx->dvoptwave = 0.0; + + spx->dwavezopt = 0.0; + spx->dzoptwave = 0.0; + + spx->dwavevelo = 0.0; + spx->dvelowave = 0.0; + + spx->dawavvelo = 0.0; + spx->dveloawav = 0.0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int spxperr(const struct spxprm *spx, const char *prefix) + +{ + if (spx == 0x0) return SPXERR_NULL_POINTER; + + if (spx->err) { + wcserr_prt(spx->err, prefix); + } + + return 0; +} + + +/*============================================================================ +* Conversions between frequency and vacuum wavelength. +*===========================================================================*/ + +int freqwave(dummy, nfreq, sfreq, swave, freq, wave, stat) + +double dummy; +int nfreq, sfreq, swave; +const double freq[]; +double wave[]; +int stat[]; + +{ + int status = 0; + register int ifreq, *statp; + register const double *freqp; + register double *wavep; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + freqp = freq; + wavep = wave; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + if (*freqp != 0.0) { + *wavep = C/(*freqp); + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + freqp += sfreq; + wavep += swave; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wavefreq(dummy, nwave, swave, sfreq, wave, freq, stat) + +double dummy; +int nwave, swave, sfreq; +const double wave[]; +double freq[]; +int stat[]; + +{ + int status = 0; + register int iwave, *statp; + register const double *wavep; + register double *freqp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + wavep = wave; + freqp = freq; + statp = stat; + for (iwave = 0; iwave < nwave; iwave++) { + if (*wavep != 0.0) { + *freqp = C/(*wavep); + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + wavep += swave; + freqp += sfreq; + } + + return status; +} + +/*============================================================================ +* Conversions between frequency and air wavelength. +*===========================================================================*/ + +int freqawav(dummy, nfreq, sfreq, sawav, freq, awav, stat) + +double dummy; +int nfreq, sfreq, sawav; +const double freq[]; +double awav[]; +int stat[]; + +{ + int status; + + if ((status = freqwave(dummy, nfreq, sfreq, sawav, freq, awav, stat))) { + return status; + } + + return waveawav(dummy, nfreq, sawav, sawav, awav, awav, stat); +} + +/*--------------------------------------------------------------------------*/ + +int awavfreq(dummy, nawav, sawav, sfreq, awav, freq, stat) + +double dummy; +int nawav, sawav, sfreq; +const double awav[]; +double freq[]; +int stat[]; + +{ + int status; + + if ((status = awavwave(dummy, nawav, sawav, sfreq, awav, freq, stat))) { + return status; + } + + return wavefreq(dummy, nawav, sfreq, sfreq, freq, freq, stat); +} + +/*============================================================================ +* Conversions between frequency and relativistic velocity. +*===========================================================================*/ + +int freqvelo(restfrq, nfreq, sfreq, svelo, freq, velo, stat) + +double restfrq; +int nfreq, sfreq, svelo; +const double freq[]; +double velo[]; +int stat[]; + +{ + double r, s; + register int ifreq, *statp; + register const double *freqp; + register double *velop; + + r = restfrq*restfrq; + + freqp = freq; + velop = velo; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + s = *freqp * *freqp; + *velop = C*(r - s)/(r + s); + *(statp++) = 0; + + freqp += sfreq; + velop += svelo; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int velofreq(restfrq, nvelo, svelo, sfreq, velo, freq, stat) + +double restfrq; +int nvelo, svelo, sfreq; +const double velo[]; +double freq[]; +int stat[]; + +{ + int status = 0; + double s; + register int ivelo, *statp; + register const double *velop; + register double *freqp; + + velop = velo; + freqp = freq; + statp = stat; + for (ivelo = 0; ivelo < nvelo; ivelo++) { + s = C + *velop; + if (s != 0.0) { + *freqp = restfrq*sqrt((C - *velop)/s); + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + velop += svelo; + freqp += sfreq; + } + + return status; +} + +/*============================================================================ +* Conversions between vacuum wavelength and air wavelength. +*===========================================================================*/ + +int waveawav(dummy, nwave, swave, sawav, wave, awav, stat) + +double dummy; +int nwave, swave, sawav; +const double wave[]; +double awav[]; +int stat[]; + +{ + int status = 0; + double n, s; + register int iwave, k, *statp; + register const double *wavep; + register double *awavp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + wavep = wave; + awavp = awav; + statp = stat; + for (iwave = 0; iwave < nwave; iwave++) { + if (*wavep != 0.0) { + n = 1.0; + for (k = 0; k < 4; k++) { + s = n/(*wavep); + s *= s; + n = 2.554e8 / (0.41e14 - s); + n += 294.981e8 / (1.46e14 - s); + n += 1.000064328; + } + + *awavp = (*wavep)/n; + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + wavep += swave; + awavp += sawav; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int awavwave(dummy, nawav, sawav, swave, awav, wave, stat) + +double dummy; +int nawav, sawav, swave; +const double awav[]; +double wave[]; +int stat[]; + +{ + int status = 0; + double n, s; + register int iawav, *statp; + register const double *awavp; + register double *wavep; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + awavp = awav; + wavep = wave; + statp = stat; + for (iawav = 0; iawav < nawav; iawav++) { + if (*awavp != 0.0) { + s = 1.0/(*awavp); + s *= s; + n = 2.554e8 / (0.41e14 - s); + n += 294.981e8 / (1.46e14 - s); + n += 1.000064328; + *wavep = (*awavp)*n; + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + awavp += sawav; + wavep += swave; + } + + return status; +} + +/*============================================================================ +* Conversions between vacuum wavelength and relativistic velocity. +*===========================================================================*/ + +int wavevelo(restwav, nwave, swave, svelo, wave, velo, stat) + +double restwav; +int nwave, swave, svelo; +const double wave[]; +double velo[]; +int stat[]; + +{ + double r, s; + register int iwave, *statp; + register const double *wavep; + register double *velop; + + r = restwav*restwav; + + wavep = wave; + velop = velo; + statp = stat; + for (iwave = 0; iwave < nwave; iwave++) { + s = *wavep * *wavep; + *velop = C*(s - r)/(s + r); + *(statp++) = 0; + + wavep += swave; + velop += svelo; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int velowave(restwav, nvelo, svelo, swave, velo, wave, stat) + +double restwav; +int nvelo, svelo, swave; +const double velo[]; +double wave[]; +int stat[]; + +{ + int status = 0; + double s; + register int ivelo, *statp; + register const double *velop; + register double *wavep; + + velop = velo; + wavep = wave; + statp = stat; + for (ivelo = 0; ivelo < nvelo; ivelo++) { + s = C - *velop; + if (s != 0.0) { + *wavep = restwav*sqrt((C + *velop)/s); + *(statp++) = 0; + } else { + *(statp++) = 1; + status = SPXERR_BAD_INSPEC_COORD; + } + + velop += svelo; + wavep += swave; + } + + return status; +} + +/*============================================================================ +* Conversions between air wavelength and relativistic velocity. +*===========================================================================*/ + +int awavvelo(dummy, nawav, sawav, svelo, awav, velo, stat) + +double dummy; +int nawav, sawav, svelo; +const double awav[]; +double velo[]; +int stat[]; + +{ + int status; + + if ((status = awavwave(dummy, nawav, sawav, svelo, awav, velo, stat))) { + return status; + } + + return wavevelo(dummy, nawav, svelo, svelo, velo, velo, stat); +} + +/*--------------------------------------------------------------------------*/ + +int veloawav(dummy, nvelo, svelo, sawav, velo, awav, stat) + +double dummy; +int nvelo, svelo, sawav; +const double velo[]; +double awav[]; +int stat[]; + +{ + int status; + + if ((status = velowave(dummy, nvelo, svelo, sawav, velo, awav, stat))) { + return status; + } + + return waveawav(dummy, nvelo, sawav, sawav, awav, awav, stat); +} + +/*============================================================================ +* Conversions between frequency and angular frequency. +*===========================================================================*/ + +int freqafrq(dummy, nfreq, sfreq, safrq, freq, afrq, stat) + +double dummy; +int nfreq, sfreq, safrq; +const double freq[]; +double afrq[]; +int stat[]; + +{ + register int ifreq, *statp; + register const double *freqp; + register double *afrqp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + freqp = freq; + afrqp = afrq; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + *afrqp = (*freqp)*(2.0*PI); + *(statp++) = 0; + + freqp += sfreq; + afrqp += safrq; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int afrqfreq(dummy, nafrq, safrq, sfreq, afrq, freq, stat) + +double dummy; +int nafrq, safrq, sfreq; +const double afrq[]; +double freq[]; +int stat[]; + +{ + register int iafrq, *statp; + register const double *afrqp; + register double *freqp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + afrqp = afrq; + freqp = freq; + statp = stat; + for (iafrq = 0; iafrq < nafrq; iafrq++) { + *freqp = (*afrqp)/(2.0*PI); + *(statp++) = 0; + + afrqp += safrq; + freqp += sfreq; + } + + return 0; +} + +/*============================================================================ +* Conversions between frequency and energy. +*===========================================================================*/ + +int freqener(dummy, nfreq, sfreq, sener, freq, ener, stat) + +double dummy; +int nfreq, sfreq, sener; +const double freq[]; +double ener[]; +int stat[]; + +{ + register int ifreq, *statp; + register const double *freqp; + register double *enerp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + freqp = freq; + enerp = ener; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + *enerp = (*freqp)*h; + *(statp++) = 0; + + freqp += sfreq; + enerp += sener; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int enerfreq(dummy, nener, sener, sfreq, ener, freq, stat) + +double dummy; +int nener, sener, sfreq; +const double ener[]; +double freq[]; +int stat[]; + +{ + register int iener, *statp; + register const double *enerp; + register double *freqp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + enerp = ener; + freqp = freq; + statp = stat; + for (iener = 0; iener < nener; iener++) { + *freqp = (*enerp)/h; + *(statp++) = 0; + + enerp += sener; + freqp += sfreq; + } + + return 0; +} + +/*============================================================================ +* Conversions between frequency and wave number. +*===========================================================================*/ + +int freqwavn(dummy, nfreq, sfreq, swavn, freq, wavn, stat) + +double dummy; +int nfreq, sfreq, swavn; +const double freq[]; +double wavn[]; +int stat[]; + +{ + register int ifreq, *statp; + register const double *freqp; + register double *wavnp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + freqp = freq; + wavnp = wavn; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + *wavnp = (*freqp)/C; + *(statp++) = 0; + + freqp += sfreq; + wavnp += swavn; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wavnfreq(dummy, nwavn, swavn, sfreq, wavn, freq, stat) + +double dummy; +int nwavn, swavn, sfreq; +const double wavn[]; +double freq[]; +int stat[]; + +{ + register int iwavn, *statp; + register const double *wavnp; + register double *freqp; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + wavnp = wavn; + freqp = freq; + statp = stat; + for (iwavn = 0; iwavn < nwavn; iwavn++) { + *freqp = (*wavnp)*C; + *(statp++) = 0; + + wavnp += swavn; + freqp += sfreq; + } + + return 0; +} + +/*============================================================================ +* Conversions between frequency and radio velocity. +*===========================================================================*/ + +int freqvrad(restfrq, nfreq, sfreq, svrad, freq, vrad, stat) + +double restfrq; +int nfreq, sfreq, svrad; +const double freq[]; +double vrad[]; +int stat[]; + +{ + double r; + register int ifreq, *statp; + register const double *freqp; + register double *vradp; + + if (restfrq == 0.0) { + return SPXERR_BAD_SPEC_PARAMS; + } + r = C/restfrq; + + freqp = freq; + vradp = vrad; + statp = stat; + for (ifreq = 0; ifreq < nfreq; ifreq++) { + *vradp = r*(restfrq - *freqp); + *(statp++) = 0; + + freqp += sfreq; + vradp += svrad; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int vradfreq(restfrq, nvrad, svrad, sfreq, vrad, freq, stat) + +double restfrq; +int nvrad, svrad, sfreq; +const double vrad[]; +double freq[]; +int stat[]; + +{ + double r; + register int ivrad, *statp; + register const double *vradp; + register double *freqp; + + r = restfrq/C; + + vradp = vrad; + freqp = freq; + statp = stat; + for (ivrad = 0; ivrad < nvrad; ivrad++) { + *freqp = r*(C - *vradp); + *(statp++) = 0; + vradp += svrad; + freqp += sfreq; + } + + return 0; +} + +/*============================================================================ +* Conversions between vacuum wavelength and optical velocity. +*===========================================================================*/ + +int wavevopt(restwav, nwave, swave, svopt, wave, vopt, stat) + +double restwav; +int nwave, swave, svopt; +const double wave[]; +double vopt[]; +int stat[]; + +{ + double r; + register int iwave, *statp; + register const double *wavep; + register double *voptp; + + if (restwav == 0.0) { + return SPXERR_BAD_SPEC_PARAMS; + } + r = C/restwav; + + wavep = wave; + voptp = vopt; + statp = stat; + for (iwave = 0; iwave < nwave; iwave++) { + *voptp = r*(*wavep) - C; + *(statp++) = 0; + wavep += swave; + voptp += svopt; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int voptwave(restwav, nvopt, svopt, swave, vopt, wave, stat) + +double restwav; +int nvopt, svopt, swave; +const double vopt[]; +double wave[]; +int stat[]; + +{ + double r; + register int ivopt, *statp; + register const double *voptp; + register double *wavep; + + r = restwav/C; + + voptp = vopt; + wavep = wave; + statp = stat; + for (ivopt = 0; ivopt < nvopt; ivopt++) { + *wavep = r*(C + *voptp); + *(statp++) = 0; + voptp += svopt; + wavep += swave; + } + + return 0; +} + +/*============================================================================ +* Conversions between vacuum wavelength and redshift. +*===========================================================================*/ + +int wavezopt(restwav, nwave, swave, szopt, wave, zopt, stat) + +double restwav; +int nwave, swave, szopt; +const double wave[]; +double zopt[]; +int stat[]; + +{ + double r; + register int iwave, *statp; + register const double *wavep; + register double *zoptp; + + if (restwav == 0.0) { + return SPXERR_BAD_SPEC_PARAMS; + } + r = 1.0/restwav; + + wavep = wave; + zoptp = zopt; + statp = stat; + for (iwave = 0; iwave < nwave; iwave++) { + *zoptp = r*(*wavep) - 1.0; + *(statp++) = 0; + wavep += swave; + zoptp += szopt; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int zoptwave(restwav, nzopt, szopt, swave, zopt, wave, stat) + +double restwav; +int nzopt, szopt, swave; +const double zopt[]; +double wave[]; +int stat[]; + +{ + register int izopt, *statp; + register const double *zoptp; + register double *wavep; + + zoptp = zopt; + wavep = wave; + statp = stat; + for (izopt = 0; izopt < nzopt; izopt++) { + *wavep = restwav*(1.0 + *zoptp); + *(statp++) = 0; + zoptp += szopt; + wavep += swave; + } + + return 0; +} + +/*============================================================================ +* Conversions between relativistic velocity and beta (= v/c). +*===========================================================================*/ + +int velobeta(dummy, nvelo, svelo, sbeta, velo, beta, stat) + +double dummy; +int nvelo, svelo, sbeta; +const double velo[]; +double beta[]; +int stat[]; + +{ + register int ivelo, *statp; + register const double *velop; + register double *betap; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + velop = velo; + betap = beta; + statp = stat; + for (ivelo = 0; ivelo < nvelo; ivelo++) { + *betap = (*velop)/C; + *(statp++) = 0; + + velop += svelo; + betap += sbeta; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int betavelo(dummy, nbeta, sbeta, svelo, beta, velo, stat) + +double dummy; +int nbeta, sbeta, svelo; +const double beta[]; +double velo[]; +int stat[]; + +{ + register int ibeta, *statp; + register const double *betap; + register double *velop; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + betap = beta; + velop = velo; + statp = stat; + for (ibeta = 0; ibeta < nbeta; ibeta++) { + *velop = (*betap)*C; + *(statp++) = 0; + + betap += sbeta; + velop += svelo; + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/spx.h b/testbed/astropy__astropy/cextern/wcslib/C/spx.h new file mode 100644 index 0000000000000000000000000000000000000000..061267e6527bc207ae41de6d6e1447be5ec7163d --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/spx.h @@ -0,0 +1,592 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: spx.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the spx routines +* --------------------------- +* Routines in this suite implement the spectral coordinate systems recognized +* by the FITS World Coordinate System (WCS) standard, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) +* +* specx() is a scalar routine that, given one spectral variable (e.g. +* frequency), computes all the others (e.g. wavelength, velocity, etc.) plus +* the required derivatives of each with respect to the others. The results +* are returned in the spxprm struct. +* +* spxperr() prints the error message(s) (if any) stored in a spxprm struct. +* +* The remaining routines are all vector conversions from one spectral +* variable to another. The API of these functions only differ in whether the +* rest frequency or wavelength need be supplied. +* +* Non-linear: +* - freqwave() frequency -> vacuum wavelength +* - wavefreq() vacuum wavelength -> frequency +* +* - freqawav() frequency -> air wavelength +* - awavfreq() air wavelength -> frequency +* +* - freqvelo() frequency -> relativistic velocity +* - velofreq() relativistic velocity -> frequency +* +* - waveawav() vacuum wavelength -> air wavelength +* - awavwave() air wavelength -> vacuum wavelength +* +* - wavevelo() vacuum wavelength -> relativistic velocity +* - velowave() relativistic velocity -> vacuum wavelength +* +* - awavvelo() air wavelength -> relativistic velocity +* - veloawav() relativistic velocity -> air wavelength +* +* Linear: +* - freqafrq() frequency -> angular frequency +* - afrqfreq() angular frequency -> frequency +* +* - freqener() frequency -> energy +* - enerfreq() energy -> frequency +* +* - freqwavn() frequency -> wave number +* - wavnfreq() wave number -> frequency +* +* - freqvrad() frequency -> radio velocity +* - vradfreq() radio velocity -> frequency +* +* - wavevopt() vacuum wavelength -> optical velocity +* - voptwave() optical velocity -> vacuum wavelength +* +* - wavezopt() vacuum wavelength -> redshift +* - zoptwave() redshift -> vacuum wavelength +* +* - velobeta() relativistic velocity -> beta (= v/c) +* - betavelo() beta (= v/c) -> relativistic velocity +* +* These are the workhorse routines, to be used for fast transformations. +* Conversions may be done "in place" by calling the routine with the output +* vector set to the input. +* +* Air-to-vacuum wavelength conversion: +* ------------------------------------ +* The air-to-vacuum wavelength conversion in early drafts of WCS Paper III +* cites Cox (ed., 2000, Allen’s Astrophysical Quantities, AIP Press, +* Springer-Verlag, New York), which itself derives from Edlén (1953, Journal +* of the Optical Society of America, 43, 339). This is the IAU standard, +* adopted in 1957 and again in 1991. No more recent IAU resolution replaces +* this relation, and it is the one used by WCSLIB. +* +* However, the Cox relation was replaced in later drafts of Paper III, and as +* eventually published, by the IUGG relation (1999, International Union of +* Geodesy and Geophysics, comptes rendus of the 22nd General Assembly, +* Birmingham UK, p111). There is a nearly constant ratio between the two, +* with IUGG/Cox = 1.000015 over most of the range between 200nm and 10,000nm. +* +* The IUGG relation itself is derived from the work of Ciddor (1996, Applied +* Optics, 35, 1566), which is used directly by the Sloan Digital Sky Survey. +* It agrees closely with Cox; longwards of 2500nm, the ratio Ciddor/Cox is +* fixed at 1.000000021, decreasing only slightly, to 1.000000018, at 1000nm. +* +* The Cox, IUGG, and Ciddor relations all accurately provide the wavelength +* dependence of the air-to-vacuum wavelength conversion. However, for full +* accuracy, the atmospheric temperature, pressure, and partial pressure of +* water vapour must be taken into account. These will determine a small, +* wavelength-independent scale factor and offset, which is not considered by +* WCS Paper III. +* +* WCS Paper III is also silent on the question of the range of validity of the +* air-to-vacuum wavelength conversion. Cox's relation would appear to be +* valid in the range 200nm to 10,000nm. Both the Cox and the Ciddor relations +* have singularities below 200nm, with Cox's at 156nm and 83nm. WCSLIB checks +* neither the range of validity, nor for these singularities. +* +* Argument checking: +* ------------------ +* The input spectral values are only checked for values that would result +* in floating point exceptions. In particular, negative frequencies and +* wavelengths are allowed, as are velocities greater than the speed of +* light. The same is true for the spectral parameters - rest frequency and +* wavelength. +* +* Accuracy: +* --------- +* No warranty is given for the accuracy of these routines (refer to the +* copyright notice); intending users must satisfy for themselves their +* adequacy for the intended purpose. However, closure effectively to within +* double precision rounding error was demonstrated by test routine tspec.c +* which accompanies this software. +* +* +* specx() - Spectral cross conversions (scalar) +* --------------------------------------------- +* Given one spectral variable specx() computes all the others, plus the +* required derivatives of each with respect to the others. +* +* Given: +* type const char* +* The type of spectral variable given by spec, FREQ, +* AFRQ, ENER, WAVN, VRAD, WAVE, VOPT, ZOPT, AWAV, VELO, +* or BETA (case sensitive). +* +* spec double The spectral variable given, in SI units. +* +* restfrq, +* restwav double Rest frequency [Hz] or rest wavelength in vacuo [m], +* only one of which need be given. The other should be +* set to zero. If both are zero, only a subset of the +* spectral variables can be computed, the remainder are +* set to zero. Specifically, given one of FREQ, AFRQ, +* ENER, WAVN, WAVE, or AWAV the others can be computed +* without knowledge of the rest frequency. Likewise, +* VRAD, VOPT, ZOPT, VELO, and BETA. +* +* Given and returned: +* specs struct spxprm* +* Data structure containing all spectral variables and +* their derivatives, in SI units. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spxprm pointer passed. +* 2: Invalid spectral parameters. +* 3: Invalid spectral variable. +* +* For returns > 1, a detailed error message is set in +* spxprm::err if enabled, see wcserr_enable(). +* +* freqafrq(), afrqfreq(), freqener(), enerfreq(), freqwavn(), wavnfreq(), +* freqwave(), wavefreq(), freqawav(), awavfreq(), waveawav(), awavwave(), +* velobeta(), and betavelo() implement vector conversions between wave-like +* or velocity-like spectral types (i.e. conversions that do not need the rest +* frequency or wavelength). They all have the same API. +* +* +* spxperr() - Print error messages from a spxprm struct +* ----------------------------------------------------- +* spxperr() prints the error message(s) (if any) stored in a spxprm struct. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* spx const struct spxprm* +* Spectral variables and their derivatives. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null spxprm pointer passed. +* +* +* freqafrq() - Convert frequency to angular frequency (vector) +* ------------------------------------------------------------ +* freqafrq() converts frequency to angular frequency. +* +* Given: +* param double Ignored. +* +* nspec int Vector length. +* +* instep, +* outstep int Vector strides. +* +* inspec const double[] +* Input spectral variables, in SI units. +* +* Returned: +* outspec double[] Output spectral variables, in SI units. +* +* stat int[] Status return value for each vector element: +* 0: Success. +* 1: Invalid value of inspec. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* 4: One or more of the inspec coordinates were +* invalid, as indicated by the stat vector. +* +* +* freqvelo(), velofreq(), freqvrad(), and vradfreq() implement vector +* conversions between frequency and velocity spectral types. They all have +* the same API. +* +* +* freqvelo() - Convert frequency to relativistic velocity (vector) +* ---------------------------------------------------------------- +* freqvelo() converts frequency to relativistic velocity. +* +* Given: +* param double Rest frequency [Hz]. +* +* nspec int Vector length. +* +* instep, +* outstep int Vector strides. +* +* inspec const double[] +* Input spectral variables, in SI units. +* +* Returned: +* outspec double[] Output spectral variables, in SI units. +* +* stat int[] Status return value for each vector element: +* 0: Success. +* 1: Invalid value of inspec. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* 4: One or more of the inspec coordinates were +* invalid, as indicated by the stat vector. +* +* +* wavevelo(), velowave(), awavvelo(), veloawav(), wavevopt(), voptwave(), +* wavezopt(), and zoptwave() implement vector conversions between wavelength +* and velocity spectral types. They all have the same API. +* +* +* wavevelo() - Conversions between wavelength and velocity types (vector) +* ----------------------------------------------------------------------- +* wavevelo() converts vacuum wavelength to relativistic velocity. +* +* Given: +* param double Rest wavelength in vacuo [m]. +* +* nspec int Vector length. +* +* instep, +* outstep int Vector strides. +* +* inspec const double[] +* Input spectral variables, in SI units. +* +* Returned: +* outspec double[] Output spectral variables, in SI units. +* +* stat int[] Status return value for each vector element: +* 0: Success. +* 1: Invalid value of inspec. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Invalid spectral parameters. +* 4: One or more of the inspec coordinates were +* invalid, as indicated by the stat vector. +* +* +* spxprm struct - Spectral variables and their derivatives +* -------------------------------------------------------- +* The spxprm struct contains the value of all spectral variables and their +* derivatives. It is used solely by specx() which constructs it from +* information provided via its function arguments. +* +* This struct should be considered read-only, no members need ever be set nor +* should ever be modified by the user. +* +* double restfrq +* (Returned) Rest frequency [Hz]. +* +* double restwav +* (Returned) Rest wavelength [m]. +* +* int wavetype +* (Returned) True if wave types have been computed, and ... +* +* int velotype +* (Returned) ... true if velocity types have been computed; types are +* defined below. +* +* If one or other of spxprm::restfrq and spxprm::restwav is given +* (non-zero) then all spectral variables may be computed. If both are +* given, restfrq is used. If restfrq and restwav are both zero, only wave +* characteristic xor velocity type spectral variables may be computed +* depending on the variable given. These flags indicate what is +* available. +* +* double freq +* (Returned) Frequency [Hz] (wavetype). +* +* double afrq +* (Returned) Angular frequency [rad/s] (wavetype). +* +* double ener +* (Returned) Photon energy [J] (wavetype). +* +* double wavn +* (Returned) Wave number [/m] (wavetype). +* +* double vrad +* (Returned) Radio velocity [m/s] (velotype). +* +* double wave +* (Returned) Vacuum wavelength [m] (wavetype). +* +* double vopt +* (Returned) Optical velocity [m/s] (velotype). +* +* double zopt +* (Returned) Redshift [dimensionless] (velotype). +* +* double awav +* (Returned) Air wavelength [m] (wavetype). +* +* double velo +* (Returned) Relativistic velocity [m/s] (velotype). +* +* double beta +* (Returned) Relativistic beta [dimensionless] (velotype). +* +* double dfreqafrq +* (Returned) Derivative of frequency with respect to angular frequency +* [/rad] (constant, = 1 / 2*pi), and ... +* double dafrqfreq +* (Returned) ... vice versa [rad] (constant, = 2*pi, always available). +* +* double dfreqener +* (Returned) Derivative of frequency with respect to photon energy +* [/J/s] (constant, = 1/h), and ... +* double denerfreq +* (Returned) ... vice versa [Js] (constant, = h, Planck's constant, +* always available). +* +* double dfreqwavn +* (Returned) Derivative of frequency with respect to wave number [m/s] +* (constant, = c, the speed of light in vacuo), and ... +* double dwavnfreq +* (Returned) ... vice versa [s/m] (constant, = 1/c, always available). +* +* double dfreqvrad +* (Returned) Derivative of frequency with respect to radio velocity [/m], +* and ... +* double dvradfreq +* (Returned) ... vice versa [m] (wavetype && velotype). +* +* double dfreqwave +* (Returned) Derivative of frequency with respect to vacuum wavelength +* [/m/s], and ... +* double dwavefreq +* (Returned) ... vice versa [m s] (wavetype). +* +* double dfreqawav +* (Returned) Derivative of frequency with respect to air wavelength, +* [/m/s], and ... +* double dawavfreq +* (Returned) ... vice versa [m s] (wavetype). +* +* double dfreqvelo +* (Returned) Derivative of frequency with respect to relativistic +* velocity [/m], and ... +* double dvelofreq +* (Returned) ... vice versa [m] (wavetype && velotype). +* +* double dwavevopt +* (Returned) Derivative of vacuum wavelength with respect to optical +* velocity [s], and ... +* double dvoptwave +* (Returned) ... vice versa [/s] (wavetype && velotype). +* +* double dwavezopt +* (Returned) Derivative of vacuum wavelength with respect to redshift [m], +* and ... +* double dzoptwave +* (Returned) ... vice versa [/m] (wavetype && velotype). +* +* double dwaveawav +* (Returned) Derivative of vacuum wavelength with respect to air +* wavelength [dimensionless], and ... +* double dawavwave +* (Returned) ... vice versa [dimensionless] (wavetype). +* +* double dwavevelo +* (Returned) Derivative of vacuum wavelength with respect to relativistic +* velocity [s], and ... +* double dvelowave +* (Returned) ... vice versa [/s] (wavetype && velotype). +* +* double dawavvelo +* (Returned) Derivative of air wavelength with respect to relativistic +* velocity [s], and ... +* double dveloawav +* (Returned) ... vice versa [/s] (wavetype && velotype). +* +* double dvelobeta +* (Returned) Derivative of relativistic velocity with respect to +* relativistic beta [m/s] (constant, = c, the speed of light in vacuo), +* and ... +* double dbetavelo +* (Returned) ... vice versa [s/m] (constant, = 1/c, always available). +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* void *padding +* (An unused variable inserted for alignment purposes only.) +* +* Global variable: const char *spx_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_SPEC +#define WCSLIB_SPEC + +#ifdef __cplusplus +extern "C" { +#endif + +extern const char *spx_errmsg[]; + +enum spx_errmsg { + SPXERR_SUCCESS = 0, /* Success. */ + SPXERR_NULL_POINTER = 1, /* Null spxprm pointer passed. */ + SPXERR_BAD_SPEC_PARAMS = 2, /* Invalid spectral parameters. */ + SPXERR_BAD_SPEC_VAR = 3, /* Invalid spectral variable. */ + SPXERR_BAD_INSPEC_COORD = 4 /* One or more of the inspec coordinates were + invalid. */ +}; + +struct spxprm { + double restfrq, restwav; /* Rest frequency [Hz] and wavelength [m]. */ + + int wavetype, velotype; /* True if wave/velocity types have been */ + /* computed; types are defined below. */ + + /* Spectral variables computed by specx(). */ + /*------------------------------------------------------------------------*/ + double freq, /* wavetype: Frequency [Hz]. */ + afrq, /* wavetype: Angular frequency [rad/s]. */ + ener, /* wavetype: Photon energy [J]. */ + wavn, /* wavetype: Wave number [/m]. */ + vrad, /* velotype: Radio velocity [m/s]. */ + wave, /* wavetype: Vacuum wavelength [m]. */ + vopt, /* velotype: Optical velocity [m/s]. */ + zopt, /* velotype: Redshift. */ + awav, /* wavetype: Air wavelength [m]. */ + velo, /* velotype: Relativistic velocity [m/s]. */ + beta; /* velotype: Relativistic beta. */ + + /* Derivatives of spectral variables computed by specx(). */ + /*------------------------------------------------------------------------*/ + double dfreqafrq, dafrqfreq, /* Constant, always available. */ + dfreqener, denerfreq, /* Constant, always available. */ + dfreqwavn, dwavnfreq, /* Constant, always available. */ + dfreqvrad, dvradfreq, /* wavetype && velotype. */ + dfreqwave, dwavefreq, /* wavetype. */ + dfreqawav, dawavfreq, /* wavetype. */ + dfreqvelo, dvelofreq, /* wavetype && velotype. */ + dwavevopt, dvoptwave, /* wavetype && velotype. */ + dwavezopt, dzoptwave, /* wavetype && velotype. */ + dwaveawav, dawavwave, /* wavetype. */ + dwavevelo, dvelowave, /* wavetype && velotype. */ + dawavvelo, dveloawav, /* wavetype && velotype. */ + dvelobeta, dbetavelo; /* Constant, always available. */ + + /* Error handling */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private */ + /*------------------------------------------------------------------------*/ + void *padding; /* (Dummy inserted for alignment purposes.) */ +}; + +/* Size of the spxprm struct in int units, used by the Fortran wrappers. */ +#define SPXLEN (sizeof(struct spxprm)/sizeof(int)) + + +int specx(const char *type, double spec, double restfrq, double restwav, + struct spxprm *specs); + +int spxperr(const struct spxprm *spx, const char *prefix); + +/* For use in declaring function prototypes, e.g. in spcprm. */ +#define SPX_ARGS double param, int nspec, int instep, int outstep, \ + const double inspec[], double outspec[], int stat[] + +int freqafrq(SPX_ARGS); +int afrqfreq(SPX_ARGS); + +int freqener(SPX_ARGS); +int enerfreq(SPX_ARGS); + +int freqwavn(SPX_ARGS); +int wavnfreq(SPX_ARGS); + +int freqwave(SPX_ARGS); +int wavefreq(SPX_ARGS); + +int freqawav(SPX_ARGS); +int awavfreq(SPX_ARGS); + +int waveawav(SPX_ARGS); +int awavwave(SPX_ARGS); + +int velobeta(SPX_ARGS); +int betavelo(SPX_ARGS); + + +int freqvelo(SPX_ARGS); +int velofreq(SPX_ARGS); + +int freqvrad(SPX_ARGS); +int vradfreq(SPX_ARGS); + + +int wavevelo(SPX_ARGS); +int velowave(SPX_ARGS); + +int awavvelo(SPX_ARGS); +int veloawav(SPX_ARGS); + +int wavevopt(SPX_ARGS); +int voptwave(SPX_ARGS); + +int wavezopt(SPX_ARGS); +int zoptwave(SPX_ARGS); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_SPEC */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/tab.c b/testbed/astropy__astropy/cextern/wcslib/C/tab.c new file mode 100644 index 0000000000000000000000000000000000000000..bb1af562f5ffffb84a7f071fd8fef6276b014b1b --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/tab.c @@ -0,0 +1,1650 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: tab.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcsutil.h" +#include "tab.h" + +const int TABSET = 137; + +/* Map status return value to message. */ +const char *tab_errmsg[] = { + "Success", + "Null tabprm pointer passed", + "Memory allocation failed", + "Invalid tabular parameters", + "One or more of the x coordinates were invalid", + "One or more of the world coordinates were invalid"}; + +/* Convenience macro for invoking wcserr_set(). */ +#define TAB_ERRMSG(status) WCSERR_SET(status), tab_errmsg[status] + +/*--------------------------------------------------------------------------*/ + +int tabini(int alloc, int M, const int K[], struct tabprm *tab) + +{ + static const char *function = "tabini"; + + int k, m, N; + double *dp; + struct wcserr **err; + + if (tab == 0x0) return TABERR_NULL_POINTER; + + /* Initialize error message handling. */ + err = &(tab->err); + if (tab->flag != -1) { + if (tab->err) free(tab->err); + } + tab->err = 0x0; + + + if (M <= 0) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "M must be positive, got %d", M); + } + + /* Determine the total number of elements in the coordinate array. */ + if (K) { + N = M; + + for (m = 0; m < M; m++) { + if (K[m] < 0) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Each element of K must be " + "non-negative, got %d", K[m]); + } + + N *= K[m]; + } + + } else { + /* Axis lengths as yet unknown. */ + N = 0; + } + + + /* Initialize memory management. */ + if (tab->flag == -1 || tab->m_flag != TABSET) { + if (tab->flag == -1) { + tab->sense = 0x0; + tab->p0 = 0x0; + tab->delta = 0x0; + tab->extrema = 0x0; + tab->set_M = 0; + } + + tab->m_flag = 0; + tab->m_M = 0; + tab->m_N = 0; + tab->m_K = 0x0; + tab->m_map = 0x0; + tab->m_crval = 0x0; + tab->m_index = 0x0; + tab->m_indxs = 0x0; + tab->m_coord = 0x0; + + } else { + /* Clear any outstanding signals set by wcstab(). */ + for (m = 0; m < tab->m_M; m++) { + if (tab->m_indxs[m] == (double *)0x1) tab->m_indxs[m] = 0x0; + } + + if (tab->m_coord == (double *)0x1) tab->m_coord = 0x0; + } + + + /* Allocate memory for arrays if required. */ + if (alloc || + tab->K == 0x0 || + tab->map == 0x0 || + tab->crval == 0x0 || + tab->index == 0x0 || + tab->coord == 0x0) { + + /* Was sufficient allocated previously? */ + if (tab->m_flag == TABSET && (tab->m_M < M || tab->m_N < N)) { + /* No, free it. */ + tabfree(tab); + } + + if (alloc || tab->K == 0x0) { + if (tab->m_K) { + /* In case the caller fiddled with it. */ + tab->K = tab->m_K; + + } else { + if (!(tab->K = calloc(M, sizeof(int)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_flag = TABSET; + tab->m_M = M; + tab->m_K = tab->K; + } + } + + if (alloc || tab->map == 0x0) { + if (tab->m_map) { + /* In case the caller fiddled with it. */ + tab->map = tab->m_map; + + } else { + if (!(tab->map = calloc(M, sizeof(int)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_flag = TABSET; + tab->m_M = M; + tab->m_map = tab->map; + } + } + + if (alloc || tab->crval == 0x0) { + if (tab->m_crval) { + /* In case the caller fiddled with it. */ + tab->crval = tab->m_crval; + + } else { + if (!(tab->crval = calloc(M, sizeof(double)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_flag = TABSET; + tab->m_M = M; + tab->m_crval = tab->crval; + } + } + + if (alloc || tab->index == 0x0) { + if (tab->m_index) { + /* In case the caller fiddled with it. */ + tab->index = tab->m_index; + + } else { + if (!(tab->index = calloc(M, sizeof(double *)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_flag = TABSET; + tab->m_M = M; + tab->m_N = N; + tab->m_index = tab->index; + + if (!(tab->m_indxs = calloc(M, sizeof(double *)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + /* Recall that calloc() initializes these pointers to zero. */ + if (K) { + for (m = 0; m < M; m++) { + if (K[m]) { + if (!(tab->index[m] = calloc(K[m], sizeof(double)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_indxs[m] = tab->index[m]; + } + } + } + } + } + + if (alloc || tab->coord == 0x0) { + if (tab->m_coord) { + /* In case the caller fiddled with it. */ + tab->coord = tab->m_coord; + + } else if (N) { + if (!(tab->coord = calloc(N, sizeof(double)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->m_flag = TABSET; + tab->m_M = M; + tab->m_N = N; + tab->m_coord = tab->coord; + } + } + } + + tab->flag = 0; + tab->M = M; + + /* Set defaults. */ + for (m = 0; m < M; m++) { + tab->map[m] = -1; + tab->crval[m] = 0.0; + + if (K) { + tab->K[m] = K[m]; + if ((dp = tab->index[m])) { + for (k = 0; k < K[m]; k++) { + *(dp++) = k; + } + } + } else { + tab->K[m] = 0; + } + } + + /* Initialize the coordinate array. */ + for (dp = tab->coord; dp < tab->coord + N; dp++) { + *dp = UNDEFINED; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabmem(struct tabprm *tab) + +{ + static const char *function = "tabmem"; + + int m, M, N; + struct wcserr **err; + + if (tab == 0x0) return TABERR_NULL_POINTER; + err = &(tab->err); + + if (tab->M == 0 || tab->K == 0x0) { + /* Should have been set by this time. */ + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "Null pointers in tabprm struct"); + } + + + N = M = tab->M; + for (m = 0; m < M; m++) { + if (tab->K[m] < 0) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Each element of K must be " + "non-negative, got %d", M); + } + + N *= tab->K[m]; + } + + + if (tab->m_M == 0) { + tab->m_M = M; + } else if (tab->m_M < M) { + /* Only possible if the user changed M. */ + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "tabprm struct inconsistent"); + } + + if (tab->m_N == 0) { + tab->m_N = N; + } else if (tab->m_N < N) { + /* Only possible if the user changed K[]. */ + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "tabprm struct inconsistent"); + } + + if (tab->m_K == 0x0) { + if ((tab->m_K = tab->K)) { + tab->m_flag = TABSET; + } + } + + if (tab->m_map == 0x0) { + if ((tab->m_map = tab->map)) { + tab->m_flag = TABSET; + } + } + + if (tab->m_crval == 0x0) { + if ((tab->m_crval = tab->crval)) { + tab->m_flag = TABSET; + } + } + + if (tab->m_index == 0x0) { + if ((tab->m_index = tab->index)) { + tab->m_flag = TABSET; + } + } + + for (m = 0; m < tab->m_M; m++) { + if (tab->m_indxs[m] == 0x0 || tab->m_indxs[m] == (double *)0x1) { + if ((tab->m_indxs[m] = tab->index[m])) { + tab->m_flag = TABSET; + } + } + } + + if (tab->m_coord == 0x0 || tab->m_coord == (double *)0x1) { + if ((tab->m_coord = tab->coord)) { + tab->m_flag = TABSET; + } + } + + tab->flag = 0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst) + +{ + static const char *function = "tabcpy"; + + int k, m, M, n, N, status; + double *dstp, *srcp; + struct wcserr **err; + + if (tabsrc == 0x0) return TABERR_NULL_POINTER; + if (tabdst == 0x0) return TABERR_NULL_POINTER; + err = &(tabdst->err); + + M = tabsrc->M; + if (M <= 0) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "M must be positive, got %d", M); + } + + if ((status = tabini(alloc, M, tabsrc->K, tabdst))) { + return status; + } + + N = M; + for (m = 0; m < M; m++) { + tabdst->map[m] = tabsrc->map[m]; + tabdst->crval[m] = tabsrc->crval[m]; + N *= tabsrc->K[m]; + } + + for (m = 0; m < M; m++) { + if ((srcp = tabsrc->index[m])) { + dstp = tabdst->index[m]; + for (k = 0; k < tabsrc->K[m]; k++) { + *(dstp++) = *(srcp++); + } + } + } + + srcp = tabsrc->coord; + dstp = tabdst->coord; + for (n = 0; n < N; n++) { + *(dstp++) = *(srcp++); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabcmp(int dummy, + double tol, + const struct tabprm *tab1, + const struct tabprm *tab2, + int *equal) + +{ + int m, M, N; + + /* Avert nuisance compiler warnings about unused parameters. */ + (void)dummy; + + if (tab1 == 0x0) return TABERR_NULL_POINTER; + if (tab2 == 0x0) return TABERR_NULL_POINTER; + if (equal == 0x0) return TABERR_NULL_POINTER; + + *equal = 0; + + if (tab1->M != tab2->M) { + return 0; + } + + M = tab1->M; + + if (!wcsutil_intEq(M, tab1->K, tab2->K) || + !wcsutil_intEq(M, tab1->map, tab2->map) || + !wcsutil_Eq(M, tol, tab1->crval, tab2->crval)) { + return 0; + } + + N = M; + for (m = 0; m < M; m++) { + if (!wcsutil_Eq(tab1->K[m], tol, tab1->index[m], tab2->index[m])) { + return 0; + } + + N *= tab1->K[m]; + } + + if (!wcsutil_Eq(N, tol, tab1->coord, tab2->coord)) { + return 0; + } + + *equal = 1; + + return 0; +} + + +/*--------------------------------------------------------------------------*/ + +int tabfree(struct tabprm *tab) + +{ + int m; + + if (tab == 0x0) return TABERR_NULL_POINTER; + + if (tab->flag != -1) { + /* Clear any outstanding signals set by wcstab(). */ + for (m = 0; m < tab->m_M; m++) { + if (tab->m_indxs[m] == (double *)0x1) tab->m_indxs[m] = 0x0; + } + + if (tab->m_coord == (double *)0x1) tab->m_coord = 0x0; + + /* Free memory allocated by tabini(). */ + if (tab->m_flag == TABSET) { + if (tab->K == tab->m_K) tab->K = 0x0; + if (tab->map == tab->m_map) tab->map = 0x0; + if (tab->crval == tab->m_crval) tab->crval = 0x0; + if (tab->index == tab->m_index) tab->index = 0x0; + if (tab->coord == tab->m_coord) tab->coord = 0x0; + + if (tab->m_K) free(tab->m_K); + if (tab->m_map) free(tab->m_map); + if (tab->m_crval) free(tab->m_crval); + + if (tab->m_index) { + for (m = 0; m < tab->m_M; m++) { + if (tab->m_indxs[m]) free(tab->m_indxs[m]); + } + free(tab->m_index); + free(tab->m_indxs); + } + + if (tab->m_coord) free(tab->m_coord); + } + + /* Free memory allocated by tabset(). */ + if (tab->sense) free(tab->sense); + if (tab->p0) free(tab->p0); + if (tab->delta) free(tab->delta); + if (tab->extrema) free(tab->extrema); + } + + tab->m_flag = 0; + tab->m_M = 0; + tab->m_N = 0; + tab->m_K = 0x0; + tab->m_map = 0x0; + tab->m_crval = 0x0; + tab->m_index = 0x0; + tab->m_indxs = 0x0; + tab->m_coord = 0x0; + + tab->sense = 0x0; + tab->p0 = 0x0; + tab->delta = 0x0; + tab->extrema = 0x0; + tab->set_M = 0; + + if (tab->err) { + free(tab->err); + tab->err = 0x0; + } + + tab->flag = 0; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabprt(const struct tabprm *tab) + +{ + char *cp, text[128]; + int j, k, m, n, nd; + double *dp; + + if (tab == 0x0) return TABERR_NULL_POINTER; + + if (tab->flag != TABSET) { + wcsprintf("The tabprm struct is UNINITIALIZED.\n"); + return 0; + } + + wcsprintf(" flag: %d\n", tab->flag); + wcsprintf(" M: %d\n", tab->M); + + /* Array dimensions. */ + WCSPRINTF_PTR(" K: ", tab->K, "\n"); + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf("%6d", tab->K[m]); + } + wcsprintf("\n"); + + /* Map vector. */ + WCSPRINTF_PTR(" map: ", tab->map, "\n"); + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf("%6d", tab->map[m]); + } + wcsprintf("\n"); + + /* Reference index value. */ + WCSPRINTF_PTR(" crval: ", tab->crval, "\n"); + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf(" %#- 11.5g", tab->crval[m]); + } + wcsprintf("\n"); + + /* Index vectors. */ + WCSPRINTF_PTR(" index: ", tab->index, "\n"); + for (m = 0; m < tab->M; m++) { + wcsprintf(" index[%d]: ", m); + WCSPRINTF_PTR("", tab->index[m], ""); + if (tab->index[m]) { + for (k = 0; k < tab->K[m]; k++) { + if (k%5 == 0) { + wcsprintf("\n "); + } + wcsprintf(" %#- 11.5g", tab->index[m][k]); + } + wcsprintf("\n"); + } + } + + /* Coordinate array. */ + WCSPRINTF_PTR(" coord: ", tab->coord, "\n"); + dp = tab->coord; + for (n = 0; n < tab->nc; n++) { + /* Array index. */ + j = n; + cp = text; + for (m = 0; m < tab->M; m++) { + nd = (tab->K[m] < 10) ? 1 : 2; + sprintf(cp, ",%*d", nd, j % tab->K[m] + 1); + j /= tab->K[m]; + cp += strlen(cp); + } + + wcsprintf(" (*%s)", text); + for (m = 0; m < tab->M; m++) { + wcsprintf(" %#- 11.5g", *(dp++)); + } + wcsprintf("\n"); + } + + wcsprintf(" nc: %d\n", tab->nc); + + WCSPRINTF_PTR(" sense: ", tab->sense, "\n"); + if (tab->sense) { + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf("%6d", tab->sense[m]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" p0: ", tab->p0, "\n"); + if (tab->p0) { + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf("%6d", tab->p0[m]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" delta: ", tab->delta, "\n"); + if (tab->delta) { + wcsprintf(" "); + for (m = 0; m < tab->M; m++) { + wcsprintf(" %#- 11.5g", tab->delta[m]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" extrema: ", tab->extrema, "\n"); + dp = tab->extrema; + for (n = 0; n < tab->nc/tab->K[0]; n++) { + /* Array index. */ + j = n; + cp = text; + *cp = '\0'; + for (m = 1; m < tab->M; m++) { + nd = (tab->K[m] < 10) ? 1 : 2; + sprintf(cp, ",%*d", nd, j % tab->K[m] + 1); + j /= tab->K[m]; + cp += strlen(cp); + } + + wcsprintf(" (*,*%s)", text); + for (m = 0; m < 2*tab->M; m++) { + if (m == tab->M) wcsprintf("-> "); + wcsprintf(" %#- 11.5g", *(dp++)); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" err: ", tab->err, "\n"); + if (tab->err) { + wcserr_prt(tab->err, " "); + } + + /* Memory management. */ + wcsprintf(" m_flag: %d\n", tab->m_flag); + wcsprintf(" m_M: %d\n", tab->m_M); + wcsprintf(" m_N: %d\n", tab->m_N); + + WCSPRINTF_PTR(" m_K: ", tab->m_K, ""); + if (tab->m_K == tab->K) wcsprintf(" (= K)"); + wcsprintf("\n"); + + WCSPRINTF_PTR(" m_map: ", tab->m_map, ""); + if (tab->m_map == tab->map) wcsprintf(" (= map)"); + wcsprintf("\n"); + + WCSPRINTF_PTR(" m_crval: ", tab->m_crval, ""); + if (tab->m_crval == tab->crval) wcsprintf(" (= crval)"); + wcsprintf("\n"); + + WCSPRINTF_PTR(" m_index: ", tab->m_index, ""); + if (tab->m_index == tab->index) wcsprintf(" (= index)"); + wcsprintf("\n"); + for (m = 0; m < tab->M; m++) { + wcsprintf(" m_indxs[%d]: ", m); + WCSPRINTF_PTR("", tab->m_indxs[m], ""); + if (tab->m_indxs[m] == tab->index[m]) wcsprintf(" (= index[%d])", m); + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" m_coord: ", tab->m_coord, ""); + if (tab->m_coord == tab->coord) wcsprintf(" (= coord)"); + wcsprintf("\n"); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabperr(const struct tabprm *tab, const char *prefix) + +{ + if (tab == 0x0) return TABERR_NULL_POINTER; + + if (tab->err) { + wcserr_prt(tab->err, prefix); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabset(struct tabprm *tab) + +{ + static const char *function = "tabset"; + + int i, ic, k, *Km, m, M, ne; + double *dcrd, *dmax, *dmin, dPsi, dval, *Psi; + struct wcserr **err; + + if (tab == 0x0) return TABERR_NULL_POINTER; + err = &(tab->err); + + /* Check the number of tabular coordinate axes. */ + if ((M = tab->M) < 1) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: M must be positive, got %d", M); + } + + /* Check the axis lengths. */ + if (!tab->K) { + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "Null pointers in tabprm struct"); + } + + tab->nc = 1; + for (m = 0; m < M; m++) { + if (tab->K[m] < 1) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Each element of K must be positive, " + "got %d", tab->K[m]); + } + + /* Number of coordinate vectors in the coordinate array. */ + tab->nc *= tab->K[m]; + } + + /* Check that the map vector is sensible. */ + if (!tab->map) { + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "Null pointers in tabprm struct"); + } + + for (m = 0; m < M; m++) { + i = tab->map[m]; + if (i < 0) { + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Each element of map must be " + "non-negative, got %d", i); + } + } + + /* Check memory allocation for the remaining vectors. */ + if (!tab->crval || !tab->index || !tab->coord) { + return wcserr_set(WCSERR_SET(TABERR_MEMORY), + "Null pointers in tabprm struct"); + } + + /* Take memory if signalled to by wcstab(). */ + for (m = 0; m < tab->m_M; m++) { + if (tab->m_indxs[m] == (double *)0x1 && + (tab->m_indxs[m] = tab->index[m])) { + tab->m_flag = TABSET; + } + } + + if (tab->m_coord == (double *)0x1 && + (tab->m_coord = tab->coord)) { + tab->m_flag = TABSET; + } + + + /* Allocate memory for work vectors. */ + if (tab->flag != TABSET || tab->set_M < M) { + /* Free memory that may have been allocated previously. */ + if (tab->sense) free(tab->sense); + if (tab->p0) free(tab->p0); + if (tab->delta) free(tab->delta); + if (tab->extrema) free(tab->extrema); + + /* Allocate memory for internal arrays. */ + if (!(tab->sense = calloc(M, sizeof(int)))) { + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + if (!(tab->p0 = calloc(M, sizeof(int)))) { + free(tab->sense); + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + if (!(tab->delta = calloc(M, sizeof(double)))) { + free(tab->sense); + free(tab->p0); + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + ne = M * tab->nc * 2 / tab->K[0]; + if (!(tab->extrema = calloc(ne, sizeof(double)))) { + free(tab->sense); + free(tab->p0); + free(tab->delta); + return wcserr_set(TAB_ERRMSG(TABERR_MEMORY)); + } + + tab->set_M = M; + } + + /* Check that the index vectors are monotonic. */ + Km = tab->K; + for (m = 0; m < M; m++, Km++) { + tab->sense[m] = 0; + + if (*Km > 1) { + if ((Psi = tab->index[m]) == 0x0) { + /* Default indexing. */ + tab->sense[m] = 1; + + } else { + for (k = 0; k < *Km-1; k++) { + switch (tab->sense[m]) { + case 0: + if (Psi[k] < Psi[k+1]) { + /* Monotonic increasing. */ + tab->sense[m] = 1; + } else if (Psi[k] > Psi[k+1]) { + /* Monotonic decreasing. */ + tab->sense[m] = -1; + } + break; + + case 1: + if (Psi[k] > Psi[k+1]) { + /* Should be monotonic increasing. */ + free(tab->sense); + free(tab->p0); + free(tab->delta); + free(tab->extrema); + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Index vectors are not " + "monotonically increasing"); + } + break; + + case -1: + if (Psi[k] < Psi[k+1]) { + /* Should be monotonic decreasing. */ + free(tab->sense); + free(tab->p0); + free(tab->delta); + free(tab->extrema); + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Index vectors are not " + "monotonically decreasing"); + } + break; + } + } + } + + if (tab->sense[m] == 0) { + free(tab->sense); + free(tab->p0); + free(tab->delta); + free(tab->extrema); + return wcserr_set(WCSERR_SET(TABERR_BAD_PARAMS), + "Invalid tabular parameters: Index vectors are not monotonic"); + } + } + } + + /* Find the extremal values of the coordinate elements in each row. */ + dcrd = tab->coord; + dmin = tab->extrema; + dmax = tab->extrema + M; + for (ic = 0; ic < tab->nc; ic += tab->K[0]) { + for (m = 0; m < M; m++, dcrd++) { + if (tab->K[0] > 1) { + /* Extrapolate a little before the start of the row. */ + Psi = tab->index[0]; + if (Psi == 0x0) { + dPsi = 1.0; + } else { + dPsi = Psi[1] - Psi[0]; + } + + dval = *dcrd; + if (dPsi != 0.0) { + dval -= 0.5 * (*(dcrd+M) - *dcrd)/dPsi; + } + + *(dmax+m) = *(dmin+m) = dval; + } else { + *(dmax+m) = *(dmin+m) = *dcrd; + } + } + + dcrd -= M; + for (i = 0; i < tab->K[0]; i++) { + for (m = 0; m < M; m++, dcrd++) { + if (*(dmax+m) < *dcrd) *(dmax+m) = *dcrd; + if (*(dmin+m) > *dcrd) *(dmin+m) = *dcrd; + + if (tab->K[0] > 1 && i == tab->K[0]-1) { + /* Extrapolate a little beyond the end of the row. */ + Psi = tab->index[0]; + if (Psi == 0x0) { + dPsi = 1.0; + } else { + dPsi = Psi[i] - Psi[i-1]; + } + + dval = *dcrd; + if (dPsi != 0.0) { + dval += 0.5 * (*dcrd - *(dcrd-M))/dPsi; + } + + if (*(dmax+m) < dval) *(dmax+m) = dval; + if (*(dmin+m) > dval) *(dmin+m) = dval; + } + } + } + + dmin += 2*M; + dmax += 2*M; + } + + tab->flag = TABSET; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int tabx2s( + struct tabprm *tab, + int ncoord, + int nelem, + const double x[], + double world[], + int stat[]) + +{ + static const char *function = "tabx2s"; + + int i, iv, k, *Km, m, M, n, nv, offset, p1, status; + double *coord, *Psi, psi_m, upsilon, wgt; + register int *statp; + register const double *xp; + register double *wp; + struct wcserr **err; + + if (tab == 0x0) return TABERR_NULL_POINTER; + err = &(tab->err); + + /* Initialize if required. */ + if (tab->flag != TABSET) { + if ((status = tabset(tab))) return status; + } + + /* This is used a lot. */ + M = tab->M; + + status = 0; + xp = x; + wp = world; + statp = stat; + for (n = 0; n < ncoord; n++) { + /* Determine the indexes. */ + Km = tab->K; + for (m = 0; m < M; m++, Km++) { + /* N.B. psi_m and Upsilon_m are 1-relative FITS indexes. */ + i = tab->map[m]; + psi_m = *(xp+i) + tab->crval[m]; + + Psi = tab->index[m]; + if (Psi == 0x0) { + /* Default indexing is simple. */ + upsilon = psi_m; + + } else { + /* To ease confusion, decrement Psi so that we can use 1-relative + C array indexing to match the 1-relative FITS indexing. */ + Psi--; + + if (*Km == 1) { + /* Index vector is degenerate. */ + if (Psi[1]-0.5 <= psi_m && psi_m <= Psi[1]+0.5) { + upsilon = psi_m; + } else { + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + } else { + /* Interpolate in the indexing vector. */ + if (tab->sense[m] == 1) { + /* Monotonic increasing index values. */ + if (psi_m < Psi[1]) { + if (Psi[1] - 0.5*(Psi[2]-Psi[1]) <= psi_m) { + /* Allow minor extrapolation. */ + k = 1; + + } else { + /* Index is out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + } else if (Psi[*Km] < psi_m) { + if (psi_m <= Psi[*Km] + 0.5*(Psi[*Km]-Psi[*Km-1])) { + /* Allow minor extrapolation. */ + k = *Km - 1; + + } else { + /* Index is out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + } else { + for (k = 1; k < *Km; k++) { + if (psi_m < Psi[k]) { + continue; + } + if (Psi[k] == psi_m && psi_m < Psi[k+1]) { + break; + } + if (Psi[k] < psi_m && psi_m <= Psi[k+1]) { + break; + } + } + } + + } else { + /* Monotonic decreasing index values. */ + if (psi_m > Psi[1]) { + if (Psi[1] + 0.5*(Psi[1]-Psi[2]) >= psi_m) { + /* Allow minor extrapolation. */ + k = 1; + + } else { + /* Index is out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + } else if (psi_m < Psi[*Km]) { + if (Psi[*Km] - 0.5*(Psi[*Km-1]-Psi[*Km]) <= psi_m) { + /* Allow minor extrapolation. */ + k = *Km - 1; + + } else { + /* Index is out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + } else { + for (k = 1; k < *Km; k++) { + if (psi_m > Psi[k]) { + continue; + } + if (Psi[k] == psi_m && psi_m > Psi[k+1]) { + break; + } + if (Psi[k] > psi_m && psi_m >= Psi[k+1]) { + break; + } + } + } + } + + upsilon = k + (psi_m - Psi[k]) / (Psi[k+1] - Psi[k]); + } + } + + if (upsilon < 0.5 || upsilon > *Km + 0.5) { + /* Index out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_X)); + goto next; + } + + /* Fiducial array indices and fractional offset. + p1 is 1-relative while tab::p0 is 0-relative. */ + p1 = (int)floor(upsilon); + tab->p0[m] = p1 - 1; + tab->delta[m] = upsilon - p1; + + if (p1 == 0) { + tab->p0[m] += 1; + tab->delta[m] -= 1.0; + } else if (p1 == *Km && *Km > 1) { + tab->p0[m] -= 1; + tab->delta[m] += 1.0; + } + } + + + /* Now interpolate in the coordinate array; the M-dimensional linear */ + /* interpolation algorithm is described in Sect. 3.4 of WCS Paper IV. */ + for (m = 0; m < M; m++) { + i = tab->map[m]; + *(wp+i) = 0.0; + } + + /* Loop over the 2^M vertices surrounding P. */ + nv = 1 << M; + for (iv = 0; iv < nv; iv++) { + /* Locate vertex in the coordinate array and compute its weight. */ + offset = 0; + wgt = 1.0; + for (m = M-1; m >= 0; m--) { + offset *= tab->K[m]; + offset += tab->p0[m]; + if (iv & (1 << m)) { + if (tab->K[m] > 1) offset++; + wgt *= tab->delta[m]; + } else { + wgt *= 1.0 - tab->delta[m]; + } + } + + if (wgt == 0.0) continue; + + /* Add the contribution from this vertex to each element. */ + coord = tab->coord + offset*M; + for (m = 0; m < M; m++) { + i = tab->map[m]; + *(wp+i) += *(coord++) * wgt; + } + + if (wgt == 1.0) break; + } + + *statp = 0; + +next: + xp += nelem; + wp += nelem; + statp++; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int tabs2x( + struct tabprm* tab, + int ncoord, + int nelem, + const double world[], + double x[], + int stat[]) + +{ + static const char *function = "tabs2x"; + + int tabedge(struct tabprm *); + int tabrow(struct tabprm *, const double *); + int tabvox(struct tabprm *, const double *, int, double **, unsigned int *); + + int edge, i, ic, iv, k, *Km, M, m, n, nv, offset, status; + double *dcrd, delta, *Psi, psi_m, **tabcoord, upsilon; + register int *statp; + register const double *wp; + register double *xp; + struct wcserr **err; + + if (tab == 0x0) return TABERR_NULL_POINTER; + err = &(tab->err); + + /* Initialize if required. */ + if (tab->flag != TABSET) { + if ((status = tabset(tab))) return status; + } + + /* This is used a lot. */ + M = tab->M; + + tabcoord = 0x0; + nv = 0; + if (M > 1) { + nv = 1 << M; + tabcoord = calloc(nv, sizeof(double *)); + } + + + status = 0; + wp = world; + xp = x; + statp = stat; + for (n = 0; n < ncoord; n++) { + /* Locate this coordinate in the coordinate array. */ + edge = 0; + for (m = 0; m < M; m++) { + tab->p0[m] = 0; + } + + for (ic = 0; ic < tab->nc; ic++) { + if (tab->p0[0] == 0) { + /* New row, could it contain a solution? */ + if (edge || tabrow(tab, wp)) { + /* No, skip it. */ + ic += tab->K[0]; + tab->p0[1]++; + edge = tabedge(tab); + + /* Because ic will be incremented when the loop is reentered. */ + ic--; + continue; + } + } + + if (M == 1) { + /* Deal with the one-dimensional case separately for efficiency. */ + if (*wp == tab->coord[0]) { + tab->p0[0] = 0; + tab->delta[0] = 0.0; + break; + + } else if (ic < tab->nc - 1) { + if (((tab->coord[ic] <= *wp && *wp <= tab->coord[ic+1]) || + (tab->coord[ic] >= *wp && *wp >= tab->coord[ic+1])) && + (tab->index[0] == 0x0 || + tab->index[0][ic] != tab->index[0][ic+1])) { + tab->p0[0] = ic; + tab->delta[0] = (*wp - tab->coord[ic]) / + (tab->coord[ic+1] - tab->coord[ic]); + break; + } + } + + } else { + /* Multi-dimensional tables are harder. */ + if (!edge) { + /* Addresses of the coordinates for each corner of the "voxel". */ + for (iv = 0; iv < nv; iv++) { + offset = 0; + for (m = M-1; m >= 0; m--) { + offset *= tab->K[m]; + offset += tab->p0[m]; + if ((iv & (1 << m)) && (tab->K[m] > 1)) offset++; + } + tabcoord[iv] = tab->coord + offset*M; + } + + if (tabvox(tab, wp, 0, tabcoord, 0x0) == 0) { + /* Found a solution. */ + break; + } + } + + /* Next voxel. */ + tab->p0[0]++; + edge = tabedge(tab); + } + } + + + if (ic == tab->nc) { + /* Coordinate not found; allow minor extrapolation. */ + if (M == 1) { + /* Should there be a solution? */ + if (tab->extrema[0] <= *wp && *wp <= tab->extrema[1]) { + dcrd = tab->coord; + for (i = 0; i < 2; i++) { + if (i) dcrd += tab->K[0] - 2; + + delta = (*wp - *dcrd) / (*(dcrd+1) - *dcrd); + + if (i == 0) { + if (-0.5 <= delta && delta <= 0.0) { + tab->p0[0] = 0; + tab->delta[0] = delta; + ic = 0; + break; + } + } else { + if (1.0 <= delta && delta <= 1.5) { + tab->p0[0] = tab->K[0] - 1; + tab->delta[0] = delta - 1.0; + ic = 0; + } + } + } + } + + } else { + /* Multi-dimensional tables. */ + /* >>> TBD <<< */ + } + } + + + if (ic == tab->nc) { + /* Coordinate not found. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_WORLD)); + + } else { + /* Determine the intermediate world coordinates. */ + Km = tab->K; + for (m = 0; m < M; m++, Km++) { + /* N.B. Upsilon_m and psi_m are 1-relative FITS indexes. */ + upsilon = (tab->p0[m] + 1) + tab->delta[m]; + + if (upsilon < 0.5 || upsilon > *Km + 0.5) { + /* Index out of range. */ + *statp = 1; + status = wcserr_set(TAB_ERRMSG(TABERR_BAD_WORLD)); + + } else { + /* Do inverse lookup of the index vector. */ + Psi = tab->index[m]; + if (Psi == 0x0) { + /* Default indexing. */ + psi_m = upsilon; + + } else { + /* Decrement Psi and use 1-relative C array indexing to match the + 1-relative FITS indexing. */ + Psi--; + + if (*Km == 1) { + /* Degenerate index vector. */ + psi_m = Psi[1]; + } else { + k = (int)(upsilon); + psi_m = Psi[k]; + if (k < *Km) { + psi_m += (upsilon - k) * (Psi[k+1] - Psi[k]); + } + } + } + + i = tab->map[m]; + xp[i] = psi_m - tab->crval[m]; + } + } + *statp = 0; + } + + wp += nelem; + xp += nelem; + statp++; + } + + if (tabcoord) free(tabcoord); + + return status; +} + +/*---------------------------------------------------------------------------- +* Convenience routine to deal with of edge effects in tabprm::p0. +*---------------------------------------------------------------------------*/ + +int tabedge(struct tabprm* tab) + +{ + int edge, *Km, m; + + edge = 0; + Km = tab->K; + for (m = 0; m < tab->M; m++, Km++) { + if (tab->p0[m] == *Km) { + /* p0 has been incremented beyond the end of the row, point it to the + next one. */ + tab->p0[m] = 0; + tab->p0[m+1]++; + } else if (tab->p0[m] == *Km - 1 && *Km > 1) { + /* p0 is sitting at the end of a non-degenerate row. */ + edge = 1; + } + } + + return edge; +} + +/*---------------------------------------------------------------------------- +* Quick test to see whether the world coordinate indicated by wp could lie +* somewhere along (or near) the row of the image indexed by tabprm::p0. +* Return 0 if so, 1 otherwise. +* +* tabprm::p0 selects a particular row of the image, p0[0] being ignored (i.e. +* treated as zero). Adjacent rows that delimit a row of "voxels" are formed +* by incrementing elements other than p0[0] in all binary combinations. N.B. +* these are not the same as the voxels (pixels) that are indexed by, and +* centred on, integral pixel coordinates in FITS. +* +* To see why it is necessary to examine the adjacent rows, consider the 2-D +* case where the first world coordinate element is constant along each row. +* If the first element of wp has value 0.5, and its value in the row indexed +* by p0 has value 0, and in the next row it has value 1, then it is clear that +* the solution lies in neither row but somewhere between them. Thus both rows +* will be involved in finding the solution. +* +* tabprm::extrema is the address of the first element of a 1-D array that +* records the minimum and maximum value of each element of the coordinate +* vector in each row of the coordinate array, treated as though it were +* defined as +* +* double extrema[K_M]...[K_2][2][M] +* +* The minimum is recorded in the first element of the compressed K_1 +* dimension, then the maximum. +*---------------------------------------------------------------------------*/ + +int tabrow(struct tabprm* tab, const double *wp) + +{ + int M, m, offset; + unsigned int eq, gt, iv, lt, nv; + const double tol = 1e-10; + double *cp, w; + + M = tab->M; + + /* The number of corners in a "voxel". We need examine only half this + number of rows. The extra factor of two will be used to select between + the minimal and maximal values in each row. */ + nv = 1 << M; + + eq = 0; + lt = 0; + gt = 0; + for (iv = 0; iv < nv; iv++) { + /* Find the index into tabprm::extrema for this row. */ + offset = 0; + for (m = M-1; m > 0; m--) { + offset *= tab->K[m]; + offset += tab->p0[m]; + + /* Select the row. */ + if (iv & (1 << m)) { + if (tab->K[m] > 1) offset++; + } + } + + /* The K_1 dimension has length 2 (see prologue). */ + offset *= 2; + + /* Select the minimum on even numbered iterations, else the maximum. */ + if (iv & 1) offset++; + + /* The last dimension has length M (see prologue). */ + offset *= M; + + /* Address of the extremal elements (min or max) for this row. */ + cp = tab->extrema + offset; + + /* For each coordinate element, we only need to find one row where its + minimum value is less than that of wp, and one row where the maximum + value is greater. That doesn't mean that there is a solution, only + that there might be. */ + for (m = 0; m < M; m++, cp++) { + /* Apply the axis mapping. */ + w = wp[tab->map[m]]; + + /* Finally the test itself; set bits in the bitmask. */ + if (fabs(*cp - w) < tol) { + eq |= (1 << m); + } else if (*cp < w) { + lt |= (1 << m); + } else if (*cp > w) { + gt |= (1 << m); + } + } + + /* Have all bits been switched on? */ + if ((lt | eq) == nv-1 && (gt | eq) == nv-1) { + /* A solution could lie within this row of voxels. */ + return 0; + } + } + + /* No solution in this row. */ + return 1; +} + +/*---------------------------------------------------------------------------- +* Does the world coordinate indicated by wp lie within the voxel indexed by +* tabprm::p0? If so, do a binary chop of the interior of the voxel to find +* it and return 0, with tabprm::delta set to the solution. Else return 1. +* +* As in tabrow(), a "voxel" is formed by incrementing the elements of +* tabprm::p0 in all binary combinations. Note that these are not the same as +* the voxels (pixels) that are indexed by, and centred on, integral pixel +* coordinates in FITS. +* +* tabvox() calls itself recursively. When called from outside, level, being +* the level of recursion, should be given as zero. tabcoord is an array +* holding the addresses of the coordinates for each corner of the voxel. +* vox is the address of a work array (vox2) used during recursive calls to +* dissect the voxel. It is ignored when tabvox() is called from outside +* (level == 0). +* +* It is assumed that the image dimensions are no greater than 16. +----------------------------------------------------------------------------*/ + +int tabvox( + struct tabprm* tab, + const double *wp, + int level, + double **tabcoord, + unsigned int *vox) + +{ + int i, M, m; + unsigned int eq, et, gt, iv, jv, lt, nv, vox2[16]; + const double tol = 1e-10; + double coord[16], *cp, dv, w, wgt; + + M = tab->M; + + /* The number of corners in a voxel. */ + nv = 1 << M; + + dv = 1.0; + for (i = 0; i < level; i++) { + dv /= 2.0; + } + + /* Could the coordinate lie within this voxel (level == 0) or sub-voxel + (level > 0)? We use the fact that with linear interpolation the + coordinate elements are extremal in a corner and test each one. */ + lt = 0; + gt = 0; + eq = 0; + for (iv = 0; iv < nv; iv++) { + /* Select a corner of the sub-voxel. */ + for (m = 0; m < M; m++) { + coord[m] = 0.0; + tab->delta[m] = level ? dv*vox[m] : 0.0; + + if (iv & (1 << m)) { + tab->delta[m] += dv; + } + } + + /* Compute the coordinates of this corner of the sub-voxel by linear + interpolation using the weighting algorithm described in Sect. 3.4 of + WCS Paper IV. */ + for (jv = 0; jv < nv; jv++) { + /* Find the weight for this corner of the parent voxel. */ + wgt = 1.0; + for (m = 0; m < M; m++) { + if (jv & (1 << m)) { + wgt *= tab->delta[m]; + } else { + wgt *= 1.0 - tab->delta[m]; + } + } + + if (wgt == 0.0) continue; + + /* Add its contribution to each coordinate element. */ + cp = tabcoord[jv]; + for (m = 0; m < M; m++) { + coord[m] += *(cp++) * wgt; + } + + if (wgt == 1.0) break; + } + + /* Coordinate elements are minimal or maximal in a corner. */ + et = 0; + for (m = 0; m < M; m++) { + /* Apply the axis mapping. */ + w = wp[tab->map[m]]; + + /* Finally the test itself; set bits in the bitmask. */ + if (fabs(coord[m] - w) < tol) { + et |= (1 << m); + } else if (coord[m] < w) { + lt |= (1 << m); + } else if (coord[m] > w) { + gt |= (1 << m); + } + } + + if (et == nv-1) { + /* We've stumbled across a solution in this corner of the sub-voxel. */ + return 0; + } + + eq |= et; + } + + /* Could the coordinate lie within this sub-voxel? */ + if ((lt | eq) == nv-1 && (gt | eq) == nv-1) { + /* Yes it could, but does it? */ + + /* Is it time to stop the recursion? */ + if (level == 31) { + /* We have a solution, squeeze out the last bit of juice. */ + dv /= 2.0; + for (m = 0; m < M; m++) { + tab->delta[m] = dv * (2.0*vox[m] + 1.0); + } + + return 0; + } + + /* Subdivide the sub-voxel and try again for each subdivision. */ + for (iv = 0; iv < nv; iv++) { + /* Select the subdivision. */ + for (m = 0; m < M; m++) { + vox2[m] = level ? 2*vox[m] : 0; + if (iv & (1 << m)) { + vox2[m]++; + } + } + + /* Recurse. */ + if (tabvox(tab, wp, level+1, tabcoord, vox2) == 0) { + return 0; + } + } + } + + /* No solution in this sub-voxel. */ + return 1; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/tab.h b/testbed/astropy__astropy/cextern/wcslib/C/tab.h new file mode 100644 index 0000000000000000000000000000000000000000..378845db04b64d881ceb47baf890a9938e8520cc --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/tab.h @@ -0,0 +1,635 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: tab.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the tab routines +* --------------------------- +* Routines in this suite implement the part of the FITS World Coordinate +* System (WCS) standard that deals with tabular coordinates, i.e. coordinates +* that are defined via a lookup table, as described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) +* +* These routines define methods to be used for computing tabular world +* coordinates from intermediate world coordinates (a linear transformation +* of image pixel coordinates), and vice versa. They are based on the tabprm +* struct which contains all information needed for the computations. The +* struct contains some members that must be set by the user, and others that +* are maintained by these routines, somewhat like a C++ class but with no +* encapsulation. +* +* tabini(), tabmem(), tabcpy(), and tabfree() are provided to manage the +* tabprm struct, and another, tabprt(), to print its contents. +* +* tabperr() prints the error message(s) (if any) stored in a tabprm struct. +* +* A setup routine, tabset(), computes intermediate values in the tabprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by tabset() but it need not be called explicitly - refer +* to the explanation of tabprm::flag. +* +* tabx2s() and tabs2x() implement the WCS tabular coordinate transformations. +* +* Accuracy: +* --------- +* No warranty is given for the accuracy of these routines (refer to the +* copyright notice); intending users must satisfy for themselves their +* adequacy for the intended purpose. However, closure effectively to within +* double precision rounding error was demonstrated by test routine ttab.c +* which accompanies this software. +* +* +* tabini() - Default constructor for the tabprm struct +* ---------------------------------------------------- +* tabini() allocates memory for arrays in a tabprm struct and sets all members +* of the struct to default values. +* +* PLEASE NOTE: every tabprm struct should be initialized by tabini(), possibly +* repeatedly. On the first invokation, and only the first invokation, the +* flag member of the tabprm struct must be set to -1 to initialize memory +* management, regardless of whether tabini() will actually be used to allocate +* memory. +* +* Given: +* alloc int If true, allocate memory unconditionally for arrays in +* the tabprm struct. +* +* If false, it is assumed that pointers to these arrays +* have been set by the user except if they are null +* pointers in which case memory will be allocated for +* them regardless. (In other words, setting alloc true +* saves having to initalize these pointers to zero.) +* +* M int The number of tabular coordinate axes. +* +* K const int[] +* Vector of length M whose elements (K_1, K_2,... K_M) +* record the lengths of the axes of the coordinate array +* and of each indexing vector. M and K[] are used to +* determine the length of the various tabprm arrays and +* therefore the amount of memory to allocate for them. +* Their values are copied into the tabprm struct. +* +* It is permissible to set K (i.e. the address of the +* array) to zero which has the same effect as setting +* each element of K[] to zero. In this case no memory +* will be allocated for the index vectors or coordinate +* array in the tabprm struct. These together with the +* K vector must be set separately before calling +* tabset(). +* +* Given and returned: +* tab struct tabprm* +* Tabular transformation parameters. Note that, in +* order to initialize memory management tabprm::flag +* should be set to -1 when tab is initialized for the +* first time (memory leaks may result if it had already +* been initialized). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid tabular parameters. +* +* For returns > 1, a detailed error message is set in +* tabprm::err if enabled, see wcserr_enable(). +* +* +* tabmem() - Acquire tabular memory +* --------------------------------- +* tabmem() takes control of memory allocated by the user for arrays in the +* tabprm struct. +* +* Given and returned: +* tab struct tabprm* +* Tabular transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* tabprm::err if enabled, see wcserr_enable(). +* +* +* tabcpy() - Copy routine for the tabprm struct +* --------------------------------------------- +* tabcpy() does a deep copy of one tabprm struct to another, using tabini() to +* allocate memory for its arrays if required. Only the "information to be +* provided" part of the struct is copied; a call to tabset() is required to +* set up the remainder. +* +* Given: +* alloc int If true, allocate memory unconditionally for arrays in +* the tabprm struct. +* +* If false, it is assumed that pointers to these arrays +* have been set by the user except if they are null +* pointers in which case memory will be allocated for +* them regardless. (In other words, setting alloc true +* saves having to initalize these pointers to zero.) +* +* tabsrc const struct tabprm* +* Struct to copy from. +* +* Given and returned: +* tabdst struct tabprm* +* Struct to copy to. tabprm::flag should be set to -1 +* if tabdst was not previously initialized (memory leaks +* may result if it was previously initialized). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* tabprm::err (associated with tabdst) if enabled, see +* wcserr_enable(). +* +* +* tabcmp() - Compare two tabprm structs for equality +* -------------------------------------------------- +* tabcmp() compares two tabprm structs for equality. +* +* Given: +* cmp int A bit field controlling the strictness of the +* comparison. At present, this value must always be 0, +* indicating a strict comparison. In the future, other +* options may be added. +* +* tol double Tolerance for comparison of floating-point values. +* For example, for tol == 1e-6, all floating-point +* values in the structs must be equal to the first 6 +* decimal places. A value of 0 implies exact equality. +* +* tab1 const struct tabprm* +* The first tabprm struct to compare. +* +* tab2 const struct tabprm* +* The second tabprm struct to compare. +* +* Returned: +* equal int* Non-zero when the given structs are equal. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null pointer passed. +* +* +* tabfree() - Destructor for the tabprm struct +* -------------------------------------------- +* tabfree() frees memory allocated for the tabprm arrays by tabini(). +* tabini() records the memory it allocates and tabfree() will only attempt to +* free this. +* +* PLEASE NOTE: tabfree() must not be invoked on a tabprm struct that was not +* initialized by tabini(). +* +* Returned: +* tab struct tabprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* +* +* tabprt() - Print routine for the tabprm struct +* ---------------------------------------------- +* tabprt() prints the contents of a tabprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* tab const struct tabprm* +* Tabular transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* +* +* tabperr() - Print error messages from a tabprm struct +* ----------------------------------------------------- +* tabperr() prints the error message(s) (if any) stored in a tabprm struct. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* tab const struct tabprm* +* Tabular transformation parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* +* +* tabset() - Setup routine for the tabprm struct +* ----------------------------------------------- +* tabset() allocates memory for work arrays in the tabprm struct and sets up +* the struct according to information supplied within it. +* +* Note that this routine need not be called directly; it will be invoked by +* tabx2s() and tabs2x() if tabprm::flag is anything other than a predefined +* magic value. +* +* Given and returned: +* tab struct tabprm* +* Tabular transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 3: Invalid tabular parameters. +* +* For returns > 1, a detailed error message is set in +* tabprm::err if enabled, see wcserr_enable(). +* +* +* tabx2s() - Pixel-to-world transformation +* ---------------------------------------- +* tabx2s() transforms intermediate world coordinates to world coordinates +* using coordinate lookup. +* +* Given and returned: +* tab struct tabprm* +* Tabular transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length +* nelem. +* +* x const double[ncoord][nelem] +* Array of intermediate world coordinates, SI units. +* +* Returned: +* world double[ncoord][nelem] +* Array of world coordinates, in SI units. +* +* stat int[ncoord] +* Status return value status for each coordinate: +* 0: Success. +* 1: Invalid intermediate world coordinate. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 3: Invalid tabular parameters. +* 4: One or more of the x coordinates were invalid, +* as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* tabprm::err if enabled, see wcserr_enable(). +* +* +* tabs2x() - World-to-pixel transformation +* ---------------------------------------- +* tabs2x() transforms world coordinates to intermediate world coordinates. +* +* Given and returned: +* tab struct tabprm* +* Tabular transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length +* nelem. +* world const double[ncoord][nelem] +* Array of world coordinates, in SI units. +* +* Returned: +* x double[ncoord][nelem] +* Array of intermediate world coordinates, SI units. +* stat int[ncoord] +* Status return value status for each vector element: +* 0: Success. +* 1: Invalid world coordinate. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null tabprm pointer passed. +* 3: Invalid tabular parameters. +* 5: One or more of the world coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* tabprm::err if enabled, see wcserr_enable(). +* +* +* tabprm struct - Tabular transformation parameters +* ------------------------------------------------- +* The tabprm struct contains information required to transform tabular +* coordinates. It consists of certain members that must be set by the user +* ("given") and others that are set by the WCSLIB routines ("returned"). Some +* of the latter are supplied for informational purposes while others are for +* internal use only. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following tabprm structure members are set or changed: +* +* - tabprm::M (q.v., not normally set by the user), +* - tabprm::K (q.v., not normally set by the user), +* - tabprm::map, +* - tabprm::crval, +* - tabprm::index, +* - tabprm::coord. +* +* This signals the initialization routine, tabset(), to recompute the +* returned members of the tabprm struct. tabset() will reset flag to +* indicate that this has been done. +* +* PLEASE NOTE: flag should be set to -1 when tabini() is called for the +* first time for a particular tabprm struct in order to initialize memory +* management. It must ONLY be used on the first initialization otherwise +* memory leaks may result. +* +* int M +* (Given or returned) Number of tabular coordinate axes. +* +* If tabini() is used to initialize the tabprm struct (as would normally +* be the case) then it will set M from the value passed to it as a +* function argument. The user should not subsequently modify it. +* +* int *K +* (Given or returned) Pointer to the first element of a vector of length +* tabprm::M whose elements (K_1, K_2,... K_M) record the lengths of the +* axes of the coordinate array and of each indexing vector. +* +* If tabini() is used to initialize the tabprm struct (as would normally +* be the case) then it will set K from the array passed to it as a +* function argument. The user should not subsequently modify it. +* +* int *map +* (Given) Pointer to the first element of a vector of length tabprm::M +* that defines the association between axis m in the M-dimensional +* coordinate array (1 <= m <= M) and the indices of the intermediate world +* coordinate and world coordinate arrays, x[] and world[], in the argument +* lists for tabx2s() and tabs2x(). +* +* When x[] and world[] contain the full complement of coordinate elements +* in image-order, as will usually be the case, then map[m-1] == i-1 for +* axis i in the N-dimensional image (1 <= i <= N). In terms of the FITS +* keywords +* +* map[PVi_3a - 1] == i - 1. +* +* However, a different association may result if x[], for example, only +* contains a (relevant) subset of intermediate world coordinate elements. +* For example, if M == 1 for an image with N > 1, it is possible to fill +* x[] with the relevant coordinate element with nelem set to 1. In this +* case map[0] = 0 regardless of the value of i. +* +* double *crval +* (Given) Pointer to the first element of a vector of length tabprm::M +* whose elements contain the index value for the reference pixel for each +* of the tabular coordinate axes. +* +* double **index +* (Given) Pointer to the first element of a vector of length tabprm::M of +* pointers to vectors of lengths (K_1, K_2,... K_M) of 0-relative indexes +* (see tabprm::K). +* +* The address of any or all of these index vectors may be set to zero, +* i.e. +* += index[m] == 0; +* +* this is interpreted as default indexing, i.e. +* += index[m][k] = k; +* +* double *coord +* (Given) Pointer to the first element of the tabular coordinate array, +* treated as though it were defined as +* += double coord[K_M]...[K_2][K_1][M]; +* +* (see tabprm::K) i.e. with the M dimension varying fastest so that the +* M elements of a coordinate vector are stored contiguously in memory. +* +* int nc +* (Returned) Total number of coordinate vectors in the coordinate array +* being the product K_1 * K_2 * ... * K_M (see tabprm::K). +* +* int padding +* (An unused variable inserted for alignment purposes only.) +* +* int *sense +* (Returned) Pointer to the first element of a vector of length tabprm::M +* whose elements indicate whether the corresponding indexing vector is +* monotonic increasing (+1), or decreasing (-1). +* +* int *p0 +* (Returned) Pointer to the first element of a vector of length tabprm::M +* of interpolated indices into the coordinate array such that Upsilon_m, +* as defined in Paper III, is equal to (p0[m] + 1) + tabprm::delta[m]. +* +* double *delta +* (Returned) Pointer to the first element of a vector of length tabprm::M +* of interpolated indices into the coordinate array such that Upsilon_m, +* as defined in Paper III, is equal to (tabprm::p0[m] + 1) + delta[m]. +* +* double *extrema +* (Returned) Pointer to the first element of an array that records the +* minimum and maximum value of each element of the coordinate vector in +* each row of the coordinate array, treated as though it were defined as +* += double extrema[K_M]...[K_2][2][M] +* +* (see tabprm::K). The minimum is recorded in the first element of the +* compressed K_1 dimension, then the maximum. This array is used by the +* inverse table lookup function, tabs2x(), to speed up table searches. +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* int m_flag +* (For internal use only.) +* int m_M +* (For internal use only.) +* int m_N +* (For internal use only.) +* int set_M +* (For internal use only.) +* int m_K +* (For internal use only.) +* int m_map +* (For internal use only.) +* int m_crval +* (For internal use only.) +* int m_index +* (For internal use only.) +* int m_indxs +* (For internal use only.) +* int m_coord +* (For internal use only.) +* +* +* Global variable: const char *tab_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_TAB +#define WCSLIB_TAB + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *tab_errmsg[]; + +enum tab_errmsg_enum { + TABERR_SUCCESS = 0, /* Success. */ + TABERR_NULL_POINTER = 1, /* Null tabprm pointer passed. */ + TABERR_MEMORY = 2, /* Memory allocation failed. */ + TABERR_BAD_PARAMS = 3, /* Invalid tabular parameters. */ + TABERR_BAD_X = 4, /* One or more of the x coordinates were + invalid. */ + TABERR_BAD_WORLD = 5 /* One or more of the world coordinates were + invalid. */ +}; + +struct tabprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* Parameters to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int M; /* Number of tabular coordinate axes. */ + int *K; /* Vector of length M whose elements */ + /* (K_1, K_2,... K_M) record the lengths of */ + /* the axes of the coordinate array and of */ + /* each indexing vector. */ + int *map; /* Vector of length M usually such that */ + /* map[m-1] == i-1 for coordinate array */ + /* axis m and image axis i (see above). */ + double *crval; /* Vector of length M containing the index */ + /* value for the reference pixel for each */ + /* of the tabular coordinate axes. */ + double **index; /* Vector of pointers to M indexing vectors */ + /* of lengths (K_1, K_2,... K_M). */ + double *coord; /* (1+M)-dimensional tabular coordinate */ + /* array (see above). */ + + /* Information derived from the parameters supplied. */ + /*------------------------------------------------------------------------*/ + int nc; /* Number of coordinate vectors (of length */ + /* M) in the coordinate array. */ + int padding; /* (Dummy inserted for alignment purposes.) */ + int *sense; /* Vector of M flags that indicate whether */ + /* the Mth indexing vector is monotonic */ + /* increasing, or else decreasing. */ + int *p0; /* Vector of M indices. */ + double *delta; /* Vector of M increments. */ + double *extrema; /* (1+M)-dimensional array of coordinate */ + /* extrema. */ + + /* Error handling */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Private - the remainder are for memory management. */ + /*------------------------------------------------------------------------*/ + int m_flag, m_M, m_N; + int set_M; + int *m_K, *m_map; + double *m_crval, **m_index, **m_indxs, *m_coord; +}; + +/* Size of the tabprm struct in int units, used by the Fortran wrappers. */ +#define TABLEN (sizeof(struct tabprm)/sizeof(int)) + + +int tabini(int alloc, int M, const int K[], struct tabprm *tab); + +int tabmem(struct tabprm *tab); + +int tabcpy(int alloc, const struct tabprm *tabsrc, struct tabprm *tabdst); + +int tabcmp(int cmp, double tol, const struct tabprm *tab1, + const struct tabprm *tab2, int *equal); + +int tabfree(struct tabprm *tab); + +int tabprt(const struct tabprm *tab); + +int tabperr(const struct tabprm *tab, const char *prefix); + +int tabset(struct tabprm *tab); + +int tabx2s(struct tabprm *tab, int ncoord, int nelem, const double x[], + double world[], int stat[]); + +int tabs2x(struct tabprm *tab, int ncoord, int nelem, const double world[], + double x[], int stat[]); + + +/* Deprecated. */ +#define tabini_errmsg tab_errmsg +#define tabcpy_errmsg tab_errmsg +#define tabfree_errmsg tab_errmsg +#define tabprt_errmsg tab_errmsg +#define tabset_errmsg tab_errmsg +#define tabx2s_errmsg tab_errmsg +#define tabs2x_errmsg tab_errmsg + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_TAB */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcs.c b/testbed/astropy__astropy/cextern/wcslib/C/wcs.c new file mode 100644 index 0000000000000000000000000000000000000000..70b14b6b06c618d1a9fd1bfad38c6a17d2864a87 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcs.c @@ -0,0 +1,3978 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcs.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcstrig.h" +#include "wcsunits.h" +#include "wcsutil.h" +#include "wtbarr.h" +#include "lin.h" +#include "dis.h" +#include "log.h" +#include "spc.h" +#include "prj.h" +#include "sph.h" +#include "cel.h" +#include "tab.h" +#include "wcs.h" + +const int WCSSET = 137; + +/* Maximum number of PVi_ma and PSi_ma keywords. */ +int NPVMAX = 64; +int NPSMAX = 8; + +/* Map status return value to message. */ +const char *wcs_errmsg[] = { + "Success", + "Null wcsprm pointer passed", + "Memory allocation failed", + "Linear transformation matrix is singular", + "Inconsistent or unrecognized coordinate axis type", + "Invalid parameter value", + "Unrecognized coordinate transformation parameter", + "Ill-conditioned coordinate transformation parameter", + "One or more of the pixel coordinates were invalid", + "One or more of the world coordinates were invalid", + "Invalid world coordinate", + "No solution found in the specified interval", + "Invalid subimage specification", + "Non-separable subimage coordinate system"}; + +/* Map error returns for lower-level routines. */ +const int wcs_linerr[] = { + WCSERR_SUCCESS, /* 0: LINERR_SUCCESS */ + WCSERR_NULL_POINTER, /* 1: LINERR_NULL_POINTER */ + WCSERR_MEMORY, /* 2: LINERR_MEMORY */ + WCSERR_SINGULAR_MTX, /* 3: LINERR_SINGULAR_MTX */ + WCSERR_BAD_PARAM, /* 4: LINERR_DISTORT_INIT */ + WCSERR_BAD_PIX, /* 5: LINERR_DISTORT */ + WCSERR_BAD_WORLD /* 6: LINERR_DEDISTORT */ +}; + +const int wcs_logerr[] = { + WCSERR_SUCCESS, /* 0: LOGERR_SUCCESS */ + WCSERR_NULL_POINTER, /* 1: LOGERR_NULL_POINTER */ + WCSERR_BAD_PARAM, /* 2: LOGERR_BAD_LOG_REF_VAL */ + WCSERR_BAD_PIX, /* 3: LOGERR_BAD_X */ + WCSERR_BAD_WORLD /* 4: LOGERR_BAD_WORLD */ +}; + +const int wcs_spcerr[] = { + /* -1: SPCERR_NO_CHANGE */ + WCSERR_SUCCESS, /* 0: SPCERR_SUCCESS */ + WCSERR_NULL_POINTER, /* 1: SPCERR_NULL_POINTER */ + WCSERR_BAD_PARAM, /* 2: SPCERR_BAD_SPEC_PARAMS */ + WCSERR_BAD_PIX, /* 3: SPCERR_BAD_X */ + WCSERR_BAD_WORLD /* 4: SPCERR_BAD_SPEC */ +}; + +const int wcs_celerr[] = { + WCSERR_SUCCESS, /* 0: CELERR_SUCCESS */ + WCSERR_NULL_POINTER, /* 1: CELERR_NULL_POINTER */ + WCSERR_BAD_PARAM, /* 2: CELERR_BAD_PARAM */ + WCSERR_BAD_COORD_TRANS, /* 3: CELERR_BAD_COORD_TRANS */ + WCSERR_ILL_COORD_TRANS, /* 4: CELERR_ILL_COORD_TRANS */ + WCSERR_BAD_PIX, /* 5: CELERR_BAD_PIX */ + WCSERR_BAD_WORLD /* 6: CELERR_BAD_WORLD */ +}; + +const int wcs_taberr[] = { + WCSERR_SUCCESS, /* 0: TABERR_SUCCESS */ + WCSERR_NULL_POINTER, /* 1: TABERR_NULL_POINTER */ + WCSERR_MEMORY, /* 2: TABERR_MEMORY */ + WCSERR_BAD_PARAM, /* 3: TABERR_BAD_PARAMS */ + WCSERR_BAD_PIX, /* 4: TABERR_BAD_X */ + WCSERR_BAD_WORLD /* 5: TABERR_BAD_WORLD */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define WCS_ERRMSG(status) WCSERR_SET(status), wcs_errmsg[status] + +#ifndef signbit +#define signbit(X) ((X) < 0.0 ? 1 : 0) +#endif + +/* Internal helper functions, not for general use. */ +static int wcs_types(struct wcsprm *); +static int wcs_units(struct wcsprm *); + +/*--------------------------------------------------------------------------*/ + +int wcsnpv(int npvmax) { if (npvmax >= 0) NPVMAX = npvmax; return NPVMAX; } +int wcsnps(int npsmax) { if (npsmax >= 0) NPSMAX = npsmax; return NPSMAX; } + +/*--------------------------------------------------------------------------*/ + +int wcsini(int alloc, int naxis, struct wcsprm *wcs) + +{ + return wcsinit(alloc, naxis, wcs, -1, -1, -1); +} + +/*--------------------------------------------------------------------------*/ + +int wcsinit( + int alloc, + int naxis, + struct wcsprm *wcs, + int npvmax, + int npsmax, + int ndpmax) + +{ + static const char *function = "wcsinit"; + + int i, j, k, status; + double *cd; + struct wcserr **err; + + /* Check inputs. */ + if (wcs == 0x0) return WCSERR_NULL_POINTER; + + if (npvmax < 0) npvmax = wcsnpv(-1); + if (npsmax < 0) npsmax = wcsnps(-1); + + + /* Initialize error message handling. */ + err = &(wcs->err); + if (wcs->flag != -1) { + if (wcs->err) free(wcs->err); + if (wcs->lin.err) free(wcs->lin.err); + if (wcs->cel.err) free(wcs->cel.err); + if (wcs->spc.err) free(wcs->spc.err); + } + wcs->err = 0x0; + wcs->lin.err = 0x0; + wcs->cel.err = 0x0; + wcs->spc.err = 0x0; + + + /* Initialize pointers. */ + if (wcs->flag == -1 || wcs->m_flag != WCSSET) { + if (wcs->flag == -1) { + wcs->tab = 0x0; + wcs->types = 0x0; + wcs->lin.flag = -1; + } + + /* Initialize memory management. */ + wcs->m_flag = 0; + wcs->m_naxis = 0; + wcs->m_crpix = 0x0; + wcs->m_pc = 0x0; + wcs->m_cdelt = 0x0; + wcs->m_crval = 0x0; + wcs->m_cunit = 0x0; + wcs->m_ctype = 0x0; + wcs->m_pv = 0x0; + wcs->m_ps = 0x0; + wcs->m_cd = 0x0; + wcs->m_crota = 0x0; + wcs->m_colax = 0x0; + wcs->m_cname = 0x0; + wcs->m_crder = 0x0; + wcs->m_csyer = 0x0; + wcs->m_czphs = 0x0; + wcs->m_cperi = 0x0; + wcs->m_tab = 0x0; + wcs->m_wtb = 0x0; + } + + if (naxis < 0) { + return wcserr_set(WCSERR_SET(WCSERR_MEMORY), + "naxis must not be negative (got %d)", naxis); + } + + + /* Allocate memory for arrays if required. */ + if (alloc || + wcs->crpix == 0x0 || + wcs->pc == 0x0 || + wcs->cdelt == 0x0 || + wcs->crval == 0x0 || + wcs->cunit == 0x0 || + wcs->ctype == 0x0 || + (npvmax && wcs->pv == 0x0) || + (npsmax && wcs->ps == 0x0) || + wcs->cd == 0x0 || + wcs->crota == 0x0 || + wcs->colax == 0x0 || + wcs->cname == 0x0 || + wcs->crder == 0x0 || + wcs->csyer == 0x0 || + wcs->czphs == 0x0 || + wcs->cperi == 0x0) { + + /* Was sufficient allocated previously? */ + if (wcs->m_flag == WCSSET && + (wcs->m_naxis < naxis || + wcs->npvmax < npvmax || + wcs->npsmax < npsmax)) { + /* No, free it. */ + wcsfree(wcs); + } + + if (alloc || wcs->crpix == 0x0) { + if (wcs->m_crpix) { + /* In case the caller fiddled with it. */ + wcs->crpix = wcs->m_crpix; + + } else { + if ((wcs->crpix = calloc(naxis, sizeof(double))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_crpix = wcs->crpix; + } + } + + if (alloc || wcs->pc == 0x0) { + if (wcs->m_pc) { + /* In case the caller fiddled with it. */ + wcs->pc = wcs->m_pc; + + } else { + if ((wcs->pc = calloc(naxis*naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_pc = wcs->pc; + } + } + + if (alloc || wcs->cdelt == 0x0) { + if (wcs->m_cdelt) { + /* In case the caller fiddled with it. */ + wcs->cdelt = wcs->m_cdelt; + + } else { + if ((wcs->cdelt = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_cdelt = wcs->cdelt; + } + } + + if (alloc || wcs->crval == 0x0) { + if (wcs->m_crval) { + /* In case the caller fiddled with it. */ + wcs->crval = wcs->m_crval; + + } else { + if ((wcs->crval = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_crval = wcs->crval; + } + } + + if (alloc || wcs->cunit == 0x0) { + if (wcs->m_cunit) { + /* In case the caller fiddled with it. */ + wcs->cunit = wcs->m_cunit; + + } else { + if ((wcs->cunit = calloc(naxis, sizeof(char [72]))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_cunit = wcs->cunit; + } + } + + if (alloc || wcs->ctype == 0x0) { + if (wcs->m_ctype) { + /* In case the caller fiddled with it. */ + wcs->ctype = wcs->m_ctype; + + } else { + if ((wcs->ctype = calloc(naxis, sizeof(char [72]))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_ctype = wcs->ctype; + } + } + + if (alloc || wcs->pv == 0x0) { + if (wcs->m_pv) { + /* In case the caller fiddled with it. */ + wcs->pv = wcs->m_pv; + + } else { + if (npvmax) { + if ((wcs->pv = calloc(npvmax, sizeof(struct pvcard))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + } else { + wcs->pv = 0x0; + } + + wcs->npvmax = npvmax; + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_pv = wcs->pv; + } + } + + if (alloc || wcs->ps == 0x0) { + if (wcs->m_ps) { + /* In case the caller fiddled with it. */ + wcs->ps = wcs->m_ps; + + } else { + if (npsmax) { + if ((wcs->ps = calloc(npsmax, sizeof(struct pscard))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + } else { + wcs->ps = 0x0; + } + + wcs->npsmax = npsmax; + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_ps = wcs->ps; + } + } + + if (alloc || wcs->cd == 0x0) { + if (wcs->m_cd) { + /* In case the caller fiddled with it. */ + wcs->cd = wcs->m_cd; + + } else { + if ((wcs->cd = calloc(naxis*naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_cd = wcs->cd; + } + } + + if (alloc || wcs->crota == 0x0) { + if (wcs->m_crota) { + /* In case the caller fiddled with it. */ + wcs->crota = wcs->m_crota; + + } else { + if ((wcs->crota = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_crota = wcs->crota; + } + } + + if (alloc || wcs->colax == 0x0) { + if (wcs->m_colax) { + /* In case the caller fiddled with it. */ + wcs->colax = wcs->m_colax; + + } else { + if ((wcs->colax = calloc(naxis, sizeof(int))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_colax = wcs->colax; + } + } + + if (alloc || wcs->cname == 0x0) { + if (wcs->m_cname) { + /* In case the caller fiddled with it. */ + wcs->cname = wcs->m_cname; + + } else { + if ((wcs->cname = calloc(naxis, sizeof(char [72]))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_cname = wcs->cname; + } + } + + if (alloc || wcs->crder == 0x0) { + if (wcs->m_crder) { + /* In case the caller fiddled with it. */ + wcs->crder = wcs->m_crder; + + } else { + if ((wcs->crder = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_crder = wcs->crder; + } + } + + if (alloc || wcs->csyer == 0x0) { + if (wcs->m_csyer) { + /* In case the caller fiddled with it. */ + wcs->csyer = wcs->m_csyer; + + } else { + if ((wcs->csyer = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_csyer = wcs->csyer; + } + } + + if (alloc || wcs->czphs == 0x0) { + if (wcs->m_czphs) { + /* In case the caller fiddled with it. */ + wcs->czphs = wcs->m_czphs; + + } else { + if ((wcs->czphs = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_czphs = wcs->czphs; + } + } + + if (alloc || wcs->cperi == 0x0) { + if (wcs->m_cperi) { + /* In case the caller fiddled with it. */ + wcs->cperi = wcs->m_cperi; + + } else { + if ((wcs->cperi = calloc(naxis, sizeof(double))) == 0x0) { + wcsfree(wcs); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + wcs->m_flag = WCSSET; + wcs->m_naxis = naxis; + wcs->m_cperi = wcs->cperi; + } + } + } + + + wcs->flag = 0; + wcs->naxis = naxis; + + + /* Set defaults for the linear transformation. */ + wcs->lin.crpix = wcs->crpix; + wcs->lin.pc = wcs->pc; + wcs->lin.cdelt = wcs->cdelt; + if ((status = lininit(0, naxis, &(wcs->lin), ndpmax))) { + return wcserr_set(WCS_ERRMSG(wcs_linerr[status])); + } + + + /* CRVALia defaults to 0.0. */ + for (i = 0; i < naxis; i++) { + wcs->crval[i] = 0.0; + } + + + /* CUNITia and CTYPEia are blank by default. */ + for (i = 0; i < naxis; i++) { + memset(wcs->cunit[i], 0, 72); + memset(wcs->ctype[i], 0, 72); + } + + + /* Set defaults for the celestial transformation parameters. */ + wcs->lonpole = UNDEFINED; + wcs->latpole = +90.0; + + /* Set defaults for the spectral transformation parameters. */ + wcs->restfrq = 0.0; + wcs->restwav = 0.0; + + /* Default parameter values. */ + wcs->npv = 0; + for (k = 0; k < wcs->npvmax; k++) { + wcs->pv[k].i = 0; + wcs->pv[k].m = 0; + wcs->pv[k].value = 0.0; + } + + wcs->nps = 0; + for (k = 0; k < wcs->npsmax; k++) { + wcs->ps[k].i = 0; + wcs->ps[k].m = 0; + memset(wcs->ps[k].value, 0, 72); + } + + /* Defaults for alternate linear transformations. */ + cd = wcs->cd; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + *(cd++) = 0.0; + } + } + for (i = 0; i < naxis; i++) { + wcs->crota[i] = 0.0; + } + wcs->altlin = 0; + wcs->velref = 0; + + /* Defaults for auxiliary coordinate system information. */ + memset(wcs->alt, 0, 4); + wcs->alt[0] = ' '; + wcs->colnum = 0; + + for (i = 0; i < naxis; i++) { + wcs->colax[i] = 0; + memset(wcs->cname[i], 0, 72); + wcs->crder[i] = UNDEFINED; + wcs->csyer[i] = UNDEFINED; + wcs->czphs[i] = UNDEFINED; + wcs->cperi[i] = UNDEFINED; + } + + memset(wcs->wcsname, 0, 72); + + memset(wcs->timesys, 0, 72); + memset(wcs->trefpos, 0, 72); + memset(wcs->trefdir, 0, 72); + memset(wcs->plephem, 0, 72); + + memset(wcs->timeunit, 0, 72); + memset(wcs->dateref, 0, 72); + wcs->mjdref[0] = UNDEFINED; + wcs->mjdref[1] = UNDEFINED; + wcs->timeoffs = UNDEFINED; + + memset(wcs->dateobs, 0, 72); + memset(wcs->datebeg, 0, 72); + memset(wcs->dateavg, 0, 72); + memset(wcs->dateend, 0, 72); + wcs->mjdobs = UNDEFINED; + wcs->mjdbeg = UNDEFINED; + wcs->mjdavg = UNDEFINED; + wcs->mjdend = UNDEFINED; + wcs->jepoch = UNDEFINED; + wcs->bepoch = UNDEFINED; + wcs->tstart = UNDEFINED; + wcs->tstop = UNDEFINED; + wcs->xposure = UNDEFINED; + wcs->telapse = UNDEFINED; + + wcs->timsyer = UNDEFINED; + wcs->timrder = UNDEFINED; + wcs->timedel = UNDEFINED; + wcs->timepixr = UNDEFINED; + + wcs->obsgeo[0] = UNDEFINED; + wcs->obsgeo[1] = UNDEFINED; + wcs->obsgeo[2] = UNDEFINED; + wcs->obsgeo[3] = UNDEFINED; + wcs->obsgeo[4] = UNDEFINED; + wcs->obsgeo[5] = UNDEFINED; + memset(wcs->obsorbit, 0, 72); + memset(wcs->radesys, 0, 72); + wcs->equinox = UNDEFINED; + memset(wcs->specsys, 0, 72); + memset(wcs->ssysobs, 0, 72); + wcs->velosys = UNDEFINED; + wcs->zsource = UNDEFINED; + memset(wcs->ssyssrc, 0, 72); + wcs->velangl = UNDEFINED; + + wcs->ntab = 0; + wcs->tab = 0x0; + wcs->nwtb = 0; + wcs->wtb = 0x0; + + /* Reset derived values. */ + strcpy(wcs->lngtyp, " "); + strcpy(wcs->lattyp, " "); + wcs->lng = -1; + wcs->lat = -1; + wcs->spec = -1; + wcs->cubeface = -1; + + celini(&(wcs->cel)); + spcini(&(wcs->spc)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcssub( + int alloc, + const struct wcsprm *wcssrc, + int *nsub, + int axes[], + struct wcsprm *wcsdst) + +{ + static const char *function = "wcssub"; + + const char *pq = "PQ"; + char *c, ctypei[16], ctmp[16], *fp; + int axis, axmap[10], cubeface, dealloc, dummy, i, idp, itab, *itmp = 0x0, + j, jhat, k, latitude, longitude, m, *map, msub, naxis, ndp, ndpmax, + Nhat, npv, npvmax, nps, npsmax, ntmp, other, spectral, status, stokes; + const double *srcp; + double *dstp; + struct tabprm *tab; + struct disprm *dissrc, *disdst; + struct dpkey *dpsrc, *dpdst; + struct wcserr **err; + + if (wcssrc == 0x0) return WCSERR_NULL_POINTER; + if (wcsdst == 0x0) return WCSERR_NULL_POINTER; + err = &(wcsdst->err); + + /* N.B. we do not rely on the wcsprm struct having been set up. */ + if ((naxis = wcssrc->naxis) <= 0) { + return wcserr_set(WCSERR_SET(WCSERR_MEMORY), + "naxis must be positive (got %d)", naxis); + } + + if (nsub == 0x0) { + nsub = &dummy; + *nsub = naxis; + } else if (*nsub == 0) { + *nsub = naxis; + } + + /* Allocate enough temporary storage to hold either axes[] xor map[].*/ + ntmp = (*nsub <= naxis) ? naxis : *nsub; + if ((itmp = calloc(ntmp, sizeof(int))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + if ((dealloc = (axes == 0x0))) { + /* Construct an index array. */ + if ((axes = calloc(naxis, sizeof(int))) == 0x0) { + free(itmp); + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + for (i = 0; i < naxis; i++) { + axes[i] = i+1; + } + } + + /* So that we don't try to free an uninitialized pointer on cleanup. */ + wcsdst->m_tab = 0x0; + + + msub = 0; + for (j = 0; j < *nsub; j++) { + axis = axes[j]; + + if (abs(axis) > 0x1000) { + /* Subimage extraction by type. */ + k = abs(axis) & 0xFF; + + longitude = k & WCSSUB_LONGITUDE; + latitude = k & WCSSUB_LATITUDE; + cubeface = k & WCSSUB_CUBEFACE; + spectral = k & WCSSUB_SPECTRAL; + stokes = k & WCSSUB_STOKES; + + if ((other = (axis < 0))) { + longitude = !longitude; + latitude = !latitude; + cubeface = !cubeface; + spectral = !spectral; + stokes = !stokes; + } + + for (i = 0; i < naxis; i++) { + strncpy (ctypei, (char *)(wcssrc->ctype + i), 8); + ctypei[8] = '\0'; + + /* Find the last non-blank character. */ + c = ctypei + 8; + while (c-- > ctypei) { + if (*c == ' ') *c = '\0'; + if (*c != '\0') break; + } + + if ( + strcmp(ctypei, "RA") == 0 || + strcmp(ctypei+1, "LON") == 0 || + strcmp(ctypei+2, "LN") == 0 || + strncmp(ctypei, "RA---", 5) == 0 || + strncmp(ctypei+1, "LON-", 4) == 0 || + strncmp(ctypei+2, "LN-", 3) == 0) { + if (!longitude) { + continue; + } + + } else if ( + strcmp(ctypei, "DEC") == 0 || + strcmp(ctypei+1, "LAT") == 0 || + strcmp(ctypei+2, "LT") == 0 || + strncmp(ctypei, "DEC--", 5) == 0 || + strncmp(ctypei+1, "LAT-", 4) == 0 || + strncmp(ctypei+2, "LT-", 3) == 0) { + if (!latitude) { + continue; + } + + } else if (strcmp(ctypei, "CUBEFACE") == 0) { + if (!cubeface) { + continue; + } + + } else if (( + strncmp(ctypei, "FREQ", 4) == 0 || + strncmp(ctypei, "ENER", 4) == 0 || + strncmp(ctypei, "WAVN", 4) == 0 || + strncmp(ctypei, "VRAD", 4) == 0 || + strncmp(ctypei, "WAVE", 4) == 0 || + strncmp(ctypei, "VOPT", 4) == 0 || + strncmp(ctypei, "ZOPT", 4) == 0 || + strncmp(ctypei, "AWAV", 4) == 0 || + strncmp(ctypei, "VELO", 4) == 0 || + strncmp(ctypei, "BETA", 4) == 0) && + (ctypei[4] == '\0' || ctypei[4] == '-')) { + if (!spectral) { + continue; + } + + } else if (strcmp(ctypei, "STOKES") == 0) { + if (!stokes) { + continue; + } + + } else if (!other) { + continue; + } + + /* This axis is wanted, but has it already been added? */ + for (k = 0; k < msub; k++) { + if (itmp[k] == i+1) { + break; + } + } + if (k == msub) itmp[msub++] = i+1; + } + + } else if (0 < axis && axis <= naxis) { + /* Check that the requested axis has not already been added. */ + for (k = 0; k < msub; k++) { + if (itmp[k] == axis) { + break; + } + } + if (k == msub) itmp[msub++] = axis; + + } else if (axis == 0) { + /* Graft on a new axis. */ + itmp[msub++] = 0; + + } else { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_SUBIMAGE)); + goto cleanup; + } + } + + if ((*nsub = msub) == 0) { + /* Zero out this struct. */ + status = wcsinit(alloc, 0, wcsdst, 0, 0, 0); + goto cleanup; + } + + for (i = 0; i < *nsub; i++) { + axes[i] = itmp[i]; + } + + + /* Construct the inverse axis map (i is 0-relative, j is 1-relative): + axes[i] == j means that output axis i+1 comes from input axis j, + axes[i] == 0 means to create a new axis, + map[i] == j means that input axis i+1 goes to output axis j, + map[i] == 0 means that input axis i+1 is not used. */ + map = itmp; + for (i = 0; i < naxis; i++) { + map[i] = 0; + } + + for (i = 0; i < *nsub; i++) { + if (axes[i] > 0) { + map[axes[i]-1] = i+1; + } + } + + + /* Check that the subimage coordinate system is separable. First check */ + /* non-zero, off-diagonal elements of the linear transformation matrix. */ + srcp = wcssrc->pc; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + if (*(srcp++) == 0.0 || j == i) continue; + + if ((map[i] == 0) != (map[j] == 0)) { + status = wcserr_set(WCS_ERRMSG(WCSERR_NON_SEPARABLE)); + goto cleanup; + } + } + } + + /* Now check for distortions that depend on other axes. As the disprm */ + /* struct may not have been initialized, we must parse the dpkey entries. */ + ndpmax = 0; + for (m = 0; m < 2; m++) { + if (m == 0) { + dissrc = wcssrc->lin.dispre; + } else { + dissrc = wcssrc->lin.disseq; + } + + ndp = 0; + if (dissrc != 0x0) { + for (j = 0; j < naxis; j++) { + if (map[j] == 0) continue; + + /* Axis numbers in axmap[] are 0-relative. */ + for (jhat = 0; jhat < 10; jhat++) { + axmap[jhat] = -1; + } + + Nhat = 0; + dpsrc = dissrc->dp; + for (idp = 0; idp < dissrc->ndp; idp++, dpsrc++) { + /* Thorough error checking will be done later by disset(). */ + if (dpsrc->j != j+1) continue; + if (dpsrc->field[1] != pq[m]) continue; + if ((fp = strchr(dpsrc->field, '.')) == 0x0) continue; + fp++; + + ndp++; + + if (strncmp(fp, "NAXES", 6) == 0) { + Nhat = dpkeyi(dpsrc); + } else if (strncmp(fp, "AXIS.", 5) == 0) { + sscanf(fp+5, "%d", &jhat); + axmap[jhat-1] = dpkeyi(dpsrc) - 1; + } + } + + if (Nhat < 0 || (Nhat == 0 && 1 < ndp) || naxis < Nhat || 10 < Nhat) { + status = wcserr_set(WCSERR_SET(WCSERR_BAD_PARAM), + "NAXES was not set (or bad) for %s distortion on axis %d", + dissrc->dtype[j], j+1); + goto cleanup; + } + + for (jhat = 0; jhat < Nhat; jhat++) { + if (axmap[jhat] < 0) { + axmap[jhat] = jhat; + + /* Make room for an additional DPja.AXIS.j record. */ + ndp++; + } + + if (map[axmap[jhat]] == 0) { + /* Distortion depends on an axis excluded from the subimage. */ + status = wcserr_set(WCS_ERRMSG(WCSERR_NON_SEPARABLE)); + goto cleanup; + } + } + } + } + + if (ndpmax < ndp) ndpmax = ndp; + } + + + /* Number of PVi_ma records in the subimage. */ + npvmax = 0; + for (m = 0; m < wcssrc->npv; m++) { + i = wcssrc->pv[m].i; + if (i == 0 || (i > 0 && map[i-1])) { + npvmax++; + } + } + + /* Number of PSi_ma records in the subimage. */ + npsmax = 0; + for (m = 0; m < wcssrc->nps; m++) { + i = wcssrc->ps[m].i; + if (i > 0 && map[i-1]) { + npsmax++; + } + } + + /* Initialize the destination. */ + status = wcsinit(alloc, *nsub, wcsdst, npvmax, npsmax, ndpmax); + + for (m = 0; m < 2; m++) { + if (m == 0) { + dissrc = wcssrc->lin.dispre; + disdst = wcsdst->lin.dispre; + } else { + dissrc = wcssrc->lin.disseq; + disdst = wcsdst->lin.disseq; + } + + if (dissrc && !disdst) { + if ((disdst = calloc(1, sizeof(struct disprm))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + /* Also inits disdst. */ + disdst->flag = -1; + lindist(m+1, &(wcsdst->lin), disdst, ndpmax); + } + } + + if (status) { + goto cleanup; + } + + + /* Linear transformation. */ + srcp = wcssrc->crpix; + dstp = wcsdst->crpix; + for (j = 0; j < *nsub; j++, dstp++) { + if (axes[j] > 0) { + k = axes[j] - 1; + *dstp = *(srcp+k); + } + } + + srcp = wcssrc->pc; + dstp = wcsdst->pc; + for (i = 0; i < *nsub; i++) { + for (j = 0; j < *nsub; j++, dstp++) { + if (axes[i] > 0 && axes[j] > 0) { + k = (axes[i]-1)*naxis + (axes[j]-1); + *dstp = *(srcp+k); + } + } + } + + srcp = wcssrc->cdelt; + dstp = wcsdst->cdelt; + for (i = 0; i < *nsub; i++, dstp++) { + if (axes[i] > 0) { + k = axes[i] - 1; + *dstp = *(srcp+k); + } + } + + /* Coordinate reference value. */ + srcp = wcssrc->crval; + dstp = wcsdst->crval; + for (i = 0; i < *nsub; i++, dstp++) { + if (axes[i] > 0) { + k = axes[i] - 1; + *dstp = *(srcp+k); + } + } + + /* Coordinate units and type. */ + for (i = 0; i < *nsub; i++) { + if (axes[i] > 0) { + k = axes[i] - 1; + strncpy(wcsdst->cunit[i], wcssrc->cunit[k], 72); + strncpy(wcsdst->ctype[i], wcssrc->ctype[k], 72); + } + } + + /* Celestial and spectral transformation parameters. */ + wcsdst->lonpole = wcssrc->lonpole; + wcsdst->latpole = wcssrc->latpole; + wcsdst->restfrq = wcssrc->restfrq; + wcsdst->restwav = wcssrc->restwav; + + /* Parameter values. */ + npv = 0; + for (m = 0; m < wcssrc->npv; m++) { + i = wcssrc->pv[m].i; + if (i == 0) { + /* i == 0 is a special code that means "the latitude axis". */ + wcsdst->pv[npv] = wcssrc->pv[m]; + wcsdst->pv[npv].i = 0; + npv++; + } else if (i > 0 && map[i-1]) { + wcsdst->pv[npv] = wcssrc->pv[m]; + wcsdst->pv[npv].i = map[i-1]; + npv++; + } + } + wcsdst->npv = npv; + + nps = 0; + for (m = 0; m < wcssrc->nps; m++) { + i = wcssrc->ps[m].i; + if (i > 0 && map[i-1]) { + wcsdst->ps[nps] = wcssrc->ps[m]; + wcsdst->ps[nps].i = map[i-1]; + nps++; + } + } + wcsdst->nps = nps; + + /* Alternate linear transformations. */ + srcp = wcssrc->cd; + dstp = wcsdst->cd; + for (i = 0; i < *nsub; i++) { + for (j = 0; j < *nsub; j++, dstp++) { + if (axes[i] > 0 && axes[j] > 0) { + k = (axes[i]-1)*naxis + (axes[j]-1); + *dstp = *(srcp+k); + } else if (i == j && wcssrc->altlin & 2) { + /* A new axis is being created where CDi_ja was present in the input + header, so override the default value of 0 set by wcsinit(). */ + *dstp = 1.0; + } + } + } + + srcp = wcssrc->crota; + dstp = wcsdst->crota; + for (i = 0; i < *nsub; i++, dstp++) { + if (axes[i] > 0) { + k = axes[i] - 1; + *dstp = *(srcp+k); + } + } + + wcsdst->altlin = wcssrc->altlin; + wcsdst->velref = wcssrc->velref; + + /* Auxiliary coordinate system information. */ + strncpy(wcsdst->alt, wcssrc->alt, 4); + wcsdst->colnum = wcssrc->colnum; + + for (i = 0; i < *nsub; i++) { + if (axes[i] > 0) { + k = axes[i] - 1; + wcsdst->colax[i] = wcssrc->colax[k]; + strncpy(wcsdst->cname[i], wcssrc->cname[k], 72); + wcsdst->crder[i] = wcssrc->crder[k]; + wcsdst->csyer[i] = wcssrc->csyer[k]; + wcsdst->czphs[i] = wcssrc->czphs[k]; + wcsdst->cperi[i] = wcssrc->cperi[k]; + } + } + + strncpy(wcsdst->wcsname, wcssrc->wcsname, 72); + + strncpy(wcsdst->timesys, wcssrc->timesys, 72); + strncpy(wcsdst->trefpos, wcssrc->trefpos, 72); + strncpy(wcsdst->trefdir, wcssrc->trefdir, 72); + strncpy(wcsdst->plephem, wcssrc->plephem, 72); + + strncpy(wcsdst->timeunit, wcssrc->timeunit, 72); + strncpy(wcsdst->dateref, wcssrc->dateref, 72); + wcsdst->mjdref[0] = wcssrc->mjdref[0]; + wcsdst->mjdref[1] = wcssrc->mjdref[1]; + wcsdst->timeoffs = wcssrc->timeoffs; + + strncpy(wcsdst->dateobs, wcssrc->dateobs, 72); + strncpy(wcsdst->datebeg, wcssrc->datebeg, 72); + strncpy(wcsdst->dateavg, wcssrc->dateavg, 72); + strncpy(wcsdst->dateend, wcssrc->dateend, 72); + + wcsdst->mjdobs = wcssrc->mjdobs; + wcsdst->mjdbeg = wcssrc->mjdbeg; + wcsdst->mjdavg = wcssrc->mjdavg; + wcsdst->mjdend = wcssrc->mjdend; + wcsdst->jepoch = wcssrc->jepoch; + wcsdst->bepoch = wcssrc->bepoch; + wcsdst->tstart = wcssrc->tstart; + wcsdst->tstop = wcssrc->tstop; + wcsdst->xposure = wcssrc->xposure; + wcsdst->telapse = wcssrc->telapse; + + wcsdst->timsyer = wcssrc->timsyer; + wcsdst->timrder = wcssrc->timrder; + wcsdst->timedel = wcssrc->timedel; + wcsdst->timepixr = wcssrc->timepixr; + + wcsdst->obsgeo[0] = wcssrc->obsgeo[0]; + wcsdst->obsgeo[1] = wcssrc->obsgeo[1]; + wcsdst->obsgeo[2] = wcssrc->obsgeo[2]; + wcsdst->obsgeo[3] = wcssrc->obsgeo[3]; + wcsdst->obsgeo[4] = wcssrc->obsgeo[4]; + wcsdst->obsgeo[5] = wcssrc->obsgeo[5]; + + strncpy(wcsdst->obsorbit, wcssrc->obsorbit, 72); + strncpy(wcsdst->radesys, wcssrc->radesys, 72); + wcsdst->equinox = wcssrc->equinox; + strncpy(wcsdst->specsys, wcssrc->specsys, 72); + strncpy(wcsdst->ssysobs, wcssrc->ssysobs, 72); + wcsdst->velosys = wcssrc->velosys; + wcsdst->zsource = wcssrc->zsource; + strncpy(wcsdst->ssyssrc, wcssrc->ssyssrc, 72); + wcsdst->velangl = wcssrc->velangl; + + + /* Distortion parameters. */ + for (m = 0; m < 2; m++) { + if (m == 0) { + dissrc = wcssrc->lin.dispre; + disdst = wcsdst->lin.dispre; + } else { + dissrc = wcssrc->lin.disseq; + disdst = wcsdst->lin.disseq; + } + + if (dissrc) { + disdst->naxis = *nsub; + + /* Distortion type and maximum distortion (but not total distortion). */ + for (j = 0; j < *nsub; j++) { + if (axes[j] > 0) { + k = axes[j] - 1; + strncpy(disdst->dtype[j], dissrc->dtype[k], 72); + disdst->maxdis[j] = dissrc->maxdis[k]; + } + } + + /* DPja or DQia keyvalues. */ + ndp = 0; + dpdst = disdst->dp; + for (j = 0; j < *nsub; j++) { + if (axes[j] == 0) continue; + + /* Determine the axis mapping. */ + for (jhat = 0; jhat < 10; jhat++) { + axmap[jhat] = -1; + } + + Nhat = 0; + dpsrc = dissrc->dp; + for (idp = 0; idp < dissrc->ndp; idp++, dpsrc++) { + if (dpsrc->j != axes[j]) continue; + if (dpsrc->field[1] != pq[m]) continue; + if ((fp = strchr(dpsrc->field, '.')) == 0x0) continue; + fp++; + + if (strncmp(fp, "NAXES", 6) == 0) { + Nhat = dpkeyi(dpsrc); + } else if (strncmp(fp, "AXIS.", 5) == 0) { + sscanf(fp+5, "%d", &jhat); + axmap[jhat-1] = dpkeyi(dpsrc) - 1; + } + } + + for (jhat = 0; jhat < Nhat; jhat++) { + if (axmap[jhat] < 0) { + axmap[jhat] = jhat; + } + } + + /* Copy the DPja or DQia keyvalues. */ + dpsrc = dissrc->dp; + for (idp = 0; idp < dissrc->ndp; idp++, dpsrc++) { + if (dpsrc->j != axes[j]) continue; + if (dpsrc->field[1] != pq[m]) continue; + if ((fp = strchr(dpsrc->field, '.')) == 0x0) continue; + fp++; + + if (strncmp(fp, "AXIS.", 5) == 0) { + /* Skip it, we will create our own later. */ + continue; + } + + *dpdst = *dpsrc; + sprintf(ctmp, "%d", j+1); + dpdst->field[2] = ctmp[0]; + dpdst->j = j+1; + + ndp++; + dpdst++; + + if (strncmp(fp, "NAXES", 6) == 0) { + for (jhat = 0; jhat < Nhat; jhat++) { + strcpy(dpdst->field, dpsrc->field); + dpdst->field[2] = ctmp[0]; + fp = strchr(dpdst->field, '.') + 1; + sprintf(fp, "AXIS.%d", jhat+1); + dpdst->j = j+1; + dpdst->type = 0; + dpdst->value.i = map[axmap[jhat]]; + + ndp++; + dpdst++; + } + } + } + } + + disdst->ndp = ndp; + } + } + + + /* Coordinate lookup tables; only copy what's needed. */ + wcsdst->ntab = 0; + for (itab = 0; itab < wcssrc->ntab; itab++) { + /* Is this table wanted? */ + for (m = 0; m < wcssrc->tab[itab].M; m++) { + i = wcssrc->tab[itab].map[m]; + + if (map[i-1]) { + wcsdst->ntab++; + break; + } + } + } + + if (wcsdst->ntab) { + /* Allocate memory for tabprm structs. */ + if ((wcsdst->tab = calloc(wcsdst->ntab, sizeof(struct tabprm))) == 0x0) { + wcsdst->ntab = 0; + + status = wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + goto cleanup; + } + + wcsdst->m_tab = wcsdst->tab; + } + + tab = wcsdst->tab; + for (itab = 0; itab < wcssrc->ntab; itab++) { + for (m = 0; m < wcssrc->tab[itab].M; m++) { + i = wcssrc->tab[itab].map[m]; + + if (map[i-1]) { + if ((status = tabcpy(1, wcssrc->tab + itab, tab))) { + wcserr_set(WCS_ERRMSG(wcs_taberr[status])); + goto cleanup; + } + + tab++; + break; + } + } + } + + +cleanup: + if (itmp) free(itmp); + if (dealloc) { + free(axes); + } + + if (status && wcsdst->m_tab) { + free(wcsdst->m_tab); + wcsdst->tab = 0x0; + wcsdst->m_tab = 0x0; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcscompare( + int cmp, + double tol, + const struct wcsprm *wcs1, + const struct wcsprm *wcs2, + int *equal) + +{ + int i, j, naxis, naxis2; + double diff; + int tab_equal; + int status; + + if (wcs1 == 0x0) return WCSERR_NULL_POINTER; + if (wcs2 == 0x0) return WCSERR_NULL_POINTER; + if (equal == 0x0) return WCSERR_NULL_POINTER; + + *equal = 0; + + if (wcs1->naxis != wcs2->naxis) { + return 0; + } + + naxis = wcs1->naxis; + naxis2 = wcs1->naxis*wcs1->naxis; + + if (cmp & WCSCOMPARE_CRPIX) { + /* Don't compare crpix. */ + } else if (cmp & WCSCOMPARE_TILING) { + for (i = 0; i < naxis; ++i) { + diff = wcs1->crpix[i] - wcs2->crpix[i]; + if ((double)(int)(diff) != diff) { + return 0; + } + } + } else { + if (!wcsutil_Eq(naxis, tol, wcs1->crpix, wcs2->crpix)) { + return 0; + } + } + + if (!wcsutil_Eq(naxis2, tol, wcs1->pc, wcs2->pc) || + !wcsutil_Eq(naxis, tol, wcs1->cdelt, wcs2->cdelt) || + !wcsutil_Eq(naxis, tol, wcs1->crval, wcs2->crval) || + !wcsutil_strEq(naxis, wcs1->cunit, wcs2->cunit) || + !wcsutil_strEq(naxis, wcs1->ctype, wcs2->ctype) || + !wcsutil_Eq(1, tol, &wcs1->lonpole, &wcs2->lonpole) || + !wcsutil_Eq(1, tol, &wcs1->latpole, &wcs2->latpole) || + !wcsutil_Eq(1, tol, &wcs1->restfrq, &wcs2->restfrq) || + !wcsutil_Eq(1, tol, &wcs1->restwav, &wcs2->restwav) || + wcs1->npv != wcs2->npv || + wcs1->nps != wcs2->nps) { + return 0; + } + + /* Compare pv cards, which may not be in the same order */ + for (i = 0; i < wcs1->npv; ++i) { + for (j = 0; j < wcs2->npv; ++j) { + if (wcs1->pv[i].i == wcs2->pv[j].i && + wcs1->pv[i].m == wcs2->pv[j].m) { + if (!wcsutil_Eq(1, tol, &wcs1->pv[i].value, &wcs2->pv[j].value)) { + return 0; + } + break; + } + } + /* We didn't find a match, so they are not equal */ + if (j == wcs2->npv) { + return 0; + } + } + + /* Compare ps cards, which may not be in the same order */ + for (i = 0; i < wcs1->nps; ++i) { + for (j = 0; j < wcs2->nps; ++j) { + if (wcs1->ps[i].i == wcs2->ps[j].i && + wcs1->ps[i].m == wcs2->ps[j].m) { + if (strncmp(wcs1->ps[i].value, wcs2->ps[j].value, 72)) { + return 0; + } + break; + } + } + /* We didn't find a match, so they are not equal */ + if (j == wcs2->nps) { + return 0; + } + } + + if (wcs1->flag != WCSSET || wcs2->flag != WCSSET) { + if (!wcsutil_Eq(naxis2, tol, wcs1->cd, wcs2->cd) || + !wcsutil_Eq(naxis, tol, wcs1->crota, wcs2->crota) || + wcs1->altlin != wcs2->altlin || + wcs1->velref != wcs2->velref) { + return 0; + } + } + + if (!(cmp & WCSCOMPARE_ANCILLARY)) { + if (strncmp(wcs1->alt, wcs2->alt, 4) || + wcs1->colnum != wcs2->colnum || + !wcsutil_intEq(naxis, wcs1->colax, wcs2->colax) || + !wcsutil_strEq(naxis, wcs1->cname, wcs2->cname) || + !wcsutil_Eq(naxis, tol, wcs1->crder, wcs2->crder) || + !wcsutil_Eq(naxis, tol, wcs1->csyer, wcs2->csyer) || + !wcsutil_Eq(naxis, tol, wcs1->czphs, wcs2->czphs) || + !wcsutil_Eq(naxis, tol, wcs1->cperi, wcs2->cperi) || + strncmp(wcs1->wcsname, wcs2->wcsname, 72) || + strncmp(wcs1->timesys, wcs2->timesys, 72) || + strncmp(wcs1->trefpos, wcs2->trefpos, 72) || + strncmp(wcs1->trefdir, wcs2->trefdir, 72) || + strncmp(wcs1->plephem, wcs2->plephem, 72) || + strncmp(wcs1->timeunit, wcs2->timeunit, 72) || + strncmp(wcs1->dateref, wcs2->dateref, 72) || + !wcsutil_Eq(2, tol, wcs1->mjdref, wcs2->mjdref) || + !wcsutil_Eq(1, tol, &wcs1->timeoffs, &wcs2->timeoffs) || + strncmp(wcs1->dateobs, wcs2->dateobs, 72) || + strncmp(wcs1->datebeg, wcs2->datebeg, 72) || + strncmp(wcs1->dateavg, wcs2->dateavg, 72) || + strncmp(wcs1->dateend, wcs2->dateend, 72) || + !wcsutil_Eq(1, tol, &wcs1->mjdobs, &wcs2->mjdobs) || + !wcsutil_Eq(1, tol, &wcs1->mjdbeg, &wcs2->mjdbeg) || + !wcsutil_Eq(1, tol, &wcs1->mjdavg, &wcs2->mjdavg) || + !wcsutil_Eq(1, tol, &wcs1->mjdend, &wcs2->mjdend) || + !wcsutil_Eq(1, tol, &wcs1->jepoch, &wcs2->jepoch) || + !wcsutil_Eq(1, tol, &wcs1->bepoch, &wcs2->bepoch) || + !wcsutil_Eq(1, tol, &wcs1->tstart, &wcs2->tstart) || + !wcsutil_Eq(1, tol, &wcs1->tstop, &wcs2->tstop) || + !wcsutil_Eq(1, tol, &wcs1->xposure, &wcs2->xposure) || + !wcsutil_Eq(1, tol, &wcs1->telapse, &wcs2->telapse) || + !wcsutil_Eq(1, tol, &wcs1->timsyer, &wcs2->timsyer) || + !wcsutil_Eq(1, tol, &wcs1->timrder, &wcs2->timrder) || + !wcsutil_Eq(1, tol, &wcs1->timedel, &wcs2->timedel) || + !wcsutil_Eq(1, tol, &wcs1->timepixr, &wcs2->timepixr) || + !wcsutil_Eq(6, tol, wcs1->obsgeo, wcs2->obsgeo) || + strncmp(wcs1->obsorbit, wcs2->obsorbit, 72) || + strncmp(wcs1->radesys, wcs2->radesys, 72) || + !wcsutil_Eq(1, tol, &wcs1->equinox, &wcs2->equinox) || + strncmp(wcs1->specsys, wcs2->specsys, 72) || + strncmp(wcs1->ssysobs, wcs2->ssysobs, 72) || + !wcsutil_Eq(1, tol, &wcs1->velosys, &wcs2->velosys) || + !wcsutil_Eq(1, tol, &wcs1->zsource, &wcs2->zsource) || + strncmp(wcs1->ssyssrc, wcs2->ssyssrc, 72) || + !wcsutil_Eq(1, tol, &wcs1->velangl, &wcs2->velangl)) { + return 0; + } + } + + /* Compare tabular parameters */ + if (wcs1->ntab != wcs2->ntab) { + return 0; + } + + for (i = 0; i < wcs1->ntab; ++i) { + if ((status = tabcmp(0, tol, &wcs1->tab[i], &wcs2->tab[i], &tab_equal))) { + return status; + } + if (!tab_equal) { + return 0; + } + } + + *equal = 1; + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsfree(struct wcsprm *wcs) + +{ + int j; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + + if (wcs->flag == -1) { + wcs->lin.flag = -1; + + } else { + /* Optionally allocated by wcsinit() for given parameters. */ + if (wcs->m_flag == WCSSET) { + if (wcs->crpix == wcs->m_crpix) wcs->crpix = 0x0; + if (wcs->pc == wcs->m_pc) wcs->pc = 0x0; + if (wcs->cdelt == wcs->m_cdelt) wcs->cdelt = 0x0; + if (wcs->crval == wcs->m_crval) wcs->crval = 0x0; + if (wcs->cunit == wcs->m_cunit) wcs->cunit = 0x0; + if (wcs->ctype == wcs->m_ctype) wcs->ctype = 0x0; + if (wcs->pv == wcs->m_pv) wcs->pv = 0x0; + if (wcs->ps == wcs->m_ps) wcs->ps = 0x0; + if (wcs->cd == wcs->m_cd) wcs->cd = 0x0; + if (wcs->crota == wcs->m_crota) wcs->crota = 0x0; + if (wcs->colax == wcs->m_colax) wcs->colax = 0x0; + if (wcs->cname == wcs->m_cname) wcs->cname = 0x0; + if (wcs->crder == wcs->m_crder) wcs->crder = 0x0; + if (wcs->csyer == wcs->m_csyer) wcs->csyer = 0x0; + if (wcs->czphs == wcs->m_czphs) wcs->czphs = 0x0; + if (wcs->cperi == wcs->m_cperi) wcs->cperi = 0x0; + if (wcs->tab == wcs->m_tab) wcs->tab = 0x0; + if (wcs->wtb == wcs->m_wtb) wcs->wtb = 0x0; + + if (wcs->m_crpix) free(wcs->m_crpix); + if (wcs->m_pc) free(wcs->m_pc); + if (wcs->m_cdelt) free(wcs->m_cdelt); + if (wcs->m_crval) free(wcs->m_crval); + if (wcs->m_cunit) free(wcs->m_cunit); + if (wcs->m_ctype) free(wcs->m_ctype); + if (wcs->m_pv) free(wcs->m_pv); + if (wcs->m_ps) free(wcs->m_ps); + if (wcs->m_cd) free(wcs->m_cd); + if (wcs->m_crota) free(wcs->m_crota); + if (wcs->m_colax) free(wcs->m_colax); + if (wcs->m_cname) free(wcs->m_cname); + if (wcs->m_crder) free(wcs->m_crder); + if (wcs->m_csyer) free(wcs->m_csyer); + if (wcs->m_czphs) free(wcs->m_czphs); + if (wcs->m_cperi) free(wcs->m_cperi); + + /* Allocated unconditionally by wcstab(). */ + if (wcs->m_tab) { + for (j = 0; j < wcs->ntab; j++) { + tabfree(wcs->m_tab + j); + } + + free(wcs->m_tab); + } + if (wcs->m_wtb) free(wcs->m_wtb); + } + + if (wcs->err) free(wcs->err); + + /* Allocated unconditionally by wcsset(). */ + if (wcs->types) free(wcs->types); + + if (wcs->lin.crpix == wcs->m_crpix) wcs->lin.crpix = 0x0; + if (wcs->lin.pc == wcs->m_pc) wcs->lin.pc = 0x0; + if (wcs->lin.cdelt == wcs->m_cdelt) wcs->lin.cdelt = 0x0; + } + + wcs->m_flag = 0; + wcs->m_naxis = 0x0; + wcs->m_crpix = 0x0; + wcs->m_pc = 0x0; + wcs->m_cdelt = 0x0; + wcs->m_crval = 0x0; + wcs->m_cunit = 0x0; + wcs->m_ctype = 0x0; + wcs->m_pv = 0x0; + wcs->m_ps = 0x0; + wcs->m_cd = 0x0; + wcs->m_crota = 0x0; + wcs->m_colax = 0x0; + wcs->m_cname = 0x0; + wcs->m_crder = 0x0; + wcs->m_csyer = 0x0; + wcs->m_czphs = 0x0; + wcs->m_cperi = 0x0; + + wcs->ntab = 0; + wcs->m_tab = 0x0; + wcs->nwtb = 0; + wcs->m_wtb = 0x0; + + wcs->types = 0x0; + + wcs->err = 0x0; + + wcs->flag = 0; + + linfree(&(wcs->lin)); + celfree(&(wcs->cel)); + spcfree(&(wcs->spc)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +static void wcsprt_auxc(const char *name, const char *value) +{ + if (value[0] == '\0') { + wcsprintf(" %s: UNDEFINED\n", name); + } else { + wcsprintf(" %s: \"%s\"\n", name, value); + } +} + +static void wcsprt_auxd(const char *name, double value) +{ + if (undefined(value)) { + wcsprintf(" %s: UNDEFINED\n", name); + } else { + wcsprintf(" %s: %15.9f\n", name, value); + } +} + +int wcsprt(const struct wcsprm *wcs) + +{ + int i, j, k; + struct wtbarr *wtbp; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + + if (wcs->flag != WCSSET) { + wcsprintf("The wcsprm struct is UNINITIALIZED.\n"); + return 0; + } + + wcsprintf(" flag: %d\n", wcs->flag); + wcsprintf(" naxis: %d\n", wcs->naxis); + WCSPRINTF_PTR(" crpix: ", wcs->crpix, "\n"); + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" %#- 11.5g", wcs->crpix[i]); + } + wcsprintf("\n"); + + /* Linear transformation. */ + k = 0; + WCSPRINTF_PTR(" pc: ", wcs->pc, "\n"); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" pc[%d][]:", i); + for (j = 0; j < wcs->naxis; j++) { + wcsprintf(" %#- 11.5g", wcs->pc[k++]); + } + wcsprintf("\n"); + } + + /* Coordinate increment at reference point. */ + WCSPRINTF_PTR(" cdelt: ", wcs->cdelt, "\n"); + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" %#- 11.5g", wcs->cdelt[i]); + } + wcsprintf("\n"); + + /* Coordinate value at reference point. */ + WCSPRINTF_PTR(" crval: ", wcs->crval, "\n"); + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" %#- 11.5g", wcs->crval[i]); + } + wcsprintf("\n"); + + /* Coordinate units and type. */ + WCSPRINTF_PTR(" cunit: ", wcs->cunit, "\n"); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" \"%s\"\n", wcs->cunit[i]); + } + + WCSPRINTF_PTR(" ctype: ", wcs->ctype, "\n"); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" \"%s\"\n", wcs->ctype[i]); + } + + /* Celestial and spectral transformation parameters. */ + if (undefined(wcs->lonpole)) { + wcsprintf(" lonpole: UNDEFINED\n"); + } else { + wcsprintf(" lonpole: %9f\n", wcs->lonpole); + } + wcsprintf(" latpole: %9f\n", wcs->latpole); + wcsprintf(" restfrq: %f\n", wcs->restfrq); + wcsprintf(" restwav: %f\n", wcs->restwav); + + /* Parameter values. */ + wcsprintf(" npv: %d\n", wcs->npv); + wcsprintf(" npvmax: %d\n", wcs->npvmax); + WCSPRINTF_PTR(" pv: ", wcs->pv, "\n"); + for (i = 0; i < wcs->npv; i++) { + wcsprintf(" %3d%4d %#- 11.5g\n", (wcs->pv[i]).i, + (wcs->pv[i]).m, (wcs->pv[i]).value); + } + wcsprintf(" nps: %d\n", wcs->nps); + wcsprintf(" npsmax: %d\n", wcs->npsmax); + WCSPRINTF_PTR(" ps: ", wcs->ps, "\n"); + for (i = 0; i < wcs->nps; i++) { + wcsprintf(" %3d%4d %s\n", (wcs->ps[i]).i, + (wcs->ps[i]).m, (wcs->ps[i]).value); + } + + /* Alternate linear transformations. */ + k = 0; + WCSPRINTF_PTR(" cd: ", wcs->cd, "\n"); + if (wcs->cd) { + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" cd[%d][]:", i); + for (j = 0; j < wcs->naxis; j++) { + wcsprintf(" %#- 11.5g", wcs->cd[k++]); + } + wcsprintf("\n"); + } + } + + WCSPRINTF_PTR(" crota: ", wcs->crota, "\n"); + if (wcs->crota) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" %#- 11.5g", wcs->crota[i]); + } + wcsprintf("\n"); + } + + wcsprintf(" altlin: %d\n", wcs->altlin); + wcsprintf(" velref: %d\n", wcs->velref); + + + + /* Auxiliary coordinate system information. */ + wcsprintf(" alt: '%c'\n", wcs->alt[0]); + wcsprintf(" colnum: %d\n", wcs->colnum); + + WCSPRINTF_PTR(" colax: ", wcs->colax, "\n"); + if (wcs->colax) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf(" %5d", wcs->colax[i]); + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" cname: ", wcs->cname, "\n"); + if (wcs->cname) { + for (i = 0; i < wcs->naxis; i++) { + if (wcs->cname[i][0] == '\0') { + wcsprintf(" UNDEFINED\n"); + } else { + wcsprintf(" \"%s\"\n", wcs->cname[i]); + } + } + } + + WCSPRINTF_PTR(" crder: ", wcs->crder, "\n"); + if (wcs->crder) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + if (undefined(wcs->crder[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %#- 11.5g", wcs->crder[i]); + } + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" csyer: ", wcs->csyer, "\n"); + if (wcs->csyer) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + if (undefined(wcs->csyer[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %#- 11.5g", wcs->csyer[i]); + } + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" czphs: ", wcs->czphs, "\n"); + if (wcs->czphs) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + if (undefined(wcs->czphs[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %#- 11.5g", wcs->czphs[i]); + } + } + wcsprintf("\n"); + } + + WCSPRINTF_PTR(" cperi: ", wcs->cperi, "\n"); + if (wcs->cperi) { + wcsprintf(" "); + for (i = 0; i < wcs->naxis; i++) { + if (undefined(wcs->cperi[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %#- 11.5g", wcs->cperi[i]); + } + } + wcsprintf("\n"); + } + + wcsprt_auxc(" wcsname", wcs->wcsname); + + wcsprt_auxc(" timesys", wcs->timesys); + wcsprt_auxc(" trefpos", wcs->trefpos); + wcsprt_auxc(" trefdir", wcs->trefdir); + wcsprt_auxc(" plephem", wcs->plephem); + wcsprt_auxc("timeunit", wcs->timeunit); + wcsprt_auxc(" dateref", wcs->dateref); + wcsprintf(" mjdref: "); + for (i = 0; i < 2; i++) { + if (undefined(wcs->mjdref[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %15.9f", wcs->mjdref[i]); + } + } + wcsprintf("\n"); + wcsprt_auxd("timeoffs", wcs->timeoffs); + + wcsprt_auxc(" dateobs", wcs->dateobs); + wcsprt_auxc(" datebeg", wcs->datebeg); + wcsprt_auxc(" dateavg", wcs->dateavg); + wcsprt_auxc(" dateend", wcs->dateend); + wcsprt_auxd(" mjdobs", wcs->mjdobs); + wcsprt_auxd(" mjdbeg", wcs->mjdbeg); + wcsprt_auxd(" mjdavg", wcs->mjdavg); + wcsprt_auxd(" mjdend", wcs->mjdend); + wcsprt_auxd(" jepoch", wcs->jepoch); + wcsprt_auxd(" bepoch", wcs->bepoch); + wcsprt_auxd(" tstart", wcs->tstart); + wcsprt_auxd(" tstop", wcs->tstop); + wcsprt_auxd(" xposure", wcs->xposure); + wcsprt_auxd(" telapse", wcs->telapse); + + + wcsprt_auxd(" timsyer", wcs->timsyer); + wcsprt_auxd(" timrder", wcs->timrder); + wcsprt_auxd(" timedel", wcs->timedel); + wcsprt_auxd("timepixr", wcs->timepixr); + + wcsprintf(" obsgeo: "); + for (i = 0; i < 3; i++) { + if (undefined(wcs->obsgeo[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %15.6f", wcs->obsgeo[i]); + } + } + wcsprintf("\n "); + for (i = 3; i < 6; i++) { + if (undefined(wcs->obsgeo[i])) { + wcsprintf(" UNDEFINED"); + } else { + wcsprintf(" %15.6f", wcs->obsgeo[i]); + } + } + wcsprintf("\n"); + + wcsprt_auxc("obsorbit", wcs->obsorbit); + wcsprt_auxc(" radesys", wcs->radesys); + wcsprt_auxd(" equinox", wcs->equinox); + wcsprt_auxc(" specsys", wcs->specsys); + wcsprt_auxc(" ssysobs", wcs->ssysobs); + wcsprt_auxd(" velosys", wcs->velosys); + wcsprt_auxd(" zsource", wcs->zsource); + wcsprt_auxc(" ssyssrc", wcs->ssyssrc); + wcsprt_auxd(" velangl", wcs->velangl); + + wcsprintf(" ntab: %d\n", wcs->ntab); + WCSPRINTF_PTR(" tab: ", wcs->tab, ""); + if (wcs->tab != 0x0) wcsprintf(" (see below)"); + wcsprintf("\n"); + wcsprintf(" nwtb: %d\n", wcs->nwtb); + WCSPRINTF_PTR(" wtb: ", wcs->wtb, ""); + if (wcs->wtb != 0x0) wcsprintf(" (see below)"); + wcsprintf("\n"); + + /* Derived values. */ + WCSPRINTF_PTR(" types: ", wcs->types, "\n "); + for (i = 0; i < wcs->naxis; i++) { + wcsprintf("%5d", wcs->types[i]); + } + wcsprintf("\n"); + + wcsprintf(" lngtyp: \"%s\"\n", wcs->lngtyp); + wcsprintf(" lattyp: \"%s\"\n", wcs->lattyp); + wcsprintf(" lng: %d\n", wcs->lng); + wcsprintf(" lat: %d\n", wcs->lat); + wcsprintf(" spec: %d\n", wcs->spec); + wcsprintf(" cubeface: %d\n", wcs->cubeface); + + WCSPRINTF_PTR(" err: ", wcs->err, "\n"); + if (wcs->err) { + wcserr_prt(wcs->err, " "); + } + + wcsprintf(" lin: (see below)\n"); + wcsprintf(" cel: (see below)\n"); + wcsprintf(" spc: (see below)\n"); + + /* Memory management. */ + wcsprintf(" m_flag: %d\n", wcs->m_flag); + wcsprintf(" m_naxis: %d\n", wcs->m_naxis); + WCSPRINTF_PTR(" m_crpix: ", wcs->m_crpix, ""); + if (wcs->m_crpix == wcs->crpix) wcsprintf(" (= crpix)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_pc: ", wcs->m_pc, ""); + if (wcs->m_pc == wcs->pc) wcsprintf(" (= pc)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cdelt: ", wcs->m_cdelt, ""); + if (wcs->m_cdelt == wcs->cdelt) wcsprintf(" (= cdelt)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_crval: ", wcs->m_crval, ""); + if (wcs->m_crval == wcs->crval) wcsprintf(" (= crval)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cunit: ", wcs->m_cunit, ""); + if (wcs->m_cunit == wcs->cunit) wcsprintf(" (= cunit)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_ctype: ", wcs->m_ctype, ""); + if (wcs->m_ctype == wcs->ctype) wcsprintf(" (= ctype)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_pv: ", wcs->m_pv, ""); + if (wcs->m_pv == wcs->pv) wcsprintf(" (= pv)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_ps: ", wcs->m_ps, ""); + if (wcs->m_ps == wcs->ps) wcsprintf(" (= ps)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cd: ", wcs->m_cd, ""); + if (wcs->m_cd == wcs->cd) wcsprintf(" (= cd)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_crota: ", wcs->m_crota, ""); + if (wcs->m_crota == wcs->crota) wcsprintf(" (= crota)"); + wcsprintf("\n"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_colax: ", wcs->m_colax, ""); + if (wcs->m_colax == wcs->colax) wcsprintf(" (= colax)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cname: ", wcs->m_cname, ""); + if (wcs->m_cname == wcs->cname) wcsprintf(" (= cname)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_crder: ", wcs->m_crder, ""); + if (wcs->m_crder == wcs->crder) wcsprintf(" (= crder)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_csyer: ", wcs->m_csyer, ""); + if (wcs->m_csyer == wcs->csyer) wcsprintf(" (= csyer)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_czphs: ", wcs->m_czphs, ""); + if (wcs->m_czphs == wcs->czphs) wcsprintf(" (= czphs)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_cperi: ", wcs->m_cperi, ""); + if (wcs->m_cperi == wcs->cperi) wcsprintf(" (= cperi)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_tab: ", wcs->m_tab, ""); + if (wcs->m_tab == wcs->tab) wcsprintf(" (= tab)"); + wcsprintf("\n"); + WCSPRINTF_PTR(" m_wtb: ", wcs->m_wtb, ""); + if (wcs->m_wtb == wcs->wtb) wcsprintf(" (= wtb)"); + wcsprintf("\n"); + + /* Tabular transformation parameters. */ + if ((wtbp = wcs->wtb)) { + for (j = 0; j < wcs->nwtb; j++, wtbp++) { + wcsprintf("\n"); + wcsprintf("wtb[%d].*\n", j); + wcsprintf(" i: %d\n", wtbp->i); + wcsprintf(" m: %d\n", wtbp->m); + wcsprintf(" kind: %c\n", wtbp->kind); + wcsprintf(" extnam: %s\n", wtbp->extnam); + wcsprintf(" extver: %d\n", wtbp->extver); + wcsprintf(" extlev: %d\n", wtbp->extlev); + wcsprintf(" ttype: %s\n", wtbp->ttype); + wcsprintf(" row: %ld\n", wtbp->row); + wcsprintf(" ndim: %d\n", wtbp->ndim); + WCSPRINTF_PTR(" dimlen: ", wtbp->dimlen, "\n"); + WCSPRINTF_PTR(" arrayp: ", wtbp->arrayp, " -> "); + WCSPRINTF_PTR("", *(wtbp->arrayp), "\n"); + } + } + + if (wcs->tab) { + for (j = 0; j < wcs->ntab; j++) { + wcsprintf("\n"); + wcsprintf("tab[%d].*\n", j); + tabprt(wcs->tab + j); + } + } + + /* Linear transformation parameters. */ + wcsprintf("\n"); + wcsprintf(" lin.*\n"); + linprt(&(wcs->lin)); + + /* Celestial transformation parameters. */ + wcsprintf("\n"); + wcsprintf(" cel.*\n"); + celprt(&(wcs->cel)); + + /* Spectral transformation parameters. */ + wcsprintf("\n"); + wcsprintf(" spc.*\n"); + spcprt(&(wcs->spc)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsperr(const struct wcsprm *wcs, const char *prefix) + +{ + int j; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + + if (wcs->err && wcserr_prt(wcs->err, prefix) == 0) { + linperr(&(wcs->lin), prefix); + celperr(&(wcs->cel), prefix); + wcserr_prt(wcs->spc.err, prefix); + if (wcs->tab) { + for (j = 0; j < wcs->ntab; j++) { + wcserr_prt((wcs->tab + j)->err, prefix); + } + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsbchk(struct wcsprm *wcs, int bounds) + +{ + int status; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + wcs->cel.prj.bounds = bounds; + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsset(struct wcsprm *wcs) + +{ + static const char *function = "wcsset"; + + char dpq[16], scode[4], stype[5]; + int i, j, k, m, n, naxis, ndpmax, status; + double lambda, rho; + double *cd, *pc; + struct disprm *dis; + struct dpkey *keyp; + struct linprm *wcslin = &(wcs->lin); + struct celprm *wcscel = &(wcs->cel); + struct prjprm *wcsprj = &(wcscel->prj); + struct spcprm *wcsspc = &(wcs->spc); + struct wcserr **err; + + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + /* Determine axis types from CTYPEia. */ + if ((status = wcs_types(wcs))) { + return status; + } + + /* Convert to canonical units. */ + if ((status = wcs_units(wcs))) { + return status; + } + + naxis = wcs->naxis; + + + /* Non-linear celestial axes present? */ + if (wcs->lng >= 0 && wcs->types[wcs->lng] == 2200) { + celini(wcscel); + + /* CRVALia, LONPOLEa, and LATPOLEa keyvalues. */ + wcscel->ref[0] = wcs->crval[wcs->lng]; + wcscel->ref[1] = wcs->crval[wcs->lat]; + wcscel->ref[2] = wcs->lonpole; + wcscel->ref[3] = wcs->latpole; + + /* Do alias translation for TPU/TPV before dealing with PVi_ma. */ + strncpy(wcsprj->code, wcs->ctype[wcs->lng]+5, 3); + wcsprj->code[3] = '\0'; + if (strncmp(wcsprj->code, "TPU", 3) == 0 || + strncmp(wcsprj->code, "TPV", 3) == 0) { + /* Translate the PV parameters. */ + if ((dis = calloc(1, sizeof(struct disprm))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + ndpmax = 6 + wcs->npv; + + /* Attach it to linprm. Also inits it. */ + dis->flag = -1; + if (strncmp(wcsprj->code, "TPU", 3) == 0) { + /* Prior distortion. */ + lindist(1, wcslin, dis, ndpmax); + strcpy(dpq, "DP"); + } else { + /* Sequent distortion. */ + lindist(2, wcslin, dis, ndpmax); + strcpy(dpq, "DQ"); + } + + /* Yes, the distortion type is "TPV" even for TPU. */ + strcpy(dis->dtype[wcs->lng], "TPV"); + strcpy(dis->dtype[wcs->lat], "TPV"); + + /* Keep the keywords in axis-order to aid debugging. */ + keyp = dis->dp; + + sprintf(dpq+2, "%d", wcs->lng+1); + dpfill(keyp++, dpq, "NAXES", 0, 0, 2, 0.0); + dpfill(keyp++, dpq, "AXIS.1", 0, 0, 1, 0.0); + dpfill(keyp++, dpq, "AXIS.2", 0, 0, 2, 0.0); + + /* Copy distortion parameters for the longitude axis. */ + for (k = 0; k < wcs->npv; k++) { + if (wcs->pv[k].i != wcs->lng+1) continue; + sprintf(keyp->field, "%s.TPV.%d", dpq, wcs->pv[k].m); + dpfill(keyp++, 0x0, 0x0, 0, 1, 0, wcs->pv[k].value); + } + + /* Now the latitude axis. */ + sprintf(dpq+2, "%d", wcs->lat+1); + dpfill(keyp++, dpq, "NAXES", 0, 0, 2, 0.0); + dpfill(keyp++, dpq, "AXIS.1", 0, 0, 2, 0.0); + dpfill(keyp++, dpq, "AXIS.2", 0, 0, 1, 0.0); + + for (k = 0; k < wcs->npv; k++) { + if (wcs->pv[k].i != wcs->lat+1) continue; + sprintf(keyp->field, "%s.TPV.%d", dpq, wcs->pv[k].m); + dpfill(keyp++, 0x0, 0x0, 0, 1, 0, wcs->pv[k].value); + } + + dis->ndp = keyp - dis->dp; + + /* Erase PVi_ma associated with the celestial axes. */ + n = 0; + for (k = 0; k < wcs->npv; k++) { + i = wcs->pv[k].i - 1; + if (i == wcs->lng || i == wcs->lat) continue; + + wcs->pv[n].i = wcs->pv[k].i; + wcs->pv[n].m = wcs->pv[k].m; + wcs->pv[n].value = wcs->pv[k].value; + + n++; + } + + wcs->npv = n; + strcpy(wcsprj->code, "TAN"); + + /* As the PVi_ma have now been erased, ctype must be reset to prevent + this translation from re-occurring if wcsset() is called again. */ + strcpy(wcs->ctype[wcs->lng]+5, "TAN"); + strcpy(wcs->ctype[wcs->lat]+5, "TAN"); + + } else if (strncmp(wcsprj->code, "TNX", 3) == 0) { + /* The WAT distortion should already have been encoded in disseq. */ + strcpy(wcsprj->code, "TAN"); + strcpy(wcs->ctype[wcs->lng]+5, "TAN"); + strcpy(wcs->ctype[wcs->lat]+5, "TAN"); + + } else if (strncmp(wcsprj->code, "ZPX", 3) == 0) { + /* The WAT distortion should already have been encoded in disseq. */ + strcpy(wcsprj->code, "ZPN"); + strcpy(wcs->ctype[wcs->lng]+5, "ZPN"); + strcpy(wcs->ctype[wcs->lat]+5, "ZPN"); + } + + /* PVi_ma keyvalues. */ + for (k = 0; k < wcs->npv; k++) { + if (wcs->pv[k].i == 0) { + /* From a PROJPn keyword. */ + wcs->pv[k].i = wcs->lat + 1; + } + + i = wcs->pv[k].i - 1; + m = wcs->pv[k].m; + + if (i == wcs->lat) { + /* PVi_ma associated with latitude axis. */ + if (m < 30) { + wcsprj->pv[m] = wcs->pv[k].value; + } + + } else if (i == wcs->lng) { + /* PVi_ma associated with longitude axis. */ + switch (m) { + case 0: + wcscel->offset = (wcs->pv[k].value != 0.0); + break; + case 1: + wcscel->phi0 = wcs->pv[k].value; + break; + case 2: + wcscel->theta0 = wcs->pv[k].value; + break; + case 3: + /* If present, overrides LONPOLEa. */ + wcscel->ref[2] = wcs->pv[k].value; + break; + case 4: + /* If present, overrides LATPOLEa. */ + wcscel->ref[3] = wcs->pv[k].value; + break; + default: + return wcserr_set(WCSERR_SET(WCSERR_BAD_COORD_TRANS), + "PV%i_%i%s: Unrecognized coordinate transformation parameter", + i+1, m, wcs->alt); + break; + } + } + } + + /* Do simple alias translations. */ + if (strncmp(wcs->ctype[wcs->lng]+5, "GLS", 3) == 0) { + wcscel->offset = 1; + wcscel->phi0 = 0.0; + wcscel->theta0 = wcs->crval[wcs->lat]; + strcpy(wcsprj->code, "SFL"); + + } else if (strncmp(wcs->ctype[wcs->lng]+5, "NCP", 3) == 0) { + /* Convert NCP to SIN. */ + if (wcscel->ref[1] == 0.0) { + return wcserr_set(WCSERR_SET(WCSERR_BAD_PARAM), + "Invalid projection: NCP blows up on the equator"); + } + + strcpy(wcsprj->code, "SIN"); + wcsprj->pv[1] = 0.0; + wcsprj->pv[2] = cosd(wcscel->ref[1])/sind(wcscel->ref[1]); + } + + /* Initialize the celestial transformation routines. */ + wcsprj->r0 = 0.0; + if ((status = celset(wcscel))) { + return wcserr_set(WCS_ERRMSG(wcs_celerr[status])); + } + + /* Update LONPOLE, LATPOLE, and PVi_ma keyvalues. */ + wcs->lonpole = wcscel->ref[2]; + wcs->latpole = wcscel->ref[3]; + + for (k = 0; k < wcs->npv; k++) { + i = wcs->pv[k].i - 1; + m = wcs->pv[k].m; + + if (i == wcs->lng) { + switch (m) { + case 1: + wcs->pv[k].value = wcscel->phi0; + break; + case 2: + wcs->pv[k].value = wcscel->theta0; + break; + case 3: + wcs->pv[k].value = wcscel->ref[2]; + break; + case 4: + wcs->pv[k].value = wcscel->ref[3]; + break; + } + } + } + } + + + /* Non-linear spectral axis present? */ + if (wcs->spec >= 0 && wcs->types[wcs->spec] == 3300) { + spcini(wcsspc); + if ((status = spctype(wcs->ctype[wcs->spec], stype, scode, 0x0, 0x0, 0x0, + 0x0, 0x0, err))) { + return status; + } + strcpy(wcsspc->type, stype); + strcpy(wcsspc->code, scode); + + /* CRVALia, RESTFRQa, and RESTWAVa keyvalues. */ + wcsspc->crval = wcs->crval[wcs->spec]; + wcsspc->restfrq = wcs->restfrq; + wcsspc->restwav = wcs->restwav; + + /* PVi_ma keyvalues. */ + for (k = 0; k < wcs->npv; k++) { + i = wcs->pv[k].i - 1; + m = wcs->pv[k].m; + + if (i == wcs->spec) { + /* PVi_ma associated with grism axis. */ + if (m < 7) { + wcsspc->pv[m] = wcs->pv[k].value; + } + } + } + + /* Initialize the spectral transformation routines. */ + if ((status = spcset(wcsspc))) { + return wcserr_set(WCS_ERRMSG(wcs_spcerr[status])); + } + } + + + /* Tabular axes present? */ + for (j = 0; j < wcs->ntab; j++) { + if ((status = tabset(wcs->tab + j))) { + return wcserr_set(WCS_ERRMSG(wcs_taberr[status])); + } + } + + + /* Initialize the linear transformation. */ + wcs->altlin &= 7; + if (wcs->altlin > 1 && !(wcs->altlin & 1)) { + pc = wcs->pc; + + if (wcs->altlin & 2) { + /* Copy CDi_ja to PCi_ja and reset CDELTia. */ + cd = wcs->cd; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++) { + *(pc++) = *(cd++); + } + wcs->cdelt[i] = 1.0; + } + + } else if (wcs->altlin & 4) { + /* Construct PCi_ja from CROTAia. */ + if ((i = wcs->lng) >= 0 && (j = wcs->lat) >= 0) { + rho = wcs->crota[j]; + + if (wcs->cdelt[i] == 0.0) { + return wcserr_set(WCSERR_SET(WCSERR_SINGULAR_MTX), + "Singular transformation matrix, CDELT%d is zero", i+1); + } + lambda = wcs->cdelt[j]/wcs->cdelt[i]; + + *(pc + i*naxis + i) = *(pc + j*naxis + j) = cosd(rho); + *(pc + i*naxis + j) = *(pc + j*naxis + i) = sind(rho); + *(pc + i*naxis + j) *= -lambda; + *(pc + j*naxis + i) /= lambda; + } + } + } + + wcs->lin.crpix = wcs->crpix; + wcs->lin.pc = wcs->pc; + wcs->lin.cdelt = wcs->cdelt; + if ((status = linset(&(wcs->lin)))) { + return wcserr_set(WCS_ERRMSG(wcs_linerr[status])); + } + + + /* Set defaults for radesys and equinox for equatorial or ecliptic. */ + if (strcmp(wcs->lngtyp, "RA") == 0 || + strcmp(wcs->lngtyp, "ELON") == 0 || + strcmp(wcs->lngtyp, "HLON") == 0) { + if (wcs->radesys[0] == '\0') { + if (undefined(wcs->equinox)) { + strcpy(wcs->radesys, "ICRS"); + } else if (wcs->equinox < 1984.0) { + strcpy(wcs->radesys, "FK4"); + } else { + strcpy(wcs->radesys, "FK5"); + } + + } else if (strcmp(wcs->radesys, "ICRS") == 0 || + strcmp(wcs->radesys, "GAPPT") == 0) { + /* Equinox is not applicable for these coordinate systems. */ + wcs->equinox = UNDEFINED; + + } else if (undefined(wcs->equinox)) { + if (strcmp(wcs->radesys, "FK5") == 0) { + wcs->equinox = 2000.0; + } else if (strcmp(wcs->radesys, "FK4") == 0 || + strcmp(wcs->radesys, "FK4-NO-E") == 0) { + wcs->equinox = 1950.0; + } + } + + } else { + /* No celestial axes, ensure that radesys and equinox are unset. */ + memset(wcs->radesys, 0, 72); + wcs->equinox = UNDEFINED; + } + + + /* Strip off trailing blanks and null-fill auxiliary string members. */ + wcsutil_null_fill(4, wcs->alt); + for (i = 0; i < naxis; i++) { + wcsutil_null_fill(72, wcs->cname[i]); + } + wcsutil_null_fill(72, wcs->wcsname); + wcsutil_null_fill(72, wcs->timesys); + wcsutil_null_fill(72, wcs->trefpos); + wcsutil_null_fill(72, wcs->trefdir); + wcsutil_null_fill(72, wcs->plephem); + wcsutil_null_fill(72, wcs->timeunit); + wcsutil_null_fill(72, wcs->dateref); + wcsutil_null_fill(72, wcs->dateobs); + wcsutil_null_fill(72, wcs->datebeg); + wcsutil_null_fill(72, wcs->dateavg); + wcsutil_null_fill(72, wcs->dateend); + wcsutil_null_fill(72, wcs->obsorbit); + wcsutil_null_fill(72, wcs->radesys); + wcsutil_null_fill(72, wcs->specsys); + wcsutil_null_fill(72, wcs->ssysobs); + wcsutil_null_fill(72, wcs->ssyssrc); + + wcs->flag = WCSSET; + + return 0; +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int wcs_types(struct wcsprm *wcs) + +{ + static const char *function = "wcs_types"; + + const int nalias = 6; + const char aliases [6][4] = {"NCP", "GLS", "TPU", "TPV", "TNX", "ZPX"}; + + const char *alt = ""; + char ctypei[16], pcode[4], requir[16], scode[4], specsys[9]; + int i, j, m, naxis, *ndx = 0x0, type; + struct wcserr **err; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + /* Parse the CTYPEia keyvalues. */ + pcode[0] = '\0'; + requir[0] = '\0'; + wcs->lng = -1; + wcs->lat = -1; + wcs->spec = -1; + wcs->cubeface = -1; + + if (*(wcs->alt) != ' ') alt = wcs->alt; + + + naxis = wcs->naxis; + if (wcs->types) free(wcs->types); + if ((wcs->types = calloc(naxis, sizeof(int))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + for (i = 0; i < naxis; i++) { + /* Null fill. */ + wcsutil_null_fill(72, wcs->ctype[i]); + + strncpy(ctypei, wcs->ctype[i], 15); + ctypei[15] = '\0'; + + /* Check for early Paper IV syntax (e.g. '-SIP' used by Spitzer). */ + if (strlen(ctypei) == 12 && ctypei[8] == '-') { + /* Excise the "4-3-3" or "8-3"-form distortion code. */ + ctypei[8] = '\0'; + + /* Remove trailing dashes from "8-3"-form codes. */ + for (j = 7; j > 0; j--) { + if (ctypei[j] != '-') break; + ctypei[j] = '\0'; + } + } + + /* Logarithmic or tabular axis? */ + wcs->types[i] = 0; + if (strcmp(ctypei+4, "-LOG") == 0) { + /* Logarithmic axis. */ + wcs->types[i] = 400; + + } else if (strcmp(ctypei+4, "-TAB") == 0) { + /* Tabular axis. */ + wcs->types[i] = 500; + } + + if (wcs->types[i]) { + /* Could have -LOG or -TAB with celestial or spectral types. */ + ctypei[4] = '\0'; + + /* Take care of things like 'FREQ-LOG' or 'RA---TAB'. */ + for (j = 3; j >= 0; j--) { + if (ctypei[j] != '-') break; + ctypei[j] = '\0'; + } + } + + /* Translate AIPS spectral types for spctyp(). */ + if (spcaips(ctypei, wcs->velref, ctypei, specsys) == 0) { + strcpy(wcs->ctype[i], ctypei); + if (wcs->specsys[0] == '\0') strcpy(wcs->specsys, specsys); + } + + /* Process linear axes. */ + if (!(strlen(ctypei) == 8 && ctypei[4] == '-')) { + /* Identify Stokes, celestial and spectral types. */ + if (strcmp(ctypei, "STOKES") == 0) { + /* STOKES axis. */ + wcs->types[i] = 1100; + + } else if (strcmp(ctypei, "RA") == 0 || + strcmp(ctypei+1, "LON") == 0 || + strcmp(ctypei+2, "LN") == 0) { + /* Longitude axis. */ + wcs->types[i] += 2000; + if (wcs->lng < 0) { + wcs->lng = i; + strcpy(wcs->lngtyp, ctypei); + } + + } else if (strcmp(ctypei, "DEC") == 0 || + strcmp(ctypei+1, "LAT") == 0 || + strcmp(ctypei+2, "LT") == 0) { + /* Latitude axis. */ + wcs->types[i] += 2001; + if (wcs->lat < 0) { + wcs->lat = i; + strcpy(wcs->lattyp, ctypei); + } + + } else if (strcmp(ctypei, "CUBEFACE") == 0) { + /* CUBEFACE axis. */ + if (wcs->cubeface == -1) { + wcs->types[i] = 2102; + wcs->cubeface = i; + } else { + /* Multiple CUBEFACE axes! */ + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Multiple CUBEFACE axes (in CTYPE%d%.1s and CTYPE%d%.1s)", + wcs->cubeface+1, alt, i+1, alt); + } + + } else if (spctyp(ctypei, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) == 0) { + /* Spectral axis. */ + if (wcs->spec < 0) wcs->spec = i; + wcs->types[i] += 3000; + } + + continue; + } + + + /* CTYPEia is in "4-3" form; is it a recognized spectral type? */ + if (spctyp(ctypei, 0x0, scode, 0x0, 0x0, 0x0, 0x0, 0x0) == 0) { + /* Non-linear spectral axis found. */ + wcs->types[i] = 3300; + + /* Check uniqueness. */ + if (wcs->spec >= 0) { + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Multiple spectral axes (in CTYPE%d%.1s and CTYPE%d%.1s)", + wcs->spec+1, alt, i+1, alt); + } + + wcs->spec = i; + + continue; + } + + + /* Is it a recognized celestial projection? */ + for (j = 0; j < prj_ncode; j++) { + if (strncmp(ctypei+5, prj_codes[j], 3) == 0) break; + } + + if (j == prj_ncode) { + /* Not a standard projection code, maybe it's an alias. */ + for (j = 0; j < nalias; j++) { + if (strncmp(ctypei+5, aliases[j], 3) == 0) break; + } + + if (j == nalias) { + /* Not a recognized algorithm code of any type. */ + wcs->types[i] = -1; + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Unrecognized projection code (%s in CTYPE%d%.1s)", + ctypei+5, i+1, alt); + } + } + + /* Parse the celestial axis type. */ + wcs->types[i] = 2200; + if (*pcode == '\0') { + /* The first of the two celestial axes. */ + sprintf(pcode, "%.3s", ctypei+5); + + if (strncmp(ctypei, "RA--", 4) == 0) { + wcs->lng = i; + strcpy(wcs->lngtyp, "RA"); + strcpy(wcs->lattyp, "DEC"); + ndx = &wcs->lat; + sprintf(requir, "DEC--%s", pcode); + } else if (strncmp(ctypei, "DEC-", 4) == 0) { + wcs->lat = i; + strcpy(wcs->lngtyp, "RA"); + strcpy(wcs->lattyp, "DEC"); + ndx = &wcs->lng; + sprintf(requir, "RA---%s", pcode); + } else if (strncmp(ctypei+1, "LON", 3) == 0) { + wcs->lng = i; + sprintf(wcs->lngtyp, "%cLON", ctypei[0]); + sprintf(wcs->lattyp, "%cLAT", ctypei[0]); + ndx = &wcs->lat; + sprintf(requir, "%s-%s", wcs->lattyp, pcode); + } else if (strncmp(ctypei+1, "LAT", 3) == 0) { + wcs->lat = i; + sprintf(wcs->lngtyp, "%cLON", ctypei[0]); + sprintf(wcs->lattyp, "%cLAT", ctypei[0]); + ndx = &wcs->lng; + sprintf(requir, "%s-%s", wcs->lngtyp, pcode); + } else if (strncmp(ctypei+2, "LN", 2) == 0) { + wcs->lng = i; + sprintf(wcs->lngtyp, "%c%cLN", ctypei[0], ctypei[1]); + sprintf(wcs->lattyp, "%c%cLT", ctypei[0], ctypei[1]); + ndx = &wcs->lat; + sprintf(requir, "%s-%s", wcs->lattyp, pcode); + } else if (strncmp(ctypei+2, "LT", 2) == 0) { + wcs->lat = i; + sprintf(wcs->lngtyp, "%c%cLN", ctypei[0], ctypei[1]); + sprintf(wcs->lattyp, "%c%cLT", ctypei[0], ctypei[1]); + ndx = &wcs->lng; + sprintf(requir, "%s-%s", wcs->lngtyp, pcode); + } else { + /* Unrecognized celestial type. */ + wcs->types[i] = -1; + + wcs->lng = -1; + wcs->lat = -1; + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Unrecognized celestial type (%5s in CTYPE%d%.1s)", + ctypei, i+1, alt); + } + + if (wcs->lat >= 0) wcs->types[i]++; + + } else { + /* Looking for the complementary celestial axis. */ + if (wcs->lat < 0) wcs->types[i]++; + + if (strncmp(ctypei, requir, 8) != 0) { + /* Inconsistent projection types. */ + wcs->lng = -1; + wcs->lat = -1; + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), "Inconsistent " + "projection types (expected %s, got %s in CTYPE%d%.1s)", requir, + ctypei, i+1, alt); + } + + *ndx = i; + requir[0] = '\0'; + } + } + + /* Do we have a complementary pair of celestial axes? */ + if (strcmp(requir, "")) { + /* Unmatched celestial axis. */ + wcs->lng = -1; + wcs->lat = -1; + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Unmatched celestial axes"); + } + + /* Table group numbers. */ + for (j = 0; j < wcs->ntab; j++) { + for (m = 0; m < wcs->tab[j].M; m++) { + /* Get image axis number. */ + i = wcs->tab[j].map[m]; + + type = (wcs->types[i] / 100) % 10; + if (type != 5) { + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "Table parameters set for non-table axis type"); + } + wcs->types[i] += 10 * j; + } + } + + return 0; +} + +/* : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : */ + +int wcs_units(struct wcsprm *wcs) + +{ + static const char *function = "wcs_units"; + + char ctype[9], units[16]; + int i, j, naxis; + double scale, offset, power; + struct wcserr *uniterr = 0x0, **err; + + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + naxis = wcs->naxis; + for (i = 0; i < naxis; i++) { + /* Use types set by wcs_types(). */ + switch (wcs->types[i]/1000) { + case 2: + /* Celestial axis. */ + strcpy(units, "deg"); + break; + + case 3: + /* Spectral axis. */ + strncpy(ctype, wcs->ctype[i], 8); + ctype[8] = '\0'; + spctyp(ctype, 0x0, 0x0, 0x0, units, 0x0, 0x0, 0x0); + break; + + default: + continue; + } + + /* Tabular axis, CDELTia and CRVALia relate to indices. */ + if ((wcs->types[i]/100)%10 == 5) { + continue; + } + + wcsutil_null_fill(72, wcs->cunit[i]); + if (wcs->cunit[i][0]) { + if (wcsunitse(wcs->cunit[i], units, &scale, &offset, &power, + &uniterr)) { + wcserr_set(WCSERR_SET(WCSERR_BAD_COORD_TRANS), + "In CUNIT%d%.1s: %s", i+1, (*wcs->alt)?wcs->alt:"", uniterr->msg); + free(uniterr); + return WCSERR_BAD_COORD_TRANS; + } + + if (scale != 1.0) { + wcs->cdelt[i] *= scale; + wcs->crval[i] *= scale; + + for (j = 0; j < naxis; j++) { + *(wcs->cd + i*naxis + j) *= scale; + } + + strcpy(wcs->cunit[i], units); + } + + } else { + strcpy(wcs->cunit[i], units); + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsp2s( + struct wcsprm *wcs, + int ncoord, + int nelem, + const double pixcrd[], + double imgcrd[], + double phi[], + double theta[], + double world[], + int stat[]) + +{ + static const char *function = "wcsp2s"; + + int bits, face, i, iso_x, iso_y, istat, *istatp, itab, k, m, nx, ny, + *statp, status, type; + double crvali, offset; + register double *img, *wrl; + struct celprm *wcscel = &(wcs->cel); + struct prjprm *wcsprj = &(wcscel->prj); + struct wcserr **err; + + /* Initialize if required. */ + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + /* Sanity check. */ + if (ncoord < 1 || (ncoord > 1 && nelem < wcs->naxis)) { + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "ncoord and/or nelem inconsistent with the wcsprm"); + } + + + /* Apply pixel-to-world linear transformation. */ + if ((status = linp2x(&(wcs->lin), ncoord, nelem, pixcrd, imgcrd))) { + return wcserr_set(WCS_ERRMSG(wcs_linerr[status])); + } + + /* Initialize status vectors. */ + if ((istatp = calloc(ncoord, sizeof(int))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + stat[0] = 0; + wcsutil_setAli(ncoord, 1, stat); + + + /* Convert intermediate world coordinates to world coordinates. */ + for (i = 0; i < wcs->naxis; i++) { + /* Extract the second digit of the axis type code. */ + type = (wcs->types[i] / 100) % 10; + + if (type <= 1) { + /* Linear or quantized coordinate axis. */ + img = imgcrd + i; + wrl = world + i; + crvali = wcs->crval[i]; + for (k = 0; k < ncoord; k++) { + *wrl = *img + crvali; + img += nelem; + wrl += nelem; + } + + } else if (wcs->types[i] == 2200) { + /* Convert celestial coordinates; do we have a CUBEFACE axis? */ + if (wcs->cubeface != -1) { + /* Separation between faces. */ + if (wcsprj->r0 == 0.0) { + offset = 90.0; + } else { + offset = wcsprj->r0*PI/2.0; + } + + /* Lay out faces in a plane. */ + img = imgcrd; + statp = stat; + bits = (1 << i) | (1 << wcs->lat); + for (k = 0; k < ncoord; k++, statp++) { + face = (int)(*(img+wcs->cubeface) + 0.5); + if (fabs(*(img+wcs->cubeface) - face) > 1e-10) { + *statp |= bits; + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_PIX)); + + } else { + *statp = 0; + + switch (face) { + case 0: + *(img+wcs->lat) += offset; + break; + case 1: + break; + case 2: + *(img+i) += offset; + break; + case 3: + *(img+i) += offset*2; + break; + case 4: + *(img+i) += offset*3; + break; + case 5: + *(img+wcs->lat) -= offset; + break; + default: + *statp |= bits; + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_PIX)); + } + } + + img += nelem; + } + } + + /* Check for constant x and/or y. */ + nx = ncoord; + ny = 0; + + if ((iso_x = wcsutil_allEq(ncoord, nelem, imgcrd+i))) { + nx = 1; + ny = ncoord; + } + if ((iso_y = wcsutil_allEq(ncoord, nelem, imgcrd+wcs->lat))) { + ny = 1; + } + + /* Transform projection plane coordinates to celestial coordinates. */ + if ((istat = celx2s(wcscel, nx, ny, nelem, nelem, imgcrd+i, + imgcrd+wcs->lat, phi, theta, world+i, + world+wcs->lat, istatp))) { + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_celerr[istat])); + if (status != WCSERR_BAD_PIX) { + goto cleanup; + } + } + } + + /* If x and y were both constant, replicate values. */ + if (iso_x && iso_y) { + wcsutil_setAll(ncoord, nelem, world+i); + wcsutil_setAll(ncoord, nelem, world+wcs->lat); + wcsutil_setAll(ncoord, 1, phi); + wcsutil_setAll(ncoord, 1, theta); + wcsutil_setAli(ncoord, 1, istatp); + } + + if (istat == 5) { + bits = (1 << i) | (1 << wcs->lat); + wcsutil_setBit(ncoord, istatp, bits, stat); + } + + } else if (type == 3 || type == 4) { + /* Check for constant x. */ + nx = ncoord; + if ((iso_x = wcsutil_allEq(ncoord, nelem, imgcrd+i))) { + nx = 1; + } + + istat = 0; + if (wcs->types[i] == 3300) { + /* Spectral coordinates. */ + istat = spcx2s(&(wcs->spc), nx, nelem, nelem, imgcrd+i, world+i, + istatp); + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_spcerr[istat])); + if (status != WCSERR_BAD_PIX) { + goto cleanup; + } + } + } else if (type == 4) { + /* Logarithmic coordinates. */ + istat = logx2s(wcs->crval[i], nx, nelem, nelem, imgcrd+i, world+i, + istatp); + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_logerr[istat])); + if (status != WCSERR_BAD_PIX) { + goto cleanup; + } + } + } + + /* If x was constant, replicate values. */ + if (iso_x) { + wcsutil_setAll(ncoord, nelem, world+i); + wcsutil_setAli(ncoord, 1, istatp); + } + + if (istat == 3) { + wcsutil_setBit(ncoord, istatp, 1 << i, stat); + } + } + } + + + /* Do tabular coordinates. */ + for (itab = 0; itab < wcs->ntab; itab++) { + istat = tabx2s(wcs->tab + itab, ncoord, nelem, imgcrd, world, istatp); + + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_taberr[istat])); + + if (status != WCSERR_BAD_PIX) { + goto cleanup; + + } else { + bits = 0; + for (m = 0; m < wcs->tab[itab].M; m++) { + bits |= 1 << wcs->tab[itab].map[m]; + } + wcsutil_setBit(ncoord, istatp, bits, stat); + } + } + } + + + /* Zero the unused world coordinate elements. */ + for (i = wcs->naxis; i < nelem; i++) { + world[i] = 0.0; + wcsutil_setAll(ncoord, nelem, world+i); + } + +cleanup: + free(istatp); + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcss2p( + struct wcsprm* wcs, + int ncoord, + int nelem, + const double world[], + double phi[], + double theta[], + double imgcrd[], + double pixcrd[], + int stat[]) + +{ + static const char *function = "wcss2p"; + + int bits, i, isolat, isolng, isospec, istat, *istatp, itab, k, m, nlat, + nlng, nwrld, status, type; + double crvali, offset; + register const double *wrl; + register double *img; + struct celprm *wcscel = &(wcs->cel); + struct prjprm *wcsprj = &(wcscel->prj); + struct wcserr **err; + + + /* Initialize if required. */ + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + /* Sanity check. */ + if (ncoord < 1 || (ncoord > 1 && nelem < wcs->naxis)) { + return wcserr_set(WCSERR_SET(WCSERR_BAD_CTYPE), + "ncoord and/or nelem inconsistent with the wcsprm"); + } + + /* Initialize status vectors. */ + if ((istatp = calloc(ncoord, sizeof(int))) == 0x0) { + return wcserr_set(WCS_ERRMSG(WCSERR_MEMORY)); + } + + status = 0; + stat[0] = 0; + wcsutil_setAli(ncoord, 1, stat); + + + /* Convert world coordinates to intermediate world coordinates. */ + for (i = 0; i < wcs->naxis; i++) { + /* Extract the second digit of the axis type code. */ + type = (wcs->types[i] / 100) % 10; + + if (type <= 1) { + /* Linear or quantized coordinate axis. */ + wrl = world + i; + img = imgcrd + i; + crvali = wcs->crval[i]; + for (k = 0; k < ncoord; k++) { + *img = *wrl - crvali; + wrl += nelem; + img += nelem; + } + + } else if (wcs->types[i] == 2200) { + /* Celestial coordinates; check for constant lng and/or lat. */ + nlng = ncoord; + nlat = 0; + + if ((isolng = wcsutil_allEq(ncoord, nelem, world+i))) { + nlng = 1; + nlat = ncoord; + } + if ((isolat = wcsutil_allEq(ncoord, nelem, world+wcs->lat))) { + nlat = 1; + } + + /* Transform celestial coordinates to projection plane coordinates. */ + if ((istat = cels2x(wcscel, nlng, nlat, nelem, nelem, world+i, + world+wcs->lat, phi, theta, imgcrd+i, + imgcrd+wcs->lat, istatp))) { + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_celerr[istat])); + if (status != WCSERR_BAD_WORLD) { + goto cleanup; + } + } + } + + /* If lng and lat were both constant, replicate values. */ + if (isolng && isolat) { + wcsutil_setAll(ncoord, nelem, imgcrd+i); + wcsutil_setAll(ncoord, nelem, imgcrd+wcs->lat); + wcsutil_setAll(ncoord, 1, phi); + wcsutil_setAll(ncoord, 1, theta); + wcsutil_setAli(ncoord, 1, istatp); + } + + if (istat == CELERR_BAD_WORLD) { + bits = (1 << i) | (1 << wcs->lat); + wcsutil_setBit(ncoord, istatp, bits, stat); + } + + /* Do we have a CUBEFACE axis? */ + if (wcs->cubeface != -1) { + /* Separation between faces. */ + if (wcsprj->r0 == 0.0) { + offset = 90.0; + } else { + offset = wcsprj->r0*PI/2.0; + } + + /* Stack faces in a cube. */ + img = imgcrd; + for (k = 0; k < ncoord; k++) { + if (*(img+wcs->lat) < -0.5*offset) { + *(img+wcs->lat) += offset; + *(img+wcs->cubeface) = 5.0; + } else if (*(img+wcs->lat) > 0.5*offset) { + *(img+wcs->lat) -= offset; + *(img+wcs->cubeface) = 0.0; + } else if (*(img+i) > 2.5*offset) { + *(img+i) -= 3.0*offset; + *(img+wcs->cubeface) = 4.0; + } else if (*(img+i) > 1.5*offset) { + *(img+i) -= 2.0*offset; + *(img+wcs->cubeface) = 3.0; + } else if (*(img+i) > 0.5*offset) { + *(img+i) -= offset; + *(img+wcs->cubeface) = 2.0; + } else { + *(img+wcs->cubeface) = 1.0; + } + + img += nelem; + } + } + + } else if (type == 3 || type == 4) { + /* Check for constancy. */ + nwrld = ncoord; + if ((isospec = wcsutil_allEq(ncoord, nelem, world+i))) { + nwrld = 1; + } + + istat = 0; + if (wcs->types[i] == 3300) { + /* Spectral coordinates. */ + istat = spcs2x(&(wcs->spc), nwrld, nelem, nelem, world+i, + imgcrd+i, istatp); + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_spcerr[istat])); + if (status != WCSERR_BAD_WORLD) { + goto cleanup; + } + } + } else if (type == 4) { + /* Logarithmic coordinates. */ + istat = logs2x(wcs->crval[i], nwrld, nelem, nelem, world+i, + imgcrd+i, istatp); + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_logerr[istat])); + if (status != WCSERR_BAD_WORLD) { + goto cleanup; + } + } + } + + /* If constant, replicate values. */ + if (isospec) { + wcsutil_setAll(ncoord, nelem, imgcrd+i); + wcsutil_setAli(ncoord, 1, istatp); + } + + if (istat == 4) { + wcsutil_setBit(ncoord, istatp, 1 << i, stat); + } + } + } + + + /* Do tabular coordinates. */ + for (itab = 0; itab < wcs->ntab; itab++) { + istat = tabs2x(wcs->tab + itab, ncoord, nelem, world, imgcrd, istatp); + + if (istat) { + status = wcserr_set(WCS_ERRMSG(wcs_taberr[istat])); + + if (status == WCSERR_BAD_WORLD) { + bits = 0; + for (m = 0; m < wcs->tab[itab].M; m++) { + bits |= 1 << wcs->tab[itab].map[m]; + } + wcsutil_setBit(ncoord, istatp, bits, stat); + + } else { + goto cleanup; + } + } + } + + + /* Zero the unused intermediate world coordinate elements. */ + for (i = wcs->naxis; i < nelem; i++) { + imgcrd[i] = 0.0; + wcsutil_setAll(ncoord, nelem, imgcrd+i); + } + + + /* Apply world-to-pixel linear transformation. */ + if ((istat = linx2p(&(wcs->lin), ncoord, nelem, imgcrd, pixcrd))) { + status = wcserr_set(WCS_ERRMSG(wcs_linerr[istat])); + goto cleanup; + } + +cleanup: + free(istatp); + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcsmix( + struct wcsprm *wcs, + int mixpix, + int mixcel, + const double vspan[2], + double vstep, + int viter, + double world[], + double phi[], + double theta[], + double imgcrd[], + double pixcrd[]) + +{ + static const char *function = "wcsmix"; + + const int niter = 60; + int crossed, istep, iter, j, k, nstep, retry, stat[1], status; + const double tol = 1.0e-10; + const double tol2 = 100.0*tol; + double *worldlat, *worldlng; + double lambda, span[2], step; + double pixmix; + double dlng, lng, lng0, lng0m, lng1, lng1m; + double dlat, lat, lat0, lat0m, lat1, lat1m; + double d, d0, d0m, d1, d1m, dx = 0.0; + double dabs, dmin, lmin; + double dphi, phi0, phi1; + struct celprm *wcscel = &(wcs->cel); + struct wcsprm wcs0; + struct wcserr **err; + + /* Initialize if required. */ + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + worldlng = world + wcs->lng; + worldlat = world + wcs->lat; + + + /* Check vspan. */ + if (vspan[0] <= vspan[1]) { + span[0] = vspan[0]; + span[1] = vspan[1]; + } else { + /* Swap them. */ + span[0] = vspan[1]; + span[1] = vspan[0]; + } + + /* Check vstep. */ + step = fabs(vstep); + if (step == 0.0) { + step = (span[1] - span[0])/10.0; + if (step > 1.0 || step == 0.0) step = 1.0; + } + + /* Check viter. */ + nstep = viter; + if (nstep < 5) { + nstep = 5; + } else if (nstep > 10) { + nstep = 10; + } + + /* Given pixel element. */ + pixmix = pixcrd[mixpix]; + + /* Iterate on the step size. */ + for (istep = 0; istep <= nstep; istep++) { + if (istep) step /= 2.0; + + /* Iterate on the sky coordinate between the specified range. */ + if (mixcel == 1) { + /* Celestial longitude is given. */ + + /* Check whether the solution interval is a crossing interval. */ + lat0 = span[0]; + *worldlat = lat0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = pixcrd[mixpix] - pixmix; + + dabs = fabs(d0); + if (dabs < tol) return 0; + + lat1 = span[1]; + *worldlat = lat1; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1 = pixcrd[mixpix] - pixmix; + + dabs = fabs(d1); + if (dabs < tol) return 0; + + lmin = lat1; + dmin = dabs; + + /* Check for a crossing point. */ + if (signbit(d0) != signbit(d1)) { + crossed = 1; + dx = d1; + } else { + crossed = 0; + lat0 = span[1]; + } + + for (retry = 0; retry < 4; retry++) { + /* Refine the solution interval. */ + while (lat0 > span[0]) { + lat0 -= step; + if (lat0 < span[0]) lat0 = span[0]; + *worldlat = lat0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = pixcrd[mixpix] - pixmix; + + /* Check for a solution. */ + dabs = fabs(d0); + if (dabs < tol) return 0; + + /* Record the point of closest approach. */ + if (dabs < dmin) { + lmin = lat0; + dmin = dabs; + } + + /* Check for a crossing point. */ + if (signbit(d0) != signbit(d1)) { + crossed = 2; + dx = d0; + break; + } + + /* Advance to the next subinterval. */ + lat1 = lat0; + d1 = d0; + } + + if (crossed) { + /* A crossing point was found. */ + for (iter = 0; iter < niter; iter++) { + /* Use regula falsi division of the interval. */ + lambda = d0/(d0-d1); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + + dlat = lat1 - lat0; + lat = lat0 + lambda*dlat; + *worldlat = lat; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + + /* Check for a solution. */ + d = pixcrd[mixpix] - pixmix; + dabs = fabs(d); + if (dabs < tol) return 0; + + if (dlat < tol) { + /* An artifact of numerical imprecision. */ + if (dabs < tol2) return 0; + + /* Must be a discontinuity. */ + break; + } + + /* Record the point of closest approach. */ + if (dabs < dmin) { + lmin = lat; + dmin = dabs; + } + + if (signbit(d0) == signbit(d)) { + lat0 = lat; + d0 = d; + } else { + lat1 = lat; + d1 = d; + } + } + + /* No convergence, must have been a discontinuity. */ + if (crossed == 1) lat0 = span[1]; + lat1 = lat0; + d1 = dx; + crossed = 0; + + } else { + /* No crossing point; look for a tangent point. */ + if (lmin == span[0]) break; + if (lmin == span[1]) break; + + lat = lmin; + lat0 = lat - step; + if (lat0 < span[0]) lat0 = span[0]; + lat1 = lat + step; + if (lat1 > span[1]) lat1 = span[1]; + + *worldlat = lat0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = fabs(pixcrd[mixpix] - pixmix); + + d = dmin; + + *worldlat = lat1; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1 = fabs(pixcrd[mixpix] - pixmix); + + for (iter = 0; iter < niter; iter++) { + lat0m = (lat0 + lat)/2.0; + *worldlat = lat0m; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0m = fabs(pixcrd[mixpix] - pixmix); + + if (d0m < tol) return 0; + + lat1m = (lat1 + lat)/2.0; + *worldlat = lat1m; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1m = fabs(pixcrd[mixpix] - pixmix); + + if (d1m < tol) return 0; + + if (d0m < d && d0m <= d1m) { + lat1 = lat; + d1 = d; + lat = lat0m; + d = d0m; + } else if (d1m < d) { + lat0 = lat; + d0 = d; + lat = lat1m; + d = d1m; + } else { + lat0 = lat0m; + d0 = d0m; + lat1 = lat1m; + d1 = d1m; + } + } + } + } + + } else { + /* Celestial latitude is given. */ + + /* Check whether the solution interval is a crossing interval. */ + lng0 = span[0]; + *worldlng = lng0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = pixcrd[mixpix] - pixmix; + + dabs = fabs(d0); + if (dabs < tol) return 0; + + lng1 = span[1]; + *worldlng = lng1; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1 = pixcrd[mixpix] - pixmix; + + dabs = fabs(d1); + if (dabs < tol) return 0; + lmin = lng1; + dmin = dabs; + + /* Check for a crossing point. */ + if (signbit(d0) != signbit(d1)) { + crossed = 1; + dx = d1; + } else { + crossed = 0; + lng0 = span[1]; + } + + for (retry = 0; retry < 4; retry++) { + /* Refine the solution interval. */ + while (lng0 > span[0]) { + lng0 -= step; + if (lng0 < span[0]) lng0 = span[0]; + *worldlng = lng0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = pixcrd[mixpix] - pixmix; + + /* Check for a solution. */ + dabs = fabs(d0); + if (dabs < tol) return 0; + + /* Record the point of closest approach. */ + if (dabs < dmin) { + lmin = lng0; + dmin = dabs; + } + + /* Check for a crossing point. */ + if (signbit(d0) != signbit(d1)) { + crossed = 2; + dx = d0; + break; + } + + /* Advance to the next subinterval. */ + lng1 = lng0; + d1 = d0; + } + + if (crossed) { + /* A crossing point was found. */ + for (iter = 0; iter < niter; iter++) { + /* Use regula falsi division of the interval. */ + lambda = d0/(d0-d1); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + + dlng = lng1 - lng0; + lng = lng0 + lambda*dlng; + *worldlng = lng; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + + /* Check for a solution. */ + d = pixcrd[mixpix] - pixmix; + dabs = fabs(d); + if (dabs < tol) return 0; + + if (dlng < tol) { + /* An artifact of numerical imprecision. */ + if (dabs < tol2) return 0; + + /* Must be a discontinuity. */ + break; + } + + /* Record the point of closest approach. */ + if (dabs < dmin) { + lmin = lng; + dmin = dabs; + } + + if (signbit(d0) == signbit(d)) { + lng0 = lng; + d0 = d; + } else { + lng1 = lng; + d1 = d; + } + } + + /* No convergence, must have been a discontinuity. */ + if (crossed == 1) lng0 = span[1]; + lng1 = lng0; + d1 = dx; + crossed = 0; + + } else { + /* No crossing point; look for a tangent point. */ + if (lmin == span[0]) break; + if (lmin == span[1]) break; + + lng = lmin; + lng0 = lng - step; + if (lng0 < span[0]) lng0 = span[0]; + lng1 = lng + step; + if (lng1 > span[1]) lng1 = span[1]; + + *worldlng = lng0; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = fabs(pixcrd[mixpix] - pixmix); + + d = dmin; + + *worldlng = lng1; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1 = fabs(pixcrd[mixpix] - pixmix); + + for (iter = 0; iter < niter; iter++) { + lng0m = (lng0 + lng)/2.0; + *worldlng = lng0m; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0m = fabs(pixcrd[mixpix] - pixmix); + + if (d0m < tol) return 0; + + lng1m = (lng1 + lng)/2.0; + *worldlng = lng1m; + if ((status = wcss2p(wcs, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1m = fabs(pixcrd[mixpix] - pixmix); + + if (d1m < tol) return 0; + + if (d0m < d && d0m <= d1m) { + lng1 = lng; + d1 = d; + lng = lng0m; + d = d0m; + } else if (d1m < d) { + lng0 = lng; + d0 = d; + lng = lng1m; + d = d1m; + } else { + lng0 = lng0m; + d0 = d0m; + lng1 = lng1m; + d1 = d1m; + } + } + } + } + } + } + + + /* Set cel0 to the unity transformation. */ + wcs0 = *wcs; + wcs0.cel.euler[0] = -90.0; + wcs0.cel.euler[1] = 0.0; + wcs0.cel.euler[2] = 90.0; + wcs0.cel.euler[3] = 1.0; + wcs0.cel.euler[4] = 0.0; + + /* No convergence, check for aberrant behaviour at a native pole. */ + *theta = -90.0; + for (j = 1; j <= 2; j++) { + /* Could the celestial coordinate element map to a native pole? */ + *phi = 0.0; + *theta = -*theta; + sphx2s(wcscel->euler, 1, 1, 1, 1, phi, theta, &lng, &lat); + + if (mixcel == 1) { + if (fabs(fmod(*worldlng-lng, 360.0)) > tol) continue; + if (lat < span[0]) continue; + if (lat > span[1]) continue; + *worldlat = lat; + } else { + if (fabs(*worldlat-lat) > tol) continue; + if (lng < span[0]) lng += 360.0; + if (lng > span[1]) lng -= 360.0; + if (lng < span[0]) continue; + if (lng > span[1]) continue; + *worldlng = lng; + } + + /* Is there a solution for the given pixel coordinate element? */ + lng = *worldlng; + lat = *worldlat; + + /* Feed native coordinates to wcss2p() with cel0 set to unity. */ + *worldlng = -180.0; + *worldlat = *theta; + if ((status = wcss2p(&wcs0, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (wcs->err) free(wcs->err); + wcs->err = wcs0.err; + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d0 = pixcrd[mixpix] - pixmix; + + /* Check for a solution. */ + if (fabs(d0) < tol) { + /* Recall saved world coordinates. */ + *worldlng = lng; + *worldlat = lat; + return 0; + } + + /* Search for a crossing interval. */ + phi0 = -180.0; + for (k = -179; k <= 180; k++) { + phi1 = (double) k; + *worldlng = phi1; + if ((status = wcss2p(&wcs0, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (wcs->err) free(wcs->err); + wcs->err = wcs0.err; + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + d1 = pixcrd[mixpix] - pixmix; + + /* Check for a solution. */ + dabs = fabs(d1); + if (dabs < tol) { + /* Recall saved world coordinates. */ + *worldlng = lng; + *worldlat = lat; + return 0; + } + + /* Is it a crossing interval? */ + if (signbit(d0) != signbit(d1)) break; + + phi0 = phi1; + d0 = d1; + } + + for (iter = 1; iter <= niter; iter++) { + /* Use regula falsi division of the interval. */ + lambda = d0/(d0-d1); + if (lambda < 0.1) { + lambda = 0.1; + } else if (lambda > 0.9) { + lambda = 0.9; + } + + dphi = phi1 - phi0; + *worldlng = phi0 + lambda*dphi; + if ((status = wcss2p(&wcs0, 1, 0, world, phi, theta, imgcrd, pixcrd, + stat))) { + if (wcs->err) free(wcs->err); + wcs->err = wcs0.err; + if (status == WCSERR_BAD_WORLD) { + status = wcserr_set(WCS_ERRMSG(WCSERR_BAD_WORLD_COORD)); + } + return status; + } + + /* Check for a solution. */ + d = pixcrd[mixpix] - pixmix; + dabs = fabs(d); + if (dabs < tol || (dphi < tol && dabs < tol2)) { + /* Recall saved world coordinates. */ + *worldlng = lng; + *worldlat = lat; + return 0; + } + + if (signbit(d0) == signbit(d)) { + phi0 = *worldlng; + d0 = d; + } else { + phi1 = *worldlng; + d1 = d; + } + } + } + + + /* No solution. */ + return wcserr_set(WCS_ERRMSG(WCSERR_NO_SOLUTION)); +} + +/*--------------------------------------------------------------------------*/ + +int wcssptr( + struct wcsprm *wcs, + int *i, + char ctype[9]) + +{ + static const char *function = "wcssptr"; + + int j, status; + double cdelt, crval; + struct wcserr **err; + + /* Initialize if required. */ + if (wcs == 0x0) return WCSERR_NULL_POINTER; + err = &(wcs->err); + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + if ((j = *i) < 0) { + if ((j = wcs->spec) < 0) { + /* Look for a linear spectral axis. */ + for (j = 0; j < wcs->naxis; j++) { + if (wcs->types[j]/100 == 30) { + break; + } + } + + if (j >= wcs->naxis) { + /* No spectral axis. */ + return wcserr_set(WCSERR_SET(WCSERR_BAD_SUBIMAGE), + "No spectral axis found."); + } + } + + *i = j; + } + + /* Translate the spectral axis. */ + if ((status = spctrne(wcs->ctype[j], wcs->crval[j], wcs->cdelt[j], + wcs->restfrq, wcs->restwav, ctype, &crval, &cdelt, + &(wcs->spc.err)))) { + return wcserr_set(WCS_ERRMSG(wcs_spcerr[status])); + } + + + /* Translate keyvalues. */ + wcs->flag = 0; + wcs->cdelt[j] = cdelt; + wcs->crval[j] = crval; + spctyp(ctype, 0x0, 0x0, 0x0, wcs->cunit[j], 0x0, 0x0, 0x0); + strcpy(wcs->ctype[j], ctype); + + /* This keeps things tidy if the spectral axis is linear. */ + spcfree(&(wcs->spc)); + spcini(&(wcs->spc)); + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +#define STRINGIZE(s) STRINGIFY(s) +#define STRINGIFY(s) #s + +const char *wcslib_version( + int vers[3]) + +{ + static const char *wcsver = STRINGIZE(WCSLIB_VERSION); + + if (vers != 0x0) { + vers[2] = 0; + sscanf(wcsver, "%d.%d.%d", vers, vers+1, vers+2); + } + + return wcsver; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcs.h b/testbed/astropy__astropy/cextern/wcslib/C/wcs.h new file mode 100644 index 0000000000000000000000000000000000000000..5ef99d087777e3cc3e0abc84e01a3342aa5d9cc9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcs.h @@ -0,0 +1,1918 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcs.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcs routines +* --------------------------- +* Routines in this suite implement the FITS World Coordinate System (WCS) +* standard which defines methods to be used for computing world coordinates +* from image pixel coordinates, and vice versa. The standard, and proposed +* extensions for handling distortions, are described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) += += "Representations of distortions in FITS world coordinate systems", += Calabretta, M.R. et al. (WCS Paper IV, draft dated 2004/04/22), += available from http://www.atnf.csiro.au/people/Mark.Calabretta += += "Mapping on the HEALPix grid", += Calabretta, M.R., & Roukema, B.F. 2007, MNRAS, 381, 865 (WCS Paper V) += += "Representing the 'Butterfly' Projection in FITS -- Projection Code XPH", += Calabretta, M.R., & Lowe, S.R. 2013, PASA, 30, e050 (WCS Paper VI) += += "Representations of time coordinates in FITS - += Time and relative dimension in space", += Rots, A.H., Bunclark, P.S., Calabretta, M.R., Allen, S.L., += Manchester, R.N., & Thompson, W.T. 2015, A&A, 574, A36 (WCS Paper VII) +* +* These routines are based on the wcsprm struct which contains all information +* needed for the computations. The struct contains some members that must be +* set by the user, and others that are maintained by these routines, somewhat +* like a C++ class but with no encapsulation. +* +* wcsnpv(), wcsnps(), wcsini(), wcsinit(), wcssub(), and wcsfree() are +* provided to manage the wcsprm struct and another, wcsprt(), prints its +* contents. Refer to the description of the wcsprm struct for an explanation +* of the anticipated usage of these routines. wcscopy(), which does a deep +* copy of one wcsprm struct to another, is defined as a preprocessor macro +* function that invokes wcssub(). +* +* wcsperr() prints the error message(s) (if any) stored in a wcsprm struct, +* and the linprm, celprm, prjprm, spcprm, and tabprm structs that it contains. +* +* A setup routine, wcsset(), computes intermediate values in the wcsprm struct +* from parameters in it that were supplied by the user. The struct always +* needs to be set up by wcsset() but this need not be called explicitly - +* refer to the explanation of wcsprm::flag. +* +* wcsp2s() and wcss2p() implement the WCS world coordinate transformations. +* In fact, they are high level driver routines for the WCS linear, +* logarithmic, celestial, spectral and tabular transformation routines +* described in lin.h, log.h, cel.h, spc.h and tab.h. +* +* Given either the celestial longitude or latitude plus an element of the +* pixel coordinate a hybrid routine, wcsmix(), iteratively solves for the +* unknown elements. +* +* wcssptr() translates the spectral axis in a wcsprm struct. For example, a +* 'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa. +* +* wcslib_version() returns the WCSLIB version number. +* +* Quadcube projections: +* --------------------- +* The quadcube projections (TSC, CSC, QSC) may be represented in FITS in +* either of two ways: +* +* a: The six faces may be laid out in one plane and numbered as follows: +* += 0 += += 4 3 2 1 4 3 2 += += 5 +* +* Faces 2, 3 and 4 may appear on one side or the other (or both). The +* world-to-pixel routines map faces 2, 3 and 4 to the left but the +* pixel-to-world routines accept them on either side. +* +* b: The "COBE" convention in which the six faces are stored in a +* three-dimensional structure using a CUBEFACE axis indexed from +* 0 to 5 as above. +* +* These routines support both methods; wcsset() determines which is being +* used by the presence or absence of a CUBEFACE axis in ctype[]. wcsp2s() +* and wcss2p() translate the CUBEFACE axis representation to the single +* plane representation understood by the lower-level WCSLIB projection +* routines. +* +* +* wcsnpv() - Memory allocation for PVi_ma +* --------------------------------------- +* wcsnpv() sets or gets the value of NPVMAX (default 64). This global +* variable controls the number of pvcard structs, for holding PVi_ma +* keyvalues, that wcsini() should allocate space for. It is also used by +* wcsinit() as the default value of npvmax. +* +* PLEASE NOTE: This function is not thread-safe. +* +* Given: +* n int Value of NPVMAX; ignored if < 0. Use a value less +* than zero to get the current value. +* +* Function return value: +* int Current value of NPVMAX. +* +* +* wcsnps() - Memory allocation for PSi_ma +* --------------------------------------- +* wcsnps() sets or gets the value of NPSMAX (default 8). This global variable +* controls the number of pscard structs, for holding PSi_ma keyvalues, that +* wcsini() should allocate space for. It is also used by wcsinit() as the +* default value of npsmax. +* +* PLEASE NOTE: This function is not thread-safe. +* +* Given: +* n int Value of NPSMAX; ignored if < 0. Use a value less +* than zero to get the current value. +* +* Function return value: +* int Current value of NPSMAX. +* +* +* wcsini() - Default constructor for the wcsprm struct +* ---------------------------------------------------- +* wcsini() is a thin wrapper on wcsinit(). It invokes it with npvmax, +* npsmax, and ndpmax set to -1 which causes it to use the values of the +* global variables NDPMAX, NPSMAX, and NDPMAX. It is thereby potentially +* thread-unsafe if these variables are altered dynamically via wcsnpv(), +* wcsnps(), and disndp(). Use wcsinit() for a thread-safe alternative in +* this case. +* +* +* wcsinit() - Default constructor for the wcsprm struct +* ----------------------------------------------------- +* wcsinit() optionally allocates memory for arrays in a wcsprm struct and sets +* all members of the struct to default values. +* +* PLEASE NOTE: every wcsprm struct should be initialized by wcsinit(), +* possibly repeatedly. On the first invokation, and only the first +* invokation, wcsprm::flag must be set to -1 to initialize memory management, +* regardless of whether wcsinit() will actually be used to allocate memory. +* +* Given: +* alloc int If true, allocate memory unconditionally for the +* crpix, etc. arrays. +* +* If false, it is assumed that pointers to these arrays +* have been set by the user except if they are null +* pointers in which case memory will be allocated for +* them regardless. (In other words, setting alloc true +* saves having to initalize these pointers to zero.) +* +* naxis int The number of world coordinate axes. This is used to +* determine the length of the various wcsprm vectors and +* matrices and therefore the amount of memory to +* allocate for them. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Note that, in order to initialize memory management, +* wcsprm::flag should be set to -1 when wcs is +* initialized for the first time (memory leaks may +* result if it had already been initialized). +* +* Given: +* npvmax int The number of PVi_ma keywords to allocate space for. +* If set to -1, the value of the global variable NPVMAX +* will be used. This is potentially thread-unsafe if +* wcsnpv() is being used dynamically to alter its value. +* +* npsmax int The number of PSi_ma keywords to allocate space for. +* If set to -1, the value of the global variable NPSMAX +* will be used. This is potentially thread-unsafe if +* wcsnps() is being used dynamically to alter its value. +* +* ndpmax int The number of DPja or DQia keywords to allocate space +* for. If set to -1, the value of the global variable +* NDPMAX will be used. This is potentially +* thread-unsafe if disndp() is being used dynamically to +* alter its value. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* wcssub() - Subimage extraction routine for the wcsprm struct +* ------------------------------------------------------------ +* wcssub() extracts the coordinate description for a subimage from a wcsprm +* struct. It does a deep copy, using wcsinit() to allocate memory for its +* arrays if required. Only the "information to be provided" part of the +* struct is extracted. Consequently, wcsset() need not have been, and won't +* be invoked on the struct from which the subimage is extracted. A call to +* wcsset() is required to set up the subimage struct. +* +* The world coordinate system of the subimage must be separable in the sense +* that the world coordinates at any point in the subimage must depend only on +* the pixel coordinates of the axes extracted. In practice, this means that +* the linear transformation matrix of the original image must not contain +* non-zero off-diagonal terms that associate any of the subimage axes with any +* of the non-subimage axes. Likewise, if any distortions are associated with +* the subimage axes, they must not depend on any of the axes that are not +* being extracted. +* +* Note that while the required elements of the tabprm array are extracted, the +* wtbarr array is not. (Thus it is not appropriate to call wcssub() after +* wcstab() but before filling the tabprm structs - refer to wcshdr.h.) +* +* wcssub() can also add axes to a wcsprm struct. The new axes will be created +* using the defaults set by wcsinit() which produce a simple, unnamed, linear +* axis with world coordinate equal to the pixel coordinate. These default +* values can be changed afterwards, before invoking wcsset(). +* +* Given: +* alloc int If true, allocate memory for the crpix, etc. arrays in +* the destination. Otherwise, it is assumed that +* pointers to these arrays have been set by the user +* except if they are null pointers in which case memory +* will be allocated for them regardless. +* +* wcssrc const struct wcsprm* +* Struct to extract from. +* +* Given and returned: +* nsub int* +* axes int[] Vector of length *nsub containing the image axis +* numbers (1-relative) to extract. Order is +* significant; axes[0] is the axis number of the input +* image that corresponds to the first axis in the +* subimage, etc. +* +* Use an axis number of 0 to create a new axis using +* the defaults set by wcsinit(). They can be changed +* later. +* +* nsub (the pointer) may be set to zero, and so also may +* *nsub, which is interpreted to mean all axes in the +* input image; the number of axes will be returned if +* nsub != 0x0. axes itself (the pointer) may be set to +* zero to indicate the first *nsub axes in their +* original order. +* +* Set both nsub (or *nsub) and axes to zero to do a deep +* copy of one wcsprm struct to another. +* +* Subimage extraction by coordinate axis type may be +* done by setting the elements of axes[] to the +* following special preprocessor macro values: +* +* WCSSUB_LONGITUDE: Celestial longitude. +* WCSSUB_LATITUDE: Celestial latitude. +* WCSSUB_CUBEFACE: Quadcube CUBEFACE axis. +* WCSSUB_SPECTRAL: Spectral axis. +* WCSSUB_STOKES: Stokes axis. +* +* Refer to the notes (below) for further usage examples. +* +* On return, *nsub will be set to the number of axes in +* the subimage; this may be zero if there were no axes +* of the required type(s) (in which case no memory will +* be allocated). axes[] will contain the axis numbers +* that were extracted, or 0 for newly created axes. The +* vector length must be sufficient to contain all axis +* numbers. No checks are performed to verify that the +* coordinate axes are consistent, this is done by +* wcsset(). +* +* wcsdst struct wcsprm* +* Struct describing the subimage. wcsprm::flag should +* be set to -1 if wcsdst was not previously initialized +* (memory leaks may result if it was previously +* initialized). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 12: Invalid subimage specification. +* 13: Non-separable subimage coordinate system. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* Combinations of subimage axes of particular types may be extracted in the +* same order as they occur in the input image by combining preprocessor +* codes, for example +* += *nsub = 1; += axes[0] = WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_SPECTRAL; +* +* would extract the longitude, latitude, and spectral axes in the same order +* as the input image. If one of each were present, *nsub = 3 would be +* returned. +* +* For convenience, WCSSUB_CELESTIAL is defined as the combination +* WCSSUB_LONGITUDE | WCSSUB_LATITUDE | WCSSUB_CUBEFACE. +* +* The codes may also be negated to extract all but the types specified, for +* example +* += *nsub = 4; += axes[0] = WCSSUB_LONGITUDE; += axes[1] = WCSSUB_LATITUDE; += axes[2] = WCSSUB_CUBEFACE; += axes[3] = -(WCSSUB_SPECTRAL | WCSSUB_STOKES); +* +* The last of these specifies all axis types other than spectral or Stokes. +* Extraction is done in the order specified by axes[] a longitude axis (if +* present) would be extracted first (via axes[0]) and not subsequently (via +* axes[3]). Likewise for the latitude and cubeface axes in this example. +* +* From the foregoing, it is apparent that the value of *nsub returned may be +* less than or greater than that given. However, it will never exceed the +* number of axes in the input image (plus the number of newly-created axes +* if any were specified on input). +* +* +* wcscompare() - Compare two wcsprm structs for equality +* ------------------------------------------------------ +* wcscompare() compares two wcsprm structs for equality. +* +* Given: +* cmp int A bit field controlling the strictness of the +* comparison. When 0, all fields must be identical. +* +* The following constants may be or'ed together to +* relax the comparison: +* WCSCOMPARE_ANCILLARY: Ignore ancillary keywords +* that don't change the WCS transformation, such +* as DATE-OBS or EQUINOX. +* WCSCOMPARE_TILING: Ignore integral differences in +* CRPIXja. This is the 'tiling' condition, where +* two WCSes cover different regions of the same +* map projection and align on the same map grid. +* WCSCOMPARE_CRPIX: Ignore any differences at all in +* CRPIXja. The two WCSes cover different regions +* of the same map projection but may not align on +* the same grid map. Overrides WCSCOMPARE_TILING. +* +* tol double Tolerance for comparison of floating-point values. +* For example, for tol == 1e-6, all floating-point +* values in the structs must be equal to the first 6 +* decimal places. A value of 0 implies exact equality. +* +* wcs1 const struct wcsprm* +* The first wcsprm struct to compare. +* +* wcs2 const struct wcsprm* +* The second wcsprm struct to compare. +* +* Returned: +* equal int* Non-zero when the given structs are equal. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null pointer passed. +* +* +* wcscopy() macro - Copy routine for the wcsprm struct +* ---------------------------------------------------- +* wcscopy() does a deep copy of one wcsprm struct to another. As of +* WCSLIB 3.6, it is implemented as a preprocessor macro that invokes +* wcssub() with the nsub and axes pointers both set to zero. +* +* +* wcsfree() - Destructor for the wcsprm struct +* -------------------------------------------- +* wcsfree() frees memory allocated for the wcsprm arrays by wcsinit() and/or +* wcsset(). wcsinit() records the memory it allocates and wcsfree() will only +* attempt to free this. +* +* PLEASE NOTE: wcsfree() must not be invoked on a wcsprm struct that was not +* initialized by wcsinit(). +* +* Returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsprt() - Print routine for the wcsprm struct +* ---------------------------------------------- +* wcsprt() prints the contents of a wcsprm struct using wcsprintf(). Mainly +* intended for diagnostic purposes. +* +* Given: +* wcs const struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsperr() - Print error messages from a wcsprm struct +* ----------------------------------------------------- +* wcsperr() prints the error message(s), if any, stored in a wcsprm struct, +* and the linprm, celprm, prjprm, spcprm, and tabprm structs that it contains. +* If there are no errors then nothing is printed. It uses wcserr_prt(), q.v. +* +* Given: +* wcs const struct wcsprm* +* Coordinate transformation parameters. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsbchk() - Enable/disable bounds checking +* ------------------------------------------ +* wcsbchk() is used to control bounds checking in the projection routines. +* Note that wcsset() always enables bounds checking. wcsbchk() will invoke +* wcsset() on the wcsprm struct beforehand if necessary. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Given: +* bounds int If bounds&1 then enable strict bounds checking for the +* spherical-to-Cartesian (s2x) transformation for the +* AZP, SZP, TAN, SIN, ZPN, and COP projections. +* +* If bounds&2 then enable strict bounds checking for the +* Cartesian-to-spherical (x2s) transformation for the +* HPX and XPH projections. +* +* If bounds&4 then enable bounds checking on the native +* coordinates returned by the Cartesian-to-spherical +* (x2s) transformations using prjchk(). +* +* Zero it to disable all checking. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsset() - Setup routine for the wcsprm struct +* ---------------------------------------------- +* wcsset() sets up a wcsprm struct according to information supplied within +* it (refer to the description of the wcsprm struct). +* +* wcsset() recognizes the NCP projection and converts it to the equivalent SIN +* projection and likewise translates GLS into SFL. It also translates the +* AIPS spectral types ('FREQ-LSR', 'FELO-HEL', etc.), possibly changing the +* input header keywords wcsprm::ctype and/or wcsprm::specsys if necessary. +* +* Note that this routine need not be called directly; it will be invoked by +* wcsp2s() and wcss2p() if the wcsprm::flag is anything other than a +* predefined magic value. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* wcsset() always enables strict bounds checking in the projection routines +* (via a call to prjini()). Use wcsbchk() to modify bounds-checking after +* wcsset() is invoked. +* +* +* wcsp2s() - Pixel-to-world transformation +* ---------------------------------------- +* wcsp2s() transforms pixel coordinates to world coordinates. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length +* nelem but containing wcs.naxis coordinate elements. +* Thus nelem must equal or exceed the value of the +* NAXIS keyword unless ncoord == 1, in which case nelem +* is not used. +* +* pixcrd const double[ncoord][nelem] +* Array of pixel coordinates. +* +* Returned: +* imgcrd double[ncoord][nelem] +* Array of intermediate world coordinates. For +* celestial axes, imgcrd[][wcs.lng] and +* imgcrd[][wcs.lat] are the projected x-, and +* y-coordinates in pseudo "degrees". For spectral +* axes, imgcrd[][wcs.spec] is the intermediate spectral +* coordinate, in SI units. +* +* phi,theta double[ncoord] +* Longitude and latitude in the native coordinate system +* of the projection [deg]. +* +* world double[ncoord][nelem] +* Array of world coordinates. For celestial axes, +* world[][wcs.lng] and world[][wcs.lat] are the +* celestial longitude and latitude [deg]. For +* spectral axes, imgcrd[][wcs.spec] is the intermediate +* spectral coordinate, in SI units. +* +* stat int[ncoord] +* Status return value for each coordinate: +* 0: Success. +* 1+: A bit mask indicating invalid pixel coordinate +* element(s). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* 8: One or more of the pixel coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* wcss2p() - World-to-pixel transformation +* ---------------------------------------- +* wcss2p() transforms world coordinates to pixel coordinates. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Given: +* ncoord, +* nelem int The number of coordinates, each of vector length nelem +* but containing wcs.naxis coordinate elements. Thus +* nelem must equal or exceed the value of the NAXIS +* keyword unless ncoord == 1, in which case nelem is not +* used. +* +* world const double[ncoord][nelem] +* Array of world coordinates. For celestial axes, +* world[][wcs.lng] and world[][wcs.lat] are the +* celestial longitude and latitude [deg]. For spectral +* axes, world[][wcs.spec] is the spectral coordinate, in +* SI units. +* +* Returned: +* phi,theta double[ncoord] +* Longitude and latitude in the native coordinate +* system of the projection [deg]. +* +* imgcrd double[ncoord][nelem] +* Array of intermediate world coordinates. For +* celestial axes, imgcrd[][wcs.lng] and +* imgcrd[][wcs.lat] are the projected x-, and +* y-coordinates in pseudo "degrees". For quadcube +* projections with a CUBEFACE axis the face number is +* also returned in imgcrd[][wcs.cubeface]. For +* spectral axes, imgcrd[][wcs.spec] is the intermediate +* spectral coordinate, in SI units. +* +* pixcrd double[ncoord][nelem] +* Array of pixel coordinates. +* +* stat int[ncoord] +* Status return value for each coordinate: +* 0: Success. +* 1+: A bit mask indicating invalid world coordinate +* element(s). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* 9: One or more of the world coordinates were +* invalid, as indicated by the stat vector. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* wcsmix() - Hybrid coordinate transformation +* ------------------------------------------- +* wcsmix(), given either the celestial longitude or latitude plus an element +* of the pixel coordinate, solves for the remaining elements by iterating on +* the unknown celestial coordinate element using wcss2p(). Refer also to the +* notes below. +* +* Given and returned: +* wcs struct wcsprm* +* Indices for the celestial coordinates obtained +* by parsing the wcsprm::ctype[]. +* +* Given: +* mixpix int Which element of the pixel coordinate is given. +* +* mixcel int Which element of the celestial coordinate is given: +* 1: Celestial longitude is given in +* world[wcs.lng], latitude returned in +* world[wcs.lat]. +* 2: Celestial latitude is given in +* world[wcs.lat], longitude returned in +* world[wcs.lng]. +* +* vspan const double[2] +* Solution interval for the celestial coordinate [deg]. +* The ordering of the two limits is irrelevant. +* Longitude ranges may be specified with any convenient +* normalization, for example [-120,+120] is the same as +* [240,480], except that the solution will be returned +* with the same normalization, i.e. lie within the +* interval specified. +* +* vstep const double +* Step size for solution search [deg]. If zero, a +* sensible, although perhaps non-optimal default will be +* used. +* +* viter int If a solution is not found then the step size will be +* halved and the search recommenced. viter controls how +* many times the step size is halved. The allowed range +* is 5 - 10. +* +* Given and returned: +* world double[naxis] +* World coordinate elements. world[wcs.lng] and +* world[wcs.lat] are the celestial longitude and +* latitude [deg]. Which is given and which returned +* depends on the value of mixcel. All other elements +* are given. +* +* Returned: +* phi,theta double[naxis] +* Longitude and latitude in the native coordinate +* system of the projection [deg]. +* +* imgcrd double[naxis] +* Image coordinate elements. imgcrd[wcs.lng] and +* imgcrd[wcs.lat] are the projected x-, and +* y-coordinates in pseudo "degrees". +* +* Given and returned: +* pixcrd double[naxis] +* Pixel coordinate. The element indicated by mixpix is +* given and the remaining elements are returned. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* 10: Invalid world coordinate. +* 11: No solution found in the specified interval. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* Initially the specified solution interval is checked to see if it's a +* "crossing" interval. If it isn't, a search is made for a crossing +* solution by iterating on the unknown celestial coordinate starting at the +* upper limit of the solution interval and decrementing by the specified +* step size. A crossing is indicated if the trial value of the pixel +* coordinate steps through the value specified. If a crossing interval is +* found then the solution is determined by a modified form of "regula falsi" +* division of the crossing interval. If no crossing interval was found +* within the specified solution interval then a search is made for a +* "non-crossing" solution as may arise from a point of tangency. The +* process is complicated by having to make allowance for the discontinuities +* that occur in all map projections. +* +* Once one solution has been determined others may be found by subsequent +* invokations of wcsmix() with suitably restricted solution intervals. +* +* Note the circumstance that arises when the solution point lies at a native +* pole of a projection in which the pole is represented as a finite curve, +* for example the zenithals and conics. In such cases two or more valid +* solutions may exist but wcsmix() only ever returns one. +* +* Because of its generality wcsmix() is very compute-intensive. For +* compute-limited applications more efficient special-case solvers could be +* written for simple projections, for example non-oblique cylindrical +* projections. +* +* +* wcssptr() - Spectral axis translation +* ------------------------------------- +* wcssptr() translates the spectral axis in a wcsprm struct. For example, a +* 'FREQ' axis may be translated into 'ZOPT-F2W' and vice versa. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* i int* Index of the spectral axis (0-relative). If given < 0 +* it will be set to the first spectral axis identified +* from the ctype[] keyvalues in the wcsprm struct. +* +* ctype char[9] Desired spectral CTYPEia. Wildcarding may be used as +* for the ctypeS2 argument to spctrn() as described in +* the prologue of spc.h, i.e. if the final three +* characters are specified as "???", or if just the +* eighth character is specified as '?', the correct +* algorithm code will be substituted and returned. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* 12: Invalid subimage specification (no spectral +* axis). +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* wcslib_version() - WCSLIB version number +* ---------------------------------------- +* wcslib_version() returns the WCSLIB version number. +* +* The major version number changes when the ABI changes or when the license +* conditions change. ABI changes typically result from a change to the +* contents of one of the structs. The major version number is used to +* distinguish between incompatible versions of the sharable library. +* +* The minor version number changes with new functionality or bug fixes that do +* not involve a change in the ABI. +* +* The auxiliary version number (which is often absent) signals changes to the +* documentation, test suite, build procedures, or any other change that does +* not affect the compiled library. +* +* Returned: +* vers[3] int[3] The broken-down version number: +* 0: Major version number. +* 1: Minor version number. +* 2: Auxiliary version number (zero if absent). +* May be given as a null pointer if not required. +* +* Function return value: +* char* A null-terminated, statically allocated string +* containing the version number in the usual form, i.e. +* "..". +* +* +* wcsprm struct - Coordinate transformation parameters +* ---------------------------------------------------- +* The wcsprm struct contains information required to transform world +* coordinates. It consists of certain members that must be set by the user +* ("given") and others that are set by the WCSLIB routines ("returned"). +* While the addresses of the arrays themselves may be set by wcsinit() if it +* (optionally) allocates memory, their contents must be set by the user. +* +* Some parameters that are given are not actually required for transforming +* coordinates. These are described as "auxiliary"; the struct simply provides +* a place to store them, though they may be used by wcshdo() in constructing a +* FITS header from a wcsprm struct. Some of the returned values are supplied +* for informational purposes and others are for internal use only as +* indicated. +* +* In practice, it is expected that a WCS parser would scan the FITS header to +* determine the number of coordinate axes. It would then use wcsinit() to +* allocate memory for arrays in the wcsprm struct and set default values. +* Then as it reread the header and identified each WCS keyrecord it would load +* the value into the relevant wcsprm array element. This is essentially what +* wcspih() does - refer to the prologue of wcshdr.h. As the final step, +* wcsset() is invoked, either directly or indirectly, to set the derived +* members of the wcsprm struct. wcsset() strips off trailing blanks in all +* string members and null-fills the character array. +* +* int flag +* (Given and returned) This flag must be set to zero whenever any of the +* following wcsprm struct members are set or changed: +* +* - wcsprm::naxis (q.v., not normally set by the user), +* - wcsprm::crpix, +* - wcsprm::pc, +* - wcsprm::cdelt, +* - wcsprm::crval, +* - wcsprm::cunit, +* - wcsprm::ctype, +* - wcsprm::lonpole, +* - wcsprm::latpole, +* - wcsprm::restfrq, +* - wcsprm::restwav, +* - wcsprm::npv, +* - wcsprm::pv, +* - wcsprm::nps, +* - wcsprm::ps, +* - wcsprm::cd, +* - wcsprm::crota, +* - wcsprm::altlin, +* - wcsprm::ntab, +* - wcsprm::nwtb, +* - wcsprm::tab, +* - wcsprm::wtb. +* +* This signals the initialization routine, wcsset(), to recompute the +* returned members of the celprm struct. celset() will reset flag to +* indicate that this has been done. +* +* PLEASE NOTE: flag should be set to -1 when wcsinit() is called for the +* first time for a particular wcsprm struct in order to initialize memory +* management. It must ONLY be used on the first initialization otherwise +* memory leaks may result. +* +* int naxis +* (Given or returned) Number of pixel and world coordinate elements. +* +* If wcsinit() is used to initialize the linprm struct (as would normally +* be the case) then it will set naxis from the value passed to it as a +* function argument. The user should not subsequently modify it. +* +* double *crpix +* (Given) Address of the first element of an array of double containing +* the coordinate reference pixel, CRPIXja. +* +* double *pc +* (Given) Address of the first element of the PCi_ja (pixel coordinate) +* transformation matrix. The expected order is +* += struct wcsprm wcs; += wcs.pc = {PC1_1, PC1_2, PC2_1, PC2_2}; +* +* This may be constructed conveniently from a 2-D array via +* += double m[2][2] = {{PC1_1, PC1_2}, += {PC2_1, PC2_2}}; +* +* which is equivalent to +* += double m[2][2]; += m[0][0] = PC1_1; += m[0][1] = PC1_2; += m[1][0] = PC2_1; += m[1][1] = PC2_2; +* +* The storage order for this 2-D array is the same as for the 1-D array, +* whence +* += wcs.pc = *m; +* +* would be legitimate. +* +* double *cdelt +* (Given) Address of the first element of an array of double containing +* the coordinate increments, CDELTia. +* +* double *crval +* (Given) Address of the first element of an array of double containing +* the coordinate reference values, CRVALia. +* +* char (*cunit)[72] +* (Given) Address of the first element of an array of char[72] containing +* the CUNITia keyvalues which define the units of measurement of the +* CRVALia, CDELTia, and CDi_ja keywords. +* +* As CUNITia is an optional header keyword, cunit[][72] may be left blank +* but otherwise is expected to contain a standard units specification as +* defined by WCS Paper I. Utility function wcsutrn(), described in +* wcsunits.h, is available to translate commonly used non-standard units +* specifications but this must be done as a separate step before invoking +* wcsset(). +* +* For celestial axes, if cunit[][72] is not blank, wcsset() uses +* wcsunits() to parse it and scale cdelt[], crval[], and cd[][*] to +* degrees. It then resets cunit[][72] to "deg". +* +* For spectral axes, if cunit[][72] is not blank, wcsset() uses wcsunits() +* to parse it and scale cdelt[], crval[], and cd[][*] to SI units. It +* then resets cunit[][72] accordingly. +* +* wcsset() ignores cunit[][72] for other coordinate types; cunit[][72] may +* be used to label coordinate values. +* +* These variables accomodate the longest allowed string-valued FITS +* keyword, being limited to 68 characters, plus the null-terminating +* character. +* +* char (*ctype)[72] +* (Given) Address of the first element of an array of char[72] containing +* the coordinate axis types, CTYPEia. +* +* The ctype[][72] keyword values must be in upper case and there must be +* zero or one pair of matched celestial axis types, and zero or one +* spectral axis. The ctype[][72] strings should be padded with blanks on +* the right and null-terminated so that they are at least eight characters +* in length. +* +* These variables accomodate the longest allowed string-valued FITS +* keyword, being limited to 68 characters, plus the null-terminating +* character. +* +* double lonpole +* (Given and returned) The native longitude of the celestial pole, phi_p, +* given by LONPOLEa [deg] or by PVi_2a [deg] attached to the longitude +* axis which takes precedence if defined, and ... +* double latpole +* (Given and returned) ... the native latitude of the celestial pole, +* theta_p, given by LATPOLEa [deg] or by PVi_3a [deg] attached to the +* longitude axis which takes precedence if defined. +* +* lonpole and latpole may be left to default to values set by wcsinit() +* (see celprm::ref), but in any case they will be reset by wcsset() to +* the values actually used. Note therefore that if the wcsprm struct is +* reused without resetting them, whether directly or via wcsinit(), they +* will no longer have their default values. +* +* double restfrq +* (Given) The rest frequency [Hz], and/or ... +* double restwav +* (Given) ... the rest wavelength in vacuo [m], only one of which need be +* given, the other should be set to zero. +* +* int npv +* (Given) The number of entries in the wcsprm::pv[] array. +* +* int npvmax +* (Given or returned) The length of the wcsprm::pv[] array. +* +* npvmax will be set by wcsinit() if it allocates memory for wcsprm::pv[], +* otherwise it must be set by the user. See also wcsnpv(). +* +* struct pvcard *pv +* (Given) Address of the first element of an array of length npvmax of +* pvcard structs. +* +* As a FITS header parser encounters each PVi_ma keyword it should load it +* into a pvcard struct in the array and increment npv. wcsset() +* interprets these as required. +* +* Note that, if they were not given, wcsset() resets the entries for +* PVi_1a, PVi_2a, PVi_3a, and PVi_4a for longitude axis i to match +* phi_0 and theta_0 (the native longitude and latitude of the reference +* point), LONPOLEa and LATPOLEa respectively. +* +* int nps +* (Given) The number of entries in the wcsprm::ps[] array. +* +* int npsmax +* (Given or returned) The length of the wcsprm::ps[] array. +* +* npsmax will be set by wcsinit() if it allocates memory for wcsprm::ps[], +* otherwise it must be set by the user. See also wcsnps(). +* +* struct pscard *ps +* (Given) Address of the first element of an array of length npsmax of +* pscard structs. +* +* As a FITS header parser encounters each PSi_ma keyword it should load it +* into a pscard struct in the array and increment nps. wcsset() +* interprets these as required (currently no PSi_ma keyvalues are +* recognized). +* +* double *cd +* (Given) For historical compatibility, the wcsprm struct supports two +* alternate specifications of the linear transformation matrix, those +* associated with the CDi_ja keywords, and ... +* double *crota +* (Given) ... those associated with the CROTAi keywords. Although these +* may not formally co-exist with PCi_ja, the approach taken here is simply +* to ignore them if given in conjunction with PCi_ja. +* +* int altlin +* (Given) altlin is a bit flag that denotes which of the PCi_ja, CDi_ja +* and CROTAi keywords are present in the header: +* +* - Bit 0: PCi_ja is present. +* +* - Bit 1: CDi_ja is present. +* +* Matrix elements in the IRAF convention are +* equivalent to the product CDi_ja = CDELTia * PCi_ja, but the +* defaults differ from that of the PCi_ja matrix. If one or more +* CDi_ja keywords are present then all unspecified CDi_ja default to +* zero. If no CDi_ja (or CROTAi) keywords are present, then the +* header is assumed to be in PCi_ja form whether or not any PCi_ja +* keywords are present since this results in an interpretation of +* CDELTia consistent with the original FITS specification. +* +* While CDi_ja may not formally co-exist with PCi_ja, it may co-exist +* with CDELTia and CROTAi which are to be ignored. +* +* - Bit 2: CROTAi is present. +* +* In the AIPS convention, CROTAi may only be +* associated with the latitude axis of a celestial axis pair. It +* specifies a rotation in the image plane that is applied AFTER the +* CDELTia; any other CROTAi keywords are ignored. +* +* CROTAi may not formally co-exist with PCi_ja. +* +* CROTAi and CDELTia may formally co-exist with CDi_ja but if so are to +* be ignored. +* +* CDi_ja and CROTAi keywords, if found, are to be stored in the +* wcsprm::cd and wcsprm::crota arrays which are dimensioned similarly to +* wcsprm::pc and wcsprm::cdelt. FITS +* header parsers should use the following procedure: +* +* - Whenever a PCi_ja keyword is encountered: altlin |= 1; +* +* - Whenever a CDi_ja keyword is encountered: altlin |= 2; +* +* - Whenever a CROTAi keyword is encountered: altlin |= 4; +* +* If none of these bits are set the PCi_ja representation results, i.e. +* wcsprm::pc and wcsprm::cdelt will be used as given. +* +* These alternate specifications of the linear transformation matrix are +* translated immediately to PCi_ja by wcsset() and are invisible to the +* lower-level WCSLIB routines. In particular, wcsset() resets +* wcsprm::cdelt to unity if CDi_ja is present (and no PCi_ja). +* +* If CROTAi are present but none is associated with the latitude axis +* (and no PCi_ja or CDi_ja), then wcsset() reverts to a unity PCi_ja +* matrix. +* +* int velref +* (Given) AIPS velocity code VELREF, refer to spcaips(). +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::velref is changed. +* +* char alt[4] +* (Given, auxiliary) Character code for alternate coordinate descriptions +* (i.e. the 'a' in keyword names such as CTYPEia). This is blank for the +* primary coordinate description, or one of the 26 upper-case letters, +* A-Z. +* +* An array of four characters is provided for alignment purposes, only the +* first is used. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::alt is changed. +* +* int colnum +* (Given, auxiliary) Where the coordinate representation is associated +* with an image-array column in a FITS binary table, this variable may be +* used to record the relevant column number. +* +* It should be set to zero for an image header or pixel list. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::colnum is changed. +* +* int *colax +* (Given, auxiliary) Address of the first element of an array of int +* recording the column numbers for each axis in a pixel list. +* +* The array elements should be set to zero for an image header or image +* array in a binary table. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::colax is changed. +* +* char (*cname)[72] +* (Given, auxiliary) The address of the first element of an array of +* char[72] containing the coordinate axis names, CNAMEia. +* +* These variables accomodate the longest allowed string-valued FITS +* keyword, being limited to 68 characters, plus the null-terminating +* character. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::cname is changed. +* +* double *crder +* (Given, auxiliary) Address of the first element of an array of double +* recording the random error in the coordinate value, CRDERia. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::crder is changed. +* +* double *csyer +* (Given, auxiliary) Address of the first element of an array of double +* recording the systematic error in the coordinate value, CSYERia. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::csyer is changed. +* +* double *czphs +* (Given, auxiliary) Address of the first element of an array of double +* recording the time at the zero point of a phase axis, CZPHSia. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::czphs is changed. +* +* double *cperi +* (Given, auxiliary) Address of the first element of an array of double +* recording the period of a phase axis, CPERIia. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::cperi is changed. +* +* char wcsname[72] +* (Given, auxiliary) The name given to the coordinate representation, +* WCSNAMEa. This variable accomodates the longest allowed string-valued +* FITS keyword, being limited to 68 characters, plus the null-terminating +* character. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::wcsname is changed. +* +* char timesys[72] +* (Given, auxiliary) TIMESYS keyvalue, being the time scale (UTC, TAI, +* etc.) in which all other time-related auxiliary header values are +* recorded. Also defines the time scale for an image axis with CTYPEia +* set to 'TIME'. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timesys is changed. +* +* char trefpos[72] +* (Given, auxiliary) TREFPOS keyvalue, being the location in space where +* the recorded time is valid. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::trefpos is changed. +* +* char trefdir[72] +* (Given, auxiliary) TREFDIR keyvalue, being the reference direction used +* in calculating a pathlength delay. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::trefdir is changed. +* +* char plephem[72] +* (Given, auxiliary) PLEPHEM keyvalue, being the Solar System ephemeris +* used for calculating a pathlength delay. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::plephem is changed. +* +* char timeunit[72] +* (Given, auxiliary) TIMEUNIT keyvalue, being the time units in which +* the following header values are expressed: TSTART, TSTOP, TIMEOFFS, +* TIMSYER, TIMRDER, TIMEDEL. It also provides the default value for +* CUNITia for time axes. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timeunit is changed. +* +* char dateref[72] +* (Given, auxiliary) DATEREF keyvalue, being the date of a reference epoch +* relative to which other time measurements refer. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::dateref is changed. +* +* double mjdref[2] +* (Given, auxiliary) MJDREF keyvalue, equivalent to DATEREF expressed as +* a Modified Julian Date (MJD = JD - 2400000.5). The value is given as +* the sum of the two-element vector, allowing increased precision. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::mjdref is changed. +* +* double timeoffs +* (Given, auxiliary) TIMEOFFS keyvalue, being a time offset, which may be +* used, for example, to provide a uniform clock correction for times +* referenced to DATEREF. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timeoffs is changed. +* +* char dateobs[72] +* (Given, auxiliary) DATE-OBS keyvalue, being the date at the start of the +* observation unless otherwise explained in the DATE-OBS keycomment, in +* ISO format, yyyy-mm-ddThh:mm:ss. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::dateobs is changed. +* +* char datebeg[72] +* (Given, auxiliary) DATE-BEG keyvalue, being the date at the start of the +* observation in ISO format, yyyy-mm-ddThh:mm:ss. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::datebeg is changed. +* +* char dateavg[72] +* (Given, auxiliary) DATE-AVG keyvalue, being the date at a representative +* mid-point of the observation in ISO format, yyyy-mm-ddThh:mm:ss. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::dateavg is changed. +* +* char dateend[72] +* (Given, auxiliary) DATE-END keyvalue, baing the date at the end of the +* observation in ISO format, yyyy-mm-ddThh:mm:ss. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::dateend is changed. +* +* double mjdobs +* (Given, auxiliary) MJD-OBS keyvalue, equivalent to DATE-OBS expressed +* as a Modified Julian Date (MJD = JD - 2400000.5). +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::mjdobs is changed. +* +* double mjdbeg +* (Given, auxiliary) MJD-BEG keyvalue, equivalent to DATE-BEG expressed +* as a Modified Julian Date (MJD = JD - 2400000.5). +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::mjdbeg is changed. +* +* double mjdavg +* (Given, auxiliary) MJD-AVG keyvalue, equivalent to DATE-AVG expressed +* as a Modified Julian Date (MJD = JD - 2400000.5). +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::mjdavg is changed. +* +* double mjdend +* (Given, auxiliary) MJD-END keyvalue, equivalent to DATE-END expressed +* as a Modified Julian Date (MJD = JD - 2400000.5). +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::mjdend is changed. +* +* double jepoch +* (Given, auxiliary) JEPOCH keyvalue, equivalent to DATE-OBS expressed +* as a Julian epoch. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::jepoch is changed. +* +* double bepoch +* (Given, auxiliary) BEPOCH keyvalue, equivalent to DATE-OBS expressed +* as a Besselian epoch +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::bepoch is changed. +* +* double tstart +* (Given, auxiliary) TSTART keyvalue, equivalent to DATE-BEG expressed +* as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::tstart is changed. +* +* double tstop +* (Given, auxiliary) TSTOP keyvalue, equivalent to DATE-END expressed +* as a time in units of TIMEUNIT relative to DATEREF+TIMEOFFS. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::tstop is changed. +* +* double xposure +* (Given, auxiliary) XPOSURE keyvalue, being the effective exposure time +* in units of TIMEUNIT. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::xposure is changed. +* +* double telapse +* (Given, auxiliary) TELAPSE keyvalue, equivalent to the elapsed time +* between DATE-BEG and DATE-END, in units of TIMEUNIT. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::telapse is changed. +* +* double timsyer +* (Given, auxiliary) TIMSYER keyvalue, being the absolute error of the +* time values, in units of TIMEUNIT. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timsyer is changed. +* +* double timrder +* (Given, auxiliary) TIMRDER keyvalue, being the accuracy of time stamps +* relative to each other, in units of TIMEUNIT. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timrder is changed. +* +* double timedel +* (Given, auxiliary) TIMEDEL keyvalue, being the resolution of the time +* stamps. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timedel is changed. +* +* double timepixr +* (Given, auxiliary) TIMEPIXR keyvalue, being the relative position of the +* time stamps in binned time intervals, a value between 0.0 and 1.0. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::timepixr is changed. +* +* double obsgeo[6] +* (Given, auxiliary) Location of the observer in a standard terrestrial +* reference frame. The first three give ITRS Cartesian coordinates +* OBSGEO-X [m], OBSGEO-Y [m], OBSGEO-Z [m], and the second three give +* OBSGEO-L [deg], OBSGEO-B [deg], OBSGEO-H [m], which are related through +* a standard transformation. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::obsgeo is changed. +* +* char obsorbit[72] +* (Given, auxiliary) OBSORBIT keyvalue, being the URI, URL, or name of an +* orbit ephemeris file giving spacecraft coordinates relating to TREFPOS. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::obsorbit is changed. +* +* char radesys[72] +* (Given, auxiliary) The equatorial or ecliptic coordinate system type, +* RADESYSa. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::radesys is changed. +* +* double equinox +* (Given, auxiliary) The equinox associated with dynamical equatorial or +* ecliptic coordinate systems, EQUINOXa (or EPOCH in older headers). Not +* applicable to ICRS equatorial or ecliptic coordinates. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::equinox is changed. +* +* char specsys[72] +* (Given, auxiliary) Spectral reference frame (standard of rest), +* SPECSYSa. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::specsys is changed. +* +* char ssysobs[72] +* (Given, auxiliary) The spectral reference frame in which there is no +* differential variation in the spectral coordinate across the +* field-of-view, SSYSOBSa. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::ssysobs is changed. +* +* double velosys +* (Given, auxiliary) The relative radial velocity [m/s] between the +* observer and the selected standard of rest in the direction of the +* celestial reference coordinate, VELOSYSa. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::velosys is changed. +* +* double zsource +* (Given, auxiliary) The redshift, ZSOURCEa, of the source. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::zsource is changed. +* +* char ssyssrc[72] +* (Given, auxiliary) The spectral reference frame (standard of rest), +* SSYSSRCa, in which wcsprm::zsource was measured. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::ssyssrc is changed. +* +* double velangl +* (Given, auxiliary) The angle [deg] that should be used to decompose an +* observed velocity into radial and transverse components. +* +* It is not necessary to reset the wcsprm struct (via wcsset()) when +* wcsprm::velangl is changed. +* +* int ntab +* (Given) See wcsprm::tab. +* +* int nwtb +* (Given) See wcsprm::wtb. +* +* struct tabprm *tab +* (Given) Address of the first element of an array of ntab tabprm structs +* for which memory has been allocated. These are used to store tabular +* transformation parameters. +* +* Although technically wcsprm::ntab and tab are "given", they will +* normally be set by invoking wcstab(), whether directly or indirectly. +* +* The tabprm structs contain some members that must be supplied and others +* that are derived. The information to be supplied comes primarily from +* arrays stored in one or more FITS binary table extensions. These +* arrays, referred to here as "wcstab arrays", are themselves located by +* parameters stored in the FITS image header. +* +* struct wtbarr *wtb +* (Given) Address of the first element of an array of nwtb wtbarr structs +* for which memory has been allocated. These are used in extracting +* wcstab arrays from a FITS binary table. +* +* Although technically wcsprm::nwtb and wtb are "given", they will +* normally be set by invoking wcstab(), whether directly or indirectly. +* +* char lngtyp[8] +* (Returned) Four-character WCS celestial longitude and ... +* char lattyp[8] +* (Returned) ... latitude axis types. e.g. "RA", "DEC", "GLON", "GLAT", +* etc. extracted from 'RA--', 'DEC-', 'GLON', 'GLAT', etc. in the first +* four characters of CTYPEia but with trailing dashes removed. (Declared +* as char[8] for alignment reasons.) +* +* int lng +* (Returned) Index for the longitude coordinate, and ... +* int lat +* (Returned) ... index for the latitude coordinate, and ... +* int spec +* (Returned) ... index for the spectral coordinate in the imgcrd[][] and +* world[][] arrays in the API of wcsp2s(), wcss2p() and wcsmix(). +* +* These may also serve as indices into the pixcrd[][] array provided that +* the PCi_ja matrix does not transpose axes. +* +* int cubeface +* (Returned) Index into the pixcrd[][] array for the CUBEFACE axis. This +* is used for quadcube projections where the cube faces are stored on a +* separate axis (see wcs.h). +* +* int *types +* (Returned) Address of the first element of an array of int containing a +* four-digit type code for each axis. +* +* - First digit (i.e. 1000s): +* - 0: Non-specific coordinate type. +* - 1: Stokes coordinate. +* - 2: Celestial coordinate (including CUBEFACE). +* - 3: Spectral coordinate. +* +* - Second digit (i.e. 100s): +* - 0: Linear axis. +* - 1: Quantized axis (STOKES, CUBEFACE). +* - 2: Non-linear celestial axis. +* - 3: Non-linear spectral axis. +* - 4: Logarithmic axis. +* - 5: Tabular axis. +* +* - Third digit (i.e. 10s): +* - 0: Group number, e.g. lookup table number, being an index into the +* tabprm array (see above). +* +* - The fourth digit is used as a qualifier depending on the axis type. +* +* - For celestial axes: +* - 0: Longitude coordinate. +* - 1: Latitude coordinate. +* - 2: CUBEFACE number. +* +* - For lookup tables: the axis number in a multidimensional table. +* +* CTYPEia in "4-3" form with unrecognized algorithm code will have its +* type set to -1 and generate an error. +* +* struct linprm lin +* (Returned) Linear transformation parameters (usage is described in the +* prologue to lin.h). +* +* struct celprm cel +* (Returned) Celestial transformation parameters (usage is described in +* the prologue to cel.h). +* +* struct spcprm spc +* (Returned) Spectral transformation parameters (usage is described in the +* prologue to spc.h). +* +* struct wcserr *err +* (Returned) If enabled, when an error status is returned, this struct +* contains detailed information about the error, see wcserr_enable(). +* +* int m_flag +* (For internal use only.) +* int m_naxis +* (For internal use only.) +* double *m_crpix +* (For internal use only.) +* double *m_pc +* (For internal use only.) +* double *m_cdelt +* (For internal use only.) +* double *m_crval +* (For internal use only.) +* char (*m_cunit)[72] +* (For internal use only.) +* char (*m_ctype)[72] +* (For internal use only.) +* struct pvcard *m_pv +* (For internal use only.) +* struct pscard *m_ps +* (For internal use only.) +* double *m_cd +* (For internal use only.) +* double *m_crota +* (For internal use only.) +* int *m_colax +* (For internal use only.) +* char (*m_cname)[72] +* (For internal use only.) +* double *m_crder +* (For internal use only.) +* double *m_csyer +* (For internal use only.) +* double *m_czphs +* (For internal use only.) +* double *m_cperi +* (For internal use only.) +* struct tabprm *m_tab +* (For internal use only.) +* struct wtbarr *m_wtb +* (For internal use only.) +* +* +* pvcard struct - Store for PVi_ma keyrecords +* ------------------------------------------- +* The pvcard struct is used to pass the parsed contents of PVi_ma keyrecords +* to wcsset() via the wcsprm struct. +* +* All members of this struct are to be set by the user. +* +* int i +* (Given) Axis number (1-relative), as in the FITS PVi_ma keyword. If +* i == 0, wcsset() will replace it with the latitude axis number. +* +* int m +* (Given) Parameter number (non-negative), as in the FITS PVi_ma keyword. +* +* double value +* (Given) Parameter value. +* +* +* pscard struct - Store for PSi_ma keyrecords +* ------------------------------------------- +* The pscard struct is used to pass the parsed contents of PSi_ma keyrecords +* to wcsset() via the wcsprm struct. +* +* All members of this struct are to be set by the user. +* +* int i +* (Given) Axis number (1-relative), as in the FITS PSi_ma keyword. +* +* int m +* (Given) Parameter number (non-negative), as in the FITS PSi_ma keyword. +* +* char value[72] +* (Given) Parameter value. +* +* +* Global variable: const char *wcs_errmsg[] - Status return messages +* ------------------------------------------------------------------ +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCS +#define WCSLIB_WCS + +#include "lin.h" +#include "cel.h" +#include "spc.h" + +#ifdef __cplusplus +extern "C" { +#define wtbarr wtbarr_s /* See prologue of wtbarr.h. */ +#endif + +#define WCSSUB_LONGITUDE 0x1001 +#define WCSSUB_LATITUDE 0x1002 +#define WCSSUB_CUBEFACE 0x1004 +#define WCSSUB_CELESTIAL 0x1007 +#define WCSSUB_SPECTRAL 0x1008 +#define WCSSUB_STOKES 0x1010 + + +#define WCSCOMPARE_ANCILLARY 0x0001 +#define WCSCOMPARE_TILING 0x0002 +#define WCSCOMPARE_CRPIX 0x0004 + + +extern const char *wcs_errmsg[]; + +enum wcs_errmsg_enum { + WCSERR_SUCCESS = 0, /* Success. */ + WCSERR_NULL_POINTER = 1, /* Null wcsprm pointer passed. */ + WCSERR_MEMORY = 2, /* Memory allocation failed. */ + WCSERR_SINGULAR_MTX = 3, /* Linear transformation matrix is + singular. */ + WCSERR_BAD_CTYPE = 4, /* Inconsistent or unrecognized coordinate + axis type. */ + WCSERR_BAD_PARAM = 5, /* Invalid parameter value. */ + WCSERR_BAD_COORD_TRANS = 6, /* Unrecognized coordinate transformation + parameter. */ + WCSERR_ILL_COORD_TRANS = 7, /* Ill-conditioned coordinate transformation + parameter. */ + WCSERR_BAD_PIX = 8, /* One or more of the pixel coordinates were + invalid. */ + WCSERR_BAD_WORLD = 9, /* One or more of the world coordinates were + invalid. */ + WCSERR_BAD_WORLD_COORD = 10, /* Invalid world coordinate. */ + WCSERR_NO_SOLUTION = 11, /* No solution found in the specified + interval. */ + WCSERR_BAD_SUBIMAGE = 12, /* Invalid subimage specification. */ + WCSERR_NON_SEPARABLE = 13 /* Non-separable subimage coordinate + system. */ +}; + + +/* Struct used for storing PVi_ma keywords. */ +struct pvcard { + int i; /* Axis number, as in PVi_ma (1-relative). */ + int m; /* Parameter number, ditto (0-relative). */ + double value; /* Parameter value. */ +}; + +/* Size of the pvcard struct in int units, used by the Fortran wrappers. */ +#define PVLEN (sizeof(struct pvcard)/sizeof(int)) + +/* Struct used for storing PSi_ma keywords. */ +struct pscard { + int i; /* Axis number, as in PSi_ma (1-relative). */ + int m; /* Parameter number, ditto (0-relative). */ + char value[72]; /* Parameter value. */ +}; + +/* Size of the pscard struct in int units, used by the Fortran wrappers. */ +#define PSLEN (sizeof(struct pscard)/sizeof(int)) + + +struct wcsprm { + /* Initialization flag (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int flag; /* Set to zero to force initialization. */ + + /* FITS header keyvalues to be provided (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int naxis; /* Number of axes (pixel and coordinate). */ + double *crpix; /* CRPIXja keyvalues for each pixel axis. */ + double *pc; /* PCi_ja linear transformation matrix. */ + double *cdelt; /* CDELTia keyvalues for each coord axis. */ + double *crval; /* CRVALia keyvalues for each coord axis. */ + + char (*cunit)[72]; /* CUNITia keyvalues for each coord axis. */ + char (*ctype)[72]; /* CTYPEia keyvalues for each coord axis. */ + + double lonpole; /* LONPOLEa keyvalue. */ + double latpole; /* LATPOLEa keyvalue. */ + + double restfrq; /* RESTFRQa keyvalue. */ + double restwav; /* RESTWAVa keyvalue. */ + + int npv; /* Number of PVi_ma keywords, and the */ + int npvmax; /* number for which space was allocated. */ + struct pvcard *pv; /* PVi_ma keywords for each i and m. */ + + int nps; /* Number of PSi_ma keywords, and the */ + int npsmax; /* number for which space was allocated. */ + struct pscard *ps; /* PSi_ma keywords for each i and m. */ + + /* Alternative header keyvalues (see the prologue above). */ + /*------------------------------------------------------------------------*/ + double *cd; /* CDi_ja linear transformation matrix. */ + double *crota; /* CROTAi keyvalues for each coord axis. */ + int altlin; /* Alternative representations */ + /* Bit 0: PCi_ja is present, */ + /* Bit 1: CDi_ja is present, */ + /* Bit 2: CROTAi is present. */ + int velref; /* AIPS velocity code, VELREF. */ + + /* Auxiliary coordinate system information, not used by WCSLIB. Refer to */ + /* the prologue comments above for a brief explanation of these values. */ + char alt[4]; + int colnum; + int *colax; + /* Auxiliary coordinate axis information. */ + char (*cname)[72]; + double *crder; + double *csyer; + double *czphs; + double *cperi; + + char wcsname[72]; + /* Time reference system and measurement. */ + char timesys[72], trefpos[72], trefdir[72], plephem[72]; + char timeunit[72]; + char dateref[72]; + double mjdref[2]; + double timeoffs; + /* Data timestamps and durations. */ + char dateobs[72], datebeg[72], dateavg[72], dateend[72]; + double mjdobs, mjdbeg, mjdavg, mjdend; + double jepoch, bepoch; + double tstart, tstop; + double xposure, telapse; + /* Timing accuracy. */ + double timsyer, timrder; + double timedel, timepixr; + /* Spatial & celestial reference frame. */ + double obsgeo[6]; + char obsorbit[72]; + char radesys[72]; + double equinox; + char specsys[72]; + char ssysobs[72]; + double velosys; + double zsource; + char ssyssrc[72]; + double velangl; + + /* Coordinate lookup tables (see the prologue above). */ + /*------------------------------------------------------------------------*/ + int ntab; /* Number of separate tables. */ + int nwtb; /* Number of wtbarr structs. */ + struct tabprm *tab; /* Tabular transformation parameters. */ + struct wtbarr *wtb; /* Array of wtbarr structs. */ + + /*------------------------------------------------------------------------*/ + /* Information derived from the FITS header keyvalues by wcsset(). */ + /*------------------------------------------------------------------------*/ + char lngtyp[8], lattyp[8]; /* Celestial axis types, e.g. RA, DEC. */ + int lng, lat, spec; /* Longitude, latitude and spectral axis */ + /* indices (0-relative). */ + int cubeface; /* True if there is a CUBEFACE axis. */ + int *types; /* Coordinate type codes for each axis. */ + + struct linprm lin; /* Linear transformation parameters. */ + struct celprm cel; /* Celestial transformation parameters. */ + struct spcprm spc; /* Spectral transformation parameters. */ + + /*------------------------------------------------------------------------*/ + /* THE REMAINDER OF THE WCSPRM STRUCT IS PRIVATE. */ + /*------------------------------------------------------------------------*/ + + /* Error handling, if enabled. */ + /*------------------------------------------------------------------------*/ + struct wcserr *err; + + /* Memory management. */ + /*------------------------------------------------------------------------*/ + int m_flag, m_naxis; + double *m_crpix, *m_pc, *m_cdelt, *m_crval; + char (*m_cunit)[72], (*m_ctype)[72]; + struct pvcard *m_pv; + struct pscard *m_ps; + double *m_cd, *m_crota; + int *m_colax; + char (*m_cname)[72]; + double *m_crder, *m_csyer, *m_czphs, *m_cperi; + struct tabprm *m_tab; + struct wtbarr *m_wtb; +}; + +/* Size of the wcsprm struct in int units, used by the Fortran wrappers. */ +#define WCSLEN (sizeof(struct wcsprm)/sizeof(int)) + + +int wcsnpv(int n); + +int wcsnps(int n); + +int wcsini(int alloc, int naxis, struct wcsprm *wcs); + +int wcsinit(int alloc, int naxis, struct wcsprm *wcs, int npvmax, int npsmax, + int ndpmax); + +int wcssub(int alloc, const struct wcsprm *wcssrc, int *nsub, int axes[], + struct wcsprm *wcsdst); + +int wcscompare(int cmp, double tol, const struct wcsprm *wcs1, + const struct wcsprm *wcs2, int *equal); + +int wcsfree(struct wcsprm *wcs); + +int wcsprt(const struct wcsprm *wcs); + +int wcsperr(const struct wcsprm *wcs, const char *prefix); + +int wcsbchk(struct wcsprm *wcs, int bounds); + +int wcsset(struct wcsprm *wcs); + +int wcsp2s(struct wcsprm *wcs, int ncoord, int nelem, const double pixcrd[], + double imgcrd[], double phi[], double theta[], double world[], + int stat[]); + +int wcss2p(struct wcsprm *wcs, int ncoord, int nelem, const double world[], + double phi[], double theta[], double imgcrd[], double pixcrd[], + int stat[]); + +int wcsmix(struct wcsprm *wcs, int mixpix, int mixcel, const double vspan[], + double vstep, int viter, double world[], double phi[], + double theta[], double imgcrd[], double pixcrd[]); + +int wcssptr(struct wcsprm *wcs, int *i, char ctype[9]); + +const char* wcslib_version(int vers[3]); + +/* Defined mainly for backwards compatibility, use wcssub() instead. */ +#define wcscopy(alloc, wcssrc, wcsdst) wcssub(alloc, wcssrc, 0x0, 0x0, wcsdst) + + +/* Deprecated. */ +#define wcsini_errmsg wcs_errmsg +#define wcssub_errmsg wcs_errmsg +#define wcscopy_errmsg wcs_errmsg +#define wcsfree_errmsg wcs_errmsg +#define wcsprt_errmsg wcs_errmsg +#define wcsset_errmsg wcs_errmsg +#define wcsp2s_errmsg wcs_errmsg +#define wcss2p_errmsg wcs_errmsg +#define wcsmix_errmsg wcs_errmsg + +#ifdef __cplusplus +#undef wtbarr +} +#endif + +#endif /* WCSLIB_WCS */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsbth.l b/testbed/astropy__astropy/cextern/wcslib/C/wcsbth.l new file mode 100644 index 0000000000000000000000000000000000000000..b00d57553f6fe66a6ebb814467adb0ba337fd363 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsbth.l @@ -0,0 +1,3535 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsbth.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* wcsbth.l is a Flex description file containing the definition of a lexical +* scanner for parsing the WCS keyrecords for one or more image arrays and/or +* pixel lists in a FITS binary table header. It can also handle primary image +* and image extension headers. +* +* wcsbth.l requires Flex v2.5.4 or later. Refer to wcshdr.h for a description +* of the user interface and operating notes. +* +* Implementation notes +* -------------------- +* wcsbth() may be invoked with an option that causes it to recognize the +* image-header form of WCS keywords as defaults for each alternate coordinate +* representation (up to 27). By design, with this option enabled wcsbth() can +* also handle primary image and image extension headers, effectively treating +* them as a single-column binary table though with WCS keywords of a different +* form. +* +* NAXIS is always 2 for binary tables, it refers to the two-dimensional nature +* of the table. Thus NAXIS does not count the number of image axes in either +* image arrays or pixels lists and for the latter there is not even a formal +* equivalent of WCSAXESa. Hence NAXIS is always ignored and a first pass +* through the header is required to determine the number of images, the number +* of alternate coordinate representations for each image (up to 27), and the +* number of coordinate axes in each representation; this pass also counts the +* number of iPVn_ma and iPSn_ma or TVk_ma and TSk_ma keywords in each +* representation. +* +* On completion of the first pass, the association between column number and +* axis number is defined for each representation of a pixel list. Memory is +* allocated for an array of the required number of wcsprm structs and each of +* these is initialized appropriately. These structs are filled in the second +* pass. +* +* It is permissible for a scalar table column to contain degenerate (single- +* point) image arrays and simultaneously form one axis of a pixel list. +* +* The parser does not check for duplicated keywords, for most keywords it +* accepts the last encountered. +* +* wcsbth() does not currently handle the Green Bank convention. +* +*===========================================================================*/ + +/* Options. */ +%option full +%option never-interactive +%option noyywrap +%option outfile="wcsbth.c" +%option prefix="wcsbth" +%option reentrant + +/* Indices for parameterized keywords. */ +Z1 [0-9] +Z2 [0-9]{2} +Z3 [0-9]{3} +Z4 [0-9]{4} + +I1 [1-9] +I2 [1-9][0-9] +I3 [1-9][0-9]{2} +I4 [1-9][0-9]{3} + +/* Alternate coordinate system identifier. */ +ALT [ A-Z] + +/* Keyvalue data types. */ +INTEGER [+-]?[0-9]+ +FLOAT [+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eEdD][+-]?[0-9]+)? +STRING '([^']|'')*' + +/* Inline comment syntax. */ +INLINE " "*(\/.*)? + +/* Exclusive start states. */ +%x CCCCCia iCCCna iCCCCn TCCCna TCCCCn +%x CCi_ja ijCCna TCn_ka TCCn_ka +%x CROTAi iCROTn TCROTn +%x CCi_ma iCn_ma iCCn_ma TCn_ma TCCn_ma +%x PROJPm +%x CCCCCCCC CCCCCCCa +%x CCCCna CCCCCna +%x CCCCn CCCCCn +%x VALUE INTEGER_VAL FLOAT_VAL FLOAT2_VAL STRING_VAL +%x COMMENT DISCARD ERROR FLUSH + +%{ +#include +#include +#include +#include +#include + +#include "wcs.h" +#include "wcshdr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcsutil.h" + + /* Codes used for keyvalue data types. */ +#define INTEGER 0 +#define FLOAT 1 +#define FLOAT2 2 +#define STRING 3 + + /* Bit masks used for keyword types: */ +#define IMGAUX 0x1 /* Auxiliary image header, e.g. LONPOLEa or */ + /* DATE-OBS. */ +#define IMGAXIS 0x2 /* Image header with axis number, e.g. */ + /* CTYPEia. */ +#define IMGHEAD 0x3 /* IMGAUX | IMGAXIS, i.e. image header of */ + /* either type. */ +#define BIMGARR 0x4 /* Binary table image array, e.g. iCTYna. */ +#define PIXLIST 0x8 /* Pixel list, e.g. TCTYna. */ +#define BINTAB 0xC /* BIMGARR | PIXLIST, i.e. binary table */ + /* image array (without axis number) or */ + /* pixel list, e.g. LONPna or OBSGXn. */ + +static int wcsbth_scanner(char *header, int nkeyrec, int relax, int ctrl, + int keysel, int *colsel, int *nreject, int *nwcs, + struct wcsprm **wcs, yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsbth( + char *header, + int nkeyrec, + int relax, + int ctrl, + int keysel, + int *colsel, + int *nreject, + int *nwcs, + struct wcsprm **wcs) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsbth_scanner(header, nkeyrec, relax, ctrl, keysel, colsel, + nreject, nwcs, wcs, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsbth_scanner(char *header, int nkeyrec, int relax, \ + int ctrl, int keysel, int *colsel, int *nreject, int *nwcs, \ + struct wcsprm **wcs, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (wcsbth_nkeyrec) { \ + strncpy(inbuff, wcsbth_hdr, 80); \ + inbuff[80] = '\n'; \ + wcsbth_hdr += 80; \ + wcsbth_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* A convenience macro to get around incompatibilities between unput() and + yyless(): put yytext followed by a blank back onto the input stream. */ +#define WCSBTH_PUTBACK \ + sprintf(strtmp, "%s ", yytext); \ + itmp = strlen(strtmp); \ + while (itmp) unput(strtmp[--itmp]); + +/* These global variables are required by YY_INPUT. */ +static char *wcsbth_hdr; +static int wcsbth_nkeyrec; + +/* Struct used internally for header bookkeeping. */ +struct wcsbth_alts { + int ncol, ialt, icol, imgherit; + short int (*arridx)[27]; + short int pixidx[27]; + short int pad1; + unsigned int *pixlist; + + unsigned char (*npv)[27]; + unsigned char (*nps)[27]; + unsigned char pixnpv[27]; + unsigned char pixnps[27]; + unsigned char pad2[2]; +}; + +/* Internal helper functions. */ +static int wcsbth_colax(struct wcsprm *wcs, struct wcsbth_alts *alts, int k, + char a); +static int wcsbth_final(struct wcsbth_alts *alts, int *nwcs, + struct wcsprm **wcs); +static struct wcsprm *wcsbth_idx(struct wcsprm *wcs, struct wcsbth_alts *alts, + int keytype, int n, char a); +static int wcsbth_init1(struct wcsbth_alts *alts, int *nwcs, + struct wcsprm **wcs); +static int wcsbth_pass1(int keytype, int i, int j, int n, int k, char a, + char ptype, struct wcsbth_alts *alts); + +/* Helper functions for keywords that require special handling. */ +static int wcsbth_jdref(double *wptr, const double *jdref); +static int wcsbth_jdrefi(double *wptr, const double *jdrefi); +static int wcsbth_jdreff(double *wptr, const double *jdreff); +static int wcsbth_epoch(double *wptr, const double *epoch); +static int wcsbth_vsource(double *wptr, const double *vsource); + +/* Helper functions for keyvalue validity checking. */ +static int wcsbth_timepixr(double timepixr); + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsbth_abort_jmp_env; +#define exit(status) longjmp(wcsbth_abort_jmp_env, status) + +%} + +%% + /* Keyword indices, as used in the WCS papers, e.g. iVn_ma, TPn_ka. */ + char a; + int i, j, k, m, n; + + char *cptr, *errmsg, errtxt[80], exclude[1000], gotone, *hptr, *keep, + *keyname, *keyrec, ptype, strtmp[80]; + int altlin, ialt, icol, incl, imherit, inttmp, ipass, ipx, itmp, ix, + jx, keytype, nother, nsel, npass, nvalid, status, valtype, voff; + double dbltmp, dbl2tmp[2]; + void *vptr, *wptr; + struct wcsbth_alts alts; + struct wcsprm *wcsp, wcstem; + int (*chekval)(double); + int (*special)(double *, const double *); + + /* The data structures produced. */ + *nwcs = 0; + *wcs = 0x0; + + /* Parameters used to implement YY_INPUT. */ + wcsbth_hdr = header; + wcsbth_nkeyrec = nkeyrec; + + /* Our handle on the input stream. */ + keyrec = header; + hptr = header; + keep = 0x0; + + /* For keeping tallies of keywords found. */ + *nreject = 0; + nvalid = 0; + nother = 0; + + /* Used to flag image header keywords that are always inherited. */ + imherit = 1; + + /* If strict, then also reject. */ + if (relax & WCSHDR_strict) relax |= WCSHDR_reject; + + /* Keyword parameters. */ + i = j = 0; + n = k = 0; + m = 0; + a = ' '; + + /* Header bookkeeping. */ + alts.ncol = 0; + alts.arridx = 0x0; + alts.pixlist = 0x0; + alts.npv = 0x0; + alts.nps = 0x0; + + for (ialt = 0; ialt < 27; ialt++) { + alts.pixidx[ialt] = 0; + alts.pixnpv[ialt] = 0; + alts.pixnps[ialt] = 0; + } + + /* For decoding the keyvalue. */ + keytype = 0; + valtype = -1; + vptr = 0x0; + + /* For keywords that require special handling. */ + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + /* Selection by column number. */ + nsel = colsel ? colsel[0] : 0; + incl = (nsel > 0); + for (icol = 0; icol < 1000; icol++) { + exclude[icol] = incl; + } + for (icol = 1; icol <= abs(nsel); icol++) { + itmp = colsel[icol]; + if (0 < itmp && itmp < 1000) { + exclude[itmp] = !incl; + } + } + exclude[0] = 0; + + /* Selection by keyword type. */ + itmp = keysel; + keysel = 0; + if (itmp) { + if (itmp & WCSHDR_IMGHEAD) keysel |= IMGHEAD; + if (itmp & WCSHDR_BIMGARR) keysel |= BIMGARR; + if (itmp & WCSHDR_PIXLIST) keysel |= PIXLIST; + } + if (keysel == 0) { + keysel = IMGHEAD | BINTAB; + } + + /* Control variables. */ + ipass = 1; + npass = 2; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsbth_abort_jmp_env)) { + return 4; + } + + BEGIN(INITIAL); + + +^TFIELDS" = "" "*{INTEGER} { + if (ipass == 1) { + if (alts.ncol == 0) { + sscanf(yytext, "TFIELDS = %d", &(alts.ncol)); + BEGIN(FLUSH); + } else { + errmsg = "duplicate or out-of-sequence TFIELDS keyword"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + } + +^WCSAXES{ALT}=" "" "*{INTEGER} { + if (!(keysel & IMGAXIS)) { + /* Ignore this key type. */ + BEGIN(DISCARD); + + } else { + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "WCSAXES%c= %d", &a, &i); + + if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCSAXESa"; + keytype = IMGAXIS; + BEGIN(COMMENT); + } + + } else if (relax & WCSHDR_reject) { + errmsg = "image-header keyword WCSAXESa in binary table"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + } + +^WCAX{I1}{ALT}" = "" "*{INTEGER} | +^WCAX{I2}{ALT}" = "" "*{INTEGER} | +^WCAX{I3}{ALT}"= "" "*{INTEGER} { + keyname = "WCAXna"; + + /* Note that a blank in the sscanf() format string matches zero or + more of them in the input. */ + sscanf(yytext, "WCAX%d%c = %d", &n, &a, &i); + + if (!(keysel & BIMGARR) || exclude[n]) { + /* Ignore this key type or column. */ + BEGIN(DISCARD); + + } else if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCAXna"; + keytype = IMGAXIS; + BEGIN(COMMENT); + } + } + +^WCST{I1}{ALT}" = "" "*{STRING} | +^WCST{I2}{ALT}" = "" "*{STRING} | +^WCST{I3}{ALT}"= "" "*{STRING} { + /* Cross-reference supplier. */ + keyname = "WCSTna"; + errmsg = "cross-references are not implemented"; + BEGIN(ERROR); + } + +^WCSX{I1}{ALT}" = "" "*{STRING} | +^WCSX{I2}{ALT}" = "" "*{STRING} | +^WCSX{I3}{ALT}"= "" "*{STRING} { + /* Cross-reference consumer. */ + keyname = "WCSXna"; + errmsg = "cross-references are not implemented"; + BEGIN(ERROR); + } + +^CRPIX { + valtype = FLOAT; + vptr = &(wcstem.crpix); + + keyname = "CRPIXja"; + BEGIN(CCCCCia); + } + +^{I1}CRP | +^{I1}CRPX { + valtype = FLOAT; + vptr = &(wcstem.crpix); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "jCRPna"; + BEGIN(iCCCna); + } else { + keyname = "jCRPXn"; + BEGIN(iCCCCn); + } + } + +^TCRP | +^TCRPX { + valtype = FLOAT; + vptr = &(wcstem.crpix); + + if (yyleng == 4) { + keyname = "TCRPna"; + BEGIN(TCCCna); + } else { + keyname = "TCRPXn"; + BEGIN(TCCCCn); + } + } + +^PC { + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + keyname = "PCi_ja"; + BEGIN(CCi_ja); + } + +^{I2}PC { + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + sscanf(yytext, "%1d%1d", &i, &j); + + keyname = "ijPCna"; + BEGIN(ijCCna); + } + +^TP | +^TPC { + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + if (yyleng == 2) { + keyname = "TPn_ka"; + BEGIN(TCn_ka); + } else { + keyname = "TPCn_ka"; + BEGIN(TCCn_ka); + } + } + +^CD { + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + keyname = "CDi_ja"; + BEGIN(CCi_ja); + } + +^{I2}CD { + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + sscanf(yytext, "%1d%1d", &i, &j); + + keyname = "ijCDna"; + BEGIN(ijCCna); + } + +^TC | +^TCD { + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + if (yyleng == 2) { + keyname = "TCn_ka"; + BEGIN(TCn_ka); + } else { + keyname = "TCDn_ka"; + BEGIN(TCCn_ka); + } + } + +^CDELT { + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + keyname = "CDELTia"; + BEGIN(CCCCCia); + } + +^{I1}CDE | +^{I1}CDLT { + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCDEna"; + BEGIN(iCCCna); + } else { + keyname = "iCDLTn"; + BEGIN(iCCCCn); + } + } + +^TCDE | +^TCDLT { + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + if (yyleng == 4) { + keyname = "TCDEna"; + BEGIN(TCCCna); + } else { + keyname = "TCDLTn"; + BEGIN(TCCCCn); + } + } + +^CROTA { + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "CROTAi"; + BEGIN(CROTAi); + } + +^{I1}CROT { + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + sscanf(yytext, "%d", &i); + + keyname = "iCROTn"; + BEGIN(iCROTn); + } + +^TCROT { + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "TCROTn"; + BEGIN(TCROTn); + } + +^CUNIT { + valtype = STRING; + vptr = &(wcstem.cunit); + + keyname = "CUNITia"; + BEGIN(CCCCCia); + } + +^{I1}CUN | +^{I1}CUNI { + valtype = STRING; + vptr = &(wcstem.cunit); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCUNna"; + BEGIN(iCCCna); + } else { + keyname = "iCUNIn"; + BEGIN(iCCCCn); + } + } + +^TCUN | +^TCUNI { + valtype = STRING; + vptr = &(wcstem.cunit); + + if (yyleng == 4) { + keyname = "TCUNna"; + BEGIN(TCCCna); + } else { + keyname = "TCUNIn"; + BEGIN(TCCCCn); + } + } + +^CTYPE { + valtype = STRING; + vptr = &(wcstem.ctype); + + keyname = "CTYPEia"; + BEGIN(CCCCCia); + } + +^{I1}CTY | +^{I1}CTYP { + valtype = STRING; + vptr = &(wcstem.ctype); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCTYna"; + BEGIN(iCCCna); + } else { + keyname = "iCTYPn"; + BEGIN(iCCCCn); + } + } + +^TCTY | +^TCTYP { + valtype = STRING; + vptr = &(wcstem.ctype); + + if (yyleng == 4) { + keyname = "TCTYna"; + BEGIN(TCCCna); + } else { + keyname = "TCTYPn"; + BEGIN(TCCCCn); + } + } + +^CRVAL { + valtype = FLOAT; + vptr = &(wcstem.crval); + + keyname = "CRVALia"; + BEGIN(CCCCCia); + } + +^{I1}CRV | +^{I1}CRVL { + valtype = FLOAT; + vptr = &(wcstem.crval); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCRVna"; + BEGIN(iCCCna); + } else { + keyname = "iCRVLn"; + BEGIN(iCCCCn); + } + } + +^TCRV | +^TCRVL { + valtype = FLOAT; + vptr = &(wcstem.crval); + + if (yyleng == 4) { + keyname = "TCRVna"; + BEGIN(TCCCna); + } else { + keyname = "TCRVLn"; + BEGIN(TCCCCn); + } + } + +^LONPOLE | +^LONP { + valtype = FLOAT; + vptr = &(wcstem.lonpole); + + if (yyleng == 7) { + keyname = "LONPOLEa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "LONPna"; + BEGIN(CCCCna); + } + } + +^LATPOLE | +^LATP { + valtype = FLOAT; + vptr = &(wcstem.latpole); + + if (yyleng == 7) { + keyname = "LATPOLEa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "LATPna"; + BEGIN(CCCCna); + } + } + +^RESTFREQ | +^RESTFRQ | +^RFRQ { + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + if (yyleng == 8) { + if (relax & WCSHDR_strict) { + errmsg = "the RESTFREQ keyword is deprecated, use RESTFRQa"; + BEGIN(ERROR); + + } else { + unput(' '); + + keyname = "RESTFREQ"; + BEGIN(CCCCCCCa); + } + + } else if (yyleng == 7) { + keyname = "RESTFRQa"; + BEGIN(CCCCCCCa); + + } else { + keyname = "RFRQna"; + BEGIN(CCCCna); + } + } + +^RESTWAV | +^RWAV { + valtype = FLOAT; + vptr = &(wcstem.restwav); + + if (yyleng == 7) { + keyname = "RESTWAVa"; + BEGIN(CCCCCCCa); + } else { + keyname = "RWAVna"; + BEGIN(CCCCna); + } + } + +^PV { + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + keyname = "PVi_ma"; + BEGIN(CCi_ma); + } + +^{I1}V | +^{I1}PV { + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + sscanf(yytext, "%d", &i); + + if (yyleng == 2) { + keyname = "iVn_ma"; + BEGIN(iCn_ma); + } else { + keyname = "iPVn_ma"; + BEGIN(iCCn_ma); + } + } + +^TV | +^TPV { + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + if (yyleng == 2) { + keyname = "TVn_ma"; + BEGIN(TCn_ma); + } else { + keyname = "TPVn_ma"; + BEGIN(TCCn_ma); + } + } + +^PROJP { + valtype = FLOAT; + vptr = &(wcstem.pv); + ptype = 'v'; + + keyname = "PROJPm"; + BEGIN(PROJPm); + } + +^PS { + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + keyname = "PSi_ma"; + BEGIN(CCi_ma); + } + +^{I1}S | +^{I1}PS { + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + sscanf(yytext, "%d", &i); + + if (yyleng == 2) { + keyname = "iSn_ma"; + BEGIN(iCn_ma); + } else { + keyname = "iPSn_ma"; + BEGIN(iCCn_ma); + } + } + +^TS | +^TPS { + valtype = STRING; + vptr = &(wcstem.ps); + ptype = 's'; + + if (yyleng == 2) { + keyname = "TSn_ma"; + BEGIN(TCn_ma); + } else { + keyname = "TPSn_ma"; + BEGIN(TCCn_ma); + } + } + +^VELREF{ALT}" " { + sscanf(yytext, "VELREF%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the VELREF keyword is deprecated, use SPECSYSa"; + BEGIN(ERROR); + + } else if (a == ' ' || (relax & WCSHDR_VELREFa)) { + valtype = INTEGER; + vptr = &(wcstem.velref); + + unput(a); + + keyname = "VELREF"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "VELREF keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^CNAME { + valtype = STRING; + vptr = &(wcstem.cname); + + keyname = "CNAMEia"; + BEGIN(CCCCCia); + } + +^{I1}CNA | +^{I1}CNAM { + valtype = STRING; + vptr = &(wcstem.cname); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCNAna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCNAMn"; + BEGIN(iCCCCn); + } + } + +^TCNA | +^TCNAM { + valtype = STRING; + vptr = &(wcstem.cname); + + if (yyleng == 4) { + keyname = "TCNAna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCNAMn"; + BEGIN(TCCCCn); + } + } + +^CRDER { + valtype = FLOAT; + vptr = &(wcstem.crder); + + keyname = "CRDERia"; + BEGIN(CCCCCia); + } + +^{I1}CRD | +^{I1}CRDE { + valtype = FLOAT; + vptr = &(wcstem.crder); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCRDna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCRDEn"; + BEGIN(iCCCCn); + } + } + +^TCRD | +^TCRDE { + valtype = FLOAT; + vptr = &(wcstem.crder); + + if (yyleng == 4) { + keyname = "TCRDna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCRDEn"; + BEGIN(TCCCCn); + } + } + +^CSYER { + valtype = FLOAT; + vptr = &(wcstem.csyer); + + keyname = "CSYERia"; + BEGIN(CCCCCia); + } + +^{I1}CSY | +^{I1}CSYE { + valtype = FLOAT; + vptr = &(wcstem.csyer); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCSYna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCSYEn"; + BEGIN(iCCCCn); + } + } + +^TCSY | +^TCSYE { + valtype = FLOAT; + vptr = &(wcstem.csyer); + + if (yyleng == 4) { + keyname = "TCSYna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCSYEn"; + BEGIN(TCCCCn); + } + } + +^CZPHS { + valtype = FLOAT; + vptr = &(wcstem.czphs); + + keyname = "CZPHSia"; + BEGIN(CCCCCia); + } + +^{I1}CZP | +^{I1}CZPH { + valtype = FLOAT; + vptr = &(wcstem.czphs); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCZPna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCZPHn"; + BEGIN(iCCCCn); + } + } + +^TCZP | +^TCZPH { + valtype = FLOAT; + vptr = &(wcstem.czphs); + + if (yyleng == 4) { + keyname = "TCZPna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCZPHn"; + BEGIN(TCCCCn); + } + } + +^CPERI { + valtype = FLOAT; + vptr = &(wcstem.cperi); + + keyname = "CPERIia"; + BEGIN(CCCCCia); + } + +^{I1}CPR | +^{I1}CPER { + valtype = FLOAT; + vptr = &(wcstem.cperi); + + sscanf(yytext, "%d", &i); + + if (yyleng == 4) { + keyname = "iCPRna"; + BEGIN(iCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "iCPERn"; + BEGIN(iCCCCn); + } + } + +^TCPR | +^TCPER { + valtype = FLOAT; + vptr = &(wcstem.cperi); + + if (yyleng == 4) { + keyname = "TCPRna"; + BEGIN(TCCCna); + } else { + if (!(relax & WCSHDR_CNAMn)) vptr = 0x0; + keyname = "TCPERn"; + BEGIN(TCCCCn); + } + } + +^WCSNAME | +^WCSN | +^TWCS { + valtype = STRING; + vptr = wcstem.wcsname; + + if (yyleng == 7) { + keyname = "WCSNAMEa"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else { + if (*yytext == 'W') { + keyname = "WCSNna"; + } else { + keyname = "TWCSna"; + } + BEGIN(CCCCna); + } + } + +^TIMESYS" " { + valtype = STRING; + vptr = wcstem.timesys; + + keyname = "TIMESYS"; + BEGIN(CCCCCCCC); + } + +^TREFPOS" " | +^TRPOS { + valtype = STRING; + vptr = wcstem.trefpos; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "TREFPOS"; + BEGIN(CCCCCCCC); + } else { + keyname = "TRPOSn"; + BEGIN(CCCCCn); + } + } + +^TREFDIR" " | +^TRDIR { + valtype = STRING; + vptr = wcstem.trefdir; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "TREFDIR"; + BEGIN(CCCCCCCC); + } else { + keyname = "TRDIRn"; + BEGIN(CCCCCn); + } + } + +^PLEPHEM" " { + valtype = STRING; + vptr = wcstem.plephem; + + keyname = "PLEPHEM"; + BEGIN(CCCCCCCC); + } + +^TIMEUNIT { + valtype = STRING; + vptr = wcstem.timeunit; + + keyname = "TIMEUNIT"; + BEGIN(CCCCCCCC); + } + +^DATEREF" " { + valtype = STRING; + vptr = wcstem.dateref; + + keyname = "DATEREF"; + BEGIN(CCCCCCCC); + } + +^MJDREF" " { + valtype = FLOAT2; + vptr = wcstem.mjdref; + + keyname = "MJDREF"; + BEGIN(CCCCCCCC); + } + +^MJDREFI" " { + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + + keyname = "MJDREFI"; + BEGIN(CCCCCCCC); + } + +^MJDREFF" " { + valtype = FLOAT; + vptr = wcstem.mjdref + 1; + + keyname = "MJDREFF"; + BEGIN(CCCCCCCC); + } + +^JDREF" " { + valtype = FLOAT2; + vptr = wcstem.mjdref; + special = wcsbth_jdref; + + keyname = "JDREF"; + BEGIN(CCCCCCCC); + } + +^JDREFI" " { + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcsbth_jdrefi; + + keyname = "JDREFI"; + BEGIN(CCCCCCCC); + } + +^JDREFF" " { + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcsbth_jdreff; + + keyname = "JDREFF"; + BEGIN(CCCCCCCC); + } + +^TIMEOFFS { + valtype = FLOAT; + vptr = &(wcstem.timeoffs); + + keyname = "TIMEOFFS"; + BEGIN(CCCCCCCC); + } + +^DATE-OBS { + valtype = STRING; + vptr = wcstem.dateobs; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-OBS"; + imherit = 0; + BEGIN(CCCCCCCC); + } + +^DOBS{I1}" " | +^DOBS{I2}" " | +^DOBS{I3}" " { + valtype = STRING; + vptr = wcstem.dateobs; + + if (relax & WCSHDR_DOBSn) { + yyless(4); + + keyname = "DOBSn"; + BEGIN(CCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "DOBSn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^DATE-BEG { + valtype = STRING; + vptr = wcstem.datebeg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-BEG"; + BEGIN(CCCCCCCC); + } + +^DATE-AVG | +^DAVG { + valtype = STRING; + vptr = wcstem.dateavg; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "DATE-AVG"; + BEGIN(CCCCCCCC); + } else { + keyname = "DAVGn"; + BEGIN(CCCCn); + } + } + +^DATE-END { + valtype = STRING; + vptr = wcstem.dateend; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-END"; + BEGIN(CCCCCCCC); + } + +^MJD-OBS" " | +^MJDOB { + valtype = FLOAT; + vptr = &(wcstem.mjdobs); + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "MJD-OBS"; + imherit = 0; + BEGIN(CCCCCCCC); + } else { + keyname = "MJDOBn"; + BEGIN(CCCCCn); + } + } + +^MJD-BEG" " { + valtype = FLOAT; + vptr = &(wcstem.mjdbeg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-BEG"; + BEGIN(CCCCCCCC); + } + +^MJD-AVG" " | +^MJDA { + valtype = FLOAT; + vptr = &(wcstem.mjdavg); + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "MJD-AVG"; + BEGIN(CCCCCCCC); + } else { + keyname = "MJDAn"; + BEGIN(CCCCn); + } + } + +^MJD-END" " { + valtype = FLOAT; + vptr = &(wcstem.mjdend); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-END"; + BEGIN(CCCCCCCC); + } + +^JEPOCH" " { + valtype = FLOAT; + vptr = &(wcstem.jepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "JEPOCH"; + BEGIN(CCCCCCCC); + } + +^BEPOCH" " { + valtype = FLOAT; + vptr = &(wcstem.bepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "BEPOCH"; + BEGIN(CCCCCCCC); + } + +^TSTART" " { + valtype = FLOAT; + vptr = &(wcstem.tstart); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTART"; + BEGIN(CCCCCCCC); + } + +^TSTOP" " { + valtype = FLOAT; + vptr = &(wcstem.tstop); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTOP"; + BEGIN(CCCCCCCC); + } + +^XPOSURE" " { + valtype = FLOAT; + vptr = &(wcstem.xposure); + if (ctrl < -10) keep = keyrec; + + keyname = "XPOSURE"; + BEGIN(CCCCCCCC); + } + +^TELAPSE" " { + valtype = FLOAT; + vptr = &(wcstem.telapse); + if (ctrl < -10) keep = keyrec; + + keyname = "TELAPSE"; + BEGIN(CCCCCCCC); + } + +^TIMSYER" " { + valtype = FLOAT; + vptr = &(wcstem.timsyer); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMSYER"; + BEGIN(CCCCCCCC); + } + +^TIMRDER" " { + valtype = FLOAT; + vptr = &(wcstem.timrder); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMRDER"; + BEGIN(CCCCCCCC); + } + +^TIMEDEL" " { + valtype = FLOAT; + vptr = &(wcstem.timedel); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEDEL"; + BEGIN(CCCCCCCC); + } + +^TIMEPIXR { + valtype = FLOAT; + vptr = &(wcstem.timepixr); + chekval = wcsbth_timepixr; + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEPIXR"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-X | +^OBSGX { + valtype = FLOAT; + vptr = wcstem.obsgeo; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-X"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGXn"; + BEGIN(CCCCCn); + } + } + +^OBSGEO-Y | +^OBSGY { + valtype = FLOAT; + vptr = wcstem.obsgeo + 1; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-Y"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGYn"; + BEGIN(CCCCCn); + } + } + +^OBSGEO-Z | +^OBSGZ { + valtype = FLOAT; + vptr = wcstem.obsgeo + 2; + + if (yyleng == 8) { + if (ctrl < -10) keep = keyrec; + keyname = "OBSGEO-Z"; + BEGIN(CCCCCCCC); + } else { + keyname = "OBSGZn"; + BEGIN(CCCCCn); + } + } + +^OBSGEO-L { + valtype = FLOAT; + vptr = wcstem.obsgeo + 3; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-L"; + BEGIN(CCCCCCCC); + } + +^OBSGL{I1}" " | +^OBSGL{I2}" " | +^OBSGL{I3} { + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGLn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGLn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^OBSGEO-B { + valtype = FLOAT; + vptr = wcstem.obsgeo + 4; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-B"; + BEGIN(CCCCCCCC); + } + +^OBSGB{I1}" " | +^OBSGB{I2}" " | +^OBSGB{I3} { + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGBn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGBn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^OBSGEO-H { + valtype = FLOAT; + vptr = wcstem.obsgeo + 5; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-H"; + BEGIN(CCCCCCCC); + } + +^OBSGH{I1}" " | +^OBSGH{I2}" " | +^OBSGH{I3} { + valtype = STRING; + vptr = wcstem.obsgeo + 3; + + if (relax & WCSHDR_OBSGLBHn) { + yyless(5); + + keyname = "OBSGHn"; + BEGIN(CCCCCn); + + } else if (relax & WCSHDR_reject) { + errmsg = "OBSGHn keyword is non-standard"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^OBSORBIT { + valtype = STRING; + vptr = wcstem.obsorbit; + + keyname = "OBSORBIT"; + BEGIN(CCCCCCCC); + } + +^RADESYS | +^RADE { + valtype = STRING; + vptr = wcstem.radesys; + + if (yyleng == 7) { + keyname = "RADESYSa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "RADEna"; + BEGIN(CCCCna); + } + } + +^RADECSYS { + if (relax & WCSHDR_RADECSYS) { + valtype = STRING; + vptr = wcstem.radesys; + + unput(' '); + + keyname = "RADECSYS"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the RADECSYS keyword is deprecated, use RADESYSa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^EPOCH{ALT}" " { + sscanf(yytext, "EPOCH%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the EPOCH keyword is deprecated, use EQUINOXa"; + BEGIN(ERROR); + + } else if (a == ' ' || (relax & WCSHDR_EPOCHa)) { + valtype = FLOAT; + vptr = &(wcstem.equinox); + special = wcsbth_epoch; + + unput(a); + + keyname = "EPOCH"; + imherit = 0; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "EPOCH keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^EQUINOX | +^EQUI { + valtype = FLOAT; + vptr = &(wcstem.equinox); + + if (yyleng == 7) { + keyname = "EQUINOXa"; + imherit = 0; + BEGIN(CCCCCCCa); + } else { + keyname = "EQUIna"; + BEGIN(CCCCna); + } + } + +^SPECSYS | +^SPEC { + valtype = STRING; + vptr = wcstem.specsys; + + if (yyleng == 7) { + keyname = "SPECSYSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SPECna"; + BEGIN(CCCCna); + } + } + +^SSYSOBS | +^SOBS { + valtype = STRING; + vptr = wcstem.ssysobs; + + if (yyleng == 7) { + keyname = "SSYSOBSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SOBSna"; + BEGIN(CCCCna); + } + } + +^VELOSYS | +^VSYS { + valtype = FLOAT; + vptr = &(wcstem.velosys); + + if (yyleng == 7) { + keyname = "VELOSYSa"; + BEGIN(CCCCCCCa); + } else { + keyname = "VSYSna"; + BEGIN(CCCCna); + } + } + +^VSOURCE{ALT} { + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcsbth_vsource; + + yyless(7); + + keyname = "VSOURCEa"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the VSOURCEa keyword is deprecated, use ZSOURCEa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^VSOU{I1}{ALT}" " | +^VSOU{I2}{ALT}" " | +^VSOU{I3}{ALT} { + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcsbth_vsource; + + yyless(4); + keyname = "VSOUna"; + BEGIN(CCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = "VSOUna keyword is deprecated, use ZSOUna"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +^ZSOURCE | +^ZSOU { + valtype = FLOAT; + vptr = &(wcstem.zsource); + + if (yyleng == 7) { + keyname = "ZSOURCEa"; + BEGIN(CCCCCCCa); + } else { + keyname = "ZSOUna"; + BEGIN(CCCCna); + } + } + +^SSYSSRC | +^SSRC { + valtype = STRING; + vptr = wcstem.ssyssrc; + + if (yyleng == 7) { + keyname = "SSYSSRCa"; + BEGIN(CCCCCCCa); + } else { + keyname = "SSRCna"; + BEGIN(CCCCna); + } + } + +^VELANGL | +^VANG { + valtype = FLOAT; + vptr = &(wcstem.velangl); + + if (yyleng == 7) { + keyname = "VELANGLa"; + BEGIN(CCCCCCCa); + } else { + keyname = "VANGna"; + BEGIN(CCCCna); + } + } + +^END" "{77} { + if (wcsbth_nkeyrec) { + wcsbth_nkeyrec = 0; + errmsg = "keyrecords following the END keyrecord were ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + +^. { + BEGIN(DISCARD); + } + +{I1}{ALT}" " | +{I2}{ALT} { + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d%c", &i, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +0{I1}{ALT} | +00{I1} { + if (relax & WCSHDR_ALLIMG) { + if (relax & WCSHDR_reject) { + /* Violates the basic FITS standard. */ + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +0{ALT}" " | +00{ALT} | +{Z3} { + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + if (relax & WCSHDR_ALLIMG) { + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "keyword looks very much like %s but isn't", + keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{I1}" " | +{I2}" " | +{I3} | +{I1}" " | +{I2}" " | +{I3} { + if (vptr) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCCCn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +{I1}[A-Z]" " | +{I2}[A-Z] | +{I1}[A-Z]" " | +{I2}[A-Z] { + if (vptr && (relax & WCSHDR_LONGKEY)) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCCCn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + if (!vptr) { + sprintf(errmsg, "%s keyword is non-standard", keyname); + } else { + sprintf(errmsg, + "%s keyword may not have an alternate version code", keyname); + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}{ALT}" " | +{I2}{ALT}" " | +{I3}{ALT} | +{I1}{ALT}" " | +{I2}{ALT}" " | +{I3}{ALT} { + sscanf(yytext, "%d%c", &n, &a); + if (YY_START == TCCCna) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCCCna) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}_{I1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I2}_{I1}{ALT}" " | +{I2}_{I2}{ALT} { + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +0{I1}_{I1}{ALT}" " | +{I1}_0{I1}{ALT}" " | +00{I1}_{I1}{ALT} | +0{I1}_0{I1}{ALT} | +{I1}_00{I1}{ALT} | +000{I1}_{I1} | +00{I1}_0{I1} | +0{I1}_00{I1} | +{I1}_000{I1} | +0{I1}_{I2}{ALT} | +{I1}_0{I2}{ALT} | +00{I1}_{I2} | +0{I1}_0{I2} | +{I1}_00{I2} | +0{I2}_{I1}{ALT} | +{I2}_0{I1}{ALT} | +00{I2}_{I1} | +0{I2}_0{I1} | +{I2}_00{I1} | +0{I2}_{I2} | +{I2}_0{I2} { + if (relax & WCSHDR_ALLIMG) { + if (((altlin == 1) && (relax & WCSHDR_PC0i_0ja)) || + ((altlin == 2) && (relax & WCSHDR_CD0i_0ja))) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}_{Z1}{ALT}" " | +{Z2}_{Z1}{ALT}" " | +{Z1}_{Z2}{ALT}" " | +{Z3}_{Z1}{ALT} | +{Z2}_{Z2}{ALT} | +{Z1}_{Z3}{ALT} | +{Z4}_{Z1} | +{Z3}_{Z2} | +{Z2}_{Z3} | +{Z1}_{Z4} { + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + if (relax & WCSHDR_ALLIMG) { + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}-{Z1}{ALT}" " | +{Z2}-{Z1}{ALT}" " | +{Z1}-{Z2}{ALT}" " | +{Z3}-{Z1}{ALT} | +{Z2}-{Z2}{ALT} | +{Z1}-{Z3}{ALT} | +{Z4}-{Z1} | +{Z3}-{Z2} | +{Z2}-{Z3} | +{Z1}-{Z4} { + if (relax & WCSHDR_ALLIMG) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}{6} { + /* This covers the defunct forms CD00i00j and PC00i00j. */ + if (relax & WCSHDR_ALLIMG) { + if (((altlin == 1) && (relax & WCSHDR_PC00i00j)) || + ((altlin == 2) && (relax & WCSHDR_CD00i00j))) { + sscanf(yytext, "%3d%3d", &i, &j); + a = ' '; + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "this form of the %s keyword is deprecated, use %s", + keyname, keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "deprecated image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + BEGIN(DISCARD); + } + +{I1}{ALT}" " | +{I2}{ALT}" " | +{I3}{ALT} { + sscanf(yytext, "%d%c", &n, &a); + keytype = BIMGARR; + BEGIN(VALUE); + } + +{I1}_{I1}{ALT}" " | +{I1}_{I2}{ALT} | +{I2}_{I1}{ALT} | +{I1}_{I3} | +{I2}_{I2} | +{I3}_{I1} { + if (relax & WCSHDR_LONGKEY) { + WCSBTH_PUTBACK; + BEGIN(TCn_ka); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "%s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + BEGIN(DISCARD); + } + +{I1}_{I1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I2}_{I1}{ALT}" " | +{I1}_{I3}{ALT} | +{I2}_{I2}{ALT} | +{I3}_{I1}{ALT} { + sscanf(yytext, "%d_%d%c", &n, &k, &a); + i = wcsbth_colax(*wcs, &alts, n, a); + j = wcsbth_colax(*wcs, &alts, k, a); + keytype = PIXLIST; + BEGIN(VALUE); + } + +{I1}_{I4} | +{I2}_{I3} | +{I3}_{I2} | +{I4}_{I1} { + sscanf(yytext, "%d_%d", &n, &k); + a = ' '; + i = wcsbth_colax(*wcs, &alts, n, a); + j = wcsbth_colax(*wcs, &alts, k, a); + keytype = PIXLIST; + BEGIN(VALUE); + } + +. { + BEGIN(DISCARD); + } + +{Z1}{ALT}" " | +{Z2}{ALT} | +{Z3} { + if (relax & WCSHDR_ALLIMG) { + a = ' '; + sscanf(yytext, "%d%c", &i, &a); + + if (relax & WCSHDR_strict) { + errmsg = "the CROTAn keyword is deprecated, use PCi_ja"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_CROTAia) { + yyless(0); + BEGIN(CCCCCia); + + } else if (relax & WCSHDR_reject) { + errmsg = "CROTAn keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "deprecated image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + if (relax & WCSHDR_ALLIMG) { + yyless(0); + BEGIN(CCCCCia); + } else { + /* Let it go. */ + BEGIN(DISCARD); + } + } + +{I1}" " | +{I2}" " | +{I3} | +{I1}" " | +{I2}" " | +{I3} { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCROTn) ? iCCCna : TCCCna); + } + +{I1}[A-Z]" " | +{I2}[A-Z] | +{I1}[A-Z]" " | +{I2}[A-Z] { + if (relax & WCSHDR_CROTAia) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCROTn) ? iCCCna : TCCCna); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "%s keyword may not have an alternate version code", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. | +. { + BEGIN(DISCARD); + } + +{ALT} | +. { + /* Image-header keyword. */ + if (imherit || (relax & (WCSHDR_AUXIMG | WCSHDR_ALLIMG))) { + if (YY_START == CCCCCCCa) { + sscanf(yytext, "%c", &a); + } else { + a = 0; + unput(yytext[0]); + } + keytype = IMGAUX; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "invalid alternate code, keyword resembles %s " + "but isn't", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{I1}{ALT}" " | +{I2}{ALT}" " | +{I3}{ALT} | +{I1}{ALT}" " | +{I2}{ALT} { + sscanf(yytext, "%d%c", &n, &a); + keytype = BINTAB; + BEGIN(VALUE); + } + +{I3} { + sscanf(yytext, "%d", &n); + a = ' '; + keytype = BINTAB; + BEGIN(VALUE); + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}" " | +{I2}" " | +{I3}" " | +{I4} | +{I1}" " | +{I2}" " | +{I3} { + sscanf(yytext, "%d", &n); + a = 0; + keytype = BINTAB; + BEGIN(VALUE); + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I2}_{Z1}{ALT}" " | +{I2}_{I2}{ALT} { + /* Image-header keyword. */ + if (relax & WCSHDR_ALLIMG) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +0{I1}_{Z1}{ALT}" " | +{I1}_0{Z1}{ALT}" " | +00{I1}_{Z1}{ALT} | +0{I1}_0{Z1}{ALT} | +{I1}_00{Z1}{ALT} | +000{I1}_{Z1} | +00{I1}_0{Z1} | +0{I1}_00{Z1} | +{I1}_000{Z1} | +0{I1}_{I2}{ALT} | +{I1}_0{I2}{ALT} | +00{I1}_{I2} | +0{I1}_0{I2} | +{I1}_00{I2} | +0{I2}_{Z1}{ALT} | +{I2}_0{Z1}{ALT} | +00{I2}_{Z1} | +0{I2}_0{Z1} | +{I2}_00{Z1} | +0{I2}_{I2} | +{I2}_0{I2} { + if (relax & WCSHDR_ALLIMG) { + if (((valtype == FLOAT) && (relax & WCSHDR_PV0i_0ma)) || + ((valtype == STRING) && (relax & WCSHDR_PS0i_0ma))) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}_{Z1}{ALT}" " | +{Z2}_{Z1}{ALT}" " | +{Z1}_{Z2}{ALT}" " | +{Z3}_{Z1}{ALT} | +{Z2}_{Z2}{ALT} | +{Z1}_{Z3}{ALT} | +{Z4}_{Z1} | +{Z3}_{Z2} | +{Z2}_{Z3} | +{Z1}_{Z4} { + if (relax & WCSHDR_ALLIMG) { + /* Anything that has fallen through to this point must contain */ + /* an invalid parameter. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "invalid image-header keyword %s in binary table", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}-{Z1}{ALT}" " | +{Z2}-{Z1}{ALT}" " | +{Z1}-{Z2}{ALT}" " | +{Z3}-{Z1}{ALT} | +{Z2}-{Z2}{ALT} | +{Z1}-{Z3}{ALT} | +{Z4}-{Z1} | +{Z3}-{Z2} | +{Z2}-{Z3} | +{Z1}-{Z4} { + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + +. { + BEGIN(DISCARD); + } + +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT} | +{I1}_{I3} | +{I2}_{Z1}{ALT} | +{I2}_{I2} | +{I3}_{Z1} | +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT} | +{I1}_{I3} | +{I2}_{Z1}{ALT} | +{I2}_{I2} | +{I3}_{Z1} { + if (relax & WCSHDR_LONGKEY) { + WCSBTH_PUTBACK; + BEGIN((YY_START == iCCn_ma) ? iCn_ma : TCn_ma); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, "the %s keyword is non-standard", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I1}_{I3}{ALT} | +{I2}_{Z1}{ALT}" " | +{I2}_{I2}{ALT} | +{I3}_{Z1}{ALT} | +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I1}_{I3}{ALT} | +{I2}_{Z1}{ALT}" " | +{I2}_{I2}{ALT} | +{I3}_{Z1}{ALT} { + sscanf(yytext, "%d_%d%c", &n, &m, &a); + if (YY_START == TCn_ma) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCn_ma) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + +{I1}_{I4} | +{I2}_{I3} | +{I3}_{I2} | +{I4}_{Z1} | +{I1}_{I4} | +{I2}_{I3} | +{I3}_{I2} | +{I4}_{Z1} { + /* Invalid combinations will be flagged by . */ + sscanf(yytext, "%d_%d", &n, &m); + a = ' '; + if (YY_START == TCn_ma) i = wcsbth_colax(*wcs, &alts, n, a); + keytype = (YY_START == iCn_ma) ? BIMGARR : PIXLIST; + BEGIN(VALUE); + } + +. | +. { + BEGIN(DISCARD); + } + +{Z1}" " { + if (relax & WCSHDR_PROJPn) { + sscanf(yytext, "%d", &m); + i = 0; + a = ' '; + keytype = IMGAXIS; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "the PROJPn keyword is deprecated, use PVi_ma"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z2}" " | +{Z3} { + if (relax & (WCSHDR_PROJPn | WCSHDR_reject)) { + errmsg = "invalid PROJPn keyword"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +. { + BEGIN(DISCARD); + } + +=" "+ { + /* Do checks on i, j, m, n, k. */ + if (!(keytype & keysel)) { + /* Selection by keyword type. */ + BEGIN(DISCARD); + + } else if (exclude[n] || exclude[k]) { + /* One or other column is not selected. */ + if (k && (exclude[n] != exclude[k])) { + /* For keywords such as TCn_ka, both columns must be excluded. + User error, so return immediately. */ + return 3; + + } else { + BEGIN(DISCARD); + } + + } else if (i > 99 || j > 99 || m > 99 || n > 999 || k > 999) { + if (relax & WCSHDR_reject) { + errmsg = errtxt; + if (i > 99 || j > 99) { + sprintf(errmsg, "axis number exceeds 99"); + } else if (m > 99) { + sprintf(errmsg, "parameter number exceeds 99"); + } else if (n > 999 || k > 999) { + sprintf(errmsg, "column number exceeds 999"); + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else if (ipass == 2 && npass == 3 && (keytype & BINTAB)) { + /* Skip keyvalues that won't be inherited. */ + BEGIN(FLUSH); + + } else { + if (ipass == 3 && (keytype & IMGHEAD)) { + /* IMGHEAD keytypes are always dealt with on the second pass. */ + /* However, they must be re-parsed in order to report errors. */ + vptr = 0x0; + } + + if (valtype == INTEGER) { + BEGIN(INTEGER_VAL); + } else if (valtype == FLOAT) { + BEGIN(FLOAT_VAL); + } else if (valtype == FLOAT2) { + BEGIN(FLOAT2_VAL); + } else if (valtype == STRING) { + BEGIN(STRING_VAL); + } else { + errmsg = errtxt; + sprintf(errmsg, "internal parser ERROR, bad data type: %d", + valtype); + BEGIN(ERROR); + } + } + } + +. { + errmsg = "invalid KEYWORD = VALUE syntax"; + BEGIN(ERROR); + } + +{INTEGER} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + sscanf(yytext, "%d", &inttmp); + + BEGIN(COMMENT); + } + } + +. { + errmsg = "an integer value was expected"; + BEGIN(ERROR); + } + +{FLOAT} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + wcsutil_str2double(yytext, &dbltmp); + + if (chekval && chekval(dbltmp)) { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } else { + BEGIN(COMMENT); + } + } + } + +. { + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + +{FLOAT} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue as integer and fractional parts. */ + wcsutil_str2double2(yytext, dbl2tmp); + + BEGIN(COMMENT); + } + } + +. { + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + +{STRING} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + strcpy(strtmp, yytext+1); + + /* Squeeze out repeated quotes. */ + ix = 0; + for (jx = 0; jx < 72; jx++) { + if (ix < jx) { + strtmp[ix] = strtmp[jx]; + } + + if (strtmp[jx] == '\0') { + if (ix) strtmp[ix-1] = '\0'; + break; + } else if (strtmp[jx] == '\'' && strtmp[jx+1] == '\'') { + jx++; + } + + ix++; + } + + BEGIN(COMMENT); + } + } + +. { + errmsg = "a string value was expected"; + BEGIN(ERROR); + } + +{INLINE}$ { + if (ipass == 1) { + /* Do first-pass bookkeeping. */ + wcsbth_pass1(keytype, i, j, n, k, a, ptype, &alts); + BEGIN(FLUSH); + + } else if (*wcs) { + /* Store the value now that the keyrecord has been validated. */ + alts.icol = 0; + alts.ialt = 0; + + /* Update each coordinate representation. */ + gotone = 0; + while ((wcsp = wcsbth_idx(*wcs, &alts, keytype, n, a))) { + gotone = 1; + + if (vptr) { + voff = (char *)vptr - (char *)(&wcstem); + wptr = (void *)((char *)wcsp + voff); + + if (valtype == INTEGER) { + *((int *)wptr) = inttmp; + + } else if (valtype == FLOAT) { + /* Apply keyword parameterization. */ + if (ptype == 'v') { + ipx = (wcsp->npv)++; + wcsp->pv[ipx].i = i; + wcsp->pv[ipx].m = m; + wptr = &(wcsp->pv[ipx].value); + + } else if (j) { + wptr = *((double **)wptr) + (i - 1)*(wcsp->naxis) + + (j - 1); + + } else if (i) { + wptr = *((double **)wptr) + (i - 1); + } + + if (special) { + special(wptr, &dbltmp); + } else { + *((double *)wptr) = dbltmp; + } + + /* Flag the presence of PCi_ja, or CDi_ja and/or CROTAia. */ + if (altlin) { + wcsp->altlin |= altlin; + altlin = 0; + } + + } else if (valtype == FLOAT2) { + /* Split MJDREF and JDREF into integer and fraction.*/ + if (special) { + special(wptr, dbl2tmp); + } else { + *((double *)wptr) = dbl2tmp[0]; + *((double *)wptr + 1) = dbl2tmp[1]; + } + + } else if (valtype == STRING) { + /* Apply keyword parameterization. */ + if (ptype == 's') { + ipx = wcsp->nps++; + wcsp->ps[ipx].i = i; + wcsp->ps[ipx].m = m; + wptr = wcsp->ps[ipx].value; + + } else if (j) { + wptr = *((char (**)[72])wptr) + + (i - 1)*(wcsp->naxis) + (j - 1); + + } else if (i) { + wptr = *((char (**)[72])wptr) + (i - 1); + } + + cptr = (char *)wptr; + strcpy(cptr, strtmp); + } + } + } + + if (ipass == npass) { + if (gotone) { + nvalid++; + if (ctrl == 4) { + wcsfprintf(stderr, + "%.80s\n Accepted (%d) as a valid WCS keyrecord.\n", + keyrec, nvalid); + } + + BEGIN(FLUSH); + + } else { + errmsg = "syntactically valid WCS keyrecord has no effect"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + + } else { + BEGIN(FLUSH); + } + } + +.*" "*\/.*$ { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + +[^ \/\n]*{INLINE}$ { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + +" "+[^\/\n].*{INLINE}$ { + errmsg = "invalid keyvalue or malformed keycomment"; + BEGIN(ERROR); + } + +.*$ { + errmsg = "malformed keycomment"; + BEGIN(ERROR); + } + +.*$ { + if (ipass == npass) { + if (ctrl < 0) { + /* Preserve discards. */ + keep = keyrec; + + } else if (2 < ctrl) { + nother++; + wcsfprintf(stderr, "%.80s\n Not a recognized WCS keyword.\n", + keyrec); + } + } + BEGIN(FLUSH); + } + +.*$ { + if (ipass == npass) { + (*nreject)++; + + if (ctrl%10 == -1) { + keep = keyrec; + } + + if (1 < abs(ctrl%10)) { + wcsfprintf(stderr, "%.80s\n Rejected (%d), %s.\n", + keyrec, *nreject, errmsg); + } + } + BEGIN(FLUSH); + } + +.*\n { + if (ipass == npass && keep) { + if (hptr < keep) { + strncpy(hptr, keep, 80); + } + hptr += 80; + } + + /* Throw away the rest of the line and reset for the next one. */ + i = j = 0; + n = k = 0; + m = 0; + a = ' '; + + keyrec += 80; + + keytype = 0; + valtype = -1; + vptr = 0x0; + keep = 0x0; + + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + BEGIN(INITIAL); + } + +<> { + /* End-of-input. */ + if (ipass == 1) { + if ((status = wcsbth_init1(&alts, nwcs, wcs)) || + (*nwcs == 0 && ctrl == 0)) { + return status; + } + + if (2 < abs(ctrl%10)) { + if (*nwcs == 1) { + if (strcmp(wcs[0]->wcsname, "DEFAULTS") != 0) { + wcsfprintf(stderr, "Found one coordinate representation.\n"); + } + } else { + wcsfprintf(stderr, "Found %d coordinate representations.\n", + *nwcs); + } + } + + if (alts.imgherit) npass = 3; + } + + if (ipass++ < npass) { + wcsbth_hdr = header; + wcsbth_nkeyrec = nkeyrec; + keyrec = header; + *nreject = 0; + + imherit = 1; + + i = j = 0; + k = n = 0; + m = 0; + a = ' '; + + keytype = 0; + valtype = -1; + vptr = 0x0; + + altlin = 0; + ptype = ' '; + chekval = 0x0; + special = 0x0; + + yyrestart(yyin, yyscanner); + + } else { + + if (ctrl < 0) { + *hptr = '\0'; + } else if (ctrl == 1) { + wcsfprintf(stderr, "%d WCS keyrecord%s rejected.\n", + *nreject, (*nreject==1)?" was":"s were"); + } else if (ctrl == 4) { + wcsfprintf(stderr, "\n"); + wcsfprintf(stderr, "%5d keyrecord%s rejected for syntax or " + "other errors,\n", *nreject, (*nreject==1)?" was":"s were"); + wcsfprintf(stderr, "%5d %s recognized as syntactically valid, " + "and\n", nvalid, (nvalid==1)?"was":"were"); + wcsfprintf(stderr, "%5d other%s were not recognized as WCS " + "keyrecords.\n", nother, (nother==1)?"":"s"); + } + + return wcsbth_final(&alts, nwcs, wcs); + } + } + +%% + +/*---------------------------------------------------------------------------- +* Perform first-pass tasks: +* +* 1) Count the number of coordinate axes in each of the 27 possible alternate +* image-header coordinate representations. Also count the number of PVi_ma +* and PSi_ma keywords in each representation. +* +* 2) Determine the number of binary table columns that have an image array +* with a coordinate representation (up to 999), and count the number of +* coordinate axes in each of the 27 possible alternates. Also count the +* number of iVn_ma and iSn_ma keywords in each representation. +* +* 3) Determine the number of alternate pixel list coordinate representations +* (up to 27) and the table columns associated with each. Also count the +* number of TVn_ma and TSn_ma keywords in each representation. +* +* In the first pass alts->arridx[icol][27] is used to determine the number of +* axes in each of 27 possible image-header coordinate descriptions (icol == 0) +* and each of the 27 possible coordinate representations for an image array in +* each column. +* +* The elements of alts->pixlist[icol] are used as bit arrays to flag which of +* the 27 possible pixel list coordinate representations are associated with +* each table column. +*---------------------------------------------------------------------------*/ + +int wcsbth_pass1( + int keytype, + int i, + int j, + int n, + int k, + char a, + char ptype, + struct wcsbth_alts *alts) + +{ + int ialt, icol, mask, ncol; + + if (a == 0) { + /* Keywords such as DATE-OBS go along for the ride. */ + return 0; + } + + ncol = alts->ncol; + + /* Do we need to allocate memory for alts? */ + if (alts->arridx == 0x0) { + if (ncol == 0) { + /* Can only happen if TFIELDS is missing or out-of-sequence. If n and + k are both zero then we may be processing an image header so leave + ncol alone - the array will be realloc'd later if required. */ + if (n || k) { + /* The header is mangled, assume the worst. */ + ncol = 999; + } + } + + if (!(alts->arridx = calloc((1 + ncol)*27, sizeof(short int))) || + !(alts->npv = calloc((1 + ncol)*27, sizeof(unsigned char))) || + !(alts->nps = calloc((1 + ncol)*27, sizeof(unsigned char))) || + !(alts->pixlist = calloc((1 + ncol), sizeof(unsigned int)))) { + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + return 2; + } + + alts->ncol = ncol; + + } else if (n > ncol || k > ncol) { + /* Can only happen if TFIELDS or the WCS keyword is wrong; carry on. */ + ncol = 999; + if (!(alts->arridx = realloc(alts->arridx, + 27*(1 + ncol)*sizeof(short int))) || + !(alts->npv = realloc(alts->npv, + 27*(1 + ncol)*sizeof(unsigned char))) || + !(alts->nps = realloc(alts->nps, + 27*(1 + ncol)*sizeof(unsigned char))) || + !(alts->pixlist = realloc(alts->pixlist, + (1 + ncol)*sizeof(unsigned int)))) { + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + return 2; + } + + /* Since realloc() doesn't initialize the extra memory. */ + for (icol = (1 + alts->ncol); icol < (1 + ncol); icol++) { + for (ialt = 0; ialt < 27; ialt++) { + alts->arridx[icol][ialt] = 0; + alts->npv[icol][ialt] = 0; + alts->nps[icol][ialt] = 0; + alts->pixlist[icol] = 0; + } + } + + alts->ncol = ncol; + } + + ialt = 0; + if (a != ' ') { + ialt = a - 'A' + 1; + } + + /* A BINTAB keytype such as LONPna, in conjunction with an IMGAXIS keytype + causes a table column to be recognized as an image array. */ + if (keytype & IMGHEAD || keytype & BIMGARR) { + /* n == 0 is expected for IMGHEAD keywords. */ + if (i == 0 && j == 0) { + if (alts->arridx[n][ialt] == 0) { + /* Flag that an auxiliary keyword was seen. */ + alts->arridx[n][ialt] = -1; + } + + } else { + /* Record the maximum axis number found. */ + if (alts->arridx[n][ialt] < i) { + alts->arridx[n][ialt] = i; + } + + if (alts->arridx[n][ialt] < j) { + alts->arridx[n][ialt] = j; + } + } + + if (ptype == 'v') { + alts->npv[n][ialt]++; + } else if (ptype == 's') { + alts->nps[n][ialt]++; + } + } + + /* BINTAB keytypes, which apply both to pixel lists as well as binary table + image arrays, never contribute to recognizing a table column as a pixel + list axis. A PIXLIST keytype is required for that. */ + if (keytype == PIXLIST) { + mask = 1 << ialt; + + /* n > 0 for PIXLIST keytypes. */ + alts->pixlist[n] |= mask; + if (k) alts->pixlist[k] |= mask; + + /* Used as a flag over all columns. */ + alts->pixlist[0] |= mask; + + if (ptype == 'v') { + alts->pixnpv[ialt]++; + } else if (ptype == 's') { + alts->pixnps[ialt]++; + } + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Perform initializations at the end of the first pass: +* +* 1) Determine the required number of wcsprm structs, allocate memory for +* an array of them and initialize each one. +*---------------------------------------------------------------------------*/ + +int wcsbth_init1( + struct wcsbth_alts *alts, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, icol, inherit[27], ix, mask, ncol, npsmax, npvmax, status = 0; + struct wcsprm *wcsp; + + + if (alts->arridx == 0x0) { + *nwcs = 0; + return 0; + } + + /* Determine the number of axes in each pixel list representation. */ + ncol = alts->ncol; + for (ialt = 0, mask = 1; ialt < 27; ialt++, mask <<= 1) { + alts->pixidx[ialt] = 0; + + if (alts->pixlist[0] | mask) { + for (icol = 1; icol <= ncol; icol++) { + if (alts->pixlist[icol] & mask) { + alts->pixidx[ialt]++; + } + } + } + } + + /* Find the total number of coordinate representations. */ + *nwcs = 0; + alts->imgherit = 0; + for (ialt = 0; ialt < 27; ialt++) { + inherit[ialt] = 0; + + for (icol = 1; icol <= ncol; icol++) { + if (alts->arridx[icol][ialt] < 0) { + /* No BIMGARR keytype but there's at least one BINTAB. */ + if (alts->arridx[0][ialt] > 0) { + /* There is an IMGAXIS keytype that we will inherit, so count this + representation. */ + alts->arridx[icol][ialt] = alts->arridx[0][ialt]; + } else { + alts->arridx[icol][ialt] = 0; + } + } + + if (alts->arridx[icol][ialt]) { + if (alts->arridx[0][ialt]) { + /* All IMGHEAD keywords are inherited for this ialt. */ + inherit[ialt] = 1; + + if (alts->arridx[icol][ialt] < alts->arridx[0][ialt]) { + /* The extra axes are also inherited. */ + alts->arridx[icol][ialt] = alts->arridx[0][ialt]; + } + } + + (*nwcs)++; + } + } + + /* Count every "a" found in any IMGHEAD keyword... */ + if (alts->arridx[0][ialt]) { + if (inherit[ialt]) { + /* ...but not if the IMGHEAD keywords will be inherited. */ + alts->arridx[0][ialt] = 0; + alts->imgherit = 1; + } else if (alts->arridx[0][ialt] > 0) { + (*nwcs)++; + } + } + + /* We need a struct for every "a" found in a PIXLIST keyword. */ + if (alts->pixidx[ialt]) { + (*nwcs)++; + } + } + + + if (*nwcs) { + /* Allocate memory for the required number of wcsprm structs. */ + if (!(*wcs = calloc(*nwcs, sizeof(struct wcsprm)))) { + return 2; + } + + /* Initialize each wcsprm struct. */ + wcsp = *wcs; + *nwcs = 0; + for (icol = 0; icol <= ncol; icol++) { + for (ialt = 0; ialt < 27; ialt++) { + if (alts->arridx[icol][ialt] > 0) { + /* Image-header representations that are not for inheritance + (icol == 0) or binary table image array representations. */ + wcsp->flag = -1; + npvmax = alts->npv[icol][ialt]; + npsmax = alts->nps[icol][ialt]; + if ((status = wcsinit(1, (int)(alts->arridx[icol][ialt]), wcsp, + npvmax, npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record the table column number. */ + wcsp->colnum = icol; + + /* On the second pass alts->arridx[icol][27] indexes the array of + wcsprm structs. */ + alts->arridx[icol][ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that this column has no WCS for this "a". */ + alts->arridx[icol][ialt] = -1; + } + } + } + + for (ialt = 0; ialt < 27; ialt++) { + if (alts->pixidx[ialt]) { + /* Pixel lists representations. */ + wcsp->flag = -1; + npvmax = alts->pixnpv[ialt]; + npsmax = alts->pixnps[ialt]; + if ((status = wcsinit(1, (int)(alts->pixidx[ialt]), wcsp, npvmax, + npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record the pixel list column numbers. */ + mask = (1 << ialt); + for (icol = 1, ix = 0; icol <= ncol; icol++) { + if (alts->pixlist[icol] & mask) { + wcsp->colax[ix++] = icol; + } + } + + /* alts->pixidx[] indexes the array of wcsprm structs. */ + alts->pixidx[ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that this column is not a pixel list axis for this "a". */ + alts->pixidx[ialt] = -1; + } + } + } + + return status; +} + + +/*---------------------------------------------------------------------------- +* Return a pointer to the next wcsprm struct for a particular column number +* and alternate. +*---------------------------------------------------------------------------*/ + +struct wcsprm *wcsbth_idx( + struct wcsprm *wcs, + struct wcsbth_alts *alts, + int keytype, + int n, + char a) + +{ + const char as[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iwcs; + + if (!wcs) return 0x0; + + iwcs = -1; + for (; iwcs < 0 && alts->ialt < 27; alts->ialt++) { + /* Note that a == 0 applies to every alternate, otherwise this + loop simply determines the appropriate value of alts->ialt. */ + if (a && a != as[alts->ialt]) continue; + + if (keytype & (IMGHEAD | BIMGARR)) { + for (; iwcs < 0 && alts->icol <= alts->ncol; alts->icol++) { + /* Image header keywords, n == 0, apply to all columns, otherwise this + loop simply determines the appropriate value of alts->icol. */ + if (n && n != alts->icol) continue; + iwcs = alts->arridx[alts->icol][alts->ialt]; + } + + /* Break out of the loop to stop alts->ialt from being incremented. */ + if (iwcs >= 0) break; + + /* Start from scratch for the next alts->ialt. */ + alts->icol = 0; + } + + if (keytype & (IMGAUX | PIXLIST)) { + iwcs = alts->pixidx[alts->ialt]; + } + } + + return (iwcs >= 0) ? (wcs + iwcs) : 0x0; +} + + +/*---------------------------------------------------------------------------- +* Return the axis number associated with the specified column number in a +* particular pixel list coordinate representation. +*---------------------------------------------------------------------------*/ + +int wcsbth_colax( + struct wcsprm *wcs, + struct wcsbth_alts *alts, + int n, + char a) + +{ + int ix; + struct wcsprm *wcsp; + + if (!wcs) return 0; + + wcsp = wcs; + if (a != ' ') { + wcsp += alts->pixidx[a-'A'+1]; + } + + for (ix = 0; ix < wcsp->naxis; ix++) { + if (wcsp->colax[ix] == n) { + return ++ix; + } + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret the JDREF, JDREFI, and JDREFF keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_jdref(double *mjdref, const double *jdref) + +{ + /* Set MJDREF from JDREF. */ + if (undefined(mjdref[0] && undefined(mjdref[1]))) { + mjdref[0] = jdref[0] - 2400000.0; + mjdref[1] = jdref[1] - 0.5; + + if (mjdref[1] < 0.0) { + mjdref[0] -= 1.0; + mjdref[1] += 1.0; + } + } + + return 0; +} + +int wcsbth_jdrefi(double *mjdref, const double *jdrefi) + +{ + /* Set the integer part of MJDREF from JDREFI. */ + if (undefined(mjdref[0])) { + mjdref[0] = *jdrefi - 2400000.5; + } + + return 0; +} + + +int wcsbth_jdreff(double *mjdref, const double *jdreff) + +{ + /* Set the fractional part of MJDREF from JDREFF. */ + if (undefined(mjdref[1])) { + mjdref[1] = *jdreff; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret EPOCHa keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_epoch(double *equinox, const double *epoch) + +{ + /* If EQUINOXa is currently undefined then set it from EPOCHa. */ + if (undefined(*equinox)) { + *equinox = *epoch; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret VSOURCEa keywords. +*---------------------------------------------------------------------------*/ + +int wcsbth_vsource(double *zsource, const double *vsource) + +{ + double beta, c = 299792458.0; + + /* If ZSOURCEa is currently undefined then set it from VSOURCEa. */ + if (undefined(*zsource)) { + /* Convert relativistic Doppler velocity to redshift. */ + beta = *vsource/c; + *zsource = (1.0 + beta)/sqrt(1.0 - beta*beta) - 1.0; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Check validity of a TIMEPIXR keyvalue. +*---------------------------------------------------------------------------*/ + +int wcsbth_timepixr(double timepixr) + +{ + return (timepixr < 0.0 || 1.0 < timepixr); +} + + +/*---------------------------------------------------------------------------- +* Tie up loose ends. +*---------------------------------------------------------------------------*/ + +int wcsbth_final( + struct wcsbth_alts *alts, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, status; + + if (alts->arridx) free(alts->arridx); + if (alts->npv) free(alts->npv); + if (alts->nps) free(alts->nps); + if (alts->pixlist) free(alts->pixlist); + + for (ialt = 0; ialt < *nwcs; ialt++) { + /* Interpret -TAB header keywords. */ + if ((status = wcstab(*wcs+ialt))) { + wcsvfree(nwcs, wcs); + return status; + } + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcserr.c b/testbed/astropy__astropy/cextern/wcslib/C/wcserr.c new file mode 100644 index 0000000000000000000000000000000000000000..4677042ce3248b79d5d0f7a50661cb7ff4cf1400 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcserr.c @@ -0,0 +1,191 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + Module author: Michael Droettboom + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcserr.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsprintf.h" + +static int wcserr_enabled = 0; + +/*--------------------------------------------------------------------------*/ + +int wcserr_enable(int enable) + +{ + return wcserr_enabled = (enable ? 1 : 0); +} + +/*--------------------------------------------------------------------------*/ + +int wcserr_prt( + const struct wcserr *err, + const char *prefix) + +{ + if (!wcserr_enabled) { + wcsprintf("Error messaging is not enabled, use wcserr_enable().\n"); + return 2; + } + + if (err == 0x0) { + return 0; + } + + if (err->status) { + if (prefix == 0x0) prefix = ""; + + if (err->status > 0) { + wcsprintf("%sERROR %d in %s() at line %d of file %s:\n%s%s.\n", + prefix, err->status, err->function, err->line_no, err->file, prefix, + err->msg); + } else { + /* An informative message only. */ + wcsprintf("%sINFORMATIVE message from %s() at line %d of file " + "%s:\n%s%s.\n", prefix, err->function, err->line_no, err->file, + prefix, err->msg); + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcserr_clear( + struct wcserr **errp) + +{ + if (*errp) { + if ((*errp)->msg) { + free((*errp)->msg); + } + free(*errp); + *errp = 0x0; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcserr_set( + struct wcserr **errp, + int status, + const char *function, + const char *file, + int line_no, + const char *format, + ...) + +{ + char fmt[2048]; + int msglen; + struct wcserr *err; + va_list argp; + + if (!wcserr_enabled) return status; + + if (errp == 0x0) { + return status; + } + err = *errp; + + if (status) { + if (err == 0x0) { + *errp = err = calloc(1, sizeof(struct wcserr)); + } + + if (err == 0x0) { + return status; + } + + err->status = status; + err->function = function; + err->file = file; + err->line_no = line_no; + err->msg = 0x0; + + /* Workaround for a compiler segv from gcc 4.2.1 in MacOSX 10.7. */ + strncpy(fmt, format, 2048); + + /* Determine the required message buffer size. */ + va_start(argp, format); + msglen = vsnprintf(0x0, 0, fmt, argp) + 1; + va_end(argp); + + if (msglen <= 0 || (err->msg = malloc(msglen)) == 0x0) { + wcserr_clear(errp); + return status; + } + + /* Write the message. */ + va_start(argp, format); + msglen = vsnprintf(err->msg, msglen, fmt, argp); + va_end(argp); + + if (msglen < 0) { + wcserr_clear(errp); + } + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcserr_copy( + const struct wcserr *src, + struct wcserr *dst) + +{ + int msglen; + + if (src == 0x0) { + if (dst) { + memset(dst, 0, sizeof(struct wcserr)); + } + return 0; + } + + if (dst) { + memcpy(dst, src, sizeof(struct wcserr)); + + if (src->msg) { + msglen = strlen(src->msg) + 1; + if ((dst->msg = malloc(msglen))) { + strcpy(dst->msg, src->msg); + } + } + } + + return src->status; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcserr.h b/testbed/astropy__astropy/cextern/wcslib/C/wcserr.h new file mode 100644 index 0000000000000000000000000000000000000000..53e6417d8eae148f01d71f681c71538739b6fd77 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcserr.h @@ -0,0 +1,255 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + Module author: Michael Droettboom + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcserr.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* Summary of the wcserr routines +* ------------------------------ +* Most of the structs in WCSLIB contain a pointer to a wcserr struct as a +* member. Functions in WCSLIB that return an error status code can also +* allocate and set a detailed error message in this struct which also +* identifies the function, source file, and line number where the error +* occurred. +* +* For example: +* += struct prjprm prj; += wcserr_enable(1); += if (prjini(&prj)) { += // Print the error message to stderr. += wcsprintf_set(stderr); += wcserr_prt(prj.err, 0x0); += } +* +* A number of utility functions used in managing the wcserr struct are for +* internal use only. They are documented here solely as an aid to +* understanding the code. They are not intended for external use - the API +* may change without notice! +* +* +* wcserr struct - Error message handling +* -------------------------------------- +* The wcserr struct contains the numeric error code, a textual description of +* the error, and information about the function, source file, and line number +* where the error was generated. +* +* int status +* Numeric status code associated with the error, the meaning of which +* depends on the function that generated it. See the documentation for +* the particular function. +* +* int line_no +* Line number where the error occurred as given by the __LINE__ +* preprocessor macro. +* +* const char *function +* Name of the function where the error occurred. +* +* const char *file +* Name of the source file where the error occurred as given by the +* __FILE__ preprocessor macro. +* +* char *msg +* Informative error message. +* +* +* wcserr_enable() - Enable/disable error messaging +* ------------------------------------------------ +* wcserr_enable() enables or disables wcserr error messaging. By default it +* is disabled. +* +* PLEASE NOTE: This function is not thread-safe. +* +* Given: +* enable int If true (non-zero), enable error messaging, else +* disable it. +* +* Function return value: +* int Status return value: +* 0: Error messaging is disabled. +* 1: Error messaging is enabled. +* +* +* wcserr_prt() - Print a wcserr struct +* ------------------------------------ +* wcserr_prt() prints the error message (if any) contained in a wcserr struct. +* It uses the wcsprintf() functions. +* +* Given: +* err const struct wcserr* +* The error object. If NULL, nothing is printed. +* +* prefix const char * +* If non-NULL, each output line will be prefixed with +* this string. +* +* Function return value: +* int Status return value: +* 0: Success. +* 2: Error messaging is not enabled. +* +* +* wcserr_clear() - Clear a wcserr struct +* -------------------------------------- +* wcserr_clear() clears (deletes) a wcserr struct. +* +* Given and returned: +* err struct wcserr** +* The error object. If NULL, nothing is done. Set to +* NULL on return. +* +* Function return value: +* int Status return value: +* 0: Success. +* +* +* wcserr_set() - Fill in the contents of an error object +* ------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcserr_set() fills a wcserr struct with information about an error. +* +* A convenience macro, WCSERR_SET, provides the source file and line number +* information automatically. +* +* Given and returned: +* err struct wcserr** +* Error object. +* +* If err is NULL, returns the status code given without +* setting an error message. +* +* If *err is NULL, allocates memory for a wcserr struct +* (provided that status is non-zero). +* +* Given: +* status int Numeric status code to set. If 0, then *err will be +* deleted and *err will be returned as NULL. +* +* function const char * +* Name of the function generating the error. This +* must point to a constant string, i.e. in the +* initialized read-only data section ("data") of the +* executable. +* +* file const char * +* Name of the source file generating the error. This +* must point to a constant string, i.e. in the +* initialized read-only data section ("data") of the +* executable such as given by the __FILE__ preprocessor +* macro. +* +* line_no int Line number in the source file generating the error +* such as given by the __LINE__ preprocessor macro. +* +* format const char * +* Format string of the error message. May contain +* printf-style %-formatting codes. +* +* ... mixed The remaining variable arguments are applied (like +* printf) to the format string to generate the error +* message. +* +* Function return value: +* int The status return code passed in. +* +* +* wcserr_copy() - Copy an error object +* ------------------------------------ +* INTERNAL USE ONLY. +* +* wcserr_copy() copies one error object to another. Use of this function +* should be avoided in general since the function, source file, and line +* number information copied to the destination may lose its context. +* +* Given: +* src const struct wcserr* +* Source error object. If src is NULL, dst is cleared. +* +* Returned: +* dst struct wcserr* +* Destination error object. If NULL, no copy is made. +* +* Function return value: +* int Numeric status code of the source error object. +* +* +* WCSERR_SET() macro - Fill in the contents of an error object +* ------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* WCSERR_SET() is a preprocessor macro that helps to fill in the argument list +* of wcserr_set(). It takes status as an argument of its own and provides the +* name of the source file and the line number at the point where invoked. It +* assumes that the err and function arguments of wcserr_set() will be provided +* by variables of the same names. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSERR +#define WCSLIB_WCSERR + +#ifdef __cplusplus +extern "C" { +#endif + +struct wcserr { + int status; /* Status code for the error. */ + int line_no; /* Line number where the error occurred. */ + const char *function; /* Function name. */ + const char *file; /* Source file name. */ + char *msg; /* Informative error message. */ +}; + +/* Size of the wcserr struct in int units, used by the Fortran wrappers. */ +#define ERRLEN (sizeof(struct wcserr)/sizeof(int)) + +int wcserr_enable(int enable); + +int wcserr_prt(const struct wcserr *err, const char *prefix); + +int wcserr_clear(struct wcserr **err); + + +/* INTERNAL USE ONLY -------------------------------------------------------*/ + +int wcserr_set(struct wcserr **err, int status, const char *function, + const char *file, int line_no, const char *format, ...); + +int wcserr_copy(const struct wcserr *src, struct wcserr *dst); + +/* Convenience macro for invoking wcserr_set(). */ +#define WCSERR_SET(status) err, status, function, __FILE__, __LINE__ + +#ifdef __cplusplus +} +#endif + +#endif /* WSCLIB_WCSERR */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.c b/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.c new file mode 100644 index 0000000000000000000000000000000000000000..853fbb0798081164d47fe904dce5091434238123 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.c @@ -0,0 +1,1098 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsfix.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcstrig.h" +#include "wcsutil.h" +#include "lin.h" +#include "sph.h" +#include "wcs.h" +#include "wcsunits.h" +#include "wcsfix.h" + +extern const int WCSSET; + +/* Maximum number of coordinate axes that can be handled. */ +#define NMAX 16 + +/* Map status return value to message. */ +const char *wcsfix_errmsg[] = { + "Success", + "Null wcsprm pointer passed", + "Memory allocation failed", + "Linear transformation matrix is singular", + "Inconsistent or unrecognized coordinate axis types", + "Invalid parameter value", + "Invalid coordinate transformation parameters", + "Ill-conditioned coordinate transformation parameters", + "All of the corner pixel coordinates are invalid", + "Could not determine reference pixel coordinate", + "Could not determine reference pixel value"}; + +/* Map error returns for lower-level routines. */ +const int fix_linerr[] = { + FIXERR_SUCCESS, /* 0: LINERR_SUCCESS */ + FIXERR_NULL_POINTER, /* 1: LINERR_NULL_POINTER */ + FIXERR_MEMORY, /* 2: LINERR_MEMORY */ + FIXERR_SINGULAR_MTX, /* 3: LINERR_SINGULAR_MTX */ + FIXERR_BAD_PARAM, /* 4: LINERR_DISTORT_INIT */ + FIXERR_NO_REF_PIX_COORD, /* 5: LINERR_DISTORT */ + FIXERR_NO_REF_PIX_VAL /* 6: LINERR_DEDISTORT */ +}; + +const int fix_wcserr[] = { + FIXERR_SUCCESS, /* 0: WCSERR_SUCCESS */ + FIXERR_NULL_POINTER, /* 1: WCSERR_NULL_POINTER */ + FIXERR_MEMORY, /* 2: WCSERR_MEMORY */ + FIXERR_SINGULAR_MTX, /* 3: WCSERR_SINGULAR_MTX */ + FIXERR_BAD_CTYPE, /* 4: WCSERR_BAD_CTYPE */ + FIXERR_BAD_PARAM, /* 5: WCSERR_BAD_PARAM */ + FIXERR_BAD_COORD_TRANS, /* 6: WCSERR_BAD_COORD_TRANS */ + FIXERR_ILL_COORD_TRANS, /* 7: WCSERR_ILL_COORD_TRANS */ + FIXERR_BAD_CORNER_PIX, /* 8: WCSERR_BAD_PIX */ + FIXERR_NO_REF_PIX_VAL, /* 9: WCSERR_BAD_WORLD */ + FIXERR_NO_REF_PIX_VAL /* 10: WCSERR_BAD_WORLD_COORD */ + /* ...others not used */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define WCSFIX_ERRMSG(status) WCSERR_SET(status), wcsfix_errmsg[status] + +/*--------------------------------------------------------------------------*/ + +int wcsfix(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[]) + +{ + int status = 0; + + if ((stat[CDFIX] = cdfix(wcs)) > 0) { + status = 1; + } + + if ((stat[DATFIX] = datfix(wcs)) > 0) { + status = 1; + } + + if ((stat[OBSFIX] = obsfix(0, wcs)) > 0) { + status = 1; + } + + if ((stat[UNITFIX] = unitfix(ctrl, wcs)) > 0) { + status = 1; + } + + if ((stat[SPCFIX] = spcfix(wcs)) > 0) { + status = 1; + } + + if ((stat[CELFIX] = celfix(wcs)) > 0) { + status = 1; + } + + if ((stat[CYLFIX] = cylfix(naxis, wcs)) > 0) { + status = 1; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcsfixi(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[], + struct wcserr info[]) + +{ + int ifix, status = 0; + struct wcserr err; + + /* Handling the status values returned from the sub-fixers is trickier than + it might seem, especially considering that wcs->err may contain an error + status on input which should be preserved if no translation errors occur. + The simplest way seems to be to save a copy of wcs->err and clear it before + each sub-fixer. The last real error to occur, excluding informative + messages, is the one returned. + + To get informative messages from spcfix() it must precede celfix() and + cylfix(). The latter call wcsset() which also translates AIPS-convention + spectral axes. */ + wcserr_copy(wcs->err, &err); + + for (ifix = CDFIX; ifix < NWCSFIX; ifix++) { + /* Clear (delete) wcs->err. */ + wcserr_clear(&(wcs->err)); + + switch (ifix) { + case CDFIX: + stat[ifix] = cdfix(wcs); + break; + case DATFIX: + stat[ifix] = datfix(wcs); + break; + case OBSFIX: + stat[ifix] = obsfix(0, wcs); + break; + case UNITFIX: + stat[ifix] = unitfix(ctrl, wcs); + break; + case SPCFIX: + stat[ifix] = spcfix(wcs); + break; + case CELFIX: + stat[ifix] = celfix(wcs); + break; + case CYLFIX: + stat[ifix] = cylfix(naxis, wcs); + break; + default: + continue; + } + + if (stat[ifix] == FIXERR_NO_CHANGE) { + /* No change => no message. */ + wcserr_copy(0x0, info+ifix); + + } else if (stat[ifix] == 0) { + /* Successful translation, but there may be an informative message. */ + if (wcs->err && wcs->err->status < 0) { + wcserr_copy(wcs->err, info+ifix); + } else { + wcserr_copy(0x0, info+ifix); + } + + } else { + /* An informative message or error message. */ + wcserr_copy(wcs->err, info+ifix); + + if ((status = (stat[ifix] > 0))) { + /* It was an error, replace the previous one. */ + wcserr_copy(wcs->err, &err); + } + } + } + + /* Restore the last error to occur. */ + if (err.status) { + wcserr_copy(&err, wcs->err); + } else { + wcserr_clear(&(wcs->err)); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int cdfix(struct wcsprm *wcs) + +{ + int i, k, naxis, status = FIXERR_NO_CHANGE; + double *cd; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + + if ((wcs->altlin & 1) || !(wcs->altlin & 2)) { + /* Either we have PCi_ja or there are no CDi_ja. */ + return FIXERR_NO_CHANGE; + } + + naxis = wcs->naxis; + status = FIXERR_NO_CHANGE; + for (i = 0; i < naxis; i++) { + /* Row of zeros? */ + cd = wcs->cd + i * naxis; + for (k = 0; k < naxis; k++, cd++) { + if (*cd != 0.0) goto next; + } + + /* Column of zeros? */ + cd = wcs->cd + i; + for (k = 0; k < naxis; k++, cd += naxis) { + if (*cd != 0.0) goto next; + } + + cd = wcs->cd + i * (naxis + 1); + *cd = 1.0; + status = 0; + +next: ; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +static int parse_date(const char *buf, int *hour, int *minute, double *sec) + +{ + char ctmp[72]; + + if (sscanf(buf, "%2d:%2d:%s", hour, minute, ctmp) < 3 || + wcsutil_str2double(ctmp, sec)) { + return 1; + } + + return 0; +} + + +static void write_date(char *buf, int hour, int minute, double sec) + +{ + char ctmp[72]; + + wcsutil_double2str(ctmp, "%04.1f", sec); + sprintf(buf, "T%.2d:%.2d:%s", hour, minute, ctmp); +} + + +static char *newline(char **cp) + +{ + int k; + + if ((k = strlen(*cp))) { + *cp += k; + strcat(*cp, ".\n"); + *cp += 2; + } + + return *cp; +} + + +int datfix(struct wcsprm *wcs) + +{ + static const char *function = "datfix"; + + /* MJD of J2000.0 and B1900.0. */ + const double mjd2000 = 51544.5; + const double mjd1900 = 15019.81352; + + /* Days per Julian year and per tropical year. */ + const double djy = 365.25; + const double dty = 365.242198781; + + const char *dateid; + char *cp, *date, infomsg[512], orig_date[72]; + int day, dd, hour = 0, i, jd, minute = 0, month, msec, n4, status, year; + double bepoch, jepoch, mjd, sec = 0.0, t, *wcsmjd; + struct wcserr **err; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + cp = infomsg; + *cp = '\0'; + status = FIXERR_NO_CHANGE; + + for (i = 0; i < 4; i++) { + if (i == 0) { + dateid = "OBS"; + date = wcs->dateobs; + wcsmjd = &(wcs->mjdobs); + } else if (i == 1) { + dateid = "BEG"; + date = wcs->datebeg; + wcsmjd = &(wcs->mjdbeg); + } else if (i == 2) { + dateid = "AVG"; + date = wcs->dateavg; + wcsmjd = &(wcs->mjdavg); + } else if (i == 3) { + dateid = "END"; + date = wcs->dateend; + wcsmjd = &(wcs->mjdend); + } + + strncpy(orig_date, date, 72); + mjd = *wcsmjd; + + if (date[0] == '\0') { + + if (i == 0 && undefined(mjd)) { + /* See if we have jepoch or bepoch. */ + if (!undefined(wcs->jepoch)) { + mjd = mjd2000 + (wcs->jepoch - 2000.0)*djy; + *wcsmjd = mjd; + sprintf(newline(&cp), "Set MJD-OBS to %.6f from JEPOCH", mjd); + + } else if (!undefined(wcs->bepoch)) { + mjd = mjd1900 + (wcs->bepoch - 1900.0)*dty; + *wcsmjd = mjd; + sprintf(newline(&cp), "Set MJD-OBS to %.6f from BEPOCH", mjd); + } + } + + if (undefined(mjd)) { + /* No date information was provided. */ + + } else { + /* Calendar date from MJD. */ + jd = 2400001 + (int)mjd; + + n4 = 4*(jd + ((2*((4*jd - 17918)/146097)*3)/4 + 1)/2 - 37); + dd = 10*(((n4-237)%1461)/4) + 5; + + year = n4/1461 - 4712; + month = (2 + dd/306)%12 + 1; + day = (dd%306)/10 + 1; + sprintf(date, "%.4d-%.2d-%.2d", year, month, day); + + /* Write time part only if non-zero. */ + if ((t = mjd - (int)mjd) > 0.0) { + t *= 24.0; + hour = (int)t; + t = 60.0 * (t - hour); + minute = (int)t; + sec = 60.0 * (t - minute); + + /* Round to 1ms. */ + dd = 60000*(60*hour + minute) + (int)(1000*(sec+0.0005)); + hour = dd / 3600000; + dd -= 3600000 * hour; + minute = dd / 60000; + msec = dd - 60000 * minute; + sprintf(date+10, "T%.2d:%.2d:%.2d", hour, minute, msec/1000); + + /* Write fractions of a second only if non-zero. */ + if (msec%1000) { + sprintf(date+19, ".%.3d", msec%1000); + } + } + } + + } else { + if (strlen(date) < 8) { + /* Can't be a valid date. */ + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s' is too short", + dateid, date); + continue; + } + + /* Identify the date format. */ + if (date[4] == '-' && date[7] == '-') { + /* Standard year-2000 form: CCYY-MM-DD[Thh:mm:ss[.sss...]] */ + if (sscanf(date, "%4d-%2d-%2d", &year, &month, &day) < 3) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s'", dateid, date); + continue; + } + + if (date[10] == 'T') { + if (parse_date(date+11, &hour, &minute, &sec)) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid time in DATE-%s '%s'", dateid, + date+11); + continue; + } + } else if (date[10] == ' ') { + hour = 0; + minute = 0; + sec = 0.0; + if (parse_date(date+11, &hour, &minute, &sec)) { + write_date(date+10, hour, minute, sec); + } else { + date[10] = 'T'; + } + } + + } else if (date[4] == '/' && date[7] == '/') { + /* Also allow CCYY/MM/DD[Thh:mm:ss[.sss...]] */ + if (sscanf(date, "%4d/%2d/%2d", &year, &month, &day) < 3) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s'", dateid, date); + continue; + } + + if (date[10] == 'T') { + if (parse_date(date+11, &hour, &minute, &sec)) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid time in DATE-%s '%s'", dateid, + date+11); + continue; + } + } else if (date[10] == ' ') { + hour = 0; + minute = 0; + sec = 0.0; + if (parse_date(date+11, &hour, &minute, &sec)) { + write_date(date+10, hour, minute, sec); + } else { + date[10] = 'T'; + } + } + + /* Looks ok, fix it up. */ + date[4] = '-'; + date[7] = '-'; + + } else { + if (i == 0 && date[2] == '/' && date[5] == '/') { + /* Old format DATE-OBS date: DD/MM/YY, also allowing DD/MM/CCYY. */ + if (sscanf(date, "%2d/%2d/%4d", &day, &month, &year) < 3) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s'", dateid, + date); + continue; + } + + } else if (i == 0 && date[2] == '-' && date[5] == '-') { + /* Also recognize DD-MM-YY and DD-MM-CCYY */ + if (sscanf(date, "%2d-%2d-%4d", &day, &month, &year) < 3) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s'", dateid, + date); + continue; + } + + } else { + /* Not a valid date format. */ + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), "Invalid DATE-%s format '%s'", dateid, date); + continue; + } + + if (year < 100) year += 1900; + + /* Doesn't have a time. */ + sprintf(date, "%.4d-%.2d-%.2d", year, month, day); + } + + /* Compute MJD. */ + mjd = (double)((1461*(year - (12-month)/10 + 4712))/4 + + (306*((month+9)%12) + 5)/10 + - (3*((year - (12-month)/10 + 4900)/100))/4 + + day - 2399904) + + (hour + (minute + sec/60.0)/60.0)/24.0; + + if (undefined(*wcsmjd)) { + *wcsmjd = mjd; + sprintf(newline(&cp), "Set MJD-%s to %.6f from DATE-%s", dateid, mjd, + dateid); + + } else { + /* Check for consistency. */ + if (fabs(mjd - *wcsmjd) > 0.001) { + status = FIXERR_BAD_PARAM; + sprintf(newline(&cp), + "Invalid parameter values: MJD-%s and DATE-%s are inconsistent", + dateid, dateid); + } + } + + if (i == 0) { + if (!undefined(wcs->jepoch)) { + /* Check consistency of JEPOCH. */ + jepoch = 2000.0 + (mjd - mjd2000) / djy; + + if (fabs(jepoch - wcs->jepoch) > 0.000002) { + /* Informational only, no error. */ + sprintf(newline(&cp), "JEPOCH is inconsistent with DATE-OBS"); + } + } + + if (!undefined(wcs->bepoch)) { + /* Check consistency of BEPOCH. */ + bepoch = 1900.0 + (mjd - mjd1900) / dty; + + if (fabs(bepoch - wcs->bepoch) > 0.000002) { + /* Informational only, no error. */ + sprintf(newline(&cp), "BEPOCH is inconsistent with DATE-OBS"); + } + } + } + } + + if (strncmp(orig_date, date, 72)) { + if (orig_date[0] == '\0') { + sprintf(newline(&cp), "Set DATE-%s to '%s' from MJD-%s", dateid, date, + dateid); + } else { + sprintf(newline(&cp), "Changed DATE-%s from '%s' to '%s'", dateid, + orig_date, date); + } + + if (status == FIXERR_NO_CHANGE) status = 0; + } + } + + if (*infomsg) { + wcserr_set(WCSERR_SET(FIXERR_DATE_FIX), infomsg); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int obsfix(int ctrl, struct wcsprm *wcs) + +{ + static const char *function = "obsfix"; + + /* IAU(1976) ellipsoid (as prescribed by WCS Paper VII). */ + const double a = 6378140.0, f = 1.0 / 298.2577; + const double e2 = (2.0 - f)*f; + + char *cp, infomsg[256]; + int havelbh = 7, havexyz = 7, i, k, status; + double coslat, coslng, d, hgt, lat, lng, n, r2, rho, sinlat, sinlng, x, y, + z, zeta; + struct wcserr **err; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + /* Set masks for checking partially-defined coordinate triplets. */ + havexyz -= 1*undefined(wcs->obsgeo[0]); + havexyz -= 2*undefined(wcs->obsgeo[1]); + havexyz -= 4*undefined(wcs->obsgeo[2]); + havelbh -= 1*undefined(wcs->obsgeo[3]); + havelbh -= 2*undefined(wcs->obsgeo[4]); + havelbh -= 4*undefined(wcs->obsgeo[5]); + + if (ctrl == 2) { + /* Make no changes. */ + if (0 < havexyz && havexyz < 7) { + return wcserr_set(WCSERR_SET(FIXERR_BAD_PARAM), + "Partially undefined Cartesian coordinate triplet"); + } + + if (0 < havelbh && havelbh < 7) { + return wcserr_set(WCSERR_SET(FIXERR_BAD_PARAM), + "Partially undefined Geodetic coordinate triplet"); + } + + if (havexyz == 0 || havelbh == 0) { + return FIXERR_NO_CHANGE; + } + } + + if (havexyz == 0 && havelbh == 0) { + return FIXERR_NO_CHANGE; + } + + + infomsg[0] = '\0'; + status = FIXERR_NO_CHANGE; + + if (havelbh == 7) { + /* Compute (x,y,z) from (lng,lat,hgt). */ + sincosd(wcs->obsgeo[3], &sinlng, &coslng); + sincosd(wcs->obsgeo[4], &sinlat, &coslat); + n = a / sqrt(1.0 - e2*sinlat*sinlat); + rho = n + wcs->obsgeo[5]; + + x = rho*coslng*coslat; + y = rho*sinlng*coslat; + z = (rho - n*e2)*sinlat; + + if (havexyz < 7) { + /* One or more of the Cartesian elements was undefined. */ + status = 0; + cp = infomsg; + + if (ctrl == 1 || !(havexyz & 1)) { + wcs->obsgeo[0] = x; + sprintf(cp, "%s OBSGEO-X to %12.3f from OBSGEO-[LBH]", + (havexyz & 1) ? "Reset" : "Set", x); + } + + if (ctrl == 1 || !(havexyz & 2)) { + wcs->obsgeo[1] = y; + + if ((k = strlen(cp))) { + strcat(cp+k, ".\n"); + cp += k + 2; + } + + sprintf(cp, "%s OBSGEO-Y to %12.3f from OBSGEO-[LBH]", + (havexyz & 2) ? "Reset" : "Set", y); + } + + if (ctrl == 1 || !(havexyz & 4)) { + wcs->obsgeo[2] = z; + if ((k = strlen(cp))) { + strcat(cp+k, ".\n"); + cp += k + 2; + } + + sprintf(cp, "%s OBSGEO-Z to %12.3f from OBSGEO-[LBH]", + (havexyz & 4) ? "Reset" : "Set", z); + } + + wcserr_set(WCSERR_SET(FIXERR_OBSGEO_FIX), infomsg); + + if (havexyz == 0) { + /* Skip the consistency check. */ + return status; + } + } + + } else if (havexyz == 7) { + /* Compute (lng,lat,hgt) from (x,y,z). */ + x = wcs->obsgeo[0]; + y = wcs->obsgeo[1]; + z = wcs->obsgeo[2]; + r2 = x*x + y*y; + + /* Iterate over the value of zeta. */ + zeta = z; + for (i = 0; i < 4; i++) { + rho = sqrt(r2 + zeta*zeta); + sinlat = zeta / rho; + n = a / sqrt(1.0 - e2*sinlat*sinlat); + + zeta = z / (1.0 - n*e2/rho); + } + + lng = atan2d(y, x); + lat = asind(sinlat); + hgt = rho - n; + + if (havelbh < 7) { + /* One or more of the Geodetic elements was undefined. */ + status = 0; + cp = infomsg; + + if (ctrl == 1 || !(havelbh & 1)) { + wcs->obsgeo[3] = lng; + sprintf(cp, "%s OBSGEO-L to %12.6f from OBSGEO-[XYZ]", + (havelbh & 1) ? "Reset" : "Set", lng); + } + + if (ctrl == 1 || !(havelbh & 2)) { + wcs->obsgeo[4] = lat; + if ((k = strlen(cp))) { + strcat(cp+k, ".\n"); + cp += k + 2; + } + + sprintf(cp, "%s OBSGEO-B to %12.6f from OBSGEO-[XYZ]", + (havelbh & 2) ? "Reset" : "Set", lat); + } + + if (ctrl == 1 || !(havelbh & 4)) { + wcs->obsgeo[5] = hgt; + if ((k = strlen(cp))) { + strcat(cp+k, ".\n"); + cp += k + 2; + } + + sprintf(cp, "%s OBSGEO-H to %12.3f from OBSGEO-[XYZ]", + (havelbh & 4) ? "Reset" : "Set", hgt); + } + + wcserr_set(WCSERR_SET(FIXERR_OBSGEO_FIX), infomsg); + + if (havelbh == 0) { + /* Skip the consistency check. */ + return status; + } + } + + /* Compute (x,y,z) from (lng,lat,hgt) for consistency checking. */ + sincosd(wcs->obsgeo[3], &sinlng, &coslng); + sincosd(wcs->obsgeo[4], &sinlat, &coslat); + n = a / sqrt(1.0 - e2*sinlat*sinlat); + rho = n + wcs->obsgeo[5]; + + x = rho*coslng*coslat; + y = rho*sinlng*coslat; + z = (rho - n*e2)*sinlat; + } + + + /* Check consistency. */ + r2 = 0.0; + d = wcs->obsgeo[0] - x; + r2 += d*d; + d = wcs->obsgeo[1] - y; + r2 += d*d; + d = wcs->obsgeo[2] - z; + r2 += d*d; + + if (1.0 < r2) { + d = sqrt(r2); + return wcserr_set(WCSERR_SET(FIXERR_BAD_PARAM), + "Observatory coordinates inconsistent by %.1f metres", d); + } + + return status; +} + + +/*--------------------------------------------------------------------------*/ + +int unitfix(int ctrl, struct wcsprm *wcs) + +{ + const char *function = "unitfix"; + + int i, msglen, result, status = FIXERR_NO_CHANGE; + char orig_unit[72], msg[512], msgtmp[72]; + struct wcserr **err; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + strncpy(msg, "Changed units:", 512); + + for (i = 0; i < wcs->naxis; i++) { + strncpy(orig_unit, wcs->cunit[i], 72); + result = wcsutrne(ctrl, wcs->cunit[i], &(wcs->err)); + if (result == 0 || result == 12) { + msglen = strlen(msg); + if (msglen < 511) { + wcsutil_null_fill(72, orig_unit); + sprintf(msgtmp, "\n '%s' -> '%s',", orig_unit, wcs->cunit[i]); + strncpy(msg+msglen, msgtmp, 511-msglen); + status = FIXERR_UNITS_ALIAS; + } + } + } + + if (status == FIXERR_UNITS_ALIAS) { + /* Chop off the trailing ", ". */ + msglen = strlen(msg) - 2; + msg[msglen] = '\0'; + wcserr_set(WCSERR_SET(FIXERR_UNITS_ALIAS), msg); + + status = 0; + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int spcfix(struct wcsprm *wcs) + +{ + static const char *function = "spcfix"; + + char ctype[9], specsys[9]; + int i, status; + struct wcserr **err; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + for (i = 0; i < wcs->naxis; i++) { + /* Translate an AIPS-convention spectral type if present. */ + status = spcaips(wcs->ctype[i], wcs->velref, ctype, specsys); + if (status == 0) { + /* An AIPS type was found but it may match what we already have. */ + status = FIXERR_NO_CHANGE; + + /* Was specsys translated? */ + if (wcs->specsys[0] == '\0' && *specsys) { + strncpy(wcs->specsys, specsys, 9); + wcserr_set(WCSERR_SET(FIXERR_SPC_UPDATE), + "Changed SPECSYS to '%s'", specsys); + status = 0; + } + + /* Was ctype translated? Have to null-fill for comparing them. */ + wcsutil_null_fill(9, wcs->ctype[i]); + if (strncmp(wcs->ctype[i], ctype, 9)) { + /* ctype was translated... */ + if (status == 0) { + /* ...and specsys was also. */ + wcserr_set(WCSERR_SET(FIXERR_SPC_UPDATE), + "Changed CTYPE%d from '%s' to '%s', and SPECSYS to '%s' " + "(VELREF=%d)", i+1, wcs->ctype[i], ctype, wcs->specsys, + wcs->velref); + } else { + wcserr_set(WCSERR_SET(FIXERR_SPC_UPDATE), + "Changed CTYPE%d from '%s' to '%s' (VELREF=%d)", i+1, + wcs->ctype[i], ctype, wcs->velref); + status = 0; + } + + strncpy(wcs->ctype[i], ctype, 9); + } + + /* Tidy up. */ + if (status == 0) { + wcsutil_null_fill(72, wcs->ctype[i]); + wcsutil_null_fill(72, wcs->specsys); + } + + /* No need to check for others, wcsset() will fail if so. */ + return status; + + } else if (status == SPCERR_BAD_SPEC_PARAMS) { + /* An AIPS spectral type was found but with invalid velref. */ + return wcserr_set(WCSERR_SET(FIXERR_BAD_PARAM), + "Invalid parameter value: velref = %d", wcs->velref); + } + } + + return FIXERR_NO_CHANGE; +} + +/*--------------------------------------------------------------------------*/ + +int celfix(struct wcsprm *wcs) + +{ + static const char *function = "celfix"; + + int k, status; + struct celprm *wcscel = &(wcs->cel); + struct prjprm *wcsprj = &(wcscel->prj); + struct wcserr **err; + + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + /* Initialize if required. */ + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return fix_wcserr[status]; + } + + /* Was an NCP or GLS projection code translated? */ + if (wcs->lat >= 0) { + /* Check ctype. */ + if (strcmp(wcs->ctype[wcs->lat]+5, "NCP") == 0) { + strcpy(wcs->ctype[wcs->lng]+5, "SIN"); + strcpy(wcs->ctype[wcs->lat]+5, "SIN"); + + if (wcs->npvmax < wcs->npv + 2) { + /* Allocate space for two more PVi_ma keyvalues. */ + if (wcs->m_flag == WCSSET && wcs->pv == wcs->m_pv) { + if (!(wcs->pv = calloc(wcs->npv+2, sizeof(struct pvcard)))) { + wcs->pv = wcs->m_pv; + return wcserr_set(WCSFIX_ERRMSG(FIXERR_MEMORY)); + } + + wcs->npvmax = wcs->npv + 2; + wcs->m_flag = WCSSET; + + for (k = 0; k < wcs->npv; k++) { + wcs->pv[k] = wcs->m_pv[k]; + } + + if (wcs->m_pv) free(wcs->m_pv); + wcs->m_pv = wcs->pv; + + } else { + return wcserr_set(WCSFIX_ERRMSG(FIXERR_MEMORY)); + } + } + + wcs->pv[wcs->npv].i = wcs->lat + 1; + wcs->pv[wcs->npv].m = 1; + wcs->pv[wcs->npv].value = wcsprj->pv[1]; + (wcs->npv)++; + + wcs->pv[wcs->npv].i = wcs->lat + 1; + wcs->pv[wcs->npv].m = 2; + wcs->pv[wcs->npv].value = wcsprj->pv[2]; + (wcs->npv)++; + + return 0; + + } else if (strcmp(wcs->ctype[wcs->lat]+5, "GLS") == 0) { + strcpy(wcs->ctype[wcs->lng]+5, "SFL"); + strcpy(wcs->ctype[wcs->lat]+5, "SFL"); + + if (wcs->crval[wcs->lng] != 0.0 || wcs->crval[wcs->lat] != 0.0) { + /* In the AIPS convention, setting the reference longitude and + * latitude for GLS does not create an oblique graticule. A non-zero + * reference longitude introduces an offset in longitude in the normal + * way, whereas a non-zero reference latitude simply translates the + * reference point (i.e. the map as a whole) to that latitude. This + * might be effected by adjusting CRPIXja but that is complicated by + * the linear transformation and instead is accomplished here by + * setting theta_0. */ + if (wcs->npvmax < wcs->npv + 3) { + /* Allocate space for three more PVi_ma keyvalues. */ + if (wcs->m_flag == WCSSET && wcs->pv == wcs->m_pv) { + if (!(wcs->pv = calloc(wcs->npv+3, sizeof(struct pvcard)))) { + wcs->pv = wcs->m_pv; + return wcserr_set(WCSFIX_ERRMSG(FIXERR_MEMORY)); + } + + wcs->npvmax = wcs->npv + 3; + wcs->m_flag = WCSSET; + + for (k = 0; k < wcs->npv; k++) { + wcs->pv[k] = wcs->m_pv[k]; + } + + if (wcs->m_pv) free(wcs->m_pv); + wcs->m_pv = wcs->pv; + + } else { + return wcserr_set(WCSFIX_ERRMSG(FIXERR_MEMORY)); + } + } + + wcs->pv[wcs->npv].i = wcs->lng + 1; + wcs->pv[wcs->npv].m = 0; + wcs->pv[wcs->npv].value = 1.0; + (wcs->npv)++; + + /* Note that the reference longitude is still zero. */ + wcs->pv[wcs->npv].i = wcs->lng + 1; + wcs->pv[wcs->npv].m = 1; + wcs->pv[wcs->npv].value = 0.0; + (wcs->npv)++; + + wcs->pv[wcs->npv].i = wcs->lng + 1; + wcs->pv[wcs->npv].m = 2; + wcs->pv[wcs->npv].value = wcs->crval[wcs->lat]; + (wcs->npv)++; + } + + return 0; + } + } + + return FIXERR_NO_CHANGE; +} + +/*--------------------------------------------------------------------------*/ + +int cylfix(const int naxis[], struct wcsprm *wcs) + +{ + static const char *function = "cylfix"; + + unsigned short icnr, indx[NMAX], ncnr; + int j, k, stat[4], status; + double img[4][NMAX], lat, lng, phi[4], phi0, phimax, phimin, pix[4][NMAX], + *pixj, theta[4], theta0, world[4][NMAX], x, y; + struct wcserr **err; + + if (naxis == 0x0) return FIXERR_NO_CHANGE; + if (wcs == 0x0) return FIXERR_NULL_POINTER; + err = &(wcs->err); + + /* Initialize if required. */ + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return fix_wcserr[status]; + } + + /* Check that we have a cylindrical projection. */ + if (wcs->cel.prj.category != CYLINDRICAL) return FIXERR_NO_CHANGE; + if (wcs->naxis < 2) return FIXERR_NO_CHANGE; + + + /* Compute the native longitude in each corner of the image. */ + ncnr = 1 << wcs->naxis; + + for (k = 0; k < NMAX; k++) { + indx[k] = 1 << k; + } + + phimin = 1.0e99; + phimax = -1.0e99; + for (icnr = 0; icnr < ncnr;) { + /* Do four corners at a time. */ + for (j = 0; j < 4; j++, icnr++) { + pixj = pix[j]; + + for (k = 0; k < wcs->naxis; k++) { + if (icnr & indx[k]) { + *(pixj++) = naxis[k] + 0.5; + } else { + *(pixj++) = 0.5; + } + } + } + + if (!(status = wcsp2s(wcs, 4, NMAX, pix[0], img[0], phi, theta, world[0], + stat))) { + for (j = 0; j < 4; j++) { + if (phi[j] < phimin) phimin = phi[j]; + if (phi[j] > phimax) phimax = phi[j]; + } + } + } + + if (phimin > phimax) return fix_wcserr[status]; + + /* Any changes needed? */ + if (phimin >= -180.0 && phimax <= 180.0) return FIXERR_NO_CHANGE; + + + /* Compute the new reference pixel coordinates. */ + phi0 = (phimin + phimax) / 2.0; + theta0 = 0.0; + + if ((status = prjs2x(&(wcs->cel.prj), 1, 1, 1, 1, &phi0, &theta0, &x, &y, + stat))) { + if (status == PRJERR_BAD_PARAM) { + status = FIXERR_BAD_PARAM; + } else { + status = FIXERR_NO_REF_PIX_COORD; + } + return wcserr_set(WCSFIX_ERRMSG(status)); + } + + for (k = 0; k < wcs->naxis; k++) { + img[0][k] = 0.0; + } + img[0][wcs->lng] = x; + img[0][wcs->lat] = y; + + if ((status = linx2p(&(wcs->lin), 1, 0, img[0], pix[0]))) { + return wcserr_set(WCSFIX_ERRMSG(fix_linerr[status])); + } + + + /* Compute celestial coordinates at the new reference pixel. */ + if ((status = wcsp2s(wcs, 1, 0, pix[0], img[0], phi, theta, world[0], + stat))) { + return fix_wcserr[status]; + } + + /* Compute native coordinates of the celestial pole. */ + lng = 0.0; + lat = 90.0; + (void)sphs2x(wcs->cel.euler, 1, 1, 1, 1, &lng, &lat, phi, theta); + + wcs->crpix[wcs->lng] = pix[0][wcs->lng]; + wcs->crpix[wcs->lat] = pix[0][wcs->lat]; + wcs->crval[wcs->lng] = world[0][wcs->lng]; + wcs->crval[wcs->lat] = world[0][wcs->lat]; + wcs->lonpole = phi[0] - phi0; + + return wcsset(wcs); +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.h b/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.h new file mode 100644 index 0000000000000000000000000000000000000000..19b2c7c3785fa2b31a564fa87dadefb087ed9963 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsfix.h @@ -0,0 +1,510 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsfix.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcsfix routines +* ------------------------------ +* Routines in this suite identify and translate various forms of construct +* known to occur in FITS headers that violate the FITS World Coordinate System +* (WCS) standard described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) += += "Representations of time coordinates in FITS - += Time and relative dimension in space", += Rots, A.H., Bunclark, P.S., Calabretta, M.R., Allen, S.L., += Manchester, R.N., & Thompson, W.T. 2015, A&A, 574, A36 (WCS Paper VII) +* +* Repairs effected by these routines range from the translation of +* non-standard values for standard WCS keywords, to the repair of malformed +* coordinate representations. Some routines are also provided to check the +* consistency of pairs of keyvalues that define the same measure in two +* different ways, for example, as a date and an MJD. +* +* Non-standard keyvalues: +* ----------------------- +* AIPS-convention celestial projection types, NCP and GLS, and spectral +* types, 'FREQ-LSR', 'FELO-HEL', etc., set in CTYPEia are translated +* on-the-fly by wcsset() but without modifying the relevant ctype[], pv[] or +* specsys members of the wcsprm struct. That is, only the information +* extracted from ctype[] is translated when wcsset() fills in wcsprm::cel +* (celprm struct) or wcsprm::spc (spcprm struct). +* +* On the other hand, these routines do change the values of wcsprm::ctype[], +* wcsprm::pv[], wcsprm::specsys and other wcsprm struct members as +* appropriate to produce the same result as if the FITS header itself had +* been translated. +* +* Auxiliary WCS header information not used directly by WCSLIB may also be +* translated. For example, the older DATE-OBS date format (wcsprm::dateobs) +* is recast to year-2000 standard form, and MJD-OBS (wcsprm::mjdobs) will be +* deduced from it if not already set. +* +* Certain combinations of keyvalues that result in malformed coordinate +* systems, as described in Sect. 7.3.4 of Paper I, may also be repaired. +* These are handled by cylfix(). +* +* Non-standard keywords: +* ---------------------- +* The AIPS-convention CROTAn keywords are recognized as quasi-standard +* and as such are accomodated by wcsprm::crota[] and translated to +* wcsprm::pc[][] by wcsset(). These are not dealt with here, nor are any +* other non-standard keywords since these routines work only on the contents +* of a wcsprm struct and do not deal with FITS headers per se. In +* particular, they do not identify or translate CD00i00j, PC00i00j, PROJPn, +* EPOCH, VELREF or VSOURCEa keywords; this may be done by the FITS WCS +* header parser supplied with WCSLIB, refer to wcshdr.h. +* +* wcsfix() and wcsfixi() apply all of the corrections handled by the following +* specific functions which may also be invoked separately: +* +* - cdfix(): Sets the diagonal element of the CDi_ja matrix to 1.0 if all +* CDi_ja keywords associated with a particular axis are omitted. +* +* - datfix(): recast an older DATE-OBS date format in dateobs to year-2000 +* standard form. +* +* Derive mjdobs from dateobs if not already set. Alternatively, if mjdobs +* is set and dateobs isn't, then derive dateobs from it. If both are set, +* then check consistency. Likewise for datebeg and mjdbeg; dateavg and +* mjdavg; and dateend and mjdend. +* +* - obsfix(): if only one half of obsgeo[] is set, then derive the other +* half from it. If both halves are set, then check consistency. +* +* - unitfix(): translate some commonly used but non-standard unit strings in +* the CUNITia keyvalues, e.g. 'DEG' -> 'deg'. +* +* - spcfix(): translate AIPS-convention spectral types, 'FREQ-LSR', +* 'FELO-HEL', etc., in ctype[] as set from CTYPEia. +* +* - celfix(): translate AIPS-convention celestial projection types, NCP and +* GLS, in ctype[] as set from CTYPEia. +* +* - cylfix(): fixes WCS keyvalues for malformed cylindrical projections that +* suffer from the problem described in Sect. 7.3.4 of Paper I. +* +* +* wcsfix() - Translate a non-standard WCS struct +* ---------------------------------------------- +* wcsfix() is identical to wcsfixi(), but lacks the info argument. +* +* +* wcsfixi() - Translate a non-standard WCS struct +* ----------------------------------------------- +* wcsfixi() applies all of the corrections handled separately by cdfix(), +* datfix(), obsfix(), unitfix(), spcfix(), celfix(), and cylfix(). +* +* Given: +* ctrl int Do potentially unsafe translations of non-standard +* unit strings as described in the usage notes to +* wcsutrn(). +* +* naxis const int [] +* Image axis lengths. If this array pointer is set to +* zero then cylfix() will not be invoked. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Returned: +* stat int [NWCSFIX] +* Status returns from each of the functions. Use the +* preprocessor macros NWCSFIX to dimension this vector +* and CDFIX, DATFIX, OBSFIX, UNITFIX, SPCFIX, CELFIX, +* and CYLFIX to access its elements. A status value +* of -2 is set for functions that were not invoked. +* +* info struct wcserr [NWCSFIX] +* Status messages from each of the functions. Use the +* preprocessor macros NWCSFIX to dimension this vector +* and CDFIX, DATFIX, OBSFIX, UNITFIX, SPCFIX, CELFIX, +* and CYLFIX to access its elements. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: One or more of the translation functions +* returned an error. +* +* +* cdfix() - Fix erroneously omitted CDi_ja keywords +* ------------------------------------------------- +* cdfix() sets the diagonal element of the CDi_ja matrix to unity if all +* CDi_ja keywords associated with a given axis were omitted. According to +* Paper I, if any CDi_ja keywords at all are given in a FITS header then those +* not given default to zero. This results in a singular matrix with an +* intersecting row and column of zeros. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* datfix() - Translate DATE-OBS and derive MJD-OBS or vice versa +* -------------------------------------------------------------- +* datfix() translates the old DATE-OBS date format set in wcsprm::dateobs to +* year-2000 standard form (yyyy-mm-ddThh:mm:ss). +* +* datfix() derives wcsprm::mjdobs from wcsprm::datobs if not already set. +* Alternatively, if mjdobs is set and dateobs isn't, then it derives dateobs +* from it. If both are set but disagree by more than 0.001 day (86.4 seconds) +* then status 5 is returned. Likewise for wcsprm::datebeg and wcsprm::mjdbeg; +* wcsprm::dateavg and wcsprm::mjdavg; and wcsprm::dateend and wcsprm::mjdend. +* +* If neither dateobs nor mjdobs are set, but wcsprm::jepoch (primarily) or +* wcsprm::bepoch is, then both are derived from it. If jepoch and/or bepoch +* are set but disagree with dateobs or mjdobs by more than 0.000002 year +* (63.2 seconds), an informative message is produced. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* wcsprm::dateobs and/or wcsprm::mjdobs may be changed. +* wcsprm::datebeg and/or wcsprm::mjdbeg may be changed. +* wcsprm::dateavg and/or wcsprm::mjdavg may be changed. +* wcsprm::dateend and/or wcsprm::mjdend may be changed. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* 5: Invalid parameter value. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* The MJD algorithms used by datfix() are from D.A. Hatcher, 1984, QJRAS, +* 25, 53-55, as modified by P.T. Wallace for use in SLALIB subroutines CLDJ +* and DJCL. +* +* +* obsfix() - complete the OBSGEO-[XYZLBH] vector of observatory coordinates +* ------------------------------------------------------------------------- +* obsfix() completes the wcsprm::obsgeo vector of observatory coordinates. +* That is, if only the (x,y,z) Cartesian coordinate triplet or the (l,b,h) +* geodetic coordinate triplet are set, then it derives the other triplet from +* it. If both triplets are set, then it checks for consistency at the level +* of 1 metre. +* +* Given: +* ctrl int Flag that controls behaviour if one triplet is +* defined and the other is only partially defined: +* 0: Reset only the undefined elements of an +* incomplete coordinate triplet. +* 1: Reset all elements of an incomplete triplet. +* 2: Don't make any changes, check for consistency +* only. Returns an error if either of the two +* triplets is incomplete. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* wcsprm::obsgeo may be changed. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* 5: Invalid parameter value. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* 1: While the International Terrestrial Reference System (ITRS) is based +* solely on Cartesian coordinates, it recommends the use of the GRS80 +* ellipsoid in converting to geodetic coordinates. However, while WCS +* Paper III recommends ITRS Cartesian coordinates, Paper VII prescribes +* the use of the IAU(1976) ellipsoid for geodetic coordinates, and +* consequently that is what is used here. +* +* 2: For reference, parameters of commonly used global reference ellipsoids: +* += a (m) 1/f Standard += --------- ------------- -------------------------------- += 6378140 298.2577 IAU(1976) += 6378137 298.257222101 GRS80 += 6378137 298.257223563 WGS84 += 6378136 298.257 IERS(1989) += 6378136.6 298.25642 IERS(2003,2010), IAU(2009/2012) +* +* where f = (a - b) / a is the flattening, and a and b are the semi-major +* and semi-minor radii in metres. +* +* 3: The transformation from geodetic (lng,lat,hgt) to Cartesian (x,y,z) is +* += x = (n + hgt)*coslng*coslat, += y = (n + hgt)*sinlng*coslat, += z = (n*(1.0 - e^2) + hgt)*sinlat, +* +* where the "prime vertical radius", n, is a function of latitude +* += n = a / sqrt(1 - (e*sinlat)^2), +* +* and a, the equatorial radius, and e^2 = (2 - f)*f, the (first) +* eccentricity of the ellipsoid, are constants. obsfix() inverts these +* iteratively by writing +* += x = rho*coslng*coslat, += y = rho*sinlng*coslat, += zeta = rho*sinlat, +* +* where +* += rho = n + hgt, += = sqrt(x^2 + y^2 + zeta^2), += zeta = z / (1 - n*e^2/rho), +* +* and iterating over the value of zeta. Since e is small, a good first +* approximation is given by zeta = z. +* +* +* unitfix() - Correct aberrant CUNITia keyvalues +* ---------------------------------------------- +* unitfix() applies wcsutrn() to translate non-standard CUNITia keyvalues, +* e.g. 'DEG' -> 'deg', also stripping off unnecessary whitespace. +* +* Given: +* ctrl int Do potentially unsafe translations described in the +* usage notes to wcsutrn(). +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success (an alias was applied). +* 1: Null wcsprm pointer passed. +* +* When units are translated (i.e. status 0), status -2 +* is set in the wcserr struct to allow an informative +* message to be returned. +* +* +* spcfix() - Translate AIPS-convention spectral types +* --------------------------------------------------- +* spcfix() translates AIPS-convention spectral coordinate types, +* '{FREQ,FELO,VELO}-{LSR,HEL,OBS}' (e.g. 'FREQ-OBS', 'FELO-HEL', 'VELO-LSR') +* set in wcsprm::ctype[], subject to VELREF set in wcsprm::velref. +* +* Note that if wcs::specsys is already set then it will not be overridden. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. wcsprm::ctype[] +* and/or wcsprm::specsys may be changed. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* celfix() - Translate AIPS-convention celestial projection types +* --------------------------------------------------------------- +* celfix() translates AIPS-convention celestial projection types, NCP and +* GLS, set in the ctype[] member of the wcsprm struct. +* +* Two additional pv[] keyvalues are created when translating NCP, and three +* are created when translating GLS with non-zero reference point. If the pv[] +* array was initially allocated by wcsini() then the array will be expanded if +* necessary. Otherwise, error 2 will be returned if sufficient empty slots +* are not already available for use. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. wcsprm::ctype[] +* and/or wcsprm::pv[] may be changed. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* cylfix() - Fix malformed cylindrical projections +* ------------------------------------------------ +* cylfix() fixes WCS keyvalues for malformed cylindrical projections that +* suffer from the problem described in Sect. 7.3.4 of Paper I. +* +* Given: +* naxis const int [] +* Image axis lengths. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters. +* +* Function return value: +* int Status return value: +* -1: No change required (not an error). +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* 8: All of the corner pixel coordinates are invalid. +* 9: Could not determine reference pixel coordinate. +* 10: Could not determine reference pixel value. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* Global variable: const char *wcsfix_errmsg[] - Status return messages +* --------------------------------------------------------------------- +* Error messages to match the status value returned from each function. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSFIX +#define WCSLIB_WCSFIX + +#include "wcs.h" +#include "wcserr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CDFIX 0 +#define DATFIX 1 +#define OBSFIX 2 +#define UNITFIX 3 +#define SPCFIX 4 +#define CELFIX 5 +#define CYLFIX 6 +#define NWCSFIX 7 + +extern const char *wcsfix_errmsg[]; +#define cylfix_errmsg wcsfix_errmsg + +enum wcsfix_errmsg_enum { + FIXERR_OBSGEO_FIX = -5, /* Observatory coordinates amended. */ + FIXERR_DATE_FIX = -4, /* Date string reformatted. */ + FIXERR_SPC_UPDATE = -3, /* Spectral axis type modified. */ + FIXERR_UNITS_ALIAS = -2, /* Units alias translation. */ + FIXERR_NO_CHANGE = -1, /* No change. */ + FIXERR_SUCCESS = 0, /* Success. */ + FIXERR_NULL_POINTER = 1, /* Null wcsprm pointer passed. */ + FIXERR_MEMORY = 2, /* Memory allocation failed. */ + FIXERR_SINGULAR_MTX = 3, /* Linear transformation matrix is + singular. */ + FIXERR_BAD_CTYPE = 4, /* Inconsistent or unrecognized coordinate + axis types. */ + FIXERR_BAD_PARAM = 5, /* Invalid parameter value. */ + FIXERR_BAD_COORD_TRANS = 6, /* Invalid coordinate transformation + parameters. */ + FIXERR_ILL_COORD_TRANS = 7, /* Ill-conditioned coordinate transformation + parameters. */ + FIXERR_BAD_CORNER_PIX = 8, /* All of the corner pixel coordinates are + invalid. */ + FIXERR_NO_REF_PIX_COORD = 9, /* Could not determine reference pixel + coordinate. */ + FIXERR_NO_REF_PIX_VAL = 10 /* Could not determine reference pixel + value. */ +}; + +int wcsfix(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[]); + +int wcsfixi(int ctrl, const int naxis[], struct wcsprm *wcs, int stat[], + struct wcserr info[]); + +int cdfix(struct wcsprm *wcs); + +int datfix(struct wcsprm *wcs); + +int obsfix(int ctrl, struct wcsprm *wcs); + +int unitfix(int ctrl, struct wcsprm *wcs); + +int spcfix(struct wcsprm *wcs); + +int celfix(struct wcsprm *wcs); + +int cylfix(const int naxis[], struct wcsprm *wcs); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSFIX */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.c b/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.c new file mode 100644 index 0000000000000000000000000000000000000000..f0cfefcaa78b6497a49b5eeb4b152a48cc46390c --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.c @@ -0,0 +1,2136 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcshdr.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsutil.h" +#include "wcshdr.h" +#include "wtbarr.h" +#include "tab.h" +#include "dis.h" +#include "wcs.h" + +extern const int WCSSET; + +extern const int DIS_DOTPD; + +/* Map status return value to message. */ +const char *wcshdr_errmsg[] = { + "Success", + "Null wcsprm pointer passed", + "Memory allocation failed", + "Invalid column selection", + "Fatal error returned by Flex parser", + "Invalid tabular parameters"}; + +/* Map error returns for lower-level routines. */ +const int wcshdr_taberr[] = { + WCSHDRERR_SUCCESS, /* 0: TABERR_SUCCESS */ + WCSHDRERR_NULL_POINTER, /* 1: TABERR_NULL_POINTER */ + WCSHDRERR_MEMORY, /* 2: TABERR_MEMORY */ + WCSHDRERR_BAD_TABULAR_PARAMS /* 3: TABERR_BAD_PARAMS */ + /* 4: TABERR_BAD_X */ + /* 5: TABERR_BAD_WORLD */ +}; + +/* Convenience macro for invoking wcserr_set(). */ +#define WCSHDR_ERRMSG(status) WCSERR_SET(status), wcshdr_errmsg[status] + +/* Internal helper functions, not for general use. */ +static void wcshdo_format(int, int, const double [], char *); +static void wcshdo_tpdterm(int, int, char *); +static void wcshdo_util(int, const char [], const char [], int, const char [], + int, int, int, char, int, int [], char [], const char [], int *, char **, + int *); + +/*--------------------------------------------------------------------------*/ + +int wcstab(struct wcsprm *wcs) + +{ + static const char *function = "wcstab"; + + char (*PSi_0a)[72] = 0x0, (*PSi_1a)[72] = 0x0, (*PSi_2a)[72] = 0x0; + int *PVi_1a = 0x0, *PVi_2a = 0x0, *PVi_3a = 0x0, *tabax, *tabidx = 0x0; + int getcrd, i, ip, itab, itabax, j, jtabax, m, naxis, ntabax, status; + struct wtbarr *wtbp; + struct tabprm *tabp; + struct wcserr **err; + + if (wcs == 0x0) return WCSHDRERR_NULL_POINTER; + err = &(wcs->err); + + /* Free memory previously allocated by wcstab(). */ + if (wcs->flag != -1 && wcs->m_flag == WCSSET) { + if (wcs->wtb == wcs->m_wtb) wcs->wtb = 0x0; + if (wcs->tab == wcs->m_tab) wcs->tab = 0x0; + + if (wcs->m_wtb) free(wcs->m_wtb); + if (wcs->m_tab) { + for (j = 0; j < wcs->ntab; j++) { + tabfree(wcs->m_tab + j); + } + + free(wcs->m_tab); + } + } + + wcs->ntab = 0; + wcs->nwtb = 0; + wcs->wtb = 0x0; + wcs->tab = 0x0; + + + /* Determine the number of -TAB axes. */ + naxis = wcs->naxis; + if (!(tabax = calloc(naxis, sizeof(int)))) { + return wcserr_set(WCSHDR_ERRMSG(WCSHDRERR_MEMORY)); + } + + ntabax = 0; + for (i = 0; i < naxis; i++) { + /* Null fill. */ + wcsutil_null_fill(72, wcs->ctype[i]); + + if (!strcmp(wcs->ctype[i]+4, "-TAB")) { + tabax[i] = ntabax++; + } else { + tabax[i] = -1; + } + } + + if (ntabax == 0) { + /* No lookup tables. */ + status = 0; + goto cleanup; + } + + + /* Collect information from the PSi_ma and PVi_ma keyvalues. */ + if (!((PSi_0a = calloc(ntabax, sizeof(char[72]))) && + (PVi_1a = calloc(ntabax, sizeof(int))) && + (PVi_2a = calloc(ntabax, sizeof(int))) && + (PSi_1a = calloc(ntabax, sizeof(char[72]))) && + (PSi_2a = calloc(ntabax, sizeof(char[72]))) && + (PVi_3a = calloc(ntabax, sizeof(int))) && + (tabidx = calloc(ntabax, sizeof(int))))) { + status = wcserr_set(WCSHDR_ERRMSG(WCSHDRERR_MEMORY)); + goto cleanup; + } + + for (itabax = 0; itabax < ntabax; itabax++) { + /* Remember that calloc() zeroes allocated memory. */ + PVi_1a[itabax] = 1; + PVi_2a[itabax] = 1; + PVi_3a[itabax] = 1; + } + + for (ip = 0; ip < wcs->nps; ip++) { + itabax = tabax[wcs->ps[ip].i - 1]; + if (itabax >= 0) { + switch (wcs->ps[ip].m) { + case 0: + /* EXTNAME. */ + strcpy(PSi_0a[itabax], wcs->ps[ip].value); + wcsutil_null_fill(72, PSi_0a[itabax]); + break; + case 1: + /* TTYPEn for coordinate array. */ + strcpy(PSi_1a[itabax], wcs->ps[ip].value); + wcsutil_null_fill(72, PSi_1a[itabax]); + break; + case 2: + /* TTYPEn for index vector. */ + strcpy(PSi_2a[itabax], wcs->ps[ip].value); + wcsutil_null_fill(72, PSi_2a[itabax]); + break; + } + } + } + + for (ip = 0; ip < wcs->npv; ip++) { + itabax = tabax[wcs->pv[ip].i - 1]; + if (itabax >= 0) { + switch (wcs->pv[ip].m) { + case 1: + /* EXTVER. */ + PVi_1a[itabax] = (int)(wcs->pv[ip].value + 0.5); + break; + case 2: + /* EXTLEVEL. */ + PVi_2a[itabax] = (int)(wcs->pv[ip].value + 0.5); + break; + case 3: + /* Table axis number. */ + PVi_3a[itabax] = (int)(wcs->pv[ip].value + 0.5); + break; + } + } + } + + + /* Determine the number of independent tables. */ + for (itabax = 0; itabax < ntabax; itabax++) { + /* These have no defaults. */ + if (!PSi_0a[itabax][0] || !PSi_1a[itabax][0]) { + status = wcserr_set(WCSERR_SET(WCSHDRERR_BAD_TABULAR_PARAMS), + "Invalid tabular parameters: PSi_0a and PSi_1a must be specified"); + goto cleanup; + } + + tabidx[itabax] = -1; + for (jtabax = 0; jtabax < i; jtabax++) { + /* EXTNAME, EXTVER, EXTLEVEL, and TTYPEn for the coordinate array */ + /* must match for each axis of a multi-dimensional lookup table. */ + if (strcmp(PSi_0a[itabax], PSi_0a[jtabax]) == 0 && + strcmp(PSi_1a[itabax], PSi_1a[jtabax]) == 0 && + PVi_1a[itabax] == PVi_1a[jtabax] && + PVi_2a[itabax] == PVi_2a[jtabax]) { + tabidx[itabax] = tabidx[jtabax]; + break; + } + } + + if (jtabax == itabax) { + tabidx[itabax] = wcs->ntab; + wcs->ntab++; + } + } + + if (!(wcs->tab = calloc(wcs->ntab, sizeof(struct tabprm)))) { + status = wcserr_set(WCSHDR_ERRMSG(WCSHDRERR_MEMORY)); + goto cleanup; + } + wcs->m_tab = wcs->tab; + + /* Table dimensionality; find the largest axis number. */ + for (itabax = 0; itabax < ntabax; itabax++) { + tabp = wcs->tab + tabidx[itabax]; + + /* PVi_3a records the 1-relative table axis number. */ + if (PVi_3a[itabax] > tabp->M) { + tabp->M = PVi_3a[itabax]; + } + } + + for (itab = 0; itab < wcs->ntab; itab++) { + if ((status = tabini(1, wcs->tab[itab].M, 0, wcs->tab + itab))) { + status = wcserr_set(WCSHDR_ERRMSG(wcshdr_taberr[status])); + goto cleanup; + } + } + + + /* Copy parameters into the tabprm structs. */ + for (i = 0; i < naxis; i++) { + if ((itabax = tabax[i]) < 0) { + /* Not a -TAB axis. */ + continue; + } + + /* PVi_3a records the 1-relative table axis number. */ + m = PVi_3a[itabax] - 1; + + tabp = wcs->tab + tabidx[itabax]; + tabp->map[m] = i; + tabp->crval[m] = wcs->crval[i]; + } + + /* Check for completeness. */ + for (itab = 0; itab < wcs->ntab; itab++) { + for (m = 0; m < wcs->tab[itab].M; m++) { + if (wcs->tab[itab].map[m] < 0) { + status = wcserr_set(WCSERR_SET(WCSHDRERR_BAD_TABULAR_PARAMS), + "Invalid tabular parameters: the axis mapping is undefined"); + goto cleanup; + } + } + } + + + /* Set up for reading the arrays; how many arrays are there? */ + for (itabax = 0; itabax < ntabax; itabax++) { + /* Does this -TAB axis have a non-degenerate index array? */ + if (PSi_2a[itabax][0]) { + wcs->nwtb++; + } + } + + /* Add one coordinate array for each table. */ + wcs->nwtb += wcs->ntab; + + /* Allocate memory for structs to be returned. */ + if (!(wcs->wtb = calloc(wcs->nwtb, sizeof(struct wtbarr)))) { + wcs->nwtb = 0; + + status = wcserr_set(WCSHDR_ERRMSG(WCSHDRERR_MEMORY)); + goto cleanup; + } + wcs->m_wtb = wcs->wtb; + + /* Set pointers for the index and coordinate arrays. */ + wtbp = wcs->wtb; + for (itab = 0; itab < wcs->ntab; itab++) { + getcrd = 1; + for (itabax = 0; itabax < ntabax; itabax++) { + if (tabidx[itabax] != itab) continue; + + if (getcrd) { + /* Coordinate array. */ + wtbp->i = itabax + 1; + wtbp->m = PVi_3a[itabax]; + wtbp->kind = 'c'; + + strcpy(wtbp->extnam, PSi_0a[itabax]); + wtbp->extver = PVi_1a[itabax]; + wtbp->extlev = PVi_2a[itabax]; + strcpy(wtbp->ttype, PSi_1a[itabax]); + wtbp->row = 1L; + wtbp->ndim = wcs->tab[itab].M + 1; + wtbp->dimlen = wcs->tab[itab].K; + wtbp->arrayp = &(wcs->tab[itab].coord); + + /* Signal for tabset() to take this memory. */ + wcs->tab[itab].m_coord = (double *)0x1; + + wtbp++; + getcrd = 0; + } + + if (PSi_2a[itabax][0]) { + /* Index array. */ + wtbp->i = itabax + 1; + wtbp->m = PVi_3a[itabax]; + wtbp->kind = 'i'; + + m = wtbp->m - 1; + strcpy(wtbp->extnam, PSi_0a[itabax]); + wtbp->extver = PVi_1a[itabax]; + wtbp->extlev = PVi_2a[itabax]; + strcpy(wtbp->ttype, PSi_2a[itabax]); + wtbp->row = 1L; + wtbp->ndim = 1; + wtbp->dimlen = wcs->tab[itab].K + m; + wtbp->arrayp = wcs->tab[itab].index + m; + + /* Signal for tabset() to take this memory. */ + wcs->tab[itab].m_indxs[m] = (double *)0x1; + + wtbp++; + } + } + } + + status = 0; + +cleanup: + if (tabax) free(tabax); + if (tabidx) free(tabidx); + if (PSi_0a) free(PSi_0a); + if (PVi_1a) free(PVi_1a); + if (PVi_2a) free(PVi_2a); + if (PSi_1a) free(PSi_1a); + if (PSi_2a) free(PSi_2a); + if (PVi_3a) free(PVi_3a); + + if (status) { + if (wcs->tab) free(wcs->tab); + if (wcs->wtb) free(wcs->wtb); + } + + return status; +} + +/*--------------------------------------------------------------------------*/ + +int wcsidx(int nwcs, struct wcsprm **wcs, int alts[27]) + +{ + int a, iwcs; + struct wcsprm *wcsp; + + for (a = 0; a < 27; a++) { + alts[a] = -1; + } + + if (wcs == 0x0) { + return WCSHDRERR_NULL_POINTER; + } + + wcsp = *wcs; + for (iwcs = 0; iwcs < nwcs; iwcs++, wcsp++) { + if (wcsp->colnum || wcsp->colax[0]) continue; + + if (wcsp->alt[0] == ' ') { + a = 0; + } else { + a = wcsp->alt[0] - 'A' + 1; + } + + alts[a] = iwcs; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsbdx(int nwcs, struct wcsprm **wcs, int type, short alts[1000][28]) + +{ + short *ip; + int a, i, icol, iwcs; + struct wcsprm *wcsp; + + for (ip = alts[0]; ip < alts[0] + 28*1000; ip++) { + *ip = -1; + } + + for (icol = 0; icol < 1000; icol++) { + alts[icol][27] = 0; + } + + if (wcs == 0x0) { + return WCSHDRERR_NULL_POINTER; + } + + wcsp = *wcs; + for (iwcs = 0; iwcs < nwcs; iwcs++, wcsp++) { + if (wcsp->alt[0] == ' ') { + a = 0; + } else { + a = wcsp->alt[0] - 'A' + 1; + } + + if (type) { + /* Pixel list. */ + if (wcsp->colax[0]) { + for (i = 0; i < wcsp->naxis; i++) { + alts[wcsp->colax[i]][a] = iwcs; + alts[wcsp->colax[i]][27]++; + } + } else if (!wcsp->colnum) { + alts[0][a] = iwcs; + alts[0][27]++; + } + + } else { + /* Binary table image array. */ + if (wcsp->colnum) { + alts[wcsp->colnum][a] = iwcs; + alts[wcsp->colnum][27]++; + } else if (!wcsp->colax[0]) { + alts[0][a] = iwcs; + alts[0][27]++; + } + } + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsvfree(int *nwcs, struct wcsprm **wcs) + +{ + int a, status = 0; + struct wcsprm *wcsp; + + if (wcs == 0x0) { + return WCSHDRERR_NULL_POINTER; + } + + wcsp = *wcs; + for (a = 0; a < *nwcs; a++, wcsp++) { + status |= wcsfree(wcsp); + } + + free(*wcs); + + *nwcs = 0; + *wcs = 0x0; + + return status; +} + +/*--------------------------------------------------------------------------*/ +#define I_DTYPE 0 /* Distortion type code. */ +#define I_NIPARM 1 /* Full (allocated) length of iparm[]. */ +#define I_NDPARM 2 /* No. of parameters in dparm[], excl. work space. */ +#define I_DOCORR 3 /* True if distortion func computes a correction. */ +#define I_TPDNCO 4 /* No. of TPD coefficients, forward... */ +#define I_TPDINV 5 /* ...and inverse. */ +#define I_TPDAUX 6 /* True if auxiliary variables are used. */ +#define I_TPDRAD 7 /* True if the radial variable is used. */ + +int wcshdo(int ctrl, struct wcsprm *wcs, int *nkeyrec, char **header) + +/* ::: CUBEFACE and STOKES handling? */ + +{ + static const char *function = "wcshdo"; + + const char axid[] = "xyxuvu", *cp; + const int nTPD[] = {1, 4, 7, 12, 17, 24, 31, 40, 49, 60}; + + char alt, comment[72], ctemp[32], *ctypei, format[16], fmt01[8], + keyvalue[96], keyword[16], *kp, *kp0, obsg[8] = "OBSG?", + obsgeo[8] = "OBSGEO-?", pq, ptype, xtype, term[16], timeunit[16], + tpdsrc[24], xyz[] = "XYZ"; + int *axmap, bintab, *colax, colnum, degree, direct = 0, doaux = 0, dofmt, + dosip, dotpd, dotpv, i, idis, idp, *iparm, j, jhat, k, m, naxis, + ncoeff, Nhat, p, pixlist, precision, primage, q, status = 0; + double *dparm, keyval; + struct disprm *dis; + struct dpkey *keyp; + struct wcserr **err; + + *nkeyrec = 0; + *header = 0x0; + + if (wcs == 0x0) return WCSHDRERR_NULL_POINTER; + err = &(wcs->err); + + if (wcs->flag != WCSSET) { + if ((status = wcsset(wcs))) return status; + } + + if ((naxis = wcs->naxis) == 0) { + return 0; + } + + + /* These are mainly for convenience. */ + alt = wcs->alt[0]; + if (alt == ' ') alt = '\0'; + colnum = wcs->colnum; + colax = wcs->colax; + + primage = 0; + bintab = 0; + pixlist = 0; + if (colnum) { + bintab = 1; + } else if (colax[0]) { + pixlist = 1; + } else { + primage = 1; + } + + + /* Initialize floating point format control. */ + *format = '\0'; + if (ctrl & WCSHDO_P17) { + strcpy(format, "% 20.17G"); + } else if (ctrl & WCSHDO_P16) { + strcpy(format, "% 20.16G"); + } else if (ctrl & WCSHDO_P15) { + strcpy(format, "% 20.15G"); + } else if (ctrl & WCSHDO_P14) { + strcpy(format, "% 20.14G"); + } else if (ctrl & WCSHDO_P13) { + strcpy(format, "% 20.13G"); + } else if (ctrl & WCSHDO_P12) { + strcpy(format, "%20.12G"); + } + + if (*format && (ctrl & WCSHDO_EFMT)) { + if (format[6] == 'G') { + format[6] = 'E'; + } else { + format[7] = 'E'; + } + } + + dofmt = (*format == '\0'); + + + /* WCS dimension. */ + if (!pixlist) { + sprintf(keyvalue, "%20d", naxis); + wcshdo_util(ctrl, "WCSAXES", "WCAX", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Number of coordinate axes", nkeyrec, header, &status); + } + + /* Reference pixel coordinates. */ + if (dofmt) wcshdo_format('G', naxis, wcs->crpix, format); + for (j = 0; j < naxis; j++) { + wcsutil_double2str(keyvalue, format, wcs->crpix[j]); + wcshdo_util(ctrl, "CRPIX", "CRP", WCSHDO_CRPXna, "CRPX", 0, j+1, 0, alt, + colnum, colax, keyvalue, "Pixel coordinate of reference point", nkeyrec, + header, &status); + } + + /* Linear transformation matrix. */ + if (dofmt) wcshdo_format('G', naxis*naxis, wcs->pc, format); + k = 0; + for (i = 0; i < naxis; i++) { + for (j = 0; j < naxis; j++, k++) { + if (i == j) { + if (wcs->pc[k] == 1.0) continue; + } else { + if (wcs->pc[k] == 0.0) continue; + } + + wcsutil_double2str(keyvalue, format, wcs->pc[k]); + wcshdo_util(ctrl, "PC", bintab ? "PC" : "P", WCSHDO_TPCn_ka, + bintab ? 0x0 : "PC", i+1, j+1, 0, alt, colnum, colax, + keyvalue, "Coordinate transformation matrix element", + nkeyrec, header, &status); + } + } + + /* Coordinate increment at reference point. */ + if (dofmt) wcshdo_format('G', naxis, wcs->cdelt, format); + for (i = 0; i < naxis; i++) { + wcsutil_double2str(keyvalue, format, wcs->cdelt[i]); + comment[0] = '\0'; + if (wcs->cunit[i][0]) sprintf(comment, "[%s] ", wcs->cunit[i]); + strcat(comment, "Coordinate increment at reference point"); + wcshdo_util(ctrl, "CDELT", "CDE", WCSHDO_CRPXna, "CDLT", i+1, 0, 0, alt, + colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + + /* Units of coordinate increment and reference value. */ + for (i = 0; i < naxis; i++) { + if (wcs->cunit[i][0] == '\0') continue; + + sprintf(keyvalue, "'%s'", wcs->cunit[i]); + wcshdo_util(ctrl, "CUNIT", "CUN", WCSHDO_CRPXna, "CUNI", i+1, 0, 0, alt, + colnum, colax, keyvalue, "Units of coordinate increment and value", + nkeyrec, header, &status); + } + + /* May need to alter ctype for particular distortions so do basic checks */ + /* now. Note that SIP, TPV, DSS, TNX, and ZPX are restricted to exactly */ + /* two axes and cannot coexist with other distortion types. */ + dosip = 0; + dotpv = 0; + dotpd = 0; + + if ((dis = wcs->lin.dispre)) { + for (i = 0; i < naxis; i++) { + if (strcmp(dis->dtype[i], "SIP") == 0) { + /* Simple Imaging Polynomial (SIP). Write it in its native form */ + /* if possible, unless specifically requested to write it as TPD. */ + dotpd = (dis->iparm[i][I_DTYPE] & DIS_DOTPD); + + if (!dotpd) {; + if (alt || + dis->Nhat[0] != 2 || + dis->Nhat[1] != 2 || + dis->axmap[0][0] != 0 || + dis->axmap[0][1] != 1 || + dis->axmap[1][0] != 0 || + dis->axmap[1][1] != 1 || + dis->offset[0][0] != wcs->crpix[0] || + dis->offset[0][1] != wcs->crpix[1] || + dis->offset[1][0] != wcs->crpix[0] || + dis->offset[1][1] != wcs->crpix[1] || + dis->scale[0][0] != 1.0 || + dis->scale[0][1] != 1.0 || + dis->scale[1][0] != 1.0 || + dis->scale[1][1] != 1.0) { + /* Must have been read as a 'SIP' distortion, CPDISja = 'SIP'. */ + /* Cannot be written as native SIP so write it as TPD. */ + dotpd = DIS_DOTPD; + } else if (strncmp(wcs->ctype[0], "RA---TAN", 8) || + strncmp(wcs->ctype[1], "DEC--TAN", 8)) { + /* Must have been permuted by wcssub(). */ + /* Native SIP doesn't have axis mapping so write it as TPD. */ + dotpd = DIS_DOTPD; + } + + if (dotpd) { + strcpy(tpdsrc, "SIP coordinates"); + } else { + dosip = 1; + } + } + + break; + } + } + } + + if ((dis = wcs->lin.disseq)) { + for (i = 0; i < naxis; i++) { + if (strcmp(dis->dtype[i], "TPV") == 0) { + /* TPV "projection". Write it in its native form if possible, */ + /* unless specifically requested to write it as TPD. */ + dotpd = (dis->iparm[i][I_DTYPE] & DIS_DOTPD); + + if (!dotpd) {; + if (dis->axmap[wcs->lng][0] != wcs->lng || + dis->axmap[wcs->lng][1] != wcs->lat || + dis->axmap[wcs->lat][0] != wcs->lat || + dis->axmap[wcs->lat][1] != wcs->lng || + dis->offset[wcs->lng][wcs->lng] != 0.0 || + dis->offset[wcs->lng][wcs->lat] != 0.0 || + dis->offset[wcs->lat][wcs->lng] != 0.0 || + dis->offset[wcs->lat][wcs->lat] != 0.0 || + dis->scale[wcs->lng][wcs->lng] != 1.0 || + dis->scale[wcs->lng][wcs->lat] != 1.0 || + dis->scale[wcs->lat][wcs->lng] != 1.0 || + dis->scale[wcs->lat][wcs->lat] != 1.0) { + /* Must have been read as a 'TPV' distortion, CPDISja = 'TPV'. */ + /* Cannot be written as native TPV so write it as TPD. */ + dotpd = DIS_DOTPD; + } + + if (dotpd) { + strcpy(tpdsrc, "TPV \"projection\""); + } else { + dotpv = 1; + } + } + + break; + + } else if (strcmp(dis->dtype[i], "DSS") == 0) { + /* Always written as TPD. */ + dotpd = DIS_DOTPD; + strcpy(tpdsrc, dis->dtype[i]); + + } else if (strncmp(dis->dtype[i], "WAT", 3) == 0) { + /* Always written as TPD. */ + dotpd = DIS_DOTPD; + strcpy(tpdsrc, dis->dtype[i]+4); + + if (strcmp(dis->dtype[i], "DSS") == 0) { + strcpy(tpdsrc, wcs->wcsname); + } else { + strcat(tpdsrc, " \"projection\""); + } + + break; + } + } + } + + /* Coordinate type. */ + for (i = 0; i < naxis; i++) { + if (wcs->ctype[i][0] == '\0') continue; + + sprintf(keyvalue, "'%s'", wcs->ctype[i]); + strcpy(comment, "Coordinate type code"); + + ctypei = keyvalue + 1; + if (i == wcs->lng || i == wcs->lat) { + /* Alter ctype for particular distortions. */ + if (dosip) { + /* It could have come in as CPDISja = 'SIP'. */ + strcpy(ctypei+8, "-SIP'"); + } else if (dotpv) { + /* Reinstate projection code edited by wcsset(). */ + strcpy(ctypei+4, "-TPV'"); + } + + if (strncmp(ctypei+8, "-SIP", 4) == 0) { + strcpy(comment, "TAN (gnomonic) projection + SIP distortions"); + + } else if (strncmp(ctypei+4, "-TPV", 4) == 0) { + strcpy(comment, "TAN (gnomonic) projection + distortions"); + + } else { + if (strncmp(ctypei, "RA--", 4) == 0) { + strcpy(comment, "Right ascension, "); + + } else if (strncmp(ctypei, "DEC-", 4) == 0) { + strcpy(comment, "Declination, "); + + } else if (strncmp(ctypei+1, "LON", 3) == 0 || + strncmp(ctypei+1, "LAT", 3) == 0) { + ctypei[0] = toupper(ctypei[0]); + + switch (ctypei[0]) { + case 'G': + strcpy(comment, "galactic "); + break; + case 'E': + strcpy(comment, "ecliptic "); + break; + case 'H': + strcpy(comment, "helioecliptic "); + break; + case 'S': + strcpy(comment, "supergalactic "); + break; + } + + if (i == wcs->lng) { + strcat(comment, "longitude, "); + } else { + strcat(comment, "latitude, "); + } + } + + strcat(comment, wcs->cel.prj.name); + strcat(comment, " projection"); + } + + } else if (i == wcs->spec) { + spctyp(wcs->ctype[i], 0x0, 0x0, comment, 0x0, &ptype, &xtype, 0x0); + if (ptype == xtype) { + strcat(comment, " (linear)"); + } else { + switch (xtype) { + case 'F': + strcat(comment, " (linear in frequency)"); + break; + case 'V': + strcat(comment, " (linear in velocity)"); + break; + case 'W': + strcat(comment, " (linear in wavelength)"); + break; + } + } + } + + wcshdo_util(ctrl, "CTYPE", "CTY", WCSHDO_CRPXna, "CTYP", i+1, 0, 0, alt, + colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + + /* Coordinate value at reference point. */ + for (i = 0; i < naxis; i++) { + if (dofmt) wcshdo_format('G', 1, wcs->crval+i, format); + wcsutil_double2str(keyvalue, format, wcs->crval[i]); + comment[0] = '\0'; + if (wcs->cunit[i][0]) sprintf(comment, "[%s] ", wcs->cunit[i]); + strcat(comment, "Coordinate value at reference point"); + wcshdo_util(ctrl, "CRVAL", "CRV", WCSHDO_CRPXna, "CRVL", i+1, 0, 0, alt, + colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + + /* Parameter values. */ + if (dofmt) strcpy(format, "%20.12G"); + for (k = 0; k < wcs->npv; k++) { + wcsutil_double2str(keyvalue, format, (wcs->pv[k]).value); + if ((wcs->pv[k]).i == (wcs->lng + 1)) { + switch ((wcs->pv[k]).m) { + case 1: + strcpy(comment, "[deg] Native longitude of the reference point"); + break; + case 2: + strcpy(comment, "[deg] Native latitude of the reference point"); + break; + case 3: + if (primage) { + sprintf(keyword, "LONPOLE%c", alt); + } else if (bintab) { + sprintf(keyword, "LONP%d%c", colnum, alt); + } else { + sprintf(keyword, "LONP%d%c", colax[(wcs->pv[k]).i - 1], alt); + } + sprintf(comment, "[deg] alias for %s (has precedence)", keyword); + break; + case 4: + if (primage) { + sprintf(keyword, "LATPOLE%c", alt); + } else if (bintab) { + sprintf(keyword, "LATP%d%c", colnum, alt); + } else { + sprintf(keyword, "LATP%d%c", colax[(wcs->pv[k]).i - 1], alt); + } + sprintf(comment, "[deg] alias for %s (has precedence)", keyword); + break; + } + } else if ((wcs->pv[k]).i == (wcs->lat + 1)) { + sprintf(comment, "%s projection parameter", wcs->cel.prj.code); + } else { + strcpy(comment, "Coordinate transformation parameter"); + } + + wcshdo_util(ctrl, "PV", "V", WCSHDO_PVn_ma, "PV", wcs->pv[k].i, -1, + wcs->pv[k].m, alt, colnum, colax, keyvalue, comment, + nkeyrec, header, &status); + } + + for (k = 0; k < wcs->nps; k++) { + sprintf(keyvalue, "'%s'", (wcs->ps[k]).value); + wcshdo_util(ctrl, "PS", "S", WCSHDO_PVn_ma, "PS", wcs->ps[k].i, -1, + wcs->ps[k].m, alt, colnum, colax, keyvalue, + "Coordinate transformation parameter", + nkeyrec, header, &status); + } + + /* Celestial and spectral transformation parameters. */ + if (!undefined(wcs->lonpole)) { + wcsutil_double2str(keyvalue, format, wcs->lonpole); + wcshdo_util(ctrl, "LONPOLE", "LONP", 0, 0x0, 0, 0, 0, alt, + colnum, colax, keyvalue, "[deg] Native longitude of celestial pole", + nkeyrec, header, &status); + } + + if (!undefined(wcs->latpole)) { + wcsutil_double2str(keyvalue, format, wcs->latpole); + wcshdo_util(ctrl, "LATPOLE", "LATP", 0, 0x0, 0, 0, 0, alt, + colnum, colax, keyvalue, "[deg] Native latitude of celestial pole", + nkeyrec, header, &status); + } + + if (wcs->restfrq != 0.0) { + wcsutil_double2str(keyvalue, format, wcs->restfrq); + wcshdo_util(ctrl, "RESTFRQ", "RFRQ", 0, 0x0, 0, 0, 0, alt, + colnum, colax, keyvalue, "[Hz] Line rest frequency", + nkeyrec, header, &status); + } + + if (wcs->restwav != 0.0) { + wcsutil_double2str(keyvalue, format, wcs->restwav); + wcshdo_util(ctrl, "RESTWAV", "RWAV", 0, 0x0, 0, 0, 0, alt, + colnum, colax, keyvalue, "[Hz] Line rest wavelength", + nkeyrec, header, &status); + } + + /* - - - - - - - - - - - - - - - - Auxiliary coordinate axis information. */ + sprintf(timeunit, "%.15s", wcs->timeunit[0] ? wcs->timeunit : "s"); + + /* Coordinate axis title. */ + if (wcs->cname) { + for (i = 0; i < naxis; i++) { + if (wcs->cname[i][0] == '\0') continue; + + sprintf(keyvalue, "'%s'", wcs->cname[i]); + wcshdo_util(ctrl, "CNAME", "CNA", WCSHDO_CNAMna, "CNAM", i+1, 0, 0, + alt, colnum, colax, keyvalue, "Axis name for labelling purposes", + nkeyrec, header, &status); + } + } + + /* Random error in coordinate. */ + if (wcs->crder) { + for (i = 0; i < naxis; i++) { + if (undefined(wcs->crder[i])) continue; + + wcsutil_double2str(keyvalue, format, wcs->crder[i]); + comment[0] = '\0'; + if (wcs->cunit[i][0]) sprintf(comment, "[%s] ", wcs->cunit[i]); + strcat(comment, "Random error in coordinate"); + wcshdo_util(ctrl, "CRDER", "CRD", WCSHDO_CNAMna, "CRDE", i+1, 0, 0, + alt, colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + } + + /* Systematic error in coordinate. */ + if (wcs->csyer) { + for (i = 0; i < naxis; i++) { + if (undefined(wcs->csyer[i])) continue; + + wcsutil_double2str(keyvalue, format, wcs->csyer[i]); + comment[0] = '\0'; + if (wcs->cunit[i][0]) sprintf(comment, "[%s] ", wcs->cunit[i]); + strcat(comment, "Systematic error in coordinate"); + wcshdo_util(ctrl, "CSYER", "CSY", WCSHDO_CNAMna, "CSYE", i+1, 0, 0, + alt, colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + } + + /* Time at zero point of phase axis. */ + if (wcs->czphs) { + for (i = 0; i < naxis; i++) { + if (undefined(wcs->czphs[i])) continue; + + wcsutil_double2str(keyvalue, format, wcs->czphs[i]); + sprintf(comment, "[%s] Time at zero point of phase axis", timeunit); + wcshdo_util(ctrl, "CZPHS", "CZP", WCSHDO_CNAMna, "CZPH", i+1, 0, 0, + alt, colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + } + + /* Period of phase axis. */ + if (wcs->cperi) { + for (i = 0; i < naxis; i++) { + if (undefined(wcs->cperi[i])) continue; + + wcsutil_double2str(keyvalue, format, wcs->cperi[i]); + sprintf(comment, "[%s] Period of phase axis", timeunit); + wcshdo_util(ctrl, "CPERI", "CPR", WCSHDO_CNAMna, "CPER", i+1, 0, 0, + alt, colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + } + + /* - - - - - - - - - - - - - - - - - - - - - - Coordinate system title. */ + + /* Coordinate system title. */ + if (wcs->wcsname[0]) { + sprintf(keyvalue, "'%s'", wcs->wcsname); + if (bintab) { + wcshdo_util(ctrl, "WCSNAME", "WCSN", 0, 0x0, 0, 0, 0, alt, + colnum, colax, keyvalue, "Coordinate system title", + nkeyrec, header, &status); + } else { + /* TWCS was a mistake. */ + wcshdo_util(ctrl, "WCSNAME", "TWCS", WCSHDO_WCSNna, "WCSN", 0, 0, 0, + alt, colnum, colax, keyvalue, "Coordinate system title", + nkeyrec, header, &status); + } + } + + /* - - - - - - - - - - - - - - - - Time reference system and measurement. */ + + /* Time scale. */ + if (wcs->timesys[0]) { + sprintf(keyvalue, "'%s'", wcs->timesys); + wcshdo_util(ctrl, "TIMESYS", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Time scale", nkeyrec, header, &status); + } + + /* Time reference position. */ + if (wcs->trefpos[0]) { + sprintf(keyvalue, "'%s'", wcs->trefpos); + wcshdo_util(ctrl, "TREFPOS", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Time reference position", nkeyrec, header, &status); + } + + /* Time reference direction. */ + if (wcs->trefdir[0]) { + sprintf(keyvalue, "'%s'", wcs->trefdir); + wcshdo_util(ctrl, "TREFDIR", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Time reference direction", nkeyrec, header, &status); + } + + /* Ephemerides used for pathlength delay calculation. */ + if (wcs->plephem[0]) { + sprintf(keyvalue, "'%s'", wcs->plephem); + wcshdo_util(ctrl, "PLEPHEM", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Ephemerides used for pathlength delays", nkeyrec, header, &status); + } + + /* Time units. */ + if (wcs->timeunit[0]) { + sprintf(keyvalue, "'%s'", wcs->timeunit); + wcshdo_util(ctrl, "TIMEUNIT", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Time units", nkeyrec, header, &status); + } + + /* ISO-8601 fiducial time. */ + if (wcs->dateref[0]) { + sprintf(keyvalue, "'%s'", wcs->dateref); + wcshdo_util(ctrl, "DATEREF", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "ISO-8601 fiducial time", nkeyrec, header, &status); + } + + /* MJD of fiducial time, integer part. */ + if (!undefined(wcs->mjdref[0])) { + wcsutil_double2str(keyvalue, format, wcs->mjdref[0]); + wcshdo_util(ctrl, "MJDREFI", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[d] MJD of fiducial time, integer part", nkeyrec, header, &status); + } + + /* MJD of fiducial time, fractional part. */ + if (!undefined(wcs->mjdref[1])) { + wcsutil_double2str(keyvalue, format, wcs->mjdref[1]); + wcshdo_util(ctrl, "MJDREFF", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[d] MJD of fiducial time, fractional part", nkeyrec, header, &status); + } + + /* Clock correction. */ + if (!undefined(wcs->timeoffs)) { + wcsutil_double2str(keyvalue, format, wcs->timeoffs); + sprintf(comment, "[%s] Clock correction", timeunit); + wcshdo_util(ctrl, "TIMEOFFS", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* - - - - - - - - - - - - - - - - - - - - Data timestamps and durations. */ + + /* ISO-8601 time of observation. */ + if (wcs->dateobs[0]) { + sprintf(keyvalue, "'%s'", wcs->dateobs); + strcpy(comment, "ISO-8601 time of observation"); + + if (ctrl & 1) { + /* Allow DOBSn. */ + wcshdo_util(ctrl, "DATE-OBS", "DOBS", WCSHDO_DOBSn, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } else { + /* Force DATE-OBS. */ + wcshdo_util(ctrl, "DATE-OBS", 0x0, 0, 0x0, 0, 0, 0, ' ', + 0, 0x0, keyvalue, comment, nkeyrec, header, &status); + } + } + + /* MJD of observation. */ + if (!undefined(wcs->mjdobs)) { + wcsutil_double2str(keyvalue, format, wcs->mjdobs); + wcshdo_util(ctrl, "MJD-OBS", "MJDOB", 0, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, "[d] MJD of observation", + nkeyrec, header, &status); + } + + /* Julian epoch of observation. */ + if (!undefined(wcs->jepoch)) { + wcsutil_double2str(keyvalue, format, wcs->jepoch); + wcshdo_util(ctrl, "JEPOCH", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[a] Julian epoch of observation", nkeyrec, header, &status); + } + + /* Besselian epoch of observation. */ + if (!undefined(wcs->bepoch)) { + wcsutil_double2str(keyvalue, format, wcs->bepoch); + wcshdo_util(ctrl, "BEPOCH", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[a] Besselian epoch of observation", nkeyrec, header, &status); + } + + /* ISO-8601 time at start of observation. */ + if (wcs->datebeg[0]) { + sprintf(keyvalue, "'%s'", wcs->datebeg); + wcshdo_util(ctrl, "DATE-BEG", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "ISO-8601 time at start of observation", nkeyrec, header, &status); + } + + /* MJD at start of observation. */ + if (!undefined(wcs->mjdobs)) { + wcsutil_double2str(keyvalue, format, wcs->mjdobs); + wcshdo_util(ctrl, "MJD-OBS", "MJDOB", 0, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, "[d] MJD at start of observation", + nkeyrec, header, &status); + } + + /* Time elapsed at start since fiducial time. */ + if (!undefined(wcs->tstart)) { + wcsutil_double2str(keyvalue, format, wcs->tstart); + sprintf(comment, "[%s] Time elapsed since fiducial time at start", + timeunit); + wcshdo_util(ctrl, "TSTART", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* ISO-8601 time at midpoint of observation. */ + if (wcs->dateavg[0]) { + sprintf(keyvalue, "'%s'", wcs->dateavg); + wcshdo_util(ctrl, "DATE-AVG", "DAVG", 0, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, "ISO-8601 time at midpoint of observation", + nkeyrec, header, &status); + } + + /* MJD at midpoint of observation. */ + if (!undefined(wcs->mjdavg)) { + wcsutil_double2str(keyvalue, format, wcs->mjdavg); + wcshdo_util(ctrl, "MJD-AVG", "MJDA", 0, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, "[d] MJD at midpoint of observation", + nkeyrec, header, &status); + } + + /* ISO-8601 time at end of observation. */ + if (wcs->dateend[0]) { + sprintf(keyvalue, "'%s'", wcs->dateend); + wcshdo_util(ctrl, "DATE-END", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "ISO-8601 time at end of observation", nkeyrec, header, &status); + } + + /* MJD at end of observation. */ + if (!undefined(wcs->mjdend)) { + wcsutil_double2str(keyvalue, format, wcs->mjdend); + wcshdo_util(ctrl, "MJD-END", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[d] MJD at end of observation", nkeyrec, header, &status); + } + + /* Time elapsed at end since fiducial time. */ + if (!undefined(wcs->tstop)) { + wcsutil_double2str(keyvalue, format, wcs->tstop); + sprintf(comment, "[%s] Time elapsed since fiducial time at end", + timeunit); + wcshdo_util(ctrl, "TSTOP", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* Exposure (integration) time. */ + if (!undefined(wcs->xposure)) { + wcsutil_double2str(keyvalue, format, wcs->xposure); + sprintf(comment, "[%s] Exposure (integration) time", timeunit); + wcshdo_util(ctrl, "XPOSURE", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* Elapsed time (start to stop). */ + if (!undefined(wcs->telapse)) { + wcsutil_double2str(keyvalue, format, wcs->telapse); + sprintf(comment, "[%s] Elapsed time (start to stop)", timeunit); + wcshdo_util(ctrl, "TELAPSE", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - Timing accuracy. */ + + /* Systematic error in time measurements. */ + if (!undefined(wcs->timsyer)) { + wcsutil_double2str(keyvalue, format, wcs->timsyer); + sprintf(comment, "[%s] Systematic error in time measurements", timeunit); + wcshdo_util(ctrl, "TIMSYER", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* Relative error in time measurements. */ + if (!undefined(wcs->timrder)) { + wcsutil_double2str(keyvalue, format, wcs->timrder); + sprintf(comment, "[%s] Relative error in time measurements", timeunit); + wcshdo_util(ctrl, "TIMRDER", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* Time resolution. */ + if (!undefined(wcs->timedel)) { + wcsutil_double2str(keyvalue, format, wcs->timedel); + sprintf(comment, "[%s] Time resolution", timeunit); + wcshdo_util(ctrl, "TIMEDEL", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + comment, nkeyrec, header, &status); + } + + /* Reference position of timestamp in binned data. */ + if (!undefined(wcs->timepixr)) { + wcsutil_double2str(keyvalue, format, wcs->timepixr); + wcshdo_util(ctrl, "TIMEPIXR", "", 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Reference position of timestamp in binned data", nkeyrec, header, + &status); + } + + /* - - - - - - - - - - - - - - - - - Spatial & celestial reference frame. */ + + /* Observatory coordinates. */ + if (!undefined(wcs->obsgeo[0]) && + !undefined(wcs->obsgeo[1]) && + !undefined(wcs->obsgeo[2])) { + + for (k = 0; k < 3; k++) { + wcsutil_double2str(keyvalue, format, wcs->obsgeo[k]); + sprintf(comment, "[m] observatory %c-coordinate", xyz[k]); + obsgeo[7] = xyz[k]; + obsg[4] = xyz[k]; + wcshdo_util(ctrl, obsgeo, obsg, 0, 0x0, 0, 0, 0, ' ', + colnum, colax, keyvalue, comment, nkeyrec, header, &status); + } + + } else if ( + !undefined(wcs->obsgeo[3]) && + !undefined(wcs->obsgeo[4]) && + !undefined(wcs->obsgeo[5])) { + + wcsutil_double2str(keyvalue, format, wcs->obsgeo[3]); + wcshdo_util(ctrl, "OBSGEO-L", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[deg] IAU(1976) observatory longitude", nkeyrec, header, &status); + + wcsutil_double2str(keyvalue, format, wcs->obsgeo[4]); + wcshdo_util(ctrl, "OBSGEO-B", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[deg] IAU(1976) observatory latitude", nkeyrec, header, &status); + + wcsutil_double2str(keyvalue, format, wcs->obsgeo[5]); + wcshdo_util(ctrl, "OBSGEO-L", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "[m] IAU(1976) observatory height", nkeyrec, header, &status); + } + + /* Spacecraft orbit ephemeris file. */ + if (wcs->obsorbit[0]) { + sprintf(keyvalue, "'%s'", wcs->obsorbit); + wcshdo_util(ctrl, "OBSORBIT", 0x0, 0, 0x0, 0, 0, 0, ' ', 0, 0x0, keyvalue, + "Spacecraft orbit ephemeris file", nkeyrec, header, &status); + } + + /* Equatorial coordinate system type. */ + if (wcs->radesys[0]) { + sprintf(keyvalue, "'%s'", wcs->radesys); + wcshdo_util(ctrl, "RADESYS", "RADE", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Equatorial coordinate system", nkeyrec, header, &status); + } + + /* Equinox of equatorial coordinate system. */ + if (!undefined(wcs->equinox)) { + wcsutil_double2str(keyvalue, format, wcs->equinox); + wcshdo_util(ctrl, "EQUINOX", "EQUI", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "[yr] Equinox of equatorial coordinates", nkeyrec, header, + &status); + } + + /* Reference frame of spectral coordinates. */ + if (wcs->specsys[0]) { + sprintf(keyvalue, "'%s'", wcs->specsys); + wcshdo_util(ctrl, "SPECSYS", "SPEC", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Reference frame of spectral coordinates", nkeyrec, header, + &status); + } + + /* Reference frame of spectral observation. */ + if (wcs->ssysobs[0]) { + sprintf(keyvalue, "'%s'", wcs->ssysobs); + wcshdo_util(ctrl, "SSYSOBS", "SOBS", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Reference frame of spectral observation", nkeyrec, header, + &status); + } + + /* Observer's velocity towards source. */ + if (!undefined(wcs->velosys)) { + wcsutil_double2str(keyvalue, format, wcs->velosys); + wcshdo_util(ctrl, "VELOSYS", "VSYS", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "[m/s] Velocity towards source", nkeyrec, header, &status); + } + + /* Redshift of the source. */ + if (!undefined(wcs->zsource)) { + wcsutil_double2str(keyvalue, format, wcs->zsource); + wcshdo_util(ctrl, "ZSOURCE", "ZSOU", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Redshift of the source", nkeyrec, header, &status); + } + + /* Reference frame of source redshift. */ + if (wcs->ssyssrc[0]) { + sprintf(keyvalue, "'%s'", wcs->ssyssrc); + wcshdo_util(ctrl, "SSYSSRC", "SSRC", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "Reference frame of source redshift", nkeyrec, header, + &status); + } + + /* Velocity orientation angle. */ + if (!undefined(wcs->velangl)) { + wcsutil_double2str(keyvalue, format, wcs->velangl); + wcshdo_util(ctrl, "VELANGL", "VANG", 0, 0x0, 0, 0, 0, alt, colnum, colax, + keyvalue, "[deg] Velocity orientation angle", nkeyrec, header, &status); + } + + + /* Write distortion function parameters. */ + if (dosip) { + /* Simple Imaging Polynomial (SIP) is handled by translating its dpkey */ + /* records. Determine a suitable numerical precision for the */ + /* polynomial coefficients to avoid trailing zeroes common to all of */ + /* them. */ + dis = wcs->lin.dispre; + if (dofmt) { + keyp = dis->dp; + kp0 = keyvalue + 2; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "SIP.", 4) != 0) continue; + wcsutil_double2str(keyvalue, "%20.13E", dpkeyd(keyp)); + + kp = keyvalue + 15; + while (kp0 < kp && *kp == '0') kp--; + kp0 = kp; + } + + precision = kp0 - (keyvalue + 2); + if (precision < 1) precision = 1; + if (13 < precision) precision = 13; + sprintf(format, "%%20.%dE", precision); + } + + /* Ensure the coefficients are written in a human-readable sequence. */ + for (j = 0; j <= 1; j++) { + /* Distortion function polynomial coefficients. */ + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + if (j == 0) { + strcpy(keyword, "A_"); + } else { + strcpy(keyword, "B_"); + } + + ncoeff = dis->iparm[j][I_TPDNCO]; + for (degree = 0; degree <= 9; degree++) { + if (ncoeff <= nTPD[degree]) break; + } + + strcpy(keyword+2, "ORDER"); + sprintf(keyvalue, "%20d", degree); + sprintf(comment, "SIP polynomial degree, axis %d, pixel-to-sky", j+1); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + keyvalue, comment, nkeyrec, header, &status); + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + if ((keyval = dpkeyd(keyp)) == 0.0) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "SIP.FWD.", 8) != 0) continue; + cp += 8; + strcpy(keyword+2, cp); + sscanf(cp, "%d_%d", &p, &q); + strncpy(term, "xxxxxxxxx", p); + strncpy(term+p, "yyyyyyyyy", q); + term[p+q] = '\0'; + + wcsutil_double2str(keyvalue, format, keyval); + sprintf(comment, "SIP distortion coefficient: %s", term); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + if (dis->maxdis[j] != 0.0) { + strcpy(keyword+2, "DMAX"); + wcsutil_double2str(keyvalue, "%20.3f", dis->maxdis[j]); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + keyvalue, "Maximum value of distortion function", nkeyrec, + header, &status); + } + + /* Inverse distortion function polynomial coefficients. */ + if (dis->disx2p == 0x0) continue; + + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + if (j == 0) { + strcpy(keyword, "AP_"); + } else { + strcpy(keyword, "BP_"); + } + + ncoeff = dis->iparm[j][I_NDPARM] - dis->iparm[j][I_TPDNCO]; + for (degree = 0; degree <= 9; degree++) { + if (ncoeff <= nTPD[degree]) break; + } + + strcpy(keyword+3, "ORDER"); + sprintf(keyvalue, "%20d", degree); + sprintf(comment, "SIP polynomial degree, axis %d, sky-to-pixel", j+1); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + keyvalue, comment, nkeyrec, header, &status); + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + if ((keyval = dpkeyd(keyp)) == 0.0) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "SIP.REV.", 8) != 0) continue; + cp += 8; + strcpy(keyword+3, cp); + sscanf(cp, "%d_%d", &p, &q); + strncpy(term, "xxxxxxxxx", p); + strncpy(term+p, "yyyyyyyyy", q); + term[p+q] = '\0'; + + wcsutil_double2str(keyvalue, format, keyval); + sprintf(comment, "SIP inverse coefficient: %s", term); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + } + } + + for (idis = 0; idis < 2; idis++) { + if (idis == 0 && (dis = wcs->lin.dispre) == 0x0) continue; + if (idis == 1 && (dis = wcs->lin.disseq) == 0x0) continue; + + for (j = 0; j < naxis; j++) { + if (dis->disp2x[j] == 0x0) continue; + + iparm = dis->iparm[j]; + dparm = dis->dparm[j]; + + /* Identify the distortion type. */ + if (dotpv) { + /* TPV "projection" is handled by translating its dpkey records, */ + /* which were originally translated from PVi_ma by wcsset(), or */ + /* possibly input directly as a CQDISia = 'TPV' distortion type. */ + /* Determine a suitable numerical precision for the polynomial */ + /* coefficients to avoid trailing zeroes common to all of them. */ + if (dofmt) wcshdo_format('E', iparm[I_NDPARM], dparm, format); + sprintf(fmt01, "%.3ss", format); + + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + /* Distortion function polynomial coefficients. */ + sprintf(keyword, "PV%d_", j+1); + kp = keyword + strlen(keyword); + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + if ((keyval = dpkeyd(keyp)) == 0.0) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "TPV.", 4) != 0) continue; + strcpy(kp, cp+4); + + /* Identify the term of the TPV polynomial for human readers. */ + sscanf(cp+4, "%d", &m); + wcshdo_tpdterm(m, j == wcs->lng, term); + sprintf(comment, "TPV coefficient: %s", term); + + if (keyval == 1.0) { + sprintf(keyvalue, fmt01, "1.0"); + } else { + wcsutil_double2str(keyvalue, format, keyval); + } + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + } else if (strcmp(dis->dtype[j], "TPD") == 0 || dotpd || + strcmp(dis->dtype[j], "Polynomial") == 0 || + strcmp(dis->dtype[j], "Polynomial*") == 0) { + /* One of the Paper IV type polynomial distortions. */ + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + if (strcmp(dis->dtype[j], "TPD") == 0) { + /* Pure TPD. */ + dotpd = 1; + } else if (strncmp(dis->dtype[j], "Polynomial", 10) == 0) { + /* Polynomial distortion. Write it as TPD by request? */ + dotpd = (iparm[I_DTYPE] & DIS_DOTPD); + strcpy(tpdsrc, "Polynomial distortion"); + } + + pq = idis ? 'Q' : 'P'; + Nhat = dis->Nhat[j]; + + /* CPDISja/CQDISia */ + sprintf(keyword, "C%cDIS%d", pq, j+1); + if (idis == 0) { + strcpy(comment, "P = prior, "); + } else { + strcpy(comment, "Q = sequent, "); + } + + if (dotpd) { + strcpy(keyvalue, "'TPD'"); + strcat(comment, "Template Polynomial Distortion"); + + /* For identifying terms of the TPD polynomial. */ + axmap = dis->axmap[j]; + direct = 1; + doaux = iparm[I_TPDAUX]; + if (Nhat == 2) { + /* Associate x with longitude, y with latitude. */ + if (axmap[0] == wcs->lng && axmap[1] == wcs->lat) { + direct = 1; + } else if (axmap[0] == wcs->lat && axmap[1] == wcs->lng) { + direct = 0; + } else { + /* Non-celestial. */ + direct = (axmap[0] < axmap[1]); + } + } + } else { + strcpy(keyvalue, "'Polynomial'"); + strcat(comment, "general Polynomial distortion"); + } + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + + /* NAXES. */ + sprintf(keyword, "D%c%d", pq, j+1); + sprintf(keyvalue, "'NAXES: %d'", Nhat); + if (Nhat == 1) { + strcpy(comment, "One independent variable"); + } else if (Nhat == 2) { + strcpy(comment, "Two independent variables"); + } else { + strcpy(comment, "Number of independent variables"); + } + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + + /* AXIS.jhat */ + for (jhat = 0; jhat < Nhat; jhat++) { + axmap = dis->axmap[j]; + sprintf(keyvalue, "'AXIS.%d: %d'", jhat+1, axmap[jhat]+1); + if (jhat == 0) { + strcpy(comment, "1st"); + } else if (jhat == 1) { + strcpy(comment, "2nd"); + } else if (jhat == 2) { + strcpy(comment, "3rd"); + } else { + sprintf(comment, "%dth", jhat+1); + } + + sprintf(comment+strlen(comment), " independent variable: axis %d", + axmap[jhat]+1); + if (dotpd) { + /* axid is "xyxuvu". */ + cp = axid; + if (!direct) cp++; + if (doaux) cp += 3; + sprintf(comment+strlen(comment), " (= %c)", cp[jhat]); + } + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* OFFSET.jhat */ + if (dofmt) wcshdo_format('f', Nhat, dis->offset[j], format); + for (jhat = 0; jhat < Nhat; jhat++) { + if (dis->offset[j][jhat] == 0.0) continue; + + wcsutil_double2str(ctemp, format, dis->offset[j][jhat]); + sprintf(keyvalue, "'OFFSET.%d: %s'", jhat+1, ctemp); + sprintf(comment, "Variable %d renormalization offset", jhat+1); + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* SCALE.jhat */ + if (dofmt) wcshdo_format('f', Nhat, dis->scale[j], format); + for (jhat = 0; jhat < Nhat; jhat++) { + if (dis->scale[j][jhat] == 1.0) continue; + + wcsutil_double2str(ctemp, format, dis->scale[j][jhat]); + sprintf(keyvalue, "'SCALE.%d: %s'", jhat+1, ctemp); + sprintf(comment, "Variable %d renormalization scale", jhat+1); + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* Does the distortion function compute a correction? */ + if (iparm[I_DOCORR]) { + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + "'DOCORR: 1'", "Distortion function computes a correction", + nkeyrec, header, &status); + } + + if (dotpd) { + /* Template Polynomial Distortion (TPD). As it may have been */ + /* translated from SIP, TPV, DSS, TNX, ZPX, or perhaps */ + /* Polynomial, the dpkey records may not relate to TPD. */ + /* Output is therefore handled via dparm. */ + if (dofmt) wcshdo_format('E', iparm[I_NDPARM], dparm, format); + sprintf(fmt01, "%.3ss", format); + + /* AUX.jhat.COEFF.m */ + if (doaux) { + for (idp = 0; idp < 6; idp++) { + if (dparm[idp] == 0.0) { + sprintf(ctemp, fmt01, "0.0"); + } else if (dparm[idp] == 1.0) { + sprintf(ctemp, fmt01, "1.0"); + } else { + wcsutil_double2str(ctemp, format, dparm[idp]); + } + + if (idp < 3) { + sprintf(keyvalue, "'AUX.1.COEFF.%d: %s'", idp%3, ctemp); + sprintf(comment, "TPD: x = c0 + c1*u + c2*v"); + } else { + sprintf(keyvalue, "'AUX.2.COEFF.%d: %s'", idp%3, ctemp); + sprintf(comment, "TPD: y = d0 + d1*u + d2*v"); + } + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + + } + + dparm += 6; + } + + /* TPD.FWD.m */ + for (idp = 0; idp < iparm[I_TPDNCO]; idp++) { + if (dparm[idp] == 0.0) continue; + + if (dparm[idp] == 1.0) { + sprintf(ctemp, fmt01, "1.0"); + } else { + wcsutil_double2str(ctemp, format, dparm[idp]); + } + + m = idp; + sprintf(keyvalue, "'TPD.FWD.%d:%s %s'", m, (m<10)?" ":"", ctemp); + wcshdo_tpdterm(m, direct, term); + sprintf(comment, "TPD coefficient: %s", term); + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* CPERRja/CQERRia */ + if (dis->maxdis[j] != 0.0) { + sprintf(keyword, "C%cERR%d", pq, j+1); + sprintf(keyvalue, "%20.2f", dis->maxdis[j]); + sprintf(comment, "%sMaximum absolute value of distortion", + idis?"":"[pix] "); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* Inverse distortion function polynomial coefficients. */ + if (dis->disx2p[j] == 0x0) continue; + + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + /* TPD.REV.m */ + sprintf(keyword, "D%c%d", pq, j+1); + for (idp = iparm[I_TPDNCO]; idp < iparm[I_NDPARM]; idp++) { + if (dparm[idp] == 0.0) continue; + + wcsutil_double2str(ctemp, format, dparm[idp]); + m = idp - iparm[I_TPDNCO]; + sprintf(keyvalue, "'TPD.REV.%d:%s %s'", m, (m<10)?" ":"", ctemp); + wcshdo_tpdterm(m, direct, term); + sprintf(comment, "TPD coefficient: %s", term); + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + } else { + /* General polynomial distortion, handled via its dpkey records */ + /* since iparm and dparm may hold a translation to TPD. */ + + /* Do auxiliary variables first. */ + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "NAUX", 4) != 0) continue; + + sprintf(keyvalue, "'%s: %d'", cp, dpkeyi(keyp)); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, "Number of auxiliary variables", nkeyrec, header, + &status); + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + + keyval = dpkeyd(keyp); + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "AUX.", 4) != 0) continue; + + sscanf(cp+4, "%d", &m); + sprintf(keyvalue, "'%s:", cp); + + cp = strchr(cp+4, '.') + 1; + kp = keyvalue + strlen(keyvalue); + + if ((double)((int)keyval) == keyval) { + sprintf(kp, "%4d'", (int)keyval); + } else if (keyval == 0.5) { + strcat(kp, " 0.5'"); + } else { + wcsutil_double2str(kp, "%21.13E", keyval); + strcat(keyvalue, "'"); + } + + sscanf(cp+6, "%d", &p); + if (strncmp(cp, "POWER.", 4) == 0) { + if (p) { + sprintf(comment, "Aux %d: var %d power", m, p); + } else { + sprintf(comment, "Aux %d: power of sum of terms", m); + } + } else { + if (p) { + sprintf(comment, "Aux %d: var %d coefficient", m, p); + } else { + sprintf(comment, "Aux %d: offset term", m); + } + } + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + break; + } + + /* Do polynomial terms. */ + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "NTERMS", 6) != 0) continue; + + sprintf(keyvalue, "'%s: %d'", cp, dpkeyi(keyp)); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, "Number of terms in the polynomial", nkeyrec, header, + &status); + } + + keyp = dis->dp; + for (idp = 0; idp < dis->ndp; idp++, keyp++) { + if (keyp->j != j+1) continue; + + if ((keyval = dpkeyd(keyp)) == 0.0) continue; + + cp = strchr(keyp->field, '.') + 1; + if (strncmp(cp, "TERM.", 5) != 0) continue; + + sscanf(cp+5, "%d", &m); + sprintf(keyvalue, "'%s:%s ", cp, (m<10)?" ":""); + + cp = strchr(cp+5, '.') + 1; + kp = keyvalue + strlen(keyvalue); + if (strncmp(cp, "VAR.", 4) == 0) { + if ((double)((int)keyval) == keyval) { + sprintf(kp, "%20d", (int)keyval); + } else { + wcsutil_double2str(kp, "%20.13f", keyval); + } + + sscanf(cp+4, "%d", &p); + if (p <= Nhat) { + sprintf(comment, "Poly term %d: var %d power", m, p); + } else { + sprintf(comment, "Poly term %d: aux %d power", m, p-Nhat); + } + + } else { + wcsutil_double2str(kp, "%20.13E", keyval); + sprintf(comment, "Poly term %d: coefficient", m); + } + strcat(keyvalue, "'"); + + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + + /* CPERRja/CQERRia */ + if (dis->maxdis[j] != 0.0) { + sprintf(keyword, "C%cERR%d", pq, j+1); + sprintf(keyvalue, "%20.2f", dis->maxdis[j]); + sprintf(comment, "%sMaximum absolute value of distortion", + idis?"":"[pix] "); + wcshdo_util(ctrl, keyword, "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + } + } + } + + /* DVERRa */ + if (dis->totdis != 0.0) { + sprintf(keyvalue, "%20.2f", dis->totdis); + sprintf(comment, "Maximum combined distortion"); + wcshdo_util(ctrl, "DVERR", "", 0, 0x0, 0, 0, 0, alt, 0, 0, + keyvalue, comment, nkeyrec, header, &status); + } + } + + + /* Add identification. */ + wcshdo_util(ctrl, "", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, "", "", + nkeyrec, header, &status); + + if (dotpd == DIS_DOTPD) { + /* TPD by translation. */ + sprintf(comment, "Translated from %s to TPD by WCSLIB %s", tpdsrc, + wcslib_version(0x0)); + } else { + sprintf(comment, "WCS header keyrecords produced by WCSLIB %s", + wcslib_version(0x0)); + } + + wcshdo_util(ctrl, "COMMENT", "", 0, 0x0, 0, 0, 0, ' ', 0, 0, + "", comment, nkeyrec, header, &status); + + + if (status == WCSHDRERR_MEMORY) { + wcserr_set(WCSHDR_ERRMSG(status)); + } + return status; +} + +/*--------------------------------------------------------------------------*/ +/* Determine a suitable floating point format for a set of parameters. */ + +void wcshdo_format( + int fmt, + int nval, + const double val[], + char *format) + +{ + char *cp, *cp0, cval[24]; + int i, expmax, expon, nsig, precision; + + if (fmt == 'G') { + fmt = 'f'; + for (i = 0; i < nval; i++) { + if (fabs(val[i]) < 1e-4 || 1e12 < val[i]) { + fmt = 'E'; + break; + } + } + } + + cp0 = cval + 2; + expmax = -999; + for (i = 0; i < nval; i++) { + /* Double precision has at least 15 significant digits, and up to 17: */ + /* http://en.wikipedia.org/wiki/Double-precision_floating-point_format */ + wcsutil_double2str(cval, "%21.14E", val[i]); + + cp = cval + 16; + while (cp0 < cp && *cp == '0') cp--; + cp0 = cp; + + sscanf(cval+18, "%d", &expon); + if (expmax < expon) expmax = expon; + } + + nsig = cp0 - (cval + 2) + 1; + + + if (fmt == 'f') { + precision = nsig - (expmax + 1); + if (precision < 1) precision = 1; + if (17 < precision) precision = 17; + sprintf(format, "%%20.%df", precision); + + } else { + precision = nsig - 1; + if (precision < 1) precision = 1; + if (14 < precision) precision = 14; + if (precision < 14) { + sprintf(format, "%%20.%dE", precision); + } else { + sprintf(format, "%%21.%dE", precision); + } + } +} + +/*--------------------------------------------------------------------------*/ +/* Construct a string that identifies the term of a TPD or TPV polynomial. */ + +void wcshdo_tpdterm( + int m, + int direct, + char *term) + +{ + const int nTPD[] = {1, 4, 7, 12, 17, 24, 31, 40, 49, 60}; + + int degree, k; + + for (degree = 0; degree <= 9; degree++) { + if (m < nTPD[degree]) break; + } + + if (degree == 0) { + strcpy(term, "1"); + + } else { + k = degree - (m - nTPD[degree-1]); + + if (k < 0) { + strncpy(term, "rrrrrrrrr", degree); + } else if (direct) { + strncpy(term, "xxxxxxxxx", k); + strncpy(term+k, "yyyyyyyyy", degree-k); + } else { + strncpy(term, "yyyyyyyyy", k); + strncpy(term+k, "xxxxxxxxx", degree-k); + } + + term[degree] = '\0'; + } +} + +/*--------------------------------------------------------------------------*/ +/* Construct a keyrecord from the components given. */ + +void wcshdo_util( + int relax, + const char pikey[], + const char tbkey[], + int level, + const char tlkey[], + int i, + int j, + int m, + char alt, + int btcol, + int plcol[], + char keyvalue[], + const char keycomment[], + int *nkeyrec, + char **header, + int *status) + +{ + char ch0, ch1, *hptr, keyword[32], *kptr; + int nbyte, nc = 47, nv; + + if (*status) return; + + /* Reallocate memory in blocks of 2880 bytes. */ + if ((*nkeyrec)%32 == 0) { + nbyte = ((*nkeyrec)/32 + 1) * 2880; + if (!(hptr = realloc(*header, nbyte))) { + *status = WCSHDRERR_MEMORY; + return; + } + + *header = hptr; + } + + /* Construct the keyword. */ + if (alt == ' ') alt = '\0'; + if (btcol) { + /* Binary table image array. */ + if (i > 0 && j) { + if (j > 0) { + sprintf(keyword, "%d%d%s%d%c", i, j, tbkey, btcol, alt); + } else { + sprintf(keyword, "%d%s%d_%d%c", i, tbkey, btcol, m, alt); + } + } else if (i > 0) { + sprintf(keyword, "%d%s%d%c", i, tbkey, btcol, alt); + } else if (j > 0) { + sprintf(keyword, "%d%s%d%c", j, tbkey, btcol, alt); + } else { + sprintf(keyword, "%s%d%c", tbkey, btcol, alt); + } + + if ((strlen(keyword) < 8) && tlkey && (relax & level)) { + /* Use the long form. */ + if (i > 0 && j) { + if (j > 0) { + sprintf(keyword, "%d%d%s%d%c", i, j, tlkey, btcol, alt); + } else { + sprintf(keyword, "%d%s%d_%d%c", i, tlkey, btcol, m, alt); + } + } else if (i > 0) { + sprintf(keyword, "%d%s%d%c", i, tlkey, btcol, alt); + } else if (j > 0) { + sprintf(keyword, "%d%s%d%c", j, tlkey, btcol, alt); + } else { + sprintf(keyword, "%s%d%c", tlkey, btcol, alt); + } + } + + } else if (plcol && plcol[0]) { + /* Pixel list. */ + if (i > 0 && j) { + if (j > 0) { + sprintf(keyword, "T%s%d_%d%c", tbkey, plcol[i-1], plcol[j-1], alt); + } else { + sprintf(keyword, "T%s%d_%d%c", tbkey, plcol[i-1], m, alt); + } + } else if (i > 0) { + sprintf(keyword, "T%s%d%c", tbkey, plcol[i-1], alt); + } else if (j > 0) { + sprintf(keyword, "T%s%d%c", tbkey, plcol[j-1], alt); + } else { + sprintf(keyword, "%s%d%c", tbkey, plcol[0], alt); + } + + if ((strlen(keyword) < 8) && tlkey && (relax & level)) { + /* Use the long form. */ + if (i > 0 && j) { + if (j > 0) { + sprintf(keyword, "T%s%d_%d%c", tlkey, plcol[i-1], plcol[j-1], alt); + } else { + sprintf(keyword, "T%s%d_%d%c", tlkey, plcol[i-1], m, alt); + } + } else if (i > 0) { + sprintf(keyword, "T%s%d%c", tlkey, plcol[i-1], alt); + } else if (j > 0) { + sprintf(keyword, "T%s%d%c", tlkey, plcol[j-1], alt); + } else { + sprintf(keyword, "%s%d%c", tlkey, plcol[0], alt); + } + } + } else { + if (i > 0 && j) { + if (j > 0) { + sprintf(keyword, "%s%d_%d%c", pikey, i, j, alt); + } else { + sprintf(keyword, "%s%d_%d%c", pikey, i, m, alt); + } + } else if (i > 0) { + sprintf(keyword, "%s%d%c", pikey, i, alt); + } else if (j > 0) { + sprintf(keyword, "%s%d%c", pikey, j, alt); + } else { + sprintf(keyword, "%s%c", pikey, alt); + } + } + + /* Double-up single-quotes in string keyvalues. */ + if (*keyvalue == '\'') { + hptr = keyvalue + 1; + while (*hptr) { + if (*hptr == '\'') { + kptr = hptr++; + if (*hptr) { + ch0 = *kptr; + while (*kptr) { + ch1 = *(++kptr); + *kptr = ch0; + ch0 = ch1; + } + } else { + break; + } + } + + hptr++; + } + + /* Check length. */ + if (strlen(keyvalue) > 70) { + /* Truncate. */ + keyvalue[69] = '\''; + keyvalue[70] = '\0'; + } + + } else { + /* Check length. */ + if (strlen(keyvalue) > 70) { + /* Truncate. */ + keyvalue[70] = '\0'; + } + } + + if ((nv = strlen(keyvalue) > 20)) { + /* Rob the keycomment to make space for the keyvalue. */ + nc -= (nv - 20); + } + + hptr = *header + (80 * ((*nkeyrec)++)); + if (*keyword == '\0') { + sprintf(hptr, "%80.80s", " "); + } else if (strcmp(keyword, "COMMENT") == 0) { + sprintf(hptr, "%-8.8s %-71.71s", keyword, keycomment); + } else { + sprintf(hptr, "%-8.8s= %-20s / %-*.*s", keyword, keyvalue, nc, nc, + keycomment); + } +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.h b/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.h new file mode 100644 index 0000000000000000000000000000000000000000..7f9d6cd5d1ad218477693d20ad4758de37099395 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcshdr.h @@ -0,0 +1,1354 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcshdr.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcshdr routines +* ------------------------------ +* Routines in this suite are aimed at extracting WCS information from a FITS +* file. The information is encoded via keywords defined in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) += += "Representations of celestial coordinates in FITS", += Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II) += += "Representations of spectral coordinates in FITS", += Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L. += 2006, A&A, 446, 747 (WCS Paper III) += += "Representations of distortions in FITS world coordinate systems", += Calabretta, M.R. et al. (WCS Paper IV, draft dated 2004/04/22), += available from http://www.atnf.csiro.au/people/Mark.Calabretta += += "Representations of time coordinates in FITS - += Time and relative dimension in space", += Rots, A.H., Bunclark, P.S., Calabretta, M.R., Allen, S.L., += Manchester, R.N., & Thompson, W.T. 2015, A&A, 574, A36 (WCS Paper VII) +* +* These routines provide the high-level interface between the FITS file and +* the WCS coordinate transformation routines. +* +* Additionally, function wcshdo() is provided to write out the contents of a +* wcsprm struct as a FITS header. +* +* Briefly, the anticipated sequence of operations is as follows: +* +* - 1: Open the FITS file and read the image or binary table header, e.g. +* using CFITSIO routine fits_hdr2str(). +* +* - 2: Parse the header using wcspih() or wcsbth(); they will automatically +* interpret 'TAB' header keywords using wcstab(). +* +* - 3: Allocate memory for, and read 'TAB' arrays from the binary table +* extension, e.g. using CFITSIO routine fits_read_wcstab() - refer to +* the prologue of getwcstab.h. wcsset() will automatically take +* control of this allocated memory, in particular causing it to be +* free'd by wcsfree(). +* +* - 4: Translate non-standard WCS usage using wcsfix(), see wcsfix.h. +* +* - 5: Initialize wcsprm struct(s) using wcsset() and calculate coordinates +* using wcsp2s() and/or wcss2p(). Refer to the prologue of wcs.h for a +* description of these and other high-level WCS coordinate +* transformation routines. +* +* - 6: Clean up by freeing memory with wcsvfree(). +* +* In detail: +* +* - wcspih() is a high-level FITS WCS routine that parses an image header. It +* returns an array of up to 27 wcsprm structs on each of which it invokes +* wcstab(). +* +* - wcsbth() is the analogue of wcspih() for use with binary tables; it +* handles image array and pixel list keywords. As an extension of the FITS +* WCS standard, it also recognizes image header keywords which may be used +* to provide default values via an inheritance mechanism. +* +* - wcstab() assists in filling in members of the wcsprm struct associated +* with coordinate lookup tables ('TAB'). These are based on arrays stored +* in a FITS binary table extension (BINTABLE) that are located by PVi_ma +* keywords in the image header. +* +* - wcsidx() and wcsbdx() are utility routines that return the index for a +* specified alternate coordinate descriptor in the array of wcsprm structs +* returned by wcspih() or wcsbth(). +* +* - wcsvfree() deallocates memory for an array of wcsprm structs, such as +* returned by wcspih() or wcsbth(). +* +* - wcshdo() writes out a wcsprm struct as a FITS header. +* +* +* wcspih() - FITS WCS parser routine for image headers +* ---------------------------------------------------- +* wcspih() is a high-level FITS WCS routine that parses an image header, +* either that of a primary HDU or of an image extension. All WCS keywords +* defined in Papers I, II, III, IV, and VII are recognized, and also those +* used by the AIPS convention and certain other keywords that existed in early +* drafts of the WCS papers as explained in wcsbth() note 5. wcspih() also +* handles keywords associated with non-standard distortion functions described +* in the prologue of dis.h. +* +* Given a character array containing a FITS image header, wcspih() identifies +* and reads all WCS keywords for the primary coordinate representation and up +* to 26 alternate representations. It returns this information as an array of +* wcsprm structs. +* +* wcspih() invokes wcstab() on each of the wcsprm structs that it returns. +* +* Use wcsbth() in preference to wcspih() for FITS headers of unknown type; +* wcsbth() can parse image headers as well as binary table and pixel list +* headers, although it cannot handle keywords relating to distortion +* functions, which may only exist in a primary image header. +* +* Given and returned: +* header char[] Character array containing the (entire) FITS image +* header from which to identify and construct the +* coordinate representations, for example, as might be +* obtained conveniently via the CFITSIO routine +* fits_hdr2str(). +* +* Each header "keyrecord" (formerly "card image") +* consists of exactly 80 7-bit ASCII printing characters +* in the range 0x20 to 0x7e (which excludes NUL, BS, +* TAB, LF, FF and CR) especially noting that the +* keyrecords are NOT null-terminated. +* +* For negative values of ctrl (see below), header[] is +* modified so that WCS keyrecords processed by wcspih() +* are removed from it. +* +* Given: +* nkeyrec int Number of keyrecords in header[]. +* +* relax int Degree of permissiveness: +* 0: Recognize only FITS keywords defined by the +* published WCS standard. +* WCSHDR_all: Admit all recognized informal +* extensions of the WCS standard. +* Fine-grained control of the degree of permissiveness +* is also possible as explained in wcsbth() note 5. +* +* ctrl int Error reporting and other control options for invalid +* WCS and other header keyrecords: +* 0: Do not report any rejected header keyrecords. +* 1: Produce a one-line message stating the number +* of WCS keyrecords rejected (nreject). +* 2: Report each rejected keyrecord and the reason +* why it was rejected. +* 3: As above, but also report all non-WCS +* keyrecords that were discarded, and the number +* of coordinate representations (nwcs) found. +* 4: As above, but also report the accepted WCS +* keyrecords, with a summary of the number +* accepted as well as rejected. +* The report is written to stderr by default, or the +* stream set by wcsprintf_set(). +* +* For ctrl < 0, WCS keyrecords processed by wcspih() +* are removed from header[]: +* -1: Remove only valid WCS keyrecords whose values +* were successfully extracted, nothing is +* reported. +* -2: As above, but also remove WCS keyrecords that +* were rejected, reporting each one and the +* reason that it was rejected. +* -3: As above, and also report the number of +* coordinate representations (nwcs) found. +* -11: Same as -1 but preserving global WCS-related +* keywords such as '{DATE,MJD}-{OBS,BEG,AVG,END}' +* and the other basic time-related keywords, and +* 'OBSGEO-{X,Y,Z,L,B,H}'. +* If any keyrecords are removed from header[] it will +* be null-terminated (NUL not being a legal FITS header +* character), otherwise it will contain its original +* complement of nkeyrec keyrecords and possibly not be +* null-terminated. +* +* Returned: +* nreject int* Number of WCS keywords rejected for syntax errors, +* illegal values, etc. Keywords not recognized as WCS +* keywords are simply ignored. Refer also to wcsbth() +* note 5. +* +* nwcs int* Number of coordinate representations found. +* +* wcs struct wcsprm** +* Pointer to an array of wcsprm structs containing up to +* 27 coordinate representations. +* +* Memory for the array is allocated by wcspih() which +* also invokes wcsini() for each struct to allocate +* memory for internal arrays and initialize their +* members to default values. Refer also to wcsbth() +* note 8. Note that wcsset() is not invoked on these +* structs. +* +* This allocated memory must be freed by the user, first +* by invoking wcsfree() for each struct, and then by +* freeing the array itself. A routine, wcsvfree(), is +* provided to do this (see below). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 4: Fatal error returned by Flex parser. +* +* Notes: +* Refer to wcsbth() notes 1, 2, 3, 5, 7, and 8. +* +* +* wcsbth() - FITS WCS parser routine for binary table and image headers +* --------------------------------------------------------------------- +* wcsbth() is a high-level FITS WCS routine that parses a binary table header. +* It handles image array and pixel list WCS keywords which may be present +* together in one header. +* +* As an extension of the FITS WCS standard, wcsbth() also recognizes image +* header keywords in a binary table header. These may be used to provide +* default values via an inheritance mechanism discussed in note 5 (c.f. +* WCSHDR_AUXIMG and WCSHDR_ALLIMG), or may instead result in wcsprm structs +* that are not associated with any particular column. Thus wcsbth() can +* handle primary image and image extension headers in addition to binary table +* headers (it ignores NAXIS and does not rely on the presence of the TFIELDS +* keyword). +* +* All WCS keywords defined in Papers I, II, III, and VII are recognized, and +* also those used by the AIPS convention and certain other keywords that +* existed in early drafts of the WCS papers as explained in note 5 below. +* +* wcsbth() sets the colnum or colax[] members of the wcsprm structs that it +* returns with the column number of an image array or the column numbers +* associated with each pixel coordinate element in a pixel list. wcsprm +* structs that are not associated with any particular column, as may be +* derived from image header keywords, have colnum == 0. +* +* Note 6 below discusses the number of wcsprm structs returned by wcsbth(), +* and the circumstances in which image header keywords cause a struct to be +* created. See also note 9 concerning the number of separate images that may +* be stored in a pixel list. +* +* The API to wcsbth() is similar to that of wcspih() except for the addition +* of extra arguments that may be used to restrict its operation. Like +* wcspih(), wcsbth() invokes wcstab() on each of the wcsprm structs that it +* returns. +* +* Given and returned: +* header char[] Character array containing the (entire) FITS binary +* table, primary image, or image extension header from +* which to identify and construct the coordinate +* representations, for example, as might be obtained +* conveniently via the CFITSIO routine fits_hdr2str(). +* +* Each header "keyrecord" (formerly "card image") +* consists of exactly 80 7-bit ASCII printing +* characters in the range 0x20 to 0x7e (which excludes +* NUL, BS, TAB, LF, FF and CR) especially noting that +* the keyrecords are NOT null-terminated. +* +* For negative values of ctrl (see below), header[] is +* modified so that WCS keyrecords processed by wcsbth() +* are removed from it. +* +* Given: +* nkeyrec int Number of keyrecords in header[]. +* +* relax int Degree of permissiveness: +* 0: Recognize only FITS keywords defined by the +* published WCS standard. +* WCSHDR_all: Admit all recognized informal +* extensions of the WCS standard. +* Fine-grained control of the degree of permissiveness +* is also possible, as explained in note 5 below. +* +* ctrl int Error reporting and other control options for invalid +* WCS and other header keyrecords: +* 0: Do not report any rejected header keyrecords. +* 1: Produce a one-line message stating the number +* of WCS keyrecords rejected (nreject). +* 2: Report each rejected keyrecord and the reason +* why it was rejected. +* 3: As above, but also report all non-WCS +* keyrecords that were discarded, and the number +* of coordinate representations (nwcs) found. +* 4: As above, but also report the accepted WCS +* keyrecords, with a summary of the number +* accepted as well as rejected. +* The report is written to stderr by default, or the +* stream set by wcsprintf_set(). +* +* For ctrl < 0, WCS keyrecords processed by wcsbth() +* are removed from header[]: +* -1: Remove only valid WCS keyrecords whose values +* were successfully extracted, nothing is +* reported. +* -2: Also remove WCS keyrecords that were rejected, +* reporting each one and the reason that it was +* rejected. +* -3: As above, and also report the number of +* coordinate representations (nwcs) found. +* -11: Same as -1 but preserving global WCS-related +* keywords such as '{DATE,MJD}-{OBS,BEG,AVG,END}' +* and the other basic time-related keywords, and +* 'OBSGEO-{X,Y,Z,L,B,H}'. +* If any keyrecords are removed from header[] it will +* be null-terminated (NUL not being a legal FITS header +* character), otherwise it will contain its original +* complement of nkeyrec keyrecords and possibly not be +* null-terminated. +* +* keysel int Vector of flag bits that may be used to restrict the +* keyword types considered: +* WCSHDR_IMGHEAD: Image header keywords. +* WCSHDR_BIMGARR: Binary table image array. +* WCSHDR_PIXLIST: Pixel list keywords. +* If zero, there is no restriction. +* +* Keywords such as EQUIna or RFRQna that are common to +* binary table image arrays and pixel lists (including +* WCSNna and TWCSna, as explained in note 4 below) are +* selected by both WCSHDR_BIMGARR and WCSHDR_PIXLIST. +* Thus if inheritance via WCSHDR_ALLIMG is enabled as +* discussed in note 5 and one of these shared keywords +* is present, then WCSHDR_IMGHEAD and WCSHDR_PIXLIST +* alone may be sufficient to cause the construction of +* coordinate descriptions for binary table image arrays. +* +* colsel int* Pointer to an array of table column numbers used to +* restrict the keywords considered by wcsbth(). +* +* A null pointer may be specified to indicate that there +* is no restriction. Otherwise, the magnitude of +* cols[0] specifies the length of the array: +* cols[0] > 0: the columns are included, +* cols[0] < 0: the columns are excluded. +* +* For the pixel list keywords TPn_ka and TCn_ka (and +* TPCn_ka and TCDn_ka if WCSHDR_LONGKEY is enabled), it +* is an error for one column to be selected but not the +* other. This is unlike the situation with invalid +* keyrecords, which are simply rejected, because the +* error is not intrinsic to the header itself but +* arises in the way that it is processed. +* +* Returned: +* nreject int* Number of WCS keywords rejected for syntax errors, +* illegal values, etc. Keywords not recognized as WCS +* keywords are simply ignored, refer also to note 5 +* below. +* +* nwcs int* Number of coordinate representations found. +* +* wcs struct wcsprm** +* Pointer to an array of wcsprm structs containing up +* to 27027 coordinate representations, refer to note 6 +* below. +* +* Memory for the array is allocated by wcsbth() which +* also invokes wcsini() for each struct to allocate +* memory for internal arrays and initialize their +* members to default values. Refer also to note 8 +* below. Note that wcsset() is not invoked on these +* structs. +* +* This allocated memory must be freed by the user, first +* by invoking wcsfree() for each struct, and then by +* freeing the array itself. A routine, wcsvfree(), is +* provided to do this (see below). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid column selection. +* 4: Fatal error returned by Flex parser. +* +* Notes: +* 1: wcspih() determines the number of coordinate axes independently for +* each alternate coordinate representation (denoted by the "a" value in +* keywords like CTYPEia) from the higher of +* +* a: NAXIS, +* b: WCSAXESa, +* c: The highest axis number in any parameterized WCS keyword. The +* keyvalue, as well as the keyword, must be syntactically valid +* otherwise it will not be considered. +* +* If none of these keyword types is present, i.e. if the header only +* contains auxiliary WCS keywords for a particular coordinate +* representation, then no coordinate description is constructed for it. +* +* wcsbth() is similar except that it ignores the NAXIS keyword if given +* an image header to process. +* +* The number of axes, which is returned as a member of the wcsprm +* struct, may differ for different coordinate representations of the +* same image. +* +* 2: wcspih() and wcsbth() enforce correct FITS "keyword = value" syntax +* with regard to "= " occurring in columns 9 and 10. +* +* However, they do recognize free-format character (NOST 100-2.0, +* Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values +* (Sect. 5.2.4) for all keywords. +* +* 3: Where CROTAn, CDi_ja, and PCi_ja occur together in one header wcspih() +* and wcsbth() treat them as described in the prologue to wcs.h. +* +* 4: WCS Paper I mistakenly defined the pixel list form of WCSNAMEa as +* TWCSna instead of WCSNna; the 'T' is meant to substitute for the axis +* number in the binary table form of the keyword - note that keywords +* defined in WCS Papers II, III, and VII that are not parameterized by +* axis number have identical forms for binary tables and pixel lists. +* Consequently wcsbth() always treats WCSNna and TWCSna as equivalent. +* +* 5: wcspih() and wcsbth() interpret the "relax" argument as a vector of +* flag bits to provide fine-grained control over what non-standard WCS +* keywords to accept. The flag bits are subject to change in future and +* should be set by using the preprocessor macros (see below) for the +* purpose. +* +* - WCSHDR_none: Don't accept any extensions (not even those in the +* errata). Treat non-conformant keywords in the same way as +* non-WCS keywords in the header, i.e. simply ignore them. +* +* - WCSHDR_all: Accept all extensions recognized by the parser. +* +* - WCSHDR_reject: Reject non-standard keyrecords (that are not otherwise +* explicitly accepted by one of the flags below). A message will +* optionally be printed on stderr by default, or the stream set +* by wcsprintf_set(), as determined by the ctrl argument, and +* nreject will be incremented. +* +* This flag may be used to signal the presence of non-standard +* keywords, otherwise they are simply passed over as though they +* did not exist in the header. It is mainly intended for testing +* conformance of a FITS header to the WCS standard. +* +* Keyrecords may be non-standard in several ways: +* +* - The keyword may be syntactically valid but with keyvalue of +* incorrect type or invalid syntax, or the keycomment may be +* malformed. +* +* - The keyword may strongly resemble a WCS keyword but not, in +* fact, be one because it does not conform to the standard. +* For example, "CRPIX01" looks like a CRPIXja keyword, but in +* fact the leading zero on the axis number violates the basic +* FITS standard. Likewise, "LONPOLE2" is not a valid +* LONPOLEa keyword in the WCS standard, and indeed there is +* nothing the parser can sensibly do with it. +* +* - Use of the keyword may be deprecated by the standard. Such +* will be rejected if not explicitly accepted via one of the +* flags below. +* +* - WCSHDR_strict: As for WCSHDR_reject, but also reject AIPS-convention +* keywords and all other deprecated usage that is not explicitly +* accepted. +* +* - WCSHDR_CROTAia: Accept CROTAia (wcspih()), +* iCROTna (wcsbth()), +* TCROTna (wcsbth()). +* - WCSHDR_VELREFa: Accept VELREFa. +* wcspih() always recognizes the AIPS-convention keywords, +* CROTAn, EPOCH, and VELREF for the primary representation +* (a = ' ') but alternates are non-standard. +* +* wcsbth() accepts EPOCHa and VELREFa only if WCSHDR_AUXIMG is +* also enabled. +* +* - WCSHDR_CD00i00j: Accept CD00i00j (wcspih()). +* - WCSHDR_PC00i00j: Accept PC00i00j (wcspih()). +* - WCSHDR_PROJPn: Accept PROJPn (wcspih()). +* These appeared in early drafts of WCS Paper I+II (before they +* were split) and are equivalent to CDi_ja, PCi_ja, and PVi_ma +* for the primary representation (a = ' '). PROJPn is +* equivalent to PVi_ma with m = n <= 9, and is associated +* exclusively with the latitude axis. +* +* - WCSHDR_CD0i_0ja: Accept CD0i_0ja (wcspih()). +* - WCSHDR_PC0i_0ja: Accept PC0i_0ja (wcspih()). +* - WCSHDR_PV0i_0ma: Accept PV0i_0ja (wcspih()). +* - WCSHDR_PS0i_0ma: Accept PS0i_0ja (wcspih()). +* Allow the numerical index to have a leading zero in doubly- +* parameterized keywords, for example, PC01_01. WCS Paper I +* (Sects 2.1.2 & 2.1.4) explicitly disallows leading zeroes. +* The FITS 3.0 standard document (Sect. 4.1.2.1) states that the +* index in singly-parameterized keywords (e.g. CTYPEia) "shall +* not have leading zeroes", and later in Sect. 8.1 that "leading +* zeroes must not be used" on PVi_ma and PSi_ma. However, by an +* oversight, it is silent on PCi_ja and CDi_ja. +* +* - WCSHDR_DOBSn (wcsbth() only): Allow DOBSn, the column-specific +* analogue of DATE-OBS. By an oversight this was never formally +* defined in the standard. +* +* - WCSHDR_OBSGLBHn (wcsbth() only): Allow OBSGLn, OBSGBn, and OBSGHn, +* the column-specific analogues of OBSGEO-L, OBSGEO-B, and +* OBSGEO-H. By an oversight these were never formally defined in +* the standard. +* +* - WCSHDR_RADECSYS: Accept RADECSYS. This appeared in early drafts of +* WCS Paper I+II and was subsequently replaced by RADESYSa. +* +* wcsbth() accepts RADECSYS only if WCSHDR_AUXIMG is also +* enabled. +* +* - WCSHDR_EPOCHa: Accept EPOCHa. +* +* - WCSHDR_VSOURCE: Accept VSOURCEa or VSOUna (wcsbth()). This appeared +* in early drafts of WCS Paper III and was subsequently dropped +* in favour of ZSOURCEa and ZSOUna. +* +* wcsbth() accepts VSOURCEa only if WCSHDR_AUXIMG is also +* enabled. +* +* - WCSHDR_LONGKEY (wcsbth() only): Accept long forms of the alternate +* binary table and pixel list WCS keywords, i.e. with "a" non- +* blank. Specifically +* +# jCRPXna TCRPXna : jCRPXn jCRPna TCRPXn TCRPna CRPIXja +# - TPCn_ka : - ijPCna - TPn_ka PCi_ja +# - TCDn_ka : - ijCDna - TCn_ka CDi_ja +# iCDLTna TCDLTna : iCDLTn iCDEna TCDLTn TCDEna CDELTia +# iCUNIna TCUNIna : iCUNIn iCUNna TCUNIn TCUNna CUNITia +# iCTYPna TCTYPna : iCTYPn iCTYna TCTYPn TCTYna CTYPEia +# iCRVLna TCRVLna : iCRVLn iCRVna TCRVLn TCRVna CRVALia +# iPVn_ma TPVn_ma : - iVn_ma - TVn_ma PVi_ma +# iPSn_ma TPSn_ma : - iSn_ma - TSn_ma PSi_ma +* +* where the primary and standard alternate forms together with +* the image-header equivalent are shown rightwards of the colon. +* +* The long form of these keywords could be described as quasi- +* standard. TPCn_ka, iPVn_ma, and TPVn_ma appeared by mistake +* in the examples in WCS Paper II and subsequently these and +* also TCDn_ka, iPSn_ma and TPSn_ma were legitimized by the +* errata to the WCS papers. +* +* Strictly speaking, the other long forms are non-standard and +* in fact have never appeared in any draft of the WCS papers nor +* in the errata. However, as natural extensions of the primary +* form they are unlikely to be written with any other intention. +* Thus it should be safe to accept them provided, of course, +* that the resulting keyword does not exceed the 8-character +* limit. +* +* If WCSHDR_CNAMn is enabled then also accept +* +# iCNAMna TCNAMna : --- iCNAna --- TCNAna CNAMEia +# iCRDEna TCRDEna : --- iCRDna --- TCRDna CRDERia +# iCSYEna TCSYEna : --- iCSYna --- TCSYna CSYERia +# iCZPHna TCZPHna : --- iCZPna --- TCZPna CZPHSia +# iCPERna TCPERna : --- iCPRna --- TCPRna CPERIia +* +* Note that CNAMEia, CRDERia, CSYERia, CZPHSia, CPERIia, and +* their variants are not used by WCSLIB but are stored in the +* wcsprm struct as auxiliary information. +* +* - WCSHDR_CNAMn (wcsbth() only): Accept iCNAMn, iCRDEn, iCSYEn, iCZPHn, +* iCPERn, TCNAMn, TCRDEn, TCSYEn, TCZPHn, and TCPERn, i.e. with +* "a" blank. While non-standard, these are the obvious analogues +* of iCTYPn, TCTYPn, etc. +* +* - WCSHDR_AUXIMG (wcsbth() only): Allow the image-header form of an +* auxiliary WCS keyword with representation-wide scope to +* provide a default value for all images. This default may be +* overridden by the column-specific form of the keyword. +* +* For example, a keyword like EQUINOXa would apply to all image +* arrays in a binary table, or all pixel list columns with +* alternate representation "a" unless overridden by EQUIna. +* +* Specifically the keywords are: +* +# LONPOLEa for LONPna +# LATPOLEa for LATPna +# VELREF - ... (No column-specific form.) +# VELREFa - ... Only if WCSHDR_VELREFa is set. +* +* whose keyvalues are actually used by WCSLIB, and also keywords +* providing auxiliary information that is simply stored in the +* wcsprm struct: +* +# WCSNAMEa for WCSNna ... Or TWCSna (see below). +# +# DATE-OBS for DOBSn +# MJD-OBS for MJDOBn +# +# RADESYSa for RADEna +# RADECSYS for RADEna ... Only if WCSHDR_RADECSYS is set. +# EPOCH - ... (No column-specific form.) +# EPOCHa - ... Only if WCSHDR_EPOCHa is set. +# EQUINOXa for EQUIna +* +* where the image-header keywords on the left provide default +* values for the column specific keywords on the right. +* +* Note that, according to Sect. 8.1 of WCS Paper III, and +* Sect. 5.2 of WCS Paper VII, the following are always inherited: +* +# RESTFREQ for RFRQna +# RESTFRQa for RFRQna +# RESTWAVa for RWAVna +* +* being those actually used by WCSLIB, together with the +* following auxiliary keywords, many of which do not have binary +* table equivalents and therefore can only be inherited: +* +# TIMESYS - +# TREFPOS for TRPOSn +# TREFDIR for TRDIRn +# PLEPHEM - +# TIMEUNIT - +# DATEREF - +# MJDREF - +# MJDREFI - +# MJDREFF - +# JDREF - +# JDREFI - +# JDREFF - +# TIMEOFFS - +# +# DATE-BEG - +# DATE-AVG for DAVGn +# DATE-END - +# MJD-BEG - +# MJD-AVG for MJDAn +# MJD-END - +# JEPOCH - +# BEPOCH - +# TSTART - +# TSTOP - +# XPOSURE - +# TELAPSE - +# +# TIMSYER - +# TIMRDER - +# TIMEDEL - +# TIMEPIXR - +# +# OBSGEO-X for OBSGXn +# OBSGEO-Y for OBSGYn +# OBSGEO-Z for OBSGZn +# OBSGEO-L for OBSGLn +# OBSGEO-B for OBSGBn +# OBSGEO-H for OBSGHn +# OBSORBIT - +# +# SPECSYSa for SPECna +# SSYSOBSa for SOBSna +# VELOSYSa for VSYSna +# VSOURCEa for VSOUna ... Only if WCSHDR_VSOURCE is set. +# ZSOURCEa for ZSOUna +# SSYSSRCa for SSRCna +# VELANGLa for VANGna +* +* Global image-header keywords, such as MJD-OBS, apply to all +* alternate representations, and would therefore provide a +* default value for all images in the header. +* +* This auxiliary inheritance mechanism applies to binary table +* image arrays and pixel lists alike. Most of these keywords +* have no default value, the exceptions being LONPOLEa and +* LATPOLEa, and also RADESYSa and EQUINOXa which provide +* defaults for each other. Thus one potential difficulty in +* using WCSHDR_AUXIMG is that of erroneously inheriting one of +* these four keywords. +* +* Also, beware of potential inconsistencies that may arise where, +* for example, DATE-OBS is inherited, but MJD-OBS is overridden +* by MJDOBn and specifies a different time. Pairs in this +* category are: +* += DATE-OBS/DOBSn versus MJD-OBS/MJDOBn += DATE-AVG/DAVGn versus MJD-AVG/MJDAn += RESTFRQa/RFRQna versus RESTWAVa/RWAVna += OBSGEO-[XYZ]/OBSG[XYZ]n versus OBSGEO-[LBH]/OBSG[LBH]n +* +* The wcsfixi() routines datfix() and obsfix() are provided to +* check the consistency of these and other such pairs of +* keywords. +* +* Unlike WCSHDR_ALLIMG, the existence of one (or all) of these +* auxiliary WCS image header keywords will not by itself cause a +* wcsprm struct to be created for alternate representation "a". +* This is because they do not provide sufficient information to +* create a non-trivial coordinate representation when used in +* conjunction with the default values of those keywords that are +* parameterized by axis number, such as CTYPEia. +* +* - WCSHDR_ALLIMG (wcsbth() only): Allow the image-header form of *all* +* image header WCS keywords to provide a default value for all +* image arrays in a binary table (n.b. not pixel list). This +* default may be overridden by the column-specific form of the +* keyword. +* +* For example, a keyword like CRPIXja would apply to all image +* arrays in a binary table with alternate representation "a" +* unless overridden by jCRPna. +* +* Specifically the keywords are those listed above for +* WCSHDR_AUXIMG plus +* +# WCSAXESa for WCAXna +* +* which defines the coordinate dimensionality, and the following +* keywords that are parameterized by axis number: +* +# CRPIXja for jCRPna +# PCi_ja for ijPCna +# CDi_ja for ijCDna +# CDELTia for iCDEna +# CROTAi for iCROTn +# CROTAia - ... Only if WCSHDR_CROTAia is set. +# CUNITia for iCUNna +# CTYPEia for iCTYna +# CRVALia for iCRVna +# PVi_ma for iVn_ma +# PSi_ma for iSn_ma +# +# CNAMEia for iCNAna +# CRDERia for iCRDna +# CSYERia for iCSYna +# CZPHSia for iCZPna +# CPERIia for iCPRna +* +* where the image-header keywords on the left provide default +* values for the column specific keywords on the right. +* +* This full inheritance mechanism only applies to binary table +* image arrays, not pixel lists, because in the latter case +* there is no well-defined association between coordinate axis +* number and column number (see note 9 below). +* +* Note that CNAMEia, CRDERia, CSYERia, and their variants are +* not used by WCSLIB but are stored in the wcsprm struct as +* auxiliary information. +* +* Note especially that at least one wcsprm struct will be +* returned for each "a" found in one of the image header +* keywords listed above: +* +* - If the image header keywords for "a" ARE NOT inherited by a +* binary table, then the struct will not be associated with +* any particular table column number and it is up to the user +* to provide an association. +* +* - If the image header keywords for "a" ARE inherited by a +* binary table image array, then those keywords are considered +* to be "exhausted" and do not result in a separate wcsprm +* struct. +* +* For example, to accept CD00i00j and PC00i00j and reject all other +* extensions, use +* += relax = WCSHDR_reject | WCSHDR_CD00i00j | WCSHDR_PC00i00j; +* +* The parser always treats EPOCH as subordinate to EQUINOXa if both are +* present, and VSOURCEa is always subordinate to ZSOURCEa. +* +* Likewise, VELREF is subordinate to the formalism of WCS Paper III, see +* spcaips(). +* +* Neither wcspih() nor wcsbth() currently recognize the AIPS-convention +* keywords ALTRPIX or ALTRVAL which effectively define an alternative +* representation for a spectral axis. +* +* 6: Depending on what flags have been set in its "relax" argument, +* wcsbth() could return as many as 27027 wcsprm structs: +* +* - Up to 27 unattached representations derived from image header +* keywords. +* +* - Up to 27 structs for each of up to 999 columns containing an image +* arrays. +* +* - Up to 27 structs for a pixel list. +* +* Note that it is considered legitimate for a column to contain an image +* array and also form part of a pixel list, and in particular that +* wcsbth() does not check the TFORM keyword for a pixel list column to +* check that it is scalar. +* +* In practice, of course, a realistic binary table header is unlikely to +* contain more than a handful of images. +* +* In order for wcsbth() to create a wcsprm struct for a particular +* coordinate representation, at least one WCS keyword that defines an +* axis number must be present, either directly or by inheritance if +* WCSHDR_ALLIMG is set. +* +* When the image header keywords for an alternate representation are +* inherited by a binary table image array via WCSHDR_ALLIMG, those +* keywords are considered to be "exhausted" and do not result in a +* separate wcsprm struct. Otherwise they do. +* +* 7: Neither wcspih() nor wcsbth() check for duplicated keywords, in most +* cases they accept the last encountered. +* +* 8: wcspih() and wcsbth() use wcsnpv() and wcsnps() (refer to the prologue +* of wcs.h) to match the size of the pv[] and ps[] arrays in the wcsprm +* structs to the number in the header. Consequently there are no unused +* elements in the pv[] and ps[] arrays, indeed they will often be of +* zero length. +* +* 9: The FITS WCS standard for pixel lists assumes that a pixel list +* defines one and only one image, i.e. that each row of the binary table +* refers to just one event, e.g. the detection of a single photon or +* neutrino, for which the device "pixel" coordinates are stored in +* separate scalar columns of the table. +* +* In the absence of a standard for pixel lists - or even an informal +* description! - let alone a formal mechanism for identifying the columns +* containing pixel coordinates (as opposed to pixel values or metadata +* recorded at the time the photon or neutrino was detected), WCS Paper I +* discusses how the WCS keywords themselves may be used to identify them. +* +* In practice, however, pixel lists have been used to store multiple +* images. Besides not specifying how to identify columns, the pixel list +* convention is also silent on the method to be used to associate table +* columns with image axes. +* +* An additional shortcoming is the absence of a formal method for +* associating global binary-table WCS keywords, such as WCSNna or MJDOBn, +* with a pixel list image, whether one or several. +* +* In light of these uncertainties, wcsbth() simply collects all WCS +* keywords for a particular pixel list coordinate representation (i.e. +* the "a" value in TCTYna) into one wcsprm struct. However, these +* alternates need not be associated with the same table columns and this +* allows a pixel list to contain up to 27 separate images. As usual, if +* one of these representations happened to contain more than two +* celestial axes, for example, then an error would result when wcsset() +* is invoked on it. In this case the "colsel" argument could be used to +* restrict the columns used to construct the representation so that it +* only contained one pair of celestial axes. +* +* Global, binary-table WCS keywords are considered to apply to the pixel +* list image with matching alternate (e.g. the "a" value in LONPna or +* EQUIna), regardless of the table columns the image occupies. In other +* words, the column number is ignored (the "n" value in LONPna or +* EQUIna). This also applies for global, binary-table WCS keywords that +* have no alternates, such as MJDOBn and OBSGXn, which match all images +* in a pixel list. Take heed that this may lead to counterintuitive +* behaviour, especially where such a keyword references a column that +* does not store pixel coordinates, and moreso where the pixel list +* stores only a single image. In fact, as the column number, n, is +* ignored for such keywords, it would make no difference even if they +* referenced non-existent columns. Moreover, there is no requirement for +* consistency in the column numbers used for such keywords, even for +* OBSGXn, OBSGYn, and OBSGZn which are meant to define the elements of a +* coordinate vector. Although it would surely be perverse to construct a +* pixel list like this, such a situation may still arise in practice +* where columns are deleted from a binary table. +* +* The situation with global, binary-table WCS keywords becomes +* potentially even more confusing when image arrays and pixel list images +* coexist in one binary table. In that case, a keyword such as MJDOBn +* may legitimately appear multiple times with n referencing different +* image arrays. Which then is the one that applies to the pixel list +* images? In this implementation, it is the last instance that appears +* in the header, whether or not it is also associated with an image +* array. +* +* +* wcstab() - Tabular construction routine +* --------------------------------------- +* wcstab() assists in filling in the information in the wcsprm struct relating +* to coordinate lookup tables. +* +* Tabular coordinates ('TAB') present certain difficulties in that the main +* components of the lookup table - the multidimensional coordinate array plus +* an index vector for each dimension - are stored in a FITS binary table +* extension (BINTABLE). Information required to locate these arrays is stored +* in PVi_ma and PSi_ma keywords in the image header. +* +* wcstab() parses the PVi_ma and PSi_ma keywords associated with each 'TAB' +* axis and allocates memory in the wcsprm struct for the required number of +* tabprm structs. It sets as much of the tabprm struct as can be gleaned from +* the image header, and also sets up an array of wtbarr structs (described in +* the prologue of wtbarr.h) to assist in extracting the required arrays from +* the BINTABLE extension(s). +* +* It is then up to the user to allocate memory for, and copy arrays from the +* BINTABLE extension(s) into the tabprm structs. A CFITSIO routine, +* fits_read_wcstab(), has been provided for this purpose, see getwcstab.h. +* wcsset() will automatically take control of this allocated memory, in +* particular causing it to be free'd by wcsfree(); the user must not attempt +* to free it after wcsset() has been called. +* +* Note that wcspih() and wcsbth() automatically invoke wcstab() on each of the +* wcsprm structs that they return. +* +* Given and returned: +* wcs struct wcsprm* +* Coordinate transformation parameters (see below). +* +* wcstab() sets ntab, tab, nwtb and wtb, allocating +* memory for the tab and wtb arrays. This allocated +* memory will be free'd automatically by wcsfree(). +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Invalid tabular parameters. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* +* wcsidx() - Index alternate coordinate representations +* ----------------------------------------------------- +* wcsidx() returns an array of 27 indices for the alternate coordinate +* representations in the array of wcsprm structs returned by wcspih(). For +* the array returned by wcsbth() it returns indices for the unattached +* (colnum == 0) representations derived from image header keywords - use +* wcsbdx() for those derived from binary table image arrays or pixel lists +* keywords. +* +* Given: +* nwcs int Number of coordinate representations in the array. +* +* wcs const struct wcsprm** +* Pointer to an array of wcsprm structs returned by +* wcspih() or wcsbth(). +* +* Returned: +* alts int[27] Index of each alternate coordinate representation in +* the array: alts[0] for the primary, alts[1] for 'A', +* etc., set to -1 if not present. +* +* For example, if there was no 'P' representation then +* += alts['P'-'A'+1] == -1; +* +* Otherwise, the address of its wcsprm struct would be +* += wcs + alts['P'-'A'+1]; +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsbdx() - Index alternate coordinate representions +* --------------------------------------------------- +* wcsbdx() returns an array of 999 x 27 indices for the alternate coordinate +* representions for binary table image arrays xor pixel lists in the array of +* wcsprm structs returned by wcsbth(). Use wcsidx() for the unattached +* representations derived from image header keywords. +* +* Given: +* nwcs int Number of coordinate representations in the array. +* +* wcs const struct wcsprm** +* Pointer to an array of wcsprm structs returned by +* wcsbth(). +* +* type int Select the type of coordinate representation: +* 0: binary table image arrays, +* 1: pixel lists. +* +* Returned: +* alts short[1000][28] +* Index of each alternate coordinate represention in the +* array: alts[col][0] for the primary, alts[col][1] for +* 'A', to alts[col][26] for 'Z', where col is the +* 1-relative column number, and col == 0 is used for +* unattached image headers. Set to -1 if not present. +* +* alts[col][27] counts the number of coordinate +* representations of the chosen type for each column. +* +* For example, if there was no 'P' represention for +* column 13 then +* += alts[13]['P'-'A'+1] == -1; +* +* Otherwise, the address of its wcsprm struct would be +* += wcs + alts[13]['P'-'A'+1]; +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcsvfree() - Free the array of wcsprm structs +* --------------------------------------------- +* wcsvfree() frees the memory allocated by wcspih() or wcsbth() for the array +* of wcsprm structs, first invoking wcsfree() on each of the array members. +* +* Given and returned: +* nwcs int* Number of coordinate representations found; set to 0 +* on return. +* +* wcs struct wcsprm** +* Pointer to the array of wcsprm structs; set to 0x0 on +* return. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Null wcsprm pointer passed. +* +* +* wcshdo() - Write out a wcsprm struct as a FITS header +* ----------------------------------------------------- +* wcshdo() translates a wcsprm struct into a FITS header. If the colnum +* member of the struct is non-zero then a binary table image array header will +* be produced. Otherwise, if the colax[] member of the struct is set non-zero +* then a pixel list header will be produced. Otherwise, a primary image or +* image extension header will be produced. +* +* If the struct was originally constructed from a header, e.g. by wcspih(), +* the output header will almost certainly differ in a number of respects: +* +* - The output header only contains WCS-related keywords. In particular, it +* does not contain syntactically-required keywords such as SIMPLE, NAXIS, +* BITPIX, or END. +* +* - Elements of the PCi_ja matrix will be written if and only if they differ +* from the unit matrix. Thus, if the matrix is unity then no elements +* will be written. +* +* - The redundant keywords MJDREF, JDREF, JDREFI, JDREFF, all of which +* duplicate MJDREFI + MJDREFF, are never written. OBSGEO-[LBH] are not +* written if OBSGEO-[XYZ] are defined. +* +* - Deprecated (e.g. CROTAn, RESTFREQ, VELREF, RADECSYS, EPOCH, VSOURCEa) or +* non-standard usage will be translated to standard (this is partially +* dependent on whether wcsfix() was applied). +* +* - Additional keywords such as WCSAXESa, CUNITia, LONPOLEa and LATPOLEa may +* appear. +* +* - Quantities will be converted to the units used internally, basically SI +* with the addition of degrees. +* +* - Floating-point quantities may be given to a different decimal precision. +* +* - The original keycomments will be lost, although wcshdo() tries hard to +* write meaningful comments. +* +* - Keyword order will almost certainly be changed. +* +* Keywords can be translated between the image array, binary table, and pixel +* lists forms by manipulating the colnum or colax[] members of the wcsprm +* struct. +* +* Given: +* ctrl int Vector of flag bits that controls the degree of +* permissiveness in departing from the published WCS +* standard, and also controls the formatting of +* floating-point keyvalues. Set it to zero to get the +* default behaviour. +* +* Flag bits for the degree of permissiveness: +* WCSHDO_none: Recognize only FITS keywords defined by +* the published WCS standard. +* WCSHDO_all: Admit all recognized informal extensions +* of the WCS standard. +* Fine-grained control of the degree of permissiveness +* is also possible as explained in the notes below. +* +* As for controlling floating-point formatting, by +* default wcshdo() uses "%20.12G" for non-parameterized +* keywords such as LONPOLEa, and attempts to make the +* header more human-readable by using the same "%f" +* format for all values of each of the following +* parameterized keywords: CRPIXja, PCi_ja, and CDELTia +* (n.b. excluding CRVALia). Each has the same field +* width and precision so that the decimal points line +* up. The precision, allowing for up to 15 significant +* digits, is chosen so that there are no excess trailing +* zeroes. A similar formatting scheme applies by +* default for distortion function parameters. +* +* However, where the values of, for example, CDELTia +* differ by many orders of magnitude, the default +* formatting scheme may cause unacceptable loss of +* precision for the lower-valued keyvalues. Thus the +* default behaviour may be overridden: +* WCSHDO_P12: Use "%20.12G" format for all floating- +* point keyvalues (12 significant digits). +* WCSHDO_P13: Use "%21.13G" format for all floating- +* point keyvalues (13 significant digits). +* WCSHDO_P14: Use "%22.14G" format for all floating- +* point keyvalues (14 significant digits). +* WCSHDO_P15: Use "%23.15G" format for all floating- +* point keyvalues (15 significant digits). +* WCSHDO_P16: Use "%24.16G" format for all floating- +* point keyvalues (16 significant digits). +* WCSHDO_P17: Use "%25.17G" format for all floating- +* point keyvalues (17 significant digits). +* If more than one of the above flags are set, the +* highest number of significant digits prevails. In +* addition, there is an anciliary flag: +* WCSHDO_EFMT: Use "%E" format instead of the default +* "%G" format above. +* Note that excess trailing zeroes are stripped off the +* fractional part with "%G" (which never occurs with +* "%E"). Note also that the higher-precision options +* eat into the keycomment area. In this regard, +* WCSHDO_P14 causes minimal disruption with "%G" format, +* while WCSHDO_P13 is appropriate with "%E". +* +* Given and returned: +* wcs struct wcsprm* +* Pointer to a wcsprm struct containing coordinate +* transformation parameters. Will be initialized if +* necessary. +* +* Returned: +* nkeyrec int* Number of FITS header keyrecords returned in the +* "header" array. +* +* header char** Pointer to an array of char holding the header. +* Storage for the array is allocated by wcshdo() in +* blocks of 2880 bytes (32 x 80-character keyrecords) +* and must be free'd by the user to avoid memory leaks. +* +* Each keyrecord is 80 characters long and is *NOT* +* null-terminated, so the first keyrecord starts at +* (*header)[0], the second at (*header)[80], etc. +* +* Function return value: +* int Status return value (associated with wcs_errmsg[]): +* 0: Success. +* 1: Null wcsprm pointer passed. +* 2: Memory allocation failed. +* 3: Linear transformation matrix is singular. +* 4: Inconsistent or unrecognized coordinate axis +* types. +* 5: Invalid parameter value. +* 6: Invalid coordinate transformation parameters. +* 7: Ill-conditioned coordinate transformation +* parameters. +* +* For returns > 1, a detailed error message is set in +* wcsprm::err if enabled, see wcserr_enable(). +* +* Notes: +* wcshdo() interprets the "relax" argument as a vector of flag bits to +* provide fine-grained control over what non-standard WCS keywords to write. +* The flag bits are subject to change in future and should be set by using +* the preprocessor macros (see below) for the purpose. +* +* - WCSHDO_none: Don't use any extensions. +* +* - WCSHDO_all: Write all recognized extensions, equivalent to setting each +* flag bit. +* +* - WCSHDO_safe: Write all extensions that are considered to be safe and +* recommended. +* +* - WCSHDO_DOBSn: Write DOBSn, the column-specific analogue of DATE-OBS for +* use in binary tables and pixel lists. WCS Paper III introduced +* DATE-AVG and DAVGn but by an oversight DOBSn (the obvious analogy) +* was never formally defined by the standard. The alternative to +* using DOBSn is to write DATE-OBS which applies to the whole table. +* This usage is considered to be safe and is recommended. +* +* - WCSHDO_TPCn_ka: WCS Paper I defined +* +* - TPn_ka and TCn_ka for pixel lists +* +* but WCS Paper II uses TPCn_ka in one example and subsequently the +* errata for the WCS papers legitimized the use of +* +* - TPCn_ka and TCDn_ka for pixel lists +* +* provided that the keyword does not exceed eight characters. This +* usage is considered to be safe and is recommended because of the +* non-mnemonic terseness of the shorter forms. +* +* - WCSHDO_PVn_ma: WCS Paper I defined +* +* - iVn_ma and iSn_ma for bintables and +* - TVn_ma and TSn_ma for pixel lists +* +* but WCS Paper II uses iPVn_ma and TPVn_ma in the examples and +* subsequently the errata for the WCS papers legitimized the use of +* +* - iPVn_ma and iPSn_ma for bintables and +* - TPVn_ma and TPSn_ma for pixel lists +* +* provided that the keyword does not exceed eight characters. This +* usage is considered to be safe and is recommended because of the +* non-mnemonic terseness of the shorter forms. +* +* - WCSHDO_CRPXna: For historical reasons WCS Paper I defined +* +* - jCRPXn, iCDLTn, iCUNIn, iCTYPn, and iCRVLn for bintables and +* - TCRPXn, TCDLTn, TCUNIn, TCTYPn, and TCRVLn for pixel lists +* +* for use without an alternate version specifier. However, because +* of the eight-character keyword constraint, in order to accommodate +* column numbers greater than 99 WCS Paper I also defined +* +* - jCRPna, iCDEna, iCUNna, iCTYna and iCRVna for bintables and +* - TCRPna, TCDEna, TCUNna, TCTYna and TCRVna for pixel lists +* +* for use with an alternate version specifier (the "a"). Like the +* PC, CD, PV, and PS keywords there is an obvious tendency to +* confuse these two forms for column numbers up to 99. It is very +* unlikely that any parser would reject keywords in the first set +* with a non-blank alternate version specifier so this usage is +* considered to be safe and is recommended. +* +* - WCSHDO_CNAMna: WCS Papers I and III defined +* +* - iCNAna, iCRDna, and iCSYna for bintables and +* - TCNAna, TCRDna, and TCSYna for pixel lists +* +* By analogy with the above, the long forms would be +* +* - iCNAMna, iCRDEna, and iCSYEna for bintables and +* - TCNAMna, TCRDEna, and TCSYEna for pixel lists +* +* Note that these keywords provide auxiliary information only, none +* of them are needed to compute world coordinates. This usage is +* potentially unsafe and is not recommended at this time. +* +* - WCSHDO_WCSNna: In light of wcsbth() note 4, write WCSNna instead of +* TWCSna for pixel lists. While wcsbth() treats WCSNna and TWCSna +* as equivalent, other parsers may not. Consequently, this usage +* is potentially unsafe and is not recommended at this time. +* +* +* Global variable: const char *wcshdr_errmsg[] - Status return messages +* --------------------------------------------------------------------- +* Error messages to match the status value returned from each function. +* Use wcs_errmsg[] for status returns from wcshdo(). +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSHDR +#define WCSLIB_WCSHDR + +#include "wcs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WCSHDR_none 0x00000000 +#define WCSHDR_all 0x000FFFFF +#define WCSHDR_reject 0x10000000 +#define WCSHDR_strict 0x20000000 + +#define WCSHDR_CROTAia 0x00000001 +#define WCSHDR_VELREFa 0x00000002 +#define WCSHDR_CD00i00j 0x00000004 +#define WCSHDR_PC00i00j 0x00000008 +#define WCSHDR_PROJPn 0x00000010 +#define WCSHDR_CD0i_0ja 0x00000020 +#define WCSHDR_PC0i_0ja 0x00000040 +#define WCSHDR_PV0i_0ma 0x00000080 +#define WCSHDR_PS0i_0ma 0x00000100 +#define WCSHDR_DOBSn 0x00000200 +#define WCSHDR_OBSGLBHn 0x00000400 +#define WCSHDR_RADECSYS 0x00000800 +#define WCSHDR_EPOCHa 0x00001000 +#define WCSHDR_VSOURCE 0x00002000 +#define WCSHDR_LONGKEY 0x00004000 +#define WCSHDR_CNAMn 0x00008000 +#define WCSHDR_AUXIMG 0x00010000 +#define WCSHDR_ALLIMG 0x00020000 + +#define WCSHDR_IMGHEAD 0x00100000 +#define WCSHDR_BIMGARR 0x00200000 +#define WCSHDR_PIXLIST 0x00400000 + +#define WCSHDO_none 0x00000 +#define WCSHDO_all 0x000FF +#define WCSHDO_safe 0x0000F +#define WCSHDO_DOBSn 0x00001 +#define WCSHDO_TPCn_ka 0x00002 +#define WCSHDO_PVn_ma 0x00004 +#define WCSHDO_CRPXna 0x00008 +#define WCSHDO_CNAMna 0x00010 +#define WCSHDO_WCSNna 0x00020 +#define WCSHDO_P12 0x01000 +#define WCSHDO_P13 0x02000 +#define WCSHDO_P14 0x04000 +#define WCSHDO_P15 0x08000 +#define WCSHDO_P16 0x10000 +#define WCSHDO_P17 0x20000 +#define WCSHDO_EFMT 0x40000 + + +extern const char *wcshdr_errmsg[]; + +enum wcshdr_errmsg_enum { + WCSHDRERR_SUCCESS = 0, /* Success. */ + WCSHDRERR_NULL_POINTER = 1, /* Null wcsprm pointer passed. */ + WCSHDRERR_MEMORY = 2, /* Memory allocation failed. */ + WCSHDRERR_BAD_COLUMN = 3, /* Invalid column selection. */ + WCSHDRERR_PARSER = 4, /* Fatal error returned by Flex + parser. */ + WCSHDRERR_BAD_TABULAR_PARAMS = 5 /* Invalid tabular parameters. */ +}; + +int wcspih(char *header, int nkeyrec, int relax, int ctrl, int *nreject, + int *nwcs, struct wcsprm **wcs); + +int wcsbth(char *header, int nkeyrec, int relax, int ctrl, int keysel, + int *colsel, int *nreject, int *nwcs, struct wcsprm **wcs); + +int wcstab(struct wcsprm *wcs); + +int wcsidx(int nwcs, struct wcsprm **wcs, int alts[27]); + +int wcsbdx(int nwcs, struct wcsprm **wcs, int type, short alts[1000][28]); + +int wcsvfree(int *nwcs, struct wcsprm **wcs); + +int wcshdo(int ctrl, struct wcsprm *wcs, int *nkeyrec, char **header); + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSHDR */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcslib.h b/testbed/astropy__astropy/cextern/wcslib/C/wcslib.h new file mode 100644 index 0000000000000000000000000000000000000000..ee337082226cf30c57dfa9c4b1a42ff359456bbb --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcslib.h @@ -0,0 +1,63 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcslib.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* Summary of wcslib.h +* ------------------- +* This header file is provided purely for convenience. Use it to include all +* of the separate WCSLIB headers. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSLIB +#define WCSLIB_WCSLIB + +#include "cel.h" +#include "dis.h" +#include "fitshdr.h" +#include "lin.h" +#include "log.h" +#include "prj.h" +#include "spc.h" +#include "sph.h" +#include "spx.h" +#include "tab.h" +#include "wcs.h" +#include "wcserr.h" +#include "wcsfix.h" +#include "wcshdr.h" +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcstrig.h" +#include "wcsunits.h" +#include "wcsutil.h" +#include "wtbarr.h" + +#endif /* WCSLIB_WCSLIB */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsmath.h b/testbed/astropy__astropy/cextern/wcslib/C/wcsmath.h new file mode 100644 index 0000000000000000000000000000000000000000..2700d001bac58015df1a8d6813ec13f06f11b002 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsmath.h @@ -0,0 +1,75 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsmath.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of wcsmath.h +* -------------------- +* Definition of mathematical constants used by WCSLIB. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSMATH +#define WCSLIB_WCSMATH + +#ifdef PI +#undef PI +#endif + +#ifdef D2R +#undef D2R +#endif + +#ifdef R2D +#undef R2D +#endif + +#ifdef SQRT2 +#undef SQRT2 +#endif + +#ifdef SQRT2INV +#undef SQRT2INV +#endif + +#define PI 3.141592653589793238462643 +#define D2R PI/180.0 +#define R2D 180.0/PI +#define SQRT2 1.4142135623730950488 +#define SQRT2INV 1.0/SQRT2 + +#ifdef UNDEFINED +#undef UNDEFINED +#endif + +#define UNDEFINED 987654321.0e99 +#define undefined(value) (value == UNDEFINED) + +#endif /* WCSLIB_WCSMATH */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcspih.l b/testbed/astropy__astropy/cextern/wcslib/C/wcspih.l new file mode 100644 index 0000000000000000000000000000000000000000..2485a12e7a1282f6a822b3b75aa8b80750e6f493 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcspih.l @@ -0,0 +1,2873 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcspih.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* wcspih.l is a Flex description file containing the definition of a lexical +* scanner for parsing the WCS keyrecords from a FITS primary image or image +* extension header. +* +* wcspih.l requires Flex v2.5.4 or later. Refer to wcshdr.h for a description +* of the user interface and operating notes. +* +* Implementation notes +* -------------------- +* Use of the WCSAXESa keyword is not mandatory. Its default value is "the +* larger of NAXIS and the largest index of these keywords [i.e. CRPIXj, PCi_j +* or CDi_j, CDELTi, CTYPEi, CRVALi, and CUNITi] found in the FITS header". +* Consequently the definition of WCSAXESa effectively invalidates the use of +* NAXIS for determining the number of coordinate axes and forces a preliminary +* pass through the header to determine the "largest index" in headers where +* WCSAXESa was omitted. +* +* Furthermore, since the use of WCSAXESa is optional, there is no way to +* determine the number of coordinate representations (the "a" value) other +* than by parsing all of the WCS keywords in the header; even if WCSAXESa was +* specified for some representations it cannot be known in advance whether it +* was specified for all of those present in the header. +* +* Hence the definition of WCSAXESa forces the scanner to be implemented in two +* passes. The first pass is used to determine the number of coordinate +* representations (up to 27) and the number of coordinate axes in each. +* Effectively WCSAXESa is ignored unless it exceeds the "largest index" in +* which case the keywords for the extra axes assume their default values. The +* number of PVi_ma and PSi_ma keywords in each representation is also counted +* in the first pass. +* +* On completion of the first pass, memory is allocated for an array of the +* required number of wcsprm structs and each of these is initialized +* appropriately. These structs are filled in the second pass. +* +* The parser does not check for duplicated keywords, it accepts the last +* encountered. +* +*===========================================================================*/ + +/* Options. */ +%option full +%option never-interactive +%option noyywrap +%option outfile="wcspih.c" +%option prefix="wcspih" +%option reentrant + +/* Indices for parameterized keywords. */ +Z1 [0-9] +Z2 [0-9]{2} +Z3 [0-9]{3} +Z4 [0-9]{4} +Z5 [0-9]{5} +Z6 [0-9]{6} + +I1 [1-9] +I2 [1-9][0-9] +I3 [1-9][0-9]{2} +I4 [1-9][0-9]{3} + +/* Alternate coordinate system identifier. */ +ALT [ A-Z] + +/* Keyvalue data types. */ +INTEGER [+-]?[0-9]+ +FLOAT [+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eEdD][+-]?[0-9]+)? +STRING '([^']|'')*' +RECORD '[^']*' +FIELD [a-zA-Z_][a-zA-Z_0-9.]* + +/* Inline comment syntax. */ +INLINE " "*(\/.*)? + +/* Exclusive start states. */ +%x CCia CCi_ja CCCCCia CCi_ma CCCCCCCa CCCCCCCC +%x CROTAi PROJPn SIP2 SIP3 DSSAMDXY PLTDECSN +%x VALUE INTEGER_VAL FLOAT_VAL FLOAT2_VAL STRING_VAL +%x RECORD_VAL RECFIELD RECCOLON RECVALUE RECEND +%x COMMENT +%x DISCARD ERROR FLUSH + +%{ +#include +#include +#include +#include +#include + +#include "wcsmath.h" +#include "wcsprintf.h" +#include "wcsutil.h" + +#include "dis.h" +#include "wcs.h" +#include "wcshdr.h" + +#define INTEGER 0 +#define FLOAT 1 +#define FLOAT2 2 +#define STRING 3 +#define RECORD 4 + +#define PRIOR 1 +#define SEQUENT 2 + +#define SIP 1 +#define DSS 2 +#define WAT 3 + +static int wcspih_scanner(char *header, int nkeyrec, int relax, int ctrl, + int *nreject, int *nwcs, struct wcsprm **wcs, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcspih( + char *header, + int nkeyrec, + int relax, + int ctrl, + int *nreject, + int *nwcs, + struct wcsprm **wcs) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcspih_scanner(header, nkeyrec, relax, ctrl, nreject, nwcs, wcs, + yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcspih_scanner(char *header, int nkeyrec, int relax, \ + int ctrl, int *nreject, int *nwcs, struct wcsprm **wcs, yyscan_t yyscanner) + +#define YY_INPUT(inbuff, count, bufsize) \ + { \ + if (wcspih_nkeyrec) { \ + strncpy(inbuff, wcspih_hdr, 80); \ + inbuff[80] = '\n'; \ + wcspih_hdr += 80; \ + wcspih_nkeyrec--; \ + count = 81; \ + } else { \ + count = YY_NULL; \ + } \ + } + +/* These global variables are required by YY_INPUT. */ +static char *wcspih_hdr; +static int wcspih_nkeyrec; + +/* Internal helper functions. */ +static int wcspih_final(int ndp[], int ndq[], int distran, double dsstmp[], + char *wat[], int *nwcs, struct wcsprm **wcs); +static int wcspih_inits(int naxis, int alts[], int dpq[], int npv[], + int nps[], int ndp[], int ndq[], int distran, int *nwcs, + struct wcsprm **wcs); +static void wcspih_naxes(int naxis, int i, int j, char a, int distype, + int alts[], int dpq[], int *npptr); + +static int wcspih_jdref(double *wptr, const double *jdref); +static int wcspih_jdrefi(double *wptr, const double *jdrefi); +static int wcspih_jdreff(double *wptr, const double *jdreff); +static int wcspih_epoch(double *wptr, const double *epoch); +static int wcspih_vsource(double *wptr, const double *vsource); + +static int wcspih_timepixr(double timepixr); + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcspih_abort_jmp_env; +#define exit(status) longjmp(wcspih_abort_jmp_env, status) + +%} + +%% + /* Keyword indices, as used in the WCS papers, e.g. PCi_ja, PVi_ma. */ + char a; + int i, j, m, p, q; + + char *cptr, *errmsg, errtxt[80], *hptr, *keep, *keyname, *keyrec, + keyword[16], strtmp[80], *wat[2], *watstr; + int altlin, alts[27], distran, distype, dpq[27], dssflag, gotone, + ialt, inttmp, ipass, ipx, ix, jx, naxis, ndp[27], ndq[27], + nother, *npptr, nps[27], npass, npv[27], nvalid, rectype, + sipflag, status, valtype, voff, watflag, watn; + double dbltmp, dbl2tmp[2], dsstmp[20]; + void *vptr, *wptr; + struct disprm *disp, distem; + struct wcsprm *wcsp, wcstem; + int (*chekval)(double); + int (*special)(double *, const double *); + + naxis = 0; + for (ialt = 0; ialt < 27; ialt++) { + alts[ialt] = 0; + dpq[ialt] = 0; + npv[ialt] = 0; + nps[ialt] = 0; + ndp[ialt] = 0; + ndq[ialt] = 0; + } + + /* Parameters used to implement YY_INPUT. */ + wcspih_hdr = header; + wcspih_nkeyrec = nkeyrec; + + /* Our handle on the input stream. */ + keyrec = header; + hptr = header; + keep = 0x0; + + /* For keeping tallies of keywords found. */ + *nreject = 0; + nvalid = 0; + nother = 0; + + /* If strict, then also reject. */ + if (relax & WCSHDR_strict) relax |= WCSHDR_reject; + + /* Keyword parameters. */ + i = j = 0; + m = 0; + a = ' '; + + /* For decoding the keyvalue. */ + valtype = -1; + distype = 0; + vptr = 0x0; + + /* For keywords that require special handling. */ + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + distran = 0; + sipflag = 0; + dssflag = 0; + watflag = 0; + watn = 0; + + /* The data structures produced. */ + *nwcs = 0; + *wcs = 0x0; + + /* Control variables. */ + ipass = 1; + npass = 2; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcspih_abort_jmp_env)) { + return 3; + } + + BEGIN(INITIAL); + + +^NAXIS" = "" "*{INTEGER}{INLINE} { + keyname = "NAXISn"; + + if (ipass == 1) { + sscanf(yytext, "NAXIS = %d", &naxis); + if (naxis < 0) naxis = 0; + BEGIN(FLUSH); + + } else { + sscanf(yytext, "NAXIS = %d", &i); + + if (i < 0) { + errmsg = "negative value of NAXIS ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + } + +^WCSAXES{ALT}=" "" "*{INTEGER} { + sscanf(yytext, "WCSAXES%c= %d", &a, &i); + + if (i < 0) { + errmsg = "negative value of WCSAXESa ignored"; + BEGIN(ERROR); + + } else { + valtype = INTEGER; + vptr = 0x0; + + keyname = "WCSAXESa"; + BEGIN(COMMENT); + } + } + +^CRPIX { + valtype = FLOAT; + vptr = &(wcstem.crpix); + + keyname = "CRPIXja"; + BEGIN(CCCCCia); + } + +^PC { + valtype = FLOAT; + vptr = &(wcstem.pc); + altlin = 1; + + keyname = "PCi_ja"; + BEGIN(CCi_ja); + } + +^CD { + valtype = FLOAT; + vptr = &(wcstem.cd); + altlin = 2; + + keyname = "CDi_ja"; + BEGIN(CCi_ja); + } + +^CDELT { + valtype = FLOAT; + vptr = &(wcstem.cdelt); + + keyname = "CDELTia"; + BEGIN(CCCCCia); + } + +^CROTA { + valtype = FLOAT; + vptr = &(wcstem.crota); + altlin = 4; + + keyname = "CROTAn"; + BEGIN(CROTAi); + } + +^CUNIT { + valtype = STRING; + vptr = &(wcstem.cunit); + + keyname = "CUNITia"; + BEGIN(CCCCCia); + } + +^CTYPE { + valtype = STRING; + vptr = &(wcstem.ctype); + + keyname = "CTYPEia"; + BEGIN(CCCCCia); + } + +^CRVAL { + valtype = FLOAT; + vptr = &(wcstem.crval); + + keyname = "CRVALia"; + BEGIN(CCCCCia); + } + +^LONPOLE { + valtype = FLOAT; + vptr = &(wcstem.lonpole); + + keyname = "LONPOLEa"; + BEGIN(CCCCCCCa); + } + +^LATPOLE { + valtype = FLOAT; + vptr = &(wcstem.latpole); + + keyname = "LATPOLEa"; + BEGIN(CCCCCCCa); + } + +^RESTFRQ { + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + keyname = "RESTFRQa"; + BEGIN(CCCCCCCa); + } + +^RESTFREQ { + if (relax & WCSHDR_strict) { + errmsg = "the RESTFREQ keyword is deprecated, use RESTFRQa"; + BEGIN(ERROR); + + } else { + valtype = FLOAT; + vptr = &(wcstem.restfrq); + + unput(' '); + + keyname = "RESTFREQ"; + BEGIN(CCCCCCCa); + } + } + +^RESTWAV { + valtype = FLOAT; + vptr = &(wcstem.restwav); + + keyname = "RESTWAVa"; + BEGIN(CCCCCCCa); + } + +^PV { + valtype = FLOAT; + vptr = &(wcstem.pv); + npptr = npv; + + keyname = "PVi_ma"; + BEGIN(CCi_ma); + } + +^PROJP { + valtype = FLOAT; + vptr = &(wcstem.pv); + npptr = npv; + + keyname = "PROJPn"; + BEGIN(PROJPn); + } + +^PS { + valtype = STRING; + vptr = &(wcstem.ps); + npptr = nps; + + keyname = "PSi_ma"; + BEGIN(CCi_ma); + } + +^VELREF{ALT}" " { + sscanf(yytext, "VELREF%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the VELREF keyword is deprecated, use SPECSYSa"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_VELREFa) { + valtype = INTEGER; + vptr = &(wcstem.velref); + + unput(a); + + keyname = "VELREF"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "VELREF keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^CNAME { + valtype = STRING; + vptr = &(wcstem.cname); + + keyname = "CNAMEia"; + BEGIN(CCCCCia); + } + +^CRDER { + valtype = FLOAT; + vptr = &(wcstem.crder); + + keyname = "CRDERia"; + BEGIN(CCCCCia); + } + +^CSYER { + valtype = FLOAT; + vptr = &(wcstem.csyer); + + keyname = "CSYERia"; + BEGIN(CCCCCia); + } + +^CZPHS { + valtype = FLOAT; + vptr = &(wcstem.czphs); + + keyname = "CZPHSia"; + BEGIN(CCCCCia); + } + +^CPERI { + valtype = FLOAT; + vptr = &(wcstem.cperi); + + keyname = "CPERIia"; + BEGIN(CCCCCia); + } + +^WCSNAME { + valtype = STRING; + vptr = wcstem.wcsname; + + keyname = "WCSNAMEa"; + BEGIN(CCCCCCCa); + } + +^TIMESYS" " { + valtype = STRING; + vptr = wcstem.timesys; + + keyname = "TIMESYS"; + BEGIN(CCCCCCCC); + } + +^TREFPOS" " { + valtype = STRING; + vptr = wcstem.trefpos; + + keyname = "TREFPOS"; + BEGIN(CCCCCCCC); + } + +^TREFDIR" " { + valtype = STRING; + vptr = wcstem.trefdir; + + keyname = "TREFDIR"; + BEGIN(CCCCCCCC); + } + +^PLEPHEM" " { + valtype = STRING; + vptr = wcstem.plephem; + + keyname = "PLEPHEM"; + BEGIN(CCCCCCCC); + } + +^TIMEUNIT { + valtype = STRING; + vptr = wcstem.timeunit; + + keyname = "TIMEUNIT"; + BEGIN(CCCCCCCC); + } + +^DATEREF" " { + valtype = STRING; + vptr = wcstem.dateref; + + keyname = "DATEREF"; + BEGIN(CCCCCCCC); + } + +^MJDREF" " { + valtype = FLOAT2; + vptr = wcstem.mjdref; + + keyname = "MJDREF"; + BEGIN(CCCCCCCC); + } + +^MJDREFI" " { + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + + keyname = "MJDREFI"; + BEGIN(CCCCCCCC); + } + +^MJDREFF" " { + valtype = FLOAT; + vptr = wcstem.mjdref + 1; + + keyname = "MJDREFF"; + BEGIN(CCCCCCCC); + } + +^JDREF" " { + valtype = FLOAT2; + vptr = wcstem.mjdref; + special = wcspih_jdref; + + keyname = "JDREF"; + BEGIN(CCCCCCCC); + } + +^JDREFI" " { + /* Actually integer, but treated as float. */ + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcspih_jdrefi; + + keyname = "JDREFI"; + BEGIN(CCCCCCCC); + } + +^JDREFF" " { + valtype = FLOAT; + vptr = wcstem.mjdref; + special = wcspih_jdreff; + + keyname = "JDREFF"; + BEGIN(CCCCCCCC); + } + +^TIMEOFFS { + valtype = FLOAT; + vptr = &(wcstem.timeoffs); + + keyname = "TIMEOFFS"; + BEGIN(CCCCCCCC); + } + +^DATE-OBS { + valtype = STRING; + vptr = wcstem.dateobs; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-OBS"; + BEGIN(CCCCCCCC); + } + +^DATE-BEG { + valtype = STRING; + vptr = wcstem.datebeg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-BEG"; + BEGIN(CCCCCCCC); + } + +^DATE-AVG { + valtype = STRING; + vptr = wcstem.dateavg; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-AVG"; + BEGIN(CCCCCCCC); + } + +^DATE-END { + valtype = STRING; + vptr = wcstem.dateend; + if (ctrl < -10) keep = keyrec; + + keyname = "DATE-END"; + BEGIN(CCCCCCCC); + } + +^MJD-OBS" " { + valtype = FLOAT; + vptr = &(wcstem.mjdobs); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-OBS"; + BEGIN(CCCCCCCC); + } + +^MJD-BEG" " { + valtype = FLOAT; + vptr = &(wcstem.mjdbeg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-BEG"; + BEGIN(CCCCCCCC); + } + +^MJD-AVG" " { + valtype = FLOAT; + vptr = &(wcstem.mjdavg); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-AVG"; + BEGIN(CCCCCCCC); + } + +^MJD-END" " { + valtype = FLOAT; + vptr = &(wcstem.mjdend); + if (ctrl < -10) keep = keyrec; + + keyname = "MJD-END"; + BEGIN(CCCCCCCC); + } + +^JEPOCH" " { + valtype = FLOAT; + vptr = &(wcstem.jepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "JEPOCH"; + BEGIN(CCCCCCCC); + } + +^BEPOCH" " { + valtype = FLOAT; + vptr = &(wcstem.bepoch); + if (ctrl < -10) keep = keyrec; + + keyname = "BEPOCH"; + BEGIN(CCCCCCCC); + } + +^TSTART" " { + valtype = FLOAT; + vptr = &(wcstem.tstart); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTART"; + BEGIN(CCCCCCCC); + } + +^TSTOP" " { + valtype = FLOAT; + vptr = &(wcstem.tstop); + if (ctrl < -10) keep = keyrec; + + keyname = "TSTOP"; + BEGIN(CCCCCCCC); + } + +^XPOSURE" " { + valtype = FLOAT; + vptr = &(wcstem.xposure); + if (ctrl < -10) keep = keyrec; + + keyname = "XPOSURE"; + BEGIN(CCCCCCCC); + } + +^TELAPSE" " { + valtype = FLOAT; + vptr = &(wcstem.telapse); + if (ctrl < -10) keep = keyrec; + + keyname = "TELAPSE"; + BEGIN(CCCCCCCC); + } + +^TIMSYER" " { + valtype = FLOAT; + vptr = &(wcstem.timsyer); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMSYER"; + BEGIN(CCCCCCCC); + } + +^TIMRDER" " { + valtype = FLOAT; + vptr = &(wcstem.timrder); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMRDER"; + BEGIN(CCCCCCCC); + } + +^TIMEDEL" " { + valtype = FLOAT; + vptr = &(wcstem.timedel); + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEDEL"; + BEGIN(CCCCCCCC); + } + +^TIMEPIXR { + valtype = FLOAT; + vptr = &(wcstem.timepixr); + chekval = wcspih_timepixr; + if (ctrl < -10) keep = keyrec; + + keyname = "TIMEPIXR"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-X { + valtype = FLOAT; + vptr = wcstem.obsgeo; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-X"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-Y { + valtype = FLOAT; + vptr = wcstem.obsgeo + 1; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-Y"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-Z { + valtype = FLOAT; + vptr = wcstem.obsgeo + 2; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-Z"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-L { + valtype = FLOAT; + vptr = wcstem.obsgeo + 3; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-L"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-B { + valtype = FLOAT; + vptr = wcstem.obsgeo + 4; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-B"; + BEGIN(CCCCCCCC); + } + +^OBSGEO-H { + valtype = FLOAT; + vptr = wcstem.obsgeo + 5; + if (ctrl < -10) keep = keyrec; + + keyname = "OBSGEO-H"; + BEGIN(CCCCCCCC); + } + +^OBSORBIT { + valtype = STRING; + vptr = wcstem.obsorbit; + + keyname = "OBSORBIT"; + BEGIN(CCCCCCCC); + } + +^RADESYS { + valtype = STRING; + vptr = wcstem.radesys; + + keyname = "RADESYSa"; + BEGIN(CCCCCCCa); + } + +^RADECSYS { + if (relax & WCSHDR_RADECSYS) { + valtype = STRING; + vptr = wcstem.radesys; + + unput(' '); + + keyname = "RADECSYS"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the RADECSYS keyword is deprecated, use RADESYSa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^EPOCH{ALT}" " { + sscanf(yytext, "EPOCH%c", &a); + + if (relax & WCSHDR_strict) { + errmsg = "the EPOCH keyword is deprecated, use EQUINOXa"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_EPOCHa) { + valtype = FLOAT; + vptr = &(wcstem.equinox); + special = wcspih_epoch; + + unput(a); + + keyname = "EPOCH"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "EPOCH keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^EQUINOX { + valtype = FLOAT; + vptr = &(wcstem.equinox); + + keyname = "EQUINOXa"; + BEGIN(CCCCCCCa); + } + +^SPECSYS { + valtype = STRING; + vptr = wcstem.specsys; + + keyname = "SPECSYSa"; + BEGIN(CCCCCCCa); + } + +^SSYSOBS { + valtype = STRING; + vptr = wcstem.ssysobs; + + keyname = "SSYSOBSa"; + BEGIN(CCCCCCCa); + } + +^VELOSYS { + valtype = FLOAT; + vptr = &(wcstem.velosys); + + keyname = "VELOSYSa"; + BEGIN(CCCCCCCa); + } + +^VSOURCE{ALT} { + if (relax & WCSHDR_VSOURCE) { + valtype = FLOAT; + vptr = &(wcstem.zsource); + special = wcspih_vsource; + + yyless(7); + + keyname = "VSOURCEa"; + BEGIN(CCCCCCCa); + + } else if (relax & WCSHDR_reject) { + errmsg = "the VSOURCEa keyword is deprecated, use ZSOURCEa"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +^ZSOURCE { + valtype = FLOAT; + vptr = &(wcstem.zsource); + + keyname = "ZSOURCEa"; + BEGIN(CCCCCCCa); + } + +^SSYSSRC { + valtype = STRING; + vptr = wcstem.ssyssrc; + + keyname = "SSYSSRCa"; + BEGIN(CCCCCCCa); + } + +^VELANGL { + valtype = FLOAT; + vptr = &(wcstem.velangl); + + keyname = "VELANGLa"; + BEGIN(CCCCCCCa); + } + +^CPDIS { + valtype = STRING; + distype = PRIOR; + vptr = &(distem.dtype); + + keyname = "CPDISja"; + BEGIN(CCCCCia); + } + +^CQDIS { + valtype = STRING; + distype = SEQUENT; + vptr = &(distem.dtype); + + keyname = "CQDISia"; + BEGIN(CCCCCia); + } + +^DP { + valtype = RECORD; + distype = PRIOR; + vptr = &(distem.dp); + npptr = ndp; + + keyname = "DPja"; + BEGIN(CCia); + } + +^DQ { + valtype = RECORD; + distype = SEQUENT; + vptr = &(distem.dp); + npptr = ndq; + + keyname = "DQia"; + BEGIN(CCia); + } + +^CPERR { + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + keyname = "CPERRja"; + BEGIN(CCCCCia); + } + +^CQERR { + valtype = FLOAT; + distype = SEQUENT; + vptr = &(distem.maxdis); + + keyname = "CQERRia"; + BEGIN(CCCCCia); + } + +^DVERR { + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.totdis); + + keyname = "DVERRa"; + BEGIN(CCCCCCCa); + } + +^A_ORDER" " { + /* SIP: axis 1 polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 1; + a = ' '; + + keyname = "A_ORDER"; + BEGIN(VALUE); + } + +^B_ORDER" " { + /* SIP: axis 2 polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 2; + a = ' '; + + keyname = "B_ORDER"; + BEGIN(VALUE); + } + +^AP_ORDER { + /* SIP: axis 1 inverse polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 1; + a = ' '; + + keyname = "AP_ORDER"; + BEGIN(VALUE); + } + +^BP_ORDER { + /* SIP: axis 2 inverse polynomial degree (not stored). */ + valtype = INTEGER; + distype = PRIOR; + vptr = 0x0; + + i = 2; + a = ' '; + + keyname = "BP_ORDER"; + BEGIN(VALUE); + } + +^A_DMAX" " { + /* SIP: axis 1 maximum distortion. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + i = 1; + a = ' '; + + keyname = "A_DMAX"; + BEGIN(VALUE); + } + +^B_DMAX" " { + /* SIP: axis 2 maximum distortion. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.maxdis); + + i = 2; + a = ' '; + + keyname = "B_DMAX"; + BEGIN(VALUE); + } + +^A_ { + /* SIP: axis 1 polynomial coefficient. */ + i = 1; + sipflag = 2; + + keyname = "A_p_q"; + BEGIN(SIP2); + } + +^B_ { + /* SIP: axis 2 polynomial coefficient. */ + i = 2; + sipflag = 2; + + keyname = "B_p_q"; + BEGIN(SIP2); + } + +^AP_ { + /* SIP: axis 1 inverse polynomial coefficient. */ + i = 1; + sipflag = 3; + + keyname = "AP_p_q"; + BEGIN(SIP3); + } + +^BP_ { + /* SIP: axis 2 inverse polynomial coefficient. */ + i = 2; + sipflag = 3; + + keyname = "BP_p_q"; + BEGIN(SIP3); + } + +^CNPIX1" " { + /* DSS: LLH corner pixel coordinate 1. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp; + dssflag = 1; + distran = DSS; + + keyname = "CNPIX1"; + BEGIN(VALUE); + } + +^CNPIX2" " { + /* DSS: LLH corner pixel coordinate 2. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+1; + dssflag = 1; + distran = DSS; + + keyname = "CNPIX1"; + BEGIN(VALUE); + } + +^PPO3" " { + /* DSS: plate centre x-coordinate in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+2; + dssflag = 1; + distran = DSS; + + keyname = "PPO3"; + BEGIN(VALUE); + } + +^PPO6" " { + /* DSS: plate centre y-coordinate in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+3; + dssflag = 1; + distran = DSS; + + keyname = "PPO6"; + BEGIN(VALUE); + } + +^XPIXELSZ { + /* DSS: pixel x-dimension in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+4; + dssflag = 1; + distran = DSS; + + keyname = "XPIXELSZ"; + BEGIN(VALUE); + } + +^YPIXELSZ { + /* DSS: pixel y-dimension in micron. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+5; + dssflag = 1; + distran = DSS; + + keyname = "YPIXELSZ"; + BEGIN(VALUE); + } + +^PLTRAH" " { + /* DSS: plate centre, right ascension - hours. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+6; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAH"; + BEGIN(VALUE); + } + +^PLTRAM" " { + /* DSS: plate centre, right ascension - minutes. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+7; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAM"; + BEGIN(VALUE); + } + +^PLTRAS" " { + /* DSS: plate centre, right ascension - seconds. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+8; + dssflag = 1; + distran = DSS; + + keyname = "PLTRAS"; + BEGIN(VALUE); + } + +^PLTDECSN { + /* DSS: plate centre, declination - sign. */ + valtype = STRING; + distype = SEQUENT; + vptr = dsstmp+9; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECSN"; + BEGIN(PLTDECSN); + } + +^PLTDECD" " { + /* DSS: plate centre, declination - degrees. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+10; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECD"; + BEGIN(VALUE); + } + +^PLTDECM" " { + /* DSS: plate centre, declination - arcmin. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+11; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECM"; + BEGIN(VALUE); + } + +^PLTDECS" " { + /* DSS: plate centre, declination - arcsec. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = dsstmp+12; + dssflag = 1; + distran = DSS; + + keyname = "PLTDECS"; + BEGIN(VALUE); + } + +^PLATEID" " { + /* DSS: plate identification (insufficient to trigger DSS). */ + valtype = STRING; + distype = SEQUENT; + vptr = dsstmp+13; + dssflag = 2; + distran = 0; + + keyname = "PLATEID"; + BEGIN(VALUE); + } + +^AMDX { + /* DSS: axis 1 polynomial coefficient. */ + i = 1; + dssflag = 3; + + keyname = "AMDXm"; + BEGIN(DSSAMDXY); + } + +^AMDY { + /* DSS: axis 2 polynomial coefficient. */ + i = 2; + dssflag = 3; + + keyname = "AMDYm"; + BEGIN(DSSAMDXY); + } + +^WAT[12]_{Z3} { + /* TNX or ZPX: string-encoded data array. */ + sscanf(yytext, "WAT%d_%d", &i, &m); + if (watn < m) watn = m; + watflag = 1; + + valtype = STRING; + distype = SEQUENT; + vptr = wat[i-1] + 68*(m-1); + + a = ' '; + distran = WAT; + + keyname = "WATi_m"; + BEGIN(VALUE); + } + +^END" "{77} { + if (wcspih_nkeyrec) { + wcspih_nkeyrec = 0; + errmsg = "keyrecords following the END keyrecord were ignored"; + BEGIN(ERROR); + } else { + BEGIN(DISCARD); + } + } + +^. { + BEGIN(DISCARD); + } + +{I1}{ALT}" " | +{I2}{ALT}" " | +{I1}{ALT}" " | +{I2}{ALT} { + sscanf(yytext, "%d%c", &i, &a); + BEGIN(VALUE); + } + +0{I1}{ALT}" " | +0{Z1}{I1}{ALT}" " | +0{Z2}{I1}{ALT}" " | +0{Z3}{I1}{ALT} | +0{Z4}{I1} | +0{I1}{ALT} | +0{Z1}{I1} { + if (relax & WCSHDR_reject) { + /* Violates the basic FITS standard. */ + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}{ALT}" " | +{Z2}{ALT}" " | +{Z3}{ALT}" " | +{Z4}{ALT}" " | +{Z5}{ALT} | +{Z6} | +{Z1}{ALT}" " | +{Z2}{ALT} | +{Z3} { + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + +. { + /* Let it go. */ + BEGIN(DISCARD); + } + +. { + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "keyword looks very much like %s but isn't", + keyname); + BEGIN(ERROR); + + } else { + /* Let it go. */ + BEGIN(DISCARD); + } + } + +{I1}_{I1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I2}_{I1}{ALT}" " | +{I2}_{I2}{ALT} { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + BEGIN(VALUE); + } + + +0{I1}_{I1}{ALT}" " | +{I1}_0{I1}{ALT}" " | +00{I1}_{I1}{ALT} | +0{I1}_0{I1}{ALT} | +{I1}_00{I1}{ALT} | +000{I1}_{I1} | +00{I1}_0{I1} | +0{I1}_00{I1} | +{I1}_000{I1} | +0{I1}_{I2}{ALT} | +{I1}_0{I2}{ALT} | +00{I1}_{I2} | +0{I1}_0{I2} | +{I1}_00{I2} | +0{I2}_{I1}{ALT} | +{I2}_0{I1}{ALT} | +00{I2}_{I1} | +0{I2}_0{I1} | +{I2}_00{I1} | +0{I2}_{I2} | +{I2}_0{I2} { + if (((altlin == 1) && (relax & WCSHDR_PC0i_0ja)) || + ((altlin == 2) && (relax & WCSHDR_CD0i_0ja))) { + sscanf(yytext, "%d_%d%c", &i, &j, &a); + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}_{Z1}{ALT}" " | +{Z2}_{Z1}{ALT}" " | +{Z1}_{Z2}{ALT}" " | +{Z3}_{Z1}{ALT} | +{Z2}_{Z2}{ALT} | +{Z1}_{Z3}{ALT} | +{Z4}_{Z1} | +{Z3}_{Z2} | +{Z2}_{Z3} | +{Z1}_{Z4} { + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + +{Z1}-{Z1}{ALT}" " | +{Z2}-{Z1}{ALT}" " | +{Z1}-{Z2}{ALT}" " | +{Z3}-{Z1}{ALT} | +{Z2}-{Z2}{ALT} | +{Z1}-{Z3}{ALT} | +{Z4}-{Z1} | +{Z3}-{Z2} | +{Z2}-{Z3} | +{Z1}-{Z4} { + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + +{Z2}{I1}{Z2}{I1} { + /* This covers the defunct forms CD00i00j and PC00i00j. */ + if (((altlin == 1) && (relax & WCSHDR_PC00i00j)) || + ((altlin == 2) && (relax & WCSHDR_CD00i00j))) { + sscanf(yytext, "%3d%3d", &i, &j); + a = ' '; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = errtxt; + sprintf(errmsg, + "this form of the %s keyword is deprecated, use %s", + keyname, keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + BEGIN(DISCARD); + } + +{ALT} | +. { + if (YY_START == CCCCCCCa) { + sscanf(yytext, "%c", &a); + } else { + unput(yytext[0]); + a = 0; + } + + BEGIN(VALUE); + } + +. { + if (relax & WCSHDR_reject) { + /* Looks too much like a FITS WCS keyword not to flag it. */ + errmsg = errtxt; + sprintf(errmsg, "invalid alternate code, keyword resembles %s " + "but isn't", keyname); + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{I1}_{Z1}{ALT}" " | +{I1}_{I2}{ALT}" " | +{I2}_{Z1}{ALT}" " | +{I2}_{I2}{ALT} { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + BEGIN(VALUE); + } + +0{I1}_{Z1}{ALT}" " | +{I1}_0{Z1}{ALT}" " | +00{I1}_{Z1}{ALT} | +0{I1}_0{Z1}{ALT} | +{I1}_00{Z1}{ALT} | +000{I1}_{Z1} | +00{I1}_0{Z1} | +0{I1}_00{Z1} | +{I1}_000{Z1} | +0{I1}_{I2}{ALT} | +{I1}_0{I2}{ALT} | +00{I1}_{I2} | +0{I1}_0{I2} | +{I1}_00{I2} | +0{I2}_{Z1}{ALT} | +{I2}_0{Z1}{ALT} | +00{I2}_{Z1} | +0{I2}_0{Z1} | +{I2}_00{Z1} | +0{I2}_{I2} | +{I2}_0{I2} { + if (((valtype == FLOAT) && (relax & WCSHDR_PV0i_0ma)) || + ((valtype == STRING) && (relax & WCSHDR_PS0i_0ma))) { + sscanf(yytext, "%d_%d%c", &i, &m, &a); + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "indices in parameterized keywords must not have " + "leading zeroes"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +{Z1}_{Z1}{ALT}" " | +{Z2}_{Z1}{ALT}" " | +{Z1}_{Z2}{ALT}" " | +{Z3}_{Z1}{ALT} | +{Z2}_{Z2}{ALT} | +{Z1}_{Z3}{ALT} | +{Z4}_{Z1} | +{Z3}_{Z2} | +{Z2}_{Z3} | +{Z1}_{Z4} { + /* Anything that has fallen through to this point must contain */ + /* an invalid axis number. */ + errmsg = "axis number must exceed 0"; + BEGIN(ERROR); + } + +{Z1}-{Z1}{ALT}" " | +{Z2}-{Z1}{ALT}" " | +{Z1}-{Z2}{ALT}" " | +{Z3}-{Z1}{ALT} | +{Z2}-{Z2}{ALT} | +{Z1}-{Z3}{ALT} | +{Z4}-{Z1} | +{Z3}-{Z2} | +{Z2}-{Z3} | +{Z1}-{Z4} { + errmsg = errtxt; + sprintf(errmsg, "%s keyword must use an underscore, not a dash", + keyname); + BEGIN(ERROR); + } + +. { + BEGIN(DISCARD); + } + +{Z1}{ALT}" " | +{Z2}{ALT} | +{Z3} { + a = ' '; + sscanf(yytext, "%d%c", &i, &a); + + if (relax & WCSHDR_strict) { + errmsg = "the CROTAn keyword is deprecated, use PCi_ja"; + BEGIN(ERROR); + + } else if (a == ' ' || relax & WCSHDR_CROTAia) { + yyless(0); + BEGIN(CCCCCia); + + } else if (relax & WCSHDR_reject) { + errmsg = "CROTAn keyword may not have an alternate version code"; + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + } + +. { + yyless(0); + BEGIN(CCCCCia); + } + +{Z1}" " { + if (relax & WCSHDR_PROJPn) { + sscanf(yytext, "%d", &m); + i = 0; + a = ' '; + BEGIN(VALUE); + + } else if (relax & WCSHDR_reject) { + errmsg = "the PROJPn keyword is deprecated, use PVi_ma"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +{Z2}" " | +{Z3} { + if (relax & (WCSHDR_PROJPn | WCSHDR_reject)) { + errmsg = "invalid PROJPn keyword"; + BEGIN(ERROR); + + } else { + BEGIN(DISCARD); + } + } + +. { + BEGIN(DISCARD); + } + +{Z1}_{Z1}" " | +{Z1}_{Z1}" " { + /* SIP keywords. */ + valtype = FLOAT; + distype = PRIOR; + vptr = &(distem.dp); + npptr = ndp; + + a = ' '; + distran = SIP; + + sscanf(yytext, "%d_%d", &p, &q); + BEGIN(VALUE); + } + +. | +. { + BEGIN(DISCARD); + } + +{I1}" " | +{I2}" " { + /* DSS keywords. */ + valtype = FLOAT; + distype = SEQUENT; + vptr = &(distem.dp); + npptr = ndq; + + a = ' '; + distran = DSS; + + sscanf(yytext, "%d", &m); + BEGIN(VALUE); + } + +. { + BEGIN(DISCARD); + } + +=" "+{STRING} { + /* Special handling for this iconic DSS keyword. */ + if (1 < ipass) { + /* Look for a minus sign. */ + sscanf(yytext, "= '%s", strtmp); + dbltmp = strcmp(strtmp, "-") ? 1.0 : -1.0; + } + + BEGIN(COMMENT); + } + +. { + BEGIN(DISCARD); + } + +=" "+ { + /* Do checks on i, j & m. */ + if (99 < i || 99 < j || 99 < m) { + if (relax & WCSHDR_reject) { + if (99 < i || 99 < j) { + errmsg = "axis number exceeds 99"; + } else if (m > 99) { + errmsg = "parameter number exceeds 99"; + } + BEGIN(ERROR); + + } else { + /* Pretend we don't recognize it. */ + BEGIN(DISCARD); + } + + } else { + if (valtype == INTEGER) { + BEGIN(INTEGER_VAL); + } else if (valtype == FLOAT) { + BEGIN(FLOAT_VAL); + } else if (valtype == FLOAT2) { + BEGIN(FLOAT2_VAL); + } else if (valtype == STRING) { + BEGIN(STRING_VAL); + } else if (valtype == RECORD) { + BEGIN(RECORD_VAL); + } else { + errmsg = errtxt; + sprintf(errmsg, "internal parser ERROR, bad data type: %d", + valtype); + BEGIN(ERROR); + } + } + } + +. { + errmsg = "invalid KEYWORD = VALUE syntax"; + BEGIN(ERROR); + } + +{INTEGER} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + sscanf(yytext, "%d", &inttmp); + + BEGIN(COMMENT); + } + } + +. { + errmsg = "an integer value was expected"; + BEGIN(ERROR); + } + +{FLOAT} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + wcsutil_str2double(yytext, &dbltmp); + + if (chekval && chekval(dbltmp)) { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } else { + BEGIN(COMMENT); + } + } + } + +. { + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + +{FLOAT} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue as integer and fractional parts. */ + wcsutil_str2double2(yytext, dbl2tmp); + + BEGIN(COMMENT); + } + } + +. { + errmsg = "a floating-point value was expected"; + BEGIN(ERROR); + } + +{STRING} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + /* Read the keyvalue. */ + strcpy(strtmp, yytext+1); + + /* Squeeze out repeated quotes. */ + ix = 0; + for (jx = 0; jx < 72; jx++) { + if (ix < jx) { + strtmp[ix] = strtmp[jx]; + } + + if (strtmp[jx] == '\0') { + if (ix) strtmp[ix-1] = '\0'; + break; + } else if (strtmp[jx] == '\'' && strtmp[jx+1] == '\'') { + jx++; + } + + ix++; + } + + BEGIN(COMMENT); + } + } + +. { + errmsg = "a string value was expected"; + BEGIN(ERROR); + } + +{RECORD} { + if (ipass == 1) { + BEGIN(COMMENT); + + } else { + yyless(1); + + BEGIN(RECFIELD); + } + } + +. { + errmsg = "a record was expected"; + BEGIN(ERROR); + } + +{FIELD} { + strcpy(strtmp, yytext); + BEGIN(RECCOLON); + } + +. { + errmsg = "invalid record field"; + BEGIN(ERROR); + } + +:" "+ { + BEGIN(RECVALUE); + } + +. { + errmsg = "invalid record syntax"; + BEGIN(ERROR); + } + +{INTEGER} { + rectype = 0; + sscanf(yytext, "%d", &inttmp); + BEGIN(RECEND); + } + +{FLOAT} { + rectype = 1; + wcsutil_str2double(yytext, &dbltmp); + BEGIN(RECEND); + } + +. { + errmsg = "invalid record value"; + BEGIN(ERROR); + } + +' { + BEGIN(COMMENT); + } + +{INLINE}$ { + if (ipass == 1) { + /* Do first-pass bookkeeping. */ + wcspih_naxes(naxis, i, j, a, distype, alts, dpq, npptr); + BEGIN(FLUSH); + + } else if (*wcs) { + /* Store the value now that the keyrecord has been validated. */ + gotone = 0; + for (ialt = 0; ialt < *nwcs; ialt++) { + /* The loop here is for keywords that apply */ + /* to every alternate; these have a == 0. */ + if (a >= 'A') { + ialt = alts[a-'A'+1]; + if (ialt < 0) break; + } + gotone = 1; + + if (vptr) { + if (sipflag) { + /* Translate a SIP keyword into DPja. */ + disp = (*wcs)->lin.dispre; + ipx = (disp->ndp)++; + + /* SIP doesn't have alternates. */ + sprintf(keyword, "DP%d", i); + sprintf(strtmp, "SIP.%s.%d_%d", (sipflag==2)?"FWD":"REV", + p, q); + if (valtype == INTEGER) { + dpfill(disp->dp+ipx, keyword, strtmp, i, 0, inttmp, 0.0); + } else { + dpfill(disp->dp+ipx, keyword, strtmp, i, 1, 0, dbltmp); + } + + } else if (dssflag) { + /* All DSS keywords require special handling. */ + if (dssflag == 1) { + /* Temporary parameter for DSS used by wcspih_final(). */ + *((double *)vptr) = dbltmp; + + } else if (dssflag == 2) { + /* Temporary parameter for DSS used by wcspih_final(). */ + strcpy((char *)vptr, strtmp); + + } else { + /* Translate a DSS keyword into DQia. */ + if (m <= 13 || dbltmp != 0.0) { + disp = (*wcs)->lin.disseq; + ipx = (disp->ndp)++; + + /* DSS doesn't have alternates. */ + sprintf(keyword, "DQ%d", i); + sprintf(strtmp, "DSS.AMD.%d", m); + dpfill(disp->dp+ipx, keyword, strtmp, i, 1, 0, dbltmp); + + /* Also required by wcspih_final(). */ + if (m <= 3) { + dsstmp[13+(i-1)*3+m] = dbltmp; + } + } + } + + } else if (watflag) { + /* String array for TNX and ZPX used by wcspih_final(). */ + strcpy((char *)vptr, strtmp); + + } else { + /* An ordinary keyword. */ + wcsp = *wcs + ialt; + if (distype == 0) { + voff = (char *)vptr - (char *)(&wcstem); + wptr = (void *)((char *)wcsp + voff); + + } else { + voff = (char *)vptr - (char *)(&distem); + if (distype == PRIOR) { + /* Prior distortion. */ + disp = wcsp->lin.dispre; + } else { + /* Sequent distortion. */ + disp = wcsp->lin.disseq; + } + wptr = (void *)((char *)disp + voff); + } + + if (valtype == INTEGER) { + *((int *)wptr) = inttmp; + + } else if (valtype == FLOAT) { + /* Apply keyword parameterization. */ + if (npptr == npv) { + ipx = (wcsp->npv)++; + wcsp->pv[ipx].i = i; + wcsp->pv[ipx].m = m; + wptr = &(wcsp->pv[ipx].value); + + } else if (j) { + wptr = *((double **)wptr) + (i - 1)*(wcsp->naxis) + + (j - 1); + + } else if (i) { + wptr = *((double **)wptr) + (i - 1); + } + + if (special) { + special(wptr, &dbltmp); + } else { + *((double *)wptr) = dbltmp; + } + + /* Flag presence of PCi_ja, or CDi_ja and/or CROTAia. */ + if (altlin) { + wcsp->altlin |= altlin; + altlin = 0; + } + + } else if (valtype == FLOAT2) { + /* Split MJDREF and JDREF into integer and fraction.*/ + if (special) { + special(wptr, dbl2tmp); + } else { + *((double *)wptr) = dbl2tmp[0]; + *((double *)wptr + 1) = dbl2tmp[1]; + } + + } else if (valtype == STRING) { + /* Apply keyword parameterization. */ + if (npptr == nps) { + ipx = (wcsp->nps)++; + wcsp->ps[ipx].i = i; + wcsp->ps[ipx].m = m; + wptr = wcsp->ps[ipx].value; + + } else if (j) { + wptr = *((char (**)[72])wptr) + + (i - 1)*(wcsp->naxis) + (j - 1); + + } else if (i) { + wptr = *((char (**)[72])wptr) + (i - 1); + } + + cptr = (char *)wptr; + strcpy(cptr, strtmp); + + } else if (valtype == RECORD) { + ipx = (disp->ndp)++; + + if (a == ' ') { + sprintf(keyword, "%.2s%d", keyname, i); + } else { + sprintf(keyword, "%.2s%d%c", keyname, i, a); + } + + dpfill(disp->dp+ipx, keyword, strtmp, i, rectype, inttmp, + dbltmp); + } + } + } + + if (a) break; + } + + if (gotone) { + nvalid++; + if (ctrl == 4) { + if (distran || dssflag) { + wcsfprintf(stderr, "%.80s\n Accepted (%d) as a " + "recognised WCS convention.\n", keyrec, nvalid); + } else { + wcsfprintf(stderr, "%.80s\n Accepted (%d) as a " + "valid WCS keyrecord.\n", keyrec, nvalid); + } + } + + BEGIN(FLUSH); + + } else { + errmsg = "syntactically valid WCS keyrecord has no effect"; + BEGIN(ERROR); + } + + } else { + BEGIN(FLUSH); + } + } + +.*" "*\/.*$ { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + +[^ \/\n]*{INLINE}$ { + errmsg = "invalid keyvalue"; + BEGIN(ERROR); + } + +" "+[^\/\n].*{INLINE}$ { + errmsg = "invalid keyvalue or malformed keycomment"; + BEGIN(ERROR); + } + +.*$ { + errmsg = "malformed keycomment"; + BEGIN(ERROR); + } + +.*$ { + if (ipass == npass) { + if (ctrl < 0) { + /* Preserve discards. */ + keep = keyrec; + + } else if (2 < ctrl) { + nother++; + wcsfprintf(stderr, "%.80s\n Not a recognized WCS keyword.\n", + keyrec); + } + } + BEGIN(FLUSH); + } + +.*$ { + if (ipass == npass) { + (*nreject)++; + + if (ctrl%10 == -1) { + /* Preserve rejects. */ + keep = keyrec; + } + + if (1 < abs(ctrl%10)) { + wcsfprintf(stderr, "%.80s\n Rejected (%d), %s.\n", + keyrec, *nreject, errmsg); + } + } + BEGIN(FLUSH); + } + +.*\n { + if (ipass == npass && keep) { + if (hptr < keep) { + strncpy(hptr, keep, 80); + } + hptr += 80; + } + + /* Throw away the rest of the line and reset for the next one. */ + i = j = 0; + m = 0; + a = ' '; + + keyrec += 80; + + valtype = -1; + distype = 0; + vptr = 0x0; + keep = 0x0; + + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + sipflag = 0; + dssflag = 0; + watflag = 0; + + BEGIN(INITIAL); + } + +<> { + /* End-of-input. */ + if (ipass == 1) { + if ((status = wcspih_inits(naxis, alts, dpq, npv, nps, ndp, ndq, + distran, nwcs, wcs)) || + (*nwcs == 0 && ctrl == 0)) { + return status; + } + + if (2 < abs(ctrl%10)) { + if (*nwcs == 1) { + if (strcmp(wcs[0]->wcsname, "DEFAULTS") != 0) { + wcsfprintf(stderr, "Found one coordinate representation.\n"); + } + } else { + wcsfprintf(stderr, "Found %d coordinate representations.\n", + *nwcs); + } + } + + watstr = calloc(2*(watn*68 + 1), sizeof(char)); + wat[0] = watstr; + wat[1] = watstr + watn*68 + 1; + } + + if (ipass++ < npass) { + wcspih_hdr = header; + wcspih_nkeyrec = nkeyrec; + keyrec = header; + *nreject = 0; + + i = j = 0; + m = 0; + a = ' '; + + valtype = -1; + distype = 0; + vptr = 0x0; + + altlin = 0; + npptr = 0x0; + chekval = 0x0; + special = 0x0; + sipflag = 0; + dssflag = 0; + watflag = 0; + + yyrestart(yyin, yyscanner); + + } else { + + if (ctrl < 0) { + *hptr = '\0'; + } else if (ctrl == 1) { + wcsfprintf(stderr, "%d WCS keyrecord%s rejected.\n", + *nreject, (*nreject==1)?" was":"s were"); + } else if (ctrl == 4) { + wcsfprintf(stderr, "\n"); + wcsfprintf(stderr, "%5d keyrecord%s rejected for syntax or " + "other errors,\n", *nreject, (*nreject==1)?" was":"s were"); + wcsfprintf(stderr, "%5d %s recognized as syntactically valid, " + "and\n", nvalid, (nvalid==1)?"was":"were"); + wcsfprintf(stderr, "%5d other%s were not recognized as WCS " + "keyrecords.\n", nother, (nother==1)?"":"s"); + } + + status = wcspih_final(ndp, ndq, distran, dsstmp, wat, nwcs, wcs); + free(watstr); + return status; + } + } + +%% + +/*---------------------------------------------------------------------------- +* Determine the number of coordinate representations (up to 27) and the +* number of coordinate axes in each, which distortions are present, and the +* number of PVi_ma, PSi_ma, DPja, and DQia keywords in each representation. +*---------------------------------------------------------------------------*/ + +void wcspih_naxes( + int naxis, + int i, + int j, + char a, + int distype, + int alts[], + int dpq[], + int *npptr) + +{ + /* On the first pass alts[] is used to determine the number of axes */ + /* for each of the 27 possible alternate coordinate descriptions. */ + int ialt, *ip; + + if (a == 0) { + return; + } + + ialt = 0; + if (a != ' ') { + ialt = a - 'A' + 1; + } + + ip = alts + ialt; + + if (*ip < naxis) { + *ip = naxis; + } + + /* i or j can be greater than naxis. */ + if (*ip < i) { + *ip = i; + } + + if (*ip < j) { + *ip = j; + } + + /* Type of distortions present. */ + dpq[ialt] |= distype; + + /* Count PVi_ma, PSi_ma, DPja, or DQia keywords. */ + if (npptr) { + npptr[ialt]++; + } +} + + +/*---------------------------------------------------------------------------- +* Allocate memory for an array of the required number of wcsprm structs and +* initialize each of them. +*---------------------------------------------------------------------------*/ + +int wcspih_inits( + int naxis, + int alts[], + int dpq[], + int npv[], + int nps[], + int ndp[], + int ndq[], + int distran, + int *nwcs, + struct wcsprm **wcs) + +{ + int ialt, defaults, ndis, ndpmax, npsmax, npvmax, status = 0; + struct wcsprm *wcsp; + struct disprm *dis; + + /* Find the number of coordinate descriptions. */ + *nwcs = 0; + for (ialt = 0; ialt < 27; ialt++) { + if (alts[ialt]) (*nwcs)++; + } + + if ((defaults = !(*nwcs) && naxis)) { + /* NAXIS is non-zero but there were no WCS keywords with an alternate + version code; create a default WCS with blank alternate version. */ + wcspih_naxes(naxis, 0, 0, ' ', 0, alts, dpq, 0x0); + *nwcs = 1; + } + + if (*nwcs) { + /* Allocate memory for the required number of wcsprm structs. */ + if ((*wcs = calloc(*nwcs, sizeof(struct wcsprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + ndis = 0; + if (distran == SIP) { + /* DPja.NAXES and DPja.OFFSET.j to be added for SIP (see below and + wcspih_final()). */ + ndp[0] += 6; + + } else if (distran == DSS) { + /* DPja.NAXES to be added for DSS (see below and wcspih_final()). */ + ndq[0] += 2; + } + + /* Initialize each wcsprm struct. */ + wcsp = *wcs; + *nwcs = 0; + for (ialt = 0; ialt < 27; ialt++) { + if (alts[ialt]) { + wcsp->flag = -1; + npvmax = npv[ialt]; + npsmax = nps[ialt]; + if ((status = wcsinit(1, alts[ialt], wcsp, npvmax, npsmax, -1))) { + wcsvfree(nwcs, wcs); + break; + } + + /* Record the alternate version code. */ + if (ialt) { + wcsp->alt[0] = 'A' + ialt - 1; + } + + /* Record in wcsname whether this is a default description. */ + if (defaults) { + strcpy(wcsp->wcsname, "DEFAULTS"); + } + + /* Any distortions present? */ + if (dpq[ialt] & 1) { + if ((dis = calloc(1, sizeof(struct disprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + /* Attach it to linprm. Also inits it. */ + ndis++; + ndpmax = ndp[ialt]; + dis->flag = -1; + lindist(1, &(wcsp->lin), dis, ndpmax); + } + + if (dpq[ialt] & 2) { + if ((dis = calloc(1, sizeof(struct disprm))) == 0x0) { + return WCSHDRERR_MEMORY; + } + + /* Attach it to linprm. Also inits it. */ + ndis++; + ndpmax = ndq[ialt]; + dis->flag = -1; + lindist(2, &(wcsp->lin), dis, ndpmax); + } + + /* On the second pass alts[] indexes the array of wcsprm structs. */ + alts[ialt] = (*nwcs)++; + + wcsp++; + + } else { + /* Signal that there is no wcsprm for this alt. */ + alts[ialt] = -1; + } + } + + + /* Translated distortion? Neither SIP nor DSS have alternates, so the */ + /* presence of keywords for either (not both together), as flagged by */ + /* distran, necessarily refers to the primary representation. */ + if (distran == SIP) { + strcpy((*wcs)->lin.dispre->dtype[0], "SIP"); + strcpy((*wcs)->lin.dispre->dtype[1], "SIP"); + + /* SIP doesn't have axis mapping. */ + (*wcs)->lin.dispre->ndp = 6; + dpfill((*wcs)->lin.dispre->dp, "DP1", "NAXES", 0, 0, 2, 0.0); + dpfill((*wcs)->lin.dispre->dp+3, "DP2", "NAXES", 0, 0, 2, 0.0); + + } else if (distran == DSS) { + strcpy((*wcs)->lin.disseq->dtype[0], "DSS"); + strcpy((*wcs)->lin.disseq->dtype[1], "DSS"); + + /* The Paper IV translation of DSS doesn't require an axis mapping. */ + (*wcs)->lin.disseq->ndp = 2; + dpfill((*wcs)->lin.disseq->dp, "DQ1", "NAXES", 0, 0, 2, 0.0); + dpfill((*wcs)->lin.disseq->dp+1, "DQ2", "NAXES", 0, 0, 2, 0.0); + } + } + + return status; +} + + +/*---------------------------------------------------------------------------- +* Interpret the JDREF, JDREFI, and JDREFF keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_jdref(double *mjdref, const double *jdref) + +{ + /* Set MJDREF from JDREF. */ + if (undefined(mjdref[0] && undefined(mjdref[1]))) { + mjdref[0] = jdref[0] - 2400000.0; + mjdref[1] = jdref[1] - 0.5; + + if (mjdref[1] < 0.0) { + mjdref[0] -= 1.0; + mjdref[1] += 1.0; + } + } + + return 0; +} + +int wcspih_jdrefi(double *mjdref, const double *jdrefi) + +{ + /* Set the integer part of MJDREF from JDREFI. */ + if (undefined(mjdref[0])) { + mjdref[0] = *jdrefi - 2400000.5; + } + + return 0; +} + + +int wcspih_jdreff(double *mjdref, const double *jdreff) + +{ + /* Set the fractional part of MJDREF from JDREFF. */ + if (undefined(mjdref[1])) { + mjdref[1] = *jdreff; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret EPOCHa keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_epoch(double *equinox, const double *epoch) + +{ + /* If EQUINOXa is currently undefined then set it from EPOCHa. */ + if (undefined(*equinox)) { + *equinox = *epoch; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Interpret VSOURCEa keywords. +*---------------------------------------------------------------------------*/ + +int wcspih_vsource(double *zsource, const double *vsource) + +{ + double beta, c = 299792458.0; + + /* If ZSOURCEa is currently undefined then set it from VSOURCEa. */ + if (undefined(*zsource)) { + /* Convert relativistic Doppler velocity to redshift. */ + beta = *vsource/c; + *zsource = (1.0 + beta)/sqrt(1.0 - beta*beta) - 1.0; + } + + return 0; +} + + +/*---------------------------------------------------------------------------- +* Check validity of a TIMEPIXR keyvalue. +*---------------------------------------------------------------------------*/ + +int wcspih_timepixr(double timepixr) + +{ + return (timepixr < 0.0 || 1.0 < timepixr); +} + + +/*---------------------------------------------------------------------------- +* Interpret special keywords encountered for each coordinate representation. +*---------------------------------------------------------------------------*/ + +int wcspih_final( + int ndp[], + int ndq[], + int distran, + double dsstmp[], + char *wat[], + int *nwcs, + struct wcsprm **wcs) + +{ + char field[32], *wp, wpoly[12], wtype[8]; + int i, ialt, idp, ipv, m, npv, n, nterms, omax, omin, status, wctrl[4]; + double A1, A2, A3, B1, B2, B3, CNPIX1, CNPIX2, *crval, Rx, Ry, S, wval, + X0, Y0, Xc, Yc; + struct disprm *disp; + struct wcsprm *wcsp; + + for (ialt = 0; ialt < *nwcs; ialt++) { + /* Interpret -TAB header keywords. */ + if ((status = wcstab(*wcs+ialt))) { + wcsvfree(nwcs, wcs); + return status; + } + + if (ndp[ialt] && ndq[ialt]) { + /* Prior and sequent distortions co-exist in this representation; + ensure the latter gets DVERRa. */ + (*wcs+ialt)->lin.disseq->totdis = (*wcs+ialt)->lin.dispre->totdis; + } + } + + /* Translated distortion functions; apply only to the primary WCS. */ + wcsp = *wcs; + if (distran == SIP) { + /* SIP doesn't have alternates, nor axis mapping. */ + disp = wcsp->lin.dispre; + dpfill(disp->dp+1, "DP1", "OFFSET.1", 0, 1, 0, wcsp->crpix[0]); + dpfill(disp->dp+2, "DP1", "OFFSET.2", 0, 1, 0, wcsp->crpix[1]); + dpfill(disp->dp+4, "DP2", "OFFSET.1", 0, 1, 0, wcsp->crpix[0]); + dpfill(disp->dp+5, "DP2", "OFFSET.2", 0, 1, 0, wcsp->crpix[1]); + + } else if (distran == DSS) { + /* DSS doesn't have alternates, nor axis mapping. This translation */ + /* follows Paper IV, Sect. 5.2 using the same variable names. */ + CNPIX1 = dsstmp[0]; + CNPIX2 = dsstmp[1]; + + Xc = dsstmp[2]/1000.0; + Yc = dsstmp[3]/1000.0; + Rx = dsstmp[4]/1000.0; + Ry = dsstmp[5]/1000.0; + + A1 = dsstmp[14]; + A2 = dsstmp[15]; + A3 = dsstmp[16]; + B1 = dsstmp[17]; + B2 = dsstmp[18]; + B3 = dsstmp[19]; + S = sqrt(fabs(A1*B1 - A2*B2)); + + X0 = (A2*B3 - A3*B1) / (A1*B1 - A2*B2); + Y0 = (A3*B2 - A1*B3) / (A1*B1 - A2*B2); + + wcsp->crpix[0] = (Xc - X0)/Rx - (CNPIX1 - 0.5); + wcsp->crpix[1] = (Yc + Y0)/Ry - (CNPIX2 - 0.5); + + wcsp->pc[0] = A1*Rx/S; + wcsp->pc[1] = -A2*Ry/S; + wcsp->pc[2] = -B2*Rx/S; + wcsp->pc[3] = B1*Ry/S; + wcsp->altlin = 1; + + wcsp->cdelt[0] = -S/3600.0; + wcsp->cdelt[1] = S/3600.0; + + crval = wcsp->crval; + crval[0] = (dsstmp[6] + (dsstmp[7] + dsstmp[8] /60.0)/60.0)*15.0; + crval[1] = dsstmp[10] + (dsstmp[11] + dsstmp[12]/60.0)/60.0; + if (dsstmp[9] == -1.0) crval[1] *= -1.0; + + strcpy(wcsp->ctype[0], "RA---TAN"); + strcpy(wcsp->ctype[1], "DEC--TAN"); + + sprintf(wcsp->wcsname, "DSS PLATEID %.4s", (char *)(dsstmp+13)); + + /* Erase the approximate WCS provided in modern DSS headers. */ + wcsp->cd[0] = 0.0; + wcsp->cd[1] = 0.0; + wcsp->cd[2] = 0.0; + wcsp->cd[3] = 0.0; + + } else if (distran == WAT) { + /* TNX and ZPX don't have alternates, nor axis mapping. */ + disp = wcsp->lin.disseq; + + /* Disassemble the core dump stored in the WATi_m strings. */ + nterms = 0; + for (i = 0; i < 2; i++) { + sscanf(wat[i], "wtype=%s", wtype); + + if (strcmp(wtype, "tnx") == 0) { + strcpy(disp->dtype[i], "WAT-TNX"); + } else if (strcmp(wtype, "zpx") == 0) { + strcpy(disp->dtype[i], "WAT-ZPX"); + } else { + /* Could contain "tan" or something else to be ignored. */ + lindist(2, &(wcsp->lin), 0x0, 0); + return 0; + } + + /* The PROJPn parameters are duplicated on each ZPX axis. */ + if (i == 1 && strcmp(wtype, "zpx") == 0) { + /* Take those on the second (latitude) axis ignoring the other. */ + /* First we have to count them and allocate space in wcsprm. */ + wp = wat[i]; + for (npv = 0; npv < 30; npv++) { + if ((wp = strstr(wp, "projp")) == 0x0) break; + wp += 5; + } + + /* Allocate space. */ + if (npv) { + wcsp->npvmax += npv; + wcsp->pv = realloc(wcsp->pv, wcsp->npvmax*sizeof(struct pvcard)); + if (wcsp->pv == 0x0) { + return WCSHDRERR_MEMORY; + } + + wcsp->m_pv = wcsp->pv; + } + + /* Copy the values. */ + wp = wat[i]; + for (ipv = wcsp->npv; ipv < wcsp->npvmax; ipv++) { + if ((wp = strstr(wp, "projp")) == 0x0) break; + + sscanf(wp, "projp%d=%lf", &m, &wval); + wcsp->pv[ipv].i = 2; + wcsp->pv[ipv].m = m; + wcsp->pv[ipv].value = wval; + + wp += 5; + } + + wcsp->npv += npv; + } + + /* Read the control parameters. */ + if ((wp = strchr(wat[i], '"')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + + for (m = 0; m < 4; m++) { + sscanf(wp, "%d", wctrl+m); + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* How many coefficients are we expecting? */ + omin = (wctrl[1] < wctrl[2]) ? wctrl[1] : wctrl[2]; + omax = (wctrl[1] < wctrl[2]) ? wctrl[2] : wctrl[1]; + if (wctrl[3] == 0) { + /* No cross terms. */ + nterms += omin + omax; + + } else if (wctrl[3] == 1) { + /* Full cross terms. */ + nterms += omin*omax; + + } else if (wctrl[3] == 2) { + /* Half cross terms. */ + nterms += omin*omax - omin*(omin-1)/2; + } + } + + /* Allocate memory for dpkeys. */ + ndq[0] += 2*(1 + 1 + 4) + nterms; + + disp->ndpmax += ndq[0]; + disp->dp = realloc(disp->dp, disp->ndpmax*sizeof(struct dpkey)); + if (disp->dp == 0x0) { + return WCSHDRERR_MEMORY; + } + + disp->m_dp = disp->dp; + + + /* Populate dpkeys. */ + idp = disp->ndp; + for (i = 0; i < 2; i++) { + dpfill(disp->dp+(idp++), "DQ", "NAXES", i+1, 0, 2, 0.0); + + /* Read the control parameters. */ + if ((wp = strchr(wat[i], '"')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + + for (m = 0; m < 4; m++) { + sscanf(wp, "%d", wctrl+m); + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* Polynomial type. */ + dpfill(disp->dp+(idp++), "DQ", "WAT.POLY", i+1, 0, wctrl[0], 0.0); + if (wctrl[0] == 1) { + /* Chebyshev polynomial. */ + strcpy(wpoly, "CHBY"); + } else if (wctrl[0] == 2) { + /* Legendre polynomial. */ + strcpy(wpoly, "LEGR"); + } else if (wctrl[0] == 3) { + /* Polynomial is the sum of monomials. */ + strcpy(wpoly, "MONO"); + } else { + /* Unknown code. */ + strcpy(wpoly, "UNKN"); + } + + /* Read the scaling parameters. */ + for (m = 0; m < 4; m++) { + sscanf(wp, "%lf", &wval); + sprintf(field, "WAT.%c%s", (m<2)?'X':'Y', (m%2)?"MAX":"MIN"); + dpfill(disp->dp+(idp++), "DQ", field, i+1, 1, 0, wval); + + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + + /* Read the coefficients. */ + for (n = 0; n < wctrl[2]; n++) { + for (m = 0; m < wctrl[1]; m++) { + if (wctrl[3] == 0) { + if (m && n) continue; + } else if (wctrl[3] == 2) { + if (m+n > omax-1) continue; + } + + sscanf(wp, "%lf", &wval); + if (wval == 0.0) continue; + + sprintf(field, "WAT.%s.%d_%d", wpoly, m, n); + dpfill(disp->dp+(idp++), "DQ", field, i+1, 1, 0, wval); + + if ((wp = strchr(wp, ' ')) == 0x0) { + return WCSHDRERR_PARSER; + } + wp++; + } + } + } + + disp->ndp = idp; + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.c b/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.c new file mode 100644 index 0000000000000000000000000000000000000000..b4040ffb6f86e292b316618a3710f06685b103da --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.c @@ -0,0 +1,171 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsprintf.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include + +#include "wcsprintf.h" + +static FILE *wcsprintf_file = 0x0; +static char *wcsprintf_buff = 0x0; +static char *wcsprintf_bufp = 0x0; +static size_t wcsprintf_size = 0; + +/*--------------------------------------------------------------------------*/ + +int wcsprintf_set(FILE *wcsout) + +{ + if (wcsout != 0x0) { + /* Output to file. */ + wcsprintf_file = wcsout; + + if (wcsprintf_buff != 0x0) { + /* Release the buffer. */ + free(wcsprintf_buff); + wcsprintf_buff = 0x0; + } + + } else { + /* Output to buffer. */ + if (wcsprintf_buff == 0x0) { + /* Allocate a buffer. */ + wcsprintf_buff = malloc(1024); + if (wcsprintf_buff == NULL) { + return 1; + } + wcsprintf_size = 1024; + } + + /* Reset pointer to the start of the buffer. */ + wcsprintf_bufp = wcsprintf_buff; + *wcsprintf_bufp = '\0'; + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +const char *wcsprintf_buf(void) + +{ + return wcsprintf_buff; +} + +/*--------------------------------------------------------------------------*/ + +int wcsprintf(const char *format, ...) + +{ + char *realloc_buff; + int nbytes; + size_t used; + va_list arg_list; + + if (wcsprintf_buff == 0x0 && wcsprintf_file == 0x0) { + /* Send output to stdout if wcsprintf_set() hasn't been called. */ + wcsprintf_file = stdout; + } + + va_start(arg_list, format); + + if (wcsprintf_file) { + /* Output to file. */ + nbytes = vfprintf(wcsprintf_file, format, arg_list); + + } else { + /* Output to buffer. */ + used = wcsprintf_bufp - wcsprintf_buff; + if (wcsprintf_size - used < 128) { + /* Expand the buffer. */ + wcsprintf_size += 1024; + realloc_buff = realloc(wcsprintf_buff, wcsprintf_size); + if (realloc_buff == NULL) { + free(wcsprintf_buff); + wcsprintf_buff = 0x0; + return 1; + } + wcsprintf_buff = realloc_buff; + wcsprintf_bufp = wcsprintf_buff + used; + } + + nbytes = vsprintf(wcsprintf_bufp, format, arg_list); + wcsprintf_bufp += nbytes; + } + + va_end(arg_list); + + return nbytes; +} + +/*--------------------------------------------------------------------------*/ + +int wcsfprintf(FILE *stream, const char *format, ...) + +{ + char *realloc_buff; + int nbytes; + size_t used; + va_list arg_list; + + if (wcsprintf_buff == 0x0 && wcsprintf_file == 0x0) { + /* Send output to stream if wcsprintf_set() hasn't been called. */ + wcsprintf_file = stream; + } + + va_start(arg_list, format); + + if (wcsprintf_file) { + /* Output to file. */ + nbytes = vfprintf(wcsprintf_file, format, arg_list); + + } else { + /* Output to buffer. */ + used = wcsprintf_bufp - wcsprintf_buff; + if (wcsprintf_size - used < 128) { + /* Expand the buffer. */ + wcsprintf_size += 1024; + realloc_buff = realloc(wcsprintf_buff, wcsprintf_size); + if (realloc_buff == NULL) { + free(wcsprintf_buff); + wcsprintf_buff = 0x0; + return 1; + } + wcsprintf_buff = realloc_buff; + wcsprintf_bufp = wcsprintf_buff + used; + } + + nbytes = vsprintf(wcsprintf_bufp, format, arg_list); + wcsprintf_bufp += nbytes; + } + + va_end(arg_list); + + return nbytes; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.h b/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.h new file mode 100644 index 0000000000000000000000000000000000000000..6ddb3ba268f9da15fd088f1876861ccb17168b3d --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsprintf.h @@ -0,0 +1,152 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsprintf.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcsprintf routines +* --------------------------------- +* Routines in this suite allow diagnostic output from celprt(), linprt(), +* prjprt(), spcprt(), tabprt(), wcsprt(), and wcserr_prt() to be redirected to +* a file or captured in a string buffer. Those routines all use wcsprintf() +* for output. Likewise wcsfprintf() is used by wcsbth() and wcspih(). Both +* functions may be used by application programmers to have other output go to +* the same place. +* +* +* wcsprintf() - Print function used by WCSLIB diagnostic routines +* --------------------------------------------------------------- +* wcsprintf() is used by celprt(), linprt(), prjprt(), spcprt(), tabprt(), +* wcsprt(), and wcserr_prt() for diagnostic output which by default goes to +* stdout. However, it may be redirected to a file or string buffer via +* wcsprintf_set(). +* +* Given: +* format char* Format string, passed to one of the printf(3) family +* of stdio library functions. +* +* ... mixed Argument list matching format, as per printf(3). +* +* Function return value: +* int Number of bytes written. +* +* +* wcsfprintf() - Print function used by WCSLIB diagnostic routines +* ---------------------------------------------------------------- +* wcsfprintf() is used by wcsbth(), and wcspih() for diagnostic output which +* they send to stderr. However, it may be redirected to a file or string +* buffer via wcsprintf_set(). +* +* Given: +* stream FILE* The output stream if not overridden by a call to +* wcsprintf_set(). +* +* format char* Format string, passed to one of the printf(3) family +* of stdio library functions. +* +* ... mixed Argument list matching format, as per printf(3). +* +* Function return value: +* int Number of bytes written. +* +* +* wcsprintf_set() - Set output disposition for wcsprintf() and wcsfprintf() +* ------------------------------------------------------------------------- +* wcsprintf_set() sets the output disposition for wcsprintf() which is used by +* the celprt(), linprt(), prjprt(), spcprt(), tabprt(), wcsprt(), and +* wcserr_prt() routines, and for wcsfprintf() which is used by wcsbth() and +* wcspih(). +* +* Given: +* wcsout FILE* Pointer to an output stream that has been opened for +* writing, e.g. by the fopen() stdio library function, +* or one of the predefined stdio output streams - stdout +* and stderr. If zero (NULL), output is written to an +* internally-allocated string buffer, the address of +* which may be obtained by wcsprintf_buf(). +* +* Function return value: +* int Status return value: +* 0: Success. +* +* +* wcsprintf_buf() - Get the address of the internal string buffer +* --------------------------------------------------------------- +* wcsprintf_buf() returns the address of the internal string buffer created +* when wcsprintf_set() is invoked with its FILE* argument set to zero. +* +* Function return value: +* const char * +* Address of the internal string buffer. The user may +* free this buffer by calling wcsprintf_set() with a +* valid FILE*, e.g. stdout. The free() stdlib library +* function must NOT be invoked on this const pointer. +* +* +* WCSPRINTF_PTR() macro - Print addresses in a consistent way +* ----------------------------------------------------------- +* WCSPRINTF_PTR() is a preprocessor macro used to print addresses in a +* consistent way. +* +* On some systems the "%p" format descriptor renders a NULL pointer as the +* string "0x0". On others, however, it produces "0" or even "(nil)". On +* some systems a non-zero address is prefixed with "0x", on others, not. +* +* The WCSPRINTF_PTR() macro ensures that a NULL pointer is always rendered as +* "0x0" and that non-zero addresses are prefixed with "0x" thus providing +* consistency, for example, for comparing the output of test programs. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSPRINTF +#define WCSLIB_WCSPRINTF + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define WCSPRINTF_PTR(str1, ptr, str2) \ + if (ptr) { \ + wcsprintf("%s%#lx%s", (str1), (unsigned long)(ptr), (str2)); \ + } else { \ + wcsprintf("%s0x0%s", (str1), (str2)); \ + } + +int wcsprintf_set(FILE *wcsout); +int wcsprintf(const char *format, ...); +int wcsfprintf(FILE *stream, const char *format, ...); +const char *wcsprintf_buf(void); + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSPRINTF */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.c b/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.c new file mode 100644 index 0000000000000000000000000000000000000000..d905e3e5d8666a9068f92d0ea1886282e5039d18 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.c @@ -0,0 +1,219 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcstrig.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include "wcsmath.h" +#include "wcstrig.h" + +double cosd(angle) + +double angle; + +{ + int i; + + if (fmod(angle,90.0) == 0.0) { + i = abs((int)floor(angle/90.0 + 0.5))%4; + switch (i) { + case 0: + return 1.0; + case 1: + return 0.0; + case 2: + return -1.0; + case 3: + return 0.0; + } + } + + return cos(angle*D2R); +} + +/*--------------------------------------------------------------------------*/ + +double sind(angle) + +double angle; + +{ + int i; + + if (fmod(angle,90.0) == 0.0) { + i = abs((int)floor(angle/90.0 - 0.5))%4; + switch (i) { + case 0: + return 1.0; + case 1: + return 0.0; + case 2: + return -1.0; + case 3: + return 0.0; + } + } + + return sin(angle*D2R); +} + +/*--------------------------------------------------------------------------*/ + +void sincosd(double angle, double *s, double *c) + +{ + int i; + + if (fmod(angle,90.0) == 0.0) { + i = abs((int)floor(angle/90.0 + 0.5))%4; + switch (i) { + case 0: + *s = 0.0; + *c = 1.0; + return; + case 1: + *s = (angle > 0.0) ? 1.0 : -1.0; + *c = 0.0; + return; + case 2: + *s = 0.0; + *c = -1.0; + return; + case 3: + *s = (angle > 0.0) ? -1.0 : 1.0; + *c = 0.0; + return; + } + } + +#ifdef HAVE_SINCOS + sincos(angle*D2R, s, c); +#else + *s = sin(angle*D2R); + *c = cos(angle*D2R); +#endif + + return; +} + +/*--------------------------------------------------------------------------*/ + +double tand(angle) + +double angle; + +{ + double resid; + + resid = fmod(angle,360.0); + if (resid == 0.0 || fabs(resid) == 180.0) { + return 0.0; + } else if (resid == 45.0 || resid == 225.0) { + return 1.0; + } else if (resid == -135.0 || resid == -315.0) { + return -1.0; + } + + return tan(angle*D2R); +} + +/*--------------------------------------------------------------------------*/ + +double acosd(v) + +double v; + +{ + if (v >= 1.0) { + if (v-1.0 < WCSTRIG_TOL) return 0.0; + } else if (v == 0.0) { + return 90.0; + } else if (v <= -1.0) { + if (v+1.0 > -WCSTRIG_TOL) return 180.0; + } + + return acos(v)*R2D; +} + +/*--------------------------------------------------------------------------*/ + +double asind(v) + +double v; + +{ + if (v <= -1.0) { + if (v+1.0 > -WCSTRIG_TOL) return -90.0; + } else if (v == 0.0) { + return 0.0; + } else if (v >= 1.0) { + if (v-1.0 < WCSTRIG_TOL) return 90.0; + } + + return asin(v)*R2D; +} + +/*--------------------------------------------------------------------------*/ + +double atand(v) + +double v; + +{ + if (v == -1.0) { + return -45.0; + } else if (v == 0.0) { + return 0.0; + } else if (v == 1.0) { + return 45.0; + } + + return atan(v)*R2D; +} + +/*--------------------------------------------------------------------------*/ + +double atan2d(y, x) + +double x, y; + +{ + if (y == 0.0) { + if (x >= 0.0) { + return 0.0; + } else if (x < 0.0) { + return 180.0; + } + } else if (x == 0.0) { + if (y > 0.0) { + return 90.0; + } else if (y < 0.0) { + return -90.0; + } + } + + return atan2(y,x)*R2D; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.h b/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.h new file mode 100644 index 0000000000000000000000000000000000000000..46a6c80e9ba896dc733943df92f61a5d780fc3f9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcstrig.h @@ -0,0 +1,217 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcstrig.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcstrig routines +* ------------------------------- +* When dealing with celestial coordinate systems and spherical projections +* (some moreso than others) it is often desirable to use an angular measure +* that provides an exact representation of the latitude of the north or south +* pole. The WCSLIB routines use the following trigonometric functions that +* take or return angles in degrees: +* +* - cosd() +* - sind() +* - tand() +* - acosd() +* - asind() +* - atand() +* - atan2d() +* - sincosd() +* +* These "trigd" routines are expected to handle angles that are a multiple of +* 90 degrees returning an exact result. Some C implementations provide these +* as part of a system library and in such cases it may (or may not!) be +* preferable to use them. WCSLIB provides wrappers on the standard trig +* functions based on radian measure, adding tests for multiples of 90 degrees. +* +* However, wcstrig.h also provides the choice of using preprocessor macro +* implementations of the trigd functions that don't test for multiples of +* 90 degrees (compile with -DWCSTRIG_MACRO). These are typically 20% faster +* but may lead to problems near the poles. +* +* +* cosd() - Cosine of an angle in degrees +* -------------------------------------- +* cosd() returns the cosine of an angle given in degrees. +* +* Given: +* angle double [deg]. +* +* Function return value: +* double Cosine of the angle. +* +* +* sind() - Sine of an angle in degrees +* ------------------------------------ +* sind() returns the sine of an angle given in degrees. +* +* Given: +* angle double [deg]. +* +* Function return value: +* double Sine of the angle. +* +* +* sincosd() - Sine and cosine of an angle in degrees +* -------------------------------------------------- +* sincosd() returns the sine and cosine of an angle given in degrees. +* +* Given: +* angle double [deg]. +* +* Returned: +* sin *double Sine of the angle. +* +* cos *double Cosine of the angle. +* +* Function return value: +* void +* +* +* tand() - Tangent of an angle in degrees +* --------------------------------------- +* tand() returns the tangent of an angle given in degrees. +* +* Given: +* angle double [deg]. +* +* Function return value: +* double Tangent of the angle. +* +* +* acosd() - Inverse cosine, returning angle in degrees +* ---------------------------------------------------- +* acosd() returns the inverse cosine in degrees. +* +* Given: +* x double in the range [-1,1]. +* +* Function return value: +* double Inverse cosine of x [deg]. +* +* +* asind() - Inverse sine, returning angle in degrees +* -------------------------------------------------- +* asind() returns the inverse sine in degrees. +* +* Given: +* y double in the range [-1,1]. +* +* Function return value: +* double Inverse sine of y [deg]. +* +* +* atand() - Inverse tangent, returning angle in degrees +* ----------------------------------------------------- +* atand() returns the inverse tangent in degrees. +* +* Given: +* s double +* +* Function return value: +* double Inverse tangent of s [deg]. +* +* +* atan2d() - Polar angle of (x,y), in degrees +* ------------------------------------------- +* atan2d() returns the polar angle, beta, in degrees, of polar coordinates +* (rho,beta) corresponding to Cartesian coordinates (x,y). It is equivalent +* to the arg(x,y) function of WCS Paper II, though with transposed arguments. +* +* Given: +* y double Cartesian y-coordinate. +* +* x double Cartesian x-coordinate. +* +* Function return value: +* double Polar angle of (x,y) [deg]. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSTRIG +#define WCSLIB_WCSTRIG + +#include + +#include "wcsconfig.h" + +#ifdef HAVE_SINCOS + void sincos(double angle, double *sin, double *cos); +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef WCSTRIG_MACRO + +/* Macro implementation of the trigd functions. */ +#include "wcsmath.h" + +#define cosd(X) cos((X)*D2R) +#define sind(X) sin((X)*D2R) +#define tand(X) tan((X)*D2R) +#define acosd(X) acos(X)*R2D +#define asind(X) asin(X)*R2D +#define atand(X) atan(X)*R2D +#define atan2d(Y,X) atan2(Y,X)*R2D +#ifdef HAVE_SINCOS + #define sincosd(X,S,C) sincos((X)*D2R,(S),(C)) +#else + #define sincosd(X,S,C) *(S) = sin((X)*D2R); *(C) = cos((X)*D2R); +#endif + +#else + +/* Use WCSLIB wrappers or native trigd functions. */ + +double cosd(double angle); +double sind(double angle); +void sincosd(double angle, double *sin, double *cos); +double tand(double angle); +double acosd(double x); +double asind(double y); +double atand(double s); +double atan2d(double y, double x); + +/* Domain tolerance for asin() and acos() functions. */ +#define WCSTRIG_TOL 1e-10 + +#endif /* WCSTRIG_MACRO */ + + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSTRIG */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsulex.l b/testbed/astropy__astropy/cextern/wcslib/C/wcsulex.l new file mode 100644 index 0000000000000000000000000000000000000000..e215098f5e09acd6210849c1e8e7199e5321dacc --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsulex.l @@ -0,0 +1,1042 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsulex.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* wcsulex.l is a Flex description file containing the definition of a +* recursive, multi-buffered lexical scanner and parser for FITS units +* specifications. +* +* It requires Flex v2.5.4 or later. +* +* Refer to wcsunits.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ + +/* Options. */ +%option full +%option never-interactive +%option noyywrap +%option outfile="wcsulex.c" +%option prefix="wcsulex" +%option reentrant + +/* Exponents. */ +INTEGER [+-]?[1-9][0-9]* +FRAC {INTEGER}"/"[1-9][0-9]* +FLOAT [+-]?([0-9]+\.?[0-9]*|\.[0-9]+) + +/* Metric prefixes. */ +SUB3 [munpfazy] +SUBPREFIX [dc]|{SUB3} +SUP3 [kMGTPEZY] +SUPPREFIX da|h|{SUP3} +PREFIX {SUBPREFIX}|{SUPPREFIX} + +/* Basic and derived SI units. */ +BASIC m|s|g|rad|sr|K|A|mol|cd +DERIVED Hz|J|W|V|N|Pa|C|[Oo]hm|S|F|Wb|T|H|lm|lx +SI_UNIT {BASIC}|{DERIVED} + +/* Additional recognized units: all metric prefixes allowed. */ +ADD_ALL eV|Jy|R|G|barn + +/* Additional recognized units: only super-metric prefixes allowed. */ +ADD_SUP a|yr|pc|bit|[bB]yte + +/* Additional recognized units: only sub-metric prefixes allowed. */ +ADD_SUB mag + +/* Additional recognized units for which NO metric prefixes are allowed. */ +GENERAL deg|arcmin|arcsec|mas|turn|min|h|d|cy|erg|Ry|u|D +ASTRO [Aa]ngstrom|AU|lyr|beam|solRad|solMass|solLum|Sun +DEVICE adu|bin|chan|count|ct|photon|ph|pixel|pix|voxel +ADD_NONE {GENERAL}|{ASTRO}|{DEVICE} + +/* All additional recognized units. */ +ADD_UNIT {ADD_ALL}|{ADD_SUP}|{ADD_SUB}|{ADD_NONE} + +/* Exclusive start states. */ +%x PAREN PREFIX UNITS EXPON FLUSH + +%{ +/* To get the prototype for fileno() from stdio.h when gcc is invoked with + * -std=c89 (same as -ansi) or -std=c99 since we do not define YY_INPUT. */ +#define _POSIX_SOURCE 1 + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsmath.h" +#include "wcsunits.h" +#include "wcsutil.h" + +static int wcsulex_scanner(const char unitstr[], int *func, double *scale, + double units[WCSUNITS_NTYPE], struct wcserr **err, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsulexe( + const char unitstr[], + int *func, + double *scale, + double units[WCSUNITS_NTYPE], + struct wcserr **err) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsulex_scanner(unitstr, func, scale, units, err, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsulex_scanner(const char unitstr[], int *func, \ + double *scale, double units[WCSUNITS_NTYPE], struct wcserr **err, \ + yyscan_t yyscanner) + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsulex_abort_jmp_env; +#define exit(status) longjmp(wcsulex_abort_jmp_env, status) + +%} + +%% + static const char *function = "wcsulexe"; + + char ctmp[72]; + int bracket = 0; + int operator = 0; + int paren = 0; + int status = 0; + int func_r, i, j; + double dexp, expon, factor, factor_r, types[WCSUNITS_NTYPE]; + YY_BUFFER_STATE buf; + void add(double *factor, double types[], double *expon, double *scale, + double units[]); + + if (err) *err = 0x0; + + *func = 0; + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] = 0.0; + types[i] = 0.0; + } + expon = 1.0; + factor = 1.0; + *scale = 1.0; + + /* Avert a flex-induced memory leak. */ + if (YY_CURRENT_BUFFER && YY_CURRENT_BUFFER->yy_input_file == stdin) { + yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); + } + + yy_scan_string(unitstr, yyscanner); + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsulex_abort_jmp_env)) { + return wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + } + + BEGIN(INITIAL); + + #ifdef DEBUG + fprintf(stderr, "\n%s ->\n", unitstr); + #endif + +^" "+ { + /* Pretend initial whitespace doesn't exist. */ + yy_set_bol(1); + } + +^"[" { + if (bracket++) { + BEGIN(FLUSH); + } else { + yy_set_bol(1); + } + } + +^10[0-9] { + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_NUM_MULTIPLIER), + "Invalid exponent in '%s'", unitstr); + BEGIN(FLUSH); + } + +^10 { + factor = 10.0; + BEGIN(EXPON); + } + +^log" "*"(" { + *func = 1; + unput('('); + BEGIN(PAREN); + } + +^ln" "*"(" { + *func = 2; + unput('('); + BEGIN(PAREN); + } + +^exp" "*"(" { + *func = 3; + unput('('); + BEGIN(PAREN); + } + +^[*.] { + /* Leading binary multiply. */ + status = wcserr_set(WCSERR_SET(UNITSERR_DANGLING_BINOP), + "Dangling binary operator in '%s'", unitstr); + BEGIN(FLUSH); + } + +" "+ /* Discard whitespace in INITIAL context. */ + +sqrt" "*"(" { + expon /= 2.0; + unput('('); + BEGIN(PAREN); + } + +"(" { + /* Gather terms in parentheses. */ + yyless(0); + BEGIN(PAREN); + } + +[*.] { + if (operator++) { + BEGIN(FLUSH); + } + } + +^1"/" | +"/" { + if (operator++) { + BEGIN(FLUSH); + } else { + expon *= -1.0; + } + } + +{SI_UNIT}|{ADD_UNIT} { + operator = 0; + yyless(0); + BEGIN(UNITS); + } + +{PREFIX}({SI_UNIT}|{ADD_ALL}) | +{SUPPREFIX}{ADD_SUP} | +{SUBPREFIX}{ADD_SUB} { + operator = 0; + yyless(0); + BEGIN(PREFIX); + } + +"]" { + bracket = !bracket; + BEGIN(FLUSH); + } + +. { + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_INITIAL_SYMBOL), + "Invalid symbol in INITIAL context in '%s'", unitstr); + BEGIN(FLUSH); + } + +"(" { + paren++; + operator = 0; + yymore(); + } + +")" { + paren--; + if (paren) { + /* Not balanced yet. */ + yymore(); + + } else { + /* Balanced; strip off the outer parentheses and recurse. */ + yytext[yyleng-1] = '\0'; + + buf = YY_CURRENT_BUFFER; + status = wcsulexe(yytext+1, &func_r, &factor_r, types, err); + yy_switch_to_buffer(buf, yyscanner); + + if (func_r) { + status = wcserr_set(WCSERR_SET(UNITSERR_FUNCTION_CONTEXT), + "Function in invalid context in '%s'", unitstr); + } + + if (status) { + BEGIN(FLUSH); + } else { + factor *= factor_r; + BEGIN(EXPON); + } + } + } + +[^()]+ { + yymore(); + } + +d { + factor = 1e-1; + BEGIN(UNITS); + } + +c { + factor = 1e-2; + BEGIN(UNITS); + } + +m { + factor = 1e-3; + BEGIN(UNITS); + } + +u { + factor = 1e-6; + BEGIN(UNITS); + } + +n { + factor = 1e-9; + BEGIN(UNITS); + } + +p { + factor = 1e-12; + BEGIN(UNITS); + } + +f { + factor = 1e-15; + BEGIN(UNITS); + } + +a { + factor = 1e-18; + BEGIN(UNITS); + } + +z { + factor = 1e-21; + BEGIN(UNITS); + } + +y { + factor = 1e-24; + BEGIN(UNITS); + } + +da { + factor = 1e+1; + BEGIN(UNITS); + } + +h { + factor = 1e+2; + BEGIN(UNITS); + } + +k { + factor = 1e+3; + BEGIN(UNITS); + } + +M { + factor = 1e+6; + BEGIN(UNITS); + } + +G { + factor = 1e+9; + BEGIN(UNITS); + } + +T { + factor = 1e+12; + BEGIN(UNITS); + } + +P { + factor = 1e+15; + BEGIN(UNITS); + } + +E { + factor = 1e+18; + BEGIN(UNITS); + } + +Z { + factor = 1e+21; + BEGIN(UNITS); + } + +Y { + factor = 1e+24; + BEGIN(UNITS); + } + +. { + /* Internal parser error. */ + status = wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + BEGIN(FLUSH); + } + +A { + /* Ampere. */ + types[WCSUNITS_CHARGE] += 1.0; + types[WCSUNITS_TIME] -= 1.0; + BEGIN(EXPON); + } + +a|yr { + /* Julian year (annum). */ + factor *= 31557600.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +adu { + /* Analogue-to-digital converter units. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + +[Aa]ngstrom { + /* Angstrom. */ + factor *= 1e-10; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +arcmin { + /* Minute of arc. */ + factor /= 60.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +arcsec { + /* Second of arc. */ + factor /= 3600.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +AU { + /* Astronomical unit. */ + factor *= 1.49598e+11; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +barn { + /* Barn. */ + factor *= 1e-28; + types[WCSUNITS_LENGTH] += 2.0; + BEGIN(EXPON); + } + +beam { + /* Beam, as in Jy/beam. */ + types[WCSUNITS_BEAM] += 1.0; + BEGIN(EXPON); + } + +bin { + /* Bin (e.g. histogram). */ + types[WCSUNITS_BIN] += 1.0; + BEGIN(EXPON); + } + +bit { + /* Bit. */ + types[WCSUNITS_BIT] += 1.0; + BEGIN(EXPON); + } + +[bB]yte { + /* Byte. */ + factor *= 8.0; + types[WCSUNITS_BIT] += 1.0; + BEGIN(EXPON); + } + +C { + /* Coulomb. */ + types[WCSUNITS_CHARGE] += 1.0; + BEGIN(EXPON); + } + +cd { + /* Candela. */ + types[WCSUNITS_LUMINTEN] += 1.0; + BEGIN(EXPON); + } + +chan { + /* Channel. */ + types[WCSUNITS_BIN] += 1.0; + BEGIN(EXPON); + } + +count|ct { + /* Count. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + +cy { + /* Julian century. */ + factor *= 3155760000.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +D { + /* Debye. */ + factor *= 1e-29 / 3.0; + types[WCSUNITS_CHARGE] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +d { + /* Day. */ + factor *= 86400.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +deg { + /* Degree. */ + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +erg { + /* Erg. */ + factor *= 1e-7; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +eV { + /* Electron volt. */ + factor *= 1.6021765e-19; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +F { + /* Farad. */ + types[WCSUNITS_MASS] -= 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] += 3.0; + types[WCSUNITS_CHARGE] += 2.0; + BEGIN(EXPON); + } + +G { + /* Gauss. */ + factor *= 1e-4; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + +g { + /* Gram. */ + factor *= 1e-3; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + +H { + /* Henry. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] += 2.0; + types[WCSUNITS_CHARGE] -= 2.0; + BEGIN(EXPON); + } + +h { + /* Hour. */ + factor *= 3600.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +Hz { + /* Hertz. */ + types[WCSUNITS_TIME] -= 1.0; + BEGIN(EXPON); + } + +J { + /* Joule. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +Jy { + /* Jansky. */ + factor *= 1e-26; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +K { + /* Kelvin. */ + types[WCSUNITS_TEMPERATURE] += 1.0; + BEGIN(EXPON); + } + +lm { + /* Lumen. */ + types[WCSUNITS_LUMINTEN] += 1.0; + types[WCSUNITS_SOLID_ANGLE] += 1.0; + BEGIN(EXPON); + } + +lx { + /* Lux. */ + types[WCSUNITS_LUMINTEN] += 1.0; + types[WCSUNITS_SOLID_ANGLE] += 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + BEGIN(EXPON); + } + +lyr { + /* Light year. */ + factor *= 2.99792458e8 * 31557600.0; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +m { + /* Metre. */ + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +mag { + /* Stellar magnitude. */ + types[WCSUNITS_MAGNITUDE] += 1.0; + BEGIN(EXPON); + } + +mas { + /* Milli-arcsec. */ + factor /= 3600e+3; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +min { + /* Minute. */ + factor *= 60.0; + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +mol { + /* Mole. */ + types[WCSUNITS_MOLE] += 1.0; + BEGIN(EXPON); + } + +N { + /* Newton. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +[Oo]hm { + /* Ohm. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 1.0; + types[WCSUNITS_CHARGE] -= 2.0; + BEGIN(EXPON); + } + +Pa { + /* Pascal. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] -= 1.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +pc { + /* Parsec. */ + factor *= 3.0857e16; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +photon|ph { + /* Photon. */ + types[WCSUNITS_COUNT] += 1.0; + BEGIN(EXPON); + } + +pixel|pix { + /* Pixel. */ + types[WCSUNITS_PIXEL] += 1.0; + BEGIN(EXPON); + } + +R { + /* Rayleigh. */ + factor *= 1e10 / (4.0 * PI); + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] -= 1.0; + types[WCSUNITS_SOLID_ANGLE] -= 1.0; + BEGIN(EXPON); + } + +rad { + /* Radian. */ + factor *= 180.0 / PI; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +Ry { + /* Rydberg. */ + factor *= 13.605692 * 1.6021765e-19; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 2.0; + BEGIN(EXPON); + } + +S { + /* Siemen. */ + types[WCSUNITS_MASS] -= 1.0; + types[WCSUNITS_LENGTH] -= 2.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] += 2.0; + BEGIN(EXPON); + } + +s { + /* Second. */ + types[WCSUNITS_TIME] += 1.0; + BEGIN(EXPON); + } + +solLum { + /* Solar luminosity. */ + factor *= 3.8268e26; + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 3.0; + BEGIN(EXPON); + } + +solMass { + /* Solar mass. */ + factor *= 1.9891e30; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + +solRad { + /* Solar radius. */ + factor *= 6.9599e8; + types[WCSUNITS_LENGTH] += 1.0; + BEGIN(EXPON); + } + +sr { + /* Steradian. */ + types[WCSUNITS_SOLID_ANGLE] += 1.0; + BEGIN(EXPON); + } + +Sun { + /* Sun (with respect to). */ + types[WCSUNITS_SOLRATIO] += 1.0; + BEGIN(EXPON); + } + +T { + /* Tesla. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + +turn { + /* Turn. */ + factor *= 360.0; + types[WCSUNITS_PLANE_ANGLE] += 1.0; + BEGIN(EXPON); + } + +u { + /* Unified atomic mass unit. */ + factor *= 1.6605387e-27; + types[WCSUNITS_MASS] += 1.0; + BEGIN(EXPON); + } + +V { + /* Volt. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 1.0; + types[WCSUNITS_TIME] -= 2.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + +voxel { + /* Voxel. */ + types[WCSUNITS_VOXEL] += 1.0; + BEGIN(EXPON); + } + +W { + /* Watt. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] -= 3.0; + BEGIN(EXPON); + } + +Wb { + /* Weber. */ + types[WCSUNITS_MASS] += 1.0; + types[WCSUNITS_LENGTH] += 2.0; + types[WCSUNITS_TIME] += 1.0; + types[WCSUNITS_CHARGE] -= 1.0; + BEGIN(EXPON); + } + +. { + /* Internal parser error. */ + status = wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error parsing '%s'", unitstr); + BEGIN(FLUSH); + } + +" "*("**"|^) { + /* Exponentiation. */ + if (operator++) { + BEGIN(FLUSH); + } + } + +" "*{INTEGER} { + sscanf(yytext, " %d", &i); + expon *= (double)i; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + +" "*"("" "*{INTEGER}" "*")" { + sscanf(yytext, " (%d)", &i); + expon *= (double)i; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + +" "*"("" "*{FRAC}" "*")" { + sscanf(yytext, " (%d/%d)", &i, &j); + expon *= (double)i / (double)j; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + +" "*"("" "*{FLOAT}" "*")" { + sscanf(yytext, " (%s)", ctmp); + wcsutil_str2double(ctmp, &dexp); + expon *= dexp; + add(&factor, types, &expon, scale, units); + operator = 0; + BEGIN(INITIAL); + } + +" "*[.*]" "* { + /* Multiply. */ + if (operator++) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + BEGIN(INITIAL); + } + } + +" "*"(" { + /* Multiply. */ + if (operator) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + unput('('); + BEGIN(INITIAL); + } + } + +" "+ { + /* Multiply. */ + if (operator) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + BEGIN(INITIAL); + } + } + +" "*"/"" "* { + /* Divide. */ + if (operator++) { + BEGIN(FLUSH); + } else { + add(&factor, types, &expon, scale, units); + expon = -1.0; + BEGIN(INITIAL); + } + } + +" "*"]" { + add(&factor, types, &expon, scale, units); + bracket = !bracket; + BEGIN(FLUSH); + } + +. { + status = wcserr_set(WCSERR_SET(UNITSERR_BAD_EXPON_SYMBOL), + "Invalid symbol in EXPON context in '%s'", unitstr); + BEGIN(FLUSH); + } + +.* { + /* Discard any remaining input. */ + } + +<> { + /* End-of-string. */ + if (YY_START == EXPON) { + add(&factor, types, &expon, scale, units); + } + + if (bracket) { + status = wcserr_set(WCSERR_SET(UNITSERR_UNBAL_BRACKET), + "Unbalanced bracket in '%s'", unitstr); + } else if (paren) { + status = wcserr_set(WCSERR_SET(UNITSERR_UNBAL_PAREN), + "Unbalanced parenthesis in '%s'", unitstr); + } else if (operator == 1) { + status = wcserr_set(WCSERR_SET(UNITSERR_DANGLING_BINOP), + "Dangling binary operator in '%s'", unitstr); + } else if (operator) { + status = wcserr_set(WCSERR_SET(UNITSERR_CONSEC_BINOPS), + "Consecutive binary operators in '%s'", unitstr); + #ifdef DEBUG + } else { + fprintf(stderr, "EOS\n"); + #endif + } + + if (status) { + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] = 0.0; + *scale = 0.0; + } + } + + return status; + } + +%% + +/*---------------------------------------------------------------------------- +* Accumulate a term in a units specification and reset work variables. +*---------------------------------------------------------------------------*/ + +void add( + double *factor, + double types[], + double *expon, + double *scale, + double units[]) + +{ + int i; + + *scale *= pow(*factor, *expon); + + for (i = 0; i < WCSUNITS_NTYPE; i++) { + units[i] += *expon * types[i]; + types[i] = 0.0; + } + + *expon = 1.0; + *factor = 1.0; + + return; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.c b/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.c new file mode 100644 index 0000000000000000000000000000000000000000..2851779dd196811c828b39c098d070f8c25b22f8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.c @@ -0,0 +1,224 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsunits.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include + +#include "wcsunits.h" + +/* Map status return value to message. */ +const char *wcsunits_errmsg[] = { + "Success", + "Invalid numeric multiplier", + "Dangling binary operator", + "Invalid symbol in INITIAL context", + "Function in invalid context", + "Invalid symbol in EXPON context", + "Unbalanced bracket", + "Unbalanced parenthesis", + "Consecutive binary operators", + "Internal parser error", + "Non-conformant unit specifications", + "Non-conformant functions", + "Potentially unsafe translation"}; + + +/* Unit types. */ +const char *wcsunits_types[] = { + "plane angle", + "solid angle", + "charge", + "mole", + "temperature", + "luminous intensity", + "mass", + "length", + "time", + "beam", + "bin", + "bit", + "count", + "stellar magnitude", + "pixel", + "solar ratio", + "voxel"}; + +const char *wcsunits_units[] = { + "degree", + "steradian", + "Coulomb", + "mole", + "Kelvin", + "candela", + "kilogram", + "metre", + "second", + "", "", "", "", "", "", "", ""}; + +const char *wcsunits_funcs[] = { + "none", + "log", + "ln", + "exp"}; + +/*--------------------------------------------------------------------------*/ + +int wcsunits( + const char have[], + const char want[], + double *scale, + double *offset, + double *power) + +{ + return wcsunitse(have, want, scale, offset, power, 0x0); +} + +/*--------------------------------------------------------------------------*/ + +int wcsunitse( + const char have[], + const char want[], + double *scale, + double *offset, + double *power, + struct wcserr **err) + +{ + static const char *function = "wcsunitse"; + + int func1, func2, i, status; + double scale1, scale2, units1[WCSUNITS_NTYPE], units2[WCSUNITS_NTYPE]; + + if ((status = wcsulexe(have, &func1, &scale1, units1, err))) { + return status; + } + + if ((status = wcsulexe(want, &func2, &scale2, units2, err))) { + return status; + } + + /* Check conformance. */ + for (i = 0; i < WCSUNITS_NTYPE; i++) { + if (units1[i] != units2[i]) { + return wcserr_set(WCSERR_SET(UNITSERR_BAD_UNIT_SPEC), + "Mismatched units type '%s': have '%s', want '%s'", + wcsunits_types[i], have, want); + } + } + + *scale = 0.0; + *offset = 0.0; + *power = 1.0; + + switch (func1) { + case 0: + /* No function. */ + if (func2) { + return wcserr_set(WCSERR_SET(UNITSERR_BAD_FUNCS), + "Mismatched unit functions: have '%s' (%s), want '%s' (%s)", + have, wcsunits_funcs[func1], want, wcsunits_funcs[func2]); + } + + *scale = scale1 / scale2; + break; + + case 1: + /* log(). */ + if (func2 == 1) { + /* log(). */ + *scale = 1.0; + *offset = log10(scale1 / scale2); + + } else if (func2 == 2) { + /* ln(). */ + *scale = log(10.0); + *offset = log(scale1 / scale2); + + } else { + return wcserr_set(WCSERR_SET(UNITSERR_BAD_FUNCS), + "Mismatched unit functions: have '%s' (%s), want '%s' (%s)", + have, wcsunits_funcs[func1], want, wcsunits_funcs[func2]); + } + + break; + + case 2: + /* ln(). */ + if (func2 == 1) { + /* log(). */ + *scale = 1.0 / log(10.0); + *offset = log(scale1 / scale2); + + } else if (func2 == 2) { + /* ln(). */ + *scale = 1.0; + *offset = log(scale1 / scale2); + + } else { + return wcserr_set(WCSERR_SET(UNITSERR_BAD_FUNCS), + "Mismatched unit functions: have '%s' (%s), want '%s' (%s)", + have, wcsunits_funcs[func1], want, wcsunits_funcs[func2]); + } + + break; + + case 3: + /* exp(). */ + if (func2 != 3) { + return wcserr_set(WCSERR_SET(UNITSERR_BAD_FUNCS), + "Mismatched unit functions: have '%s' (%s), want '%s' (%s)", + have, wcsunits_funcs[func1], want, wcsunits_funcs[func2]); + } + + *scale = 1.0; + *power = scale1 / scale2; + break; + + default: + /* Internal parser error. */ + return wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units parser error"); + } + + return 0; +} + +/*--------------------------------------------------------------------------*/ + +int wcsutrn(int ctrl, char unitstr[]) + +{ + return wcsutrne(ctrl, unitstr, 0x0); +} + +/*--------------------------------------------------------------------------*/ + +int wcsulex(const char unitstr[], int *func, double *scale, double units[]) + +{ + return wcsulexe(unitstr, func, scale, units, 0x0); +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.h b/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.h new file mode 100644 index 0000000000000000000000000000000000000000..d6f6d8bae2fd0a4904f1b1b11831a72e092e622c --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsunits.h @@ -0,0 +1,411 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsunits.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcsunits routines +* -------------------------------- +* Routines in this suite deal with units specifications and conversions, as +* described in +* += "Representations of world coordinates in FITS", += Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I) +* +* The Flexible Image Transport System (FITS), a data format widely used in +* astronomy for data interchange and archive, is described in +* += "Definition of the Flexible Image Transport System (FITS), version 3.0", += Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010, += A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362 +* +* See also http://fits.gsfc.nasa.gov +* +* These routines perform basic units-related operations: +* +* - wcsunitse(): given two unit specifications, derive the conversion from +* one to the other. +* +* - wcsutrne(): translates certain commonly used but non-standard unit +* strings. It is intended to be called before wcsulexe() which only +* handles standard FITS units specifications. +* +* - wcsulexe(): parses a standard FITS units specification of arbitrary +* complexity, deriving the conversion to canonical units. +* +* +* wcsunitse() - FITS units specification conversion +* ------------------------------------------------- +* wcsunitse() derives the conversion from one system of units to another. +* +* A deprecated form of this function, wcsunits(), lacks the wcserr** +* parameter. +* +* Given: +* have const char [] +* FITS units specification to convert from (null- +* terminated), with or without surrounding square +* brackets (for inline specifications); text following +* the closing bracket is ignored. +* +* want const char [] +* FITS units specification to convert to (null- +* terminated), with or without surrounding square +* brackets (for inline specifications); text following +* the closing bracket is ignored. +* +* Returned: +* scale, +* offset, +* power double* Convert units using +* += pow(scale*value + offset, power); +* +* Normally offset is zero except for log() or ln() +* conversions, e.g. "log(MHz)" to "ln(Hz)". Likewise, +* power is normally unity except for exp() conversions, +* e.g. "exp(ms)" to "exp(/Hz)". Thus conversions +* ordinarily consist of +* += value *= scale; +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1-9: Status return from wcsulexe(). +* 10: Non-conformant unit specifications. +* 11: Non-conformant functions. +* +* scale is zeroed on return if an error occurs. +* +* +* wcsutrne() - Translation of non-standard unit specifications +* ------------------------------------------------------------ +* wcsutrne() translates certain commonly used but non-standard unit strings, +* e.g. "DEG", "MHZ", "KELVIN", that are not recognized by wcsulexe(), refer to +* the notes below for a full list. Compounds are also recognized, e.g. +* "JY/BEAM" and "KM/SEC/SEC". Extraneous embedded blanks are removed. +* +* A deprecated form of this function, wcsutrn(), lacks the wcserr** parameter. +* +* Given: +* ctrl int Although "S" is commonly used to represent seconds, +* its translation to "s" is potentially unsafe since the +* standard recognizes "S" formally as Siemens, however +* rarely that may be used. The same applies to "H" for +* hours (Henry), and "D" for days (Debye). This +* bit-flag controls what to do in such cases: +* 1: Translate "S" to "s". +* 2: Translate "H" to "h". +* 4: Translate "D" to "d". +* Thus ctrl == 0 doesn't do any unsafe translations, +* whereas ctrl == 7 does all of them. +* +* Given and returned: +* unitstr char [] Null-terminated character array containing the units +* specification to be translated. +* +* Inline units specifications in the a FITS header +* keycomment are also handled. If the first non-blank +* character in unitstr is '[' then the unit string is +* delimited by its matching ']'. Blanks preceding '[' +* will be stripped off, but text following the closing +* bracket will be preserved without modification. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* -1: No change was made, other than stripping blanks +* (not an error). +* 0: Success. +* 9: Internal parser error. +* 12: Potentially unsafe translation, whether applied +* or not (see notes). +* +* Notes: +* Translation of non-standard unit specifications: apart from leading and +* trailing blanks, a case-sensitive match is required for the aliases listed +* below, in particular the only recognized aliases with metric prefixes are +* "KM", "KHZ", "MHZ", and "GHZ". Potentially unsafe translations of "D", +* "H", and "S", shown in parentheses, are optional. +* += Unit Recognized aliases += ---- ------------------------------------------------------------- += Angstrom angstrom += arcmin arcmins, ARCMIN, ARCMINS += arcsec arcsecs, ARCSEC, ARCSECS += beam BEAM += byte Byte += d day, days, (D), DAY, DAYS += deg degree, degrees, Deg, Degree, Degrees, DEG, DEGREE, DEGREES += GHz GHZ += h hr, (H), HR += Hz hz, HZ += kHz KHZ += Jy JY += K kelvin, kelvins, Kelvin, Kelvins, KELVIN, KELVINS += km KM += m metre, meter, metres, meters, M, METRE, METER, METRES, METERS += min MIN += MHz MHZ += Ohm ohm += Pa pascal, pascals, Pascal, Pascals, PASCAL, PASCALS += pixel pixels, PIXEL, PIXELS += rad radian, radians, RAD, RADIAN, RADIANS += s sec, second, seconds, (S), SEC, SECOND, SECONDS += V volt, volts, Volt, Volts, VOLT, VOLTS += yr year, years, YR, YEAR, YEARS +* +* The aliases "angstrom", "ohm", and "Byte" for (Angstrom, Ohm, and byte) +* are recognized by wcsulexe() itself as an unofficial extension of the +* standard, but they are converted to the standard form here. +* +* +* wcsulexe() - FITS units specification parser +* -------------------------------------------- +* wcsulexe() parses a standard FITS units specification of arbitrary +* complexity, deriving the scale factor required to convert to canonical +* units - basically SI with degrees and "dimensionless" additions such as +* byte, pixel and count. +* +* A deprecated form of this function, wcsulex(), lacks the wcserr** parameter. +* +* Given: +* unitstr const char [] +* Null-terminated character array containing the units +* specification, with or without surrounding square +* brackets (for inline specifications); text following +* the closing bracket is ignored. +* +* Returned: +* func int* Special function type, see note 4: +* 0: None +* 1: log() ...base 10 +* 2: ln() ...base e +* 3: exp() +* +* scale double* Scale factor for the unit specification; multiply a +* value expressed in the given units by this factor to +* convert it to canonical units. +* +* units double[WCSUNITS_NTYPE] +* A units specification is decomposed into powers of 16 +* fundamental unit types: angle, mass, length, time, +* count, pixel, etc. Preprocessor macro WCSUNITS_NTYPE +* is defined to dimension this vector, and others such +* WCSUNITS_PLANE_ANGLE, WCSUNITS_LENGTH, etc. to access +* its elements. +* +* Corresponding character strings, wcsunits_types[] and +* wcsunits_units[], are predefined to describe each +* quantity and its canonical units. +* +* err struct wcserr ** +* If enabled, for function return values > 1, this +* struct will contain a detailed error message, see +* wcserr_enable(). May be NULL if an error message is +* not desired. Otherwise, the user is responsible for +* deleting the memory allocated for the wcserr struct. +* +* Function return value: +* int Status return value: +* 0: Success. +* 1: Invalid numeric multiplier. +* 2: Dangling binary operator. +* 3: Invalid symbol in INITIAL context. +* 4: Function in invalid context. +* 5: Invalid symbol in EXPON context. +* 6: Unbalanced bracket. +* 7: Unbalanced parenthesis. +* 8: Consecutive binary operators. +* 9: Internal parser error. +* +* scale and units[] are zeroed on return if an error +* occurs. +* +* Notes: +* 1: wcsulexe() is permissive in accepting whitespace in all contexts in a +* units specification where it does not create ambiguity (e.g. not +* between a metric prefix and a basic unit string), including in strings +* like "log (m ** 2)" which is formally disallowed. +* +* 2: Supported extensions: +* - "angstrom" (OGIP usage) is allowed in addition to "Angstrom". +* - "ohm" (OGIP usage) is allowed in addition to "Ohm". +* - "Byte" (common usage) is allowed in addition to "byte". +* +* 3: Table 6 of WCS Paper I lists eleven units for which metric prefixes are +* allowed. However, in this implementation only prefixes greater than +* unity are allowed for "a" (annum), "yr" (year), "pc" (parsec), "bit", +* and "byte", and only prefixes less than unity are allowed for "mag" +* (stellar magnitude). +* +* Metric prefix "P" (peta) is specifically forbidden for "a" (annum) to +* avoid confusion with "Pa" (Pascal, not peta-annum). Note that metric +* prefixes are specifically disallowed for "h" (hour) and "d" (day) so +* that "ph" (photons) cannot be interpreted as pico-hours, nor "cd" +* (candela) as centi-days. +* +* 4: Function types log(), ln() and exp() may only occur at the start of the +* units specification. The scale and units[] returned for these refers +* to the string inside the function "argument", e.g. to "MHz" in log(MHz) +* for which a scale of 1e6 will be returned. +* +* +* Global variable: const char *wcsunits_errmsg[] - Status return messages +* ----------------------------------------------------------------------- +* Error messages to match the status value returned from each function. +* +* +* Global variable: const char *wcsunits_types[] - Names of physical quantities +* ---------------------------------------------------------------------------- +* Names for physical quantities to match the units vector returned by +* wcsulexe(): +* - 0: plane angle +* - 1: solid angle +* - 2: charge +* - 3: mole +* - 4: temperature +* - 5: luminous intensity +* - 6: mass +* - 7: length +* - 8: time +* - 9: beam +* - 10: bin +* - 11: bit +* - 12: count +* - 13: stellar magnitude +* - 14: pixel +* - 15: solar ratio +* - 16: voxel +* +* +* Global variable: const char *wcsunits_units[] - Names of units +* -------------------------------------------------------------- +* Names for the units (SI) to match the units vector returned by wcsulexe(): +* - 0: degree +* - 1: steradian +* - 2: Coulomb +* - 3: mole +* - 4: Kelvin +* - 5: candela +* - 6: kilogram +* - 7: metre +* - 8: second +* +* The remainder are dimensionless. +*===========================================================================*/ + +#ifndef WCSLIB_WCSUNITS +#define WCSLIB_WCSUNITS + +#include "wcserr.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +extern const char *wcsunits_errmsg[]; + +enum wcsunits_errmsg_enum { + UNITSERR_SUCCESS = 0, /* Success. */ + UNITSERR_BAD_NUM_MULTIPLIER = 1, /* Invalid numeric multiplier. */ + UNITSERR_DANGLING_BINOP = 2, /* Dangling binary operator. */ + UNITSERR_BAD_INITIAL_SYMBOL = 3, /* Invalid symbol in INITIAL + context. */ + UNITSERR_FUNCTION_CONTEXT = 4, /* Function in invalid context. */ + UNITSERR_BAD_EXPON_SYMBOL = 5, /* Invalid symbol in EXPON context. */ + UNITSERR_UNBAL_BRACKET = 6, /* Unbalanced bracket. */ + UNITSERR_UNBAL_PAREN = 7, /* Unbalanced parenthesis. */ + UNITSERR_CONSEC_BINOPS = 8, /* Consecutive binary operators. */ + UNITSERR_PARSER_ERROR = 9, /* Internal parser error. */ + UNITSERR_BAD_UNIT_SPEC = 10, /* Non-conformant unit + specifications. */ + UNITSERR_BAD_FUNCS = 11, /* Non-conformant functions. */ + UNITSERR_UNSAFE_TRANS = 12 /* Potentially unsafe translation. */ +}; + +extern const char *wcsunits_types[]; +extern const char *wcsunits_units[]; + +#define WCSUNITS_PLANE_ANGLE 0 +#define WCSUNITS_SOLID_ANGLE 1 +#define WCSUNITS_CHARGE 2 +#define WCSUNITS_MOLE 3 +#define WCSUNITS_TEMPERATURE 4 +#define WCSUNITS_LUMINTEN 5 +#define WCSUNITS_MASS 6 +#define WCSUNITS_LENGTH 7 +#define WCSUNITS_TIME 8 +#define WCSUNITS_BEAM 9 +#define WCSUNITS_BIN 10 +#define WCSUNITS_BIT 11 +#define WCSUNITS_COUNT 12 +#define WCSUNITS_MAGNITUDE 13 +#define WCSUNITS_PIXEL 14 +#define WCSUNITS_SOLRATIO 15 +#define WCSUNITS_VOXEL 16 + +#define WCSUNITS_NTYPE 17 + + +int wcsunitse(const char have[], const char want[], double *scale, + double *offset, double *power, struct wcserr **err); + +int wcsutrne(int ctrl, char unitstr[], struct wcserr **err); + +int wcsulexe(const char unitstr[], int *func, double *scale, + double units[WCSUNITS_NTYPE], struct wcserr **err); + +/* Deprecated. */ +int wcsunits(const char have[], const char want[], double *scale, + double *offset, double *power); +int wcsutrn(int ctrl, char unitstr[]); +int wcsulex(const char unitstr[], int *func, double *scale, + double units[WCSUNITS_NTYPE]); + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSUNITS */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.c b/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.c new file mode 100644 index 0000000000000000000000000000000000000000..ef237e157745282bb5a5484c51942faffee88193 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.c @@ -0,0 +1,425 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsutil.c,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*===========================================================================*/ + +#include +#include +#include +#include +#include + +#include "wcsutil.h" +#include "wcsmath.h" + +/*--------------------------------------------------------------------------*/ + +void wcsutil_blank_fill(int n, char c[]) + +{ + int k; + + for (k = strlen(c); k < n; k++) { + c[k] = ' '; + } + + return; +} + +/*--------------------------------------------------------------------------*/ + +void wcsutil_null_fill(int n, char c[]) + +{ + int j, k; + + if (n <= 0) return; + + /* Null-fill the string. */ + *(c+n-1) = '\0'; + for (j = 0; j < n; j++) { + if (c[j] == '\0') { + for (k = j+1; k < n; k++) { + c[k] = '\0'; + } + break; + } + } + + for (k = j-1; k > 0; k--) { + if (c[k] != ' ') break; + c[k] = '\0'; + } + + return; +} + +/*--------------------------------------------------------------------------*/ + +int wcsutil_allEq(int nvec, int nelem, const double *first) + +{ + double v0; + const double *vp; + + if (nvec <= 0 || nelem <= 0) return 0; + + v0 = *first; + for (vp = first+nelem; vp < first + nvec*nelem; vp += nelem) { + if (*vp != v0) return 0; + } + + return 1; +} + +/*--------------------------------------------------------------------------*/ + +int wcsutil_Eq(int nelem, double tol, const double *arr1, const double *arr2) + +{ + int i; + + if (nelem == 0) return 1; + if (nelem < 0) return 0; + + if (arr1 == 0x0 && arr2 == 0x0) return 1; + if (arr1 == 0x0 || arr2 == 0x0) return 0; + + if (tol == 0.0) { + /* Handled separately for speed of execution. */ + for (i = 0; i < nelem; i++, arr1++, arr2++) { + if (*arr1 != *arr2) return 0; + } + + } else { + for (i = 0; i < nelem; i++, arr1++, arr2++) { + /* Undefined values must match exactly. */ + if (*arr1 == UNDEFINED && *arr2 != UNDEFINED) return 0; + if (*arr1 != UNDEFINED && *arr2 == UNDEFINED) return 0; + + /* Otherwise, compare within the specified tolerance. */ + if (fabs(*arr1 - *arr2) > 0.5*tol) return 0; + } + } + + return 1; +} + +/*--------------------------------------------------------------------------*/ + +int wcsutil_intEq(int nelem, const int *arr1, const int *arr2) + +{ + int i; + + if (nelem == 0) return 1; + if (nelem < 0) return 0; + + if (arr1 == 0x0 && arr2 == 0x0) return 1; + if (arr1 == 0x0 || arr2 == 0x0) return 0; + + for (i = 0; i < nelem; i++, arr1++, arr2++) { + if (*arr1 != *arr2) return 0; + } + + return 1; +} + +/*--------------------------------------------------------------------------*/ + +int wcsutil_strEq(int nelem, char (*arr1)[72], char (*arr2)[72]) + +{ + int i; + + if (nelem == 0) return 1; + if (nelem < 0) return 0; + + if (arr1 == 0x0 && arr2 == 0x0) return 1; + if (arr1 == 0x0 || arr2 == 0x0) return 0; + + for (i = 0; i < nelem; i++, arr1++, arr2++) { + if (strncmp(*arr1, *arr2, 72)) return 0; + } + + return 1; +} + +/*--------------------------------------------------------------------------*/ + +void wcsutil_setAll(int nvec, int nelem, double *first) + +{ + double v0, *vp; + + if (nvec <= 0 || nelem <= 0) return; + + v0 = *first; + for (vp = first+nelem; vp < first + nvec*nelem; vp += nelem) { + *vp = v0; + } +} + +/*--------------------------------------------------------------------------*/ + +void wcsutil_setAli(int nvec, int nelem, int *first) + +{ + int v0, *vp; + + if (nvec <= 0 || nelem <= 0) return; + + v0 = *first; + for (vp = first+nelem; vp < first + nvec*nelem; vp += nelem) { + *vp = v0; + } +} + +/*--------------------------------------------------------------------------*/ + +void wcsutil_setBit(int nelem, const int *sel, int bits, int *array) + +{ + int *arrp; + + if (bits == 0 || nelem <= 0) return; + + if (sel == 0x0) { + /* All elements selected. */ + for (arrp = array; arrp < array + nelem; arrp++) { + *arrp |= bits; + } + + } else { + /* Some elements selected. */ + for (arrp = array; arrp < array + nelem; arrp++) { + if (*(sel++)) *arrp |= bits; + } + } +} + +/*--------------------------------------------------------------------------*/ + +char *wcsutil_fptr2str(void (*fptr)(void), char hext[19]) + +{ + unsigned char *p = (unsigned char *)(&fptr); + char *t = hext; + unsigned int i; + int *(ip[2]), j[2], le = 1, gotone = 0; + + /* Test for little-endian addresses. */ + ip[0] = j; + ip[1] = j + 1; + if ((unsigned char *)ip[0] < (unsigned char *)ip[1]) { + /* Little-endian, reverse it. */ + p += sizeof(fptr) - 1; + le = -1; + } + + sprintf(t, "0x0"); + t += 2; + + for (i = 0; i < sizeof(fptr); i++) { + /* Skip leading zeroes. */ + if (*p) gotone = 1; + + if (gotone) { + sprintf(t, "%02x", *p); + t += 2; + } + + p += le; + } + + return hext; +} + +/*--------------------------------------------------------------------------*/ + +static void wcsutil_locale_to_dot(char *buf) + +{ + struct lconv *locale_data = localeconv(); + const char *decimal_point = locale_data->decimal_point; + + if (decimal_point[0] != '.' || decimal_point[1] != 0) { + size_t decimal_point_len = strlen(decimal_point); + char *inbuf = buf; + char *outbuf = buf; + + for ( ; *inbuf; inbuf++) { + if (strncmp(inbuf, decimal_point, decimal_point_len) == 0) { + *outbuf++ = '.'; + inbuf += decimal_point_len - 1; + } else { + *outbuf++ = *inbuf; + } + } + + *outbuf = '\0'; + } +} + + +void wcsutil_double2str(char *buf, const char *format, double value) + +{ + char *bp, *cp; + + sprintf(buf, format, value); + wcsutil_locale_to_dot(buf); + + /* Look for a decimal point or exponent. */ + bp = buf; + while (*bp) { + if (*bp != ' ') { + if (*bp == '.') return; + if (*bp == 'e') return; + if (*bp == 'E') return; + } + bp++; + } + + /* Not found, add a fractional part. */ + bp = buf; + if (*bp == ' ') { + cp = buf + 1; + if (*cp == ' ') cp++; + + while (*cp) { + *bp = *cp; + bp++; + cp++; + } + + *bp = '.'; + bp++; + if (bp < cp) *bp = '0'; + } +} + +/*--------------------------------------------------------------------------*/ + +static const char *wcsutil_dot_to_locale(const char *inbuf, char *outbuf) + +{ + struct lconv *locale_data = localeconv(); + const char *decimal_point = locale_data->decimal_point; + + if (decimal_point[0] != '.' || decimal_point[1] != 0) { + char *out = outbuf; + size_t decimal_point_len = strlen(decimal_point); + + for ( ; *inbuf; inbuf++) { + if (*inbuf == '.') { + strncpy(out, decimal_point, decimal_point_len); + out += decimal_point_len; + } else { + *out++ = *inbuf; + } + } + + *out = '\0'; + + return outbuf; + } else { + return inbuf; + } +} + + +int wcsutil_str2double(const char *buf, double *value) + +{ + char ctmp[72]; + return sscanf(wcsutil_dot_to_locale(buf, ctmp), "%lf", value) < 1; +} + + +int wcsutil_str2double2(const char *buf, double *value) + +{ + char *cptr, ctmp[72], *dptr, *eptr, ltmp[72]; + int exp = 0; + + value[0] = 0.0; + value[1] = 0.0; + + /* Get the integer part. */ + if (sscanf(wcsutil_dot_to_locale(buf, ltmp), "%lf", value) < 1) { + return 1; + } + value[0] = floor(value[0]); + + strcpy(ctmp, buf); + + /* Look for a decimal point. */ + dptr = strchr(ctmp, '.'); + + /* Look for an exponent. */ + if ((eptr = strchr(ctmp, 'E')) == NULL) { + if ((eptr = strchr(ctmp, 'D')) == NULL) { + if ((eptr = strchr(ctmp, 'e')) == NULL) { + eptr = strchr(ctmp, 'd'); + } + } + } + + if (eptr) { + /* Get the exponent. */ + if (sscanf(eptr+1, "%d", &exp) < 1) { + return 1; + } + + if (!dptr) { + dptr = eptr; + eptr++; + } + + if (dptr+exp <= ctmp) { + /* There is only a fractional part. */ + return sscanf(wcsutil_dot_to_locale(buf, ctmp), "%lf", value+1) < 1; + } else if (eptr <= dptr+exp+1) { + /* There is no fractional part. */ + return 0; + } + } + + /* Get the fractional part. */ + if (dptr) { + cptr = ctmp; + while (cptr <= dptr+exp) { + if ('0' < *cptr && *cptr <= '9') *cptr = '0'; + cptr++; + } + + if (sscanf(wcsutil_dot_to_locale(ctmp, ltmp), "%lf", value+1) < 1) { + return 1; + } + } + + return 0; +} diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.h b/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.h new file mode 100644 index 0000000000000000000000000000000000000000..80630a21f033f09649dafa72763fc175665593f9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsutil.h @@ -0,0 +1,364 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsutil.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wcsutil routines +* ------------------------------- +* Simple utility functions for internal use only by WCSLIB. They are +* documented here solely as an aid to understanding the code. They are not +* intended for external use - the API may change without notice! +* +* +* wcsutil_blank_fill() - Fill a character string with blanks +* ---------------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_blank_fill() pads a character string with blanks starting with the +* terminating NULL character. +* +* Used by the Fortran wrapper functions in translating C character strings +* into Fortran CHARACTER variables. +* +* Given: +* n int Length of the character array, c[]. +* +* Given and returned: +* c char[] The character string. It will not be null-terminated +* on return. +* +* Function return value: +* void +* +* +* wcsutil_null_fill() - Fill a character string with NULLs +* -------------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_null_fill() strips off trailing blanks and pads the character array +* holding the string with NULL characters. +* +* Used mainly to make character strings intelligible in the GNU debugger which +* prints the rubbish following the terminating NULL, obscuring the valid part +* of the string. +* +* Given: +* n int Number of characters. +* +* Given and returned: +* c char[] The character string. +* +* Function return value: +* void +* +* +* wcsutil_allEq() - Test for equality of a particular vector element +* ------------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcsutil_allEq() tests for equality of a particular element in a set of +* vectors. +* +* Given: +* nvec int The number of vectors. +* +* nelem int The length of each vector. +* +* first const double* +* Pointer to the first element to test in the array. +* The elements tested for equality are +* += *first == *(first + nelem) += == *(first + nelem*2) += : += == *(first + nelem*(nvec-1)); +* +* The array might be dimensioned as +* += double v[nvec][nelem]; +* +* Function return value: +* int Status return value: +* 0: Not all equal. +* 1: All equal. +* +* +* wcsutil_Eq() - Test for equality of two double arrays +* ----------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_Eq() tests for equality of two double-precision arrays. +* +* Given: +* nelem int The number of elements in each array. +* +* tol double Tolerance for comparison of the floating-point values. +* For example, for tol == 1e-6, all floating-point +* values in the arrays must be equal to the first 6 +* decimal places. A value of 0 implies exact equality. +* +* arr1 const double* +* The first array. +* +* arr2 const double* +* The second array +* +* Function return value: +* int Status return value: +* 0: Not equal. +* 1: Equal. +* +* +* wcsutil_intEq() - Test for equality of two int arrays +* ----------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_intEq() tests for equality of two int arrays. +* +* Given: +* nelem int The number of elements in each array. +* +* arr1 const int* +* The first array. +* +* arr2 const int* +* The second array +* +* Function return value: +* int Status return value: +* 0: Not equal. +* 1: Equal. +* +* +* wcsutil_strEq() - Test for equality of two string arrays +* -------------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_strEq() tests for equality of two string arrays. +* +* Given: +* nelem int The number of elements in each array. +* +* arr1 const char** +* The first array. +* +* arr2 const char** +* The second array +* +* Function return value: +* int Status return value: +* 0: Not equal. +* 1: Equal. +* +* +* wcsutil_setAll() - Set a particular vector element +* -------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_setAll() sets the value of a particular element in a set of vectors. +* +* Given: +* nvec int The number of vectors. +* +* nelem int The length of each vector. +* +* Given and returned: +* first double* Pointer to the first element in the array, the value +* of which is used to set the others +* += *(first + nelem) = *first; += *(first + nelem*2) = *first; += : += *(first + nelem*(nvec-1)) = *first; +* +* The array might be dimensioned as +* += double v[nvec][nelem]; +* +* Function return value: +* void +* +* +* wcsutil_setAli() - Set a particular vector element +* -------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_setAli() sets the value of a particular element in a set of vectors. +* +* Given: +* nvec int The number of vectors. +* +* nelem int The length of each vector. +* +* Given and returned: +* first int* Pointer to the first element in the array, the value +* of which is used to set the others +* += *(first + nelem) = *first; += *(first + nelem*2) = *first; += : += *(first + nelem*(nvec-1)) = *first; +* +* The array might be dimensioned as +* += int v[nvec][nelem]; +* +* Function return value: +* void +* +* +* wcsutil_setBit() - Set bits in selected elements of an array +* ------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcsutil_setBit() sets bits in selected elements of an array. +* +* Given: +* nelem int Number of elements in the array. +* +* sel const int* +* Address of a selection array of length nelem. May +* be specified as the null pointer in which case all +* elements are selected. +* +* bits int Bit mask. +* +* Given and returned: +* array int* Address of the array of length nelem. +* +* Function return value: +* void +* +* +* wcsutil_fptr2str() - Translate pointer-to-function to string +* ------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcsutil_fptr2str() translates a pointer-to-function to hexadecimal string +* representation for output. It is used by the various routines that print +* the contents of WCSLIB structs, noting that it is not strictly legal to +* type-pun a function pointer to void*. See +* http://stackoverflow.com/questions/2741683/how-to-format-a-function-pointer +* +* Given: +* fptr void(*)() Pointer to function. +* +* Returned: +* hext char[19] Null-terminated string. Should be at least 19 bytes +* in size to accomodate a 64-bit address (16 bytes in +* hex), plus the leading "0x" and trailing '\0'. +* +* Function return value: +* char * The address of hext. +* +* +* wcsutil_double2str() - Translate double to string ignoring the locale +* --------------------------------------------------------------------- +* INTERNAL USE ONLY. +* +* wcsutil_double2str() converts a double to a string, but unlike sprintf() it +* ignores the locale and always uses a '.' as the decimal separator. Also, +* unless it includes an exponent, the formatted value will always have a +* fractional part, ".0" being appended if necessary. +* +* Returned: +* buf char * The buffer to write the string into. +* +* Given: +* format char * The formatting directive, such as "%f". This +* may be any of the forms accepted by sprintf(), but +* should only include a formatting directive and +* nothing else. For "%g" and "%G" formats, unless it +* includes an exponent, the formatted value will always +* have a fractional part, ".0" being appended if +* necessary. +* +* value double The value to convert to a string. +* +* +* wcsutil_str2double() - Translate string to a double, ignoring the locale +* ------------------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcsutil_str2double() converts a string to a double, but unlike sscanf() it +* ignores the locale and always expects a '.' as the decimal separator. +* +* Given: +* buf char * The string containing the value +* +* Returned: +* value double * The double value parsed from the string. +* +* +* wcsutil_str2double2() - Translate string to doubles, ignoring the locale +* ------------------------------------------------------------------------ +* INTERNAL USE ONLY. +* +* wcsutil_str2double2() converts a string to a pair of doubles containing the +* integer and fractional parts. Unlike sscanf() it ignores the locale and +* always expects a '.' as the decimal separator. +* +* Given: +* buf char * The string containing the value +* +* Returned: +* value double[2] The double value, split into integer and fractional +* parts, parsed from the string. +* +*===========================================================================*/ + +#ifndef WCSLIB_WCSUTIL +#define WCSLIB_WCSUTIL + +#ifdef __cplusplus +extern "C" { +#endif + +void wcsutil_blank_fill(int n, char c[]); +void wcsutil_null_fill (int n, char c[]); + +int wcsutil_allEq (int nvec, int nelem, const double *first); +int wcsutil_Eq(int nelem, double tol, const double *arr1, + const double *arr2); +int wcsutil_intEq(int nelem, const int *arr1, const int *arr2); +int wcsutil_strEq(int nelem, char (*arr1)[72], char (*arr2)[72]); +void wcsutil_setAll(int nvec, int nelem, double *first); +void wcsutil_setAli(int nvec, int nelem, int *first); +void wcsutil_setBit(int nelem, const int *sel, int bits, int *array); +char *wcsutil_fptr2str(void (*fptr)(void), char hext[19]); +void wcsutil_double2str(char *buf, const char *format, double value); +int wcsutil_str2double(const char *buf, double *value); +int wcsutil_str2double2(const char *buf, double *value); + +#ifdef __cplusplus +} +#endif + +#endif /* WCSLIB_WCSUTIL */ diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wcsutrn.l b/testbed/astropy__astropy/cextern/wcslib/C/wcsutrn.l new file mode 100644 index 0000000000000000000000000000000000000000..f3597e5decda6854939354ceebf658b239749c83 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wcsutrn.l @@ -0,0 +1,362 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wcsutrn.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* wcsutrn.l is a Flex description file containing the definition of a lexical +* scanner that translates non-standard FITS units specifications. +* +* It requires Flex v2.5.4 or later. +* +* Refer to wcsunits.h for a description of the user interface and operating +* notes. +* +*===========================================================================*/ + +/* Options. */ +%option full +%option never-interactive +%option noyywrap +%option outfile="wcsutrn.c" +%option prefix="wcsutrn" +%option reentrant + +/* Exclusive start states. */ +%x NEXT FLUSH + +%{ +/* To get the prototype for fileno() from stdio.h when gcc is invoked with + * -std=c89 (same as -ansi) or -std=c99 since we do not define YY_INPUT. */ +#define _POSIX_SOURCE 1 + +#include +#include +#include +#include + +#include "wcserr.h" +#include "wcsunits.h" + +static int wcsutrne_scanner(int ctrl, char unitstr[], struct wcserr **err, + yyscan_t yyscanner); + +/*--------------------------------------------------------------------------*/ + +int wcsutrne( + int ctrl, + char unitstr[], + struct wcserr **err) + +{ + int status; + yyscan_t yyscanner; + int yylex_init(yyscan_t *yyscanner); + int yylex_destroy(yyscan_t yyscanner); + + yylex_init(&yyscanner); + status = wcsutrne_scanner(ctrl, unitstr, err, yyscanner); + yylex_destroy(yyscanner); + + return status; +} + +/*--------------------------------------------------------------------------*/ + +#define YY_DECL int wcsutrne_scanner(int ctrl, char unitstr[], \ + struct wcserr **err, yyscan_t yyscanner) + +/* Used in preempting the call to exit() by yy_fatal_error(). */ +jmp_buf wcsutrn_abort_jmp_env; +#define exit(status) longjmp(wcsutrn_abort_jmp_env, status) + +%} + +%% + static const char *function = "wcsutrne"; + + char orig[80], subs[80]; + int bracket = 0; + int unsafe = 0; + int status = -1; + + if (err) *err = 0x0; + + *orig = '\0'; + *subs = '\0'; + + yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); + yy_scan_string(unitstr, yyscanner); + *unitstr = '\0'; + + /* Return here via longjmp() invoked by yy_fatal_error(). */ + if (setjmp(wcsutrn_abort_jmp_env)) { + return wcserr_set(WCSERR_SET(UNITSERR_PARSER_ERROR), + "Internal units translator error parsing '%s'", unitstr); + } + + BEGIN(INITIAL); + + #ifdef DEBUG + fprintf(stderr, "\n%s ->\n", unitstr); + #endif + +^" "*"[" { + /* Looks like a keycomment. */ + strcat(unitstr, "["); + bracket = 1; + } + +" "+ /* Discard leading whitespace. */ + +[^A-Za-z] { + /* Non-alphabetic character. */ + strcat(unitstr, yytext); + if (bracket && *yytext == ']') { + BEGIN(FLUSH); + } + } + +angstrom { + strcpy(orig, yytext); + strcpy(subs, "Angstrom"); + BEGIN(NEXT); + } + +arcmins|ARCMINS? { + strcpy(orig, yytext); + strcpy(subs, "arcmin"); + BEGIN(NEXT); + } + +arcsecs|ARCSECS? { + strcpy(orig, yytext); + strcpy(subs, "arcsec"); + BEGIN(NEXT); + } + +BEAM { + strcpy(orig, yytext); + strcpy(subs, "beam"); + BEGIN(NEXT); + } + +Byte { + strcpy(orig, yytext); + strcpy(subs, "byte"); + BEGIN(NEXT); + } + +days?|DAYS? { + strcpy(orig, yytext); + strcpy(subs, "d"); + BEGIN(NEXT); + } + +D { + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 4) ? "d" : "D"); + BEGIN(NEXT); + } + +degrees?|Deg|Degrees?|DEG|DEGREES? { + strcpy(orig, yytext); + strcpy(subs, "deg"); + BEGIN(NEXT); + } + +GHZ { + strcpy(orig, yytext); + strcpy(subs, "GHz"); + BEGIN(NEXT); + } + +hr|HR { + strcpy(orig, yytext); + strcpy(subs, "h"); + BEGIN(NEXT); + } + +H { + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 2) ? "h" : "H"); + BEGIN(NEXT); + } + +hz|HZ { + strcpy(orig, yytext); + strcpy(subs, "Hz"); + BEGIN(NEXT); + } + +KHZ { + strcpy(orig, yytext); + strcpy(subs, "kHz"); + BEGIN(NEXT); + } + +JY { + strcpy(orig, yytext); + strcpy(subs, "Jy"); + BEGIN(NEXT); + } + +[kK]elvins?|KELVINS? { + strcpy(orig, yytext); + strcpy(subs, "K"); + BEGIN(NEXT); + } + +KM { + strcpy(orig, yytext); + strcpy(subs, "km"); + BEGIN(NEXT); + } + +metres?|meters?|M|METRES?|METERS? { + strcpy(orig, yytext); + strcpy(subs, "m"); + BEGIN(NEXT); + } + +MIN { + strcpy(orig, yytext); + strcpy(subs, "min"); + BEGIN(NEXT); + } + +MHZ { + strcpy(orig, yytext); + strcpy(subs, "MHz"); + BEGIN(NEXT); + } + +Ohm { + strcpy(orig, yytext); + strcpy(subs, "ohm"); + BEGIN(NEXT); + } + +[pP]ascals?|PASCALS? { + strcpy(orig, yytext); + strcpy(subs, "Pa"); + BEGIN(NEXT); + } + +pixels|PIXELS? { + strcpy(orig, yytext); + strcpy(subs, "pixel"); + BEGIN(NEXT); + } + +radians?|RAD|RADIANS? { + strcpy(orig, yytext); + strcpy(subs, "rad"); + BEGIN(NEXT); + } + +sec|seconds?|SEC|SECONDS? { + strcpy(orig, yytext); + strcpy(subs, "s"); + BEGIN(NEXT); + } + +S { + unsafe = 1; + strcpy(orig, yytext); + strcpy(subs, (ctrl & 1) ? "s" : "S"); + BEGIN(NEXT); + } + +[vV]olts?|VOLTS? { + strcpy(orig, yytext); + strcpy(subs, "V"); + BEGIN(NEXT); + } + +years?|YR|YEARS? { + strcpy(orig, yytext); + strcpy(subs, "yr"); + BEGIN(NEXT); + } + +[A-Za-z]+ { + /* Not a recognized alias. */ + strcpy(orig, yytext); + strcpy(subs, orig); + BEGIN(NEXT); + } + +[A-Za-z]+ { + /* Reject the alias match. */ + strcat(orig, yytext); + strcpy(subs, orig); + } + +" "+[^A-Za-z] { + /* Discard separating whitespace. */ + unput(yytext[yyleng-1]); + } + +" "+[A-Za-z] { + /* Compress separating whitespace. */ + strcat(unitstr, subs); + strcat(unitstr, " "); + if (strcmp(orig, subs)) status = 0; + unput(yytext[yyleng-1]); + *subs = '\0'; + BEGIN(INITIAL); + } + +. { + /* Copy anything else unchanged. */ + strcat(unitstr, subs); + if (strcmp(orig, subs)) status = 0; + unput(*yytext); + *subs = '\0'; + BEGIN(INITIAL); + } + +.* { + /* Copy out remaining input. */ + strcat(unitstr, yytext); + } + +<> { + /* End-of-string. */ + if (*subs) { + strcat(unitstr, subs); + if (strcmp(orig, subs)) status = 0; + } + + if (unsafe) { + return wcserr_set(WCSERR_SET(UNITSERR_UNSAFE_TRANS), + "Unsafe unit translation in '%s'", unitstr); + } + return status; + } + +%% diff --git a/testbed/astropy__astropy/cextern/wcslib/C/wtbarr.h b/testbed/astropy__astropy/cextern/wcslib/C/wtbarr.h new file mode 100644 index 0000000000000000000000000000000000000000..357ff429f51fc7683a92047dc1d06aa378f06572 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/C/wtbarr.h @@ -0,0 +1,123 @@ +/*============================================================================ + + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: wtbarr.h,v 6.2 2018/10/20 10:03:13 mcalabre Exp $ +*============================================================================= +* +* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System +* (WCS) standard. Refer to the README file provided with WCSLIB for an +* overview of the library. +* +* +* Summary of the wtbarr struct +* ---------------------------- +* The wtbarr struct is used by wcstab() in extracting coordinate lookup tables +* from a binary table extension (BINTABLE) and copying them into the tabprm +* structs stored in wcsprm. +* +* +* wtbarr struct - Extraction of coordinate lookup tables from BINTABLE +* -------------------------------------------------------------------- +* Function wcstab(), which is invoked automatically by wcspih(), sets up an +* array of wtbarr structs to assist in extracting coordinate lookup tables +* from a binary table extension (BINTABLE) and copying them into the tabprm +* structs stored in wcsprm. Refer to the usage notes for wcspih() and +* wcstab() in wcshdr.h, and also the prologue to tab.h. +* +* For C++ usage, because of a name space conflict with the wtbarr typedef +* defined in CFITSIO header fitsio.h, the wtbarr struct is renamed to wtbarr_s +* by preprocessor macro substitution with scope limited to wtbarr.h itself, +* and similarly in wcs.h. +* +* int i +* (Given) Image axis number. +* +* int m +* (Given) wcstab array axis number for index vectors. +* +* int kind +* (Given) Character identifying the wcstab array type: +* - c: coordinate array, +* - i: index vector. +* +* char extnam[72] +* (Given) EXTNAME identifying the binary table extension. +* +* int extver +* (Given) EXTVER identifying the binary table extension. +* +* int extlev +* (Given) EXTLEV identifying the binary table extension. +* +* char ttype[72] +* (Given) TTYPEn identifying the column of the binary table that contains +* the wcstab array. +* +* long row +* (Given) Table row number. +* +* int ndim +* (Given) Expected dimensionality of the wcstab array. +* +* int *dimlen +* (Given) Address of the first element of an array of int of length ndim +* into which the wcstab array axis lengths are to be written. +* +* double **arrayp +* (Given) Pointer to an array of double which is to be allocated by the +* user and into which the wcstab array is to be written. +* +*===========================================================================*/ + +#ifndef WCSLIB_WTBARR +#define WCSLIB_WTBARR + +#ifdef __cplusplus +extern "C" { +#define wtbarr wtbarr_s /* See prologue above. */ +#endif + /* For extracting wcstab arrays. Matches */ + /* the wtbarr typedef defined in CFITSIO */ + /* header fitsio.h. */ +struct wtbarr { + int i; /* Image axis number. */ + int m; /* Array axis number for index vectors. */ + int kind; /* wcstab array type. */ + char extnam[72]; /* EXTNAME of binary table extension. */ + int extver; /* EXTVER of binary table extension. */ + int extlev; /* EXTLEV of binary table extension. */ + char ttype[72]; /* TTYPEn of column containing the array. */ + long row; /* Table row number. */ + int ndim; /* Expected wcstab array dimensionality. */ + int *dimlen; /* Where to write the array axis lengths. */ + double **arrayp; /* Where to write the address of the array */ + /* allocated to store the wcstab array. */ +}; + +#ifdef __cplusplus +#undef wtbarr +} +#endif + +#endif /* WCSLIB_WTBARR */ diff --git a/testbed/astropy__astropy/cextern/wcslib/CHANGES b/testbed/astropy__astropy/cextern/wcslib/CHANGES new file mode 100644 index 0000000000000000000000000000000000000000..a5c52087dda6821b72502c964eb107a68e0b5cf9 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/CHANGES @@ -0,0 +1,2812 @@ +WCSLIB version 6.2 (2018/10/20) +------------------------------- + +* C library + + - Consequent on the change in release 6.1, reapplied soothing balm to + the wtbarr struct definition in wcs.h for C++ compilation (C and + Fortran compilation being unaffected). While the object libraries + themselves are unchanged, the modified wcs.h must be installed for + compiling C++ applications. Reported by Corentin Schreiber. + +* User manual + + - Fixed minor formatting problems with the doxygen manual generation. + + +WCSLIB version 6.1 (2018/10/19) +------------------------------- + +* C library + + - Added support for time-related WCS keywords (Paper VII) by expanding + the wcsprm struct to store them as auxiliary values, now filled by + the header parsers, wcspih() and wcsbth() and handled routinely by + wcsinit(), wcssub(), wcscompare(), wcsfree(), wcsprt(), wcsset(), + and wcshdo(). + + - Augmented datfix() to do various consistency checks on the new + time-related keyvalues, and added a new routine, obsfix(), to check + consistency of the OBSGEO-[XYZLBH] observatory coordinates. + + - In the usage notes for wcsbth(), clarified that, according to WCS + Papers III and VII, certain global image header keywords are + permitted in binary table headers and are expected to be inherited + by image arrays and pixel lists, and elaborated on the difficulties + that such inheritance may cause for pixel lists. + + - Revamped message string handling in the wcserr module to allow + arbitrarily long messages while greatly reducing the sizeof the + struct. + + - Extracted the definition of the wtbarr struct from wcs.h to a + separate header file, wtbarr.h, in order to reduce the number of + irrelevant warnings generated by 'gcc -Wpadded' (primarily for + code development). Applications code that needs to access members + of the struct (unlikely) must now include wtbarr.h (or wcslib.h). + + - The WCSLIB major version number was incremented as changes to the + wcsprm struct makes the ABI of the sharable library incompatible + with executables linked with that of older releases. + +* Installation + + - Several changes to configure and the makefiles aimed at facilitating + code development. + +* Fortran wrappers + + - Match changes to the C library, including adding a wrapper for + obsfix(). + + +WCSLIB version 5.20 (2018/10/05) +-------------------------------- + +* C library + + - Added utility functions dpkeyi() and dpkeyd() to dis.c, and removed + the corresponding functions from wcsutil.c. + +* Installation + + - Reworked the makefiles to allow parallel library builds, as required + by some software distributions. Reported by Dustin Lang with + suggested patch, and Zaak Beekman. (Parallel execution of the test + suite is not supported.) + + - The introduction of "deterministic" archiving (ar(1)) broke + dependency analysis in the WCSLIB makefiles on the many systems + where it is now enabled by default (i.e. binutils configured with + --enable-deterministic-archives). + + Modified configure to force non-deterministic archiving during the + library builds, thus repairing the dependency analysis. However, + the static object libraries are now reconstructed using + deterministic archiving in the process of installing them. + + - Fixed problems with the dependency analysis, solely affecting code + development. + +* Fortran wrappers + + - New wrappers for dpkeyi() and dpkeyd(). + + +WCSLIB version 5.19.1 (2018/07/28) +---------------------------------- + +* Installation + + - Updated ./config/config.{guess,sub} to the latest versions from the + GIT repository, timestamped 2018-07-18 and 2018-07-25, respectively. + The previous pair were dated 2012-02-10 and 2012-04-18. + + +WCSLIB version 5.19 (2018/07/27) +-------------------------------- + +* C library + + - In wcssub(), fixed a bug in handling distortion functions on axes + with changed axis number in the subimage (i.e. via deletion or + addition of an axis). + + - In various routines within dis.c, wcs.c, wcshdr.c, and wcspih.l, + increased the size of various sprintf() output buffers to avert + -Wformat-overflow warnings from gcc 8.1.0 (with -DFORTIFY_SOURCE=2). + Reported by Simon Conseil. + + Also fixed other warnings in these routines from gcc 8.1.0 + relating to -Wcast-function-type, -Wmaybe-uninitialized, and + -Wunused-parameter. + + - In wcsutrn.l (the units alias translator used by wcsfix), recognise + 'Deg', 'Degree', and 'Degrees' as aliases for 'deg'. Rogue header + reported by Jim Lewis. + + - Added a note to the prologue of spx.h explaining WCSLIB's use of + Cox's air-to-vacuum transformation equation rather than the IUGG + relation cited in WCS Paper III. Noted by Benjamin Alan Weaver. + + - In the test suite, avert nuisance compiler warnings in tdis1. + Made tsphdpa more robust in handling user coordinate input. + +* PGSBOX + + - In pgwcsl_(), avert nuisance warnings from gcc 8.1.0 relating to + unused parameters (-Wunused-parameter). Also averted nuisance + compiler warnings in cpgtest. + +* Utilities + + - wcsware was not reading the -TAB table from the FITS file for + alternate descriptions, bug reported by Chiara Marmo. Nor was + wcsfix() ever invoked for them. + + Made it more robust in handling user input of coordinates for the + -x and -w options. + + - Fixed compiler warnings from gcc 8.1.0 in HPXcvt + (-Wmaybe-uninitialized), and wcsgrid (-Wformat-overflow). + +* Installation + + - Amended configure.ac to allow cross-compilation, and also updated + the auxiliary configure scripts in the config/ directory. Patch + supplied by Mos Giordano. + + +WCSLIB version 5.18 (2018/01/10) +-------------------------------- + +* C library + + - New routines introduced to preclude altering the global variables + NPVMAX, NPSMAX, and NDPMAX, which determine how much memory to + allocate for storing PVi_ma, PSi_ma, DPja, and DQia keyvalues: + wcsinit(), lininit(), lindist(), and disinit(). These are now used + by various WCSLIB routines, such as the header parsers, which + previously temporarily altered the global variables, thus posing a + thread hazard. Testing and feedback on thread-safety issues, with + patches, from Rodrigo Tobar Carrizo. + + - The Flex scanners, fitshdr(), wcsbth(), wcspih(), wcsulexe(), and + wcsutrne(), have been rewritten as thin wrappers (with the same API) + over scanners that were modified (with changed API) as required to + use Flex's "reentrant" option. Consequently, they are now reentrant + and should be thread-safe. That also passes through to the + deprecated wrappers, wcsulex() and wcsutrn(). + + - Fixed memory leaks in lindist() and lincpy() uncovered by valgrind. + + - Test programs tfitshdr, tpih1, tpih2, and ttab3 are now careful to + free all allocated memory before exit to defeat spurious reports of + memory leaks by valgrind. + +* Fortran wrappers + + - New wrappers for wcsinit(), lininit(), lindist(), and disinit(). + +* Installation + + - configure now recognises the value of ARFLAGS obtained from the + environment. + +* User manual + + - Updates and amendments in line with the above changes. + + - Documentation generation moved to doxygen 1.8.14 (was 1.8.13). + + +WCSLIB version 5.17 (2017/09/18) +-------------------------------- + +* C library + + - Fixed a memory leak in wcspih(). Reported by Pim Schellart. + + - Fixed compiler warnings about comparison between signed and unsigned + integers in tab.c (Pey-Lian Lim). Also fixed warnings in other + functions about unused parameters. + +* Fortran wrappers + + - Fixed compiler warnings about comparison between signed and unsigned + integers in several routines. + +* PGSBOX + + - Fixed a compiler warning about comparison between signed and + unsigned ints. + +* Installation + + - Removed setgid permission on installation directories (for Fedora + Linux, reported by Sergio Pascual). + +* User manual + + - Minor updates and amendments. + + - Documentation generation moved to doxygen 1.8.13 (was 1.8.10). + + +WCSLIB version 5.16 (2017/01/15) +-------------------------------- + +* C library + + - Bug fix in spcfix() for the previous change. Reported separately by + Julian Taylor & Peter Williams. + + +WCSLIB version 5.15 (2016/04/05) +-------------------------------- + +* C library + + - Bug fix in wcsulex.l for the previous change. Reported, and fix + supplied by Tammo Jan Dijkema. + + - In spcfix(), report the value of VELREF if ctype is translated from + the AIPS convention. + + +WCSLIB version 5.14 (2016/02/07) +-------------------------------- + +* C library + + - In wcsulex.l and wcsutrn.l, applied a workaround for a memory leak + introduced by a change (bug) in flex in Aug/2012. Reported, and + fix supplied by Thomas Robitaille and Erik Bray. + +* Installation + + - In MacOSX, create symlink libwcs.dylib pointing to the dynamic + library so that WCSLIB is linked dynamically by default. Requested + by Paul Price. + + +WCSLIB version 5.13 (2016/01/26) +-------------------------------- + +* C library + + - In wcshdo(), provide floating-point format control via the 'ctrl' + argument (formerly 'relax'). + + - In wcspih(), PLATEID by itself is no longer sufficient to trigger a + DSS translation (reported by James Allen). + + - In unitfix(), ensure that the message buffer cannot be overrun, e.g. + by blank-padded unit strings (reported by Vishal Kasliwal). + + +WCSLIB version 5.12 (2015/11/15) +-------------------------------- + +* C library + + - Bug fix in wcshdo() for CRVALia precision reported by Mihai Cara. + + +WCSLIB version 5.11 (2015/10/18) +-------------------------------- + +* C library + + - Bug fixes in wcspih.l and dis.c for WAT distortions provided by + Ole Streicher. + + +WCSLIB version 5.10 (2015/10/09) +-------------------------------- + +* C library + + - In wcshdo(), allow output of floating point keyvalues to 15 + significant digits (was 14), mainly for astropy. + + - In wcspih(), allow unrecognised WAT projection types (tan, etc.) to + pass without returning an error. Reported by Michael Droettboom. + Also fixed a bug triggered by SIP keywords in unconventional order, + reported by Colin Slater, LSST. + + +WCSLIB version 5.9 (2015/07/21) +------------------------------- + +* C library + + - In disx2p(), make proper allowance for the possibility that the TPD + and SIP forward and inverse distortion polynomials may not be of the + same degree, reported by Martin Kuemmel. + + - Fix-ups in wcshdo() reported by Michael Droettboom, and several + tidy-ups as well. + + +WCSLIB version 5.8 (2015/07/08) +------------------------------- + +* C library + + - DSS (Digitized Sky Survey) coordinates are now handled via TPD, as + are the TNX and ZPX "projections". New test script tdis3 and + headers DSS.keyrec, TNX.keyrec, and ZPX.keyrec. + + - New function dishdo() can be used to set a flag that causes + wcshdo() to write headers in the form of the distortion function + used internally (usually TPD). + + - Added the capability, via DPja.DOCORR, for a distortion function to + to compute an additive correction to the undistorted coordinates + (rather than computing the distorted coordinates themselves). + + - Added auxiliary variables to TPD via DPja.AUX.jhat.COEFF.m. + + - Bug fix in wcshdo() for TPV, diagnosed by Michael Droettboom. + +* Fortran wrappers + + - Wrapper for dishdo(). + + +WCSLIB version 5.7 (2015/06/29) +------------------------------- + +* C library + + - Extended wcssub() to handle distortions (and thus wcscopy() also). + This required axis mapping to be enabled for SIP distortions within + WCSLIB. + + - wcshdo() now handles all distortions currently supported by WCSLIB: + SIP, TPV, TPD, and Polynomial. + + - Bug fixes in sphx2s() and sphs2x() for non-unit vector strides for + special-case rotations. + + - In wcsset(), modify wcsprm::ctype after translating TPV so that + subsequent calls won't try to re-translate it, the PVi_ma records + by then having been erased. Reported by Michael Droettboom. Also, + restore NDPMAX after translating TPV. + + - Bug fixes in discpy(), disprt(), disset(), and disx2p(). + + - Added disperr(), prjperr(), spcperr(), spxperr(), and tabperr() to + complete the set and make reporting errors slightly more convenient. + +* Utilities + + - wcsware has a new option, -o, to print the wcsprm struct in the form + of a FITS header using wcshdo(). Also, the -a option has been + extended to allow a 0-relative numeric index for selecting an + alternate WCS, where the alternates are sequenced alphabetically + (without gaps) following the primary representation. + +* User manual + + - Documentation generation moved to doxygen 1.8.10 (was 1.8.9.1). + + +WCSLIB version 5.6 (2015/06/14) +------------------------------- + +* C library + + - Bug fixes in wcspih() and sipset() to account for the fact that the + independent variables of the SIP polynomial are pixel coordinate + offsets from CRPIXja, not pixel coordinates per se. Diagnosed by + Michael Droettboom. + + Validated SIP and TPV handling by comparing the output of + 'wcsware -x' with that of wcstools 'xy2sky -d -n6' using astropy's + SIP test headers, and separate SIP and TPV headers originating from + the Palomar Transient Factory provided by David Shupe. + + Changed SIP.keyrec so that CRPIX1 and CRPIX2 differ in value, + thereby making tests sensitive to any confusion between the two. + + +WCSLIB version 5.5 (2015/05/05) +------------------------------- + +* C library + + - Bug fixes in wcspih.l for headers with multiple distortions, and for + distortion parameter look-alike keywords. + + - Bug fix in sipset() uncovered by valgrind. + + +WCSLIB version 5.4.1 (2015/05/01) +--------------------------------- + +* C library + + - Added a fairly lengthy section to the prologue of dis.h describing + the Paper IV keywords and the distortion functions currently + implemented. + +* User manual + + - Added a new section on WCSLIB version numbers. + + +WCSLIB version 5.4 (2015/04/21) +------------------------------- + +* C library + + - Further work on distortions: wcspih() now parses Paper IV distortion + keywords (CPDISja, CQDISia, DPja, DQia, etc.), thus handling record- + valued keywords. SIP keywords are also parsed and translated into + Paper IV keywords. + + - TPV, SIP, and whereever possible, the general Polynomial distortion + function of Paper IV are now implemented by the Template Polynomial + Distortion (TPD), that being a superset of TPV and SIP. TPD, which + can also handle 1D distortions and be used for inversions, is also + supported as a separate distortion type defined by Paper IV + keywords. TPD efficiently handles 1D distortions and distortions + without radial terms. + + - Specialized inverse distortions, such as defined by SIP, are + implemented by TPD and recognized by disx2p(), which uses them to + compute the initial approximation of its more precise iterative + solution. + + - Generalized tdis1.c so that it can do closure tests for SIP headers, + and added a SIP test header. + + +WCSLIB version 5.3.1 (2015/04/21) +--------------------------------- + +* C library + + - Bug fix in test program tdis1.c reported by Martin Kuemmel. + + +WCSLIB version 5.3 (2015/04/21) +------------------------------- + +First public release of WCSLIB 5.x with distortions capability. + +* C library + + - Changed disprm::dtype from char[16] to char[72] for reasons relating + to header parsing. + + - More armour plating for disset() and friends. They also use new + utility functions wcsutil_dpkey_int() and wcsutil_dpkey_double() to + extract numeric values from a dpkey struct. This ensures their + independence of the data type, the appropriate reporting of dpkey + values by disprt(), and (eventually) the appropriate writing of DPja + and DQia keyvalues by wcshdo(). + + - Augmented the usage comments for dpfill() to explain how numeric + values in a dpkey struct are handled. + +* Utilities + + - wcsware now uses wcserr to provide a backtrace on errors. Also + fixed a couple of minor annoyances relating to alternate + representations. + + +WCSLIB version 5.2 beta release (2015/04/15) +-------------------------------------------- + +* C library + + - Further development of disprm and related functions to implement + the FITS keywords for distortions introduced in WCS Paper IV, thus + changing disprm's ABI once again. + + disprm's model is now similar to wcsprm's handling of PVi_ma and + PSi_ma, where the parsed keyrecords are loaded into a set of pvcard + and pscard structs and wcsset() does the analysis. For disprm, the + parsed DPja or DQia keyrecords are loaded into a set of dpkey + structs for disset() to analyse. + + - New function dpfill() aids in filling a dpkey struct. Function + disparms() has been removed. It was no longer needed as + disprm::parms[][] is now a "returned" member of the struct. + + - Implementation of the general Polynomial distortion function defined + in Sect. 3.1 of WCS Paper IV. The polynomial is defined in terms of + Paper IV keywords. + + - Bug fixes in diswarp() and linwarp() reported by + Michael Droettboom. + + - Test program tdis1 now tests a TPV header for closure in two ways: + directly as a specialist TPV distortion (as before), then by + translating it into a general polynomial distortion. It then also + tests that the TPV and polynomial distortions produce the same + results. + +* Fortran wrappers + + - Changes to the wrappers reflecting changes to disprm. + + - Bug fixes in fitshdr_f.c, and test programs tdis1.f, tfitshdr.f, + twcsfix.f, and twcs.f. All reported and/or fixed by Ole Streicher. + + +WCSLIB version 5.1 beta release (2015/04/07) +-------------------------------------------- + +* C library + + - Distortions-related bug fixes to linset(), linp2x(), and linx2p(). + + - New functions diswarp() and linwarp() compute statistics of the + distortion functions over a specified domain. Changed tdis1.c to + test them. + + - Changes to disprm (so changed ABI). + +* Fortran wrappers + + - Wrappers for diswarp() and linwarp(). + + +WCSLIB version 5.0 beta release (2015/04/05) +-------------------------------------------- + +* C library + + - Implemented the framework of WCS Paper IV (the draft distortions + proposal) based on a new struct, disprm, and suite of routines with + header dis.h: disini(), disalloc(), discpy(), disfree(), disprt(), + disset(), disp2x(), and disx2p(). New test program tdis1. + + Consequent changes to the linprm struct have altered its ABI, thus + necessitating an increment in the WCSLIB major verion number. + + - wcsset() now recognises the "TPV" projection proposed in an early + draft of WCS Paper II, and translates it into a disprm distortion - + by request of Octavi Fors. Additionally, it recognises "TPU" as + equivalent to "TPV" but using a prior distortion (coming before the + linear transformation matrix) rather than sequent (coming after it). + + - In wcspih() and wcsbth(), added relaxation flags to allow PC0i_0ja, + PV0j_0ma, and PS0j_0ma (i.e. with leading zeroes on the index). + + - Added wcslib_version() to return the WCSLIB version number, as + suggested by Ole Streicher. + + - Fixed problems uncovered by valgrind in prjbchk() (reported by + Ger van Diepen), sphx2s(), sphx2s(), spcspxe(), spcxpse(), tabini(), + and wcshdo_util(). + + - Tidied up error reporting, particularly relating to translating + status returns from lower-level functions. New functions linperr() + and celperr() report error messages from the structs they contain + in addition to their own. + + - Changed output formatting of floating point values in linprt(), + celprt(), prjprt(), spcprt(), tabprt(), and wcsprt(). Updated the + test output reference files for tbth1, tpih1, twcsfix, twcssub, and + twcstab to suit. + + - Tidied up several of the test programs, mostly to free memory + explicitly before exit so that valgrind doesn't report (non-)leaks. + +* Fortran wrappers + + - Wrappers for the new distortion functions. New test programs + tdis1.f and tdis2.f. + + - Updates following changes to wcspih() and wcsbth(). + + - Added wrappers for linperr() and celperr(). Also added prjperr_(), + spcperr_(), and tabperr_() as convenient wrappers on wcserr_prt(). + + - Wrapper for wcslib_version(). + +* Utilities + + - Added a "lint" function to wcsware to check a FITS header for + conformance to the WCS standard. New test program twcslint. + +* PGSBOX + + - In PGCRLB, fixed an incorrect use of the MOD intrinsic reported by + 'gfortran -std=f95' via Jean-Baptiste Marquette. + + +WCSLIB version 4.25.1 (2015/01/05) +---------------------------------- + +* C library + + - Updated the test output reference files for tpih1, tbth1, twcsfix, + and twcstab to account for the change to wcsset() in release 4.25. + +* Fortran wrappers + + - Updated the test output reference files for tpih1, twcsfix, and + twcstab to account for the change to wcsset() in release 4.25. + +* User manual + + - Documentation generation moved to doxygen 1.8.9.1 (was 1.8.8). + + +WCSLIB version 4.25 (2014/12/15) +---------------------------------- + +* C library + + - wcsset() now supplies default values for the auxiliary keywords + EQUINOXa and RADESYSa if not present in the FITS header. + + +WCSLIB version 4.24 (2014/09/19) +---------------------------------- + +* C library + + - Changed API to wcscompare() to allow a tolerance to be specified for + floating-point comparisons. Contributed by Michael Droettboom. + +* Fortran wrappers + + Track the change to wcscompare(). + +* User manual + + - Documentation generation moved to doxygen 1.8.8 (was 1.8.4). + + - Added mention of WCSLIB in "homebrew-science" (MacOSX) in the + section on other packages. + + +WCSLIB version 4.23 (2014/05/11) +-------------------------------- + +* C library + + - New function wcscompare() compares two wcsprm structs for equality + with varying degrees of strictness. Test program twcscompare. + Contributed by Michael Droettboom. + + - In wcssub(), fixed a bug uncovered by valgrind arising from + allocation of insufficient memory for temporaries when a new axis + is added. Reported by Michael Droettboom. + + - In wcshdo(), don't write RESTFRQ or RESTWAV if zero. + + Also, to distinguish them from integer keyvalues, floating- + point values will now always be written with an exponent or + fractional part, ".0" being appended if necessary to achieve this. + Suggested by Peter Weilbacher. + + - Fixed the '-h' option in twcshdr. + +* Fortran wrappers + + - Wrapper for wcscompare(). + + +WCSLIB version 4.22 (2014/04/13) +-------------------------------- + +* C library + + - In pcox2s() and pcos2x(), use alternative projection equations for + greater numerical precision near theta == 0. In cops2x(), return + an exact result for theta at the poles. Relaxed the tolerance for + bounds checking a little in sflx2s(). + + +WCSLIB version 4.21 (2014/03/24) +-------------------------------- + +* C library + + - New function prjbchk() performs bounds checking on native spherical + coordinates. It is invoked automatically by the deprojection (x2s) + routines if prjprm::bounds&4 is set. Documented the new bounds + checking implemented by prjbchk() in the prologue entry for + wcsbchk(). Improvements to tprj1 to test the vector API of prjx2s() + and to deal better with out-of-bounds native coordinates returned by + it. + + - Bug fixes in the projection routines: in hpxx2s() relating to bounds + checking, bug introduced at 4.20, reported by Michael Droettboom; in + parx2s() and molx2s() relating to setting the stat vector; in + hpxx2s() relating to implementation of the vector API; and in + xphx2s() relating to setting an out-of-bounds value of phi. + +* Fortran wrappers + + - Wrapper for prjbchk(). Modified tprj1.f to track changes to the C + version. + + +WCSLIB version 4.20 (2013/12/18) +-------------------------------- + +* C library + + - New function, wcsbchk(), for controlling bounds checking in the + projection routines. + + - Enable bounds checking in the pixel-to-sky (x2s) direction for HPX + and XPH if prjprm::bounds&2. Tightened bounds checking in xphx2s(). + prjini() now sets prjprm::bounds = 3 to enable all bounds checking + by default. + + - Fixed an incorrect error message in wcs_units(). Also report + potentially unsafe units translations in unitfix() - both + contributed by Michael Droettboom. + +* Fortran wrappers + + - Wrapper for wcsbchk(). + +* PGSBOX + + - Fixed a few nuisance warnings from gfortran 4.7.2 relating to + implicit type conversions in pgsbox.f. + +* User manual + + - Added mention of wcsjs (Javascript) in the section on other + packages. + + +WCSLIB version 4.19 (2013/09/30) +-------------------------------- + +* C library + + - Bug fix in wcshdo(), uncovered by cppcheck and reported by David + Binderman. Fixed additional minor inconsistencies in hpxx2s(), + wcsprintf(), and wcsfprintf() reported by cppcheck. + + - Minor fix to twcstab reported by cppcheck. + + - Bug fix in wcssub() for handling (non-standard) PROJPn keywords + (uncovered by valgrind, reported by Paul Price). + + +WCSLIB version 4.18 (2013/07/13) +-------------------------------- + +* C library + + - Implemented the butterfly projection (XPH), being the polar form of + the HEALPix projection with (H,K) = (4,3). Augmented tprj1.c and + tprj2.c to suit. + + - Bug fix in celfix() when translating GLS to SFL with non-zero + reference point. + +* Fortran wrappers + + - Wrappers for the XPH projection functions and corresponding + modifications to the test programs. + + - Fixed a few inconsequential warnings from gfortran 4.7.2 relating + to implicit type conversions in the test programs. + +* Utilities + + - In HPXcvt, fixed incorrect axis scaling (CDELT1 and CDELT2) in the + XPH header, and set the PCi_ja matrix in the HPX header to a pure + 45 degree rotation with appropriate adjustment of CDELT1 and CDELT2 + (matching XPH). Also set LONPOLE to 180 degree in the XPH header + with adjustment of CRVAL1 as recommended in the errata. These + changes prompted by Paddy Leahy. Also, modified the FITS header + comment for XPH - it is no longer "experimental", and accept the + '-x' option (i.e. without qualification) as equivalent to '-xn'. + +* User manual + + - Documentation generation moved to doxygen 1.8.4 (was 1.5.6). + + +WCSLIB version 4.17 (2013/01/29) +-------------------------------- + +* C library + + - Added wcsfprintf() to wcsprint.h. Now used in wcsbth() and wcspih() + to allow diagnostic output to be redirected. Changes provided by + Michael Droettboom. + + +WCSLIB version 4.16 (2012/11/07) +-------------------------------- + +* C library + + - When wcspih() constructs a default coordinate representation it will + give it the special name "DEFAULTS", and will not report "Found one + coordinate representation" (if reporting is enabled). + +* Utilities + + - wcsware has a new option, -P, which does the same as -p except that + it won't print a wcsprm struct with the name "DEFAULTS". + + +WCSLIB version 4.15 (2012/09/26) +-------------------------------- + +* C library + + - Bug fixes in spctype(), spcspxe(), spcxpse, and spctrne() for + propagating an error status correctly from lower-level routines. + Amendments to the prologues of these routines. Reported by + Hans Terlouw. + + - Similarly for wcsunitse(), wcsulexe(), and wcsutrne(). + +* PGSBOX + + - Bug fix in PGSBOX for handling cycles in angle when both world + coordinate elements are angular. Reported by Thomas Robitaille. + + +WCSLIB version 4.14 (2012/07/13) +-------------------------------- + +* C library + + - Problems were caused for fitshdr(), wcsbth(), wcspih(), wcsulex(), + datfix() and wcshdo(), by locales such as "fr_FR" in which commas + are used to delimit the decimal part of floating point numbers. + In particular, these locales adversely affect the behaviour of + sscanf() and sprintf() when reading and writing FITS header + keyvalues. Thread-safe fixes provided by Michael Droettboom. + + - Applied astropy patches from Michael Droettboom: attend to compiler + warnings in prj.c, spc.c, tab.c, and wcsutil.c, including those for + MS-Windows. + + +WCSLIB version 4.13.4 (2012/04/02) +---------------------------------- + +* Installation + + - Relaxed the closure tolerance slightly in tlog.f as for tlog.c + previously. + + +WCSLIB version 4.13.3 (2012/03/26) +---------------------------------- + +* Installation + + - Relaxed the closure tolerance slightly in tlog.c for gcc 4.6.3 on + Ubuntu 12.04 (reported by Ole Streicher). + + +WCSLIB version 4.13.2 (2012/03/21) +---------------------------------- + +* Installation + + - Changes to configure.ac and the GNUmakefiles to put '-lm' strictly + in the correct sequence when producing the sharable library + (reported by Ole Streicher). + + +WCSLIB version 4.13.1 (2012/03/15) +---------------------------------- + +* C library + + - Workaround in wcserr_set() for an unfortunate compiler segv from + gcc 4.2.1 in MacOSX 10.7. + + +WCSLIB version 4.13 (2012/03/14) +-------------------------------- + +* C library + + - Allow naxis == 0 in wcsini() and linini() for a degenerate + coordinate system as may be produced by wcssub(). In wcssub(), + ensure that wcsini() is called for coordinate systems with + naxis == 0. In wcssptr(), call spcfree() before spcini() to plug a + memory leak. + + +WCSLIB version 4.12 (2012/02/29) +-------------------------------- + +* C library + + - In spctrne(), guard against restfrq == restwav == 0.0 when + translating between two velocity-characteristic types, or between + two wave-characteristic types (the translation is independent of + restfrq and restwav, but a dummy value is needed for intermediate + calculations). + + +WCSLIB version 4.11 (2012/02/21) +-------------------------------- + +* C library + + - Bug fix in spcset() for handling simple linear spectral axes. + +* Fortran wrappers + + - Bug fix in spctrne_() for handling ctypeS2. + + +WCSLIB version 4.10 (2012/02/06) +-------------------------------- + +* C library + + - datfix() and spcfix() now return informative messages when dates and + AIPS-convention spectral axes are translated (changes contributed by + Michael Droettboom). spcaips() now returns an error status for + invalid values of VELREF. + + - wcssub() has been augmented with the ability to add new axes onto a + wcsprm struct. + + +WCSLIB version 4.9 (2012/01/24) +------------------------------- + +* C library + + - Fixes to wcsfixi() for collecting the messages properly in the info + array (from Michael Droettboom). + + - Handle certain malformed date strings more gracefully in datfix(). + + - Make informative messages printed by wcserr_prt() a bit more + informative. + + +WCSLIB version 4.8.4 (2011/12/05) +--------------------------------- + +* C library + + - Fixed the pseudo-random number generator in twcstab.c - gcc 4.6 with + '-O2' baulked at testing for signed integer overflow. + +* Installation + + - In configure.ac, the Fortran compiler's libraries must be added to + the link list when checking for the PGPLOT libraries since gcc is + driving the linker. Likewise in C/GNUmakefile when linking test + programs that use PGPLOT. + + - Use 'make CHECK=nopgplot check' to run only the non-graphical tests + (even if PGPLOT is available). + + - After compiling and running the tests, 'make check' now summarizes + the non-graphical test results and stops if any failed. + + +WCSLIB version 4.8.3 (2011/11/17) +--------------------------------- + +* C library + + - Minor generalization of the wcserr diagnostics to allow the return + of informative messages, which are associated with negative status + values. wcserr_prt() will now recognize and print them as such. + Added wcserr_clear() to reset (clear) a wcserr struct. + + - Modified unitfix() to return an informative message if a units + alias is applied, and wcsfixi() to allow such messages to be + propagated through the info array (from Michael Droettboom). + + - Modified twcsfix.c to use wcserr diagnostics, in particular to + report units alias translations. + +* Fortran wrappers + + - In wcsfix_(), interpret *naxis == 0 as meaning naxis == 0x0, thus + causing cylfix() to be skipped. + + - Modified twcsfix.f to reflect changes made to twcsfix.c. + + +WCSLIB version 4.8.2 (2011/10/04) +--------------------------------- + +* Installation + + - Changes for Debian package generation contributed by Ole Streicher: + - Corrections to 'configure' reported by 'lintian'. + - Generate man pages for the utility programs and install them. + + +WCSLIB version 4.8.1 (2011/09/19) +--------------------------------- + +* Installation + + - Set SONAME in the sharable library in accordance with + tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html + (reported by Ole Streicher, Debian package maintainer). The + sharable library will again be installed with full release number + and with a symbolic link from SONAME pointing to it. If defined, + SHRLN will point to SONAME. + + +WCSLIB version 4.8 (2011/08/15) +------------------------------- + +* C library + + - New error diagnostics mechanism contributed by Michael Droettboom: + + Most functions that return a numeric status (error) code now also + write a detailed error message to a wcserr struct attached to the + passed-in *prm struct. See wcserr.h for more information. + + Functions that didn't have a *prm struct as an argument have no + direct way to return an error message. Therefore, these functions + now have duplicate versions with the suffix "e" that take an + additional "struct wcserr *" parameter. These functions are: + + spcspx() -> spcspxe() + spctrn() -> spctrne() + spctyp() -> spctype() + spcxps() -> spcxpse() + wcsulex() -> wcsulexe() + wcsunits() -> wcsunitse() + wcsutrn() -> wcsutrne() + + A new function wcsfixi() was added which is identical to wcsfix() + but in addition stores all of the detailed textual messages about + the fixes that were performed. + + - In wcssub(), ensure that wcstab->m_tab has been initialized + before trying to free it on status return 12 or 13 (reported by + Hans Terlow). + + - Bug fixes: + - In sphx2s() and sphs2x() for the case where |eul[1]| = 180.0. + - For parsing AIPS-convention VELREF in wcsbth(). + - In spcaips() for translating AIPS-convention CTYPEia without + Doppler frame. + + - Non-graphical test programs now simply report "PASS" if they satisfy + the reporting tolerance for closure residuals, etc. Their full + output is reported otherwise. Run 'make MODE=interactive check' to + revert to the previous behaviour of reporting the full output for + tests that succeed. + + - Eliminated compiler warnings about type-punning of pointer-to- + function. + +* Fortran wrappers + + Extensive modifications to track the new error handling mechanism + in the C library. + +* Installation + + - configure now prefers gfortran over g77 if available. + + - Don't rely on "." being in the PATH if config.status needs to be + run in the pgsbox and utils makefile (reported by Peter Teuben). + + +WCSLIB version 4.7 (2011/02/07) +------------------------------- + +* C library + + - Bug fix in celset() for interpreting LATPOLEa when LONPOLEa = phi0. + Crept in at version 4.4. + + - Fixed the bounds test on y in hpxx2s() (HEALPix projection) for + unconventional values of H and K. In hpxx2s() and hpxs2x(), + corrected the offset of the southern polar half-facets for + even K. In hpxs2x(), put the phi = 180 meridian in the expected + place. + + - Bug fixes in tabx2s() and tabs2x() for default indexes (reported + by David Berry). In tabs2x(), if no solution is found then do + minor extrapolation past the ends of each row (1-D case only). + Sped up tabs2x() by about 50%. + + - New functions wcsprintf(), wcsprintf_set(), and wcsprintf_buf(), + declared in wcsprintf.h, provide control over the disposition of + output from celprt(), linprt(), prjprt(), spcprt(), tabprt(), and + wcsprt() routines. Prompted by Michael Droettboom, with an initial + implementation. + +* Fortran wrappers + + - In the various test programs, used EQUIVALENCEs to ensure that the + CEL, LIN, PRJ, etc. arrays are aligned on a DOUBLE PRECISION + boundary. + +* PGSBOX + + - Bug fix for the case where NG1 == 0 and GRID1(0) < 0, and likewise + for NG2 and GRID2. + +* Utilities + + - In wcsware, added a '-w' option to convert world coordinates + obtained from stdin to pixel coordinates using wcss2p(). Allow + multiple sets of input coordinates with the '-x' and '-w' options + and report the value of the intermediate world coordinates. + +* User manual + + - Fixed list formatting for function return values < 0 or > 9. + + - New section for wcsprintf() and related routines. + +* Installation + + - Changes prompted by Sbastien Fabbro for the Gentoo Linux package: + a) autoconf updates, + b) respect LDFLAGS when building the shared library, + c) install documentation, + d) recognise DESTDIR for doing a staged installation. + + - As of this release, the minor WCSLIB version number (second field) + will be incremented if and only if a change is made that affects the + library itself, not the documentation or utilities. The version + number on the installed libraries and header files will omit the + patch number (third field). + + +WCSLIB version 4.6.3 (2010/11/24) +--------------------------------- + +* C library + + - Bug fix in wcsbth() for handling the inheritance of image header + keywords (uncovered by valgrind, reported by Jim Lewis). + + +WCSLIB version 4.6.2 (2010/11/22) +--------------------------------- + +* C library + + - Fixed a memory leak in wcsbth.l (reported by Jim Lewis). + + +WCSLIB version 4.6.1 (2010/11/18) +--------------------------------- + +* Fortran wrappers + + - Fixed typos in cel_f.c, celget[cdi] -> celgt[cdi]. + + +WCSLIB version 4.6 (2010/11/16) +------------------------------- + +* C library + + - In wcsulex.l and wcsutrn.l, stdlib.h must be included explicitly + before the redefinition of exit() - most versions of flex do include + it upfront but some don't (reported by Peter Williams). + +* Fortran wrappers + + - Changes intended to avert nuisance compiler warnings that could + potentially obscure warnings indicative of a genuine problem: + + - To stop messages about unused variables when the relevant compiler + option is set, e.g. 'g77 -Wunused', the various *_ERRMSG arrays + defined in the Fortran include files and (formerly) initialized + therein via DATA statements, e.g. PRJ_ERRMSG in prj.inc, have now + been placed into COMMON blocks with names such as PRJ_DATA, and + are initialized via DATA statements in BLOCK DATA subprograms + defined in separate files, e.g. prj_data.f. + + - To stop messages about subroutines being invoked with inconsistent + argument lists if the relevant compiler option is not set, e.g. + 'g77 -Wno-globals', the C wrapper functions that take 'void *' + arguments now have separate forms for INTEGER, DOUBLE PRECISION, + and CHARACTER arguments that simply invoke the generic function. + Application code must be modified to take advantage of this. + +* User manual + + - In the section on the Fortran wrappers in the manual, warn about the + need for the INTEGER array holding a data structure to be aligned on + a DOUBLE PRECISION boundary. + + +WCSLIB version 4.5.6 (2010/10/28) +--------------------------------- + +* Installation + + - Fixed the search for CFITSIO and PGPLOT library and include + directories. + + +WCSLIB version 4.5.5 (2010/10/14) +--------------------------------- + +* Installation + + - Build the PGSBOX sharable library. + + +WCSLIB version 4.5.4 (2010/09/28) +--------------------------------- + +* C library + + - In wcshdo(), according to the FITS standard, "Letters in the + exponential form ('E' or 'D') shall be upper case" (reported by + Michael Droettboom). + + +WCSLIB version 4.5.3 (2010/09/23) +--------------------------------- + +* Utilities + + - Various improvements to wcsgrid: correct the scaling set via + cpgwnad(); label angles other than RA,Dec in decimal degrees; + draw the projection boundary for projections other than zenithals. + + +WCSLIB version 4.5.2 (2010/09/23) +--------------------------------- + +* C library + + - Fixed the translation of GLS to SFL in wcsset() and celfix() when + the reference longitude is non-zero - it introduces an offset in + longitude in the normal way. (This undoes part of the change + applied in version 4.4.) + + +WCSLIB version 4.5.1 (2010/08/12) +--------------------------------- + +* C library + + - New utility function, sphpad(), computes the coordinates of points + offset by given angular distances and position angles from a given + point on the sky (complementary to sphdpa()). + +* Fortran wrappers + + - New wrapper function: + - SPHPAD for sphpad(). + + +WCSLIB version 4.5 (2010/07/16) +------------------------------- + +* C library + + - Fixed the interpretation of VELREF when translating AIPS-convention + spectral types. Such translation is now handled by a new special- + purpose function, spcaips(). The wcsprm struct has been augmented + with an entry for velref which is filled by wcspih() and wcsbth(). + Previously, selection by VELREF of the radio or optical velocity + convention for type VELO was not properly handled. + +* Fortran wrappers + + - New wrapper function: + - SPCAIPS for spcaips(). + + - Changed spc.inc, spc_f.c, wcs.inc and wcs_f.c to track VELREF + changes. + + - Declared functions external in the include files to avoid compiler + warnings about unused variables (if the particular option is set). + +* Utilities + + - Added a '-q' option to fitshdr to quit after a specified number + of HDUs. + + +WCSLIB version 4.4.4 (2009/09/14) +--------------------------------- + +* Installation + + - Added more configure options for controlling the build: + --disable-fortran, --disable-utils, --without-cfitsio, and + --without-pgplot. + + +WCSLIB version 4.4.3 (2009/09/03) +--------------------------------- + +* C library + + - Set wave number units to "/m" in spctyp(), was "1/m" which is not + strictly legal and wasn't handled by wcsulex() (reported by + Hans Terlow). Also fixed a number of units specifications in the + prologue of spx.h to conform with Paper I usage. + + - In wcsulex(), allow unit strings like "1/m" in addition to "/m", + provided that the superfluous "1" is the first non-blank character + in the expression, or parenthesised sub-expression. + + - In wcssptr(), ensure that i is always reset if given < 0. + +* User manual + + - Augmented the list of FITS WCS and related software in the manual. + + +WCSLIB version 4.4.2 (2009/08/13) +--------------------------------- + +* C library + + - In sphx2s() and sphs2x(), handle the case where |eul[1]| = 180.0 + separately for speed and accuracy. This change also fixes a rare + and subtle bug in cels2x() that occurs when celprm::isolat is set + and the magnitude of the first latitude in the lat[] vector exceeds + 90 deg (reported by Hans Terlouw). + +* Installation + + - Fix relating to creation of symlinks when installing the libraries. + + +WCSLIB version 4.4.1 (2009/08/11) +--------------------------------- + +* Installation + + - Fixes for installation of the CHANGES file and for the creation of a + symbolic link for the sharable library if one already exists. + + +WCSLIB version 4.4 (2009/08/10) +------------------------------- + +* C library + + - Creation of WCSLIB user manual from the header file prologues using + a special-purpose parser, doxextr, and sed scripts to generate input + for doxygen. This required minor formatting changes to all + prologues plus miscellaneous changes such as naming of arguments in + function prototypes. + + - Bug fix in wcsset() that affected handling of PROJPn (deprecated) + and PVi_ma attached to the longitude (not latitude) axis. Guard + against long strings when copying the projection code. In + wcs_types(), allow for early Paper IV distortion codes (e.g. + "RA---TAN-SIP") when parsing CTYPEia. + + - Use sincos() whereever possible for a ~15% speedup (patches for + cel.c, prj.c and sph.c supplied by Michael Droettboom). configure + checks for, and uses it automatically if available. + + - Fixed the translation of GLS to SFL in wcsset() and celfix() when + the reference longitude and latitude are non-zero. (In the AIPS + convention, this simply translates the reference point, i.e. the map + as a whole, to those coordinates without creating an oblique grid.) + + - Bug fix in prjoff(), a utility function used by the prj routines. + It forces (x,y) = (0,0) at (phi_0,theta_0) when the latter are set + by PVi_[012]a attached to the longitude (not latitude) axis. Rarely + used in practice. + + - New utility function, sphdpa(), computes the distance and position + angle from a point on the sphere to a set of field points. + + - In sphx2s() and sphx2s(), handle a simple change in origin of + longitude using a short-cut calculation for speed and accuracy. + Similarly in celset(), check whether phip == phi0 when computing + latp and if so use a short-cut that ensures latp == 90.0 (exactly) + if lat0 == theta0. The resulting spherical rotation then becomes a + simple change in origin of longitude. In particular, these changes + should assist PGSBOX in drawing grid lines of +/-180 longitude, to + prevent flip-flopping between one and the other. + + - wcsbth() & wcspih(): resolved an inconsistency between the + documentation and code by renamimg WCSHDR_VSOURCEa as + WCSHDR_VSOURCE. + + - Flex code: moved declaration of helper functions out of global + scope. + + - Fixed the call to wcss2p() in twcshdr (in a section of code not + usually exercised). + +* Fortran wrappers + + - New wrapper functions: + - WCSBTH for wcsbth(), + - WCSBDX for wcsbdx(), + - CDFIX for cdfix(), + - SPHDPA for sphdpa(). + + - Updated WCSLEN (in wcs.inc) and added WCS_COLAX and WCS_VELANGL to + match changes to wcsprm made in v4.3 with corresponding changes to + the wrapper functions. Likewise updated TABLEN (in tab.inc) for + changes to tabprm, and added CEL_LATPREQ for celprm. + + - Struct lengths (WCSLEN, PRJLEN, etc.) are now long enough to + accomodate 64-bit machines. + + - Updated the flag bits for the RELAX argument in wcshdr.inc to + reflect changes to wcshdr.h made in v4.3. Renamed WCSHDR_VSOURCEa + to WCSHDR_VSOURCE for consistency with the C library. + +* PGSBOX + + - Improved grid labelling, particularly in minimizing the number of + fields required in sexagesimal labels. + +* Utilities + + - New utility program: + + - wcsware extracts the WCS keywords for an image from the specified + FITS file, constructs wcsprm structs for each coordinate + representation found, and performs a variety of operations using + them. + + - Old utility programs (first appeared in 4.3 but were not recorded): + + - HPXcvt reorganises HEALPix data into a 2-D FITS image with HPX + coordinate system. + + - wcsgrid extracts the WCS keywords for an image from the specified + FITS file and uses pgsbox() to plot a 2-D coordinate graticule for + each alternate representation found. + + - fitshdr lists headers from a FITS file specified on the command + line, or else on stdin, printing them as 80-character keyrecords + without trailing blanks. + +* Installation + + - New configure options, --with-pgplotinc, --with-pgplotlib, + --with-cfitsioinc and --with-cfitsiolib allow additional directories + to be added to the library and include file search path. + + - Miscellaneous fixes and improvements to the installation process. + + - Generate a metadata file for pkg-config. + + - Added 'make MODE=interactive check' to run the test programs in + interactive mode rather than batch. + + - Merged the separate CHANGES files for C, Fortran and PGSBOX into + one (this), with a new section for utilities. + + +WCSLIB version 4.3.3 (2009/04/30) +--------------------------------- + +* C library + + - fitshdr.l, wcsbth.l, and wcspih.l: use setjmp/longjmp to preempt + the call to exit() which is hard-coded in function yy_fatal_error() + supplied by flex. + + - wcspih.l: if NAXIS is non-zero but there were no WCS keywords at + all in the header then create a default WCS with blank alternate + version. + + +WCSLIB version 4.3.2 (2009/03/16) +--------------------------------- + +* C library + + - utils/GNUmakefile: create BINDIR if necessary prior to installing + utilities. + + +WCSLIB version 4.3.1 (2008/09/08) +--------------------------------- + +* Installation + + - Top-level GNUmakefile: install header files. + + +WCSLIB version 4.3 (2007/12/27) +------------------------------- + +* C library + + - A new general WCS header parser wcsbth() handles binary table image + arrays and pixel lists as well as image array headers. Added + "colax" to the wcsprm struct to record the column numbers for each + axis in a pixel list. + + - New function wcsbdx() is the analog of wcsidx() for the array of + wcsprm structs returned by wcsbth(). + + - New function wcshdo() writes out a wcsprm struct as a FITS header. + + - Changes to wcspih(): + - Bug fix, check for a == 0 (indication of a keyword that applies + to all alternates) in internal helper function wcspih_naxes() + (reported by Craig Markwardt). + - Added a new ctrl option to remove valid WCS keyrecords except for + those with a more general role, namely {DATE,MJD}-{OBS,AVG} and + OBSGEO-{X,Y,Z} (suggested by Jim Lewis). + - Added a rule for VELANGLa. Also added "velangl" to the wcsprm + struct. + - Do checks on the i, k & m keyword parameters in . + - Fixed the test for repeated blanks in the NAXIS and WCSAXES + patterns. + - Fixed three rules to allow m == 0. + - Reworked the implementation notes in the prologue. + + - The flex scanners, fitshdr.l, wcsbth.l, wcspih.l, wcsulex.l, and + wcsutrn.l, invoke yylex_destroy() before returning to avoid a 16kiB + memory leak. This was reported by several people, however it may be + problematic depending on the version of flex used - version 2.5.9 or + later is required. If this is not available, C sources pre- + generated by flex 2.5.33 will be used. + + - In wcs.c, don't define the signbit macro if already defined (for + MacOSX). + + - In wcs.h, documented wtbarr namespace issues in C++. + + - In wcsset(), always set wcsprm.cunit[i], if possible (primarily for + use by wcshdo()). + + - In wcsfix.c, parenthesised a boolean expression that was otherwise + incorrect. + + - Fixed an obscure floating point rounding error in celset() that + appeared with -O2 optimization in gcc v3.3.5 (Linux). + + - prjset() now correctly propagates the status value returned by the + specific projection-setting functions (reported by Bill Pence). + + - Bug fix in hpxx2s(), also added bounds checking. Minor efficiencies + in carx2s() and merx2s(). + + - In the various functions that print the contents of the structs, use + the "%p" printf conversion specifier to print addresses rather than + casting the pointer to int and using "#x". The latter does not work + on 64-bit machines where sizeof(int) != sizeof(void*). + + - Reorganized the various structs to get alignment on 64-bit machines. + + - All header file prologues now reference the README file for an + overview of the library. + + - Miscellaneous portability fixes for 64-bit, MacOSX, OSF compiler, + etc. + + - Elimination of compiler warnings, e.g. parenthesised assignments + used as truth values (a favourite gcc gripe!), etc. + + - Process flex descriptions using a newer version of flex, primarily + for MacOSX. However, the processed files are now only used when + flex 2.5.9 or later is not available. + + - Removed WCSLIB 2.x backwards-compatibility measures from lin.h, + prj.h, prj.c, and sph.h. + +* Fortran wrappers + + - (No substantive changes.) + +* PGSBOX + + - Miscellaneous improvements to PGSBOX. + +* General + + - Switched licensing to LGPL 3.0. + + - In comment text, replaced use of the obsolete term "card" with + "keyrecord" which consists of a "keyword", "keyvalue", and + "keycomment". + +* Installation + + - General improvements to the installation process: autoconf-related + portability improvements, particularly relating to Fortran name + mangling; makefile rules for building the shared library, for + processing flex descriptions; don't rely on "." being in the PATH + when running tests. + + +WCSLIB version 4.2 (2005/09/23) +------------------------------- + +* C library + + - Brought the installation process under control of GNU autoconf, + the top-level makefile now builds and tests everything, and the C + library has a config.h in which WCS_INT64 is set. Added an INSTALL + file. + + - Merged the FORTRAN, C and PGSBOX READMEs into one top-level README. + + - Extensions for -TAB coordinate handling: in tabx2s() and tabs2x(), + allow extrapolation by half a cell at either end of the index and + coordinate tables; fits_read_wcstab() (in getwcstab.{h,c}) allows + TDIMn to be omitted for 1-D lookup tables for which it has the form + '(1,K)', i.e. describing a degenerate 2-D array; wcsprt() now prints + the wtbarr structs in wcsprm. + + - Bug fixes for -TAB coordinate handling: in tabx2s() and tabs2x() + the incorrect indexing variable, m instead of i, was used for + tab->crval[]; wcsp2s() and wcss2p() returned prematurely in the + tabular coordinate loop; in wcstab(), removed an extraneous + assignment to wtbp->kind for index arrays. + + - In wcsp2s() and wcss2p(), elements of the stat[] vector that had + been set were being reset incorrectly to zero. The stat[] values + are now set as flag bits for each coordinate element. + + - Added cdfix() to the wcsfix() suite to fix erroneously omitted + CDi_ja cards. + + - PGSBOX is now compiled into a separate object library, and is + installed alongside WCSLIB. + + - Eliminated several instances of non-ANSI C library functions and + header files and some residual K&R C usage. The Sun C compiler + complained about const int definitions of initializers used in + variable declarations in some of the test programs; changed these + to preprocessor macros. + +* Fortran wrappers + + - Fixed handling of 64-bit integer keyvalues in keyget_(). + + - Fixed output formatting of 64-bit integer keyvalues in tfitshdr.f. + + - Fixed minor syntax errors in twcsfix.f and tpih1.f reported by the + Sun Fortran compiler. + + - The output of each test program now identifies the source file. + +* PGSBOX + + - (No substantive changes.) + + +WCSLIB version 4.1 (2005/08/31) +------------------------------- + +* C library + + Summary of added functionality: + + - -TAB coordinate axes are now fully implemented in the WCSLIB driver + functions (in wcs.{h,c}); multiple -TAB axes are supported. A new + function, wcstab(), which is automatically invoked by wcspih(), + parses -TAB-related header cards and sets up structs for a separate + routine that reads the necessary arrays from a FITS binary table + extension. + + An implementation of this routine in CFITSIO, fits_read_wcstab(), + is provided. Note however that the interface of this function is + experimental, and the code itself must be considered beta-release in + WCSLIB 4.1. + + - Units specifications, either from CNAMEia or inline comments (with + brackets), of arbitrary complexity are now fully implemented via a + parser, wcsulex(), and converter, wcsunits(). This is invoked + automatically by wcsset(). + + - Translators for non-standard WCS constructs are provided. These + cover date formats, units specifications, defunct celestial + projection types, AIPS spectral axis types, and the repair of + malformed cylindrical coordinate systems. + + - wcspih() now has options to remove the WCS cards it has processed + from the header and a new generic FITS header parser, fitshdr(), may + be used to parse the remaining non-WCS cards. In addition to the + more basic types, it handles 64-bit and 'very long' (70 digit) + integer keyvalues, and also continued string keyvalues. It also + does keyword matching and extracts units specifications in inline + comments. + + - -LOG coordinates are now implemented independently of spectral + coordinate types. Multiple -LOG axes are supported. + + - New function wcssptr() translates the spectral axis in a wcsprm + struct to the required type. + + - The README file now gives an introduction to, and complete overview + of, WCSLIB. It provides a point of entry to programming with + WCSLIB. Complete descriptions and usage notes for all functions are + contained in the header files. + + - The FORTRAN wrappers and test programs are now completely up-to-date + with respect to the C implementation. + + - All code, including the FORTRAN wrappers, PGSBOX, and all test + programs, now pass 'purify' without memory leaks, uninitialized + memory reads, memory access violations, or other memory faults. + + Change notes: + + - Added options to wcspih() to remove WCS cards from the input header + leaving only non-WCS cards behind. Modified test programs tpih1.c + and tpih2.c to use CFITSIO optionally via preprocessor macro + DO_CFITSIO. + + - New function wcstab() in wcshdr.{h,c} parses -TAB-related header + cards and sets up structs for a separate routine that reads the + necessary arrays from a FITS binary table extension. New + test/demo program twcstab.c using header defined in wcstab.cards. + + - CFITSIO implementation, fits_read_wcstab() in getwcstab.{h,c}, of a + function, independent of WCSLIB, for extracting arrays from a binary + table as required in constructing -TAB coordinates. + + - New units specification parser, wcsulex() in wcsunits.h and + wcsulex.l, and converter, wcsunits() in wcsunits.{h,c}. New + test/demo program tunits.c. + + - New parser for non-standard units specifications, wcsutrn() in + wcsunits.h and wcsutrn.l, also tested by tunits.c. + + - New functions datfix(), unitfix() (which applies wcsutrn()), + celfix(), and spcfix() join cylfix() in wcsfix.{h,c} to translate + various forms of non-standard or quasi-standard FITS WCS keyvalues + in a wcsprm struct. wcsfix() applies all of these in sequence. + New test/demo program twcsfix.c, with wcsfix() also now invoked by + tpih1.c. + + - New generic FITS header parser, fitshdr() in fitshdr.{h,l}. New + test/demo program tfitshdr.c uses wcs.cards with extra non-WCS + cards added. + + - -LOG coordinates are now treated as a coordinate type separate from + spectral coordinates, implemented via log.{h,c} and test program + tlog.c. The logarithmic functions were removed from spx.{h,c}, and + spc.c. + + - Extensive changes to wcs.{h,c} to support multiple -TAB and -LOG + coordinate axes and units conversion. Substantially changed the + test program, twcs.c, to test the more general functionality. + + - New function wcssptr() in wcs.{h,c} translates the spectral axis in + a wcsprm struct. + + - Added DATE-AVG to wcsprm. Also ntab, tab, nwtb, and wtb required + for -TAB implementation. Define struct wtbarr. + + - Added a types[] member to the wcsprm struct to identify axis + coordinate types using a four-digit code. + + - Use memset() in wcsini() to null-fill character arrays in the wcsprm + struct so that they don't appear to be padded with garbage when + displayed by gdb. + + - Do alias translation for AIPS-convention spectral types in wcsset() + using spctyp(). If wcsset() finds a CTYPEia in "4-3" form with an + unrecognized algorithm code it now returns an error rather than + assume that it's a linear axis. wcsset() now also resets lonpole + and latpole to the values actually used. + + - Modified spctyp() to translate AIPS-convention spectral ctypes, and + modified the argument list to return the parsed spectral type and + algorithm code. The return arguments will not be modified if + CTYPEia is not a valid spectral type; zero-pointers may be specified + for any that are not of interest. Removed the external const + variables, spc_codes and spc_ncode, as their function is now + fulfilled by spctyp(). + + - Fixed a bug in spctrn() in resolving ctypeS2 wildcarding. + + - Added latpreq member to the celprm struct, set by celset() to + indicate how LATPOLE is used. Augmented tcel2.c to report it. + + - New function tabmem() in tab.{h,c} takes control of user-allocated + memory. + + - tabini() allows K == 0 and also K[m] == 0 to initialize partially + the tabprm struct (for wcstab()). It now does fine-grained + bookkeeping of memory allocation for the index arrays and allocates + each individually. tabprm.index[] == 0x0 is recognized as default + indexing in tabset(), tabx2s() and tabs2x(). + + - The *prt() functions report parameters to an extra decimal place. + + - tabprt() prints the array index for elements of the coordinate and + index vectors. + + - Set the 0th element in all *_errmsg arrays to "Success". + + - Extracted string utility functions used by WCSLIB into + wcsutil.{h,c}. + + - Removed support for K&R C. + +* Fortran wrappers + + - The FORTRAN wrappers and test programs are now completely up-to-date + with respect to the C implementation. + + - New include files, wrappers, and test programs: + fitshdr.inc, fitshdr_f.c, getwcstab.inc, getwcstab_f.c, log.inc, + log_f.c, sph.inc, tab.inc, tab_f.c, tfitshdr.f, tlog.f, ttab1.f, + ttab2.f, ttab3.f, tunits.f, twcsfix.f, twcstab.f, wcsfix.inc, + wcsfix_f.c, wcsunits.inc, wcsunits_f.c. + + - Updates to reflect changes to the C library and test programs: + cel.inc, cel_f.c, prj.inc, spc.inc, spc_f.c, spx.inc, spx_f.c, + tlin.f, tpih1.f, tpih2.f, tprj1.f, tprj2.f, tspc.f, tsph.f, tspx.f, + twcs.f, twcsmix.f, twcssub.f, wcs.inc, wcs_f.c, wcshdr.inc, + wcshdr_f.c. + + - Added *_ERRMSG arrays containing status messages to all include + files. + + - Removed support for K&R C. + +* PGSBOX + + - Fixed a subtle though benign memory fault identified by 'purify'. + + - Reset LATPOLE in the COE example in cpgtest.f when drawing the + second (native) grid because it will have been set to a non-default + value by wcsset() when the first grid was drawn; set wcs.flag to -1 + before wcsinit() and call wcsfree() at the end. Similarly for + pgtest.f. + + +WCSLIB version 4.0 (2005/02/07) +------------------------------- + +* C library + + - Implemented tabular coordinates (-TAB). New files: tab.h and tab.c, + and test programs ttab[123].c. These have not been incorporated + into the higher-level (wcs.h) functions at this stage. + + - New spectral functions: spchek() checks a spectral algorithm code + for legitimacy; from the spectral keywords given, spcspx() derives + the corresponding CRVALi and CDELTi keywords for the underlying P-, + and X-type spectral coordinates; spcxps() does the opposite; + spctrn() combines spcspx() and spcxps() to translate one set of + spectral keywords into another, e.g. 'FREQ' -> 'ZOPT-F2W'. + + - Implemented the HEALPix (HPX) projection in the prj functions. + + - Added a new function, wcsidx(), to return an array that indexes the + alternate coordinate descriptions found by wcspih() (suggested by + Bill Pence, NASA/Goddard). Modified tpih1.c to exercise it. + + - In wcsp2s() and wcss2p(), check that nelem equals or exceeds + wcs.naxis; emphasised this in the usage notes for these functions + in tab.h (suggested by Bill Pence, NASA/Goddard). + + - Moved the macros used for UNDEFINED values and the corresponding + macro test function, undefined(), to wcsmath.h for general use. + Previously, UNDEFINED values were only used internally, but they are + now visible in some of the structs, particularly values of undefined + auxiliary header cards in the wcsprm struct. + + - Remove const from the double args in the specx() prototype in spx.h + to match the definition in spx.c (reported by Bryan Irby, + NASA/Goddard). + + - Fixed the interaction between the FLAVOUR and PGPLOTLIB definitions + in the C and FORTRAN Makefiles by introducing a separate variable, + DO_PLOTS, to control whether to exercise test programs that require + PGPLOT (reported by Bill Pence, NASA/Goddard). + +* Fortran wrappers + + - New wrapper defined in wcshdr_f.c: wcsidx_(). Modified test program + tpih1.f to use it. + +* PGSBOX + + - (No substantive changes.) + +* General + + - Changed the copyright notice in all library routines from LGPL to + GPL as recommended by the FSF (http://www.gnu.org/licenses/why-not- + lgpl.html). + +* Installation + + - General improvements to the installation process: fixed the + interaction between the FLAVOUR and PGPLOTLIB definitions in the + Makefile by introducing a separate variable, DO_PLOTS, to control + whether to exercise test programs that require PGPLOT (reported by + Bill Pence, NASA/Goddard). Added an "install" target to the + Makefile. + + +WCSLIB version 3.6 (2004/08/25) +------------------------------- + +* C library + + - New service routine, wcssub() extracts the coordinate description + for a subimage from a wcsprm struct. wcscopy() is now implemented + as a preprocessor macro that invokes wcssub(). New test program, + twcssub.c, tests wcssub(). + + - In wcspih(): + + 1) Fixed handling of string-valued keywords where the inline comment + contains a single-quote character ('). + + 2) Fixed the address arithmetic for EPOCH and VELREF. + + 3) Translate VSOURCEa into ZSOURCEa if required. + + 4) Recognize SSYSSRCa. + + 5) Support free-format string keyvalues, as well as integer and + floating-point keyvalues; documented this in the prologue of + wcshdr.h. + + 6) Allow header cards without inline comments. + + 7) Fixed function prototyping in wcspih.l (i.e. ANSI and non-ANSI + forms were potentially mixed). + + 8) Catch an unhandled newline character on the END card that was + echoed to stdout. + + 9) In error messages, print "ERROR" (uppercase) - POSIX standard. + + - Modified wcs.cards to explain and test free-format keyvalues, and + also augmented the inline comment on illegal WCS cards that are to + be rejected, and WCS-like cards to be discarded. Added a header + card with no inline comment. + + - Removed vsource from the wcsprm struct and added ssyssrc. + + - In wcsini(), fixed a problem with memory management for wcs.pv when + NPVMAX is zero; likewise for wcs.ps and NPSMAX. + + - In wcsprt(), don't print auxiliary coordinate system information in + arrays with zero address. + + - In wcss2p(), status == 9 (one or more invalid world coordinates) was + not returned appropriately. + + - Renamed twcs1.c to twcs.c, and twcs2.c to twcsmix.c. + + - "Error status/code/number" is now referred to consistently as the + "status return value". + + - Some vestiges of K&R C were removed: preprocessor definition of + const, and K&R function prototypes. + +* Fortran wrappers + + - New wrapper defined in wcs_f.c: wcssub_(). New test program, + twcssub.f. + + - Renamed twcs1.f to twcs.f, and twcs2.f to twcsmix.f. + +* PGSBOX + + - (No substantive changes.) + +* Installation + + - Worked over the C, FORTRAN, and PGSBOX makefiles, in particular to + make them all consistent. + + +WCSLIB version 3.5 (2004/06/28) +------------------------------- + +* C library + + - WCSLIB now provides a function, wcspih() implemented as a Flex + description, that parses a FITS image header, either that of a + primary HDU or an image extension. Given a character array + containing the header it identifies and reads all WCS cards for + the primary coordinate description and up to 26 alternate + descriptions and returns this information as an array of wcsprm + structs. A service routine, wcsvfree(), is provided to free the + memory allocated by wcspih(). The relevant header file for these + functions is wcshdr.h. + + Test programs, tpih1 and tpih2, are provided to verify wcspih. The + first simply prints the contents of the structs using wcsprt(). The + second uses cpgsbox() to draw coordinate graticules. A FITS WCS + test header has been developed to provide input to these test + programs. It is implemented as a list of card images, wcs.cards, + one card per line, together with a program, tofits, that compiles + these into a valid FITS file. tpih1 uses its own code to read this, + whereas tpih2 uses the fits_hdr2str() function from CFITSIO. + + - Removed twcsprt, tpih exercises wcsprt() much more thoroughly than + twcsprt ever did. Modified twcs1 to print the size of the various + structs as twcsprt used to. + + - Although they are not used in any coordinate calculations, the + wcsprm struct now provides data members for storing all of the + auxiliary FITS WCS header cards defined in Papers I, II, and III, + such as WCSNAMEa, EQUINOXa, and CNAMEia. Members are also provided + for storing the alternate descriptor code (the "a" in CTYPEia), and + the binary table column number. These are supported by the high + level WCSLIB routines, wcsini(), wcscopy(), wcsfree(), and wcsprt(). + Refer to wcs.h for details. + + - The number of PVi_ma cards for which wcsini() allocates memory is + now set by a global variable, NPVMAX (previously a C-preprocessor + macro). This defaults to 64 but may be changed by a new function, + wcsnpv(). The wcsprm struct contains a new member, npvmax, that + records the value of this number at the time the struct was + initialized. This is in addition to npv which records the actual + number of cards that were encountered. + + Similarly, NPSMAX (default 8) is used for the number of PSi_ma + cards, and it may be changed via wcsnps(). + + The axis number, i, in the pvcard struct used for storing PVi_ma + cards may now be set to 0 to indicate the latitude axis. + + - calloc() is now used in place of malloc() in allocating memory for + arrays, and inclusion of malloc.h has been replaced with stdlib.h + for all platforms. + + wcsfree() checks that wcs.flag != -1 before testing wcs.m_flag when + freeing memory allocated by wcsini() in case the struct is + uninitialized. Similarly for linfree(). + + - In prj.h, renamed C-preprocessor macros INI, PRT, SET, X2S and S2X + to PRJINI, PRJPRT, PRJSET, PRJX2S and PRJS2X to reduce the + likelihood of namespace clashes. Similarly in spc.h. + + Also, in prj.c, changed the name of helper routine offset() to + prjoff() to reduce the likelihood of global namespace conflicts. + + - In line with bonx2s() and bons2x(), bonset() now recognizes the + equatorial case of Bonne's projection as Sanson-Flamsteed, mainly so + that the auxiliary information in the prjprm struct more accurately + reflects the truth. Modified tcel2 to exercise this by using an + equatorial Bonne projection in place of the Hammer-Aitov. + + - zpns2x() used prj.w[0] for bounds checking, though this had not been + set by zpnset() for polynomials of degree N < 3. Consequently, + bounds checking for N < 3 was unreliable (reported by David Berry, + STARLINK). + + - Changed some variable names in tscs2x(), cscx2s(), cscs2x(), + qscx2s(), and qscs2x() to match Paper II, and likewise changed some + inequality tests in qscs2x() without changing the results. + + - Minor tidying up of output formatting in prjprt(). + + - Added the alternate version code to FITS WCS keywords mentioned in + comments, e.g. CTYPEi changed to CTYPEia. + +* Fortran wrappers + + - New wrappers defined in wcshdr_f.c: wcspih_() and wcsvfree_(), and + also a new service function, wcsvcopy_(). + + New test programs, TPIH1 and TPIH2, being analogues of tpih1 and + tpih2. Removed TWCSPRT. + + - In wcs_f.c, new wrappers wcsnpv_() and wcsnps_(); modified wcsput_() + and wcsget_() to handle new members of the wcsprm struct. Also + modified wcsput_() to null-fill all char[] members of the wcsprm + struct, and likewise wcsget_() to blank-fill them. + + - Modified wcs.inc to support changes to the wcsprm struct. + +* PGSBOX + + - In PGSBOX, increased the dimension of the WORLD and XY vectors from + 2 to 9 to accomodate higher-dimensional coordinate representations + of up to 9 elements. Similarly for pgwcsl(). The assumption + (presently) is that the first two world, and pixel, coordinate + elements are the relevant ones; the others are all set to zero when + pgwcsl() initializes and otherwise ignored. + + Assigned some variables in DATA to stop compiler messages about + uninitialized variables. + + - Generalized the Makefile, bringing it into line with the WCSLIB + Makefile, and adding separate targets for compiling and running the + test programs. The default target now simply compiles pgsbox.c and + cpgsbox.c. A separate target compiles pgwcsl.c and inserts it into + ../C/libwcs.a. + + +WCSLIB version 3.4 (2004/02/11) +------------------------------- + +* C library + + - In aitx2s(), apply the boundary condition 0.5 <= Z^2 <= 1 given + after Eq. (109) in WCS Paper II to detect outlying pixels. + + - Fixed several special-case bugs in celset(): + + 1) For theta_0 = 90, in substituting the default value for phi_p + (LONPOLE), + + a) for the special case when delta_0 = 90, celset() provided the + wrong value (180 instead of 0), + + b) celset() neglected to add phi_0 (normally 0). + + 2) For theta_0 != 90, + + a) for the special case when delta_0 = -90, celset() incorrectly + computed delta_p (as theta_0 instead of -theta_0), + + b) for the special case when delta_p = +90 (or -90), celset() + neglected to subtract (or add) phi_0 (normally 0). + + 3) For |delta_0| = 90, celset() incorrectly allowed the particular, + invalid, value of phi_p (LONPOLE) that put the other pole at the + fiducial point. + + 4) For theta_0 = 0, delta_0 = 0 LATPOLE determines delta_p + completely. For LATPOLE > 90 celset() now sets delta_p to 90, + and for LATPOLE < -90 it sets it to -90. + + - Additional refinements in celset(): + + 1) cel->ref[2] is normalized in the range [-180,180]. + + 2) Account for rounding error in the computation of delta_p. + + - sphx2s() and sphs2x() incorrectly handled the "change in the origin + of longitude" special case that arises when delta_p = -90, in the + even more restrictive case where |theta| = 90 also; it applied + Eq. (3) instead of Eq. (4) of Paper II. + + - Added a new test program, tcel2.c, to exercise celset() more + thoroughly. Renamed the original tcel.c to tcel1.c and modified the + Makefile to suit. + +* Fortran wrappers + + - (No changes.) + +* PGSBOX + + - (No substantive changes.) + + +WCSLIB version 3.3 (2003/10/21) +------------------------------- + +* C library + + - In celset(), the default value for phi_p (LONPOLE) is + + phi_p = phi_0 + ((delta_0 < theta_0) ? 180.0 : 0.0) + + Previously phi_0 (which is normally zero) was not added (reported by + David Berry, STARLINK). + + - wcsprt() and linprt() now check that the structs have been + initialized. + + - In wcsini(), when the wcsprm flag is -1 also set the linprm flag to + -1 to force initialization of the memory managed by linset(). + + - wcsset() now explicitly initializes the celprm and spcprm structs + via celini() and spcini(). + + - Fixed syntax errors in the macro definitions of linrev_errmsg and + linfwd_errmsg. + + - In Makefile, added the -ansi option to gcc to force it to behave + like a strict ANSI C compiler, specifically in setting the __STDC__ + preprocessor macro. + +* Fortran wrappers + + - (No changes.) + +* PGSBOX + + - PGSBOX now recognizes status returns -1, -2, and -3 from NLFUNC for + opcodes +2 and +1 which cause it to accept the returned (x,y) + coordinates but not consider them as one end of a crossing segment + for labelling world coordinate 1, 2, or both. + + - PGSBOX now takes care not to lose vertical tick marks (and hence + labels) at the left or right edge of the frame. Likewise for + horizontal tick marks at the top or bottom edge of the frame. + + - Tightened up the test in PGSBOX for cycles in angle to catch the + case where the coordinate value spans a full 360 degrees. + + - PGSBOX will no longer accept frame crossings that are too oblique; + floating point rounding errors may cause grid lines that should + otherwise track along the frame to weave down it from side-to-side + resulting in spurious crossing points. + + - Fixed a bug in pgwcsl_() for processing simple linear coordinates. + + - pgwcsl_() now returns error -2 if the latitude is outside -90 to +90 + for opcodes +2 and +1. + + - Amended the translation of status return codes from WCSLIB in + pgwcsl_(). + + - Provided a header file for pgwcsl_() (mainly for C++ usage). + + - Added extra test plots to PGTEST and cpgtest. + + - Added extra functionality to the Makefile. + + +WCSLIB version 3.2 (2003/09/09) +------------------------------- + +* C library + + - Added the facility of setting the flag member of a wcsprm struct to + -1 before calling wcsini() for the first time in order to initialize + memory management. Likewise for linprm and linini(). + + - Renamed wcscpy() to wcscopy() to avoid a conflict with the Posix + "wide character string" function of the same name (wchar.h). In + particular, this is used by the GNU C++ string class. + + - The higher level functions (wcs, cel, spc) no longer return + prematurely if some of the input coordinate values are invalid. + + - All functions now test whether a null pointer for the particular + struct (wcsprm, celprm, etc.) has been passed to them. + + - Function return codes have been rationalized into a consistent set + within each of the wcs, cel, lin, prj, spc, and spx suites of + functions. Error messages to match these error codes are now + encoded in a single character array, e.g. wcs_errmsg and prj_errmsg, + instead of a separate array for each function. Macro definitions + for the older character arrays (e.g. wcsini_errmsg) have been + provided for backward compatibility. + + - Declared prj_stat as extern in prj.h. + +* Fortran wrappers + + - (No changes.) + +* PGSBOX + + - Added an ENTRY point, PGLBOX, that provides a simplified interface + to PGSBOX for linear axes without having to specify an NLFUNC or the + associated parameters. + + +WCSLIB version 3.1 (2003/04/29) +------------------------------- + +* C library + + - Added "global" and "divergent" prjprm struct informational members + to record whether the projection is capable of mapping the whole + sphere, and whether it is divergent in latitude. + + - Function cylfix() provided to fix WCS FITS header cards for + malformed cylindrical projections (c.f. Paper II, Sect. 7.3.4). + + - Added support for CUNITi cards to wcsprm (but not currently + implemented). + + - Added macro implementations of the trigd functions to wcstrig.h, + enabled if WCSTRIG_MACRO is defined. + + - Improved printing of the WCSLIB structs. + + - Added macro definitions for the lengths of the WCSLIB structs + measured in sizeof(int) units (mainly for the FORTRAN wrappers). + +* Fortran wrappers + + - FORTRAN is now supported via a set of wrappers on the C library. + Refer to the README file. + +* PGSBOX + + + +WCSLIB version 3.0 beta release (2003/04/01) +-------------------------------------------- + +* C library + + - Fully vectorized function interfaces (C preprocessor macros are + available to implement the scalar interfaces of the proj.c, sph.c, + and lin.c routines from WCSLIB 2.x). + + - Implementation of Paper II, Sect. 2.5: User-specified + (phi0, theta0). + + - Implementation of Paper III (excluding "-TAB"). + + - Memory management is now implemented in the upper-level (wcs.c) + routines. + + - New extensible design should accomodate Paper IV (and any other) + without further change to the function interfaces. + +* PGSBOX + + - Added a C wrapper function, cpgsbox(), and C test/demo program, + cpgtest, that duplicates PGTEST and serves as a C coding template. + + - Added calendar date axes. + + - Sped up the max/min search - if only tickmarks are required there is + no need to search the interior of the image. + + - Return margin widths in CACHE(,NC). + + - Fixed a buglet that caused ticks at the frame edges to be skipped. + + - Return error 3 if CACHE overflows. + + - Adapted PGWCSL for WCSLIB 3.x - it is now a C function (for + interfacing to WCSLIB) with a FORTRAN-like interface (for PGSBOX). + + +WCSLIB version 2.9 (2002/04/03) +------------------------------- + +* C library + + - Fixed a bug with alias translation in wcsset(). + + - Added a conditional compilation directive to lin.c for Apple's + MacOSX. + +* Fortran library + + - Fixed CUBEFACE handling in WCSSET. + + +WCSLIB version 2.8 (2001/11/16) +------------------------------- + +* C library + + - Added support for the SZP projection with szpset(), szpfwd() and + szprev(), and generalized AZP with support for the tilt parameter, + gamma. + + - Added phi0 to the prjprm struct, this is set by the projection + initialization routines along with theta0. + + - Fixed a problem in wcsmix() caused by numerical imprecision that + could cause it not to recognize when convergence was reached; break + out of the loop early if a discontinuity is detected. + + - Clarified the usage of vspan in the prologue to wcsmix(). + + - Fixed comments relating to LATPOLE in the prologue to cel.c and + tcel.c, and replaced references to LONGPOLE with LONPOLE. + + - Augmented the error reports in twcs2. + + - Modified projex() in tproj1 and prjplt() in tproj2 to make use of + the information stored in the prjprm struct. + +* Fortran library + + - Added support for the SZP projection with SZPSET, SZPFWD and SZPREV, + and generalized AZP with support for the tilt parameter, gamma. + + - Changed the call sequence to PRJSET to return PHI0 along with + THETA0. + + - Fixed a problem in WCSMIX caused by numerical imprecision that could + cause it not to recognize when convergence was reached; break out of + the loop early if a discontinuity is detected. + + - Clarified the usage of VSPAN in the prologue to WCSMIX. + + - Fixed comments relating to LATPOLE in the prologue to CEL and TCEL, + and replaced references to LONGPOLE with LONPOLE. + + - Augmented the error reports in TWCS2. + + - Modified PROJEX in TPROJ1 and PRJPLT in TPROJ2 to use the generic + driver routines PRJSET, PRJFWD and PRJREV. PRJPLT also now uses the + projection type encoded in PRJ(11). + + +WCSLIB version 2.7 (2001/02/19) +------------------------------- + +* C library + + - Added generic driver routines prjset(), prjfwd() and prjrev(). + These invoke specific projection routines via the pointer-to- + function elements, prjfwd and prjrev, transferred to the prjprm + struct from celprm. + + - Added code (3-letter projection code) and theta0 (reference + latitude) elements to prjprm. + + - The projection code for the Sanson-Flamsteed projection is now SFL. + The upper-level routines, wcsset(), wcsfwd(), and wcsrev(), + recognize GLS as an alias for this. + + - wcsset() now recognizes 'xyLN/xyLT' axis pairs. + + - Two bugs in the translation from NCP to SIN in wcsfwd() and wcsrev() + were fixed: (1) the projection parameter was computed incorrectly + and (2) they did not honour prj->flag set to -1 to disable strict + bounds checking. + + - A bug in wcsmix() was fixed - it was relying on the wcsprm struct to + have been initialized beforehand. + + - The test programs now use the cpgplot interface to PGPLOT, the old + tpgc.c and tpgf.f wrappers have been removed. + +* Fortran library + + - Added generic driver routines PRJSET, PRJFWD and PRJREV. These are + keyed to specific projection routines via the value of PRJ(11) which + now differs for each projection. + + - The projection code for the Sanson-Flamsteed projection is now SFL. + The upper-level routines, WCSSET, WCSFWD, and WCSREV, recognize GLS + as an alias for this. + + - WCSSET now recognizes 'xyLN/xyLT' axis pairs. + + - A bug in the translation from NCP to SIN in WCSFWD and WCSREV was + fixed; they did not honour PRJ(11) set to -1 to disable strict + bounds checking. + + - A bug in WCSMIX was fixed - it was relying on the WCS array to have + been initialized beforehand. + + +WCSLIB version 2.6 (2000/05/10) +------------------------------- + +* C library + + - Check for invalid (x,y) in zearev(). + + - In wcsmath.h, guard against prior definition of PI and other + preprocessor variables. + +* Fortran library + + - Check for invalid (X,Y) in ZEAREV. + + - Declare COSD and SIND in WCSFWD and WCSREV, reported by Clive Page + (cgp@star.le.ac.uk). + + +WCSLIB version 2.5 (1999/12/14) +------------------------------- + +* C library + + - Added copyright notice to header files and prefixed include guard + names with "WCSLIB_". + + - Fixed cube face handling in wcsfwd() and wcsrev() (reported by + Doug Mink, CfA). Allow more general face layout in the inverse + quadcube projections. + + - Fixed the problem in wcsmix() where it failed to find a valid + solution when the solution point lay at a native pole of a + projection in which the pole is represented as a finite interval. + However, wcsmix() will only ever return one solution even when two + or more valid solutions may exist. + + - wcsmix() now accepts viter in the range 5 - 10, the specified value + will be pushed up or down into this range if necessary. + + - The projection routines for AZP, TAN, SIN, ZPN, and COP now return + error 2 if (phi,theta) correspond to the overlapped (far) side of + the projection. This strict bounds checking can be switched off by + setting prj->flag to -1 (rather than 0) when the projections are + initialized. + + - The upper level routines, wcsset(), wcsfwd(), wcsrev(), and + wcsmix(), now recognize the NCP projection and convert it to the + equivalent SIN projection. The lower level routines do not + recognize NCP. + + - Extracted definitions of mathematical constants (PI etc.) from + proj.h into wcsmath.h in order to avoid conflicts with their + definition in math.h in some systems (such as Linux). + + - Describe the two alternate representations of the quadcube + projections (i.e. faces laid out or stacked) in the prologue of + wcs.c. + +* Fortran library + + - Fixed cube face handling in WCSFWD and WCSREV, reported by Doug Mink + (dmink@cfa.harvard.edu). Allow more general face layout in the + inverse quadcube projections. + + - Fixed the problem in WCSMIX where it failed to find a valid solution + when the solution point lay at a native pole of a projection in + which the pole is represented as a finite interval. However, WCSMIX + will only ever return one solution even when two or more valid + solutions may exist. + + - WCSMIX now accepts VITER in the range 5 - 10, the specified value + will be pushed up or down into this range if necessary. + + - The projection routines for AZP, TAN, SIN, ZPN, and COP now return + error 2 if (phi,theta) correspond to the overlapped (far) side of + the projection. This strict bounds checking can be switched off by + setting PRJ(11) to -1 (rather than 0) when the projections are + initialized. + + - The upper level routines, WCSSET, WCSFWD, WCSREV, and WCSMIX, now + recognize the NCP projection and convert it to the equivalent SIN + projection. The lower level routines do not recognize NCP. + + - Describe the two alternate representations of the quadcube + projections (i.e. faces laid out or stacked) in the prologue of + wcs.f. + + +WCSLIB version 2.4 (1996/09/23) +------------------------------- + +* C library + + - In sinrev(), cscrev(), qscrev(), and tscrev(), return error 2 if + (x,y) do not lie within the perimeter of the projection. In + sinrev(), stop the computation of phi for the "synthesis" projection + being applied to the pure "orthographic" case (reported by + David Berry, STARLINK). + + - (Internal change) Renamed variables l <-> m in the quadcube + projections to accord with standard usage (and revised WCS draft + paper). + +* Fortran library + + - In SINREV, CSCREV, QSCREV, and TSCREV, return error 2 if (X,Y) do + not lie within the perimeter of the projection. In SINREV, stop the + computation of PHI for the "synthesis" projection being applied to + the pure "orthographic" case. Reported by David Berry + (dsb@ast.man.ac.uk). + + - (Internal change) Renamed variables L <-> M in the quadcube + projections to accord with standard usage (and revised WCS draft + paper). + + - (Internal change) Stopped PRJ(11) doing double service in any + projection. It is now set and tested for a specific magic value + rather than simply being non-zero. + + +WCSLIB version 2.3 (1996/06/24) +------------------------------- + +* C library + + - Fixed two bugs in zpnset(). The first led to an incorrect + determination of the degree of the polynomial and would mainly have + affected the efficiency of zpnrev(). The second affected the + determination of the boundary of the projection but would only have + been significant for projections with a point of inflection between + 9 and 10 degrees of the pole. Reported by David Berry, STARLINK. + + - Replaced usage of alloca() in lin.c with malloc() and free() for + portability as suggested by Klaus Banse, ESO (kbanse@eso.org). + + - Allow for C implementations that provide their own versions of + cosd(), sind(), tand(), acosd(), asind(), atand(), and atan2d(). + From Klaus Banse, ESO (kbanse@eso.org). + + - Implemented the CUBEFACE axis for quadcube projections. + + - Made all function prototypes const-correct. + + - Adapted the header files to C++ usage. + + - Added a new test program, twcs1, to verify closure of wcsfwd() and + wcsrev(). The old twcs test program is now called twcs2. + + - Added external arrays of error messages indexed by function return + value. For example, extern const char *wcsmix_errmsg[] for + wcsmix(). Messages for the many proj.c functions are in + prjfwd_errmsg[], etc. + +* Fortran library + + - Implemented the CUBEFACE axis for quadcube projections. + + - Added a new test program, TWCS1, to verify closure of WCSFWD and + WCSREV. The old TWCS test program is now called TWCS2. + + +WCSLIB version 2.2 (1996/01/18) +------------------------------- + +* C library + + - Amended the projection equations for the conics (COP, COD, COE, COO) + and Bonne's projection (BON) to correctly handle southern hemisphere + projections with PROJP1 < 0 (reported by Lindsay Davis, NOAO). + Revised tproj1 and tproj2 to test such cases. + +* Fortran library + + - Amended the projection equations for the conics (COP, COD, COE, COO) + and Bonne's projection (BON) to correctly handle southern hemisphere + projections with PROJP1 < 0 (reported by Lindsay Davis, NOAO). + Revised TPROJ1 and TPROJ2 to test such cases. + + - Increased the dimension of the WCS array from WCS(0:2) to WCS(0:3) + to allow for future handling of the CUBEFACE keyword - WCS(3) will + store an index to the CUBEFACE axis. This affects the call + sequences of WCSSET, WCSFWD, WCSREV, and WCSMIX. + + +WCSLIB version 2.1 (1995/11/17) +------------------------------- + +* C library + + The main change of interest to programmers is that of changed argument + lists for wcsfwd() and wcsrev() as described below. + + - The WCS linear transformations are now implemented in WCSLIB, + complete with matrix inverter. The new files are lin.c, lin.h, and + test program tlin.c. + + - Given either the celestial longitude or latitude plus an element of + the pixel coordinate a new routine, wcsmix(), solves for the + remaining elements by iterating on the unknown celestial coordinate + element using wcsfwd(). + + - The high level driver routines wcsfwd(), wcsrev(), and wcsmix() now + apply the full WCS algorithm chain (except for pixel regularization + table), including parsing the CTYPEn header cards and computing non- + celestial elements of the world coordinate. This required a change + to their argument lists which now more closely reflect the sequence + of algorithms applied. A new routine, wcsset(), parses the CTYPEn. + + - The high level driver routines of WCSLIB 1.0 are available as + intermediate level drivers celset(), celfwd(), and celrev(), but + note that their argument lists have been extended to return native + coordinates. The related struct is now called celprm instead of + wcsprm. + + - The reference point for conic projections is now at the midpoint of + the standard parallels. The FITS header cards PROJP1 and PROJP2 now + give the half-sum (midpoint) and half-difference of the latitudes of + the standard parallels; previously they gave the latitudes of the + standard parallels themselves. The change is reflected in this + release of WCSLIB. + + - A bug in celset() (formerly wcsset()) that misapplied WCS draft + equations 7 has been fixed (thanks to Rick Ebert IPAC/JPL and + Lindsey Davis, NOAO for reporting this). This affected the + computation of Euler angles for the celestial coordinate + transformation for those projections that have their reference point + away from the native pole. In investigating this a deficiency with + the formalism was discovered that led to the introduction of a + LATPOLE FITS header card which may be used to disambiguate where + CRVAL1, CRVAL2, and LONGPOLE do not uniquely determine the latitude + of the native pole. The celprm struct (formerly wcsprm) has been + extended to accomodate LATPOLE. + + - Default values of LONGPOLE and LATPOLE are now supported and their + use is recommended where appropriate. + + - Numerical precision was being lost near the native poles in the SIN, + AIR, and QSC projections and this has been recovered (reported by + Lindsey Davis, NOAO). Floating underflows in CSC are now avoided. + + - Numerical precision was also lost in certain circumstances in the + spherical coordinate transformation routines and this has been + fixed. + + - The test programs have been enhanced in various ways and the library + has been validated on an SGI machine using both 32-bit and 64-bit + compilers. + +* Fortran library + + The main change of interest to programmers is that of changed call + sequences for WCSFWD and WCSREV as described below. + + - The WCS linear transformations are now implemented in WCSLIB, + complete with matrix inverter. The new files are lin.f and test + program tlin.f. + + - Given either the celestial longitude or latitude plus an element of + the pixel coordinate a new routine, WCSMIX, solves for the remaining + elements by iterating on the unknown celestial coordinate element + using WCSFWD. + + - The high level driver routines WCSFWD, WCSREV, and WCSMIX now apply + the full WCS algorithm chain (except for pixel regularization + table), including parsing the CTYPEn header cards and computing non- + celestial elements of the world coordinate. This required a change + to their call sequences which now more closely reflect the sequence + of algorithms applied. A new routine, WCSSET, parses the CTYPEn. + + - The high level driver routines of WCSLIB 1.0 are available as + intermediate level drivers CELSET, CELFWD, and CELREV, but note + that their call sequences have been extended to return native + coordinates. The related parameter array is now called CEL instead + of WCS. + + - The reference point for conic projections is now at the midpoint of + the standard parallels. The FITS header cards PROJP1 and PROJP2 now + give the half-sum (midpoint) and half-difference of the latitudes of + the standard parallels; previously they gave the latitudes of the + standard parallels themselves. The change is reflected in this + release of WCSLIB. + + - A bug in CELSET (formerly WCSSET) that misapplied WCS draft + equations 7 has been fixed (thanks to Rick Ebert IPAC/JPL and + Lindsey Davis, NOAO for reporting this). This affected the + computation of Euler angles for the celestial coordinate + transformation for those projections that have their reference point + away from the native pole. In investigating this a deficiency with + the formalism was discovered that led to the introduction of a + LATPOLE FITS header card which may be used to disambiguate where + CRVAL1, CRVAL2, and LONGPOLE do not uniquely determine the latitude + of the native pole. The CEL parameter array (formerly WCS) has been + extended to accomodate LATPOLE as CEL(4), and the flag variable is + now CEL(5) (formerly WCS(4)). + + - Default values of LONGPOLE and LATPOLE are now supported and their + use is recommended where appropriate. + + - Numerical precision was being lost near the native poles in the SIN, + AIR, and QSC projections and this has been recovered (reported by + Lindsey Davis, NOAO). Floating underflows in CSC are now avoided. + + - Numerical precision was also lost in certain circumstances in the + spherical coordinate transformation routines and this has been + fixed. + + - The test programs have been enhanced in various ways and the + library has been validated on an SGI machine using both 32-bit and + 64-bit compilers. + + +WCSLIB version 1.0 (1995/01/31) +------------------------------- + +* C library + + Initial release. + +* Fortran library + + Initial release. + +------------------------------------------------------------------------ +$Id: CHANGES,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ diff --git a/testbed/astropy__astropy/cextern/wcslib/COPYING b/testbed/astropy__astropy/cextern/wcslib/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..94a9ed024d3859793618152ea559a168bbcbb5e2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/testbed/astropy__astropy/cextern/wcslib/COPYING.LESSER b/testbed/astropy__astropy/cextern/wcslib/COPYING.LESSER new file mode 100644 index 0000000000000000000000000000000000000000..cca7fc278f5c81ce23a2687208f0d63a6ea44009 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/testbed/astropy__astropy/cextern/wcslib/GNUmakefile b/testbed/astropy__astropy/cextern/wcslib/GNUmakefile new file mode 100644 index 0000000000000000000000000000000000000000..f5e59e2b85e9632204198a66bdf553bd457ce6ba --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/GNUmakefile @@ -0,0 +1,207 @@ +#----------------------------------------------------------------------------- +# GNU makefile for building WCSLIB 6.2 +# +# Summary of the main targets +# --------------------------- +# all: Do 'make all' in each subdirectory (excluding ./doxygen). +# check: Do 'make check' in each subdirectory (compile and run tests). +# tests: Do 'make tests' in each subdirectory (compile test programs but +# don't run them). +# install: Do 'make install' in each subdirectory. +# clean: Recursively delete intermediate files produced as part of the +# build, e.g. object modules, core dumps, etc. +# cleaner: Recursively clean, and also delete test executables, test +# input and output, and intermediates produced in compiling the +# programmers' manual. +# distclean (or realclean): Recursively delete all platform-dependent files +# generated during the build, preserving only the programmers' +# manual and man pages (which are normally provided pre-built). +# It is the one to use between builds for multiple platforms. +# cleanest: Like distclean, but deletes everything that can be regenerated +# from the source files, including the programmers' manual and +# man pages, but excluding 'configure'. +# show: Print the values of important variables used in this and the +# other makefiles. +# writable: Run chmod recursively to make all sources writable. +# +# Notes: +# 1) If you need to make changes then preferably modify makedefs.in instead. +# +# 2) Refer also to the makefiles in subdirectories, particularly +# C/GNUmakefile. +# +# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +# http://www.atnf.csiro.au/people/Mark.Calabretta +# $Id: GNUmakefile,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +#----------------------------------------------------------------------------- +# Get configure settings. +SUBDIR := . +include makedefs + +ifeq "$(CHECK)" "nopgplot" + TSTDIRS := $(filter-out pgsbox,$(TSTDIRS)) +endif + +.PHONY : build check chmod clean cleaner cleanest distclean install \ + realclean show tests writable + +build : + -@ for DIR in $(SUBDIRS) ; do \ + echo '' ; \ + $(TIMER) ; \ + $(MAKE) -k -C $$DIR build ; \ + done + +check tests :: show + -@ echo '' + -@ $(TIMER) + @ for DIR in $(SUBDIRS) ; do \ + echo '' ; \ + $(MAKE) -i -C $$DIR cleaner build ; \ + done + -@ echo '' + @ for DIR in $(TSTDIRS) ; do \ + echo '' ; \ + $(TIMER) ; \ + $(MAKE) -k -C $$DIR $@ ; \ + done + +check :: + -@ echo '' + -@ echo 'Summary of results for non-graphical tests' + -@ echo '------------------------------------------' + -@ cat ./*/test_results + @ if grep 'FAIL:' ./*/test_results > /dev/null ; then \ + exit 1 ; \ + else \ + exit 0 ; \ + fi + +install : + @ for DIR in $(INSTDIR) ; do \ + $(MAKE) -k -C $$DIR $@ ; \ + done + $(INSTALL) -m 444 wcsconfig.h wcsconfig_f77.h $(INCDIR) + - if [ ! -d "$(DOCDIR)" ] ; then \ + $(INSTALL) -d -m 775 $(DOCDIR) ; \ + fi + $(INSTALL) -m 444 CHANGES COPYING* README $(DOCDIR) + - if [ -h $(DOCLINK) ] ; then \ + $(RM) $(DOCLINK) ; \ + $(LN_S) $(notdir $(DOCDIR)) $(DOCLINK) ; \ + fi + - if [ ! -d "$(PDFDIR)" ] ; then \ + $(INSTALL) -d -m 775 $(PDFDIR) ; \ + fi + $(INSTALL) -m 444 wcslib.pdf $(PDFDIR) + - if [ ! -d "$(HTMLDIR)/html" ] ; then \ + $(INSTALL) -d -m 775 $(HTMLDIR)/html ; \ + fi + $(INSTALL) -m 444 html/* $(HTMLDIR)/html + if [ ! -d "$(LIBDIR)/pkgconfig" ] ; then \ + $(INSTALL) -d -m 775 $(LIBDIR)/pkgconfig ; \ + fi + $(INSTALL) -m 444 wcslib.pc $(LIBDIR)/pkgconfig/wcslib.pc + +clean cleaner : + for DIR in $(SUBDIRS) doxygen ; do \ + $(MAKE) -C $$DIR $@ ; \ + done + +cleanest distclean realclean : + for DIR in $(SUBDIRS) doxygen ; do \ + $(MAKE) -C $$DIR $@ ; \ + done + - $(RM) *.log + - $(RM) -r autom4te.cache autoscan.log + - $(RM) -r api-sanity-check + - $(RM) confdefs.h conftest.* + - $(RM) config.log config.status configure.lineno + - $(RM) makedefs wcslib.pc + - $(RM) wcsconfig.h wcsconfig_*.h + - $(RM) wcslib-*.tar.gz + +show :: + -@ echo 'Subdirectories to be built...' + -@ echo ' SUBDIRS := $(SUBDIRS)' + -@ echo ' TSTDIRS := $(TSTDIRS)' + -@ echo '' + +writable : + chmod -R u+w . + +GNUmakefile : makedefs ; + +makedefs : makedefs.in config.status + -@ echo '' + -@ $(TIMER) + ./config.status + +config.status : configure + -@ echo '' + -@ $(TIMER) + -@ echo '' + -@ echo "Environment variables that affect 'configure':" + -@ echo " CC = $${CC-(undefined)}" + -@ echo " CFLAGS = $${CFLAGS-(undefined)}" + -@ echo " CPP = $${CPP-(undefined)}" + -@ echo " CPPFLAGS = $${CPPFLAGS-(undefined)}" + -@ echo " F77 = $${F77-(undefined)}" + -@ echo " FFLAGS = $${FFLAGS-(undefined)}" + -@ echo " ARFLAGS = $${ARFLAGS-(undefined)}" + -@ echo " LDFLAGS = $${LDFLAGS-(undefined)}" + -@ echo '' + ./configure --no-create + + +#----------------------------------------------------------------------------- +# These are for code management. + +.PHONY : dist + +dist : + $(MAKE) -C doxygen cleanest build + $(MAKE) -C utils man + $(MAKE) distclean + -@ echo $(WCSLIBPKG)/C/RCS > wcslib.X + -@ echo $(WCSLIBPKG)/C/flexed/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/C/test/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/doxygen/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/Fortran/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/Fortran/test/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/makedefs >> wcslib.X + -@ echo $(WCSLIBPKG)/other >> wcslib.X + -@ echo $(WCSLIBPKG)/pgsbox/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/TODO >> wcslib.X + -@ echo $(WCSLIBPKG)/utils/RCS >> wcslib.X + -@ echo $(WCSLIBPKG)/wcslib.T >> wcslib.X + -@ echo $(WCSLIBPKG)/wcslib.X >> wcslib.X + rm -f $(WCSLIBPKG).tar.bz2 + tar cf - -C .. -X wcslib.X $(WCSLIBPKG) | \ + tar t | \ + grep -v '/$$' | \ + sort > wcslib.T + rm -f wcslib.X + tar cvf $(WCSLIBPKG).tar -C .. -T wcslib.T + rm -f wcslib.T + bzip2 $(WCSLIBPKG).tar + chmod 444 $(WCSLIBPKG).tar.bz2 + +install_dist : + scp -p $(WCSLIBPKG).tar.bz2 cal103@venice:/nfs/ftp/software/wcslib/ + mv -f $(WCSLIBPKG).tar.bz2 ../wcslib-releases/ + ssh cal103@venice "cd /nfs/ftp/software/wcslib/ && \ + rm -f wcslib.tar.bz2 && \ + ln -s $(WCSLIBPKG).tar.bz2 wcslib.tar.bz2" + cp -fp CHANGES wcslib.pdf ~/public_html/WCS/ + rsync --archive --delete html/ ~/public_html/WCS/wcslib/ + +configure : configure.ac + -@ echo '' + -@ $(TIMER) + autoconf + +# Code development overrides must be included specifically before 'configure' +# generates makedefs. +-include flavours diff --git a/testbed/astropy__astropy/cextern/wcslib/INSTALL b/testbed/astropy__astropy/cextern/wcslib/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..a95be75397c2fd86eb815c41ae2672c89f31ba43 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/INSTALL @@ -0,0 +1,336 @@ +------------------------------------------------------------------------------ +WCSLIB 6.2 and PGSBOX 6.2 INSTALLATION +-------------------------------------- + +WCSLIB requires an ANSI C compiler with standard ANSI C environment, that is, +a standard C library and header files as defined in Appendix B of Kernigan & +Ritchie, 2nd ed. + +If you are running a typical Linux distro and have installed WCSLIB before, +then all you should need to do is + + tar pxvf wcslib-6.2.tar.bz2 + cd wcslib-6.2 + make install + +Otherwise, read on. + +Installation of WCSLIB is handled by GNU autoconf; GNU make (referred to here +as 'gmake') must be used. The WCSLIB distribution also includes PGSBOX (refer +to the README file). To unpack the tar file, type + + bzcat wcslib-6.2.tar.bz2 | tar pvxf - + cd wcslib-6.2 + +then if you do not need to specify any configuration options, simply run + + gmake + +This will run 'configure' to generate "makedefs" which is included by the top- +level GNUmakefile and those in each subdirectory, and then build 'libwcs.a', +which includes both the C library and Fortran wrappers, and also libpgsbox.a. + +(WARNING: The build may fail with gmake 3.79, upgrade to 3.79.1 or later.) + +configure tries to determine the location of the PGPLOT and CFITSIO libraries +required by some utilities (wcsware, wcsgrid) and programs in the test suite. +If it fails to find them you can, if you wish, tailor the few variables found +at the start of "makedefs". Of course you do not need to exercise the test +suite in order to build and install the library - if configure fails to find +anything required for that it will issue an explicit error message. + +To build and exercise the test suite use + + gmake check + +To install the object libraries and header files, do + + gmake install + + +TWEAKING THE INSTALLATION DEFAULTS +---------------------------------- + +By default the library and header files are installed in the lib and include +subdirectories of /usr/local/. To change this, or any other options, run +configure separately before gmake: + + ./configure --prefix=/some/other/dir + gmake + +Use + + ./configure --help + +to list configure's options. Useful options are + + --with-pgplotinc + --with-pgplotlib + --with-cfitsioinc + --with-cfitsiolib + +Which allow additional directories to be added to the library and include +file search path. + +Installation of WCSLIB differs a little from most packages in that all +configurable makefile variables are defined in a single file, "makedefs", +which configure generates from "makedefs.in". If you need to redefine any of +the makefile variables you can modify makedefs, or preferably makedefs.in. +The makefile will automatically detect this and re-run config.status to +re-generate a new makedefs. configure also creates four header files: + + wcsconfig.h: Contains general purpose preprocessor definitions. It is + included by the other wcsconfig header files. + + wcsconfig_f77.h: By common convention the WCSLIB Fortran wrappers have + been written (in C) using function names in lower case with an + underscore ("_") suffix. wcsconfig_f77.h defines a preprocessor macro, + F77_FUNC(name,NAME), that may redefine these to suit different name + mangling schemes used by some Fortran compilers. + + wcsconfig_tests.h: Contains C preprocessor definitions for compiling the + test/demo programs. + + wcsconfig_utils.h: Contains C preprocessor macro definitions for compiling + the utility programs provided with WCSLIB. + +If you do have trouble building the library please send me config.log. + + +The INSTALL file provided with GNU autoconf 2.53 is appended without change. + + +Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +http://www.atnf.csiro.au/people/Mark.Calabretta +$Id: INSTALL,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ + +============================================================================== + +Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for variables by setting +them in the environment. You can do that on the command line like this: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/testbed/astropy__astropy/cextern/wcslib/README b/testbed/astropy__astropy/cextern/wcslib/README new file mode 100644 index 0000000000000000000000000000000000000000..c098b3856d7e29d816d9177d975e1c2417f95042 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/README @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ + WCSLIB 6.2 and PGSBOX 6.2 +------------------------------------------------------------------------------ + WCSLIB 6.2 - an implementation of the FITS WCS standard. + Copyright (C) 1995-2018, Mark Calabretta + + This file is part of WCSLIB. + + WCSLIB is free software: you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with WCSLIB. If not, see http://www.gnu.org/licenses. + + Direct correspondence concerning WCSLIB to mark@calabretta.id.au + + Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. + http://www.atnf.csiro.au/people/Mark.Calabretta + $Id: README,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +------------------------------------------------------------------------------ + +Please refer to + + ./INSTALL ...Installation instructions. + + ./html/index.html ...The WCSLIB programmer's manual in HTML format. + ./wcslib.pdf ...The WCSLIB programmer's manual in PDF format. + + ./CHANGES ...Log of changes made to WCSLIB. + + ./THANKS ...List of contributors to WCSLIB. + + ./VALIDATION ...List of platforms on which the installation + procedures and test suite were exercised. + + ./COPYING ...A copy of the GNU General Public License, v3.0. + ./COPYING.LESSER ...A copy of the Lesser GNU General Public License. diff --git a/testbed/astropy__astropy/cextern/wcslib/THANKS b/testbed/astropy__astropy/cextern/wcslib/THANKS new file mode 100644 index 0000000000000000000000000000000000000000..48ee8d733d5bc245104c3f50da165bf5bea2ef32 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/THANKS @@ -0,0 +1,106 @@ +I would like to acknowledge the following people who have contributed +to WCSLIB and/or PGSBOX in some way since 1995 - via bug reports, +patches, suggestions for improvements, positive feedback, etc. + +James Allen (U. Sydney) +James M. Anderson (MPIfR) +Robbie Auld (Cardiff U.) +Klaus Banse (ESO) +David Barnes (ATNF/CSIRO) +Zaak Beekman (Homebrew maintainer for MacOSX) +David Berry (STARLINK & JAC) +Emmanuel Bertin (IAP) +David Binderman +Erik M. Bray (STScI) +Jeremy Brewer (U. Pittsburgh) +Wim Brouw (ATNF/CSIRO) +Peter Bunclark (IoA, U. Cambridge) +Mihai Cara (STScI) +Rodrigo Tobar Carrizo (ICRAR/UWA) +Pan Chai (GSFC/NASA) +Charles Copley +Simon Conseil (CRAL) +Neil Crighton +Cesar Enrique Garcia Dabo (ESO) +Lindsey Davis (NOAO) +Nadezhda (Nadia) Dencheva (STScI) +Ger van Diepen (ASTRON) +Patrick Dowler (CADC/NRC) +Michael Droettboom (STScI) +Rick Ebert (IPAC/NASA) +Ken Ebisawa (GSFC/NASA) +Sbastien Fabbro (Gentoo linux maintainer) +Octavi Fors (U. North Carolina) +Bob Garwood (NRAO) +Mos Giordano (Julia wrappers) +Brian Glendenning (NRAO) +Eric Greisen (NRAO) +Michael Halle (AM/Harvard) +Booth Hartley (IPAC/NASA) +Phil Hodge (STScI) +Bryan Irby (GSFC/NASA) +Justin Jonas (Rhodes U.) +Yves Jung (ESO) +David Kaplan (KITP/UCSB) +Vishal Kasliwal (U. Pennsylvania, LSST) +Daniel S. Katz (JPL/NASA) +Neil Killeen (ATNF/CSIRO) +David King (NRAO) +Martin Kuemmel (U.-Sternwarte Muenchen) +Paul F. Kunz (SLAC/Stanford U.) +Jonas Mller Larsen (ESO) +Dustin Lang (Perimeter Inst.) +Paddy Leahy (U. Manchester) +Jim Lewis (IoA, U. Cambridge) +Pey-Lian Lim (STScI) +Marco Lombardi (ESO) +Lars Kristian Lundin (ESO) +Robert Lupton (Princeton U.) +Craig Markwardt (GSFC/NASA) +Chiara Marmo (U. Paris-Sud) +Malte Marquarding (ATNF/CSIRO) +Jean-Baptiste Marquette (IAP) +Tom Marsh (U. Warwick) +Sean Mattingly (IPAC/NASA) +Dave McConnell (ATNF/CSIRO) +Thomas A. McGlynn (GSFC/NASA) +Michelle Miller (NOAO) +Jessica Mink (CfA) +August Muench (CfA) +Fergal Mullally (Princeton U.) +Clive Page (U. Leicester) +Sergio Pascual (U. Complutense de Madrid, Fedora maintainer) +Bill Pence (NASA/GSFC) +Olivier Perdereau (LAL/IN2P3) +Dirk Petry (ESO) +Ray Plante (NCSA/UIUC) +Paul Price (Princeton U.) +Niruj Mohan Ramanujam (Leiden Obs) +Harold Ravlin (U. Illinois) +Thomas Robitaille (MPIA, STScI) +Boud Roukema (TCfA) +Keith A. Scollick (GSFC/NASA) +Arno Schoenmakers (ASTRON) +Pim Schellart (Princeton U.) +Corentin Schreiber (Oxford U.) +Colin Slater (LSST) +Hanno Spreeuw (ASTRON) +Ole Streicher (Debian maintainer) +Julian Taylor (ESO) +Hans Terlouw (Kapteyn, Groningen) +Peter Teuben (U. Maryland) +Harro Verkouter (JIVE) +John C. Vernaleo (GSFC/NASA) +Martin Vogelaar (Kapteyn, Groningen) +Stephen Walton (CSUN) +Boyd Waters (NRAO) +Randall Wayth (Curtin U.) +Benjamin Alan Weaver (LBL) +Peter Weilbacher (AIP) +Matthew Whiting (ATNF/CSIRO) +Peter Williams (UCB, CfA) +Daren Scot Wilson (NRAO) +Tony Wong (ATNF/CSIRO) + + +$Id: THANKS,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ diff --git a/testbed/astropy__astropy/cextern/wcslib/VALIDATION b/testbed/astropy__astropy/cextern/wcslib/VALIDATION new file mode 100644 index 0000000000000000000000000000000000000000..e2b527f112a2d49d628d4e76fedf35dd749891b5 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/VALIDATION @@ -0,0 +1,582 @@ +Platforms on which the installation procedures and test suite were exercised. + +WCSLIB version 6.1 (2018/10/19) +------------------------------- + +* Dell Latitude XPS 15 9560 (Intel Core i7-7700HQ, 4 cores, 8 CPUs, x86_64) + KDE Neon User Edition 5.13 (over Kubuntu 18.04, (bionic)) + uname -r (kernel version): 4.15.0-29-generic + gcc --version: gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 + gfortran --version: GNU Fortran (Ubuntu 7.3.0-16ubuntu3) 7.3.0 + +* Dell Latitude D610 (Intel Pentium M, 1 processor, i686) + Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.18-6-686 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + gfortran --version: GNU Fortran 95 (GCC) 4.1.2 20061115 (prerelease) + (Debian 4.1.1-21) + + +WCSLIB version 5.20 (2018/10/05) +-------------------------------- + +* Dell Latitude XPS 15 9560 (Intel Core i7-7700HQ, 4 cores, 8 CPUs, x86_64) + KDE Neon User Edition 5.13 (over Kubuntu 18.04, (bionic)) + uname -r (kernel version): 4.15.0-29-generic + gcc --version: gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 + gfortran --version: GNU Fortran (Ubuntu 7.3.0-16ubuntu3) 7.3.0 + + +WCSLIB version 5.19 (2018/07/27) +-------------------------------- + +* Dell Latitude E6530 (Intel Core i7-3740QM, 4 cores, 8 processors, x86_64) + Debian linux 8.10 (jessie) + uname -r (kernel version): 3.16.0-4-amd64 + gcc --version: gcc-8.1.0 (GCC) 8.1.0 (local build) + gfortran --version: GNU Fortran (GCC) 8.1.0 (local build) + + and + + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.18 (2018/01/10) +-------------------------------- + +* Dell Latitude XPS 15 9560 (Intel Core i7-7700HQ, 4 cores, 8 CPUs, x86_64) + KDE Neon User Edition 5.11 (over Kubuntu 16.04, (xenial)) + uname -r (kernel version): 4.10.0-40-generic + gcc --version: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 + gfortran --version: GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 + + +WCSLIB version 5.17 (2017/09/18) +-------------------------------- + +* Dell Latitude E6530 (Intel Core i7-3740QM, 4 cores, 8 processors, x86_64) + Debian linux 8.9 (jessie) + uname -r (kernel version): 3.16.0-4-amd64 + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.16 (2017/01/15) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.6 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.15 (2016/04/05) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.3 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.14 (2016/02/07) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.3 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.13 (2016/01/26) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.3 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.12 (2015/11/15) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.11 (2015/10/18) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.10 (2015/10/09) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.9 (2015/07/21) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.8 (2015/07/08) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.7 (2015/06/29) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.6 (2015/06/14) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 8.0 (jessie) + uname -r (kernel version): 3.16.0-4-686-pae + gcc --version: gcc (Debian 4.9.2-10) 4.9.2 + gfortran --version: GNU Fortran (Debian 4.9.2-10) 4.9.2 + + +WCSLIB version 5.5 (2015/05/05) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 5.4 (2015/04/21) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 5.3 (2015/04/21) +------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 5.2 beta release (2015/04/15) +-------------------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + +* Dell PowerEdge R710 (Intel Xeon E5530, 8 processors, amd64) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-amd64 + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + (Non-graphical tests only.) + +* Mac Mini (Intel Core i7, 4 cores, x86_64) + MacOSX 10.9.5 (13F1066) + uname -r (kernel version): Darwin 13.4.0 + gcc --version: gcc (GCC) 4.8.3 + gfortran --version: GNU Fortran (GCC) 4.8.3 + (Non-graphical tests only.) + + +WCSLIB version 5.1 beta release (2015/04/07) +-------------------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 5.0 beta release (2015/04/05) +-------------------------------------------- + +* Dell Latitude D620 (Intel Centrino T2300, 2 processors, i686) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + +* Dell PowerEdge R710 (Intel Xeon E5530, 8 processors, amd64) + Debian linux 7.8 (wheezy) + uname -r (kernel version): 3.2.0-4-amd64 + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + (Non-graphical tests only.) + +* Dell PowerEdge R820 (Intel Xeon E5-4620, 32 processors, amd64) + Debian linux 6.0.10 (squeeze) + uname -r (kernel version): 3.2.0-0.bpo.4-amd64 + gcc --version: gcc (Debian 4.4.5-8) 4.4.5 + gfortran --version: GNU Fortran (Debian 4.4.5-8) 4.4.5 + (Non-graphical tests only.) + +* Mac Mini (Intel Core i7, 4 cores, x86_64) + MacOSX 10.9.5 (13F1066) + uname -r (kernel version): Darwin 13.4.0 + gcc --version: gcc (GCC) 4.8.3 + gfortran --version: GNU Fortran (GCC) 4.8.3 + (Non-graphical tests only.) + + +WCSLIB version 4.23 (2014/05/11) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 4.22 (2014/04/13) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +* Dell PowerEdge R710 (Intel Xeon, x86_64) running Debian linux 6.0.9 (squeeze) + uname -r (kernel version): 2.6.32-5-amd64 + gcc --version: gcc (Debian 4.4.5-8) 4.4.5 + gfortran --version: GNU Fortran (Debian 4.4.5-8) 4.4.5 + + +* Mac Mini (Intel Core 2 Duo) running MacOSX 10.6.8 (10K549) + uname -r (kernel version): 10.8.0 + gcc --version: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + (Apple Inc. build 5666) (dot 3) + gfortran --version: GNU Fortran (GCC) 4.5.0 20100107 (experimental) + (Non-graphics tests only.) + + +WCSLIB version 4.21 (2014/03/24) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 4.20 (2013/12/18) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 4.19 (2013/09/30) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 4.18 (2013/07/12) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 7.0 (wheezy) + uname -r (kernel version): 3.2.0-4-686-pae + gcc --version: gcc (Debian 4.7.2-5) 4.7.2 + gfortran --version: GNU Fortran (Debian 4.7.2-5) 4.7.2 + + +WCSLIB version 4.17 (2013/01/29) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 5.0.9 (lenny) + uname -r (kernel version): 2.6.26-2-686 + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +WCSLIB version 4.15 (2012/09/26) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 5.0.9 (lenny) + uname -r (kernel version): 2.6.26-2-686 + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +WCSLIB version 4.14 (2012/07/13) +-------------------------------- + +* Dell Latitude D620 (Intel Centrino, i686) running Debian linux 5.0.9 (lenny) + uname -r (kernel version): 2.6.26-2-686 + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +* MacBook Pro (Intel Core 2 Duo) running MacOSX 10.7.3 (11D50) + uname -r (Darwin kernel version): 11.3.0 + gcc --version: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 + (Apple Inc. build 5658) (LLVM build 2336.1.00) + gfortran --version: GNU Fortran (GCC) 4.6.1 + (Non-graphics tests only.) + + +WCSLIB version 4.13.1 (2012/03/15) +---------------------------------- + +* Dell Latitude D630 (Intel Centrino, i686) running Debian linux 5.0.9 (lenny) + uname -r (kernel version): 2.6.32-bpo.5-686 + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +* MacBook Pro (Intel Core 2 Duo) running MacOSX 10.7.3 (11D50) + uname -r (Darwin kernel version): 11.3.0 + gcc --version: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 + (Apple Inc. build 5658) (LLVM build 2336.1.00) + gfortran --version: GNU Fortran (GCC) 4.6.1 + (Non-graphics tests only.) + + +WCSLIB version 4.10 (2012/02/06) +-------------------------------- + +* Dell Latitude D630 (Intel Centrino, i686) running Debian linux 5.0.9 (lenny) + uname -r (kernel version): 2.6.32-bpo.5-686 + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +WCSLIB version 4.8 (2011/08/15) +------------------------------- + +* Dell Latitude D620 (Intel Centrino Duo, i686), Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.24-1-686 (32-bit) + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + +* Dell PowerEdge 2950 (Intel Xeon, 8 x X5460), Debian linux 5.0.8 (lenny) + uname -r (kernel version): 2.6.26-2-amd64 (64-bit) + gcc --version: gcc (Debian 4.3.2-1.1) 4.3.2 + gfortran --version: GNU Fortran (Debian 4.3.2-1.1) 4.3.2 + + +* Marvell SheevaPlug (Feroceon 88FR131 rev 1 ARM v5L), Debian linux 6.0 + (squeeze) + uname -r (kernel version): 2.6.32-5-kirkwood + gcc --version: gcc (Debian 4.4.5-8) 4.4.5 + gfortran --version: GNU Fortran (Debian 4.4.5-8) 4.4.5 + + +* Mac mini (Intel Core 2 Duo) running MacOSX 10.6.2 (10C540) + uname -r (Darwin kernel version): 10.2.0 + gcc --version: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + (Apple Inc. build 5646) + gfortran --version: GNU Fortran (GCC) 4.5.0 20100107 (experimental) + + +* Enterprise 450 Model 2250 (Sparc, sun4u 64-bit), SunOS 5.9 (Solaris 9) + uname -r (SunOS version): 5.9 + gcc --version: gcc (GCC) 4.5.1 + gfortran --version: GNU Fortran (GCC) 4.5.1 + + +WCSLIB version 4.7 (2011/02/07) +------------------------------- + +* Dell Latitude D630 (Intel Centrino, i686) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.24-1-686 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + +* Sun SunFire V20z (AMD Opteron, x86_64) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.18-6-amd64 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + +* Enterprise 450 Model 2250 (Sparc, sun4u 64-bit), SunOS 5.9 (Solaris 9) + uname -r (SunOS version): 5.9 + gcc --version: gcc (GCC) 4.5.1 + gfortran --version: GNU Fortran (GCC) 4.5.1 + + and + + cc -V: cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-14 2004/02/20 + f77 -V: f77: Sun WorkShop 6 update 2 FORTRAN 77 5.3 Patch 111691-07 + 2004/04/23 + + +* Mac Xserve (Quad-Core Intel Xeon) running MacOSX 10.6.5 (10H575) + uname -r (Darwin kernel version): 10.5.0 + gcc --version: 4.2.1 (Apple Inc. build 5664) + gfortran --version: GNU Fortran (GCC) 4.5.0 20100107 (experimental) + + +* Mac mini (Intel Core 2 Duo) running MacOSX 10.6.2 (10C540) + uname -r (Darwin kernel version): 10.2.0 + gcc --version: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + (Apple Inc. build 5646) + gfortran --version: GNU Fortran (GCC) 4.5.0 20100107 (experimental) + + +* Mac mini (Intel Core Duo) running MacOSX 10.4.9 (8P2137) + uname -r (Darwin kernel version): 8.9.1 + gcc --version: gcc (GCC) 4.3.0 20070316 (experimental) + g77 --version: GNU Fortran (GCC) 3.4.0 + + +WCSLIB version 4.5 (2010/07/16) +------------------------------- + +* Dell Latitude D630 (Intel Centrino, i686) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.24-1-686 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + and + + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + ifort -V: Intel(R) Fortran Compiler for 32-bit applications, Version 8.1 + Build 20041118Z Package ID: l_fc_pc_8.1.023 + + +* Mac mini (Intel Core 2 Duo, i386) running MacOSX 10.6.2 (10C540) + uname -r (Darwin kernel version): 10.2.0 + gcc --version: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 + (Apple Inc. build 5646) + gfortran --version: GNU Fortran (GCC) 4.5.0 20100107 (experimental) + + +* Mac mini (Intel Core Duo, i386) running MacOSX 10.4.9 (8P2137) + uname -r (Darwin kernel version): 8.9.1 + gcc --version: gcc (GCC) 4.3.0 20070316 (experimental) + g77 --version: GNU Fortran (GCC) 3.4.0 + + and + + gcc --version: gcc (GCC) 4.3.0 20070316 (experimental) + gfortran --version: GNU Fortran (GCC) 4.3.0 20070316 (experimental) + + +* Sun SunFire V20z (AMD Opteron, x86_64) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.18-6-amd64 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + and + + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + gfortran --version: GNU Fortran 95 (GCC) 4.1.2 20061115 (prerelease) + (Debian 4.1.1-21) + + +* Sun Ultra-60 (Sparc, sun4u) running SunOS 5.6 (Solaris 2.6) + uname -r (SunOS version): 5.6 + gcc --version: 2.95.3 + g77 --version: GNU Fortran 0.5.25 20010315 (release) + + and + + cc -V: cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-14 2004/02/20 + f77 -V: f77: Sun WorkShop 6 update 2 FORTRAN 77 5.3 Patch 111691-07 + 2004/04/23 + + + +WCSLIB version 4.4 (2009/08/06) +------------------------------- + +* Dell Latitude D630 (Intel Centrino, i686) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.24-1-686 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + +* Mac mini (Intel Core Duo, i386) running MacOSX 10.4.9 (8P2137) + uname -r (Darwin kernel version): 8.9.1 + gcc --version: gcc (GCC) 4.3.0 20070316 (experimental) + g77 --version: GNU Fortran (GCC) 3.4.0 + + and + + gcc --version: gcc (GCC) 4.3.0 20070316 (experimental) + gfortran --version: GNU Fortran (GCC) 4.3.0 20070316 (experimental) + + +* Sun SunFire V20z (AMD Opteron, x86_64) running Debian linux 4.0 (etch) + uname -r (kernel version): 2.6.18-6-amd64 + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + g77 --version: GNU Fortran (GCC) 3.4.6 (Debian 3.4.6-5) + + and + + gcc --version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) + gfortran --version: GNU Fortran 95 (GCC) 4.1.2 20061115 (prerelease) + (Debian 4.1.1-21) + + +* Sun SunBlade 1000 (Sparc, sun4u) running SunOS 5.8 (Solaris 2.8) + uname -r (SunOS version): 5.8 + gcc --version: 2.95.3 + g77 --version: GNU Fortran 0.5.25 20010315 (release) + + and + + cc -V: cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-14 2004/02/20 + f77 -V: f77: Sun WorkShop 6 update 2 FORTRAN 77 5.3 Patch 111691-07 + 2004/04/23 + +------------------------------------------------------------------------------ +$Id: VALIDATION,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ diff --git a/testbed/astropy__astropy/cextern/wcslib/config/config.guess b/testbed/astropy__astropy/cextern/wcslib/config/config.guess new file mode 100644 index 0000000000000000000000000000000000000000..ba6af63cc447317362615eb81d0382268ddd0b48 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/config/config.guess @@ -0,0 +1,1486 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-07-18' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 +trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 + +set_cc_for_build() { + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + case `isainfo -b` in + 32) + echo i386-pc-solaris2"$UNAME_REL" + ;; + 64) + echo x86_64-pc-solaris2"$UNAME_REL" + ;; + esac + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm*:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + # shellcheck disable=SC2154 + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/testbed/astropy__astropy/cextern/wcslib/config/config.sub b/testbed/astropy__astropy/cextern/wcslib/config/config.sub new file mode 100644 index 0000000000000000000000000000000000000000..52eb02e29a259e46c91bfad15264ff1b6ae3599d --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/config/config.sub @@ -0,0 +1,1806 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-07-25' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \ + | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \ + | harris | dolphin | highlevel | gould | cbm | ns | masscomp \ + | apple | axis | knuth | cray | microblaze* \ + | sim | cisco | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + craynv) + basic_machine=craynv-cray + os=unicosmp + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper | csky \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=${os:-none} + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + m9s12z | m68hcs12z | hcs12z | s12z) + basic_machine=s12z-unknown + os=${os:-none} + ;; + ms1) + basic_machine=mt-unknown + ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=${os:-none} + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | moxie-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv-* | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + abacus) + basic_machine=abacus-unknown + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + blackfin-*) + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=cnk + ;; + c54x-*) + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=${os:-unicos} + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=${os:-elf} + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=${os:-elf} + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=${os:-bosx} + ;; + dpx2*) + basic_machine=m68k-bull + os=sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + elxsi) + basic_machine=elxsi-elxsi + os=${os:-bsd} + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=hiuxwe2 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv32 + ;; + i*86v4*) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv4 + ;; + i*86v) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv + ;; + i*86sol2) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=solaris2 + ;; + j90 | j90-cray) + basic_machine=j90-cray + os=${os:-unicos} + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + irix*) + ;; + *) + os=irix4 + ;; + esac + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=mint + ;; + mips3*-*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=newsos + ;; + next | m*-next) + basic_machine=m68k-next + case $os in + nextstep* ) + ;; + ns2*) + os=nextstep2 + ;; + *) + os=nextstep3 + ;; + esac + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=hiuxwe2 + ;; + parisc-*) + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=${os:-elf} + ;; + sequent) + basic_machine=i386-sequent + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + simso-wrs) + basic_machine=sparclite-wrs + os=vxworks + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + tile*) + basic_machine=$basic_machine-unknown + os=linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + w65*) + basic_machine=w65-wdc + os=none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=proelf + ;; + x64) + basic_machine=x86_64-pc + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + none) + basic_machine=none-none + os=${os:-none} + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x$os != x ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux + ;; + bluegene*) + os=cnk + ;; + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + solaris) + os=solaris2 + ;; + unixware*) + os=sysv4.2uw + ;; + gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=nto-$os + ;; + esac + ;; + hiux*) + os=hiuxwe2 + ;; + nto-qnx*) + ;; + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + ;; + linux-dietlibc) + os=linux-dietlibc + ;; + linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 + ;; + lynx*) + os=lynxos + ;; + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + opened*) + os=openedition + ;; + os400*) + os=os400 + ;; + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + wince*) + os=wince + ;; + utek*) + os=bsd + ;; + dynix*) + os=bsd + ;; + acis*) + os=aos + ;; + atheos*) + os=atheos + ;; + syllable*) + os=syllable + ;; + 386bsd) + os=bsd + ;; + ctix* | uts*) + os=sysv + ;; + nova*) + os=rtmk-nova + ;; + ns2) + os=nextstep2 + ;; + nsk*) + os=nsk + ;; + # Preserve the version number of sinix5. + sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + sinix*) + os=sysv4 + ;; + tpf*) + os=tpf + ;; + triton*) + os=sysv3 + ;; + oss*) + os=sysv3 + ;; + svr4*) + os=sysv4 + ;; + svr3) + os=sysv3 + ;; + sysvr4) + os=sysv4 + ;; + # This must come after sysvr4. + sysv*) + ;; + ose*) + os=ose + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint + ;; + zvmoe) + os=zvmoe + ;; + dicos*) + os=dicos + ;; + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac + ;; + nacl*) + ;; + ios) + ;; + none) + ;; + *-eabi) + ;; + *) + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=elf + ;; + spu-*) + os=elf + ;; + *-acorn) + os=riscix1.2 + ;; + arm*-rebel) + os=linux + ;; + arm*-semi) + os=aout + ;; + c4x-* | tic4x-*) + os=coff + ;; + c8051-*) + os=elf + ;; + clipper-intergraph) + os=clix + ;; + hexagon-*) + os=elf + ;; + tic54x-*) + os=coff + ;; + tic55x-*) + os=coff + ;; + tic6x-*) + os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=tops20 + ;; + pdp11-*) + os=none + ;; + *-dec | vax-*) + os=ultrix4.2 + ;; + m68*-apollo) + os=domain + ;; + i386-sun) + os=sunos4.0.2 + ;; + m68000-sun) + os=sunos3 + ;; + m68*-cisco) + os=aout + ;; + mep-*) + os=elf + ;; + mips*-cisco) + os=elf + ;; + mips*-*) + os=elf + ;; + or32-*) + os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=sysv3 + ;; + sparc-* | *-sun) + os=sunos4.1.1 + ;; + pru-*) + os=elf + ;; + *-be) + os=beos + ;; + *-ibm) + os=aix + ;; + *-knuth) + os=mmixware + ;; + *-wec) + os=proelf + ;; + *-winbond) + os=proelf + ;; + *-oki) + os=proelf + ;; + *-hp) + os=hpux + ;; + *-hitachi) + os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=sysv + ;; + *-cbm) + os=amigaos + ;; + *-dg) + os=dgux + ;; + *-dolphin) + os=sysv3 + ;; + m68k-ccur) + os=rtu + ;; + m88k-omron*) + os=luna + ;; + *-next) + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs + ;; + *-gould) + os=sysv + ;; + *-highlevel) + os=bsd + ;; + *-encore) + os=bsd + ;; + *-sgi) + os=irix + ;; + *-siemens) + os=sysv4 + ;; + *-masscomp) + os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=uxpv + ;; + *-rom68k) + os=coff + ;; + *-*bug) + os=coff + ;; + *-apple) + os=macos + ;; + *-atari*) + os=mint + ;; + *-wrs) + os=vxworks + ;; + *) + os=none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + riscix*) + vendor=acorn + ;; + sunos*) + vendor=sun + ;; + cnk*|-aix*) + vendor=ibm + ;; + beos*) + vendor=be + ;; + hpux*) + vendor=hp + ;; + mpeix*) + vendor=hp + ;; + hiux*) + vendor=hitachi + ;; + unos*) + vendor=crds + ;; + dgux*) + vendor=dg + ;; + luna*) + vendor=omron + ;; + genix*) + vendor=ns + ;; + clix*) + vendor=intergraph + ;; + mvs* | opened*) + vendor=ibm + ;; + os400*) + vendor=ibm + ;; + ptx*) + vendor=sequent + ;; + tpf*) + vendor=ibm + ;; + vxsim* | vxworks* | windiss*) + vendor=wrs + ;; + aux*) + vendor=apple + ;; + hms*) + vendor=hitachi + ;; + mpw* | macos*) + vendor=apple + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + vendor=atari + ;; + vos*) + vendor=stratus + ;; + esac + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + ;; +esac + +echo "$basic_machine-$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/testbed/astropy__astropy/cextern/wcslib/config/install-sh b/testbed/astropy__astropy/cextern/wcslib/config/install-sh new file mode 100644 index 0000000000000000000000000000000000000000..377bb8687ffe16bfc79ea25c8667cabf72aaf2c2 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/config/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/testbed/astropy__astropy/cextern/wcslib/configure b/testbed/astropy__astropy/cextern/wcslib/configure new file mode 100644 index 0000000000000000000000000000000000000000..452e7aa40baed143afabdbde87c9bcb0e8650f95 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/configure @@ -0,0 +1,9791 @@ +#! /bin/sh +# From configure.ac Revision: 6.2 . +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for WCSLIB 6.2. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: mark@calabretta.id.au about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='WCSLIB' +PACKAGE_TARNAME='wcslib-6.2' +PACKAGE_VERSION='6.2' +PACKAGE_STRING='WCSLIB 6.2' +PACKAGE_BUGREPORT='mark@calabretta.id.au' +PACKAGE_URL='' + +ac_unique_file="C/wcs.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +FLAVOUR +INSTDIR +TSTDIRS +SUBDIRS +PGPLOTLIB +PGPLOTINC +GETWCSTAB +CFITSIOLIB +CFITSIOINC +XMKMF +MAKEFLAGS +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +LN_S +SHRLN +SHRSFX +SHRLD +SHRFLAGS +SONAME +SHRLIB +RANLIB +ARFLAGS +FLIBS +ac_ct_F77 +FFLAGS +F77 +LIBOBJS +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +FLEX +ARCH +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBVER +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_fortran +enable_largefile +with_cfitsio +with_cfitsiolib +with_cfitsioinc +with_pgplot +with_pgplotlib +with_pgplotinc +with_x +enable_utils +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +F77 +FFLAGS +XMKMF' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures WCSLIB 6.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/wcslib-6.2] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of WCSLIB 6.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-fortran=ARG Fortran compiler to use + --disable-fortran don't build the Fortran wrappers or PGSBOX + --disable-largefile omit support for large files + --disable-utils don't build the WCS utilities + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --without-cfitsio eschew CFITSIO + --with-cfitsiolib=DIR directory containing cfitsio library + --with-cfitsioinc=DIR directory containing cfitsio header files + --without-pgplot eschew PGPLOT + --with-pgplotlib=DIR directory containing pgplot library + --with-pgplotinc=DIR directory containing pgplot header files + --with-x use the X Window System + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +WCSLIB configure 6.2 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------ ## +## Report this to mark@calabretta.id.au ## +## ------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_f77_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by WCSLIB $as_me 6.2, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +cat >>confdefs.h <<_ACEOF +#define WCSLIB_VERSION $PACKAGE_VERSION +_ACEOF + + +# Library version number, same as package version. +LIBVER="$PACKAGE_VERSION" + + + +ac_aux_dir= +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +# Get the system type. +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +ARCH="${host_cpu}-$host_os" + + + +# Look for Flex. +# Extract the first word of "flex", so it can be a program name with args. +set dummy flex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_FLEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$FLEX"; then + ac_cv_prog_FLEX="$FLEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_FLEX="flex" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FLEX=$ac_cv_prog_FLEX +if test -n "$FLEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 +$as_echo "$FLEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "x$FLEX" = xflex ; then + # Version 2.5.9 or later is required. + V=`flex --version | awk '{print $2}'` + W=`echo $V | awk -F. '{if ((($1*100 + $2)*100 + $3) < 20509) print "no"}'` + if test "x$W" != x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Flex version $V is too old, ignored." >&5 +$as_echo "$as_me: Flex version $V is too old, ignored." >&6;} + FLEX= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Using Flex version $V." >&5 +$as_echo "$as_me: Using Flex version $V." >&6;} + fi +fi + +if test "x$FLEX" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Flex version 2.5.9 or later does not appear to be + available, will use pre-generated sources." >&5 +$as_echo "$as_me: WARNING: Flex version 2.5.9 or later does not appear to be + available, will use pre-generated sources." >&2;} +fi + + +# Look for an ANSI C compiler. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +if test "x$ac_cv_prog_cc_stdc" = xno -o \ + "x$ac_cv_c_const" = xno -o \ + "x$ac_cv_type_size_t" = xno; then + as_fn_error 1 " + ------------------------------------------------------- + An ANSI standard C library is required to build WCSLIB. + + ERROR: WCSLIB configuration failure. + -------------------------------------------------------" "$LINENO" 5 +fi + +# Check for data types (suggested by autoscan - off_t is only required by +# fitshdr). +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + + +# Check for ANSI C headers. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in ctype.h errno.h limits.h locale.h math.h setjmp.h stdarg.h \ + stdio.h stdlib.h string.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +if test "x$ac_cv_header_stdc" = xno; then + as_fn_error 1 " + ------------------------------------------------------------------- + An ANSI standard C library is required to build WCSLIB. One of the + ANSI C header files it requires is missing or unusable. + + ERROR: WCSLIB configuration failure. + -------------------------------------------------------------------" "$LINENO" 5 +fi + +# Checks for ANSI C library functions (suggested by autoscan - fseeko and +# stat are only required by fitshdr). +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5 +$as_echo_n "checking for floor in -lm... " >&6; } +if ${ac_cv_lib_m_floor+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char floor (); +int +main () +{ +return floor (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_floor=yes +else + ac_cv_lib_m_floor=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5 +$as_echo "$ac_cv_lib_m_floor" >&6; } +if test "x$ac_cv_lib_m_floor" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if ${ac_cv_func_realloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_REALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_REALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +$as_echo "#define realloc rpl_realloc" >>confdefs.h + +fi + + +if ${ac_cv_func_setvbuf_reversed+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_func_setvbuf_reversed=no +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if ${ac_cv_func_stat_empty_string_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + +for ac_func in floor memset pow setlocale sqrt strchr strstr +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# System libraries that may be required by WCSLIB itself. +# SunOS, extra maths functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosd in -lsunmath" >&5 +$as_echo_n "checking for cosd in -lsunmath... " >&6; } +if ${ac_cv_lib_sunmath_cosd+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsunmath $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cosd (); +int +main () +{ +return cosd (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sunmath_cosd=yes +else + ac_cv_lib_sunmath_cosd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunmath_cosd" >&5 +$as_echo "$ac_cv_lib_sunmath_cosd" >&6; } +if test "x$ac_cv_lib_sunmath_cosd" = xyes; then : + LIBS="-lsunmath $LIBS" +fi + + +# See if we can find sincos(). +for ac_func in sincos +do : + ac_fn_c_check_func "$LINENO" "sincos" "ac_cv_func_sincos" +if test "x$ac_cv_func_sincos" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SINCOS 1 +_ACEOF + +fi +done + + +# Check the size and availability of integer data types. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 +$as_echo_n "checking size of long int... " >&6; } +if ${ac_cv_sizeof_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5 +$as_echo "$ac_cv_sizeof_long_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 +$as_echo_n "checking size of long long int... " >&6; } +if ${ac_cv_sizeof_long_long_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 +$as_echo "$ac_cv_sizeof_long_long_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int +_ACEOF + + + +# 64-bit integer data type; use long long int preferentially since that +# accords with "%lld" formatting used in fitshdr.l, e.g. +# int size_t long int long long int +# --- ------ -------- ------------- +# gcc x86: 32 32 32 64 +# gcc x86_64: 32 64 64 64 +if test "x$ac_cv_sizeof_long_long_int" = x8; then + +$as_echo "#define WCSLIB_INT64 long long int" >>confdefs.h + +elif test "x$ac_cv_sizeof_long_int" = x8; then + +$as_echo "#define WCSLIB_INT64 long int" >>confdefs.h + +elif test "x$ac_cv_sizeof_int" = x8; then + +$as_echo "#define WCSLIB_INT64 int" >>confdefs.h + +fi + +# Does printf() have the z modifier for size_t type? Important for 64-bit. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf z format modifier for size_t type" >&5 +$as_echo_n "checking for printf z format modifier for size_t type... " >&6; } +if test "$cross_compiling" = yes; then : + +$as_echo "#define MODZ \"\"" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: assumed not" >&5 +$as_echo "assumed not" >&6; } + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +char buf[64]; + if (sprintf(buf, "%zu", (size_t)1) != 1) + return 1; + else if (strcmp(buf, "1")) + return 2; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +$as_echo "#define MODZ \"z\"" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + +$as_echo "#define MODZ \"\"" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + +# Starting values, may be augmented later. +SUBDIRS="C" +TSTDIRS="C" +INSTDIR="C" + + +# Ways of specifying the Fortran compiler, in order of precedence: +# configure --enable-fortran= +# F77= configure ...bash +# +# Ways of disabling Fortran: +# configure --disable-fortran +# configure --enable-fortran=no +# F77=no configure ...bash +# Check whether --enable-fortran was given. +if test "${enable_fortran+set}" = set; then : + enableval=$enable_fortran; +fi + +# Check whether --enable-fortran was given. +if test "${enable_fortran+set}" = set; then : + enableval=$enable_fortran; +fi + +if test "x$enable_fortran" != x -a "x$enable_fortran" != xyes ; then + F77="$enable_fortran" +fi + +if test "x$F77" = xno ; then + F77= + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Compilation of Fortran wrappers and PGSBOX disabled" >&5 +$as_echo "$as_me: WARNING: Compilation of Fortran wrappers and PGSBOX disabled" >&2;} + +else + if test "x$F77" = x ; then + # Look for a Fortran compiler. + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran g77 f77 ifort xlf frt pgf77 fl32 af77 fort77 f90 \ + xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_F77+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 +$as_echo "$F77" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in gfortran g77 f77 ifort xlf frt pgf77 fl32 af77 fort77 f90 \ + xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_F77+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 +$as_echo "$ac_ct_F77" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi + + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 +$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } +if ${ac_cv_f77_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +if ac_fn_f77_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 +$as_echo "$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 +$as_echo_n "checking whether $F77 accepts -g... " >&6; } +if ${ac_cv_prog_f77_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + FFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_f77_try_compile "$LINENO"; then : + ac_cv_prog_f77_g=yes +else + ac_cv_prog_f77_g=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 +$as_echo "$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +if test $ac_compiler_gnu = yes; then + G77=yes +else + G77= +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi + + if test "x$F77" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + ------------------------------------------------------------------ + Fortran compiler not found, will skip Fortran wrappers and PGSBOX. + ------------------------------------------------------------------" >&5 +$as_echo "$as_me: WARNING: + ------------------------------------------------------------------ + Fortran compiler not found, will skip Fortran wrappers and PGSBOX. + ------------------------------------------------------------------" >&2;} + + # Best guess at Fortran name mangling for use if a compiler does ever + # become available. + $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h + + + else + if test "x$ac_cv_f77_compiler_gnu" = xyes ; then + if test "x$F77" = xg77 -o "x$F77" = xf77 ; then + # Not recognized by gfortran. + FFLAGS="$FFLAGS -Wno-globals" + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -I" >&5 +$as_echo_n "checking whether $F77 accepts -I... " >&6; } + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + FFLAGS_save=$FFLAGS + FFLAGS=-I. + +cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_f77_try_compile "$LINENO"; then : + FFLAGS="$FFLAGS_save -I."; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + FFLAGS="$FFLAGS_save"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Libraries required by the Fortran compiler itself (sets FLIBS). + # Required by utilities and test programs written in C that link to + # Fortran object modules such as pgsbox. + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5 +$as_echo_n "checking how to get verbose linking output from $F77... " >&6; } +if ${ac_cv_prog_f77_v+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_f77_try_compile "$LINENO"; then : + ac_cv_prog_f77_v= +# Try some options frequently used verbose output +for ac_verb in -v -verbose --verbose -V -\#\#\#; do + cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF + +# Compile and link our simple test program by passing a flag (argument +# 1 to this macro) to the Fortran compiler in order to get +# "verbose" output that we can then parse for the Fortran linker +# flags. +ac_save_FFLAGS=$FFLAGS +FFLAGS="$FFLAGS $ac_verb" +eval "set x $ac_link" +shift +$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, +# LIBRARY_PATH; skip all such settings. +ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | + sed '/^Driving:/d; /^Configured with:/d; + '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` +$as_echo "$ac_f77_v_output" >&5 +FFLAGS=$ac_save_FFLAGS + +rm -rf conftest* + +# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# /foo, /bar, and /baz are search directories for the Fortran linker. +# Here, we change these into -L/foo -L/bar -L/baz (and put it first): +ac_f77_v_output="`echo $ac_f77_v_output | + grep 'LPATH is:' | + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" + +# FIXME: we keep getting bitten by quoted arguments; a more general fix +# that detects unbalanced quotes in FLIBS should be implemented +# and (ugh) tested at some point. +case $ac_f77_v_output in + # With xlf replace commas with spaces, + # and remove "-link" and closing parenthesis. + *xlfentry*) + ac_f77_v_output=`echo $ac_f77_v_output | + sed ' + s/,/ /g + s/ -link / /g + s/) *$// + ' + ` ;; + + # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted + # $LIBS confuse us, and the libraries appear later in the output anyway). + *mGLOB_options_string*) + ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + + # Portland Group compiler has singly- or doubly-quoted -cmdline argument + # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. + # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". + *-cmdline\ * | *-ignore\ * | *-def\ *) + ac_f77_v_output=`echo $ac_f77_v_output | sed "\ + s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g + s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g + s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; + + # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. + *fort77*f2c*gcc*) + ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' + /:[ ]\+Running[ ]\{1,\}"gcc"/{ + /"-c"/d + /[.]c"*/d + s/^.*"gcc"/"gcc"/ + s/"//gp + }'` ;; + + # If we are using Cray Fortran then delete quotes. + *cft90*) + ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; +esac + + + # look for -l* and *.a constructs in the output + for ac_arg in $ac_f77_v_output; do + case $ac_arg in + [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) + ac_cv_prog_f77_v=$ac_verb + break 2 ;; + esac + done +done +if test -z "$ac_cv_prog_f77_v"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 +$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} +fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 +$as_echo "$as_me: WARNING: compilation failed" >&2;} +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 +$as_echo "$ac_cv_prog_f77_v" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 +$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } +if ${ac_cv_f77_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$FLIBS" != "x"; then + ac_cv_f77_libs="$FLIBS" # Let the user override the test. +else + +cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF + +# Compile and link our simple test program by passing a flag (argument +# 1 to this macro) to the Fortran compiler in order to get +# "verbose" output that we can then parse for the Fortran linker +# flags. +ac_save_FFLAGS=$FFLAGS +FFLAGS="$FFLAGS $ac_cv_prog_f77_v" +eval "set x $ac_link" +shift +$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 +# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, +# LIBRARY_PATH; skip all such settings. +ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | + sed '/^Driving:/d; /^Configured with:/d; + '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` +$as_echo "$ac_f77_v_output" >&5 +FFLAGS=$ac_save_FFLAGS + +rm -rf conftest* + +# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where +# /foo, /bar, and /baz are search directories for the Fortran linker. +# Here, we change these into -L/foo -L/bar -L/baz (and put it first): +ac_f77_v_output="`echo $ac_f77_v_output | + grep 'LPATH is:' | + sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" + +# FIXME: we keep getting bitten by quoted arguments; a more general fix +# that detects unbalanced quotes in FLIBS should be implemented +# and (ugh) tested at some point. +case $ac_f77_v_output in + # With xlf replace commas with spaces, + # and remove "-link" and closing parenthesis. + *xlfentry*) + ac_f77_v_output=`echo $ac_f77_v_output | + sed ' + s/,/ /g + s/ -link / /g + s/) *$// + ' + ` ;; + + # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted + # $LIBS confuse us, and the libraries appear later in the output anyway). + *mGLOB_options_string*) + ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; + + # Portland Group compiler has singly- or doubly-quoted -cmdline argument + # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. + # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". + *-cmdline\ * | *-ignore\ * | *-def\ *) + ac_f77_v_output=`echo $ac_f77_v_output | sed "\ + s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g + s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g + s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; + + # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. + *fort77*f2c*gcc*) + ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' + /:[ ]\+Running[ ]\{1,\}"gcc"/{ + /"-c"/d + /[.]c"*/d + s/^.*"gcc"/"gcc"/ + s/"//gp + }'` ;; + + # If we are using Cray Fortran then delete quotes. + *cft90*) + ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; +esac + + + +ac_cv_f77_libs= + +# Save positional arguments (if any) +ac_save_positional="$@" + +set X $ac_f77_v_output +while test $# != 1; do + shift + ac_arg=$1 + case $ac_arg in + [\\/]*.a | ?:[\\/]*.a) + ac_exists=false + for ac_i in $ac_cv_f77_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done + + if test x"$ac_exists" = xtrue; then : + +else + ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" +fi + ;; + -bI:*) + ac_exists=false + for ac_i in $ac_cv_f77_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done + + if test x"$ac_exists" = xtrue; then : + +else + if test "$ac_compiler_gnu" = yes; then + for ac_link_opt in $ac_arg; do + ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" + done +else + ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" +fi +fi + ;; + # Ignore these flags. + -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ + |-LANG:=* | -LIST:* | -LNO:* | -link) + ;; + -lkernel32) + case $host_os in + *cygwin*) ;; + *) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" + ;; + esac + ;; + -[LRuYz]) + # These flags, when seen by themselves, take an argument. + # We remove the space between option and argument and re-iterate + # unless we find an empty arg or a new option (starting with -) + case $2 in + "" | -*);; + *) + ac_arg="$ac_arg$2" + shift; shift + set X $ac_arg "$@" + ;; + esac + ;; + -YP,*) + for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do + ac_exists=false + for ac_i in $ac_cv_f77_libs; do + if test x"$ac_j" = x"$ac_i"; then + ac_exists=true + break + fi + done + + if test x"$ac_exists" = xtrue; then : + +else + ac_arg="$ac_arg $ac_j" + ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" +fi + done + ;; + -[lLR]*) + ac_exists=false + for ac_i in $ac_cv_f77_libs; do + if test x"$ac_arg" = x"$ac_i"; then + ac_exists=true + break + fi + done + + if test x"$ac_exists" = xtrue; then : + +else + ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" +fi + ;; + -zallextract*| -zdefaultextract) + ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" + ;; + # Ignore everything else. + esac +done +# restore positional arguments +set X $ac_save_positional; shift + +# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, +# then we insist that the "run path" must be an absolute path (i.e. it +# must begin with a "/"). +case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + ac_ld_run_path=`$as_echo "$ac_f77_v_output" | + sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` + test "x$ac_ld_run_path" != x && + if test "$ac_compiler_gnu" = yes; then + for ac_link_opt in $ac_ld_run_path; do + ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" + done +else + ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" +fi + ;; +esac +fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 +$as_echo "$ac_cv_f77_libs" >&6; } +FLIBS="$ac_cv_f77_libs" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # F77 name mangling (defines the F77_FUNC preprocessor macro). + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5 +$as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; } +if ${ac_cv_f77_dummy_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_f77_dm_save_LIBS=$LIBS + LIBS="$LIBS $FLIBS" + ac_fortran_dm_var=F77_DUMMY_MAIN + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # First, try linking without a dummy main: + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_fortran_dummy_main=none +else + ac_cv_fortran_dummy_main=unknown +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_cv_fortran_dummy_main = unknown; then + for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define $ac_fortran_dm_var $ac_func +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_fortran_dummy_main=$ac_func; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + fi + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main + rm -rf conftest* + LIBS=$ac_f77_dm_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5 +$as_echo "$ac_cv_f77_dummy_main" >&6; } +F77_DUMMY_MAIN=$ac_cv_f77_dummy_main +if test "$F77_DUMMY_MAIN" != unknown; then : + if test $F77_DUMMY_MAIN != none; then + +cat >>confdefs.h <<_ACEOF +#define F77_DUMMY_MAIN $F77_DUMMY_MAIN +_ACEOF + + if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then + +$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h + + fi +fi +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "linking to Fortran libraries from C fails +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5 +$as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; } +if ${ac_cv_f77_mangling+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.$ac_ext <<_ACEOF + subroutine foobar() + return + end + subroutine foo_bar() + return + end +_ACEOF +if ac_fn_f77_try_compile "$LINENO"; then : + mv conftest.$ac_objext cfortran_test.$ac_objext + + ac_save_LIBS=$LIBS + LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_success=no + for ac_foobar in foobar FOOBAR; do + for ac_underscore in "" "_"; do + ac_func="$ac_foobar$ac_underscore" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_success=yes; break 2 +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + done + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + if test "$ac_success" = "yes"; then + case $ac_foobar in + foobar) + ac_case=lower + ac_foo_bar=foo_bar + ;; + FOOBAR) + ac_case=upper + ac_foo_bar=FOO_BAR + ;; + esac + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_success_extra=no + for ac_extra in "" "_"; do + ac_func="$ac_foo_bar$ac_underscore$ac_extra" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_success_extra=yes; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + if test "$ac_success_extra" = "yes"; then + ac_cv_f77_mangling="$ac_case case" + if test -z "$ac_underscore"; then + ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" + else + ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" + fi + if test -z "$ac_extra"; then + ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" + else + ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" + fi + else + ac_cv_f77_mangling="unknown" + fi + else + ac_cv_f77_mangling="unknown" + fi + + LIBS=$ac_save_LIBS + rm -rf conftest* + rm -f cfortran_test* +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compile a simple Fortran program +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5 +$as_echo "$ac_cv_f77_mangling" >&6; } + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +case $ac_cv_f77_mangling in + "lower case, no underscore, no extra underscore") + $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) name" >>confdefs.h + ;; + "lower case, no underscore, extra underscore") + $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, no extra underscore") + $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, extra underscore") + $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h + ;; + "upper case, no underscore, no extra underscore") + $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h + ;; + "upper case, no underscore, extra underscore") + $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, no extra underscore") + $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, extra underscore") + $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h + + $as_echo "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 +$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} + ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + SUBDIRS="C Fortran" + TSTDIRS="C Fortran" + INSTDIR="Fortran" + fi +fi + + +# System-dependent system libraries (for building the sharable library). +#----------------------------------------------------------------------- +# Darwin (contains stubs for long double). +as_ac_Lib=`$as_echo "ac_cv_lib_SystemStubs_printf\\$LDBLStub" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf\$LDBLStub in -lSystemStubs" >&5 +$as_echo_n "checking for printf\$LDBLStub in -lSystemStubs... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lSystemStubs $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char printf\$LDBLStub (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return printf\$LDBLStub (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + LIBS="$LIBS -lSystemStubs" +fi + + + +# Library and installation utilities. +#------------------------------------ +# Static library generation. +# Ensure "non-deterministic" archives are produced during the build process. +ar rU conftest.a > /dev/null 2>&1 && ARFLAGS="U" +rm -f conftest.a + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +# Shared library generation. +if test "x$ac_cv_c_compiler_gnu" = xyes ; then + SHVER=`echo "$LIBVER" | sed -e 's/\..*$//'` + + # Note that -fPIC is on by default for Macs, this just makes it obvious. + SHRFLAGS="-fPIC" + SHRLD="\$(CC) \$(SHRFLAGS)" + + case "$host_os" in + darwin*) + SHRLIB="libwcs.$LIBVER.dylib" + SONAME="libwcs.$SHVER.dylib" + SHRLD="$SHRLD -dynamiclib -single_module" + SHRLD="$SHRLD -compatibility_version $SHVER -current_version $LIBVER" + SHRLN="libwcs.dylib" + + case "$host_cpu" in + powerpc*) + # Switch off -fPIC (not applicable for PowerPC Macs). + CFLAGS="$CFLAGS -mdynamic-no-pic" + ;; + esac + ;; + *) + # Covers Linux and Solaris at least. + SHRLIB="libwcs.so.$LIBVER" + SONAME="libwcs.so.$SHVER" + SHRLD="$SHRLD -shared -Wl,-h\$(SONAME)" + SHRLN="libwcs.so" + ;; + esac + +else + SHRLIB= + SONAME= + SHRFLAGS= + SHRLD= + SHRSFX= + SHRLN= +fi + + + + + + + + +# Installation utilities. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Older versions of GNU make do not have the -O option, which only facilitates +# legibility of the output from parallel builds (make -j). +make --help | grep '\-O' >/dev/null 2>&1 && MAKEFLAGS="-Otarget" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: End of primary configuration. +" >&5 +$as_echo "$as_me: End of primary configuration. +" >&6;} + + +# The following are required to build utilities and test programs. +# ---------------------------------------------------------------- +{ $as_echo "$as_me:${as_lineno-$LINENO}: Looking for libraries etc. for utilities and test suite..." >&5 +$as_echo "$as_me: Looking for libraries etc. for utilities and test suite..." >&6;} + +# Check for other quasi-standard header files. +for ac_header in unistd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UNISTD_H 1 +_ACEOF + +fi + +done + + +# Large file support. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + + + +# Extra places to look for third-party libraries and header files. +LIBDIRS= + + +# Check whether --with-cfitsio was given. +if test "${with_cfitsio+set}" = set; then : + withval=$with_cfitsio; +fi + +if test "x$with_cfitsio" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CFITSIO disabled" >&5 +$as_echo "$as_me: WARNING: CFITSIO disabled" >&2;} +else + +# Check whether --with-cfitsiolib was given. +if test "${with_cfitsiolib+set}" = set; then : + withval=$with_cfitsiolib; +fi + + if test "x$with_cfitsiolib" != x ; then + LIBDIRS="$LIBDIRS $with_cfitsiolib" + fi + + +# Check whether --with-cfitsioinc was given. +if test "${with_cfitsioinc+set}" = set; then : + withval=$with_cfitsioinc; +fi + + if test "x$with_cfitsioinc" != x ; then + CFITSIO_INCDIRS="$with_cfitsioinc" + fi + + CFITSIO_INCDIRS="$CFITSIO_INCDIRS \ + /usr/local/cfitsio/include \ + /local/cfitsio/include" + + LIBDIRS="$LIBDIRS \ + /usr/local/cfitsio/lib \ + /local/cfitsio/lib" +fi + + +# Check whether --with-pgplot was given. +if test "${with_pgplot+set}" = set; then : + withval=$with_pgplot; +fi + +if test "x$with_pgplot" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PGPLOT disabled" >&5 +$as_echo "$as_me: WARNING: PGPLOT disabled" >&2;} +else + +# Check whether --with-pgplotlib was given. +if test "${with_pgplotlib+set}" = set; then : + withval=$with_pgplotlib; +fi + + if test "x$with_pgplotlib" != x ; then + LIBDIRS="$LIBDIRS $with_pgplotlib" + fi + + +# Check whether --with-pgplotinc was given. +if test "${with_pgplotinc+set}" = set; then : + withval=$with_pgplotinc; +fi + + if test "x$with_pgplotinc" != x ; then + PGPLOT_INCDIRS="$with_pgplotinc" + fi + + PGPLOT_INCDIRS="$PGPLOT_INCDIRS \ + /usr/local/pgplot/include \ + /local/pgplot/include" + + LIBDIRS="$LIBDIRS \ + /usr/local/pgplot/lib \ + /local/pgplot/lib" +fi + + +if test "x$with_cfitsio" != xno -o \ + "x$with_pgplot" != xno ; then + LIBDIRS="$LIBDIRS \ + /usr/local/lib \ + /local/lib \ + /opt/local/lib \ + /opt/SUNWspro/lib \ + /sw/lib" + + for LIBDIR in $LIBDIRS ; do + as_ac_File=`$as_echo "ac_cv_file_$LIBDIR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBDIR" >&5 +$as_echo_n "checking for $LIBDIR... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$LIBDIR"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + LDFLAGS="$LDFLAGS -L$LIBDIR" +else + continue +fi + + done + + # Generic include directories. + INCDIRS="/usr/local/include \ + /local/include \ + /opt/local/include \ + /sw/include \ + /local \ + /usr/include" + + + # CFITSIO. + if test "x$with_cfitsio" != xno ; then + # Search for CFITSIO. + for INCDIR in $CFITSIO_INCDIRS $INCDIRS ; do + as_ac_File=`$as_echo "ac_cv_file_$INCDIR/cfitsio/fitsio.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $INCDIR/cfitsio/fitsio.h" >&5 +$as_echo_n "checking for $INCDIR/cfitsio/fitsio.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$INCDIR/cfitsio/fitsio.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + CFITSIOINC="-I$INCDIR/cfitsio"; break +fi + + as_ac_File=`$as_echo "ac_cv_file_$INCDIR/fitsio.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $INCDIR/fitsio.h" >&5 +$as_echo_n "checking for $INCDIR/fitsio.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$INCDIR/fitsio.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + CFITSIOINC="-I$INCDIR"; break +fi + + done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recv in -lsocket" >&5 +$as_echo_n "checking for recv in -lsocket... " >&6; } +if ${ac_cv_lib_socket_recv+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char recv (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return recv (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_recv=yes +else + ac_cv_lib_socket_recv=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_recv" >&5 +$as_echo "$ac_cv_lib_socket_recv" >&6; } +if test "x$ac_cv_lib_socket_recv" = xyes; then : + CFITSIOLIB="-lsocket" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffopen in -lcfitsio" >&5 +$as_echo_n "checking for ffopen in -lcfitsio... " >&6; } +if ${ac_cv_lib_cfitsio_ffopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcfitsio $CFITSIOLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ffopen (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return ffopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cfitsio_ffopen=yes +else + ac_cv_lib_cfitsio_ffopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfitsio_ffopen" >&5 +$as_echo "$ac_cv_lib_cfitsio_ffopen" >&6; } +if test "x$ac_cv_lib_cfitsio_ffopen" = xyes; then : + CFITSIOLIB="-lcfitsio $CFITSIOLIB" +fi + + + if test "x$CFITSIOINC" = x -o "x$CFITSIOLIB" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CFITSIO not found, skipping CFITSIO-dependent tests." >&5 +$as_echo "$as_me: WARNING: CFITSIO not found, skipping CFITSIO-dependent tests." >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: CFITSIO appears to be available." >&5 +$as_echo "$as_me: CFITSIO appears to be available." >&6;} + +$as_echo "#define HAVE_CFITSIO 1" >>confdefs.h + + + # Check for fits_read_wcstab, present in CFITSIO 3.004beta and later. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fits_read_wcstab in -lcfitsio" >&5 +$as_echo_n "checking for fits_read_wcstab in -lcfitsio... " >&6; } +if ${ac_cv_lib_cfitsio_fits_read_wcstab+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcfitsio $CFITSIOLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char fits_read_wcstab (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return fits_read_wcstab (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cfitsio_fits_read_wcstab=yes +else + ac_cv_lib_cfitsio_fits_read_wcstab=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfitsio_fits_read_wcstab" >&5 +$as_echo "$ac_cv_lib_cfitsio_fits_read_wcstab" >&6; } +if test "x$ac_cv_lib_cfitsio_fits_read_wcstab" = xyes; then : + GETWCSTAB= +else + GETWCSTAB=getwcstab.o +fi + + if test "x$GETWCSTAB" != x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fits_read_wcstab not found in CFITSIO, will use + getwcstab.c to compile test programs." >&5 +$as_echo "$as_me: WARNING: fits_read_wcstab not found in CFITSIO, will use + getwcstab.c to compile test programs." >&2;} + fi + fi + fi + + # PGPLOT. + if test "x$F77" != x -a "x$with_pgplot" != xno ; then + # Search for PGPLOT. + for INCDIR in $PGPLOT_INCDIRS $INCDIRS ; do + as_ac_File=`$as_echo "ac_cv_file_$INCDIR/pgplot/cpgplot.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $INCDIR/pgplot/cpgplot.h" >&5 +$as_echo_n "checking for $INCDIR/pgplot/cpgplot.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$INCDIR/pgplot/cpgplot.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + PGPLOTINC="-I$INCDIR/pgplot"; break +fi + + as_ac_File=`$as_echo "ac_cv_file_$INCDIR/cpgplot.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $INCDIR/cpgplot.h" >&5 +$as_echo_n "checking for $INCDIR/cpgplot.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$INCDIR/cpgplot.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + PGPLOTINC="-I$INCDIR"; break +fi + + done + + # FLIBS (found above via AC_F77_LIBRARY_LDFLAGS) only helps if PGPLOT was + # built using the same Fortran compiler that we are using here. + + # PGPLOT compiled by the SUN Fortran compiler but linked with something + # else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iand_ in -lM77" >&5 +$as_echo_n "checking for iand_ in -lM77... " >&6; } +if ${ac_cv_lib_M77_iand_+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lM77 $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char iand_ (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return iand_ (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_M77_iand_=yes +else + ac_cv_lib_M77_iand_=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_M77_iand_" >&5 +$as_echo "$ac_cv_lib_M77_iand_" >&6; } +if test "x$ac_cv_lib_M77_iand_" = xyes; then : + PGPLOTLIB="-lM77 $PGPLOTLIB" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for f77_init in -lF77" >&5 +$as_echo_n "checking for f77_init in -lF77... " >&6; } +if ${ac_cv_lib_F77_f77_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lF77 $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char f77_init (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return f77_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_F77_f77_init=yes +else + ac_cv_lib_F77_f77_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_F77_f77_init" >&5 +$as_echo "$ac_cv_lib_F77_f77_init" >&6; } +if test "x$ac_cv_lib_F77_f77_init" = xyes; then : + PGPLOTLIB="-lF77 $PGPLOTLIB" +fi + + + if test "x$F77" != xg77; then + # For PGPLOT compiled with g77 but linked with something else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfrtbegin" >&5 +$as_echo_n "checking for main in -lfrtbegin... " >&6; } +if ${ac_cv_lib_frtbegin_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfrtbegin $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_frtbegin_main=yes +else + ac_cv_lib_frtbegin_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_frtbegin_main" >&5 +$as_echo "$ac_cv_lib_frtbegin_main" >&6; } +if test "x$ac_cv_lib_frtbegin_main" = xyes; then : + PGPLOTLIB="-lfrtbegin $PGPLOTLIB" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gerror_ in -lg2c" >&5 +$as_echo_n "checking for gerror_ in -lg2c... " >&6; } +if ${ac_cv_lib_g2c_gerror_+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lg2c $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gerror_ (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return gerror_ (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_g2c_gerror_=yes +else + ac_cv_lib_g2c_gerror_=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_g2c_gerror_" >&5 +$as_echo "$ac_cv_lib_g2c_gerror_" >&6; } +if test "x$ac_cv_lib_g2c_gerror_" = xyes; then : + PGPLOTLIB="-lg2c $PGPLOTLIB" +fi + + fi + + if test "x$F77" != xgfortran; then + # For PGPLOT compiled with gfortran but linked with something else. + # Note that if gfortran itself is driving the linker it can be harmful + # to add -lgfortran to the link list without also adding -lgfortranbegin. + # Doing so stops gfortran from adding -lgfortranbegin which is needed to + # resolve "main". + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _gfortran_abort in -lgfortran" >&5 +$as_echo_n "checking for _gfortran_abort in -lgfortran... " >&6; } +if ${ac_cv_lib_gfortran__gfortran_abort+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgfortran $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _gfortran_abort (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return _gfortran_abort (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gfortran__gfortran_abort=yes +else + ac_cv_lib_gfortran__gfortran_abort=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gfortran__gfortran_abort" >&5 +$as_echo "$ac_cv_lib_gfortran__gfortran_abort" >&6; } +if test "x$ac_cv_lib_gfortran__gfortran_abort" = xyes; then : + PGPLOTLIB="-lgfortran $PGPLOTLIB" +fi + + fi + + # Search for X11 includes and libraries. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + + if test "x$no_x" = x; then + if test "x$ac_x_libraries" != x ; then + # Not needed for systems that keep the X11 libraries in /usr/lib. + LDFLAGS="$LDFLAGS -L$ac_x_libraries" + fi + PGPLOTLIB="-lX11 $PGPLOTLIB" + fi + + # It is possible that other libraries may be required depending on what + # graphics drivers were installed with PGPLOT. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } +if ${ac_cv_lib_z_deflate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char deflate (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return deflate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_deflate=yes +else + ac_cv_lib_z_deflate=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = xyes; then : + PGPLOTLIB="-lz $PGPLOTLIB" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_error in -lpng" >&5 +$as_echo_n "checking for png_error in -lpng... " >&6; } +if ${ac_cv_lib_png_png_error+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpng $PGPLOTLIB $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char png_error (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return png_error (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_png_png_error=yes +else + ac_cv_lib_png_png_error=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_error" >&5 +$as_echo "$ac_cv_lib_png_png_error" >&6; } +if test "x$ac_cv_lib_png_png_error" = xyes; then : + PGPLOTLIB="-lpng $PGPLOTLIB" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pgbeg_ in -lpgplot" >&5 +$as_echo_n "checking for pgbeg_ in -lpgplot... " >&6; } +if ${ac_cv_lib_pgplot_pgbeg_+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpgplot $PGPLOTLIB $FLIBS $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pgbeg_ (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return pgbeg_ (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pgplot_pgbeg_=yes +else + ac_cv_lib_pgplot_pgbeg_=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pgplot_pgbeg_" >&5 +$as_echo "$ac_cv_lib_pgplot_pgbeg_" >&6; } +if test "x$ac_cv_lib_pgplot_pgbeg_" = xyes; then : + PGPLOTLIB="-lpgplot $PGPLOTLIB" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpgbeg in -lcpgplot" >&5 +$as_echo_n "checking for cpgbeg in -lcpgplot... " >&6; } +if ${ac_cv_lib_cpgplot_cpgbeg+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcpgplot $PGPLOTLIB $FLIBS $LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cpgbeg (); +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main () +{ +return cpgbeg (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cpgplot_cpgbeg=yes +else + ac_cv_lib_cpgplot_cpgbeg=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpgplot_cpgbeg" >&5 +$as_echo "$ac_cv_lib_cpgplot_cpgbeg" >&6; } +if test "x$ac_cv_lib_cpgplot_cpgbeg" = xyes; then : + PGPLOTLIB="-lcpgplot $PGPLOTLIB" +else + PGPLOTLIB= +fi + + + # Only need the PGPLOT include file to build PGSBOX. + if test "x$PGPLOTINC" != x; then + SUBDIRS="$SUBDIRS pgsbox" + INSTDIR="pgsbox" + fi + + # Also need the PGPLOT library to build pgtest and cpgtest. + if test "x$PGPLOTLIB" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PGPLOT not found, skipping PGPLOT-dependent tests." >&5 +$as_echo "$as_me: WARNING: PGPLOT not found, skipping PGPLOT-dependent tests." >&2;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: PGPLOT appears to be available." >&5 +$as_echo "$as_me: PGPLOT appears to be available." >&6;} + + TSTDIRS="$TSTDIRS pgsbox" + fi + fi +fi + + +# Utilities are compiled last since they need the libraries. +# Ways of disabling them: +# configure --disable-utils +# configure --enable-utils=no +# Check whether --enable-utils was given. +if test "${enable_utils+set}" = set; then : + enableval=$enable_utils; +fi + +if test "x$enable_utils" != xno ; then + SUBDIRS="$SUBDIRS utils" + INSTDIR="$INSTDIR utils" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Compilation of WCS utilities disabled" >&5 +$as_echo "$as_me: WARNING: Compilation of WCS utilities disabled" >&2;} +fi + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: End of auxiliary configuration. +" >&5 +$as_echo "$as_me: End of auxiliary configuration. +" >&6;} + + + + +# Do it. +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring files..." >&5 +$as_echo "$as_me: Configuring files..." >&6;} +ac_config_files="$ac_config_files makedefs wcslib.pc" + +ac_config_headers="$ac_config_headers wcsconfig.h wcsconfig_f77.h wcsconfig_tests.h wcsconfig_utils.h" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by WCSLIB $as_me 6.2, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +WCSLIB config.status 6.2 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "makedefs") CONFIG_FILES="$CONFIG_FILES makedefs" ;; + "wcslib.pc") CONFIG_FILES="$CONFIG_FILES wcslib.pc" ;; + "wcsconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS wcsconfig.h" ;; + "wcsconfig_f77.h") CONFIG_HEADERS="$CONFIG_HEADERS wcsconfig_f77.h" ;; + "wcsconfig_tests.h") CONFIG_HEADERS="$CONFIG_HEADERS wcsconfig_tests.h" ;; + "wcsconfig_utils.h") CONFIG_HEADERS="$CONFIG_HEADERS wcsconfig_utils.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/testbed/astropy__astropy/cextern/wcslib/configure.ac b/testbed/astropy__astropy/cextern/wcslib/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..cf75c2513172819ac3eedb610f9d32f1b23bf38f --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/configure.ac @@ -0,0 +1,528 @@ +#----------------------------------------------------------------------------- +# Process this file with autoconf-2.53 or later to produce a configure script. +#----------------------------------------------------------------------------- +# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +# http://www.atnf.csiro.au/people/Mark.Calabretta +# $Id: configure.ac,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +#----------------------------------------------------------------------------- + +AC_INIT([WCSLIB], [6.2], [mark@calabretta.id.au], [wcslib-6.2]) +AC_PREREQ([2.53]) +AC_REVISION([$Revision: 6.2 $]) +AC_SUBST([PACKAGE_VERSION]) +AC_DEFINE_UNQUOTED([WCSLIB_VERSION], [$PACKAGE_VERSION], [Define wcslib version]) + +# Library version number, same as package version. +LIBVER="$PACKAGE_VERSION" +AC_SUBST([LIBVER]) + +AC_CONFIG_SRCDIR([C/wcs.h]) +AC_CONFIG_AUX_DIR([config]) + +# Get the system type. +AC_CANONICAL_HOST +ARCH="${host_cpu}-$host_os" +AC_SUBST([ARCH]) + + +# Look for Flex. +AC_CHECK_PROG([FLEX], [flex], [flex], [], [], []) +if test "x$FLEX" = xflex ; then + # Version 2.5.9 or later is required. + V=`flex --version | awk '{print $2}'` + W=`echo $V | awk -F. '{if ((($1*100 + $2)*100 + $3) < 20509) print "no"}'` + if test "x$W" != x ; then + AC_MSG_NOTICE([Flex version $V is too old, ignored.]) + FLEX= + else + AC_MSG_NOTICE([Using Flex version $V.]) + fi +fi + +if test "x$FLEX" = x ; then + AC_MSG_WARN([Flex version 2.5.9 or later does not appear to be + available, will use pre-generated sources.]) +fi + + +# Look for an ANSI C compiler. +AC_PROG_CPP +AC_PROG_CC +AC_PROG_CC_STDC +AC_C_CONST +AC_TYPE_SIZE_T +if test "x$ac_cv_prog_cc_stdc" = xno -o \ + "x$ac_cv_c_const" = xno -o \ + "x$ac_cv_type_size_t" = xno; then + AC_MSG_ERROR([ + ------------------------------------------------------- + An ANSI standard C library is required to build WCSLIB. + + ERROR: WCSLIB configuration failure. + -------------------------------------------------------], [1]) +fi + +# Check for data types (suggested by autoscan - off_t is only required by +# fitshdr). +AC_TYPE_OFF_T +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T + +# Check for ANSI C headers. +AC_HEADER_STDC +AC_CHECK_HEADERS([ctype.h errno.h limits.h locale.h math.h setjmp.h stdarg.h \ + stdio.h stdlib.h string.h]) +if test "x$ac_cv_header_stdc" = xno; then + AC_MSG_ERROR([ + ------------------------------------------------------------------- + An ANSI standard C library is required to build WCSLIB. One of the + ANSI C header files it requires is missing or unusable. + + ERROR: WCSLIB configuration failure. + -------------------------------------------------------------------], [1]) +fi + +# Checks for ANSI C library functions (suggested by autoscan - fseeko and +# stat are only required by fitshdr). +AC_CHECK_LIB([m], [floor]) +AC_FUNC_FSEEKO +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_FUNC_SETVBUF_REVERSED +AC_FUNC_STAT +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([floor memset pow setlocale sqrt strchr strstr]) + +# System libraries that may be required by WCSLIB itself. +# SunOS, extra maths functions. +AC_CHECK_LIB([sunmath], [cosd], [LIBS="-lsunmath $LIBS"], [], []) + +# See if we can find sincos(). +AC_CHECK_FUNCS([sincos]) + +# Check the size and availability of integer data types. +AC_CHECK_SIZEOF([int]) +AC_CHECK_SIZEOF([long int]) +AC_CHECK_SIZEOF([long long int]) + +# 64-bit integer data type; use long long int preferentially since that +# accords with "%lld" formatting used in fitshdr.l, e.g. +# int size_t long int long long int +# --- ------ -------- ------------- +# gcc x86: 32 32 32 64 +# gcc x86_64: 32 64 64 64 +if test "x$ac_cv_sizeof_long_long_int" = x8; then + AC_DEFINE([WCSLIB_INT64], [long long int], [64-bit integer data type.]) +elif test "x$ac_cv_sizeof_long_int" = x8; then + AC_DEFINE([WCSLIB_INT64], [long int], [64-bit integer data type.]) +elif test "x$ac_cv_sizeof_int" = x8; then + AC_DEFINE([WCSLIB_INT64], [int], [64-bit integer data type.]) +fi + +# Does printf() have the z modifier for size_t type? Important for 64-bit. +AC_MSG_CHECKING([for printf z format modifier for size_t type]) +AC_RUN_IFELSE( + [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [[char buf[64]; + if (sprintf(buf, "%zu", (size_t)1) != 1) + return 1; + else if (strcmp(buf, "1")) + return 2;]])], + AC_DEFINE([MODZ], ["z"], [printf format modifier for size_t type.]) + AC_MSG_RESULT(yes), + AC_DEFINE([MODZ], [""], [printf format modifier for size_t type.]) + AC_MSG_RESULT(no), + AC_DEFINE([MODZ], [""], [printf format modifier for size_t type.]) + AC_MSG_RESULT(assumed not) +) + + +# Starting values, may be augmented later. +SUBDIRS="C" +TSTDIRS="C" +INSTDIR="C" + + +# Ways of specifying the Fortran compiler, in order of precedence: +# configure --enable-fortran= +# F77= configure ...bash +# +# Ways of disabling Fortran: +# configure --disable-fortran +# configure --enable-fortran=no +# F77=no configure ...bash +AC_ARG_ENABLE([fortran], [AS_HELP_STRING([--enable-fortran=ARG], + [Fortran compiler to use])], []) +AC_ARG_ENABLE([fortran], [AS_HELP_STRING([--disable-fortran], + [don't build the Fortran wrappers or PGSBOX])], []) +if test "x$enable_fortran" != x -a "x$enable_fortran" != xyes ; then + F77="$enable_fortran" +fi + +if test "x$F77" = xno ; then + F77= + + AC_MSG_WARN([Compilation of Fortran wrappers and PGSBOX disabled]) + +else + if test "x$F77" = x ; then + # Look for a Fortran compiler. + AC_PROG_F77([gfortran g77 f77 ifort xlf frt pgf77 fl32 af77 fort77 f90 \ + xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95]) + fi + + if test "x$F77" = x; then + AC_MSG_WARN([ + ------------------------------------------------------------------ + Fortran compiler not found, will skip Fortran wrappers and PGSBOX. + ------------------------------------------------------------------]) + + # Best guess at Fortran name mangling for use if a compiler does ever + # become available. + AC_DEFINE([F77_FUNC(name,NAME)], [name ## _]) + + else + if test "x$ac_cv_f77_compiler_gnu" = xyes ; then + if test "x$F77" = xg77 -o "x$F77" = xf77 ; then + # Not recognized by gfortran. + FFLAGS="$FFLAGS -Wno-globals" + fi + fi + + AC_MSG_CHECKING(whether $F77 accepts -I) + AC_LANG_PUSH(Fortran 77) + FFLAGS_save=$FFLAGS + FFLAGS=-I. + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], []), + [FFLAGS="$FFLAGS_save -I."; AC_MSG_RESULT(yes)], + [FFLAGS="$FFLAGS_save"; AC_MSG_RESULT(no)]) + AC_LANG_POP() + + # Libraries required by the Fortran compiler itself (sets FLIBS). + # Required by utilities and test programs written in C that link to + # Fortran object modules such as pgsbox. + AC_F77_LIBRARY_LDFLAGS + + # F77 name mangling (defines the F77_FUNC preprocessor macro). + AC_F77_WRAPPERS + + SUBDIRS="C Fortran" + TSTDIRS="C Fortran" + INSTDIR="Fortran" + fi +fi + + +# System-dependent system libraries (for building the sharable library). +#----------------------------------------------------------------------- +# Darwin (contains stubs for long double). +AC_CHECK_LIB([SystemStubs], [printf\$LDBLStub], [LIBS="$LIBS -lSystemStubs"], + [], []) + + +# Library and installation utilities. +#------------------------------------ +# Static library generation. +# Ensure "non-deterministic" archives are produced during the build process. +ar rU conftest.a > /dev/null 2>&1 && ARFLAGS="U" +rm -f conftest.a +AC_SUBST([ARFLAGS]) +AC_PROG_RANLIB + +# Shared library generation. +if test "x$ac_cv_c_compiler_gnu" = xyes ; then + SHVER=`echo "$LIBVER" | sed -e 's/\..*$//'` + + # Note that -fPIC is on by default for Macs, this just makes it obvious. + SHRFLAGS="-fPIC" + SHRLD="\$(CC) \$(SHRFLAGS)" + + case "$host_os" in + darwin*) + SHRLIB="libwcs.$LIBVER.dylib" + SONAME="libwcs.$SHVER.dylib" + SHRLD="$SHRLD -dynamiclib -single_module" + SHRLD="$SHRLD -compatibility_version $SHVER -current_version $LIBVER" + SHRLN="libwcs.dylib" + + case "$host_cpu" in + powerpc*) + # Switch off -fPIC (not applicable for PowerPC Macs). + CFLAGS="$CFLAGS -mdynamic-no-pic" + ;; + esac + ;; + *) + # Covers Linux and Solaris at least. + SHRLIB="libwcs.so.$LIBVER" + SONAME="libwcs.so.$SHVER" + SHRLD="$SHRLD -shared -Wl,-h\$(SONAME)" + SHRLN="libwcs.so" + ;; + esac + +else + SHRLIB= + SONAME= + SHRFLAGS= + SHRLD= + SHRSFX= + SHRLN= +fi + +AC_SUBST([SHRLIB]) +AC_SUBST([SONAME]) +AC_SUBST([SHRFLAGS]) +AC_SUBST([SHRLD]) +AC_SUBST([SHRSFX]) +AC_SUBST([SHRLN]) + +# Installation utilities. +AC_PROG_LN_S +AC_PROG_INSTALL + +# Older versions of GNU make do not have the -O option, which only facilitates +# legibility of the output from parallel builds (make -j). +make --help | grep '\-O' >/dev/null 2>&1 && MAKEFLAGS="-Otarget" +AC_SUBST([MAKEFLAGS]) + +AC_MSG_NOTICE([End of primary configuration. +]) + + +# The following are required to build utilities and test programs. +# ---------------------------------------------------------------- +AC_MSG_NOTICE([Looking for libraries etc. for utilities and test suite...]) + +# Check for other quasi-standard header files. +AC_CHECK_HEADERS([unistd.h]) + +# Large file support. +AC_FUNC_FSEEKO +AC_SYS_LARGEFILE + + +# Extra places to look for third-party libraries and header files. +LIBDIRS= + +AC_ARG_WITH([cfitsio], [AS_HELP_STRING([--without-cfitsio], + [eschew CFITSIO])], []) +if test "x$with_cfitsio" = xno ; then + AC_MSG_WARN([CFITSIO disabled]) +else + AC_ARG_WITH([cfitsiolib], [AS_HELP_STRING([--with-cfitsiolib=DIR], + [directory containing cfitsio library])], []) + if test "x$with_cfitsiolib" != x ; then + LIBDIRS="$LIBDIRS $with_cfitsiolib" + fi + + AC_ARG_WITH([cfitsioinc], [AS_HELP_STRING([--with-cfitsioinc=DIR], + [directory containing cfitsio header files])], []) + if test "x$with_cfitsioinc" != x ; then + CFITSIO_INCDIRS="$with_cfitsioinc" + fi + + CFITSIO_INCDIRS="$CFITSIO_INCDIRS \ + /usr/local/cfitsio/include \ + /local/cfitsio/include" + + LIBDIRS="$LIBDIRS \ + /usr/local/cfitsio/lib \ + /local/cfitsio/lib" +fi + +AC_ARG_WITH([pgplot], [AS_HELP_STRING([--without-pgplot], + [eschew PGPLOT])], []) +if test "x$with_pgplot" = xno ; then + AC_MSG_WARN([PGPLOT disabled]) +else + AC_ARG_WITH([pgplotlib], [AS_HELP_STRING([--with-pgplotlib=DIR], + [directory containing pgplot library])], []) + if test "x$with_pgplotlib" != x ; then + LIBDIRS="$LIBDIRS $with_pgplotlib" + fi + + AC_ARG_WITH([pgplotinc], [AS_HELP_STRING([--with-pgplotinc=DIR], + [directory containing pgplot header files])], []) + if test "x$with_pgplotinc" != x ; then + PGPLOT_INCDIRS="$with_pgplotinc" + fi + + PGPLOT_INCDIRS="$PGPLOT_INCDIRS \ + /usr/local/pgplot/include \ + /local/pgplot/include" + + LIBDIRS="$LIBDIRS \ + /usr/local/pgplot/lib \ + /local/pgplot/lib" +fi + + +if test "x$with_cfitsio" != xno -o \ + "x$with_pgplot" != xno ; then + LIBDIRS="$LIBDIRS \ + /usr/local/lib \ + /local/lib \ + /opt/local/lib \ + /opt/SUNWspro/lib \ + /sw/lib" + + for LIBDIR in $LIBDIRS ; do + AC_CHECK_FILE([$LIBDIR], [LDFLAGS="$LDFLAGS -L$LIBDIR"], [continue]) + done + + # Generic include directories. + INCDIRS="/usr/local/include \ + /local/include \ + /opt/local/include \ + /sw/include \ + /local \ + /usr/include" + + + # CFITSIO. + if test "x$with_cfitsio" != xno ; then + # Search for CFITSIO. + for INCDIR in $CFITSIO_INCDIRS $INCDIRS ; do + AC_CHECK_FILE([$INCDIR/cfitsio/fitsio.h], + [CFITSIOINC="-I$INCDIR/cfitsio"; break]) + AC_CHECK_FILE([$INCDIR/fitsio.h], [CFITSIOINC="-I$INCDIR"; break]) + done + + AC_CHECK_LIB([socket], [recv], [CFITSIOLIB="-lsocket"], [], [$LIBS]) + AC_CHECK_LIB([cfitsio], [ffopen], [CFITSIOLIB="-lcfitsio $CFITSIOLIB"], [], + [$CFITSIOLIB $LIBS]) + + if test "x$CFITSIOINC" = x -o "x$CFITSIOLIB" = x; then + AC_MSG_WARN([CFITSIO not found, skipping CFITSIO-dependent tests.]) + else + AC_MSG_NOTICE([CFITSIO appears to be available.]) + AC_DEFINE([HAVE_CFITSIO], [1], [Define to 1 if CFITSIO is available.]) + + # Check for fits_read_wcstab, present in CFITSIO 3.004beta and later. + AC_CHECK_LIB([cfitsio], [fits_read_wcstab], [GETWCSTAB=], + [GETWCSTAB=getwcstab.o], [$CFITSIOLIB $LIBS]) + if test "x$GETWCSTAB" != x ; then + AC_MSG_WARN([fits_read_wcstab not found in CFITSIO, will use + getwcstab.c to compile test programs.]) + fi + fi + fi + + # PGPLOT. + if test "x$F77" != x -a "x$with_pgplot" != xno ; then + # Search for PGPLOT. + for INCDIR in $PGPLOT_INCDIRS $INCDIRS ; do + AC_CHECK_FILE([$INCDIR/pgplot/cpgplot.h], + [PGPLOTINC="-I$INCDIR/pgplot"; break]) + AC_CHECK_FILE([$INCDIR/cpgplot.h], [PGPLOTINC="-I$INCDIR"; break]) + done + + # FLIBS (found above via AC_F77_LIBRARY_LDFLAGS) only helps if PGPLOT was + # built using the same Fortran compiler that we are using here. + + # PGPLOT compiled by the SUN Fortran compiler but linked with something + # else. + AC_CHECK_LIB([M77], [iand_], [PGPLOTLIB="-lM77 $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + AC_CHECK_LIB([F77], [f77_init], [PGPLOTLIB="-lF77 $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + + if test "x$F77" != xg77; then + # For PGPLOT compiled with g77 but linked with something else. + AC_CHECK_LIB([frtbegin], [main], [PGPLOTLIB="-lfrtbegin $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + AC_CHECK_LIB([g2c], [gerror_], [PGPLOTLIB="-lg2c $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + fi + + if test "x$F77" != xgfortran; then + # For PGPLOT compiled with gfortran but linked with something else. + # Note that if gfortran itself is driving the linker it can be harmful + # to add -lgfortran to the link list without also adding -lgfortranbegin. + # Doing so stops gfortran from adding -lgfortranbegin which is needed to + # resolve "main". + AC_CHECK_LIB([gfortran], [_gfortran_abort], + [PGPLOTLIB="-lgfortran $PGPLOTLIB"], [], + [$PGPLOTLIB $LIBS]) + fi + + # Search for X11 includes and libraries. + AC_PATH_X + if test "x$no_x" = x; then + if test "x$ac_x_libraries" != x ; then + # Not needed for systems that keep the X11 libraries in /usr/lib. + LDFLAGS="$LDFLAGS -L$ac_x_libraries" + fi + PGPLOTLIB="-lX11 $PGPLOTLIB" + fi + + # It is possible that other libraries may be required depending on what + # graphics drivers were installed with PGPLOT. + AC_CHECK_LIB([z], [deflate], [PGPLOTLIB="-lz $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + AC_CHECK_LIB([png], [png_error], [PGPLOTLIB="-lpng $PGPLOTLIB"], + [], [$PGPLOTLIB $LIBS]) + AC_CHECK_LIB([pgplot], [pgbeg_], [PGPLOTLIB="-lpgplot $PGPLOTLIB"], + [], [$PGPLOTLIB $FLIBS $LIBS]) + AC_CHECK_LIB([cpgplot], [cpgbeg], [PGPLOTLIB="-lcpgplot $PGPLOTLIB"], + [PGPLOTLIB=], [$PGPLOTLIB $FLIBS $LIBS]) + + # Only need the PGPLOT include file to build PGSBOX. + if test "x$PGPLOTINC" != x; then + SUBDIRS="$SUBDIRS pgsbox" + INSTDIR="pgsbox" + fi + + # Also need the PGPLOT library to build pgtest and cpgtest. + if test "x$PGPLOTLIB" = x; then + AC_MSG_WARN([PGPLOT not found, skipping PGPLOT-dependent tests.]) + else + AC_MSG_NOTICE([PGPLOT appears to be available.]) + + TSTDIRS="$TSTDIRS pgsbox" + fi + fi +fi + + +# Utilities are compiled last since they need the libraries. +# Ways of disabling them: +# configure --disable-utils +# configure --enable-utils=no +AC_ARG_ENABLE([utils], [AS_HELP_STRING([--disable-utils], + [don't build the WCS utilities])], []) +if test "x$enable_utils" != xno ; then + SUBDIRS="$SUBDIRS utils" + INSTDIR="$INSTDIR utils" +else + AC_MSG_WARN([Compilation of WCS utilities disabled]) +fi + + +AC_SUBST([CFITSIOINC]) +AC_SUBST([CFITSIOLIB]) +AC_SUBST([GETWCSTAB]) + +AC_SUBST([PGPLOTINC]) +AC_SUBST([PGPLOTLIB]) + +AC_SUBST([SUBDIRS]) +AC_SUBST([TSTDIRS]) +AC_SUBST([INSTDIR]) + +AC_MSG_NOTICE([End of auxiliary configuration. +]) + +AC_SUBST([FLAVOUR]) + + +# Do it. +AC_MSG_NOTICE([Configuring files...]) +AC_CONFIG_FILES([makedefs wcslib.pc]) +AC_CONFIG_HEADERS([wcsconfig.h wcsconfig_f77.h wcsconfig_tests.h wcsconfig_utils.h]) +AC_OUTPUT diff --git a/testbed/astropy__astropy/cextern/wcslib/flavours b/testbed/astropy__astropy/cextern/wcslib/flavours new file mode 100644 index 0000000000000000000000000000000000000000..a3c3ed6382adfe4c6397075cdf4476385d1b59c4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/flavours @@ -0,0 +1,218 @@ +#----------------------------------------------------------------------------- +# Makefile overrides for various combinations of architecture, operating +# system and compiler. Used for development and testing only, not required +# for building WCSLIB. +# +# Variables like CC and CFLAGS are exported into the environment so that they +# will be seen by 'configure'. Thus, normal usage is as follows: +# +# make distclean +# make FLAVOUR=Linux configure +# make +# +# Reminder: add '-d' to FLFLAGS for debugging. +# +# $Id: flavours,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +#----------------------------------------------------------------------------- + +# The list of FLAVOURs can be set on the command line. +F := $(shell echo $(FLAVOURS) | tr a-z A-Z) +ifeq "$F" "" + F := + FLAVOURS := "" +endif + +ifeq "$F" "LINUX" + override FLAVOURS := "" Linux Linuxp +endif + +ifeq "$F" "SUN" + override FLAVOURS := "" SUN/GNU SUN/GNU3 SUN/GNUp SUN/ANSI +endif + +ifeq "$F" "PURE" + override FLAVOURS := SUN/Pure SUN/Quant +endif + +F := + + +# Various C standards handled by features.h in Linux. +FEATURES := +ifeq "$(notdir $(shell pwd))" "utils" + # To get off_t for fseeko() usage in fitshdr when gcc is invoked with the + # -std=c89 (same as -ansi) or the -std=c99 options. + FEATURES := -D_XOPEN_SOURCE +endif + +# Elide warnings about padding in foreign structs, particularly in fitsio.h. +ifneq "$(findstring $(SUBDIR),C Fortran pgsbox)" "" + WPADDED := -Wpadded +endif + + +# Linux with gcc/gfortran (also works for Darwin). +ifeq "$(FLAVOUR)" "Linux" + F := $(FLAVOUR) + export CC := gcc -std=c99 -pedantic + export CPPFLAGS := $(FEATURES) + export CFLAGS := -g -O0 -Wall -Wextra -Wno-long-long $(WPADDED) + export F77 := gfortran + export FFLAGS := -g -O0 -fimplicit-none -Wall -I. + export LDFLAGS := + ifdef VALGRIND + override VALGRIND := valgrind -v --leak-check=full --show-leak-kinds=all + override VALGRIND += --track-origins=yes + endif +endif + +ifeq "$(FLAVOUR)" "Linux8" + F := $(FLAVOUR) + export CC := gcc-8.1.0 -std=c99 -pedantic + export CPPFLAGS := $(FEATURES) -D_FORTIFY_SOURCE=2 + export CFLAGS := -g -O2 -Wall -Wextra -Wno-long-long $(WPADDED) + export F77 := gfortran-8.1.0 + export FFLAGS := -g -O2 -fimplicit-none -Wall -I. + export LDFLAGS := + export LD_RUN_PATH := /usr/local/lib64 + ifdef VALGRIND + override VALGRIND := valgrind -v --leak-check=full --show-leak-kinds=all + override VALGRIND += --track-origins=yes + endif +endif + +ifeq "$(FLAVOUR)" "Linuxp" + F := $(FLAVOUR) + export CC := gcc -std=c99 -pedantic + export CPPFLAGS := $(FEATURES) + export CFLAGS := -pg -g -O -Wall -Wextra -Wno-long-long $(WPADDED) + export FFLAGS := -pg -a -g -O -fimplicit-none -Wall -I. + export LDFLAGS := -pg -g $(filter -L%, $(LDFLAGS)) + override EXTRA_CLEAN := gmon.out bb.out +endif + + +# Solaris with gcc/gfortran 4.x (lynx). +ifeq "$(FLAVOUR)" "SUN/GNU" + F := $(FLAVOUR) + export CC := gcc -std=c99 + export CPPFLAGS := $(FEATURES) + export CFLAGS := -g -Wall -Wno-long-long $(WPADDED) + export F77 := gfortran + export FFLAGS := -g -fimplicit-none -Wall -I. + LD := gcc +endif + +ifeq "$(FLAVOUR)" "SUN/GNU3" + F := $(FLAVOUR) + export CC := gcc-3.1.1 -std=c99 + export CPPFLAGS := $(FEATURES) + export CFLAGS := -g -Wall -Wno-long-long $(WPADDED) + export F77 := g77-3.1.1 + export FFLAGS := -g -Wimplicit -Wunused -Wno-globals -I. + LD := gcc-3.1.1 +endif + +ifeq "$(FLAVOUR)" "SUN/GNUp" + F := $(FLAVOUR) + export CC := gcc -std=c99 -pedantic + export CPPFLAGS := $(FEATURES) + export CFLAGS := -pg -a -g -O -Wall -Wno-long-long $(WPADDED) + export FFLAGS := -pg -a -g -O -fimplicit-none -Wall -I. + export LDFLAGS := -pg -a -g $(filter -L%, $(LDFLAGS)) + override EXTRA_CLEAN := gmon.out bb.out +endif + + +# Solaris with SUN cc/f77. +ifeq "$(FLAVOUR)" "SUN/ANSI" + F := $(FLAVOUR) + WCSTRIG := NATIVE + export CC := cc + export CFLAGS := -g -I/usr/local/include + export F77 := f77 + export FFLAGS := -g -erroff=WDECL_LOCAL_NOTUSED + LD := f77 +endif + + +# Purify and quantify in Solaris. +ifeq "$(FLAVOUR)" "SUN/Pure" + F := $(FLAVOUR) + WCSTRIG := NATIVE + export CC := purify gcc + export CFLAGS := -g + export F77 := purify gcc + export FFLAGS := -g -Wimplicit -Wno-globals -I. + export LDFLAGS := $(filter -L%, $(LDFLAGS)) + override EXTRA_CLEAN := *_pure_p*.[ao] *.pcv .pure ../C/*_pure_p*.[ao] +endif + +ifeq "$(FLAVOUR)" "SUN/Quant" + F := $(FLAVOUR) + WCSTRIG := NATIVE + export CC := quantify gcc + export CFLAGS := -g + export F77 := quantify gcc + export FFLAGS := -g -Wimplicit -Wno-globals -I. + export LDFLAGS := $(filter -L%, $(LDFLAGS)) + override EXTRA_CLEAN := *_pure_q*.[ao] .pure +endif + + +# Check FLAVOUR. +ifneq "$F" "$(FLAVOUR)" + override FLAVOUR := unrecognised +endif + +# Check VALGRIND. +ifeq "$(findstring valgrind, $(VALGRIND))" "valgrind" + override MODE := interactive +else + # Unrecognised. + override VALGRIND := +endif + +# Check MODE. +ifeq "$(MODE)" "interactive" + # Important not to have output batched when running the test programs. + MAKEFLAGS := $(filter-out -Otarget,$(MAKEFLAGS)) -Onone +else + # Unrecognised. + override MODE := +endif + + +# gmake uses FC in place of configure's F77. +ifdef F77 + FC := $(F77) +endif + +ifndef TIMER + TIMER := date +"%a %Y/%m/%d %X %z, executing on $$HOST" +endif + +ifdef FLAVOUR + TIMER := $(TIMER) ; echo " with $(FLAVOUR) FLAVOUR." +endif + +# Experimental (see http://upstream-tracker.org/versions/wcslib.html). +api-sanity-check : + -@ $(RM) -r $@/ + @ mkdir $@/ + @ cp C/*.h C/$(SHRLIB) $@/ + @ echo "$(LIBVER)" > $@/opts.xml + @ echo "." >> $@/opts.xml + @ echo "." >> $@/opts.xml + @ echo "-Dwtbarr=wtbarr_s" >> $@/opts.xml + cd $@ && api-sanity-checker -lib WCSLIB -d opts.xml \ + -show-retval -gen -build -run + +show :: + -@ echo 'For code development...' + -@ echo ' FLAVOURS := $(FLAVOURS)' + -@ echo ' FLAVOUR := $(FLAVOUR)' + -@ echo ' MODE := $(MODE)' + -@ echo ' VALGRIND := $(VALGRIND)' + -@ echo ' EXTRA_CLEAN := $(EXTRA_CLEAN)' + -@ echo '' diff --git a/testbed/astropy__astropy/cextern/wcslib/makedefs.in b/testbed/astropy__astropy/cextern/wcslib/makedefs.in new file mode 100644 index 0000000000000000000000000000000000000000..bafb88bc5d851968e7c90261ab89cb2b5259ff39 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/makedefs.in @@ -0,0 +1,251 @@ +#----------------------------------------------------------------------------- +# GNU makefile definitions for building WCSLIB 6.2 +# +# makedefs is generated from makedefs.in by configure. It contains variable +# definitions and some general-purpose rules for building WCSLIB. +# +# Targets defined here +# -------------------- +# printenv: Print the environment as seen within makefile rules. +# show: Print the values of all makefile variables used. +# +# Notes: +# 1) If you need to make changes then it may be preferable to modify +# makedefs.in (not makedefs). The makefile will detect this and +# automatically re-run config.status to regenerate makedefs. +# +# 2) There are three choices for trigd functions - cosd(), sind(), tand(), +# acosd(), asind(), atand(), and atan2d(), made by setting WCSTRIG: +# +# 1: Use the wrapper functions supplied with WCSLIB (default): +# WCSTRIG := WRAPPER +# +# 2: Use native trigd functions supplied in a mathematics library such +# as libsunmath (you will also need to add the library to the LIBS +# variable below): +# WCSTRIG := NATIVE +# +# 3: Use C preprocessor macro implementations of the trigd functions +# (this method is typically 20% faster but may lead to rounding +# errors near the poles): +# WCSTRIG := MACRO +# +# 3) Variables for creating the shared (dynamic) library are currently +# only set by 'configure' if the GNU C compiler is used. However, +# you can set these variables by hand, preferably in makedefs.in. +# +# Shared libraries require position-independent code (PIC) which imposes +# a performance overhead. Consequently the static libraries are +# compiled separately without this option. +# +# The shared library will be installed with version number, e.g. as +# libwcs.so.6.2 or libwcs.6.2.dylib with or without the symlink +# required to make it visible to the linker (controlled by the SHRLN +# variable). On Macs it is deliberately not created because its very +# existence precludes static linking with the cctools linker. You can +# still link dynamically by using -lwcs.6.2. +# +# 4) PGPLOT is Tim Pearson's Fortran graphics library with separate C +# interface available from astro.caltech.edu. It is only required by +# one utility, wcsgrid, and the test programs that plot test grids +# (tprj2, tcel1, tcel2, tspc, ttab2, ttab3, twcsmix, and tpih2). You can +# skip these by setting PGPLOTLIB to blank. +# +# It is difficult for configure to deduce what auxiliary graphics +# libraries may be needed for PGPLOT since it depends on which of many +# possible graphics drivers were selected when PGPLOT was installed. +# Therefore it is quite likely that you will need to add additional +# libraries to PGPLOTLIB. +# +# 5) CFITSIO is Bill Pence's FITS I/O library written in C with Fortran +# wrappers, available from http://heasarc.gsfc.nasa.gov/fitsio. +# +# CFITSIO is required by three utilities, HPXcvt, wcsgrid, and wcsware, +# and also by the test programs twcstab and twcshdr. wcsware and the +# test programs use fits_read_wcstab() which is implemented by +# getwcstab.c. However, this implementation is included in CFITSIO post +# 3.004beta, so getwcstab.c is required here only for older releases +# (controlled by variable GETWCSTAB). getwcstab.o itself is not inserted +# into the WCSLIB object library. +# +# If available, CFITSIO is also optionally used for test programs +# tfitshdr, tbth1, tpih1 and tpih2 by setting preprocessor macro +# -DDO_CFITSIO. +# +# Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +# http://www.atnf.csiro.au/people/Mark.Calabretta +# $Id: makedefs.in,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +#----------------------------------------------------------------------------- +# Version. + LIBVER := @LIBVER@ + WCSLIBPKG := wcslib-@PACKAGE_VERSION@ + +# Additional options for GNU make added by configure. + MAKEFLAGS += @MAKEFLAGS@ + +# System architecture. + ARCH := @ARCH@ + +# Flex and options. + FLEX := @FLEX@ + FLFLAGS := + +# C preprocessor and options. + CPP := @CPP@ + CPPFLAGS := @CPPFLAGS@ @DEFS@ + WCSTRIG := WRAPPER + +# C compiler and options. + CC := @CC@ + CFLAGS := @CFLAGS@ + +# Fortran compiler and options. + FC := @F77@ + FFLAGS := @FFLAGS@ + +# Static object library. + WCSLIB := libwcs-$(LIBVER).a + ARFLAGS := @ARFLAGS@ + RANLIB := @RANLIB@ + +# Shared (dynamic) library (see note 3 above). + SHRLIB := @SHRLIB@ + SONAME := @SONAME@ + SHRFLAGS := @SHRFLAGS@ + SHRLD := @SHRLD@ + SHRLN := @SHRLN@ + +# What subdirectories to build. + SUBDIRS := @SUBDIRS@ + TSTDIRS := @TSTDIRS@ + +# Top of the 'make install' hierarchy: pgsbox -> Fortran -> C. + INSTDIR := @INSTDIR@ + +# Installation utilities and locations. + LN_S := @LN_S@ + INSTALL := @INSTALL@ + + # Needed for the definitions provided by autoconf. + prefix := @prefix@ + exec_prefix := @exec_prefix@ + datarootdir := @datarootdir@ + PACKAGE_TARNAME := @PACKAGE_TARNAME@ + docdir := @docdir@ + + LIBDIR := $(DESTDIR)@libdir@ + BINDIR := $(DESTDIR)@bindir@ + INCDIR := $(DESTDIR)@includedir@/wcslib-$(LIBVER) + INCLINK := $(DESTDIR)@includedir@/wcslib + DOCDIR := $(DESTDIR)@docdir@ + DOCLINK := $(dir $(DESTDIR)@docdir@)wcslib + HTMLDIR := $(DESTDIR)@htmldir@ + PDFDIR := $(DESTDIR)@pdfdir@ + MANDIR := $(DESTDIR)@mandir@ + +# For putting timestamps in the build log. + TIMER := date +"%a %Y/%m/%d %X %z, executing on $$HOST" + + +# The remaining options are for building utilities and test programs. +# ------------------------------------------------------------------- +# Linker options (use CC for linking). + LD = $(CC) + LDFLAGS := @LDFLAGS@ + +# PGPLOT (see note 4 above). + PGPLOTINC := @PGPLOTINC@ + PGPLOTLIB := @PGPLOTLIB@ + +# CFITSIO (see note 5 above). + CFITSIOINC := @CFITSIOINC@ + CFITSIOLIB := @CFITSIOLIB@ + GETWCSTAB := @GETWCSTAB@ + +# Libraries required by the above Fortran compiler. + FLIBS := @FLIBS@ + +# Libraries required by WCSLIB itself. + LIBS := @LIBS@ + + +#----------------------------------------------------------------------------- +# You shouldn't need to change anything below here. +#----------------------------------------------------------------------------- + +SHELL := /bin/sh +VPATH := .. + +# Common targets. +.PHONY : all build FORCE printenv show + +all : show + -@ echo '' + @ $(MAKE) build + +FORCE : + +# Print the environment as seen by makefile rules. +printenv : + -@ printenv | sort + +# Print variable definitions. +show :: wcsconfig.h + -@ echo '' + -@ uname -a + -@ echo '' + -@ $(MAKE) --version | head -1 + -@ echo ' SUBDIR := $(SUBDIR)' + -@ echo ' MAKEFLAGS := $(MAKEFLAGS)' + -@ echo '' + -@ echo 'For building and installing $(WCSLIBPKG)...' + -@ echo ' ARCH := $(ARCH)' + -@ echo ' FLEX := $(FLEX)' + -@ echo ' FLFLAGS := $(FLFLAGS)' + -@ echo ' CPP := $(CPP)' + -@ echo ' CPPFLAGS := $(CPPFLAGS)' + -@ echo ' WCSTRIG := $(WCSTRIG)' + -@ echo ' CC := $(CC)' + -@ echo ' CFLAGS := $(CFLAGS)' + -@ echo ' FC := $(FC)' + -@ echo ' FFLAGS := $(FFLAGS)' + -@ echo ' WCSLIB := $(WCSLIB)' + -@ echo ' ARFLAGS := $(ARFLAGS)' + -@ echo ' RANLIB := $(RANLIB)' + -@ echo ' SHRLIB := $(SHRLIB)' + -@ echo ' SONAME := $(SONAME)' + -@ echo ' SHRFLAGS := $(SHRFLAGS)' + -@ echo ' SHRLD := $(SHRLD)' + -@ echo ' SHRLN := $(SHRLN)' + -@ echo ' LN_S := $(LN_S)' + -@ echo ' INSTALL := $(INSTALL)' + -@ echo ' LIBDIR := $(LIBDIR)' + -@ echo ' BINDIR := $(BINDIR)' + -@ echo ' INCDIR := $(INCDIR)' + -@ echo ' INCLINK := $(INCLINK)' + -@ echo ' DOCDIR := $(DOCDIR)' + -@ echo ' DOCLINK := $(DOCLINK)' + -@ echo ' HTMLDIR := $(HTMLDIR)' + -@ echo ' PDFDIR := $(PDFDIR)' + -@ echo ' MANDIR := $(MANDIR)' + -@ echo ' TIMER := $(TIMER)' + -@ echo '' + -@ echo 'Important wcsconfig.h defines...' + -@ echo " `grep HAVE_SINCOS $<`" + -@ echo " `grep WCSLIB_INT64 $<`" + -@ echo '' + -@ echo 'To build utilities and test programs...' + -@ echo ' LD := $(LD)' + -@ echo ' LDFLAGS := $(LDFLAGS)' + -@ echo ' PGPLOTINC := $(PGPLOTINC)' + -@ echo ' PGPLOTLIB := $(PGPLOTLIB)' + -@ echo ' CFITSIOINC := $(CFITSIOINC)' + -@ echo ' CFITSIOLIB := $(CFITSIOLIB)' + -@ echo ' GETWCSTAB := $(GETWCSTAB)' + -@ echo ' FLIBS := $(FLIBS)' + -@ echo ' LIBS := $(LIBS)' + -@ echo '' + +# Code development overrides, for use in the code subdirectories. +FLAVOUR := @FLAVOUR@ +-include ../flavours diff --git a/testbed/astropy__astropy/cextern/wcslib/wcsconfig.h.in b/testbed/astropy__astropy/cextern/wcslib/wcsconfig.h.in new file mode 100644 index 0000000000000000000000000000000000000000..b0d0feb0ed576f5bbd94a6ab4dc8a7747c4f770f --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/wcsconfig.h.in @@ -0,0 +1,21 @@ +/*============================================================================ +* +* wcsconfig.h is generated from wcsconfig.h.in by 'configure'. It contains +* C preprocessor macro definitions for compiling WCSLIB 6.2 +* +* Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +* http://www.atnf.csiro.au/people/Mark.Calabretta +* $Id: wcsconfig.h.in,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*===========================================================================*/ + +/* wcslib_version() is available (as of 5.0). */ +#define HAVE_WCSLIB_VERSION + +/* WCSLIB library version number. */ +#undef WCSLIB_VERSION + +/* Define to 1 if sincos() is available. */ +#undef HAVE_SINCOS + +/* 64-bit integer data type. */ +#undef WCSLIB_INT64 diff --git a/testbed/astropy__astropy/cextern/wcslib/wcsconfig_f77.h.in b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_f77.h.in new file mode 100644 index 0000000000000000000000000000000000000000..c3d141ba36fca28cc022966df4525a42ea4ca4c8 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_f77.h.in @@ -0,0 +1,21 @@ +/*============================================================================ +* +* wcsconfig_f77.h is generated from wcsconfig_f77.h.in by 'configure'. It +* contains C preprocessor definitions for building the WCSLIB 6.2 Fortran +* wrappers. +* +* Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +* http://www.atnf.csiro.au/people/Mark.Calabretta +* $Id: wcsconfig_f77.h.in,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*===========================================================================*/ + +/* Integer array type large enough to hold an address. Set here to int[2] for + * 64-bit addresses, but could be defined as int* on 32-bit machines. */ +typedef int iptr[2]; + +/* Macro for mangling Fortran subroutine names that do not contain + * underscores. Typically a name like "WCSINI" (case-insensitive) will become + * something like "wcsini_" (case-sensitive). The Fortran wrappers, which are + * written in C, are preprocessed into names that match the latter. The macro + * takes two arguments which specify the name in lower and upper case. */ +#undef F77_FUNC diff --git a/testbed/astropy__astropy/cextern/wcslib/wcsconfig_tests.h.in b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_tests.h.in new file mode 100644 index 0000000000000000000000000000000000000000..3097be30ae138506cd0273d479021ccc195978f0 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_tests.h.in @@ -0,0 +1,18 @@ +/*============================================================================ +* +* wcsconfig_test.h is generated from wcsconfig_test.h.in by 'configure'. It +* contains C preprocessor definitions for compiling the WCSLIB 6.2 test/demo +* programs. +* +* Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +* http://www.atnf.csiro.au/people/Mark.Calabretta +* $Id: wcsconfig_tests.h.in,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*===========================================================================*/ + +#include + +/* Define to 1 if the CFITSIO library is available. */ +#undef HAVE_CFITSIO + +/* Define to the printf format modifier for size_t type. */ +#undef MODZ diff --git a/testbed/astropy__astropy/cextern/wcslib/wcsconfig_utils.h.in b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_utils.h.in new file mode 100644 index 0000000000000000000000000000000000000000..96a26a6663a420bf2f0fd5599fe8f0e5df7e61f4 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/wcsconfig_utils.h.in @@ -0,0 +1,35 @@ +/*============================================================================ +* +* wcsconfig_utils.h is generated from wcsconfig_utils.h.in by 'configure'. +* It contains C preprocessor macro definitions for compiling the WCSLIB 6.2 +* utilities. +* +* Author: Mark Calabretta, Australia Telescope National Facility, CSIRO. +* http://www.atnf.csiro.au/people/Mark.Calabretta +* $Id: wcsconfig_utils.h.in,v 6.2 2018/10/20 10:03:14 mcalabre Exp $ +*===========================================================================*/ + +#include + +/* Definitions for Large File Support (LFS), i.e. files larger than 2GiB, for + * the fitshdr utility. */ + +/* Define to 1 if fseeko() is available (for small or large files). */ +#undef HAVE_FSEEKO + +/* Define _LARGEFILE_SOURCE to get prototypes from stdio.h for the LFS + * functions fseeko() and ftello() which use an off_t argument in place of a + * long. */ +#undef _LARGEFILE_SOURCE + +/* There seems to be a bug in autoconf that causes _LARGEFILE_SOURCE not to be + * set in Linux. This dreadful kludge gets around it for now. */ +#if (defined HAVE_FSEEKO && !defined _LARGEFILE_SOURCE) +#define _LARGEFILE_SOURCE +#endif + +/* Number of bits in a file offset (off_t) on systems where it can be set. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files needed on AIX-type systems. */ +#undef _LARGE_FILES diff --git a/testbed/astropy__astropy/cextern/wcslib/wcslib.pc.in b/testbed/astropy__astropy/cextern/wcslib/wcslib.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..77909bd5acacb396f0e638429bd35ed904270c22 --- /dev/null +++ b/testbed/astropy__astropy/cextern/wcslib/wcslib.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/wcslib + +Name: WCSLIB +Description: An implementation of the FITS World Coordinate System standard +Version: @PACKAGE_VERSION@ +Requires: +Libs: -L${libdir} -lwcs -lm +Cflags: -I${includedir} diff --git a/testbed/astropy__astropy/conftest.py b/testbed/astropy__astropy/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..2baa940bd11277d7bb56181755121f387f14dc37 --- /dev/null +++ b/testbed/astropy__astropy/conftest.py @@ -0,0 +1,40 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +# This file is the main file used when running tests with pytest directly, +# in particular if running e.g. ``pytest docs/``. + +from importlib.util import find_spec +import os +import pkg_resources +import tempfile + +from astropy.tests.plugins.display import PYTEST_HEADER_MODULES +import astropy + +pytest_plugins = [ + 'astropy.tests.plugins.display', +] + +if find_spec('asdf') is not None: + from asdf import __version__ as asdf_version + if asdf_version >= astropy.__minimum_asdf_version__: + entry_points = [] + for entry_point in pkg_resources.iter_entry_points('pytest11'): + entry_points.append(entry_point.name) + if "asdf_schema_tester" not in entry_points: + pytest_plugins += ['asdf.tests.schema_tester'] + PYTEST_HEADER_MODULES['Asdf'] = 'asdf' + +# Make sure we use temporary directories for the config and cache +# so that the tests are insensitive to local configuration. + +os.environ['XDG_CONFIG_HOME'] = tempfile.mkdtemp('astropy_config') +os.environ['XDG_CACHE_HOME'] = tempfile.mkdtemp('astropy_cache') + +os.mkdir(os.path.join(os.environ['XDG_CONFIG_HOME'], 'astropy')) +os.mkdir(os.path.join(os.environ['XDG_CACHE_HOME'], 'astropy')) + +# Note that we don't need to change the environment variables back or remove +# them after testing, because they are only changed for the duration of the +# Python process, and this configuration only matters if running pytest +# directly, not from e.g. an IPython session. diff --git a/testbed/astropy__astropy/docs/Makefile b/testbed/astropy__astropy/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fb03f26e6be82581a39a45b00c82f59717bd983d --- /dev/null +++ b/testbed/astropy__astropy/docs/Makefile @@ -0,0 +1,133 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest + +#This is needed with git because git doesn't create a dir if it's empty +$(shell [ -d "_static" ] || mkdir -p _static) + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + +clean: + -rm -rf $(BUILDDIR) + -rm -rf api + -rm -rf generated + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Astropy.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Astropy.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Astropy" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Astropy" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + make -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + @echo "Run 'python setup.py test' in the root directory to run doctests " \ + @echo "in the documentation." diff --git a/testbed/astropy__astropy/docs/_pkgtemplate.rst b/testbed/astropy__astropy/docs/_pkgtemplate.rst new file mode 100644 index 0000000000000000000000000000000000000000..ac432f00b3401c61e058438b1834404e0544606e --- /dev/null +++ b/testbed/astropy__astropy/docs/_pkgtemplate.rst @@ -0,0 +1,96 @@ +**************************************************** +A description of the package (`astropy.packagename`) +**************************************************** + +When creating a new subpackage's documentation, this file should be +copied to a file "index.rst" in a directory corresponding to the name of +the package. E.g., ``docs/packagename/index.rst``. And don't forget to +delete this paragraph. + +Introduction +============ + +Include general content that might be useful for understanding the +package here, as well as general scientific or mathematical background +that might be necessary for the "big-picture" of this package. + + +Getting Started +=============== + +Short tutorial-like examples of how to do common-tasks - should be +fairly quick, with any more detailed examples in the next section. + + +Using `packagename` +=================== + +.. THIS SECTION SHOULD BE EITHER + + +This section is for the detailed documentation. For simpler packages, this +should either by paragraphs or sub-divided into sub-sections like: + +Sub-topic 1 +----------- + +Content if needed + +A Complex example +----------------- + +Content if needed + +Sub-sub topic 1 +^^^^^^^^^^^^^^^^ + +Content if needed (note the use of ^^^^ at this level). + +Sub-sub-sub topic 1 +""""""""""""""""""" + +Content if needed (note the use of """"" at this level). +This is probably the deepest level that is practical. However, +just in case, the next levels of detail should use the +, :, and ~ +characters respectively. + + +.. OR IF MORE COMPLICATED, + +For more complicated packages that require multiple documents, this +should just be a table of contents referencing those documents: + +.. toctree:: + subdoc1 + subdoc2 + subdoc3 + + +Either a toctree or sub-sections should be used, *not* both. + +For example, if your toctree looks like the above example, this document +should be ``docs/packagename/index.rst``, and the other documents should +be ``docs/packagename/subdoc1.rst``, ``docs/packagename/subdoc2.rst``, +and ``docs/packagename/subdoc3.rst``. + +In the "more complicated" case of using ``subdoc.rst`` files, each of those +should likewise use the section character header order of ``* = - ^ " + : ~``. + + +See Also (optional) +=================== + +Include here any references to related packages, articles, or texts. + + +Reference/API +============= + +.. automodapi:: packagename + + +Acknowledgments and Licenses (optional) +======================================= + +Any acknowledgements or licenses needed for this package - remove the +section if none are necessary. diff --git a/testbed/astropy__astropy/docs/_static/astropy_banner.svg b/testbed/astropy__astropy/docs/_static/astropy_banner.svg new file mode 100644 index 0000000000000000000000000000000000000000..a52c65ed0192b239b5c09c6e87838953d9904d98 --- /dev/null +++ b/testbed/astropy__astropy/docs/_static/astropy_banner.svg @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testbed/astropy__astropy/docs/_static/astropy_logo.pdf b/testbed/astropy__astropy/docs/_static/astropy_logo.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b2ae8d6c8df5095eb7e3feb687fab49a4afd0953 Binary files /dev/null and b/testbed/astropy__astropy/docs/_static/astropy_logo.pdf differ diff --git a/testbed/astropy__astropy/docs/_templates/layout.html b/testbed/astropy__astropy/docs/_templates/layout.html new file mode 100644 index 0000000000000000000000000000000000000000..78aeb6c6603e737d946a5d0d2fb5af88eb75d13c --- /dev/null +++ b/testbed/astropy__astropy/docs/_templates/layout.html @@ -0,0 +1,25 @@ +{# This extension of the 'layout.html' prevents documentation for previous + versions of Astropy to be indexed by bots, e.g. googlebot or bing bot, + by inserting a robots meta tag into pages that are not in the stable or + latest branch. + + It assumes that the documentation is built by and hosted on readthedocs.org: + 1. Readthedocs.org has a global robots.txt and no option for a custom one. + 2. The readthedocs app passes additional variables to the template context, + one of them being `version_slug`. This variable is a string computed from + the tags of the branches that are selected to be built. It can be 'latest', + 'stable' or even a unique stringified version number. + + For more information, please refer to: + https://github.com/astropy/astropy/pull/7874 + http://www.robotstxt.org/meta.html + https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/builds/version_slug.py +#} + +{% extends "!layout.html" %} +{%- block extrahead %} + {% if not version_slug in to_be_indexed %} + + {% endif %} + {{ super() }} +{% endblock %} diff --git a/testbed/astropy__astropy/docs/changelog.rst b/testbed/astropy__astropy/docs/changelog.rst new file mode 100644 index 0000000000000000000000000000000000000000..f34a16c866ea03974d5fa96b1cfbc84824f89df7 --- /dev/null +++ b/testbed/astropy__astropy/docs/changelog.rst @@ -0,0 +1,7 @@ +.. _changelog: + +************** +Full Changelog +************** + +.. include:: ../CHANGES.rst diff --git a/testbed/astropy__astropy/docs/conf.py b/testbed/astropy__astropy/docs/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..0ffd0f08eed8c629a1b571ac129313523ffa3a01 --- /dev/null +++ b/testbed/astropy__astropy/docs/conf.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# Licensed under a 3-clause BSD style license - see LICENSE.rst +# +# Astropy documentation build configuration file. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this file. +# +# All configuration values have a default. Some values are defined in +# the global Astropy configuration which is loaded here before anything else. +# See astropy.sphinx.conf for which values are set there. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# sys.path.insert(0, os.path.abspath('..')) +# IMPORTANT: the above commented section was generated by sphinx-quickstart, but +# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left +# commented out with this explanation to make it clear why this should not be +# done. If the sys.path entry above is added, when the astropy.sphinx.conf +# import occurs, it will import the *source* version of astropy instead of the +# version installed (if invoked as "make html" or directly with sphinx), or the +# version in the build directory (if "python setup.py build_docs" is used). +# Thus, any C-extensions that are needed to build the documentation will *not* +# be accessible, and the documentation will not build correctly. + +from datetime import datetime +import os +import sys + +import astropy + +try: + from sphinx_astropy.conf.v1 import * # noqa +except ImportError: + print('ERROR: the documentation requires the sphinx-astropy package to be installed') + sys.exit(1) + +plot_rcparams = {} +plot_rcparams['figure.figsize'] = (6, 6) +plot_rcparams['savefig.facecolor'] = 'none' +plot_rcparams['savefig.bbox'] = 'tight' +plot_rcparams['axes.labelsize'] = 'large' +plot_rcparams['figure.subplot.hspace'] = 0.5 + +plot_apply_rcparams = True +plot_html_show_source_link = False +plot_formats = ['png', 'svg', 'pdf'] +# Don't use the default - which includes a numpy and matplotlib import +plot_pre_code = "" + +# -- General configuration ---------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.1' + +# To perform a Sphinx version check that needs to be more specific than +# major.minor, call `check_sphinx_version("x.y.z")` here. +check_sphinx_version("1.2.1") + +# The intersphinx_mapping in astropy_helpers.sphinx.conf refers to astropy for +# the benefit of affiliated packages who want to refer to objects in the +# astropy core. However, we don't want to cyclically reference astropy in its +# own build so we remove it here. +del intersphinx_mapping['astropy'] + +# add any custom intersphinx for astropy +intersphinx_mapping['pytest'] = ('https://docs.pytest.org/en/stable/', None) +intersphinx_mapping['ipython'] = ('https://ipython.readthedocs.io/en/stable/', None) +intersphinx_mapping['pandas'] = ('http://pandas.pydata.org/pandas-docs/stable/', None) +intersphinx_mapping['sphinx_automodapi'] = ('https://sphinx-automodapi.readthedocs.io/en/stable/', None) +intersphinx_mapping['packagetemplate'] = ('http://docs.astropy.org/projects/package-template/en/latest/', None) +intersphinx_mapping['h5py'] = ('http://docs.h5py.org/en/stable/', None) + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns.append('_templates') +exclude_patterns.append('_pkgtemplate.rst') +exclude_patterns.append('**/*.inc.rst') # .inc.rst mean *include* files, don't have sphinx process them + +# Add any paths that contain templates here, relative to this directory. +if 'templates_path' not in locals(): # in case parent conf.py defines it + templates_path = [] +templates_path.append('_templates') + + +# This is added to the end of RST files - a good place to put substitutions to +# be used globally. +rst_epilog += """ +.. |minimum_python_version| replace:: {0.__minimum_python_version__} +.. |minimum_numpy_version| replace:: {0.__minimum_numpy_version__} + +.. Astropy +.. _Astropy: http://astropy.org +.. _`Astropy mailing list`: https://mail.python.org/mailman/listinfo/astropy +.. _`astropy-dev mailing list`: http://groups.google.com/group/astropy-dev +""".format(astropy) + +# -- Project information ------------------------------------------------------ + +project = u'Astropy' +author = u'The Astropy Developers' +copyright = u'2011–{0}, '.format(datetime.utcnow().year) + author + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. + +# The short X.Y version. +version = astropy.__version__.split('-', 1)[0] +# The full version, including alpha/beta/rc tags. +release = astropy.__version__ + + +# -- Options for HTML output --------------------------------------------------- + +# A NOTE ON HTML THEMES +# +# The global astropy configuration uses a custom theme, +# 'bootstrap-astropy', which is installed along with astropy. The +# theme has options for controlling the text of the logo in the upper +# left corner. This is how you would specify the options in order to +# override the theme defaults (The following options *are* the +# defaults, so we do not actually need to set them here.) + +#html_theme_options = { +# 'logotext1': 'astro', # white, semi-bold +# 'logotext2': 'py', # orange, light +# 'logotext3': ':docs' # white, light +# } + +# A different theme can be used, or other parts of this theme can be +# modified, by overriding some of the variables set in the global +# configuration. The variables set in the global configuration are +# listed below, commented out. + +# Add any paths that contain custom themes here, relative to this directory. +# To use a different custom theme, add the directory containing the theme. +#html_theme_path = [] + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. To override the custom theme, set this to the +# name of a builtin theme or the name of a custom theme in html_theme_path. +#html_theme = None + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = '' + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '' + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +html_title = '{0} v{1}'.format(project, release) + +# Output file base name for HTML help builder. +htmlhelp_basename = project + 'doc' + +# A dictionary of values to pass into the template engine’s context for all pages. +html_context = { + 'to_be_indexed': ['stable', 'latest'] +} + +# -- Options for LaTeX output -------------------------------------------------- + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [('index', project + '.tex', project + u' Documentation', + author, 'manual')] + +latex_logo = '_static/astropy_logo.pdf' + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [('index', project.lower(), project + u' Documentation', + [author], 1)] + +# Setting this URL is requited by sphinx-astropy +github_issues_url = 'https://github.com/astropy/astropy/issues/' + +# Enable nitpicky mode - which ensures that all references in the docs +# resolve. + +nitpicky = True +nitpick_ignore = [] + +for line in open('nitpick-exceptions'): + if line.strip() == "" or line.startswith("#"): + continue + dtype, target = line.split(None, 1) + target = target.strip() + nitpick_ignore.append((dtype, target)) + +# -- Options for the Sphinx gallery ------------------------------------------- + +try: + import sphinx_gallery + extensions += ["sphinx_gallery.gen_gallery"] + + sphinx_gallery_conf = { + 'backreferences_dir': 'generated/modules', # path to store the module using example template + 'filename_pattern': '^((?!skip_).)*$', # execute all examples except those that start with "skip_" + 'examples_dirs': '..{}examples'.format(os.sep), # path to the examples scripts + 'gallery_dirs': 'generated/examples', # path to save gallery generated examples + 'reference_url': { + 'astropy': None, + 'matplotlib': 'http://matplotlib.org/', + 'numpy': 'http://docs.scipy.org/doc/numpy/', + }, + 'abort_on_example_error': True + } + +except ImportError: + def setup(app): + msg = ('The sphinx_gallery extension is not installed, so the ' + 'gallery will not be built. You will probably see ' + 'additional warnings about undefined references due ' + 'to this.') + try: + app.warn(msg) + except AttributeError: + # Sphinx 1.6+ + from sphinx.util import logging + logger = logging.getLogger(__name__) + logger.warning(msg) + + +# -- Options for linkcheck output ------------------------------------------- +linkcheck_retry = 5 +linkcheck_ignore = ['https://journals.aas.org/manuscript-preparation/', + r'https://github\.com/astropy/astropy/(?:issues|pull)/\d+'] +linkcheck_timeout = 180 +linkcheck_anchors = False + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +html_extra_path = ['robots.txt'] diff --git a/testbed/astropy__astropy/docs/config/config_0_4_transition.rst b/testbed/astropy__astropy/docs/config/config_0_4_transition.rst new file mode 100644 index 0000000000000000000000000000000000000000..40edc57c2fb1bb8d5e7c94ae11be1c5671971d33 --- /dev/null +++ b/testbed/astropy__astropy/docs/config/config_0_4_transition.rst @@ -0,0 +1,327 @@ +.. _config-0-4-transition: + +Configuration Transition +************************ + +This document describes the changes in the configuration system in +``astropy`` 0.4 and how to update code in order to use it. + +For Users +========= + +The Config File +--------------- + +If you have not edited the configuration file in +``~/.astropy/config/astropy.cfg``, there is nothing for you to do. +The first time you import ``astropy`` 0.4, it will automatically be +replaced with the configuration file template for ``astropy`` 0.4. + +If you have edited the configuration file, it will be left untouched. +However, the template for ``astropy`` 0.4 will be installed as +``~/.astropy/config/astropy.0.4.cfg``. You can manually compare your +changes to this file to determine what customizations should be +brought over. + +Saving +------ + +Saving configuration items from Python has been completely removed. +Instead, the configuration file must be edited directly. + +Renames +------- + +The location of the configuration parameters have been simplified, so +they always appear in a high-level sub-package of ``astropy``, rather than in +low-level file names (which were really an implementation detail that +should not have been exposed to the user). On the Python side, +configuration items always are referenced through a ``conf`` object at +the root of a sub-package. + +Some configuration items that affect the results of science +calculations have been removed as configuration parameters altogether +and converted to science state objects that must be changed from +Python code. + +The following table lists all of the moves (in alphabetical order by +original configuration file location). The old names will continue to +work both from Python and the configuration file for the ``astropy`` 0.4 +release cycle, and will be removed altogether in ``astropy`` 0.5. + +.. list-table:: Renamed configuration parameters + :widths: 20 20 20 20 + :header-rows: 1 + + * - Old config file location + - Old Python location + - New config file location + - New Python location + * - ``[] unicode_output`` + - ``UNICODE_OUTPUT`` + - *unchanged* + - ``conf.unicode_output`` + * - ``[coordinates.name_resolve] name_resolve_timeout`` + - ``coordinates.name_resolve.NAME_RESOLVE_TIMEOUT`` + - ``[astropy.utils.data] remote_timeout`` + - ``astropy.utils.data.conf.remote_timeout`` + * - ``[coordinates.name_resolve] sesame_url`` + - ``coordinates.name_resolve.SESAME_URL`` + - *removed* + - ``coordinates.name_resolve.sesame_url.get/set`` + * - ``[coordinates.name_resolve] sesame_database`` + - ``coordinates.name_resolve.SESAME_DATABASE`` + - *removed* + - ``coordinates.name_resolve.sesame_database.get/set`` + * - ``[cosmology.core] default_cosmology`` + - ``cosmology.core.DEFAULT_COSMOLOGY`` + - *removed* + - ``cosmology.default_cosmology.get/set`` + * - ``[io.fits] enable_record_valued_keyword_cards`` + - ``io.fits.ENABLE_RECORD_VALUED_KEYWORD_CARDS`` + - *unchanged* + - ``io.fits.conf.enable_record_valued_keyword_cards`` + * - ``[io.fits] extension_name_case_sensitive`` + - ``io.fits.EXTENSION_NAME_CASE_SENSITIVE`` + - *unchanged* + - ``io.fits.conf.extension_name_case_sensitive`` + * - ``[io.fits] strip_header_whitespace`` + - ``io.fits.STRIP_HEADER_WHITESPACE`` + - *unchanged* + - ``io.fits.conf.strip_header_whitespace`` + * - ``[io.fits] use_memmap`` + - ``io.fits.USE_MEMMAP`` + - *unchanged* + - ``io.fits.conf.use_memmap`` + * - ``[io.votable.table] pedantic`` + - ``io.votable.table.PEDANTIC`` + - ``[io.votable] pedantic`` + - ``io.votable.conf.pedantic`` + * - ``[logger] log_exceptions`` + - ``logger.LOG_EXCEPTIONS`` + - *unchanged* + - ``logger.conf.log_exceptions`` + * - ``[logger] log_file_format`` + - ``logger.LOG_FILE_FORMAT`` + - *unchanged* + - ``logger.conf.log_file_format`` + * - ``[logger] log_file_level`` + - ``logger.LOG_FILE_LEVEL`` + - *unchanged* + - ``logger.conf.log_file_level`` + * - ``[logger] log_file_path`` + - ``logger.LOG_FILE_PATH`` + - *unchanged* + - ``logger.conf.log_file_path`` + * - ``[logger] log_level`` + - ``logger.LOG_LEVEL`` + - *unchanged* + - ``logger.conf.log_level`` + * - ``[logger] log_to_file`` + - ``logger.LOG_TO_FILE`` + - *unchanged* + - ``logger.conf.log_to_file`` + * - ``[logger] log_warnings`` + - ``logger.LOG_WARNINGS`` + - *unchanged* + - ``logger.conf.log_warnings`` + * - ``[logger] use_color`` + - ``logger.USE_COLOR`` + - ``[] use_color`` + - ``conf.use_color`` + * - ``[nddata.nddata] warn_unsupported_correlated`` + - ``nddata.nddata.WARN_UNSUPPORTED_CORRELATED`` + - ``[nddata] warn_unsupported_correlated`` + - ``nddata.conf.warn_unsupported_correlated`` + * - ``[table.column] auto_colname`` + - ``table.column.AUTO_COLNAME`` + - ``[table] auto_colname`` + - ``table.conf.auto_colname`` + * - ``[table.jsviewer] jquery_url`` + - ``table.jsviewer.JQUERY_URL`` + - *unchanged* + - ``table.jsviewer.conf.jquery_url`` + * - ``[table.jsviewer] datatables_url`` + - ``table.jsviewer.DATATABLES_URL`` + - *unchanged* + - ``table.jsviewer.conf.datatables_url`` + * - ``[table.pprint] max_lines`` + - ``table.pprint.MAX_LINES`` + - ``[] max_lines`` + - ``conf.max_lines`` + * - ``[table.pprint] max_width`` + - ``table.pprint.MAX_WIDTH`` + - ``[] max_width`` + - ``conf.max_width`` + * - ``[utils.console] use_color`` + - ``utils.console.USE_COLOR`` + - ``[] use_color`` + - ``conf.use_color`` + * - ``[utils.data] compute_hash_block_size`` + - ``astropy.utils.data.COMPUTE_HASH_BLOCK_SIZE`` + - *unchanged* + - ``astropy.utils.data.conf.compute_hash_block_size`` + * - ``[utils.data] dataurl`` + - ``astropy.utils.data.DATAURL`` + - *unchanged* + - ``astropy.utils.data.conf.dataurl`` + * - ``[utils.data] delete_temporary_downloads_at_exit`` + - ``astropy.utils.data.DELETE_TEMPORARY_DOWNLOADS_AT_EXIT`` + - *unchanged* + - ``astropy.utils.data.conf.delete_temporary_downloads_at_exit`` + * - ``[utils.data] download_cache_block_size`` + - ``astropy.utils.data.DOWNLOAD_CACHE_BLOCK_SIZE`` + - *unchanged* + - ``astropy.utils.data.conf.download_cache_block_size`` + * - ``[utils.data] download_cache_lock_attempts`` + - ``astropy.utils.data.download_cache_lock_attempts`` + - *unchanged* + - ``astropy.utils.data.conf.download_cache_lock_attempts`` + * - ``[utils.data] remote_timeout`` + - ``astropy.utils.data.REMOTE_TIMEOUT`` + - *unchanged* + - ``astropy.utils.data.conf.remote_timeout`` + * - ``[vo.client.conesearch] conesearch_dbname`` + - ``vo.client.conesearch.CONESEARCH_DBNAME`` + - ``[vo] conesearch_dbname`` + - ``vo.conf.conesearch_dbname`` + * - ``[vo.client.vos_catalog] vos_baseurl`` + - ``vo.client.vos_catalog.BASEURL`` + - ``[vo] vos_baseurl`` + - ``vo.conf.vos_baseurl`` + * - ``[vo.samp.utils] use_internet`` + - ``vo.samp.utils.ALLOW_INTERNET`` + - ``[vo.samp] use_internet`` + - ``vo.samp.conf.use_internet`` + * - ``[vo.validator.validate] cs_mstr_list`` + - ``vo.validator.validate.CS_MSTR_LIST`` + - ``[vo.validator] conesearch_master_list`` + - ``vo.validator.conf.conesearch_master_list`` + * - ``[vo.validator.validate] cs_urls`` + - ``vo.validator.validate.CS_URLS`` + - ``[vo.validator] conesearch_urls`` + - ``vo.validator.conf.conesearch_urls`` + * - ``[vo.validator.validate] noncrit_warnings`` + - ``vo.validator.validate.noncrit_warnings`` + - ``[vo.validator] noncritical_warnings`` + - ``vo.validator.conf.noncritical_warnings`` + +For Affiliated Package Authors +============================== + +For an affiliated package to support both ``astropy`` 0.3 and 0.4, +following the ``astropy`` 0.3 config instructions should continue to work. +Note that saving of configuration items has been removed entirely from +``astropy`` 0.4 without a deprecation cycle, so if saving configuration +programmatically is important to your package, you may want to +consider another method to save that state. + +However, by the release of ``astropy`` 0.5, the ``astropy`` 0.3 config API +will no longer work. The following describes how to transition an +affiliated package written for ``astropy`` 0.3 to support ``astropy`` 0.4 and +later. It will not be possible to support ``astropy`` 0.3, 0.4 and 0.5 +simultaneously. Below ``pkgname`` is the name of your affiliated +package. + +The automatic generation of configuration files from the +``ConfigurationItem`` objects that it finds has been removed. +Instead, the project should include a hard-coded "template" +configuration file in ``pkgname/pkgname.cfg``. By convention, and to +ease upgrades for end users, all of the values should be commented +out. For example: + +.. code-block:: ini + + [nddata] + + ## Whether to issue a warning if NDData arithmetic is performed with + ## uncertainties and the uncertainties do not support the propagation of + ## correlated uncertainties. + # warn_unsupported_correlated = True + +Affiliated packages should transition to using +`astropy.config.ConfigItem` objects as members of +`astropy.config.ConfigNamespace` subclasses. + +For example, the following is an example of the ``astropy`` 0.3 and +earlier method to define configuration items:: + + from astropy.config import ConfigurationItem + + ENABLE_RECORD_VALUED_KEYWORD_CARDS = ConfigurationItem( + 'enabled_record_valued_keyword_cards', True, + 'If True, enable support for record-valued keywords as described by ' + 'the FITS WCS distortion paper. Otherwise they are treated as normal ' + 'keywords.') + + EXTENSION_NAME_CASE_SENSITIVE = ConfigurationItem( + 'extension_name_case_sensitive', False, + 'If True, extension names (i.e. the EXTNAME keyword) should be ' + 'treated as case-sensitive.') + +The above, converted to the new method, looks like:: + + from astropy import config as _config + + class Conf(_config.ConfigNamespace): + """ + Configuration parameters for `astropy.io.fits`. + """ + + enable_record_valued_keyword_cards = _config.ConfigItem( + True, + 'If True, enable support for record-valued keywords as described by ' + 'the FITS WCS distortion paper. Otherwise they are treated as normal ' + 'keywords.', + aliases=['astropy.io.fits.enabled_record_valued_keyword_cards']) + + extension_name_case_sensitive = _config.ConfigItem( + False, + 'If True, extension names (i.e. the ``EXTNAME`` keyword) should be ' + 'treated as case-sensitive.') + conf = Conf() + + +Moving/Renaming Configuration Items in Python +--------------------------------------------- + +``ConfigAlias`` objects can be used when a configuration item has been +moved from an ``astropy`` 0.3-style ``ConfigurationItem`` to an ``astropy`` +0.4-style ``ConfigItem`` inside of a ``ConfigNamespace``. + +In the above example, the following adds backward-compatible hooks so +the old Python locations of the configuration items will continue to +work from user code:: + + ENABLE_RECORD_VALUED_KEYWORD_CARDS = _config.ConfigAlias( + '0.4', 'ENABLE_RECORD_VALUED_KEYWORD_CARDS', + 'enable_record_valued_keyword_cards') + +Moving/Renaming Configuration Items in the Config File +------------------------------------------------------ + +If a configuration item is moved or renamed within the configuration +file, the ``aliases`` kwarg to ``ConfigItem`` can be used so that the +old location will continue to be used as a fallback. For example, if +the old location of an item was: + +.. code-block:: ini + + [coordinates.name_resolve] + sesame_url = http://somewhere.com + +You might want to drop the fact that this is implemented in the module +``name_resolve`` and just store the configuration in ``coordinates``: + +.. code-block:: ini + + [coordinates] + sesame_url = http://somewhere.com + +When defining the ``ConfigItem`` for this entry, the ``aliases`` kwarg +can list the old location(s) of the configuration item:: + + sesame_url = _config.ConfigItem( + ["http://somewhere.com"], + """Docstring""", + aliases=['astropy.coordinates.name_resolve.sesame_url']) diff --git a/testbed/astropy__astropy/docs/config/index.rst b/testbed/astropy__astropy/docs/config/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..5dd1e3e622cd74bcc4f91da2533545d7c7b4395b --- /dev/null +++ b/testbed/astropy__astropy/docs/config/index.rst @@ -0,0 +1,370 @@ +.. doctest-skip-all + +.. _astropy_config: + +*************************************** +Configuration System (`astropy.config`) +*************************************** + +Introduction +============ + +The Astropy configuration system is designed to give users control of various +parameters used in Astropy or affiliated packages without delving into the +source code to make those changes. + +.. note:: + The configuration system got a major overhaul in ``astropy`` 0.4 as + part of APE3. See :ref:`config-0-4-transition` for information + about updating code to use the new API. + + +Getting Started +=============== + +The Astropy configuration options are most conveniently set by modifying the +configuration file. It will be automatically generated with all of the +default values commented out the first time you import Astropy. You +can find the exact location by doing:: + + >>> from astropy.config import get_config_dir + >>> get_config_dir() + +And you should see the location of your configuration directory. The standard +scheme generally puts your configuration directory in +``$HOME/.astropy/config``. It can be customized with the environment variable +``XDG_CONFIG_HOME`` and the ``$XDG_CONFIG_HOME/astropy`` directory must exist. +Note that ``XDG_CONFIG_HOME`` comes from a Linux-centric specification (see +`here `_ for +more details), but Astropy will use this on any OS as a more general means to +know where user-specific configurations should be written. + +Once you have found the configuration file, open it with your favorite editor. +It should have all of the sections you might want, with descriptions and the +type of value that is accepted. Feel free to edit this as you wish, and +any of these changes will be reflected when you next start Astropy. Or, if you +want to see your changes immediately in your current Astropy session, do:: + + >>> from astropy.config import reload_config + >>> reload_config() + +.. note:: + If for whatever reason your ``$HOME/.astropy`` directory is not accessible + (i.e., you have ``astropy`` running somehow as root but you are not the root + user), the best solution is to set the ``XDG_CONFIG_HOME`` and + ``XDG_CACHE_HOME`` environment variables pointing to directories, and create + an ``astropy`` directory inside each of those. Both the configuration and + data download systems will then use those directories and never try to + access the ``$HOME/.astropy`` directory. + + +Using `astropy.config` +====================== + +Accessing Values +---------------- + +By convention, configuration parameters live inside of objects called +``conf`` at the root of each sub-package. For example, configuration +parameters related to data files live in ``astropy.utils.data.conf``. +This object has properties for getting and setting individual +configuration parameters. For instance, to get the default URL for +``astropy`` remote data, do:: + + >>> from astropy.utils.data import conf + >>> conf.dataurl + 'http://data.astropy.org/' + +Changing Values at Runtime +-------------------------- + +Changing the persistent state of configuration values is done by editing the +configuration file as described above. Values can also, however, be +modified in an active Python session by setting any of the properties +on a ``conf`` object. + +For example, if there is a part of your configuration file that looks +like: + +.. code-block:: ini + + [utils.data] + + # URL for astropy remote data site. + dataurl = http://data.astropy.org/ + + # Time to wait for remote data query (in seconds). + remote_timeout = 3.0 + +You should be able to modify the values at runtime this way:: + + >>> from astropy.utils.data import conf + >>> conf.dataurl + 'http://data.astropy.org/' + >>> conf.dataurl = 'http://astropydata.mywebsite.com' + >>> conf.dataurl + 'http://astropydata.mywebsite.com' + >>> conf.remote_timeout + 3.0 + >>> conf.remote_timeout = 4.5 + >>> conf.remote_timeout + 4.5 + +Reloading Configuration +----------------------- + +Instead of modifying the variables in Python, you can also modify the +configuration files and then reload them. For example, if you modify the +configuration file to say: + +.. code-block:: ini + + [utils.data] + + # URL for astropy remote data site. + dataurl = http://myotherdata.mywebsite.com/ + + # Time to wait for remote data query (in seconds). + remote_timeout = 6.3 + +And then run the following commands:: + + >>> conf.reload('dataurl') + >>> conf.reload('remote_timeout') + +This should update the variables with the values from the configuration file:: + + >>> conf.dataurl + 'http://myotherdata.mywebsite.com/' + >>> conf.remote_timeout + 6.3 + +You can reload all configuration parameters of a ``conf`` object at +once by calling ``reload`` with no parameters:: + + >>> conf.reload() + +Or if you want to reload all Astropy configuration at once, use the +`~astropy.config.reload_config` function:: + + >>> config.reload_config('astropy') + +You can also reset a configuration parameter back to its default value. Note +that this is the default value defined in the Python code, and has nothing to +do with the configuration file on disk:: + + >>> conf.reset('dataurl') + >>> conf.dataurl + 'http://data.astropy.org/' + +Upgrading ``astropy`` +--------------------- + +Each time you upgrade to a new major version of ``astropy``, the +configuration parameters may have changed. + +If you never edited your configuration file, there is nothing for you +to do. It will automatically be replaced with a configuration file +template for the newly installed version of ``astropy``. + +If you did customize your configuration file, it will not be touched. +Instead, a new configuration file template will be installed alongside +it with the version number in the filename, for example +``astropy.0.4.cfg``. You can compare this file to your +``astropy.cfg`` file to see what needs to be changed or updated. + +.. _config-developer: + +Adding New Configuration Items +============================== + +Configuration items should be used wherever an option or setting is +needed that is either tied to a system configuration or should persist +across sessions of ``astropy`` or an affiliated package. Options that may +affect the results of science calculations should not be configuration +items, but should instead be `astropy.utils.state.ScienceState`, so +it is possible to reproduce science results without them being affected +by configuration parameters set in a particular environment. +Admittedly, this is only a guideline, as the precise cases where a +configuration item is preferred over, say, a keyword option for a +function is somewhat personal preference. It is the preferred form of +persistent configuration, however, and ``astropy`` packages must all use +it (and it is recommended for affiliated packages). + +The reference guide below describes the interface for creating a +``conf`` object with a number of configuration parameters. They +should be defined at the top level (i.e., in the ``__init__.py`` of +each sub-package that has configuration items):: + + """ This is the docstring at the beginning of a module + """ + from astropy import config as _config + + class Conf(_config.ConfigNamespace): + """ + Configuration parameters for my subpackage. + """ + some_setting = _config.ConfigItem( + 1, 'Description of some_setting') + another_setting = _config.ConfigItem( + 'string value', 'Description of another_setting') + # Create an instance for the user + conf = Conf() + + ... implementation ... + def some_func(): + #to get the value of these options, I might do: + something = conf.some_setting + 2 + return conf.another_setting + ' Also, I added text.' + +The configuration items also need to be added to the config file +template. For ``astropy``, this file is in ``astropy/astropy.cfg``. For +an affiliated package called, for example, ``packagename``, the file +is in ``packagename/packagename.cfg``. For the example above, the +following content would be added to the config file template: + +.. code-block:: ini + + [subpackage] + ## Description of some_setting + # some_setting = 1 + + ## Description of another_setting + # another_setting = foo + +Note that the key/value pairs are commented out. This will allow for +changing the default values in a future version of ``astropy`` without +requiring the user to edit their configuration file to take advantage +of the new defaults. By convention, the descriptions of each +parameter are in comment lines starting with two hash characters +(``##``) to distinguish them from commented out key/value pairs. + +Item Types and Validation +------------------------- + +If not otherwise specified, a `~astropy.config.ConfigItem` gets its +type from the type of the ``defaultvalue`` it is given when it is +created. The item can only be set to be an object of this type. +Hence:: + + some_setting = ConfigItem(1, 'A description.') + ... + conf.some_setting = 1.2 + +will fail, because ``1.2`` is a float and ``1`` is an integer. + +Note that if you want the configuration item to be limited to a +particular set of options, you should pass in a list as the +``defaultvalue`` option. The first entry in the list will be taken as +the default, and the list as a whole gives all of the valid options. For +example:: + + an_option = ConfigItem( + ['a', 'b', 'c'], + "This option can be 'a', 'b', or 'c'") + ... + conf.an_option = 'b' # succeeds + conf.an_option = 'c' # succeeds + conf.an_option = 'd' # fails! + conf.an_option = 6 # fails! + +Finally, a `~astropy.config.ConfigItem` can be explicitly given a type +via the ``cfgtype`` option:: + + an_int_setting = ConfigItem( + 1, 'A description.', cfgtype='integer') + ... + conf.an_int_setting = 3 # works fine + conf.an_int_setting = 4.2 # fails! + +If the default value's type does not match ``cfgtype``, the +`~astropy.config.ConfigItem` cannot be created:: + + an_int_setting = ConfigItem( + 4.2, 'A description.', cfgtype='integer') + +In summary, the default behavior (of automatically determining ``cfgtype``) +is usually what you want. The main exception is when you want your +configuration item to be a list. The default behavior will treat that +as a list of *options* unless you explicitly tell it that the +`~astropy.config.ConfigItem` itself is supposed to be a list:: + + a_list_setting = ConfigItem([1, 2, 3], 'A description.') + + a_list_setting = ConfigItem([1, 2, 3], 'A description.', cfgtype='list') + +Details of all of the valid ``cfgtype`` items can be found in the +`validation section of the configobj manual +`_. +Below is a list of the valid values here for quick reference: + +* 'integer' +* 'float' +* 'boolean' +* 'string' +* 'ip_addr' +* 'list' +* 'tuple' +* 'int_list' +* 'float_list' +* 'bool_list' +* 'string_list' +* 'ip_addr_list' +* 'mixed_list' +* 'option' +* 'pass' + +Usage Tips +---------- + +Keep in mind that `~astropy.config.ConfigItem` objects can be +changed at runtime by users. So it is always recommended to read their +values immediately before use instead of storing their initial +value to some other variable (or used as a default for a +function). For example, the following will work, but is incorrect +usage:: + + def some_func(val=conf.some_setting): + return val + 2 + +This works fine as long as the user does not change its value during +runtime, but if they do, the function will not know about the change:: + + >>> some_func() + 3 + >>> conf.some_setting = 3 + >>> some_func() # naively should return 5, because 3 + 2 = 5 + 3 + +There are two ways around this. The typical/intended way is:: + + def some_func(): + """ + The `SOME_SETTING` configuration item influences this output + """ + return conf.some_setting + 2 + +Or, if the option needs to be available as a function parameter:: + + def some_func(val=None): + """ + If not specified, `val` is set by the `SOME_SETTING` configuration item. + """ + return (conf.some_setting if val is None else val) + 2 + + +See Also +======== + +.. toctree:: + :maxdepth: 2 + + config_0_4_transition + +:doc:`/logging` (overview of `astropy.logger`) + + +Reference/API +============= + +.. automodapi:: astropy.config diff --git a/testbed/astropy__astropy/docs/conftest.py b/testbed/astropy__astropy/docs/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..9f202556a562abd13d843062a5350d0140bd6c17 --- /dev/null +++ b/testbed/astropy__astropy/docs/conftest.py @@ -0,0 +1,23 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst + +# This file needs to be included here to make sure commands such +# as ``python setup.py test ... -t docs/...`` works, since this +# will ignore the conftest.py file at the root of the repository +# and the one in astropy/conftest.py + +import os +import tempfile + +# Make sure we use temporary directories for the config and cache +# so that the tests are insensitive to local configuration. + +os.environ['XDG_CONFIG_HOME'] = tempfile.mkdtemp('astropy_config') +os.environ['XDG_CACHE_HOME'] = tempfile.mkdtemp('astropy_cache') + +os.mkdir(os.path.join(os.environ['XDG_CONFIG_HOME'], 'astropy')) +os.mkdir(os.path.join(os.environ['XDG_CACHE_HOME'], 'astropy')) + +# Note that we don't need to change the environment variables back or remove +# them after testing, because they are only changed for the duration of the +# Python process, and this configuration only matters if running pytest +# directly, not from e.g. an IPython session. diff --git a/testbed/astropy__astropy/docs/constants/index.rst b/testbed/astropy__astropy/docs/constants/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..de4e4709f29930bf976b206259dcb60fd769c4ff --- /dev/null +++ b/testbed/astropy__astropy/docs/constants/index.rst @@ -0,0 +1,154 @@ +.. _astropy-constants: + +******************************* +Constants (`astropy.constants`) +******************************* + +.. currentmodule:: astropy.constants + +Introduction +============ + +`astropy.constants` contains a number of physical constants useful in +Astronomy. Constants are `~astropy.units.Quantity` objects with +additional metadata describing their provenance and uncertainties. + +Getting Started +=============== + +To use the constants in International System of Units (SI units), you can +import the constants directly from the `astropy.constants` sub-package:: + + >>> from astropy.constants import G + +Or, if you want to avoid having to explicitly import all of the constants you +need, you can do: + + >>> from astropy import constants as const + +and then subsequently use, for example, ``const.G``. Constants are fully-fledged +`~astropy.units.Quantity` objects, so you can conveniently convert them to +different units. For example:: + + >>> print(const.c) + Name = Speed of light in vacuum + Value = 299792458.0 + Uncertainty = 0.0 + Unit = m / s + Reference = CODATA 2014 + + >>> print(const.c.to('km/s')) + 299792.458 km / s + + >>> print(const.c.to('pc/yr')) # doctest: +FLOAT_CMP + 0.306601393788 pc / yr + +You can then use them in conjunction with unit and other nonconstant +`~astropy.units.Quantity` objects:: + + >>> from astropy import units as u + >>> F = (const.G * 3. * const.M_sun * 100 * u.kg) / (2.2 * u.au) ** 2 + >>> print(F.to(u.N)) # doctest: +FLOAT_CMP + 0.3675671602160826 N + +It is possible to convert most constants to Centimeter-Gram-Second (CGS) units +using, for example:: + + >>> const.c.cgs # doctest: +FLOAT_CMP + + +However, some constants are defined with different physical dimensions in CGS +and cannot be directly converted. Because of this ambiguity, such constants +cannot be used in expressions without specifying a system:: + + >>> 100 * const.e + Traceback (most recent call last): + ... + TypeError: Constant u'e' does not have physically compatible units + across all systems of units and cannot be combined with other + values without specifying a system (eg. e.emu) + >>> 100 * const.e.esu # doctest: +FLOAT_CMP + + +.. _astropy-constants-prior: + +Collections of Constants (and Prior Versions) +============================================= + +Constants are organized into version modules. The constants for +``astropy`` 1.3 can be accessed in the ``astropyconst13`` module. +For example: + + >>> from astropy.constants import astropyconst13 as const + >>> print(const.e) + Name = Electron charge + Value = 1.602176565e-19 + Uncertainty = 3.5e-27 + Unit = C + Reference = CODATA 2010 + +Physical CODATA constants are in modules with names like ``codata2010`` or +``codata2014``: + + >>> from astropy.constants import codata2010 as const + >>> print(const.h) + Name = Planck constant + Value = 6.62606957e-34 + Uncertainty = 2.9e-41 + Unit = J s + Reference = CODATA 2010 + +Astronomical constants defined (primarily) by the International Astronomical +Union (IAU) are collected in modules with names like ``iau2012`` or ``iau2015``: + + >>> from astropy.constants import iau2012 as const + >>> print(const.L_sun) + Name = Solar luminosity + Value = 3.846e+26 + Uncertainty = 5e+22 + Unit = W + Reference = Allen's Astrophysical Quantities 4th Ed. + + >>> from astropy.constants import iau2015 as const + >>> print(const.L_sun) + Name = Nominal solar luminosity + Value = 3.828e+26 + Uncertainty = 0.0 + Unit = W + Reference = IAU 2015 Resolution B 3 + +The astronomical and physical constants are combined into modules with +names like ``astropyconst13`` and ``astropyconst20``. To temporarily set +constants to an older version (e.g., for regression testing), a context +manager is available as follows: + + >>> from astropy import constants as const + >>> with const.set_enabled_constants('astropyconst13'): + ... print(const.h) + Name = Planck constant + Value = 6.62606957e-34 + Uncertainty = 2.9e-41 + Unit = J s + Reference = CODATA 2010 + >>> print(const.h) + Name = Planck constant + Value = 6.62607004e-34 + Uncertainty = 8.1e-42 + Unit = J s + Reference = CODATA 2014 + +.. warning:: + + Units such as ``u.M_sun`` will use the current version of the + corresponding constant. When using prior versions of the constants, + quantities should be constructed with constants instead of units. + +.. note that if this section gets too long, it should be moved to a separate + doc page - see the top of performance.inc.rst for the instructions on how to + do that +.. include:: performance.inc.rst + +Reference/API +============= + +.. automodapi:: astropy.constants diff --git a/testbed/astropy__astropy/docs/constants/performance.inc.rst b/testbed/astropy__astropy/docs/constants/performance.inc.rst new file mode 100644 index 0000000000000000000000000000000000000000..19aba1aec394fe5afcf9a930302539a096f0a98f --- /dev/null +++ b/testbed/astropy__astropy/docs/constants/performance.inc.rst @@ -0,0 +1,12 @@ +.. note that if this is changed from the default approach of using an *include* + (in index.rst) to a separate performance page, the header needs to be changed + from === to ***, the filename extension needs to be changed from .inc.rst to + .rst, and a link needs to be added in the sub-package toctree + +.. _astropy-constants-performance: + +.. Performance Tips +.. ================ +.. +.. Here we provide some tips and tricks for how to optimize performance of code +.. using `astropy.constants`. diff --git a/testbed/astropy__astropy/docs/convolution/index.rst b/testbed/astropy__astropy/docs/convolution/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..e16820e5b58655993330f92d122708882d207dc7 --- /dev/null +++ b/testbed/astropy__astropy/docs/convolution/index.rst @@ -0,0 +1,427 @@ +.. _astropy_convolve: + +************************************************* +Convolution and Filtering (`astropy.convolution`) +************************************************* + +Introduction +============ + +`astropy.convolution` provides convolution functions and kernels that offer +improvements compared to the SciPy `scipy.ndimage` convolution routines, +including: + +* Proper treatment of NaN values (ignoring them during convolution and + replacing NaN pixels with interpolated values) + +* A single function for 1D, 2D, and 3D convolution + +* Improved options for the treatment of edges + +* Both direct and Fast Fourier Transform (FFT) versions + +* Built-in kernels that are commonly used in Astronomy + +The following thumbnails show the difference between ``scipy`` and +``astropy`` convolve functions on an astronomical image that contains NaN +values. ``scipy``'s function essentially returns NaN for all pixels that are +within a kernel of any NaN value, which is often not the desired result. + +.. plot:: + :context: reset + :include-source: + :align: center + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.io import fits + from astropy.utils.data import get_pkg_data_filename + from astropy.convolution import Gaussian2DKernel + from scipy.signal import convolve as scipy_convolve + from astropy.convolution import convolve + + + # Load the data from data.astropy.org + filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits') + hdu = fits.open(filename)[0] + + # Scale the file to have reasonable numbers + # (this is mostly so that colorbars do not have too many digits) + # Also, we crop it so you can see individual pixels + img = hdu.data[50:90, 60:100] * 1e5 + + # This example is intended to demonstrate how astropy.convolve and + # scipy.convolve handle missing data, so we start by setting the + # brightest pixels to NaN to simulate a "saturated" data set + img[img > 2e1] = np.nan + + # We also create a copy of the data and set those NaNs to zero. We will + # use this for the scipy convolution + img_zerod = img.copy() + img_zerod[np.isnan(img)] = 0 + + # We smooth with a Gaussian kernel with x_stddev=1 (and y_stddev=1) + # It is a 9x9 array + kernel = Gaussian2DKernel(x_stddev=1) + + # Convolution: scipy's direct convolution mode spreads out NaNs (see + # panel 2 below) + scipy_conv = scipy_convolve(img, kernel, mode='same', method='direct') + + # scipy's direct convolution mode run on the 'zero'd' image will not + # have NaNs, but will have some very low value zones where the NaNs were + # (see panel 3 below) + scipy_conv_zerod = scipy_convolve(img_zerod, kernel, mode='same', + method='direct') + + # astropy's convolution replaces the NaN pixels with a kernel-weighted + # interpolation from their neighbors + astropy_conv = convolve(img, kernel) + + + # Now we do a bunch of plots. In the first two plots, the originally masked + # values are marked with red X's + plt.figure(1, figsize=(12, 12)).clf() + ax1 = plt.subplot(2, 2, 1) + im = ax1.imshow(img, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + y, x = np.where(np.isnan(img)) + ax1.set_autoscale_on(False) + ax1.plot(x, y, 'rx', markersize=4) + ax1.set_title("Original") + ax1.set_xticklabels([]) + ax1.set_yticklabels([]) + + ax2 = plt.subplot(2, 2, 2) + im = ax2.imshow(scipy_conv, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax2.set_autoscale_on(False) + ax2.plot(x, y, 'rx', markersize=4) + ax2.set_title("Scipy") + ax2.set_xticklabels([]) + ax2.set_yticklabels([]) + + ax3 = plt.subplot(2, 2, 3) + im = ax3.imshow(scipy_conv_zerod, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax3.set_title("Scipy nan->zero") + ax3.set_xticklabels([]) + ax3.set_yticklabels([]) + + ax4 = plt.subplot(2, 2, 4) + im = ax4.imshow(astropy_conv, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax4.set_title("Default astropy") + ax4.set_xticklabels([]) + ax4.set_yticklabels([]) + + # we make a second plot of the amplitudes vs offset position to more + # clearly illustrate the value differences + plt.figure(2).clf() + plt.plot(img[:, 25], label='input', drawstyle='steps-mid', linewidth=2, + alpha=0.5) + plt.plot(scipy_conv[:, 25], label='scipy', drawstyle='steps-mid', + linewidth=2, alpha=0.5, marker='s') + plt.plot(scipy_conv_zerod[:, 25], label='scipy nan->zero', + drawstyle='steps-mid', linewidth=2, alpha=0.5, marker='s') + plt.plot(astropy_conv[:, 25], label='astropy', drawstyle='steps-mid', + linewidth=2, alpha=0.5) + plt.ylabel("Amplitude") + plt.ylabel("Position Offset") + plt.legend(loc='best') + plt.show() + + +The following sections describe how to make use of the convolution functions, +and how to use built-in convolution kernels: + +Getting Started +=============== + +Two convolution functions are provided. They are imported as:: + + from astropy.convolution import convolve, convolve_fft + +and are both used as:: + + result = convolve(image, kernel) + result = convolve_fft(image, kernel) + +:func:`~astropy.convolution.convolve` is implemented as a direct convolution +algorithm, while :func:`~astropy.convolution.convolve_fft` uses a Fast Fourier +Transform (FFT). Thus, the former is better for small kernels, while the latter +is much more efficient for larger kernels. + +For example, to convolve a 1D dataset with a user-specified kernel, you can do:: + + >>> from astropy.convolution import convolve + >>> convolve([1, 4, 5, 6, 5, 7, 8], [0.2, 0.6, 0.2]) # doctest: +FLOAT_CMP + array([1.4, 3.6, 5. , 5.6, 5.6, 6.8, 6.2]) + +Notice that the end points are set to zero — by default, points that are too +close to the boundary to have a convolved value calculated are set to zero. +However, the :func:`~astropy.convolution.convolve` function allows for a +``boundary`` argument that can be used to specify alternate behaviors. For +example, setting ``boundary='extend'`` causes values near the edges to be +computed, assuming the original data is simply extended using a constant +extrapolation beyond the boundary:: + + >>> from astropy.convolution import convolve + >>> convolve([1, 4, 5, 6, 5, 7, 8], [0.2, 0.6, 0.2], boundary='extend') # doctest: +FLOAT_CMP + array([1.6, 3.6, 5. , 5.6, 5.6, 6.8, 7.8]) + +The values at the end are computed assuming that any value below the first +point is ``1``, and any value above the last point is ``8``. For a more +detailed discussion of boundary treatment, see :doc:`using`. + +This module also includes built-in kernels that can be imported as, for +example:: + + >>> from astropy.convolution import Gaussian1DKernel + +To use a kernel, first create a specific instance of the kernel:: + + >>> gauss = Gaussian1DKernel(stddev=2) + +``gauss`` is not an array, but a kernel object. The underlying array can be +retrieved with:: + + >>> gauss.array # doctest: +FLOAT_CMP + array([6.69151129e-05, 4.36341348e-04, 2.21592421e-03, + 8.76415025e-03, 2.69954833e-02, 6.47587978e-02, + 1.20985362e-01, 1.76032663e-01, 1.99471140e-01, + 1.76032663e-01, 1.20985362e-01, 6.47587978e-02, + 2.69954833e-02, 8.76415025e-03, 2.21592421e-03, + 4.36341348e-04, 6.69151129e-05]) + +The kernel can then be used directly when calling +:func:`~astropy.convolution.convolve`: + +.. plot:: + :include-source: + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.convolution import Gaussian1DKernel, convolve + + plt.figure(3).clf() + + # Generate fake data + x = np.arange(1000).astype(float) + y = np.sin(x / 100.) + np.random.normal(0., 1., x.shape) + y[::3] = np.nan + + # Create kernel + g = Gaussian1DKernel(stddev=50) + + # Convolve data + z = convolve(y, g) + + # Plot data before and after convolution + plt.plot(x, y, 'k-', label='Before') + plt.plot(x, z, 'b-', label='After', alpha=0.5, linewidth=2) + plt.legend(loc='best') + plt.show() + + +Using ``astropy``'s Convolution to Replace Bad Data +--------------------------------------------------- + +``astropy``'s convolution methods can be used to replace bad data with values +interpolated from their neighbors. Kernel-based interpolation is useful for +handling images with a few bad pixels or for interpolating sparsely sampled +images. + +The interpolation tool is implemented and used as:: + + from astropy.convolution import interpolate_replace_nans + result = interpolate_replace_nans(image, kernel) + +Some contexts in which you might want to use kernel-based interpolation include: + + * Images with saturated pixels. Generally, these are the highest-intensity + regions in the imaged area, and the interpolated values are not reliable, + but this can be useful for display purposes. + * Images with flagged pixels (e.g., a few small regions affected by cosmic + rays or other spurious signals that require those pixels to be flagged out). + If the affected region is small enough, the resulting interpolation will have + a small effect on source statistics and may allow for robust source-finding + algorithms to be run on the resulting data. + * Sparsely sampled images such as those constructed with single-pixel + detectors. Such images will only have a few discrete points sampled across + the imaged area, but an approximation of the extended sky emission can still + be constructed. + +.. note:: + Care must be taken to ensure that the kernel is large enough to completely + cover potential contiguous regions of NaN values. + An ``AstropyUserWarning`` is raised if NaN values are detected post- + convolution, in which case the kernel size should be increased. + +The script below shows an example of kernel interpolation to fill in +flagged-out pixels: + +.. plot:: + :context: + :include-source: + :align: center + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.io import fits + from astropy.utils.data import get_pkg_data_filename + from astropy.convolution import Gaussian2DKernel, interpolate_replace_nans + + # Load the data from data.astropy.org + filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits') + + hdu = fits.open(filename)[0] + img = hdu.data[50:90, 60:100] * 1e5 + + # This example is intended to demonstrate how astropy.convolve and + # scipy.convolve handle missing data, so we start by setting the brightest + # pixels to NaN to simulate a "saturated" data set + img[img > 2e1] = np.nan + + # We smooth with a Gaussian kernel with x_stddev=1 (and y_stddev=1) + # It is a 9x9 array + kernel = Gaussian2DKernel(x_stddev=1) + + # create a "fixed" image with NaNs replaced by interpolated values + fixed_image = interpolate_replace_nans(img, kernel) + + # Now we do a bunch of plots. In the first two plots, the originally masked + # values are marked with red X's + plt.figure(1, figsize=(12, 6)).clf() + plt.close(2) # close the second plot from above + + ax1 = plt.subplot(1, 2, 1) + im = ax1.imshow(img, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + y, x = np.where(np.isnan(img)) + ax1.set_autoscale_on(False) + ax1.plot(x, y, 'rx', markersize=4) + ax1.set_title("Original") + ax1.set_xticklabels([]) + ax1.set_yticklabels([]) + + ax2 = plt.subplot(1, 2, 2) + im = ax2.imshow(fixed_image, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax2.set_title("Fixed") + ax2.set_xticklabels([]) + ax2.set_yticklabels([]) + +This script shows the power of this technique for reconstructing images from +sparse sampling. Note that the image is not perfect: the pointlike sources +are sometimes missed, but the extended structure is very well recovered by +eye. + +.. plot:: + :context: + :include-source: + :align: center + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.io import fits + from astropy.utils.data import get_pkg_data_filename + from astropy.convolution import Gaussian2DKernel, interpolate_replace_nans + + # Load the data from data.astropy.org + filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits') + + hdu = fits.open(filename)[0] + img = hdu.data[50:90, 60:100] * 1e5 + + indices = np.random.randint(low=0, high=img.size, size=300) + + sampled_data = img.flat[indices] + + # Build a new, sparsely sampled version of the original image + new_img = np.tile(np.nan, img.shape) + new_img.flat[indices] = sampled_data + + # We smooth with a Gaussian kernel with x_stddev=1 (and y_stddev=1) + # It is a 9x9 array + kernel = Gaussian2DKernel(x_stddev=1) + + # create a "reconstructed" image with NaNs replaced by interpolated values + reconstructed_image = interpolate_replace_nans(new_img, kernel) + + # Now we do a bunch of plots. In the first two plots, the originally masked + # values are marked with red X's + plt.figure(1, figsize=(12, 6)).clf() + ax1 = plt.subplot(1, 3, 1) + im = ax1.imshow(img, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + y, x = np.where(np.isnan(img)) + ax1.set_autoscale_on(False) + ax1.set_title("Original") + ax1.set_xticklabels([]) + ax1.set_yticklabels([]) + + ax2 = plt.subplot(1, 3, 2) + im = ax2.imshow(new_img, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax2.set_title("Sparsely Sampled") + ax2.set_xticklabels([]) + ax2.set_yticklabels([]) + + ax2 = plt.subplot(1, 3, 3) + im = ax2.imshow(reconstructed_image, vmin=-2., vmax=2.e1, origin='lower', + interpolation='nearest', cmap='viridis') + ax2.set_title("Reconstructed") + ax2.set_xticklabels([]) + ax2.set_yticklabels([]) + + +.. _astropy_convolve_compat: + +A Note on Backward Compatibility (pre v2.0) +------------------------------------------- + +The behavior of ``astropy``'s direct convolution +(:func:`~astropy.convolution.convolve`) changed in version 2.0. Generally, the +old version is undesirable. However, to recover the behavior of the old +(``astropy`` version <2.0) direct convolution function, you can interpolate and +then convolve, for example: + +.. code-block:: python + + from astropy.convolution import interpolate_replace_nans, convolve + interped_result = interpolate_replace_nans(image, kernel) + result = convolve(interped_image, kernel) + +Note that the default behavior of both `~astropy.convolution.convolve` and +`~astropy.convolution.convolve_fft` is to perform *normalized convolution* and +interpolate NaNs during that process. The example given in this note, and what +was previously done only in direct convolution in old versions of ``astropy`` +now does a two-step process: first, it replaces the NaNs with their +interpolated values while leaving all non-NaN values unchanged, then it +convolves the resulting image with the specified kernel. + +Using `astropy.convolution` +=========================== + +.. toctree:: + :maxdepth: 2 + + using.rst + kernels.rst + non_normalized_kernels.rst + +.. note that if this section gets too long, it should be moved to a separate + doc page - see the top of performance.inc.rst for the instructions on how to + do that +.. include:: performance.inc.rst + +Reference/API +============= + +.. automodapi:: astropy.convolution + :no-inheritance-diagram: diff --git a/testbed/astropy__astropy/docs/convolution/kernels.rst b/testbed/astropy__astropy/docs/convolution/kernels.rst new file mode 100644 index 0000000000000000000000000000000000000000..9a401da19245573dac45803b2bbf55f84471db1f --- /dev/null +++ b/testbed/astropy__astropy/docs/convolution/kernels.rst @@ -0,0 +1,348 @@ +Convolution Kernels +******************* + +Introduction and Concept +======================== + +The convolution module provides several built-in kernels to cover the most +common applications in astronomy. It is also possible to define custom kernels +from arrays or combine existing kernels to match specific applications. + +Every filter kernel is characterized by its response function. For time series +we speak of an "impulse response function" or for images we call it "point +spread function." This response function is given for every kernel by a +`~astropy.modeling.FittableModel`, which is evaluated on a grid with +:func:`~astropy.convolution.discretize_model` to obtain a kernel +array, which can be used for discrete convolution with the binned data. + + +Examples +======== + +1D Kernels +---------- + +One application of filtering is to smooth noisy data. In this case we +consider a noisy Lorentz curve: + +>>> import numpy as np +>>> from astropy.modeling.models import Lorentz1D +>>> from astropy.convolution import convolve, Gaussian1DKernel, Box1DKernel +>>> lorentz = Lorentz1D(1, 0, 1) +>>> x = np.linspace(-5, 5, 100) +>>> data_1D = lorentz(x) + 0.1 * (np.random.rand(100) - 0.5) + +Smoothing the noisy data with a `~astropy.convolution.Gaussian1DKernel` +with a standard deviation of 2 pixels: + +>>> gauss_kernel = Gaussian1DKernel(2) +>>> smoothed_data_gauss = convolve(data_1D, gauss_kernel) + +Smoothing the same data with a `~astropy.convolution.Box1DKernel` of width 5 +pixels: + +>>> box_kernel = Box1DKernel(5) +>>> smoothed_data_box = convolve(data_1D, box_kernel) + +The following plot illustrates the results: + +.. plot:: + + import numpy as np + import matplotlib.pyplot as plt + from astropy.modeling.models import Lorentz1D + from astropy.convolution import convolve, Gaussian1DKernel, Box1DKernel + + # Fake Lorentz data including noise + lorentz = Lorentz1D(1, 0, 1) + x = np.linspace(-5, 5, 100) + data_1D = lorentz(x) + 0.1 * (np.random.rand(100) - 0.5) + + # Smooth data + gauss_kernel = Gaussian1DKernel(2) + smoothed_data_gauss = convolve(data_1D, gauss_kernel) + box_kernel = Box1DKernel(5) + smoothed_data_box = convolve(data_1D, box_kernel) + + # Plot data and smoothed data + plt.plot(x, data_1D, label='Original') + plt.plot(x, smoothed_data_gauss, label='Smoothed with Gaussian1DKernel') + plt.plot(x, smoothed_data_box, label='Smoothed with Box1DKernel') + plt.xlabel('x [a.u.]') + plt.ylabel('amplitude [a.u.]') + plt.xlim(-5, 5) + plt.ylim(-0.1, 1.5) + plt.legend(prop={'size':12}) + plt.show() + + +Beside the ``astropy`` convolution functions +`~astropy.convolution.convolve` and +`~astropy.convolution.convolve_fft`, it is also possible to use +the kernels with ``numpy`` or ``scipy`` convolution by passing the ``array`` +attribute. This will be faster in most cases than the ``astropy`` convolution, +but will not work properly if NaN values are present in the data. + +>>> smoothed = np.convolve(data_1D, box_kernel.array) + +2D Kernels +---------- + +As all 2D kernels are symmetric, it is sufficient to specify the width in one +direction. Therefore the use of 2D kernels is basically the same as for 1D +kernels. Here we consider a small Gaussian-shaped source of amplitude 1 in the +middle of the image and add 10% noise: + +>>> import numpy as np +>>> from astropy.convolution import convolve, Gaussian2DKernel, Tophat2DKernel +>>> from astropy.modeling.models import Gaussian2D +>>> gauss = Gaussian2D(1, 0, 0, 3, 3) +>>> # Fake image data including noise +>>> x = np.arange(-100, 101) +>>> y = np.arange(-100, 101) +>>> x, y = np.meshgrid(x, y) +>>> data_2D = gauss(x, y) + 0.1 * (np.random.rand(201, 201) - 0.5) + +Smoothing the noisy data with a +:class:`~astropy.convolution.Gaussian2DKernel` with a standard +deviation of 2 pixels: + +>>> gauss_kernel = Gaussian2DKernel(2) +>>> smoothed_data_gauss = convolve(data_2D, gauss_kernel) + +Smoothing the noisy data with a +:class:`~astropy.convolution.Tophat2DKernel` of width 5 pixels: + +>>> tophat_kernel = Tophat2DKernel(5) +>>> smoothed_data_tophat = convolve(data_2D, tophat_kernel) + +This is what the original image looks like: + +.. plot:: + + import numpy as np + import matplotlib.pyplot as plt + from astropy.modeling.models import Gaussian2D + gauss = Gaussian2D(1, 0, 0, 2, 2) + # Fake image data including noise + x = np.arange(-100, 101) + y = np.arange(-100, 101) + x, y = np.meshgrid(x, y) + data_2D = gauss(x, y) + 0.1 * (np.random.rand(201, 201) - 0.5) + plt.imshow(data_2D, origin='lower') + plt.xlabel('x [pixels]') + plt.ylabel('y [pixels]') + plt.colorbar() + plt.show() + +The following plot illustrates the differences between several 2D kernels +applied to the simulated data. Note that it has a slightly different color +scale compared to the original image. + +.. plot:: + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.convolution import * + from astropy.modeling.models import Gaussian2D + + # Small Gaussian source in the middle of the image + gauss = Gaussian2D(1, 0, 0, 2, 2) + # Fake data including noise + x = np.arange(-100, 101) + y = np.arange(-100, 101) + x, y = np.meshgrid(x, y) + data_2D = gauss(x, y) + 0.1 * (np.random.rand(201, 201) - 0.5) + + # Setup kernels, including unity kernel for original image + # Choose normalization for linear scale space for MexicanHat + + kernels = [TrapezoidDisk2DKernel(11, slope=0.2), + Tophat2DKernel(11), + Gaussian2DKernel(11), + Box2DKernel(11), + 11 ** 2 * MexicanHat2DKernel(11), + AiryDisk2DKernel(11)] + + fig, axes = plt.subplots(nrows=2, ncols=3) + + # Plot kernels + for kernel, ax in zip(kernels, axes.flat): + smoothed = convolve(data_2D, kernel, normalize_kernel=False) + im = ax.imshow(smoothed, vmin=-0.01, vmax=0.08, origin='lower', + interpolation='None') + title = kernel.__class__.__name__ + ax.set_title(title, fontsize=12) + ax.set_yticklabels([]) + ax.set_xticklabels([]) + + cax = fig.add_axes([0.9, 0.1, 0.03, 0.8]) + fig.colorbar(im, cax=cax) + plt.subplots_adjust(left=0.05, right=0.85, top=0.95, bottom=0.05) + plt.show() + + +The Gaussian kernel has better smoothing properties compared to the Box and the +Top Hat. The Box filter is not isotropic and can produce artifacts (the source +appears rectangular). The Mexican Hat filter removes noise and slowly varying +structures (i.e., background), but produces a negative ring around the source. +The best choice for the filter strongly depends on the application. + + +Available Kernels +================= + +.. currentmodule:: astropy.convolution + +.. autosummary:: + + AiryDisk2DKernel + Box1DKernel + Box2DKernel + CustomKernel + Gaussian1DKernel + Gaussian2DKernel + MexicanHat1DKernel + MexicanHat2DKernel + Model1DKernel + Model2DKernel + Ring2DKernel + Tophat2DKernel + Trapezoid1DKernel + TrapezoidDisk2DKernel + +Kernel Arithmetics +================== + +Addition and Subtraction +------------------------ + +As convolution is a linear operation, kernels can be added or subtracted from +each other. They can also be multiplied with some number. One basic example +would be the definition of a Difference of Gaussian filter: + +>>> from astropy.convolution import Gaussian1DKernel +>>> gauss_1 = Gaussian1DKernel(10) +>>> gauss_2 = Gaussian1DKernel(16) +>>> DoG = gauss_2 - gauss_1 + +Another application is to convolve faked data with an instrument response +function model. For example, if the response function can be described by +the weighted sum of two Gaussians: + +>>> gauss_1 = Gaussian1DKernel(10) +>>> gauss_2 = Gaussian1DKernel(16) +>>> SoG = 4 * gauss_1 + gauss_2 + +Most times it will be necessary to normalize the resulting kernel by calling +explicitly: + +>>> SoG.normalize() + + +Convolution +----------- + +Furthermore, two kernels can be convolved with each other, which is useful when +data is filtered with two different kinds of kernels or to create a new, +special kernel: + +>>> import warnings +>>> from astropy.convolution import Gaussian1DKernel, convolve +>>> gauss_1 = Gaussian1DKernel(10) +>>> gauss_2 = Gaussian1DKernel(16) +>>> with warnings.catch_warnings(): +... warnings.simplefilter('ignore') # Ignore warning for doctest +... broad_gaussian = convolve(gauss_2, gauss_1) + +Or in case of multistage smoothing: + +>>> import numpy as np +>>> from astropy.modeling.models import Lorentz1D +>>> from astropy.convolution import convolve, Gaussian1DKernel, Box1DKernel +>>> lorentz = Lorentz1D(1, 0, 1) +>>> x = np.linspace(-5, 5, 100) +>>> data_1D = lorentz(x) + 0.1 * (np.random.rand(100) - 0.5) + +>>> gauss = Gaussian1DKernel(3) +>>> box = Box1DKernel(5) +>>> smoothed_gauss = convolve(data_1D, gauss) +>>> smoothed_gauss_box = convolve(smoothed_gauss, box) + +You would rather do the following: + +>>> gauss = Gaussian1DKernel(3) +>>> box = Box1DKernel(5) +>>> with warnings.catch_warnings(): +... warnings.simplefilter('ignore') # Ignore warning for doctest +... smoothed_gauss_box = convolve(data_1D, convolve(box, gauss)) + +Which, in most cases, will also be faster than the first method because only +one convolution with the often times larger data array will be necessary. + +Discretization +============== + +To obtain the kernel array for discrete convolution, the kernel's response +function is evaluated on a grid with +:func:`~astropy.convolution.discretize_model`. For the +discretization step the following modes are available: + +* Mode ``'center'`` (default) evaluates the response function on the grid by + taking the value at the center of the bin. + + >>> from astropy.convolution import Gaussian1DKernel + >>> gauss_center = Gaussian1DKernel(3, mode='center') + +* Mode ``'linear_interp'`` takes the values at the corners of the bin and + linearly interpolates the value at the center: + + >>> gauss_interp = Gaussian1DKernel(3, mode='linear_interp') + +* Mode ``'oversample'`` evaluates the response function by taking the mean on an + oversampled grid. The oversample factor can be specified with the ``factor`` + argument. If the oversample factor is too large, the evaluation becomes slow. + + >>> gauss_oversample = Gaussian1DKernel(3, mode='oversample', factor=10) + +* Mode ``'integrate'`` integrates the function over the pixel using + ``scipy.integrate.quad`` and ``scipy.integrate.dblquad``. This mode is very + slow and is only recommended when the highest accuracy is required. + +.. doctest-requires:: scipy + + >>> gauss_integrate = Gaussian1DKernel(3, mode='integrate') + +Especially in the range where the kernel width is in order of only a few pixels, +it can be advantageous to use the mode ``oversample`` or ``integrate`` to +conserve the integral on a subpixel scale. + + +Normalization +============= + +The kernel models are normalized per default (i.e., +:math:`\int_{-\infty}^{\infty} f(x) dx = 1`). But because of the limited kernel +array size, the normalization for kernels with an infinite response can differ +from one. The value of this deviation is stored in the kernel's ``truncation`` +attribute. + +The normalization can also differ from one, especially for small kernels, due +to the discretization step. This can be partly controlled by the ``mode`` +argument, when initializing the kernel. (See also +:func:`~astropy.convolution.discretize_model`.) Setting the +``mode`` to ``'oversample'`` allows us to conserve the normalization even on the +subpixel scale. + +The kernel arrays can be renormalized explicitly by calling either the +``normalize()`` method or by setting the ``normalize_kernel`` argument in the +:func:`~astropy.convolution.convolve` and +:func:`~astropy.convolution.convolve_fft` functions. The latter +method leaves the kernel itself unchanged but works with an internal normalized +version of the kernel. + +Note that for :class:`~astropy.convolution.MexicanHat1DKernel` +and :class:`~astropy.convolution.MexicanHat2DKernel` there is +:math:`\int_{-\infty}^{\infty} f(x) dx = 0`. To define a proper normalization, +both filters are derived from a normalized Gaussian function. diff --git a/testbed/astropy__astropy/docs/convolution/non_normalized_kernels.rst b/testbed/astropy__astropy/docs/convolution/non_normalized_kernels.rst new file mode 100644 index 0000000000000000000000000000000000000000..6f33695d5d573e8d77dae26c20b783ee22909450 --- /dev/null +++ b/testbed/astropy__astropy/docs/convolution/non_normalized_kernels.rst @@ -0,0 +1,105 @@ +************************************ +Convolving with Unnormalized Kernels +************************************ + +There are some tasks, such as source finding, where you want to apply a filter +with a kernel that is not normalized. + +For data that are well-behaved (contain no missing or infinite values), this +can be done in one step:: + + convolve(image, kernel) + +For example, we can try to run a commonly used peak enhancing kernel: + +.. plot:: + :context: reset + :include-source: + :align: center + + import numpy as np + import matplotlib.pyplot as plt + + from astropy.io import fits + from astropy.utils.data import get_pkg_data_filename + from astropy.convolution import CustomKernel + from scipy.signal import convolve as scipy_convolve + from astropy.convolution import convolve, convolve_fft + + + # Load the data from data.astropy.org + filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits') + hdu = fits.open(filename)[0] + + # Scale the file to have reasonable numbers + # (this is mostly so that colorbars don't have too many digits) + # Also, we crop it so you can see individual pixels + img = hdu.data[50:90, 60:100] * 1e5 + + kernel = CustomKernel([[-1,-1,-1], [-1, 8, -1], [-1,-1,-1]]) + + astropy_conv = convolve(img, kernel, normalize_kernel=False, nan_treatment='fill') + #astropy_conv_fft = convolve_fft(img, kernel, normalize_kernel=False, nan_treatment='fill') + + plt.figure(1, figsize=(12, 12)).clf() + ax1 = plt.subplot(1, 2, 1) + im = ax1.imshow(img, vmin=-6., vmax=5.e1, origin='lower', + interpolation='nearest', cmap='viridis') + + ax2 = plt.subplot(1, 2, 2) + im = ax2.imshow(astropy_conv, vmin=-6., vmax=5.e1, origin='lower', + interpolation='nearest', cmap='viridis') + +If you have an image with missing values (NaNs), you have to replace them with +real values first. Often, the best way to do this is to replace the NaN values +with interpolated values. In the example below, we use a Gaussian kernel +with a size similar to that of our peak-finding kernel to replace the bad data +before applying the peak-finding kernel. + +.. plot:: + :context: + :include-source: + :align: center + + from astropy.convolution import Gaussian2DKernel, interpolate_replace_nans + + # Select a random set of pixels that were affected by some sort of artifact + # and replaced with NaNs (e.g., cosmic-ray-affected pixels) + np.random.seed(42) + yinds, xinds = np.indices(img.shape) + img[np.random.choice(yinds.flat, 50), np.random.choice(xinds.flat, 50)] = np.nan + + # We smooth with a Gaussian kernel with x_stddev=1 (and y_stddev=1) + # It is a 9x9 array + kernel = Gaussian2DKernel(x_stddev=1) + + # interpolate away the NaNs + reconstructed_image = interpolate_replace_nans(img, kernel) + + + # apply peak-finding + kernel = CustomKernel([[-1,-1,-1], [-1, 8, -1], [-1,-1,-1]]) + + # Use the peak-finding kernel + # We have to turn off kernel normalization and set nan_treatment to "fill" + # here because `nan_treatment='interpolate'` is incompatible with non- + # normalized kernels + peaked_image = convolve(reconstructed_image, kernel, + normalize_kernel=False, + nan_treatment='fill') + + plt.figure(1, figsize=(12, 12)).clf() + ax1 = plt.subplot(1, 3, 1) + ax1.set_title("Image with missing data") + im = ax1.imshow(img, vmin=-6., vmax=5.e1, origin='lower', + interpolation='nearest', cmap='viridis') + + ax2 = plt.subplot(1, 3, 2) + ax2.set_title("Interpolated") + im = ax2.imshow(reconstructed_image, vmin=-6., vmax=5.e1, origin='lower', + interpolation='nearest', cmap='viridis') + + ax3 = plt.subplot(1, 3, 3) + ax3.set_title("Peak-Finding") + im = ax3.imshow(peaked_image, vmin=-6., vmax=5.e1, origin='lower', + interpolation='nearest', cmap='viridis') diff --git a/testbed/astropy__astropy/docs/convolution/performance.inc.rst b/testbed/astropy__astropy/docs/convolution/performance.inc.rst new file mode 100644 index 0000000000000000000000000000000000000000..53173f3aedd2de7bdc113b1657eeb400164b50e9 --- /dev/null +++ b/testbed/astropy__astropy/docs/convolution/performance.inc.rst @@ -0,0 +1,14 @@ +.. note that if this is changed from the default approach of using an *include* + (in index.rst) to a separate performance page, the header needs to be changed + from === to ***, the filename extension needs to be changed from .inc.rst to + .rst, and a link needs to be added in the sub-package toctree + +.. _astropy-convolution-performance: + +Performance Tips +================ + +The :func:`~astropy.convolution.convolve` function is best suited to small +kernels, and can become very slow for larger kernels. In this case, consider +using :func:`~astropy.convolution.convolve_fft` (though note that this function +uses more memory). diff --git a/testbed/astropy__astropy/docs/convolution/using.rst b/testbed/astropy__astropy/docs/convolution/using.rst new file mode 100644 index 0000000000000000000000000000000000000000..95cde4272fd297aabed3fba604b20cf1dfd76aeb --- /dev/null +++ b/testbed/astropy__astropy/docs/convolution/using.rst @@ -0,0 +1,94 @@ +Using the Convolution Functions +******************************* + +Overview +======== + +Two convolution functions are provided. They are imported as:: + + >>> from astropy.convolution import convolve, convolve_fft + +and are both used as:: + + >>> result = convolve(image, kernel) # doctest: +SKIP + >>> result = convolve_fft(image, kernel) # doctest: +SKIP + +:func:`~astropy.convolution.convolve` is implemented as a +direct convolution algorithm, while +:func:`~astropy.convolution.convolve_fft` uses a Fast Fourier +Transform (FFT). Thus, the former is better for small kernels, while the latter +is much more efficient for larger kernels. + +The input images and kernels should be lists or ``numpy`` arrays with either 1, +2, or 3 dimensions (and the number of dimensions should be the same for the +image and kernel). The result is a ``numpy`` array with the same dimensions as +the input image. The convolution is always done as floating point. + +The :func:`~astropy.convolution.convolve` function takes an +optional ``boundary=`` argument describing how to perform the convolution at +the edge of the array. The values for ``boundary`` can be: + +* ``None``: set the result values to zero where the kernel extends beyond the + edge of the array (default). + +* ``'fill'``: set values outside the array boundary to a constant. If this + option is specified, the constant should be specified using the + ``fill_value=`` argument, which defaults to zero. + +* ``'wrap'``: assume that the boundaries are periodic. + +* ``'extend'`` : set values outside the array to the nearest array value. + +By default, the kernel is not normalized. To normalize it prior to convolution, +use:: + + >>> result = convolve(image, kernel, normalize_kernel=True) # doctest: +SKIP + +Examples +======== + +Smooth a 1D array with a custom kernel and no boundary treatment:: + + >>> import numpy as np + >>> convolve([1, 4, 5, 6, 5, 7, 8], [0.2, 0.6, 0.2]) # doctest: +FLOAT_CMP + array([1.4, 3.6, 5. , 5.6, 5.6, 6.8, 6.2]) + +As above, but using the 'extend' algorithm for boundaries:: + + >>> convolve([1, 4, 5, 6, 5, 7, 8], [0.2, 0.6, 0.2], boundary='extend') # doctest: +FLOAT_CMP + array([1.6, 3.6, 5. , 5.6, 5.6, 6.8, 7.8]) + +If a NaN value is present in the original array, it will be +interpolated using the kernel:: + + >>> import numpy as np + >>> convolve([1, 4, 5, 6, np.nan, 7, 8], [0.2, 0.6, 0.2], boundary='extend') # doctest: +FLOAT_CMP + array([1.6 , 3.6 , 5. , 5.75, 6.5 , 7.25, 7.8 ]) + +Kernels and arrays can be specified either as lists or as ``numpy`` +arrays. The following examples show how to construct a 1D array as a +list:: + + >>> kernel = [0, 1, 0] + >>> result = convolve(spectrum, kernel) # doctest: +SKIP + +a 2D array as a list:: + + >>> kernel = [[0, 1, 0], + ... [1, 2, 1], + ... [0, 1, 0]] + >>> result = convolve(image, kernel) # doctest: +SKIP + +and a 3D array as a list:: + + >>> kernel = [[[0, 0, 0], [0, 2, 0], [0, 0, 0]], + ... [[0, 1, 0], [2, 3, 2], [0, 1, 0]], + ... [[0, 0, 0], [0, 2, 0], [0, 0, 0]]] + >>> result = convolve(cube, kernel) # doctest: +SKIP + +Kernels +======= + +The above examples use custom kernels, but `astropy.convolution` also +includes a number of built-in kernels, which are described in +:doc:`kernels`. diff --git a/testbed/astropy__astropy/docs/coordinates/angles.rst b/testbed/astropy__astropy/docs/coordinates/angles.rst new file mode 100644 index 0000000000000000000000000000000000000000..882d054d8758c5111367c83bbaed668d1ad284c5 --- /dev/null +++ b/testbed/astropy__astropy/docs/coordinates/angles.rst @@ -0,0 +1,167 @@ +.. include:: references.txt + +.. _working_with_angles: + +Working with Angles +******************* + +The angular components of the various coordinate objects are represented +by objects of the |Angle| class. While most likely to be encountered in +the context of coordinate objects, |Angle| objects can also be used on +their own wherever a representation of an angle is needed. + +.. _angle-creation: + +Creation +======== + +The creation of an |Angle| object is quite flexible and supports a wide +variety of input object types and formats. The type of the input angle(s) +can be array, scalar, tuple, string, `~astropy.units.Quantity` or another +|Angle|. This is best illustrated with a number of examples of valid ways +to create an |Angle|:: + + >>> import numpy as np + >>> from astropy import units as u + >>> from astropy.coordinates import Angle + + >>> Angle('10.2345d') # String with 'd' abbreviation for degrees # doctest: +FLOAT_CMP + + >>> Angle(['10.2345d', '-20d']) # Array of strings # doctest: +FLOAT_CMP + + >>> Angle('1:2:30.43 degrees') # Sexagesimal degrees # doctest: +FLOAT_CMP + + >>> Angle('1 2 0 hours') # Sexagesimal hours # doctest: +FLOAT_CMP + + >>> Angle(np.arange(1., 8.), unit=u.deg) # Numpy array from 1..7 in degrees # doctest: +FLOAT_CMP + + >>> Angle('1°2′3″') # Unicode degree, arcmin and arcsec symbols # doctest: +FLOAT_CMP + + >>> Angle('1d2m3.4s') # Degree, arcmin, arcsec. # doctest: +FLOAT_CMP + + >>> Angle('-1h2m3s') # Hour, minute, second # doctest: +FLOAT_CMP + + >>> Angle((-1, 2, 3), unit=u.deg) # (degree, arcmin, arcsec) # doctest: +FLOAT_CMP + + >>> Angle(10.2345 * u.deg) # From a Quantity object in degrees # doctest: +FLOAT_CMP + + >>> Angle(Angle(10.2345 * u.deg)) # From another Angle object # doctest: +FLOAT_CMP + + + +Representation +============== + +The |Angle| object also supports a variety of ways of representing the value +of the angle, both as a floating point number and as a string:: + + >>> a = Angle(1, u.radian) + >>> a # doctest: +FLOAT_CMP + + >>> a.radian + 1.0 + >>> a.degree # doctest: +FLOAT_CMP + 57.29577951308232 + >>> a.hour # doctest: +FLOAT_CMP + 3.8197186342054885 + >>> a.hms # doctest: +FLOAT_CMP + hms_tuple(h=3.0, m=49.0, s=10.987083139758766) + >>> a.dms # doctest: +FLOAT_CMP + dms_tuple(d=57.0, m=17.0, s=44.806247096362313) + >>> a.signed_dms # doctest: +FLOAT_CMP + signed_dms_tuple(sign=1.0, d=57.0, m=17.0, s=44.806247096362313) + >>> (-a).dms # doctest: +FLOAT_CMP + dms_tuple(d=-57.0, m=-17.0, s=-44.806247096362313) + >>> (-a).signed_dms # doctest: +FLOAT_CMP + signed_dms_tuple(sign=-1.0, d=57.0, m=17.0, s=44.806247096362313) + >>> a.arcminute # doctest: +FLOAT_CMP + 3437.7467707849396 + >>> a.to_string() + '1rad' + >>> a.to_string(unit=u.degree) + '57d17m44.8062s' + >>> a.to_string(unit=u.degree, sep=':') + '57:17:44.8062' + >>> a.to_string(unit=u.degree, sep=('deg', 'm', 's')) + '57deg17m44.8062s' + >>> a.to_string(unit=u.hour) + '3h49m10.9871s' + >>> a.to_string(unit=u.hour, decimal=True) + '3.81972' + + +Usage +===== + +Angles will also behave correctly for appropriate arithmetic operations:: + + >>> a = Angle(1.0, u.radian) + >>> a + 0.5 * u.radian + 2 * a # doctest: +FLOAT_CMP + + >>> np.sin(a / 2) # doctest: +FLOAT_CMP + + >>> a == a # doctest: +SKIP + array(True, dtype=bool) + >>> a == (a + a) # doctest: +SKIP + array(False, dtype=bool) + +|Angle| objects can also be used for creating coordinate objects:: + + >>> from astropy.coordinates import ICRS + >>> ICRS(Angle(1, u.deg), Angle(0.5, u.deg)) # doctest: +FLOAT_CMP + + + +Wrapping and Bounds +=================== + +There are two utility methods for working with angles that should have bounds. +The :meth:`~astropy.coordinates.Angle.wrap_at` method allows taking an angle or +angles and wrapping to be within a single 360 degree slice. The +:meth:`~astropy.coordinates.Angle.is_within_bounds` method returns a +boolean indicating whether an angle or angles is within the specified bounds. + + +Longitude and Latitude Objects +============================== + +|Longitude| and |Latitude| are two specialized subclasses of the |Angle| +class that are used for all of the spherical coordinate classes. +|Longitude| is used to represent values like right ascension, Galactic +longitude, and azimuth (for Equatorial, Galactic, and Alt-Az coordinates, +respectively). |Latitude| is used for declination, Galactic latitude, and +elevation. + +Longitude +--------- + +A |Longitude| object is distinguished from a pure |Angle| by virtue of a +``wrap_angle`` property. The ``wrap_angle`` specifies that all angle values +represented by the object will be in the range:: + + wrap_angle - 360 * u.deg <= angle(s) < wrap_angle + +The default ``wrap_angle`` is 360 deg. Setting ``'wrap_angle=180 * u.deg'`` +would instead result in values between -180 and +180 deg. Setting the +``wrap_angle`` attribute of an existing ``Longitude`` object will result in +re-wrapping the angle values in-place. For example:: + + >>> from astropy.coordinates import Longitude + >>> a = Longitude([-20, 150, 350, 360] * u.deg) + >>> a.degree # doctest: +FLOAT_CMP + array([340., 150., 350., 0.]) + >>> a.wrap_angle = 180 * u.deg + >>> a.degree # doctest: +FLOAT_CMP + array([-20., 150., -10., 0.]) + +Latitude +-------- + +A Latitude object is distinguished from a pure |Angle| by virtue +of being bounded so that:: + + -90.0 * u.deg <= angle(s) <= +90.0 * u.deg + +Any attempt to set a value outside of that range will result in a +`ValueError`. diff --git a/testbed/astropy__astropy/docs/coordinates/apply_space_motion.rst b/testbed/astropy__astropy/docs/coordinates/apply_space_motion.rst new file mode 100644 index 0000000000000000000000000000000000000000..b6aa15eacd6726f04f27cc71158c72c1502d8ae6 --- /dev/null +++ b/testbed/astropy__astropy/docs/coordinates/apply_space_motion.rst @@ -0,0 +1,170 @@ +.. include:: references.txt + +.. _astropy-coordinates-apply-space-motion: + +Accounting for Space Motion +*************************** + +The |SkyCoord| object supports updating the position of a source given its space +motion and a time at which to evaluate the new position (or a difference between the coordinate's current time and a new one). This is +done using the :meth:`~astropy.coordinates.SkyCoord.apply_space_motion` method. +As an example, first we'll create a |SkyCoord| object with a specified +``obstime``:: + + >>> import astropy.units as u + >>> from astropy.time import Time + >>> from astropy.coordinates import SkyCoord + >>> c = SkyCoord(l=10*u.degree, b=45*u.degree, distance=100*u.pc, + ... pm_l_cosb=34*u.mas/u.yr, pm_b=-117*u.mas/u.yr, + ... frame='galactic', + ... obstime=Time('1988-12-18 05:11:23.5')) + +We can now find the position at some other time, taking the space motion into +account. We can either specify the time difference between the observation time +and the desired time:: + + >>> c.apply_space_motion(dt=10. * u.year) # doctest: +FLOAT_CMP + + >>> c.apply_space_motion(dt=-10. * u.year) # doctest: +FLOAT_CMP + + +Or, we can specify the new time to evaluate the position at:: + + >>> c.apply_space_motion(new_obstime=Time('2017-12-18 01:12:07.3')) # doctest: +FLOAT_CMP + + +If the |SkyCoord| object has no specified radial velocity (RV), the RV is +assumed to be 0. The new position of the source is determined assuming the +source moves in a straight line with constant velocity in an inertial frame. +There are no plans to support more complex evolution (e.g., non-inertial +frames or more complex evolution), as that is out of scope for the ``astropy`` +core package (although it may well be in-scope for a variety of affiliated +packages). + +Example: Use velocity to compute sky position at different epochs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In this example, we'll use *Gaia* `TGAS +`_ astrometry for a nearby star to +compute the sky position of the source on the date that the 2MASS survey +observed that region of the sky. The TGAS astrometry is provided on the +reference epoch J2015.0, whereas the 2MASS survey occurred in the late 1990's. +For the star of interest, the proper motion is large enough that there are +appreciable differences in the sky position between the two surveys. + +After computing the previous position of the source, we'll then cross-match the +source with the 2MASS catalog to compute *Gaia*-2MASS colors for this object +source. + +.. note:: + + This example requires accessing data from the *Gaia* TGAS and 2MASS + catalogs. For convenience and speed below, we have created dictionary + objects that contain the data. We retrieved the data using the Astropy + affiliated package `astroquery `_ using + the following queries:: + + import astropy.coordinates as coord + import astropy.units as u + from astroquery.gaia import Gaia + from astroquery.vizier import Vizier + + job = Gaia.launch_job("SELECT TOP 1 * FROM gaiadr1.tgas_source \ + WHERE parallax_error < 0.3 AND parallax > 5 AND pmra > 100 \ + ORDER BY random_index") + result_tgas = job.get_results()[0] + + c_tgas = coord.SkyCoord(ra=result_tgas['ra'] * u.deg, + dec=result_tgas['dec'] * u.deg) + v = Vizier(columns=["**"], catalog="II/246/out") + result_2mass = v.query_region(c, radius=1*u.arcmin)['II/246/out'] + +The TGAS data from relevant columns for this source (see queries in Note +above):: + + >>> result_tgas = dict(ra=66.44280212823296, + ... dec=-69.99366255906372, + ... parallax=22.764078749733947, + ... pmra=144.91354358297048, + ... pmdec=5.445648092997134, + ... ref_epoch=2015.0, + ... phot_g_mean_mag=7.657174523348196) + +The 2MASS data for all sources within 1 arcminute around the above position +(see queries in Note above):: + + >>> result_2mass = dict(RAJ2000=[66.421970000000002, 66.433521999999996, + ... 66.420564999999996, 66.485068999999996, + ... 66.467928999999998, 66.440815000000001, + ... 66.440454000000003], + ... DEJ2000=[-70.003722999999994, -69.990768000000003, + ... -69.992255999999998, -69.994881000000007, + ... -69.994926000000007, -69.993613999999994, + ... -69.990836999999999], + ... Jmag=[16.35, 13.663, 16.171, 16.184, 16.292, + ... 6.6420002, 12.275], + ... Hmag=[15.879, 13.955, 15.154, 15.856, 15.642, + ... 6.3660002, 12.185], + ... Kmag=[15.581, 14.238, 14.622, 15.398, 15.123, + ... 6.2839999, 12.106], + ... Date=['1998-10-24', '1998-10-24', '1998-10-24', + ... '1998-10-24', '1998-10-24', '1998-10-24', + ... '1998-10-24']) + +We'll first create a |SkyCoord| object from the information provided in the TGAS +catalog. Note that we set the ``obstime`` of the object to the reference epoch +provided by the TGAS catalog (J2015.0):: + + >>> import astropy.units as u + >>> from astropy.coordinates import SkyCoord, Distance + >>> from astropy.time import Time + >>> c = SkyCoord(ra=result_tgas['ra'] * u.deg, + ... dec=result_tgas['dec'] * u.deg, + ... distance=Distance(parallax=result_tgas['parallax'] * u.mas), + ... pm_ra_cosdec=result_tgas['pmra'] * u.mas/u.yr, + ... pm_dec=result_tgas['pmdec'] * u.mas/u.yr, + ... obstime=Time(result_tgas['ref_epoch'], format='decimalyear')) + +We next create a |SkyCoord| object with the sky positions from the 2MASS +catalog, and an `~astropy.time.Time` object for the date of the 2MASS +observations provided in the 2MASS catalog (for the data in this region the +observation date is the same, so we take only the 0th value):: + + >>> catalog_2mass = SkyCoord(ra=result_2mass['RAJ2000'] * u.deg, + ... dec=result_2mass['DEJ2000'] * u.deg) + >>> epoch_2mass = Time(result_2mass['Date'][0]) + +We can now use the :meth:`~astropy.coordinates.SkyCoord.apply_space_motion` +method to compute the position of the TGAS source at another epoch. This uses +the proper motion and parallax information to evolve the position of the source +assuming straight-line motion:: + + >>> c_2mass_epoch = c.apply_space_motion(epoch_2mass) + +Now that we have the coordinates of the TGAS source at the 2MASS epoch, we can +do the cross-match (see also :ref:`astropy-coordinates-separations-matching`):: + + >>> idx, sep, _ = c_2mass_epoch.match_to_catalog_sky(catalog_2mass) # doctest: +SKIP + >>> sep[0].to_string() # doctest: +FLOAT_CMP +SKIP + '0d00m00.2818s' + >>> idx # doctest: +SKIP + array(5) + +The closest source it found is 0.2818 arcseconds away and corresponds to +row index 5 in the 2MASS catalog. We can then, for example, compute *Gaia*-2MASS +colors:: + + >>> G = result_tgas['phot_g_mean_mag'] + >>> J = result_2mass['Jmag'][idx] # doctest: +SKIP + >>> K = result_2mass['Kmag'][idx] # doctest: +SKIP + >>> G - J, G - K # doctest: +SKIP + (1.0151743233481962, 1.3731746233481958) diff --git a/testbed/astropy__astropy/docs/coordinates/definitions.rst b/testbed/astropy__astropy/docs/coordinates/definitions.rst new file mode 100644 index 0000000000000000000000000000000000000000..1c53fd16551a15f44736e8ca19d1e7ee373c097d --- /dev/null +++ b/testbed/astropy__astropy/docs/coordinates/definitions.rst @@ -0,0 +1,43 @@ +.. _astropy-coordinates-definitions: + +Important Definitions +********************* + +For reference, below, we define some key terms as they are used in +`~astropy.coordinates`, due to some ambiguities that exist in the +colloquial use of these terms. Chief among these terms is the concept +of a "coordinate system." To some members of the community, "coordinate +system" means the *representation* of a point in space (e.g., "Cartesian +coordinate system" is different from "Spherical polar coordinate +system"). Another use of "coordinate system" is to mean a unique +reference frame with a particular set of reference points (e.g., "the +ICRS coordinate system" or the "J2000 coordinate system"). This second +meaning is further complicated by the fact that such systems use quite +different ways of defining a frame. + +Because of the likelihood of confusion between these meanings of +"coordinate system," `~astropy.coordinates` avoids this term wherever +possible, and instead adopts the following terms (loosely inspired by +the IAU2000 resolutions on celestial coordinate systems): + +* A "Coordinate Representation" is a particular way of describing a unique + point in a vector space. (Here, this means three-dimensional space, but future + extensions might have different dimensionality, particularly if relativistic + effects are desired.) Examples include Cartesian coordinates, cylindrical + polar, or latitude/longitude spherical polar coordinates. Note that this term + applies to the positions, *not* their velocities or other derivatives (which + are represented as "differential" classes). + +* A "Reference System" is a scheme for orienting points in a space and + describing how they transforms to other systems. Examples include the ICRS, + equatorial coordinates with mean equinox, or the WGS84 geoid for + latitude/longitude on the Earth. + +* A "Coordinate Frame," "Reference Frame," or just "Frame" is a specific + realization of a reference system (e.g., the ICRF, or J2000 equatorial + coordinates). For some systems, there may be only one meaningful frame, while + others may have many different frames (differentiated by something like a + different equinox, or a different set of reference points). + +* A "Coordinate" is a combination of all of the above that specifies a unique + point. diff --git a/testbed/astropy__astropy/docs/coordinates/formatting.rst b/testbed/astropy__astropy/docs/coordinates/formatting.rst new file mode 100644 index 0000000000000000000000000000000000000000..82d440c0499a531a14978b88e295e7db055e74d1 --- /dev/null +++ b/testbed/astropy__astropy/docs/coordinates/formatting.rst @@ -0,0 +1,35 @@ +Formatting Coordinate Strings +***************************** + +.. todo: @taldcroft should change this to start with a discussion of SkyCoord's capabilities + +Getting a string representation of a coordinate is most powerfully +approached by treating the components (e.g., RA and Dec) separately. +For example:: + + >>> from astropy.coordinates import ICRS + >>> from astropy import units as u + >>> c = ICRS(187.70592*u.degree, 12.39112*u.degree) + >>> str(c.ra) + ' ' + str(c.dec) + '187d42m21.312s 12d23m28.032s' + +To get better control over the formatting, you can use the angles' +:meth:`~astropy.coordinates.Angle.to_string` method (see :doc:`angles` for +more). For example:: + + >>> rahmsstr = c.ra.to_string(u.hour) + >>> str(rahmsstr) + '12h30m49.4208s' + >>> decdmsstr = c.dec.to_string(u.degree, alwayssign=True) + >>> str(decdmsstr) + '+12d23m28.032s' + >>> rahmsstr + ' ' + decdmsstr + u'12h30m49.4208s +12d23m28.032s' + +You can also use Python's `format` string method to create more complex +string expressions, such as IAU-style coordinates or even full sentences:: + + >>> 'SDSS J{0}{1}'.format(c.ra.to_string(unit=u.hourangle, sep='', precision=2, pad=True), c.dec.to_string(sep='', precision=2, alwayssign=True, pad=True)) + 'SDSS J123049.42+122328.03' + >>> 'The galaxy M87, at an RA of {0.ra.hour:.2f} hours and Dec of {0.dec.deg:.1f} degrees, has an impressive jet.'.format(c) + 'The galaxy M87, at an RA of 12.51 hours and Dec of 12.4 degrees, has an impressive jet.' diff --git a/testbed/astropy__astropy/docs/coordinates/frames.rst b/testbed/astropy__astropy/docs/coordinates/frames.rst new file mode 100644 index 0000000000000000000000000000000000000000..60ff7bec28ae3a9ddf3c02bbfaa22828b80e1190 --- /dev/null +++ b/testbed/astropy__astropy/docs/coordinates/frames.rst @@ -0,0 +1,459 @@ +.. include:: references.txt + +.. We call EarthLocation.of_site here first to force the downloading +.. of sites.json so that future doctest output isn't cluttered with +.. "Downloading ... [done]". This can be removed once we have a better +.. way of ignoring output lines based on pattern-matching, e.g.: +.. https://github.com/astropy/pytest-doctestplus/issues/11 + +.. testsetup:: + >>> from astropy.coordinates import EarthLocation + >>> EarthLocation.of_site('greenwich') # doctest: +IGNORE_OUTPUT + +Using and Designing Coordinate Frames +************************************* + +In `astropy.coordinates`, as outlined in the +:ref:`astropy-coordinates-overview`, subclasses of |baseframe| ("frame +classes") define particular coordinate frames. They can (but do not +*have* to) contain representation objects storing the actual coordinate +data. The actual coordinate transformations are defined as functions +that transform representations between frame classes. This approach +serves to separate high-level user functionality (see :doc:`skycoord`) +and details of how the coordinates are actually stored (see +:doc:`representations`) from the definition of frames and how they are +transformed. + +Using Frame Objects +=================== + +Frames without Data +------------------- + +Frame objects have two distinct (but related) uses. The first is +storing the information needed to uniquely define a frame (e.g., +equinox, observation time). This information is stored on the frame +objects as (read-only) Python attributes, which are set when the object +is first created:: + + >>> from astropy.coordinates import ICRS, FK5 + >>> FK5(equinox='J1975') + + >>> ICRS() # has no attributes + + >>> FK5() # uses default equinox + + +The specific names of attributes available for a particular frame (and +their default values) are available as the class method +``get_frame_attr_names``:: + + >>> FK5.get_frame_attr_names() + OrderedDict([('equinox',